Commit 9bd880a2 authored by Tiejun Chen's avatar Tiejun Chen Committed by Alexander Graf

KVM: PPC: Book3E HV: call RECONCILE_IRQ_STATE to sync the software state

Rather than calling hard_irq_disable() when we're back in C code
we can just call RECONCILE_IRQ_STATE to soft disable IRQs while
we're already in hard disabled state.

This should be functionally equivalent to the code before, but
cleaner and faster.
Signed-off-by: default avatarTiejun Chen <tiejun.chen@windriver.com>
[agraf: fix comment, commit message]
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 08c9a188
...@@ -879,17 +879,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -879,17 +879,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
int s; int s;
int idx; int idx;
#ifdef CONFIG_PPC64
WARN_ON(local_paca->irq_happened != 0);
#endif
/*
* We enter with interrupts disabled in hardware, but
* we need to call hard_irq_disable anyway to ensure that
* the software state is kept in sync.
*/
hard_irq_disable();
/* update before a new last_exit_type is rewritten */ /* update before a new last_exit_type is rewritten */
kvmppc_update_timing_stats(vcpu); kvmppc_update_timing_stats(vcpu);
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
#include <asm/exception-64e.h> #include <asm/exception-64e.h>
#include <asm/hw_irq.h>
#include <asm/irqflags.h>
#else #else
#include "../kernel/head_booke.h" /* for THREAD_NORMSAVE() */ #include "../kernel/head_booke.h" /* for THREAD_NORMSAVE() */
#endif #endif
...@@ -465,6 +467,15 @@ _GLOBAL(kvmppc_resume_host) ...@@ -465,6 +467,15 @@ _GLOBAL(kvmppc_resume_host)
mtspr SPRN_EPCR, r3 mtspr SPRN_EPCR, r3
isync isync
#ifdef CONFIG_64BIT
/*
* We enter with interrupts disabled in hardware, but
* we need to call RECONCILE_IRQ_STATE to ensure
* that the software state is kept in sync.
*/
RECONCILE_IRQ_STATE(r3,r5)
#endif
/* Switch to kernel stack and jump to handler. */ /* Switch to kernel stack and jump to handler. */
PPC_LL r3, HOST_RUN(r1) PPC_LL r3, HOST_RUN(r1)
mr r5, r14 /* intno */ mr r5, r14 /* intno */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment