Skip to content

Commit

Permalink
Merge tag 'kvm-3.7-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Browse files Browse the repository at this point in the history
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
torvalds committed Oct 24, 2012
2 parents e17b131 + c5e015d commit 3d0ceac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kernel/kvm.c
Expand Up @@ -247,7 +247,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)
break;
case KVM_PV_REASON_PAGE_NOT_PRESENT:
/* page is swapped out by the host. */
rcu_irq_enter();
exit_idle();
kvm_async_pf_task_wait((u32)read_cr2());
rcu_irq_exit();
break;
case KVM_PV_REASON_PAGE_READY:
rcu_irq_enter();
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kvm/lapic.c
Expand Up @@ -1311,7 +1311,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
vcpu->arch.apic_base = value;
if (apic_x2apic_mode(apic)) {
u32 id = kvm_apic_id(apic);
u32 ldr = ((id & ~0xf) << 16) | (1 << (id & 0xf));
u32 ldr = ((id >> 4) << 16) | (1 << (id & 0xf));
kvm_apic_set_ldr(apic, ldr);
}
apic->base_address = apic->vcpu->arch.apic_base &
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/kvm/mmu.c
Expand Up @@ -2497,8 +2497,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
}
}

if (!is_error_pfn(pfn))
kvm_release_pfn_clean(pfn);
kvm_release_pfn_clean(pfn);
}

static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
Expand Down
4 changes: 1 addition & 3 deletions virt/kvm/kvm_main.c
Expand Up @@ -1322,9 +1322,7 @@ EXPORT_SYMBOL_GPL(kvm_release_page_clean);

void kvm_release_pfn_clean(pfn_t pfn)
{
WARN_ON(is_error_pfn(pfn));

if (!kvm_is_mmio_pfn(pfn))
if (!is_error_pfn(pfn) && !kvm_is_mmio_pfn(pfn))
put_page(pfn_to_page(pfn));
}
EXPORT_SYMBOL_GPL(kvm_release_pfn_clean);
Expand Down

0 comments on commit 3d0ceac

Please sign in to comment.