Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82092C433EF for ; Mon, 7 Mar 2022 19:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RSJcfKLL7d7U++05rZ739XGqcyj5OL/MHa0c+KxFHi4=; b=gbEJdXgXhi+ikd/1j2mD4hpHJo h2e06CBRBTGaq09F9kyzDflLQflYKDTHOouljt2JYLz8YpfRl1WJQJ++GfdChMPbNUiNW+CiZMpev gjX489Hj4iXKlHMYgrerjBZ3ujtHb+bwGSnVQzK/p58Doe4KiGGrP8roSdBsZIyrvSe+fDX7gd6iB qwgBGEOsD163g6gG1EbS/+zpAewtZleq+vbB7RvEsINuTm4t4DfszsNmbfDOjQTJOKc+YhBNZpWEq 4v1AXtTgo3QC8+2CONARwOrOZLG9C+PLiNxvZHXG4z9KpCr4O12ePAkSfs4ycNc+HLD7WlrRaj3Zi 0cQnIvMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRIky-001Kit-Qa; Mon, 07 Mar 2022 19:10:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRIkv-001KiN-GZ for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 19:10:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 182A06145C; Mon, 7 Mar 2022 19:10:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBA10C340EF; Mon, 7 Mar 2022 19:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646680252; bh=27XqYPXuWovbdd2DHijCUsgZSW6SKZuaE/p8V/GHa3I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s9WzWr0xdu12P3IPGfA30Musuu2nkSmpbg7fzo74PKzA/IJXszylVNKw3aZNybhLL /Uuk/m8qvMyOO+a6/L3O7TJukGzngaq0SfaJp1UUkqQ69/7+v9Vh0PmAsxtGfNIEpT y4hcvwW6Nx0nWsWlE941XGh1GTZqGuxalDS9OLBTgf7FkFARzb/CnVaI6K/4DCsyjJ TuJWqoMPAMo8r2GL85yapeX6yn8yXzustO6SXM2AD6puQ30uaHxPoG/6njCoj3F7z3 3dwVJx5GO48LWsTbWKuhCGpsQl8IL2zkWIV8UniUlZ3uy28+1N7uao193jpcjlX/cA 8W2kHILAPw67A== Date: Mon, 7 Mar 2022 19:10:44 +0000 From: Mark Brown To: Catalin Marinas Cc: Peter Collingbourne , Szabolcs Nagy , Evgenii Stepanov , Will Deacon , Joey Gouly , Branislav Rankov , Linux ARM Subject: Re: [PATCH v1 4/4] arm64/mte: Add userspace interface for enabling asymmetric mode Message-ID: References: <20220127195712.748150-5-broonie@kernel.org> MIME-Version: 1.0 In-Reply-To: X-Cookie: Whatever became of eternal truth? X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_111053_650655_14620788 X-CRM114-Status: GOOD ( 30.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6999958009198624864==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6999958009198624864== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GsGxLb1YXZ4Bi4Tk" Content-Disposition: inline --GsGxLb1YXZ4Bi4Tk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 07, 2022 at 03:36:52PM +0000, Catalin Marinas wrote: > On Fri, Mar 04, 2022 at 01:09:00PM -0800, Peter Collingbourne wrote: > > And an attempt to guess the user intent from which > > bits are set seems prone to failure and unnecessarily restrictive. >=20 > Only allowing asymmetric mode if both symmetric and async are supported > is not that confusing. The only downside is that one cannot ask for > asymmetric mode only but is this such a big problem? For testing one can > always set the sysfs preferred mode to asymm. It will be some time > before we see asymm in production. People like to do things like run their testsuites in containers and generally not as root which is a problem for any interface that relies on fiddling with the system settings. It's something people can work around but it's not great. Another option here would be to just not expose asymmetric mode directly via the pcrtl() at all and just allow it if it's supported and both sync and async are enabled. Userspace ought to be able to tolerate this since the preferred mode may vary depending on which CPU the task gets scheduled on so the application may get a mix of modes if it's requested both and it won't be able to worry about requesting async mode since the option simply isn't there meaning it's less likely to get specific coverage in application testsuites. > > The only downside that I've seen mentioned is that we will end up > > issuing more syscalls on process startup which could harm performance. > I don't think that's the only downside. It's an ABI change as well > w.r.t. getting the current TCF setting and asymm being invisible to an > unaware app. The only way out I see is to make asymm a kernel choice > when both sync and async are selected (potentially with another bit to > opt it but without changing the TCF mask). It's not the most lovely API but given that we're faced with choices of what to break or bodge another kludge would be to require that a second bit be set when enabling asymmetric mode with that bit reading as zero. That would break old code doing a save/restore flow though so while it helps the original problem I don't know that it's actually doing much overall. I think this just comes down to a question of where we end up causing problems. --GsGxLb1YXZ4Bi4Tk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmImWLMACgkQJNaLcl1U h9CVCAf/THsfOy1EcfvVV6zUngep39v/9oqgVtFpIJIrtd5llxLA734kxs5Np6Y8 D/YmvdC6SuqORZKEbwJcGGXeGv8UR5I0++Bh+Opm0tRF8pk9sEETRq5hwjMNz4Y3 xdLSx9BRUnJRN8FKQMesd0hiZQs5WCeCPXnRllk2WmWzfEdaAaX55F/wotiHGANc jfPXQR/xKw2LxHvCZSc4JgIpchLdD/JPeb4kksMGcQUtDXG1clZHs0GjypyeSgCL tF1/fxWcnCs0H2zbnJEDQC840Mld/kEeiMPaqe8b4hbGYMy+MWObNqy4bCzOOhQa evLDRuyS9WhiKJcS9mTjpblRH2zrGA== =VzOO -----END PGP SIGNATURE----- --GsGxLb1YXZ4Bi4Tk-- --===============6999958009198624864== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6999958009198624864==--