[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93654914-c3d9-8927-8ab2-ee4597426924@intel.com>
Date: Mon, 12 Jun 2023 09:30:35 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Michael Roth <michael.roth@....com>, kvm@...r.kernel.org
Cc: linux-coco@...ts.linux.dev, linux-mm@...ck.org,
linux-crypto@...r.kernel.org, x86@...nel.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, dovmurik@...ux.ibm.com, tobin@....com,
bp@...en8.de, vbabka@...e.cz, kirill@...temov.name,
ak@...ux.intel.com, tony.luck@...el.com, marcorr@...gle.com,
sathyanarayanan.kuppuswamy@...ux.intel.com, alpergun@...gle.com,
dgilbert@...hat.com, jarkko@...nel.org, ashish.kalra@....com,
nikunj.dadhania@....com, liam.merwick@...cle.com,
zhi.a.wang@...el.com
Subject: Re: [PATCH RFC v9 12/51] x86/fault: Report RMP page faults for kernel
addresses
On 6/11/23 21:25, Michael Roth wrote:
> dump_pagetable(address);
> +
> + if (error_code & X86_PF_RMP) {
> + unsigned int level;
> + pgd_t *pgd;
> + pte_t *pte;
> +
> + pgd = __va(read_cr3_pa());
> + pgd += pgd_index(address);
> + pte = lookup_address_in_pgd(pgd, address, &level);
> +
> + sev_dump_rmpentry(pte_pfn(*pte));
> + }
> }
It would be nice to trim this hunk down. Can you make it:
if (error_code & X86_PF_RMP)
sev_dump_rmpentry(address);
and hide the rest of the logic in the helper?
Oh, and lookup_address_in_pgd() can return NULL. It's not great to page
fault in the page fault handler. Could you fix that up too, please?
Powered by blists - more mailing lists