[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240126153451.GDZbPRG3KxaQik-0aY@fat_crate.local>
Date: Fri, 26 Jan 2024 16:34:51 +0100
From: Borislav Petkov <bp@...en8.de>
To: Michael Roth <michael.roth@....com>
Cc: x86@...nel.org, kvm@...r.kernel.org, linux-coco@...ts.linux.dev,
linux-mm@...ck.org, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
jroedel@...e.de, thomas.lendacky@....com, hpa@...or.com,
ardb@...nel.org, pbonzini@...hat.com, seanjc@...gle.com,
vkuznets@...hat.com, jmattson@...gle.com, luto@...nel.org,
dave.hansen@...ux.intel.com, slp@...hat.com, pgonda@...gle.com,
peterz@...radead.org, srinivas.pandruvada@...ux.intel.com,
rientjes@...gle.com, tobin@....com, vbabka@...e.cz,
kirill@...temov.name, ak@...ux.intel.com, tony.luck@...el.com,
sathyanarayanan.kuppuswamy@...ux.intel.com, alpergun@...gle.com,
jarkko@...nel.org, ashish.kalra@....com, nikunj.dadhania@....com,
pankaj.gupta@....com, liam.merwick@...cle.com
Subject: Re: [PATCH v2 11/25] x86/sev: Adjust directmap to avoid inadvertant
RMP faults
On Thu, Jan 25, 2024 at 10:11:11PM -0600, Michael Roth wrote:
> +static int adjust_direct_map(u64 pfn, int rmp_level)
> +{
> + unsigned long vaddr = (unsigned long)pfn_to_kaddr(pfn);
> + unsigned int level;
> + int npages, ret;
> + pte_t *pte;
Again, something I asked the last time but no reply:
Looking at Documentation/arch/x86/x86_64/mm.rst, the direct map starts
at page_offset_base so this here should at least check
if (vaddr < __PAGE_OFFSET)
return 0;
I'm not sure about the upper end. Right now, the adjusting should not
happen only for the direct map but also for the whole kernel address
space range because we don't want to cause any mismatch between page
mappings anywhere.
Which means, this function should be called adjust_kernel_map() or so...
Hmmm.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists