From: "Huang, Kai" <kai.huang@intel.com>
To: "peterz@infradead.org" <peterz@infradead.org>
Cc: "Hansen, Dave" <dave.hansen@intel.com>, "Christopherson,,
Sean" <seanjc@google.com>, "bp@alien8.de" <bp@alien8.de>,
"x86@kernel.org" <x86@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"Yamahata, Isaku" <isaku.yamahata@intel.com>,
"n.borisov.lkml@gmail.com" <n.borisov.lkml@gmail.com>,
"sathyanarayanan.kuppuswamy@linux.intel.com"
<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: Re: [PATCH v2 07/11] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL
Date: Fri, 21 Jul 2023 11:06:47 +0000 [thread overview]
Message-ID: <3d86a1742c1d673ba4e006e6deca4a0018306edb.camel@intel.com> (raw)
In-Reply-To: <20230721080155.GB3630545@hirez.programming.kicks-ass.net>
On Fri, 2023-07-21 at 10:01 +0200, Peter Zijlstra wrote:
> On Fri, Jul 21, 2023 at 05:19:30AM +0000, Huang, Kai wrote:
>
> > Sorry I got a build regression from lkp:
> >
> > vmlinux.o: warning: objtool: __halt+0x3a: call to __tdx_hypercall() leaves
> > .noinstr.text section
>
> Clearly you should enable CONFIG_DEBUG_ENTRY in your own development
> .config ;-)
Ah thanks a lot!
I've been investigating how to reproduce at my own environment this afternoon!
LKP people are not aware of what triggered this check either. I'll pass to
them.
>
> > The reason is __halt() is annotated with "__cpuidle", but it calls
> > __tdx_hypercall(), which is now a normal C function, w/o
> > instrumentation_begin()/end().
> >
> > I think we can annotate __tdx_hypercall() as 'noinstr' too and keep
> > __tdx_hypercall_failed() unchanged. Anyway in the upstream code,
> > __tdx_hypercall() is in '.noinstr.text'.
> >
> > diff --git a/arch/x86/coco/tdx/tdx-shared.c b/arch/x86/coco/tdx/tdx-shared.c
> > index 13139ee171c8..b47c8cce91b0 100644
> > --- a/arch/x86/coco/tdx/tdx-shared.c
> > +++ b/arch/x86/coco/tdx/tdx-shared.c
> > @@ -70,7 +70,7 @@ bool tdx_accept_memory(phys_addr_t start, phys_addr_t end)
> > return true;
> > }
> >
> > -u64 __tdx_hypercall(struct tdx_hypercall_args *args)
> > +noinstr u64 __tdx_hypercall(struct tdx_hypercall_args *args)
> > {
> > struct tdx_module_args margs = {
> > .rcx = TDVMCALL_EXPOSE_REGS_MASK,
> > diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
> > index aba58484ba10..f10b0e512a36 100644
> > --- a/arch/x86/coco/tdx/tdx.c
> > +++ b/arch/x86/coco/tdx/tdx.c
> > @@ -37,8 +37,9 @@
> >
> > #define TDREPORT_SUBTYPE_0 0
> >
> > -void __tdx_hypercall_failed(void)
> > +noinstr void __tdx_hypercall_failed(void)
> > {
> > + instrumentation_begin();
> > panic("TDVMCALL failed. TDX module bug?");
> > }
> >
> >
> > We can fold this to this patch.
> >
> > Do you have any comments?
>
> Yes this is fine, we violate noinstr for WARN etc.. There's no point
> being pendantic about these things if we're going to take the machine
> down anyway.
Thanks. I'll fold above to this patch and sent out a v3 (given that it seems
you also want a patch to adjust the layout of 'struct tdx_module_args' for
TDH.VP.ENTER).
next prev parent reply other threads:[~2023-07-21 11:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 12:28 [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly Kai Huang
2023-07-20 12:28 ` [PATCH v2 01/11] x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro Kai Huang
2023-07-20 12:28 ` [PATCH v2 02/11] x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid Kai Huang
2023-07-20 12:28 ` [PATCH v2 03/11] x86/tdx: Make macros of TDCALLs consistent with the spec Kai Huang
2023-07-20 12:28 ` [PATCH v2 04/11] x86/tdx: Rename __tdx_module_call() to __tdcall() Kai Huang
2023-07-20 12:28 ` [PATCH v2 05/11] x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure Kai Huang
2023-07-20 12:28 ` [PATCH v2 06/11] x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs Kai Huang
2023-07-20 12:28 ` [PATCH v2 07/11] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL Kai Huang
2023-07-21 5:19 ` Huang, Kai
2023-07-21 8:01 ` Peter Zijlstra
2023-07-21 11:06 ` Huang, Kai [this message]
2023-07-20 12:28 ` [PATCH v2 08/11] x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm Kai Huang
2023-07-20 12:28 ` [PATCH v2 09/11] x86/tdx: Remove 'struct tdx_hypercall_args' Kai Huang
2023-07-20 12:28 ` [PATCH v2 10/11] x86/virt/tdx: Wire up basic SEAMCALL functions Kai Huang
2023-07-20 12:28 ` [PATCH v2 11/11] x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP Kai Huang
2023-07-20 13:16 ` [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly Peter Zijlstra
2023-07-21 0:18 ` Huang, Kai
2023-07-21 8:06 ` Peter Zijlstra
2023-07-21 11:02 ` Huang, Kai
2023-07-21 11:44 ` Huang, Kai
2023-07-21 12:04 ` Huang, Kai
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=3d86a1742c1d673ba4e006e6deca4a0018306edb.camel@intel.com \
--to=kai.huang@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=isaku.yamahata@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=n.borisov.lkml@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=seanjc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome