[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5d4118d9-c501-6c59-82cc-50e317be195c@redhat.com>
Date: Tue, 21 Jan 2020 15:14:37 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>,
Yang Weijiang <weijiang.yang@...el.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
jmattson@...gle.com, yu.c.zhang@...ux.intel.com,
alazar@...defender.com, edwin.zhai@...el.com
Subject: Re: [RESEND PATCH v10 06/10] vmx: spp: Set up SPP paging table at
vmentry/vmexit
On 14/01/20 19:58, Sean Christopherson wrote:
> I'm not convinced the instruction length needs to be provided to userspace
> for this case. Obviously it's not difficult to provide the info, I just
> don't understand the value added by doing so. As above, RIP shouldn't
> need to be unwound, and blindly skipping an instruction seems like an odd
> thing for a VMI engine to do.
>
The reason to introduce the instruction length was so that userspace
could blindly use SPP to emulate ROM behavior. Weijiang's earlier
patches in fact _only_ provided that behavior, and I asked him to change
it so that, by default, using SPP and not handling it will basically
cause an infinite loop of SPP violations.
One possibility to clean things up is to change "fault_handled" and
fast_page_fault's return value from bool to RET_PF* (false becomes
RET_PF_INVALID, true becomes RET_PF_RETRY). direct_page_fault would
also have to do something like
r = fast_page_fault(vcpu, gpa, level, error_code))
if (r != RET_PF_INVALID)
return r;
Then fast_page_fault can just return RET_PF_USERSPACE, and this ugly
case can go away.
+ if (vcpu->run->exit_reason == KVM_EXIT_SPP)
+ r = RET_PF_USERSPACE;
+
Thanks,
Paolo
Powered by blists - more mailing lists