Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2021-01-27 Thread Jim Mattson
On Wed, Jan 20, 2021 at 1:16 PM Jim Mattson wrote: > > On Fri, Jan 15, 2021 at 11:35 AM Jim Mattson wrote: > > > > On Fri, Oct 23, 2020 at 10:43 AM Paolo Bonzini wrote: > > > > > > On 23/10/20 19:23, Jim Mattson wrote: > > > >> The information that we need is _not_ that provided by the advanced

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2021-01-20 Thread Jim Mattson
On Fri, Jan 15, 2021 at 11:35 AM Jim Mattson wrote: > > On Fri, Oct 23, 2020 at 10:43 AM Paolo Bonzini wrote: > > > > On 23/10/20 19:23, Jim Mattson wrote: > > >> The information that we need is _not_ that provided by the advanced > > >> VM-exit information (or by a page walk). If a page is

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2021-01-15 Thread Jim Mattson
On Fri, Oct 23, 2020 at 10:43 AM Paolo Bonzini wrote: > > On 23/10/20 19:23, Jim Mattson wrote: > >> The information that we need is _not_ that provided by the advanced > >> VM-exit information (or by a page walk). If a page is neither writable > >> nor executable, the advanced information

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-23 Thread Paolo Bonzini
On 23/10/20 19:23, Jim Mattson wrote: >> The information that we need is _not_ that provided by the advanced >> VM-exit information (or by a page walk). If a page is neither writable >> nor executable, the advanced information doesn't say if the injected #PF >> should be a W=1 or a F=1 fault. We

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-23 Thread Jim Mattson
On Fri, Oct 23, 2020 at 10:16 AM Paolo Bonzini wrote: > > On 23/10/20 18:59, Jim Mattson wrote: > >> The problem is that page fault error code bits cannot be reconstructed > >> from bits 0..2 of the EPT violation exit qualification, if bit 8 is > >> clear in the exit qualification (that is, if

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-23 Thread Paolo Bonzini
On 23/10/20 18:59, Jim Mattson wrote: >> The problem is that page fault error code bits cannot be reconstructed >> from bits 0..2 of the EPT violation exit qualification, if bit 8 is >> clear in the exit qualification (that is, if the access causing the EPT >> violation is to a paging-structure

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-23 Thread Jim Mattson
On Fri, Oct 23, 2020 at 2:22 AM Paolo Bonzini wrote: > > On 23/10/20 05:14, Sean Christopherson wrote: > + > + /* > +* Check that the GPA doesn't exceed physical memory limits, as > that is > +* a guest page fault. We have to emulate the

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-23 Thread Paolo Bonzini
On 23/10/20 05:14, Sean Christopherson wrote: + + /* +* Check that the GPA doesn't exceed physical memory limits, as that is +* a guest page fault. We have to emulate the instruction here, because +* if the illegal address is that

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-22 Thread Sean Christopherson
On Wed, Oct 14, 2020 at 04:44:57PM -0700, Jim Mattson wrote: > On Fri, Oct 9, 2020 at 9:17 AM Jim Mattson wrote: > > > > On Fri, Jul 10, 2020 at 8:48 AM Mohammed Gamal wrote: > > > @@ -5308,6 +5314,18 @@ static int handle_ept_violation(struct kvm_vcpu > > > *vcpu) > > >

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-14 Thread Jim Mattson
On Fri, Oct 9, 2020 at 9:17 AM Jim Mattson wrote: > > On Fri, Jul 10, 2020 at 8:48 AM Mohammed Gamal wrote: > > > > Check guest physical address against it's maximum physical memory. If > > the guest's physical address exceeds the maximum (i.e. has reserved bits > > set), inject a guest page

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-10-09 Thread Jim Mattson
On Fri, Jul 10, 2020 at 8:48 AM Mohammed Gamal wrote: > > Check guest physical address against it's maximum physical memory. If > the guest's physical address exceeds the maximum (i.e. has reserved bits > set), inject a guest page fault with PFERR_RSVD_MASK set. > > This has to be done both in

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-08-17 Thread Paolo Bonzini
On 17/08/20 19:22, Sean Christopherson wrote: >> This splats when running the PKU unit test, although the test still passed. >> I haven't yet spent the brain power to determine if this is a benign warning, >> i.e. simply unexpected, or if permission_fault() fault truly can't handle PK >> faults.

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-08-17 Thread Sean Christopherson
On Wed, Jul 15, 2020 at 04:00:08PM -0700, Sean Christopherson wrote: > On Fri, Jul 10, 2020 at 05:48:09PM +0200, Mohammed Gamal wrote: > > Check guest physical address against it's maximum physical memory. If > > the guest's physical address exceeds the maximum (i.e. has reserved bits > > set),

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-07-15 Thread Sean Christopherson
On Fri, Jul 10, 2020 at 05:48:09PM +0200, Mohammed Gamal wrote: > Check guest physical address against it's maximum physical memory. If > the guest's physical address exceeds the maximum (i.e. has reserved bits > set), inject a guest page fault with PFERR_RSVD_MASK set. > > This has to be done

Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig

2020-07-13 Thread Sean Christopherson
On Fri, Jul 10, 2020 at 05:48:09PM +0200, Mohammed Gamal wrote: > Check guest physical address against it's maximum physical memory. If > the guest's physical address exceeds the maximum (i.e. has reserved bits > set), inject a guest page fault with PFERR_RSVD_MASK set. > > This has to be done