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


Groups > linux.kernel > #1438123

Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in nested guest

From Wanpeng Li <kernellwp@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in nested guest
Date 2016-07-07 04:00 +0200
Message-ID <rS6LD-dY-5@gated-at.bofh.it> (permalink)
References <rRTv3-fc-11@gated-at.bofh.it> <rRV3Q-1jb-27@gated-at.bofh.it> <rRVdw-1mu-21@gated-at.bofh.it> <rRXyF-2Wq-11@gated-at.bofh.it> <rRYEq-3A0-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-07-07 1:11 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
>
>
> On 06/07/2016 18:03, Haozhong Zhang wrote:
>>>> This patch also fixed the crash of L1 Xen with L2 HVM guest. Xen does
>>>> not enable preemption timer for HVM guests, and will get panic if it
>>>> receives a preemption timer vmexit.
>>>
>>> Thanks!  I'm still not sure why the bit is set in the vmcs02 though...
>>
>> Yes, it looks really weird.
>>
>> I replaced "return false" in Wanpeng's patch by
>>
>>     pr_info("VMCS: preemption timer enabled = %d\n",
>>             !!(vmcs_read32(PIN_BASED_VM_EXEC_CONTROL) & PIN_BASED_VMX_PREEMPTION_TIMER));
>>
>> and redid my test. As expected, L1 Xen crashed due to the unexpected
>> preemption timer vmexit. I got a log from above statement just before crash:
>>
>>     VMCS: preemption timer enabled = 1
>>
>> which is expected to be 0, because preemption timer is disabled in
>> vmcs02. I also modified L1 Xen to dump VMCS at crash, and it says
>> preemption timer is disabled.
>>
>> I noticed Jim Mattson recently sent a patch "KVM: nVMX: Fix memory
>> corruption when using VMCS shadowing" to fix the inconsistency between
>> vmcs12 and its shadow. Is it relevant here? I'll test his patch
>> tomorrow.
>
> No, it shouldn't have any effect.
>
> I think it happens when the post_block hook switches back from sw_timer
> to hv_timer, and L2 is running.  So the right fix should be along the
> lines of what I posted earlier.  If you don't beat me to it, I'll take
> another look tomorrow.

I think I just figure out the root cause, I will send out a patch to fix it.

Regards,
Wanpeng Li

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


Thread

[PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in nested guest  Wanpeng Li <kernellwp@gmail.com> - 2016-07-06 13:50 +0200
  Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Haozhong Zhang <haozhong.zhang@intel.com> - 2016-07-06 15:30 +0200
    Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 15:40 +0200
      Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Haozhong Zhang <haozhong.zhang@intel.com> - 2016-07-06 18:10 +0200
        Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 19:20 +0200
          Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Wanpeng Li <kernellwp@gmail.com> - 2016-07-07 04:00 +0200
          Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Wanpeng Li <kernellwp@gmail.com> - 2016-07-07 06:00 +0200
    Re: [PATCH v3] KVM: nVMX: Fix incorrect preemption timer vmexit in  nested guest Wanpeng Li <kernellwp@gmail.com> - 2016-07-07 03:10 +0200

csiph-web