[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9e6e0c1e99c00022c96d2832c7c4e6342dd39c2.camel@intel.com>
Date: Thu, 5 Jun 2025 13:12:39 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "tglx@...utronix.de" <tglx@...utronix.de>, "peterz@...radead.org"
<peterz@...radead.org>, "mingo@...hat.com" <mingo@...hat.com>, "Hansen, Dave"
<dave.hansen@...el.com>, "kirill.shutemov@...ux.intel.com"
<kirill.shutemov@...ux.intel.com>, "bp@...en8.de" <bp@...en8.de>,
"hpa@...or.com" <hpa@...or.com>
CC: "samitolvanen@...gle.com" <samitolvanen@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Edgecombe,
Rick P" <rick.p.edgecombe@...el.com>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH] x86/virt/tdx: Add ENDBR for low level SEAMCALL assembly
functions
On Wed, 2025-06-04 at 12:46 -0700, Dave Hansen wrote:
> Circling back around now that I've divined out what is happening here...
> Is this even really about ENDBR at all? I thought that clang has some
> CFI checking that's completely independent from CET/IBT and thus ENDBR.
> Wouldn't this also break with that?
Hi Dave,
With your reminder on clang and CFI, I did more test on this patch, and
unfortunately I found building with clang and CONFIG_CFI_CLANG=y generates
below build error:
ld.lld: error: undefined symbol: __kcfi_typeid___seamcall_saved_ret
>>> referenced by usercopy_64.c
>>> vmlinux.o:(__cfi___seamcall_saved_ret)
It is because currently __seaamcall_saved_ret() is only called and is
directly called by tdh_vp_enter(), but not via sc_retry().
Making tdh_vp_enter() call __seamcall_saved_ret() via sc_retry() fixes
the error, but I am not sure it's a good idea since tdh_vp_enter() is in
performance critical path (although the additional cost of sc_retry() is
minor comparing to the SEAMCALL itself).
I think we can keep using SYM_FUNC_START for __seamcall_saved_ret() but only
change to using SYM_TYPED_FUNC_START for the other two.
I've sent out v2 based on above by replying to this v1 patch. Appreciate if
you can review. Thanks for your time.
Powered by blists - more mailing lists