diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-12-23 11:35:21 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:44 -0500 |
commit | bc6678a33d9b952981a8e44a4f876c3ad64ca4d8 (patch) | |
tree | e26027179eb0d76f234509145a395dd6e5910074 /arch/x86/kvm/vmx.c | |
parent | 3ad26d8139a82b0510b1e0435ee82ae461d33401 (diff) |
KVM: introduce kvm->srcu and convert kvm_set_memory_region to SRCU update
Use two steps for memslot deletion: mark the slot invalid (which stops
instantiation of new shadow pages for that slot, but allows destruction),
then instantiate the new empty slot.
Also simplifies kvm_handle_hva locking.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 18698799e365..f1cae7d6113d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -1503,7 +1503,11 @@ static void enter_pmode(struct kvm_vcpu *vcpu) | |||
1503 | static gva_t rmode_tss_base(struct kvm *kvm) | 1503 | static gva_t rmode_tss_base(struct kvm *kvm) |
1504 | { | 1504 | { |
1505 | if (!kvm->arch.tss_addr) { | 1505 | if (!kvm->arch.tss_addr) { |
1506 | gfn_t base_gfn = kvm->memslots->memslots[0].base_gfn + | 1506 | struct kvm_memslots *slots; |
1507 | gfn_t base_gfn; | ||
1508 | |||
1509 | slots = rcu_dereference(kvm->memslots); | ||
1510 | base_gfn = kvm->memslots->memslots[0].base_gfn + | ||
1507 | kvm->memslots->memslots[0].npages - 3; | 1511 | kvm->memslots->memslots[0].npages - 3; |
1508 | return base_gfn << PAGE_SHIFT; | 1512 | return base_gfn << PAGE_SHIFT; |
1509 | } | 1513 | } |