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 671E2C25B75 for ; Mon, 3 Jun 2024 13:09:51 +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=THmm6RW4LAzXEnSJ41J1obuue7Zu/dZ/ZrAzA6eH1G4=; b=IKt4uz2CSwnqX0 SW1EI+FC4N+9fUo5VtFIZiI2Sl+E9zoEnhOPJpwCZ+Lyk4tKuuiHw/SeahOlDmO1gZxB3XFmsjpjS qMGaMoDyGdt75jFXalaGbiPMUboUaXiCeYgd7EQPx1RtK0j9uKlXAaWGBkTdshO/4z+sEoDWvgIRF fijDdii3RyYL5XY1USTzJd4snkpfKTcRWiff7IDA6V5Ue11f80JK2hvbYG04HUveoXhFzE3ucAqz8 8Z9R8RFyTKkjfhPxQc+KKGE3i1fCdkXte7dEAKEHCIwCGZc+ZuUm99MjN+v0ZPJreD0+9T29Ds9LK 1w5Pzv5OmHXnDxfwPrCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE7RT-0000000Gqny-1UDU; Mon, 03 Jun 2024 13:09:39 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE7RR-0000000Gqmh-19AV for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2024 13:09:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4661960E07; Mon, 3 Jun 2024 13:09:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F22DC4AF08; Mon, 3 Jun 2024 13:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717420176; bh=M6NNbvARU58EuIkUnk8E/IjEk94rEU/YtoMJAvIC6HU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XtpDO4fx8Anann6Kih5ARIt9RM+wreHgndBkOE+u4rFnUKgi7GwAXETV9RZhCiieR RVUxi4ICcoTzRWP1oz0KVVYm4euYtw2IPYTJ0Skbhuucm51V3PyvqAV3eZ6+9J4nHs uF1kvsdnZ0lTI2FpfGH+OiYU0ubjZmZnGroR/7/ayidDJMHg81idzdSKKDz+7zstvg FQhk1o1V3uqFWvxAwgoebnjhBxxhbQ2OY8wvQJmF96OxZ9yJ/VajnerWjHACCJG1dn mX1OGFT30ozSdazn6YVtC9m+KGiFiOS3/dHGQoME9vlw6hd6mxe8bB0+MsDE3wNFRk Lx48RKrJGzy2w== Date: Mon, 3 Jun 2024 14:09:31 +0100 From: Will Deacon To: =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Oliver Upton , Suzuki K Poulose , Vincent Donnefort Subject: Re: [PATCH v3 10/12] KVM: arm64: nVHE: Support CONFIG_CFI_CLANG at EL2 Message-ID: <20240603130930.GA18991@willie-the-truck> References: <20240510112645.3625702-1-ptosi@google.com> <20240510112645.3625702-11-ptosi@google.com> <20240513173005.GB29051@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240603_060937_474171_25182902 X-CRM114-Status: GOOD ( 23.24 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 29, 2024 at 01:30:15PM +0100, Pierre-Cl=E9ment Tosi wrote: > On Mon, May 13, 2024 at 06:30:05PM +0100, Will Deacon wrote: > > On Fri, May 10, 2024 at 12:26:39PM +0100, Pierre-Cl=E9ment Tosi wrote: > > > [...] > > > = > > > Use SYM_TYPED_FUNC_START() for __pkvm_init_switch_pgd, as nVHE can't > > > call it directly and must use a PA function pointer from C (because it > > > is part of the idmap page), which would trigger a kCFI failure if the > > > type ID wasn't present. > > > = > > > Signed-off-by: Pierre-Cl=E9ment Tosi > > > --- > > > arch/arm64/include/asm/esr.h | 6 ++++++ > > > arch/arm64/kvm/handle_exit.c | 11 +++++++++++ > > > arch/arm64/kvm/hyp/nvhe/Makefile | 6 +++--- > > > arch/arm64/kvm/hyp/nvhe/hyp-init.S | 6 +++++- > > > 4 files changed, 25 insertions(+), 4 deletions(-) > > > = > > > [...] > > > = > > > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S b/arch/arm64/kvm/hyp/= nvhe/hyp-init.S > > > index 5a15737b4233..33fb5732ab83 100644 > > > --- a/arch/arm64/kvm/hyp/nvhe/hyp-init.S > > > +++ b/arch/arm64/kvm/hyp/nvhe/hyp-init.S > > > @@ -5,6 +5,7 @@ > > > */ > > > = > > > #include > > > +#include > > > #include > > > = > > > #include > > > @@ -268,8 +269,11 @@ SYM_CODE_END(__kvm_handle_stub_hvc) > > > /* > > > * void __pkvm_init_switch_pgd(struct kvm_nvhe_init_params *params, > > > * void (*finalize_fn)(void)); > > > + * > > > + * SYM_TYPED_FUNC_START() allows C to call this ID-mapped function i= ndirectly > > > + * using a physical pointer without triggering a kCFI failure. > > > */ > > > -SYM_FUNC_START(__pkvm_init_switch_pgd) > > > +SYM_TYPED_FUNC_START(__pkvm_init_switch_pgd) > > > /* Load the inputs from the VA pointer before turning the MMU off */ > > > ldr x5, [x0, #NVHE_INIT_PGD_PA] > > > ldr x0, [x0, #NVHE_INIT_STACK_HYP_VA] > > = > > Unrelated hunk? > = > No, this is needed to prevent a kCFI failure at EL2. > = > Please let me know if the comment and commit message aren't clear enough. I'm not disputing that this hunk is needed, but I think it should be in place before the patch enabling CFI. For example, by merging it in with patch 2? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel