[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f1e5aef5-989c-4f07-82af-9ed54cc192be@redhat.com>
Date: Sat, 30 Mar 2024 22:31:47 +0100
From: Paolo Bonzini <pbonzini@...hat.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, 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, 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 v12 22/29] KVM: SEV: Implement gmem hook for invalidating
private pages
On 3/29/24 23:58, Michael Roth wrote:
> + /*
> + * If an unaligned PFN corresponds to a 2M region assigned as a
> + * large page in he RMP table, PSMASH the region into individual
> + * 4K RMP entries before attempting to convert a 4K sub-page.
> + */
> + if (!use_2m_update && rmp_level > PG_LEVEL_4K) {
> + rc = snp_rmptable_psmash(pfn);
> + if (rc)
> + pr_err_ratelimited("SEV: Failed to PSMASH RMP entry for PFN 0x%llx error %d\n",
> + pfn, rc);
> + }
Ignoring the PSMASH failure is pretty scary... At this point
free_folio cannot fail, should the psmash part of this patch be done in
kvm_gmem_invalidate_begin() before kvm_mmu_unmap_gfn_range()?
Also, can you get PSMASH_FAIL_INUSE and if so what's the best way to
address it? Should fallocate() return -EBUSY?
Thanks,
Paolo
Powered by blists - more mailing lists