From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F22F1BDC1 for ; Wed, 4 Oct 2023 16:49:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70C4DC433C7; Wed, 4 Oct 2023 16:49:07 +0000 (UTC) Date: Wed, 4 Oct 2023 17:49:04 +0100 From: Catalin Marinas To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, nd@arm.com, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, dave.hansen@linux.intel.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v1 05/20] arm64: context switch POR_EL0 register Message-ID: References: <20230927140123.5283-1-joey.gouly@arm.com> <20230927140123.5283-6-joey.gouly@arm.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230927140123.5283-6-joey.gouly@arm.com> On Wed, Sep 27, 2023 at 03:01:08PM +0100, Joey Gouly wrote: > +static void permission_overlay_switch(struct task_struct *next) > +{ > + if (alternative_has_cap_unlikely(ARM64_HAS_S1POE)) { > + current->thread.por_el0 = read_sysreg_s(SYS_POR_EL0); > + write_sysreg_s(next->thread.por_el0, SYS_POR_EL0); > + } > +} Does this need an ISB or is the POR_EL0 register write self-synchronising? -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 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 A96B9E7C4E3 for ; Wed, 4 Oct 2023 16:49:43 +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-Transfer-Encoding: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-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vfatNu3i0RH9yIbD9yHDIes5ZVmE6iSORZ9InrJTKBE=; b=Y6PGYyBjPai16q kaSI6+9SlgkyzyDe7LWw6HsWDHfVQ8isL8gA23LasTe4EZ5NO7OTTO8rt3S6ziT0M+rtK2MzeYQaC YIFoNuI8tNedzhsgl870gwgWDOsu+hcu+dR8gqFMGaGiZjyiAh9zb9xZX8lPbSIvdB5pl1/oVNNNv pU9VYcUFqsiPGKmBoNtHtogB3th3hPfCf0/FLRSdvomgjQRdcorIeqWYaWtO+wgR+puIHQbCc9VIz 9o1/Xbv/6xa9GT09GmXXlYPrQQqGZCzLDth7KwN0YF9cfOnGeZEIUjc8TDftp5IKZckLKtdS6MqFO 0a6inZN0YJTvcEVDObGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qo53k-000WGK-0j; Wed, 04 Oct 2023 16:49:16 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qo53g-000WEN-1Z for linux-arm-kernel@lists.infradead.org; Wed, 04 Oct 2023 16:49:13 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 7F989B81F5F; Wed, 4 Oct 2023 16:49:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70C4DC433C7; Wed, 4 Oct 2023 16:49:07 +0000 (UTC) Date: Wed, 4 Oct 2023 17:49:04 +0100 From: Catalin Marinas To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, nd@arm.com, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, dave.hansen@linux.intel.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v1 05/20] arm64: context switch POR_EL0 register Message-ID: References: <20230927140123.5283-1-joey.gouly@arm.com> <20230927140123.5283-6-joey.gouly@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230927140123.5283-6-joey.gouly@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231004_094912_673522_875F29C1 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 27, 2023 at 03:01:08PM +0100, Joey Gouly wrote: > +static void permission_overlay_switch(struct task_struct *next) > +{ > + if (alternative_has_cap_unlikely(ARM64_HAS_S1POE)) { > + current->thread.por_el0 = read_sysreg_s(SYS_POR_EL0); > + write_sysreg_s(next->thread.por_el0, SYS_POR_EL0); > + } > +} Does this need an ISB or is the POR_EL0 register write self-synchronising? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel