summaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2019-02-05 13:01:18 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2019-02-20 22:48:37 +0100
commit164bf7e56c5a73f2f819c39ba7e0f20e0f97dc7b (patch)
treeb64283dd04a5aa6024d6fd6639db781bfe1c613e /virt/kvm
parent0e32958ec449a9bb63c031ed04ac7a494ea1bc1c (diff)
downloadlinux-164bf7e56c5a73f2f819c39ba7e0f20e0f97dc7b.tar.gz
linux-164bf7e56c5a73f2f819c39ba7e0f20e0f97dc7b.tar.bz2
linux-164bf7e56c5a73f2f819c39ba7e0f20e0f97dc7b.zip
KVM: Move the memslot update in-progress flag to bit 63
...now that KVM won't explode by moving it out of bit 0. Using bit 63 eliminates the need to jump over bit 0, e.g. when calculating a new memslots generation or when propagating the memslots generation to an MMIO spte. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/kvm_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5c2e7e173a46..c9d0bc01f8cb 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -657,7 +657,7 @@ static struct kvm *kvm_create_vm(unsigned long type)
if (!slots)
goto out_err_no_srcu;
/* Generations must be different for each address space. */
- slots->generation = i * 2;
+ slots->generation = i;
rcu_assign_pointer(kvm->memslots[i], slots);
}
@@ -890,10 +890,10 @@ static struct kvm_memslots *install_new_memslots(struct kvm *kvm,
* Generations must be unique even across address spaces. We do not need
* a global counter for that, instead the generation space is evenly split
* across address spaces. For example, with two address spaces, address
- * space 0 will use generations 0, 4, 8, ... while address space 1 will
- * use generations 2, 6, 10, 14, ...
+ * space 0 will use generations 0, 2, 4, ... while address space 1 will
+ * use generations 1, 3, 5, ...
*/
- gen += KVM_ADDRESS_SPACE_NUM * 2;
+ gen += KVM_ADDRESS_SPACE_NUM;
kvm_arch_memslots_updated(kvm, gen);