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: <9dcdd088494b3fa285781cccfd35cd47a70d69c3.camel@intel.com>
Date: Fri, 12 Jan 2024 01:20:03 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
	"ardb@...nel.org" <ardb@...nel.org>, "hch@...radead.org" <hch@...radead.org>,
	"Lutomirski, Andy" <luto@...nel.org>, "mhklinux@...look.com"
	<mhklinux@...look.com>, "linux-coco@...ts.linux.dev"
	<linux-coco@...ts.linux.dev>, "dave.hansen@...ux.intel.com"
	<dave.hansen@...ux.intel.com>, "thomas.lendacky@....com"
	<thomas.lendacky@....com>, "haiyangz@...rosoft.com" <haiyangz@...rosoft.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
	"mingo@...hat.com" <mingo@...hat.com>, "seanjc@...gle.com"
	<seanjc@...gle.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "tglx@...utronix.de" <tglx@...utronix.de>,
	"Cui, Dexuan" <decui@...rosoft.com>, "urezki@...il.com" <urezki@...il.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>, "hpa@...or.com" <hpa@...or.com>,
	"peterz@...radead.org" <peterz@...radead.org>, "wei.liu@...nel.org"
	<wei.liu@...nel.org>, "bp@...en8.de" <bp@...en8.de>, "Rodel, Jorg"
	<jroedel@...e.de>, "sathyanarayanan.kuppuswamy@...ux.intel.com"
	<sathyanarayanan.kuppuswamy@...ux.intel.com>, "lstoakes@...il.com"
	<lstoakes@...il.com>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v3 1/3] x86/hyperv: Use slow_virt_to_phys() in page
 transition hypervisor callback

On Fri, 2024-01-05 at 10:30 -0800, mhkelley58@...il.com wrote:
> + * It is also used in callbacks for CoCo VM page transitions between
> private
> + * and shared because it works when the PRESENT bit is not set in
> the leaf
> + * PTE. In such cases, the state of the PTEs, including the PFN, is
> otherwise
> + * known to be valid, so the returned physical address is correct.
> The similar
> + * function vmalloc_to_pfn() can't be used because it requires the
> PRESENT bit.

I'm not sure about this comment. It is mostly about callers far away
and other functions in vmalloc. Probably a decent chance to get stale.
It also kind of begs the question of why vmalloc_to_pfn() requires the
present bit in the leaf.

It seems the first part of the comment is about why this is needed when
__pa() exists. One reason given is that __pa() doesn't work with
vmalloc memory. Then the next bit talks about another similar function
that works with vmalloc memory.

So the comment is a risk to get stale, and leaves me a little confused
why this function exists.

I think the reason is because vmalloc_to_pfn() *only* works with
vmalloc memory and this is needed to work on other alias mappings.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ