diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-05 16:12:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-05 16:12:34 -0500 |
commit | c812a51d11bbe983f4c24e32b59b265705ddd3c2 (patch) | |
tree | d454f518db51a4de700cf3dcd4c3c71ee7288b47 /arch/s390 | |
parent | 9467c4fdd66f6810cecef0f1173330f3c6e67d45 (diff) | |
parent | d2be1651b736002e0c76d7095d6c0ba77b4a897c (diff) |
Merge branch 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (145 commits)
KVM: x86: Add KVM_CAP_X86_ROBUST_SINGLESTEP
KVM: VMX: Update instruction length on intercepted BP
KVM: Fix emulate_sys[call, enter, exit]()'s fault handling
KVM: Fix segment descriptor loading
KVM: Fix load_guest_segment_descriptor() to inject page fault
KVM: x86 emulator: Forbid modifying CS segment register by mov instruction
KVM: Convert kvm->requests_lock to raw_spinlock_t
KVM: Convert i8254/i8259 locks to raw_spinlocks
KVM: x86 emulator: disallow opcode 82 in 64-bit mode
KVM: x86 emulator: code style cleanup
KVM: Plan obsolescence of kernel allocated slots, paravirt mmu
KVM: x86 emulator: Add LOCK prefix validity checking
KVM: x86 emulator: Check CPL level during privilege instruction emulation
KVM: x86 emulator: Fix popf emulation
KVM: x86 emulator: Check IOPL level during io instruction emulation
KVM: x86 emulator: fix memory access during x86 emulation
KVM: x86 emulator: Add Virtual-8086 mode of emulation
KVM: x86 emulator: Add group9 instruction decoding
KVM: x86 emulator: Add group8 instruction decoding
KVM: do not store wqh in irqfd
...
Trivial conflicts in Documentation/feature-removal-schedule.txt
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 26 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 10 |
2 files changed, 24 insertions, 12 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 3fa0a10e4668..49292869a5cd 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -242,6 +242,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) | |||
242 | kvm_free_physmem(kvm); | 242 | kvm_free_physmem(kvm); |
243 | free_page((unsigned long)(kvm->arch.sca)); | 243 | free_page((unsigned long)(kvm->arch.sca)); |
244 | debug_unregister(kvm->arch.dbf); | 244 | debug_unregister(kvm->arch.dbf); |
245 | cleanup_srcu_struct(&kvm->srcu); | ||
245 | kfree(kvm); | 246 | kfree(kvm); |
246 | } | 247 | } |
247 | 248 | ||
@@ -690,14 +691,12 @@ long kvm_arch_vcpu_ioctl(struct file *filp, | |||
690 | } | 691 | } |
691 | 692 | ||
692 | /* Section: memory related */ | 693 | /* Section: memory related */ |
693 | int kvm_arch_set_memory_region(struct kvm *kvm, | 694 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
694 | struct kvm_userspace_memory_region *mem, | 695 | struct kvm_memory_slot *memslot, |
695 | struct kvm_memory_slot old, | 696 | struct kvm_memory_slot old, |
696 | int user_alloc) | 697 | struct kvm_userspace_memory_region *mem, |
698 | int user_alloc) | ||
697 | { | 699 | { |
698 | int i; | ||
699 | struct kvm_vcpu *vcpu; | ||
700 | |||
701 | /* A few sanity checks. We can have exactly one memory slot which has | 700 | /* A few sanity checks. We can have exactly one memory slot which has |
702 | to start at guest virtual zero and which has to be located at a | 701 | to start at guest virtual zero and which has to be located at a |
703 | page boundary in userland and which has to end at a page boundary. | 702 | page boundary in userland and which has to end at a page boundary. |
@@ -720,14 +719,23 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
720 | if (!user_alloc) | 719 | if (!user_alloc) |
721 | return -EINVAL; | 720 | return -EINVAL; |
722 | 721 | ||
722 | return 0; | ||
723 | } | ||
724 | |||
725 | void kvm_arch_commit_memory_region(struct kvm *kvm, | ||
726 | struct kvm_userspace_memory_region *mem, | ||
727 | struct kvm_memory_slot old, | ||
728 | int user_alloc) | ||
729 | { | ||
730 | int i; | ||
731 | struct kvm_vcpu *vcpu; | ||
732 | |||
723 | /* request update of sie control block for all available vcpus */ | 733 | /* request update of sie control block for all available vcpus */ |
724 | kvm_for_each_vcpu(i, vcpu, kvm) { | 734 | kvm_for_each_vcpu(i, vcpu, kvm) { |
725 | if (test_and_set_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests)) | 735 | if (test_and_set_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests)) |
726 | continue; | 736 | continue; |
727 | kvm_s390_inject_sigp_stop(vcpu, ACTION_RELOADVCPU_ON_STOP); | 737 | kvm_s390_inject_sigp_stop(vcpu, ACTION_RELOADVCPU_ON_STOP); |
728 | } | 738 | } |
729 | |||
730 | return 0; | ||
731 | } | 739 | } |
732 | 740 | ||
733 | void kvm_arch_flush_shadow(struct kvm *kvm) | 741 | void kvm_arch_flush_shadow(struct kvm *kvm) |
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 06cce8285ba0..60f09ab3672c 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -67,10 +67,14 @@ static inline long kvm_s390_vcpu_get_memsize(struct kvm_vcpu *vcpu) | |||
67 | 67 | ||
68 | static inline void kvm_s390_vcpu_set_mem(struct kvm_vcpu *vcpu) | 68 | static inline void kvm_s390_vcpu_set_mem(struct kvm_vcpu *vcpu) |
69 | { | 69 | { |
70 | int idx; | ||
70 | struct kvm_memory_slot *mem; | 71 | struct kvm_memory_slot *mem; |
72 | struct kvm_memslots *memslots; | ||
71 | 73 | ||
72 | down_read(&vcpu->kvm->slots_lock); | 74 | idx = srcu_read_lock(&vcpu->kvm->srcu); |
73 | mem = &vcpu->kvm->memslots[0]; | 75 | memslots = rcu_dereference(vcpu->kvm->memslots); |
76 | |||
77 | mem = &memslots->memslots[0]; | ||
74 | 78 | ||
75 | vcpu->arch.sie_block->gmsor = mem->userspace_addr; | 79 | vcpu->arch.sie_block->gmsor = mem->userspace_addr; |
76 | vcpu->arch.sie_block->gmslm = | 80 | vcpu->arch.sie_block->gmslm = |
@@ -78,7 +82,7 @@ static inline void kvm_s390_vcpu_set_mem(struct kvm_vcpu *vcpu) | |||
78 | (mem->npages << PAGE_SHIFT) + | 82 | (mem->npages << PAGE_SHIFT) + |
79 | VIRTIODESCSPACE - 1ul; | 83 | VIRTIODESCSPACE - 1ul; |
80 | 84 | ||
81 | up_read(&vcpu->kvm->slots_lock); | 85 | srcu_read_unlock(&vcpu->kvm->srcu, idx); |
82 | } | 86 | } |
83 | 87 | ||
84 | /* implemented in priv.c */ | 88 | /* implemented in priv.c */ |