[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ddcad72637dece4bd3ecb7c49b8ad0e5bd233c0.camel@intel.com>
Date: Mon, 27 Nov 2023 21:38:57 +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>,
"kys@...rosoft.com" <kys@...rosoft.com>,
"Cui, Dexuan" <decui@...rosoft.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"urezki@...il.com" <urezki@...il.com>,
"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 v2 4/8] x86/sev: Enable PVALIDATE for PFNs without a valid
virtual address
On Tue, 2023-11-21 at 13:20 -0800, mhkelley58@...il.com wrote:
> +static int pvalidate_pfn(unsigned long vaddr, unsigned int size,
> + unsigned long pfn, bool validate, int *rc2)
> +{
> + int rc;
> + struct page *page = pfn_to_page(pfn);
> +
> + *rc2 = vmap_pages_range(vaddr, vaddr + PAGE_SIZE,
> + PAGE_KERNEL, &page, PAGE_SHIFT);
Can't this fail and then the pvalidate below would encounter trouble?
Sort of separately, if those vmalloc objections can't be worked
through, did you consider doing something like text_poke() does (create
the temporary mapping in a temporary MM) for pvalidate purposes? I
don't know enough about what kind of special exceptions might popup
during that operation though, might be playing with fire...
> + rc = pvalidate(vaddr, size, validate);
> + vunmap_range(vaddr, vaddr + PAGE_SIZE);
> +
> + return rc;
> +}
Powered by blists - more mailing lists