Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1685279
| From | Bandan Das <bsd@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor |
| Date | 2017-07-11 20:30 +0200 |
| Message-ID | <u2853-5KF-9@gated-at.bofh.it> (permalink) |
| References | <u1NWF-1rM-11@gated-at.bofh.it> <u1NWH-1rM-55@gated-at.bofh.it> <u1Yfn-7Ws-9@gated-at.bofh.it> <u27C2-5m0-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Bandan Das <bsd@redhat.com> writes:
....
>>> + /*
>>> + * If the (L2) guest does a vmfunc to the currently
>>> + * active ept pointer, we don't have to do anything else
>>> + */
>>> + if (vmcs12->ept_pointer != address) {
>>> + if (address >> cpuid_maxphyaddr(vcpu) ||
>>> + !IS_ALIGNED(address, 4096))
>>
>> Couldn't the pfn still be invalid and make kvm_mmu_reload() fail?
>> (triggering a KVM_REQ_TRIPLE_FAULT)
>
> If there's a triple fault, I think it's a good idea to inject it
> back. Basically, there's no need to take care of damage control
> that L1 is intentionally doing.
>
>>> + goto fail;
>>> + kvm_mmu_unload(vcpu);
>>> + vmcs12->ept_pointer = address;
>>> + kvm_mmu_reload(vcpu);
>>
>> I was thinking about something like this:
>>
>> kvm_mmu_unload(vcpu);
>> old = vmcs12->ept_pointer;
>> vmcs12->ept_pointer = address;
>> if (kvm_mmu_reload(vcpu)) {
>> /* pointer invalid, restore previous state */
>> kvm_clear_request(KVM_REQ_TRIPLE_FAULT, vcpu);
>> vmcs12->ept_pointer = old;
>> kvm_mmu_reload(vcpu);
>> goto fail;
>> }
>>
>> The you can inherit the checks from mmu_check_root().
Actually, thinking about this a bit more, I agree with you. Any fault
with a vmfunc operation should end with a vmfunc vmexit, so this
is a good thing to have. Thank you for this idea! :)
Bandan
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 0/3] Expose VMFUNC to the nested hypervisor Bandan Das <bsd@redhat.com> - 2017-07-10 23:00 +0200
[PATCH v4 2/3] KVM: nVMX: Enable VMFUNC for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-10 23:00 +0200
[PATCH v4 1/3] KVM: vmx: Enable VMFUNCs Bandan Das <bsd@redhat.com> - 2017-07-10 23:00 +0200
[PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-10 23:00 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor David Hildenbrand <david@redhat.com> - 2017-07-11 10:00 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Paolo Bonzini <pbonzini@redhat.com> - 2017-07-11 10:50 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 16:00 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 20:10 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 21:20 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 21:40 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 20:00 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 20:30 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 21:40 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 22:00 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 22:30 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 22:40 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 22:50 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 23:10 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-12 15:30 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-12 20:20 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-12 21:20 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-17 20:00 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Jim Mattson <jmattson@google.com> - 2017-07-11 20:30 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 20:40 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 21:20 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 21:40 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-11 22:30 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-11 22:50 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Radim Krčmář <rkrcmar@redhat.com> - 2017-07-12 15:50 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-12 20:10 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor David Hildenbrand <david@redhat.com> - 2017-07-13 17:50 +0200
Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor Bandan Das <bsd@redhat.com> - 2017-07-13 19:10 +0200
csiph-web