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 AC59AC25B76 for ; Wed, 5 Jun 2024 16:12:01 +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=ovLeXpJA1xFM8CacYWNMPYAHpkIoRY3TyQMBo5E566Q=; b=pmuXZqBuOemSkI ih0i8af6/bqPhyiyHBYrtBqbjsdnA04KThGPmBdTz6r7HjcBTmQw14YJgptH7oEXf6zbp7ubfM9F5 ReC0fpWZUze8zwAHEfYZRIsfyrXZydo+YM1EtDhqrTTbsjMIxIOWadr16eCaFCu/Wze04sA1uc+5K KopiO0eXVjDbX7VoPXm61x4/XaqqSsWMrdM34yZpeRdnsI+YADHgceCarQdGKhG13IgvIk7Z12LdC HzstHVQ41B+otEiB6xjiWf/LWx5RPDqPwzHnvfYick2R/1YoXQ9p7LblGemjviRB+80U2A8Mmmzf+ VkfQ5IH0KQvsGg2MLGHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEtEp-00000006nQL-2sFM; Wed, 05 Jun 2024 16:11:47 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEtEm-00000006nPl-3yFA for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2024 16:11:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 22AE7CE1844; Wed, 5 Jun 2024 16:11:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7550C2BD11; Wed, 5 Jun 2024 16:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717603902; bh=simTZ+nEbAiDmV4Z9GCTmA+TawwRkQwEDt4QYzfCKwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d9cXwPAAA5mgiKYXiSVaJKv8htQWMAmJEk1PP14iYT4l4cV6B9LVnghU1IIE9fUXt hSBiqXOmy94oqiaQ+NRgQHtrPsnars5Jr0oTNA3Wh8BMok/38X01QFUVHh83hIhJS8 OKFZ59BM8q4j67oC8xGNZgTSrFP4wtkVnMkKv3+lAL2cS30e5FYSIXhhDqsZl2Ix7w ZsymXVoinJcv0qADpNXqkIxGByKe22c6OUqzhUXwME5/5BzdGNXpenID0SBUOaVuid 9KlqlcbpAaiWfL4YCn87Vx8FEZ/LD2ceQ8K5F27sdkOXhPejw+uzGaQwDlsvPyJktE 70doRkqkl8Pnw== Date: Wed, 5 Jun 2024 17:11:37 +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 v4 10/13] KVM: arm64: nVHE: Support CONFIG_CFI_CLANG at EL2 Message-ID: <20240605161137.GC22199@willie-the-truck> References: <20240529121251.1993135-1-ptosi@google.com> <20240529121251.1993135-11-ptosi@google.com> <20240603144530.GK19151@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-20240605_091145_371170_D9ECEDEA X-CRM114-Status: GOOD ( 23.53 ) 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 Tue, Jun 04, 2024 at 05:04:40PM +0100, Pierre-Cl=E9ment Tosi wrote: > On Mon, Jun 03, 2024 at 03:45:30PM +0100, Will Deacon wrote: > > On Wed, May 29, 2024 at 01:12:16PM +0100, Pierre-Cl=E9ment Tosi wrote: > > > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S b/arch/arm64/kvm/hyp/= nvhe/hyp-init.S > > > index d859c4de06b6..b1c8977e2812 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 > > > @@ -267,8 +268,11 @@ SYM_CODE_END(__kvm_handle_stub_hvc) > > > = > > > /* > > > * void __pkvm_init_switch_pgd(phys_addr_t pgd, void *sp, void (*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) > > > /* Turn the MMU off */ > > > pre_disable_mmu_workaround > > > mrs x9, sctlr_el2 > > = > > I still think this last hunk should be merged with the earlier patch > > fixing up the prototype of __pkvm_init_switch_pgd(). > = > Unfortunately, this is not possible because > = > SYM_TYPED_FUNC_START(__pkvm_init_switch_pgd) > = > makes the assembler generate an unresolved symbol for the function type, = which > the compiler only generates (from the C declaration) if it compiles with = kCFI so > that moving this hunk to an earlier patch results in a linker error: > = > ld.lld: error: undefined symbol: __kvm_nvhe___kcfi_typeid___pkvm_init_s= witch_pgd > = > OTOH, moving it to a later patch triggers a kCFI (runtime) panic. > = > As a result, this hunk *must* be part of this patch. Argh, thanks for the explanation. I thought CONFIG_CFI_CLANG would save us here, but that's already enabled for the rest of the kernel so now I understand what you mean. > > With that: > > = > > Acked-by: Will Deacon > = > As I haven't followed your suggestion, I'll ignore this. You can keep the Ack. Cheers, Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel