lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f738756819f046feaac2e89e08b87f93927cb06.camel@intel.com>
Date: Thu, 26 Jun 2025 01:24:42 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "Hansen, Dave" <dave.hansen@...el.com>, "Edgecombe, Rick P"
	<rick.p.edgecombe@...el.com>, "bp@...en8.de" <bp@...en8.de>,
	"peterz@...radead.org" <peterz@...radead.org>, "hpa@...or.com"
	<hpa@...or.com>, "mingo@...hat.com" <mingo@...hat.com>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "kirill.shutemov@...ux.intel.com"
	<kirill.shutemov@...ux.intel.com>
CC: "pbonzini@...hat.com" <pbonzini@...hat.com>, "seanjc@...gle.com"
	<seanjc@...gle.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH] x86/virt/tdx: Further fix tdh_vp_enter() calls
 instrumentable code warning

> > 
> > 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@...el.com>
> 
> Otherwise, LGTM.

Is this a RB? :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ