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: <3ddc237d9fbbe0aa8838babf0df790076017e9f7.camel@intel.com>
Date: Fri, 12 Jan 2024 17:17:16 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "linux-coco@...ts.linux.dev" <linux-coco@...ts.linux.dev>,
	"ardb@...nel.org" <ardb@...nel.org>, "Lutomirski, Andy" <luto@...nel.org>,
	"mhklinux@...look.com" <mhklinux@...look.com>, "hch@...radead.org"
	<hch@...radead.org>, "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>, "linux-hyperv@...r.kernel.org"
	<linux-hyperv@...r.kernel.org>, "peterz@...radead.org"
	<peterz@...radead.org>, "hpa@...or.com" <hpa@...or.com>, "bp@...en8.de"
	<bp@...en8.de>, "wei.liu@...nel.org" <wei.liu@...nel.org>, "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-12 at 15:07 +0000, Michael Kelley wrote:
> The comment is Kirill Shutemov's suggestion based on comments in
> an earlier version of the patch series.  See [1].   The intent is to
> prevent
> some later revision to slow_virt_to_phys() from adding a check for
> the
> present bit and breaking the CoCo VM hypervisor callback.  Yes, the
> comment could get stale, but I'm not sure how else to call out the
> implicit dependency.  The idea of creating a private version of
> slow_virt_to_phys() for use only in the CoCo VM hypervisor callback
> is also discussed in the thread, but that seems worse overall.

Well, it's not a huge deal, but I would have just put a comment at the
caller like:

/*
 * Use slow_virt_to_phys() instead of vmalloc_to_page(), because it
 * returns the PFN even for NP PTEs.
 */

If someone is changing slow_virt_to_phys() they should check the
callers to make sure they won't break anything. They can see the
comment then and have an easy time.

An optional comment at slow_virt_to_phys() could explain how the
function works in regards to the present bit, but not include details
about CoCoO VM page transition's usage of the present bit. The proposed
comment text looks like something more appropriate for a commit log.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ