Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348534
b: refs/heads/master
c: 9b132fb
h: refs/heads/master
v: v3
  • Loading branch information
Li Zhong authored and Gleb Natapov committed Dec 18, 2012
1 parent 5ab6498 commit fe9fb07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d591390da94234d5b8eb1bbd9f2a25d2e780d528
refs/heads/master: 9b132fbe5419d789f1ef396bed5eb66a365dd1e9
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/include/uapi/asm/kvm_para.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct kvm_vcpu_arch_shared {

#define KVM_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)

#include <asm/epapr_hcalls.h>
#include <uapi/asm/epapr_hcalls.h>

#define KVM_FEATURE_MAGIC_PAGE 1

Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/powerpc/kvm/book3s_hv_ras.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ static void flush_tlb_power7(struct kvm_vcpu *vcpu)
static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)
{
unsigned long srr1 = vcpu->arch.shregs.msr;
#ifdef CONFIG_PPC_POWERNV
struct opal_machine_check_event *opal_evt;
#endif
long handled = 1;

if (srr1 & SRR1_MC_LDSTERR) {
Expand Down Expand Up @@ -119,7 +117,6 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)
handled = 0;
}

#ifdef CONFIG_PPC_POWERNV
/*
* See if OPAL has already handled the condition.
* We assume that if the condition is recovered then OPAL
Expand All @@ -134,7 +131,6 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)

if (handled)
opal_evt->in_use = 0;
#endif

return handled;
}
Expand Down
12 changes: 10 additions & 2 deletions trunk/arch/x86/kernel/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <asm/apicdef.h>
#include <asm/hypervisor.h>
#include <asm/kvm_guest.h>
#include <asm/context_tracking.h>

static int kvmapf = 1;

Expand Down Expand Up @@ -121,13 +122,17 @@ void kvm_async_pf_task_wait(u32 token)
struct kvm_task_sleep_node n, *e;
DEFINE_WAIT(wait);

rcu_irq_enter();

spin_lock(&b->lock);
e = _find_apf_task(b, token);
if (e) {
/* dummy entry exist -> wake up was delivered ahead of PF */
hlist_del(&e->link);
kfree(e);
spin_unlock(&b->lock);

rcu_irq_exit();
return;
}

Expand All @@ -152,13 +157,16 @@ void kvm_async_pf_task_wait(u32 token)
/*
* We cannot reschedule. So halt.
*/
rcu_irq_exit();
native_safe_halt();
rcu_irq_enter();
local_irq_disable();
}
}
if (!n.halted)
finish_wait(&n.wq, &wait);

rcu_irq_exit();
return;
}
EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait);
Expand Down Expand Up @@ -252,10 +260,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();
exception_enter(regs);
exit_idle();
kvm_async_pf_task_wait((u32)read_cr2());
rcu_irq_exit();
exception_exit(regs);
break;
case KVM_PV_REASON_PAGE_READY:
rcu_irq_enter();
Expand Down

0 comments on commit fe9fb07

Please sign in to comment.