From: "Huang, Kai" <kai.huang@intel.com>
To: "Hansen, Dave" <dave.hansen@intel.com>,
"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"peterz@infradead.org" <peterz@infradead.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
"seanjc@google.com" <seanjc@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH] x86/virt/tdx: Further fix tdh_vp_enter() calls instrumentable code warning
Date: Thu, 26 Jun 2025 01:24:42 +0000 [thread overview]
Message-ID: <1f738756819f046feaac2e89e08b87f93927cb06.camel@intel.com> (raw)
In-Reply-To: <6d997522660f3ddf673d981cf2511674a94e99ae.camel@intel.com>
> >
> > To fix the second problem, change tdx_tdvpr_pa() to use
> > PFN_PHYS(page_to_pfn()) instead of page_to_phys() so that there will be
> > no more function call inside tdx_tdvpr_pa()[*].
>
> To check my understanding, page_to_pfn() on CONFIG_SPARSEMEM_VMEMMAP or
> CONFIG_FLATMEM has no function calls, but on CONFIG_SPARSEMEM, it does. We are
> counting on x86_64 to not use CONFIG_SPARSEMEM?
Yes. Please see include/asm-generic/memory_model.h.
>
> >
> > The TDVPR page is always an actual page out of page allocator, so the
> > additional warning around pfn_valid() check in page_to_phys() doesn't
> > help a lot anyway. It's not worth complicating the code for such
> > warning when CONFIG_DEBUG_VIRTUAL=y.
> >
> > [*] Since commit cba5d9b3e99d ("x86/mm/64: Make SPARSEMEM_VMEMMAP the
> > only memory model") page_to_pfn() has been a simple macro without
> > any function call.
> >
> > Fixes: e9f17038d814 ("x86/tdx: mark tdh_vp_enter() as __flatten")
> > Signed-off-by: Kai Huang <kai.huang@intel.com>
>
> Otherwise, LGTM.
Is this a RB? :-)
next prev parent reply other threads:[~2025-06-26 1:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 10:13 Kai Huang
2025-06-25 23:56 ` Edgecombe, Rick P
2025-06-26 1:24 ` Huang, Kai [this message]
2025-06-26 15:07 ` Edgecombe, Rick P
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=1f738756819f046feaac2e89e08b87f93927cb06.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=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@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
all inboxes | Powered by JetHome®