[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a9d3517-7bcc-723a-5ec5-80018d0850d7@redhat.com>
Date: Mon, 30 Nov 2020 18:53:41 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>,
Lai Jiangshan <jiangshanlai@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kvm@...r.kernel.org,
Lai Jiangshan <laijs@...ux.alibaba.com>,
Jonathan Corbet <corbet@....net>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Avi Kivity <avi@...ranet.com>, linux-doc@...r.kernel.org
Subject: Re: [PATCH] kvm/x86/mmu: use the correct inherited permissions to get
shadow page
On 30/11/20 18:41, Sean Christopherson wrote:
>>
>> pmd1 and pmd2 point to the same pte table, so:
>> ptr1 and ptr3 points to the same page.
>> ptr2 and ptr4 points to the same page.
>>
>> The guess read-accesses to ptr1 first. So the hypervisor gets the
>> shadow pte page table with role.access=u-- among other things.
>> (Note the shadowed pmd1's access is uwx)
>>
>> And then the guest write-accesses to ptr2, and the hypervisor
>> set up shadow page for ptr2.
>> (Note the hypervisor silencely accepts the role.access=u--
>> shadow pte page table in FNAME(fetch))
>>
>> After that, the guess read-accesses to ptr3, the hypervisor
>> reused the same shadow pte page table as above.
>>
>> At last, the guest writes to ptr4 without vmexit nor pagefault,
>> Which should cause vmexit as the guest expects.
>
> Hmm, yes, KVM would incorrectly handle this scenario. But, the proposed patch
> would not address the issue as KVM always maps non-leaf shadow pages with full
> access permissions.
Can we have a testcase in kvm-unit-tests? It's okay of course if it
only fails with ept=0.
Paolo
Powered by blists - more mailing lists