Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1676661

Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf
Date 2017-06-28 15:40 +0200
Message-ID <tXlmh-7nt-11@gated-at.bofh.it> (permalink)
References <tXkgy-6Kh-3@gated-at.bofh.it> <tXkgy-6Kh-15@gated-at.bofh.it> <tXkJA-6TW-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2017-06-28 14:56+0200, Paolo Bonzini:
> On 28/06/2017 14:25, Wanpeng Li wrote:
>> From: Wanpeng Li <wanpeng.li@hotmail.com>
>> 
>> Add an nested_apf field to vcpu->arch.exception to identify an async page 
>> fault, and constructs the expected vm-exit information fields. Force a 
>> nested VM exit from nested_vmx_check_exception() if the injected #PF is 
>> async page fault. Extending the userspace interface KVM_GET_VCPU_EVENTS
>> and KVM_SET_VCPU_EVENTS for live migration.
>> 
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: Radim Krčmář <rkrcmar@redhat.com>
>> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
>> ---
> 
> Radim, Wanpeng,
> 
> the patch is nice now but I'm still not 100% sure about the live
> migration part.  Why do we need to pass nested_apf to userspace, but not
> nested_apf_token?

We do not need it for migration, but unavailable nested_apf_token
already breaks checkpoint & restore from userspace ... I think the
cleanest way would be to add a new paravirtual event for nested_apf.
(Or just keep delaying the apf.)

Migration does a "async-pf-broadcast" while setting the async-pf MSR on
destination, which resumes all async-pf waiters.
Userspace actually has to drop the async-pf event on migration, because
the destination has invalid nested_apf_token.  (It's a horrible design.)

nested_apf is not #PF: if we didn't pass nested_apf, then the exception
would be injected as #PF to L2 after migration.  (Local KVM could
remember that the #PF is nested_apf and do some ugly hacks.)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 0/4] KVM: async_pf: Fix async pf exception injection Wanpeng Li <kernellwp@gmail.com> - 2017-06-28 14:30 +0200
  [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf Wanpeng Li <kernellwp@gmail.com> - 2017-06-28 14:30 +0200
    Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Paolo Bonzini <pbonzini@redhat.com> - 2017-06-28 15:00 +0200
      Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Radim Krčmář <rkrcmar@redhat.com> - 2017-06-28 15:40 +0200
        Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Paolo Bonzini <pbonzini@redhat.com> - 2017-06-28 15:50 +0200
          Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Wanpeng Li <kernellwp@gmail.com> - 2017-06-28 16:10 +0200
            Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Wanpeng Li <kernellwp@gmail.com> - 2017-06-28 16:20 +0200
              Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Wanpeng Li <kernellwp@gmail.com> - 2017-06-28 16:30 +0200
              Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Paolo Bonzini <pbonzini@redhat.com> - 2017-06-28 16:30 +0200
            Re: [PATCH v6 3/4] KVM: async_pf: Force a nested vmexit if the  injected #PF is async_pf Paolo Bonzini <pbonzini@redhat.com> - 2017-06-28 16:20 +0200
  [PATCH v6 1/4] KVM: x86: Simple kvm_x86_ops->queue_exception parameter Wanpeng Li <kernellwp@gmail.com> - 2017-06-28 14:30 +0200

csiph-web