Skip to content
This repository
Browse code

Merge tag 'kvm-3.7-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Avi Kivity:
 "KVM updates for 3.7-rc2"

* tag 'kvm-3.7-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM guest: exit idleness when handling KVM_PV_REASON_PAGE_NOT_PRESENT
  KVM: apic: fix LDR calculation in x2apic mode
  KVM: MMU: fix release noslot pfn
  • Loading branch information...
commit 3d0ceac129f3ea0b125289055a3aa7519d38df77 2 parents e17b131 + c5e015d
Linus Torvalds authored October 24, 2012
3  arch/x86/kernel/kvm.c
@@ -247,7 +247,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)
247 247
 		break;
248 248
 	case KVM_PV_REASON_PAGE_NOT_PRESENT:
249 249
 		/* page is swapped out by the host. */
  250
+		rcu_irq_enter();
  251
+		exit_idle();
250 252
 		kvm_async_pf_task_wait((u32)read_cr2());
  253
+		rcu_irq_exit();
251 254
 		break;
252 255
 	case KVM_PV_REASON_PAGE_READY:
253 256
 		rcu_irq_enter();
2  arch/x86/kvm/lapic.c
@@ -1311,7 +1311,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
1311 1311
 	vcpu->arch.apic_base = value;
1312 1312
 	if (apic_x2apic_mode(apic)) {
1313 1313
 		u32 id = kvm_apic_id(apic);
1314  
-		u32 ldr = ((id & ~0xf) << 16) | (1 << (id & 0xf));
  1314
+		u32 ldr = ((id >> 4) << 16) | (1 << (id & 0xf));
1315 1315
 		kvm_apic_set_ldr(apic, ldr);
1316 1316
 	}
1317 1317
 	apic->base_address = apic->vcpu->arch.apic_base &
3  arch/x86/kvm/mmu.c
@@ -2497,8 +2497,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
2497 2497
 		}
2498 2498
 	}
2499 2499
 
2500  
-	if (!is_error_pfn(pfn))
2501  
-		kvm_release_pfn_clean(pfn);
  2500
+	kvm_release_pfn_clean(pfn);
2502 2501
 }
2503 2502
 
2504 2503
 static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
4  virt/kvm/kvm_main.c
@@ -1322,9 +1322,7 @@ EXPORT_SYMBOL_GPL(kvm_release_page_clean);
1322 1322
 
1323 1323
 void kvm_release_pfn_clean(pfn_t pfn)
1324 1324
 {
1325  
-	WARN_ON(is_error_pfn(pfn));
1326  
-
1327  
-	if (!kvm_is_mmio_pfn(pfn))
  1325
+	if (!is_error_pfn(pfn) && !kvm_is_mmio_pfn(pfn))
1328 1326
 		put_page(pfn_to_page(pfn));
1329 1327
 }
1330 1328
 EXPORT_SYMBOL_GPL(kvm_release_pfn_clean);

0 notes on commit 3d0ceac

Please sign in to comment.
Something went wrong with that request. Please try again.