All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>,
	qemu-devel@nongnu.org, guangrong.xiao@gmail.com
Cc: shannon.zhaosl@gmail.com, kvmarm@lists.cs.columbia.edu,
	kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: Delete the slot only when KVM_MEM_READONLY flag is changed
Date: Wed, 13 Jun 2018 17:58:18 +0200	[thread overview]
Message-ID: <fdd4182f-6f7c-16ae-e800-3219bf1d09e9@redhat.com> (raw)
In-Reply-To: <5B207E41.3080209@huawei.com>

On 13/06/2018 04:15, Shannon Zhao wrote:
> 
> 
> On 2018/6/12 20:17, Paolo Bonzini wrote:
>> On 16/05/2018 11:18, Shannon Zhao wrote:
>>> According to KVM commit 75d61fbc, it needs to delete the slot before
>>> changing the KVM_MEM_READONLY flag. But QEMU commit 235e8982 only check
>>> whether KVM_MEM_READONLY flag is set instead of changing. It doesn't
>>> need to delete the slot if the KVM_MEM_READONLY flag is not changed.
>>>
>>> This fixes a issue that migrating a VM at the OVMF startup stage and
>>> VM is executing the codes in rom. Between the deleting and adding the
>>> slot in kvm_set_user_memory_region, there is a chance that guest access
>>> rom and trap to KVM, then KVM can't find the corresponding memslot.
>>> While KVM (on ARM) injects an abort to guest due to the broken hva, then
>>> guest will get stuck.
>>>
>>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>>
>> I'm a bit worried about old_flags not being set on all paths to
>> kvm_set_user_memory_region.  This would lead to extra
>> KVM_SET_USER_MEMORY_REGION calls.  It should not be a problem but
>> it is ugly.  Does something like the additional changes below work for you?
>>
> I test below patch. It works for our testcase.
> Do I need to fold them into one and resend?

No need to, thanks!

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>,
	qemu-devel@nongnu.org, guangrong.xiao@gmail.com
Cc: shannon.zhaosl@gmail.com, kvmarm@lists.cs.columbia.edu,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] kvm: Delete the slot only when KVM_MEM_READONLY flag is changed
Date: Wed, 13 Jun 2018 17:58:18 +0200	[thread overview]
Message-ID: <fdd4182f-6f7c-16ae-e800-3219bf1d09e9@redhat.com> (raw)
In-Reply-To: <5B207E41.3080209@huawei.com>

On 13/06/2018 04:15, Shannon Zhao wrote:
> 
> 
> On 2018/6/12 20:17, Paolo Bonzini wrote:
>> On 16/05/2018 11:18, Shannon Zhao wrote:
>>> According to KVM commit 75d61fbc, it needs to delete the slot before
>>> changing the KVM_MEM_READONLY flag. But QEMU commit 235e8982 only check
>>> whether KVM_MEM_READONLY flag is set instead of changing. It doesn't
>>> need to delete the slot if the KVM_MEM_READONLY flag is not changed.
>>>
>>> This fixes a issue that migrating a VM at the OVMF startup stage and
>>> VM is executing the codes in rom. Between the deleting and adding the
>>> slot in kvm_set_user_memory_region, there is a chance that guest access
>>> rom and trap to KVM, then KVM can't find the corresponding memslot.
>>> While KVM (on ARM) injects an abort to guest due to the broken hva, then
>>> guest will get stuck.
>>>
>>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>>
>> I'm a bit worried about old_flags not being set on all paths to
>> kvm_set_user_memory_region.  This would lead to extra
>> KVM_SET_USER_MEMORY_REGION calls.  It should not be a problem but
>> it is ugly.  Does something like the additional changes below work for you?
>>
> I test below patch. It works for our testcase.
> Do I need to fold them into one and resend?

No need to, thanks!

Paolo

  reply	other threads:[~2018-06-13 15:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  9:18 [PATCH] kvm: Delete the slot only when KVM_MEM_READONLY flag is changed Shannon Zhao
2018-05-16  9:18 ` Shannon Zhao
2018-05-16  9:18 ` [Qemu-devel] " Shannon Zhao
2018-06-12  1:36 ` Shannon Zhao
2018-06-12  1:36   ` Shannon Zhao
2018-06-12  1:36   ` [Qemu-devel] " Shannon Zhao
2018-06-12 12:17 ` Paolo Bonzini
2018-06-12 12:17   ` [Qemu-devel] " Paolo Bonzini
2018-06-13  2:15   ` Shannon Zhao
2018-06-13  2:15     ` Shannon Zhao
2018-06-13  2:15     ` [Qemu-devel] " Shannon Zhao
2018-06-13 15:58     ` Paolo Bonzini [this message]
2018-06-13 15:58       ` Paolo Bonzini

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=fdd4182f-6f7c-16ae-e800-3219bf1d09e9@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=guangrong.xiao@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=zhaoshenglong@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.