qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Herongguang (Stephen)" <herongguang.he@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	quintela@redhat.com, amit.shah@redhat.com, rkrcmar@redhat.com,
	kvm@vger.kernel.org
Cc: qemu-devel@nongnu.org, arei.gonglei@huawei.com,
	"Huangweidong (C)" <weidong.huang@huawei.com>
Subject: Re: [Qemu-devel] [RFC/PATCH 2] kvm: x86: handle KVM_SET_VCPU_EVENTS/KVM_VCPUEVENT_VALID_SMM properly
Date: Thu, 22 Sep 2016 21:19:42 +0800	[thread overview]
Message-ID: <57E3DA6E.1060702@huawei.com> (raw)
In-Reply-To: <28cd815c-8120-cc05-fc47-1ed31030f607@redhat.com>



On 2016/9/22 17:29, Paolo Bonzini wrote:
>
>
> On 22/09/2016 09:51, Herongguang (Stephen) wrote:
>> After making memory consistent between source and destination
>> (https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg03069.html),
>> there can
>> still reproduce instruction emulation failure in destination side if
>> migration when VM’s in grub stage:
>
> Hi!  Did you follow up on that patch, by the way?
Yes, I have some concern, see that post.

>
>> So I think there is some lacking in kvm-kmod’s
>> kvm_vcpu_ioctl_x86_set_vcpu_events that handles KVM_VCPUEVENT_VALID_SMM.
>> I tried following patch,
>> it seems works fine.
>>
>> Do you think this patch is appropriate or not enough? Thanks.
>
> Yes.  I would just call kvm_mmu_reset_context unconditionally at the end
> of kvm_vcpu_iocyl_x86_set_x86_vcpu_events.  Please send this patch as
> non-RFC.
>
> Patch 3 is also okay, please send it separately.
Ok, I will test and post it tomorrow, thanks!

>
> Thanks,
>
> Paolo
>
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 19f9f9e..f39e839 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -3013,8 +3013,10 @@ static int
>> kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
>>                  vcpu->arch.apic->sipi_vector = events->sipi_vector;
>>
>>          if (events->flags & KVM_VCPUEVENT_VALID_SMM) {
>> -               if (events->smi.smm)
>> +               if (events->smi.smm) {
>>                          vcpu->arch.hflags |= HF_SMM_MASK;
>> +                       kvm_mmu_reset_context(vcpu);
>> +               }
>>                  else
>>                          vcpu->arch.hflags &= ~HF_SMM_MASK;
>>                  vcpu->arch.smi_pending = events->smi.pending;
>>
>>
>
> .
>

  reply	other threads:[~2016-09-22 13:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  7:55 [Qemu-devel] [RFC/PATCH] migration: SMRAM dirty bitmap not fetched from kvm-kmod and not send to destination Herongguang (Stephen)
2016-09-14  9:05 ` Paolo Bonzini
2016-09-22 13:16   ` Herongguang (Stephen)
2016-09-23  1:11     ` Herongguang (Stephen)
2016-09-23  7:17     ` Paolo Bonzini
2016-09-23  8:51       ` Herongguang (Stephen)
2016-09-23  8:59         ` Paolo Bonzini
2016-09-23  9:14           ` Herongguang (Stephen)
2016-09-25 11:33       ` Herongguang (Stephen)
2016-09-26  7:15         ` Paolo Bonzini
2016-09-22  7:51 ` [Qemu-devel] [RFC/PATCH 2] kvm: x86: handle KVM_SET_VCPU_EVENTS/KVM_VCPUEVENT_VALID_SMM properly Herongguang (Stephen)
2016-09-22  9:29   ` Paolo Bonzini
2016-09-22 13:19     ` Herongguang (Stephen) [this message]
2016-09-22  7:56 ` [Qemu-devel] [RFC/PATCH 3] kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0 Herongguang (Stephen)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57E3DA6E.1060702@huawei.com \
    --to=herongguang.he@huawei.com \
    --cc=amit.shah@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=weidong.huang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).