[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 01/32] KVM: Don't assume that mpstate exists with in-k
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 01/32] KVM: Don't assume that mpstate exists with in-kernel PIC always |
Date: |
Sun, 30 Jun 2013 03:44:38 +0200 |
On PPC, we don't support MP state. So far it's not necessary and I'm
not convinced yet that we really need to support it ever.
However, the current idle logic in QEMU assumes that an in-kernel PIC
also means we support MP state. This assumption is not true anymore.
Let's split up the two cases into two different variables. That way
PPC can expose an in-kernel PIC, while not implementing MP state.
Signed-off-by: Alexander Graf <address@hidden>
CC: Jan Kiszka <address@hidden>
---
cpus.c | 2 +-
include/sysemu/kvm.h | 10 ++++++++++
kvm-all.c | 2 ++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 86571f9..20958e5 100644
--- a/cpus.c
+++ b/cpus.c
@@ -71,7 +71,7 @@ static bool cpu_thread_is_idle(CPUState *cpu)
return true;
}
if (!cpu->halted || qemu_cpu_has_work(cpu) ||
- kvm_async_interrupts_enabled()) {
+ kvm_halt_in_kernel()) {
return false;
}
return true;
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index fe8bc40..24c8e95 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -42,6 +42,7 @@
extern bool kvm_allowed;
extern bool kvm_kernel_irqchip;
extern bool kvm_async_interrupts_allowed;
+extern bool kvm_halt_in_kernel_allowed;
extern bool kvm_irqfds_allowed;
extern bool kvm_msi_via_irqfd_allowed;
extern bool kvm_gsi_routing_allowed;
@@ -73,6 +74,14 @@ extern bool kvm_readonly_mem_allowed;
#define kvm_async_interrupts_enabled() (kvm_async_interrupts_allowed)
/**
+ * kvm_halt_in_kernel
+ *
+ * Returns: true if halted cpus should still get a KVM_RUN ioctl to run
+ * inside of kernel space. This only works if MP state is implemented.
+ */
+#define kvm_halt_in_kernel() (kvm_halt_in_kernel_allowed)
+
+/**
* kvm_irqfds_enabled:
*
* Returns: true if we can use irqfds to inject interrupts into
@@ -110,6 +119,7 @@ extern bool kvm_readonly_mem_allowed;
#define kvm_enabled() (0)
#define kvm_irqchip_in_kernel() (false)
#define kvm_async_interrupts_enabled() (false)
+#define kvm_halt_in_kernel() (false)
#define kvm_irqfds_enabled() (false)
#define kvm_msi_via_irqfd_enabled() (false)
#define kvm_gsi_routing_allowed() (false)
diff --git a/kvm-all.c b/kvm-all.c
index 7a1684e..82ecebb 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -107,6 +107,7 @@ struct KVMState
KVMState *kvm_state;
bool kvm_kernel_irqchip;
bool kvm_async_interrupts_allowed;
+bool kvm_halt_in_kernel_allowed;
bool kvm_irqfds_allowed;
bool kvm_msi_via_irqfd_allowed;
bool kvm_gsi_routing_allowed;
@@ -1303,6 +1304,7 @@ static int kvm_irqchip_create(KVMState *s)
* interrupt delivery (though the reverse is not necessarily true)
*/
kvm_async_interrupts_allowed = true;
+ kvm_halt_in_kernel_allowed = true;
kvm_init_irq_routing(s);
--
1.8.1.4
- [Qemu-ppc] [PULL 00/32] ppc patch queue 2013-06-30, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 02/32] KVM: Export kvm_init_irq_routing, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 06/32] KVM: PIC: Only commit irq routing when necessary, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 03/32] KVM: MSI: Swap payload to native endianness, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 16/32] ppc: do not register IABR SPR twice for 603e, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 01/32] KVM: Don't assume that mpstate exists with in-kernel PIC always,
Alexander Graf <=
- [Qemu-ppc] [PATCH 26/32] PPC: Fix GDB read on code area for PPC6xx, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 07/32] PPC: Add non-kvm stub file, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 12/32] mpc8544_guts: Fix MemoryRegion name, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 13/32] mpc8544_guts: QOM'ify, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 29/32] PPC: Newworld: Add uninorth token register, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 09/32] intc/openpic: QOM'ify, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 14/32] mpc8544_guts: Turn qdev initfn into instance_init, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 19/32] pseries: Fix compiler warning (conversion of pointer to integral value), Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 05/32] PPC: e500: factor out mpic init code, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 10/32] intc/openpic: Convert to QOM realize, Alexander Graf, 2013/06/29