Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'kvm-updates/3.4' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull a few KVM fixes from Avi Kivity:
"A bunch of powerpc KVM fixes, a guest and a host RCU fix (unrelated),
and a small build fix."

* 'kvm-updates/3.4' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: Resolve RCU vs. async page fault problem
KVM: VMX: vmx_set_cr0 expects kvm->srcu locked
KVM: PMU: Fix integer constant is too large warning in kvm_pmu_set_msr()
KVM: PPC: Book3S: PR: Fix preemption
KVM: PPC: Save/Restore CR over vcpu_run
KVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry
KVM: PPC: Book3S HV: Fix kvm_alloc_linear in case where no linears exist
KVM: PPC: Book3S: Compile fix for ppc32 in HIOR access code

+36 -12
+5 -4
arch/powerpc/kvm/book3s_hv_builtin.c
··· 173 173 174 174 static struct kvmppc_linear_info *kvm_alloc_linear(int type) 175 175 { 176 - struct kvmppc_linear_info *ri; 176 + struct kvmppc_linear_info *ri, *ret; 177 177 178 - ri = NULL; 178 + ret = NULL; 179 179 spin_lock(&linear_lock); 180 180 list_for_each_entry(ri, &free_linears, list) { 181 181 if (ri->type != type) ··· 183 183 184 184 list_del(&ri->list); 185 185 atomic_inc(&ri->use_count); 186 + memset(ri->base_virt, 0, ri->npages << PAGE_SHIFT); 187 + ret = ri; 186 188 break; 187 189 } 188 190 spin_unlock(&linear_lock); 189 - memset(ri->base_virt, 0, ri->npages << PAGE_SHIFT); 190 - return ri; 191 + return ret; 191 192 } 192 193 193 194 static void kvm_release_linear(struct kvmppc_linear_info *ri)
+6 -2
arch/powerpc/kvm/book3s_hv_interrupts.S
··· 46 46 /* Save host state to the stack */ 47 47 stdu r1, -SWITCH_FRAME_SIZE(r1) 48 48 49 - /* Save non-volatile registers (r14 - r31) */ 49 + /* Save non-volatile registers (r14 - r31) and CR */ 50 50 SAVE_NVGPRS(r1) 51 + mfcr r3 52 + std r3, _CCR(r1) 51 53 52 54 /* Save host DSCR */ 53 55 BEGIN_FTR_SECTION ··· 159 157 * R13 = PACA 160 158 */ 161 159 162 - /* Restore non-volatile host registers (r14 - r31) */ 160 + /* Restore non-volatile host registers (r14 - r31) and CR */ 163 161 REST_NVGPRS(r1) 162 + ld r4, _CCR(r1) 163 + mtcr r4 164 164 165 165 addi r1, r1, SWITCH_FRAME_SIZE 166 166 ld r0, PPC_LR_STKOFF(r1)
+7
arch/powerpc/kvm/book3s_interrupts.S
··· 84 84 /* Save non-volatile registers (r14 - r31) */ 85 85 SAVE_NVGPRS(r1) 86 86 87 + /* Save CR */ 88 + mfcr r14 89 + stw r14, _CCR(r1) 90 + 87 91 /* Save LR */ 88 92 PPC_STL r0, _LINK(r1) 89 93 ··· 168 164 169 165 PPC_LL r4, _LINK(r1) 170 166 mtlr r4 167 + 168 + lwz r14, _CCR(r1) 169 + mtcr r14 171 170 172 171 /* Restore non-volatile host registers (r14 - r31) */ 173 172 REST_NVGPRS(r1)
+5 -4
arch/powerpc/kvm/book3s_pr.c
··· 777 777 } 778 778 } 779 779 780 + preempt_disable(); 780 781 if (!(r & RESUME_HOST)) { 781 782 /* To avoid clobbering exit_reason, only check for signals if 782 783 * we aren't already exiting to userspace for some other ··· 799 798 run->exit_reason = KVM_EXIT_INTR; 800 799 r = -EINTR; 801 800 } else { 802 - preempt_disable(); 803 - 804 801 /* In case an interrupt came in that was triggered 805 802 * from userspace (like DEC), we need to check what 806 803 * to inject now! */ ··· 880 881 881 882 switch (reg->id) { 882 883 case KVM_REG_PPC_HIOR: 883 - r = put_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr); 884 + r = copy_to_user((u64 __user *)(long)reg->addr, 885 + &to_book3s(vcpu)->hior, sizeof(u64)); 884 886 break; 885 887 default: 886 888 break; ··· 896 896 897 897 switch (reg->id) { 898 898 case KVM_REG_PPC_HIOR: 899 - r = get_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr); 899 + r = copy_from_user(&to_book3s(vcpu)->hior, 900 + (u64 __user *)(long)reg->addr, sizeof(u64)); 900 901 if (!r) 901 902 to_book3s(vcpu)->hior_explicit = true; 902 903 break;
+6 -1
arch/powerpc/kvm/booke_interrupts.S
··· 34 34 /* r2 is special: it holds 'current', and it made nonvolatile in the 35 35 * kernel with the -ffixed-r2 gcc option. */ 36 36 #define HOST_R2 12 37 - #define HOST_NV_GPRS 16 37 + #define HOST_CR 16 38 + #define HOST_NV_GPRS 20 38 39 #define HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) 39 40 #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(31) + 4) 40 41 #define HOST_STACK_SIZE (((HOST_MIN_STACK_SIZE + 15) / 16) * 16) /* Align. */ ··· 297 296 298 297 /* Return to kvm_vcpu_run(). */ 299 298 lwz r4, HOST_STACK_LR(r1) 299 + lwz r5, HOST_CR(r1) 300 300 addi r1, r1, HOST_STACK_SIZE 301 301 mtlr r4 302 + mtcr r5 302 303 /* r3 still contains the return code from kvmppc_handle_exit(). */ 303 304 blr 304 305 ··· 317 314 stw r3, HOST_RUN(r1) 318 315 mflr r3 319 316 stw r3, HOST_STACK_LR(r1) 317 + mfcr r5 318 + stw r5, HOST_CR(r1) 320 319 321 320 /* Save host non-volatile register state to stack. */ 322 321 stw r14, HOST_NV_GPR(r14)(r1)
+4
arch/x86/kernel/kvm.c
··· 38 38 #include <asm/traps.h> 39 39 #include <asm/desc.h> 40 40 #include <asm/tlbflush.h> 41 + #include <asm/idle.h> 41 42 42 43 static int kvmapf = 1; 43 44 ··· 254 253 kvm_async_pf_task_wait((u32)read_cr2()); 255 254 break; 256 255 case KVM_PV_REASON_PAGE_READY: 256 + rcu_irq_enter(); 257 + exit_idle(); 257 258 kvm_async_pf_task_wake((u32)read_cr2()); 259 + rcu_irq_exit(); 258 260 break; 259 261 } 260 262 }
+1 -1
arch/x86/kvm/pmu.c
··· 369 369 case MSR_CORE_PERF_FIXED_CTR_CTRL: 370 370 if (pmu->fixed_ctr_ctrl == data) 371 371 return 0; 372 - if (!(data & 0xfffffffffffff444)) { 372 + if (!(data & 0xfffffffffffff444ull)) { 373 373 reprogram_fixed_counters(pmu, data); 374 374 return 0; 375 375 }
+2
arch/x86/kvm/vmx.c
··· 3906 3906 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); 3907 3907 3908 3908 vmx->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET; 3909 + vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); 3909 3910 vmx_set_cr0(&vmx->vcpu, kvm_read_cr0(vcpu)); /* enter rmode */ 3911 + srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); 3910 3912 vmx_set_cr4(&vmx->vcpu, 0); 3911 3913 vmx_set_efer(&vmx->vcpu, 0); 3912 3914 vmx_fpu_activate(&vmx->vcpu);