[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SN6PR02MB415720444A3D848D444BB58AD46F2@SN6PR02MB4157.namprd02.prod.outlook.com>
Date: Fri, 12 Jan 2024 19:24:35 +0000
From: Michael Kelley <mhklinux@...look.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"linux-coco@...ts.linux.dev" <linux-coco@...ts.linux.dev>, "ardb@...nel.org"
<ardb@...nel.org>, "Lutomirski, Andy" <luto@...nel.org>, "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
From: Edgecombe, Rick P <rick.p.edgecombe@...el.com> Sent: Friday, January 12, 2024 9:17 AM
>
> 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.
> */
Yes, that comment is added in this patch.
>
> 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.
Kirill -- you originally asked for a comment in slow_virt_to_phys(). [1]
Are you OK with Rick's proposal?
Michael
[1] https://lore.kernel.org/lkml/20230828221333.5blshosyqafbgwlc@box.shutemov.name/
Powered by blists - more mailing lists