aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-12-01 12:35:26 +0000
committerPeter Maydell <peter.maydell@linaro.org>2011-12-01 12:35:26 +0000
commitb0081b145f52e9e15981c1c9e8d0b50b2ea1be14 (patch)
tree4d882b48868cccdd22cf2893e27b3c8648b8cbf8
parentc67875d4db06fc4cc7e0a3a7046fdbccdc0f7ef9 (diff)
downloadqemu-arm-kvm-work.tar.gz
target-arm/kvm.c: Pass CPU index to KVM_IRQ_LINE ioctlkvm-work
Pass the CPU index number to the KVM_IRQ_LINE ioctl in the format the kernel expects. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target-arm/kvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index 6ea96e56dc..f0899f60cc 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -122,7 +122,7 @@ int kvm_arch_get_registers(CPUState *env)
int kvm_arch_interrupt(CPUState *env, int irq, int level)
{
struct kvm_irq_level irq_level;
- int vcpu_idx = 0; /* Assume non-SMP for now */
+ int vcpu_idx = env->cpu_index;
KVMState *s = kvm_state;
int ret;
@@ -133,10 +133,10 @@ int kvm_arch_interrupt(CPUState *env, int irq, int level)
switch (irq) {
case ARM_PIC_CPU_IRQ:
- irq_level.irq = KVM_ARM_IRQ_LINE * vcpu_idx;
+ irq_level.irq = KVM_ARM_IRQ_LINE | (vcpu_idx << 1);
break;
case ARM_PIC_CPU_FIQ:
- irq_level.irq = (KVM_ARM_FIQ_LINE * vcpu_idx) + 1;
+ irq_level.irq = KVM_ARM_FIQ_LINE | (vcpu_idx << 1);
break;
default:
fprintf(stderr, "unsupported ARM irq injection\n");