diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2019-02-06 00:01:18 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-02-21 00:48:37 +0300 |
commit | 164bf7e56c5a73f2f819c39ba7e0f20e0f97dc7b (patch) | |
tree | b64283dd04a5aa6024d6fd6639db781bfe1c613e /virt | |
parent | 0e32958ec449a9bb63c031ed04ac7a494ea1bc1c (diff) | |
download | linux-164bf7e56c5a73f2f819c39ba7e0f20e0f97dc7b.tar.xz |
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')
-rw-r--r-- | virt/kvm/kvm_main.c | 8 |
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); |