> On Apr 19, 2021, at 11:33 AM, Dave Hansen <dave.han...@intel.com> wrote: > > On 4/19/21 11:10 AM, Andy Lutomirski wrote: >> I’m confused by this scenario. This should only affect physical pages >> that are in the 2M area that contains guest memory. But, if we have a >> 2M direct map PMD entry that contains kernel data and guest private >> memory, we’re already in a situation in which the kernel touching >> that memory would machine check, right? > > Not machine check, but page fault. Do machine checks even play a > special role in SEV-SNP? I thought that was only TDX? Brain fart. > > My point was just that you can't _easily_ do the 2M->4k kernel mapping > demotion in a page fault handler, like I think Borislav was suggesting. We are certainly toast if this hits the stack. Or if it hits a page table or the GDT or IDT :). The latter delightful choices would be triple faults. I sure hope the code we use to split a mapping is properly NMI safe. > >> ISTM we should fully unmap any guest private page from the kernel and >> all host user pagetables before actually making it be a guest private >> page. > > Yes, that sounds attractive. Then, we'd actually know if the host > kernel was doing stray reads somehow because we'd get a fault there too.
- Re: [RFC Part2 PATCH 03/30] x86: add helper functions... Borislav Petkov
- Re: [RFC Part2 PATCH 03/30] x86: add helper funct... Brijesh Singh
- [RFC Part2 PATCH 04/30] x86/mm: split the physmap when add... Brijesh Singh
- Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap... Dave Hansen
- Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap... Borislav Petkov
- Re: [RFC Part2 PATCH 04/30] x86/mm: split the phy... Brijesh Singh
- Re: [RFC Part2 PATCH 04/30] x86/mm: split the... Borislav Petkov
- Re: [RFC Part2 PATCH 04/30] x86/mm: split... Dave Hansen
- Re: [RFC Part2 PATCH 04/30] x86/mm: ... Andy Lutomirski
- Re: [RFC Part2 PATCH 04/30] x86/... Dave Hansen
- Re: [RFC Part2 PATCH 04/30] x86/... Andy Lutomirski
- Re: [RFC Part2 PATCH 04/30] x86/... Borislav Petkov
- Re: [RFC Part2 PATCH 04/30] x86/... Brijesh Singh
- Re: [RFC Part2 PATCH 04/30] x86/mm: split... Borislav Petkov
- [RFC Part2 PATCH 05/30] x86: define RMP violation #PF erro... Brijesh Singh
- Re: [RFC Part2 PATCH 05/30] x86: define RMP violation... Dave Hansen
- Re: [RFC Part2 PATCH 05/30] x86: define RMP viola... Brijesh Singh
- Re: [RFC Part2 PATCH 05/30] x86: define RMP v... Dave Hansen
- Re: [RFC Part2 PATCH 05/30] x86: define RMP violation... Borislav Petkov
- Re: [RFC Part2 PATCH 05/30] x86: define RMP viola... Brijesh Singh
- [RFC Part2 PATCH 07/30] mm: add support to split the large... Brijesh Singh