From: Alexander Graf Date: Sun, 22 Jun 2014 21:23:15 +0000 Subject: [PATCH 11/33] KVM: PPC: BookE: Use common critical section helper Message-Id: <1403472217-22263-12-git-send-email-agraf@suse.de> List-Id: References: <1403472217-22263-1-git-send-email-agraf@suse.de> In-Reply-To: <1403472217-22263-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org Cc: kvm@vger.kernel.org We now have common code to detect whether we are inside a critical section. Make use of it on BookE. Signed-off-by: Alexander Graf --- arch/powerpc/kvm/booke.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 58d9b6c..eb00d5d 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -349,24 +349,11 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu, int allowed = 0; ulong msr_mask = 0; bool update_esr = false, update_dear = false, update_epr = false; - ulong crit_raw = vcpu->arch.shared->critical; - ulong crit_r1 = kvmppc_get_gpr(vcpu, 1); - bool crit; + bool crit = kvmppc_critical_section(vcpu); bool keep_irq = false; enum int_class int_class; ulong new_msr = vcpu->arch.shared->msr; - /* Truncate crit indicators in 32 bit mode */ - if (!(vcpu->arch.shared->msr & MSR_SF)) { - crit_raw &= 0xffffffff; - crit_r1 &= 0xffffffff; - } - - /* Critical section when crit = r1 */ - crit = (crit_raw = crit_r1); - /* ... and we're in supervisor mode */ - crit = crit && !(vcpu->arch.shared->msr & MSR_PR); - if (priority = BOOKE_IRQPRIO_EXTERNAL_LEVEL) { priority = BOOKE_IRQPRIO_EXTERNAL; keep_irq = true; -- 1.8.1.4