aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/booke.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-07-29 08:47:51 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:46 -0400
commit90bba358873dc96a6746f0df453a0a8ca3d6b86e (patch)
tree28fed8ca78b7f88f631ead5d1f4ea7d2c8ba1378 /arch/powerpc/kvm/booke.c
parentfad93fe1d452960eb838109222cc949eb77f2859 (diff)
KVM: PPC: Tell guest about pending interrupts
When the guest turns on interrupts again, it needs to know if we have an interrupt pending for it. Because if so, it should rather get out of guest context and get the interrupt. So we introduce a new field in the shared page that we use to tell the guest that there's a pending interrupt lying around. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/booke.c')
-rw-r--r--arch/powerpc/kvm/booke.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 104d0ee8c8aa..c604277011a6 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -224,6 +224,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
224void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu) 224void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
225{ 225{
226 unsigned long *pending = &vcpu->arch.pending_exceptions; 226 unsigned long *pending = &vcpu->arch.pending_exceptions;
227 unsigned long old_pending = vcpu->arch.pending_exceptions;
227 unsigned int priority; 228 unsigned int priority;
228 229
229 priority = __ffs(*pending); 230 priority = __ffs(*pending);
@@ -235,6 +236,12 @@ void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
235 BITS_PER_BYTE * sizeof(*pending), 236 BITS_PER_BYTE * sizeof(*pending),
236 priority + 1); 237 priority + 1);
237 } 238 }
239
240 /* Tell the guest about our interrupt status */
241 if (*pending)
242 vcpu->arch.shared->int_pending = 1;
243 else if (old_pending)
244 vcpu->arch.shared->int_pending = 0;
238} 245}
239 246
240/** 247/**