diff options
author | Shannon Zhao <zhaoshenglong@huawei.com> | 2018-05-16 17:18:34 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-06-28 19:05:31 +0200 |
commit | 6c090d4a755bb6245461450869130a517e18a3dc (patch) | |
tree | 18a6be0c6933889b0e064934179a963da4adcc3e /include/sysemu | |
parent | 61362b71c105ccb151ca16897a7d56534423f390 (diff) |
kvm: Delete the slot if and only if the KVM_MEM_READONLY flag is changed
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>
Message-Id: <1526462314-19720-1-git-send-email-zhaoshenglong@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r-- | include/sysemu/kvm_int.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index 888557a1ca..f838412491 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -20,6 +20,7 @@ typedef struct KVMSlot void *ram; int slot; int flags; + int old_flags; } KVMSlot; typedef struct KVMMemoryListener { |