All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "tglx@linutronix.de" <tglx@linutronix.de>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"samitolvanen@google.com" <samitolvanen@google.com>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH] x86/virt/tdx: Add ENDBR for low level SEAMCALL assembly functions
Date: Wed, 4 Jun 2025 23:57:06 +0000	[thread overview]
Message-ID: <9a3f20181244d6cd4eaac6db1d16c2afd555b2f2.camel@intel.com> (raw)
In-Reply-To: <5ebc8a6497b7dd7029fd45e7516228e65eceb6ab.camel@intel.com>

On Wed, 2025-06-04 at 23:27 +0000, Huang, Kai wrote:
> On Wed, 2025-06-04 at 16:23 -0700, Dave Hansen wrote:
> > On 6/4/25 16:16, Huang, Kai wrote:
> > > Could you also let me know whether I should keep the Fixes tag, and the
> > > history in the changelog?
> > 
> > Yeah, I think you should keep the Fixes: tag, unless I'm missing something.
> > 
> > As for the history lesson, you can just say that you think that the TDX
> > code was OK when merged, but wasn't converted with the rest of the
> > Fixes: commit. That's all you need.
> 
> Will do.  Thanks for quick feedback.

After second thought, I think I was wrong about the target commit to Fixes,
because at that time I didn't consider CFI on CLANG.

When TDX code was merged, the SYM_FUNC_START() and SYM_TYPED_FUNC_START()
were already like this:

/* SYM_TYPED_FUNC_START -- use for indirectly called globals, w/ CFI type */
#define SYM_TYPED_FUNC_START(name)                              \
        SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_F_ALIGN)        \
        ENDBR

/* SYM_FUNC_START -- use for global functions */
#define SYM_FUNC_START(name)                            \
        SYM_START(name, SYM_L_GLOBAL, SYM_F_ALIGN)      \
        ENDBR

So the TDX code was supposed to use SYM_TYPED_FUNC_START() at the first
place when sc_retry() logic was introduced in commit

  1e66a7e27539 ("x86/virt/tdx: Handle SEAMCALL no entropy error in common
code")

Note, the seamcall*() assembly was introduced at an earlier commit

  c33621b4c5ad ("x86/virt/tdx: Wire up basic SEAMCALL functions")

But arguably that commit didn't know SEAMCALL helpers could be called
indirectly.

So, thanks for bringing up the CFI.

And if you don't have further comments, I think I will add below as Fixes
commit w/o mentioning history in the changelog.

Fixes: 1e66a7e27539 ("x86/virt/tdx: Handle SEAMCALL no entropy error in
common code")

  reply	other threads:[~2025-06-04 23:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04  0:38 [PATCH] x86/virt/tdx: Add ENDBR for low level SEAMCALL assembly functions Kai Huang
2025-06-04 19:46 ` Dave Hansen
2025-06-04 23:16   ` Huang, Kai
2025-06-04 23:23     ` Dave Hansen
2025-06-04 23:27       ` Huang, Kai
2025-06-04 23:57         ` Huang, Kai [this message]
2025-06-05 13:12   ` Huang, Kai
2025-06-05 13:10 ` [PATCH v2] x86/virt/tdx: Annotate TDX assembly to allow indirect calls Kai Huang
2025-06-05 14:07 ` [PATCH] x86/virt/tdx: Add ENDBR for low level SEAMCALL assembly functions Peter Zijlstra
2025-06-05 14:21   ` Peter Zijlstra
2025-06-05 14:54     ` Dave Hansen
2025-06-05 14:59       ` Peter Zijlstra
2025-06-05 23:20         ` Huang, Kai
2025-06-05 23:23           ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a3f20181244d6cd4eaac6db1d16c2afd555b2f2.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=samitolvanen@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.