mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "kas@kernel.org" <kas@kernel.org>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
	"rdunlap@infradead.org" <rdunlap@infradead.org>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs
Date: Fri, 2 Oct 2026 19:31:00 +0000	[thread overview]
Message-ID: <dfe6e3aa7bd37679d2d5e559b9af8e254d88044f.camel@intel.com> (raw)
In-Reply-To: <ar_GLgzxdWUdXn0Z@thinkstation>

On Fri, 2026-10-02 at 15:59 +0100, Kiryl Shutsemau wrote:
> 
> 
> ANNOTATE_NOENDBR_SYM() is a top-level asm() that references the symbol.
> Once the compiler drops the wrapper, the annotation points at an
> undefined symbol and objtool flags it.
> 
> __used makes it go away by keeping the dead wrappers in every non-TDX
> kernel, which is the opposite of what dropping the #ifdefs was for.
> 
> Drop the wrappers instead.
> 
> Let tdx.c provide the accessors with the serial_in/serial_out signature,
> __noendbr and annotated there, and declare them outside the #ifdef. No
> stubs are needed: the only reference is under cpu_feature_enabled(),
> which folds to zero without CONFIG_INTEL_TDX_GUEST.
> 
> Builds with TDX on and off.

Hi Kiryl,

Thanks - that makes sense and the patch looks good. I think the
prototype declarations in asm/tdx.h (see below) also need __noendbr
annotations?


<snip>

> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
> index 325dd7c5929f..0bbabcf0791e 100644
> --- a/arch/x86/include/asm/tdx.h
> +++ b/arch/x86/include/asm/tdx.h
> @@ -83,9 +83,6 @@ int tdx_mcall_extend_rtmr(u8 index, u8 *data);
>  
>  u64 tdx_hcall_get_quote(u8 *buf, size_t size);
>  
> -u8 tdx_inb(u16 port);
> -void tdx_outb(u8 value, u16 port);
> -
>  void __init tdx_dump_attributes(u64 td_attr);
>  void __init tdx_dump_td_ctls(u64 td_ctls);
>  
> @@ -98,6 +95,10 @@ static inline bool tdx_early_handle_ve(struct pt_regs *regs) { return false; }
>  
>  #endif /* CONFIG_INTEL_TDX_GUEST */
>  
> +/* Only referenced when X86_FEATURE_TDX_GUEST is enabled, no stubs needed */
> +unsigned int tdx_serial_in(unsigned long addr, int offset);
> +void tdx_serial_out(unsigned long addr, int offset, int value);
> +
> 

.. Should these also be:

+__noendbr unsigned int tdx_serial_in(unsigned long addr, int offset);
+__noendbr void tdx_serial_out(unsigned long addr, int offset, int value);

  reply	other threads:[~2026-10-02 19:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 20:20 [PATCH v3 0/2] x86/tdx: Use TDVMCALLs directly for earlyprintk Vishal Verma
2026-09-22 20:20 ` [PATCH v3 1/2] x86/tdx: Move port I/O definitions to a shared header Vishal Verma
2026-09-22 20:20 ` [PATCH v3 2/2] x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs Vishal Verma
2026-09-25 11:30   ` Kiryl Shutsemau
2026-09-28 23:07     ` Verma, Vishal L
2026-10-02 14:59       ` Kiryl Shutsemau
2026-10-02 19:31         ` Verma, Vishal L [this message]
2026-10-03 23:34           ` Kiryl Shutsemau

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=dfe6e3aa7bd37679d2d5e559b9af8e254d88044f.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=skhan@linuxfoundation.org \
    --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

all inboxes | Powered by JetHome®