From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: [PULL 14/36] KVM: PPC: Book3E HV: call RECONCILE_IRQ_STATE to sync the software state Date: Wed, 29 Jan 2014 17:12:53 +0100 Message-ID: <1391011995-4891-15-git-send-email-agraf@suse.de> References: <1391011995-4891-1-git-send-email-agraf@suse.de> Cc: kvm-ppc@vger.kernel.org, gleb@redhat.com, Paolo Bonzini , Tiejun Chen To: kvm@vger.kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:54476 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752742AbaA2QNX (ORCPT ); Wed, 29 Jan 2014 11:13:23 -0500 In-Reply-To: <1391011995-4891-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: From: Tiejun Chen 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: Tiejun Chen [agraf: fix comment, commit message] Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c | 11 ----------- arch/powerpc/kvm/bookehv_interrupts.S | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 54ee1c0..6a8c32e 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -879,17 +879,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, int s; 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 */ kvmppc_update_timing_stats(vcpu); diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S index e8ed7d6..be3de1d 100644 --- a/arch/powerpc/kvm/bookehv_interrupts.S +++ b/arch/powerpc/kvm/bookehv_interrupts.S @@ -33,6 +33,8 @@ #ifdef CONFIG_64BIT #include +#include +#include #else #include "../kernel/head_booke.h" /* for THREAD_NORMSAVE() */ #endif @@ -465,6 +467,15 @@ _GLOBAL(kvmppc_resume_host) mtspr SPRN_EPCR, r3 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. */ PPC_LL r3, HOST_RUN(r1) mr r5, r14 /* intno */ -- 1.8.1.4