Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1653304
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC] KVM: SVM: do not drop VMCB CPL to 0 if SS is not present |
| Date | 2017-05-30 17:20 +0200 |
| Message-ID | <tMR69-A4-1@gated-at.bofh.it> (permalink) |
| References | <tISNb-4Fr-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 19/05/2017 18:14, Roman Penyaev wrote: > > 1. Simple one, KVM SVM side, which makes sure that CPL is not updated > if segment is unusable: > > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -1549,7 +1549,7 @@ static void svm_set_segment(struct kvm_vcpu *vcpu, > * forces SS.DPL to 3 on sysret, so we ignore that case; fixing it > * would entail passing the CPL to userspace and back. > */ > - if (seg == VCPU_SREG_SS) > + if (seg == VCPU_SREG_SS && !var->unusable) > svm->vmcb->save.cpl = (s->attrib >> > SVM_SELECTOR_DPL_SHIFT) & 3; Based on the discussion between you and Andy, my understanding is that it would not be enough to ensure that the attributes are preserved across a roundtrip through KVM_GET_SEGMENT and KVM_SET_SEGMENT. We need a workaround in the hypervisor if we don't want to pass the CPL to userspace and back. Maybe if 1) in 64-bit mode 2) SS.P=0 3) SS selector != 0, then the CPL can be taken from SS.RPL? Thanks, Paolo
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [RFC] KVM: SVM: do not drop VMCB CPL to 0 if SS is not present Paolo Bonzini <pbonzini@redhat.com> - 2017-05-30 17:20 +0200
Re: [RFC] KVM: SVM: do not drop VMCB CPL to 0 if SS is not present Roman Penyaev <roman.penyaev@profitbricks.com> - 2017-05-30 18:00 +0200
Re: [RFC] KVM: SVM: do not drop VMCB CPL to 0 if SS is not present Paolo Bonzini <pbonzini@redhat.com> - 2017-05-30 18:10 +0200
Re: [RFC] KVM: SVM: do not drop VMCB CPL to 0 if SS is not present Gi-Oh Kim <gi-oh.kim@profitbricks.com> - 2017-05-30 18:40 +0200
csiph-web