aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiantao Zhang <xiantao.zhang@intel.com>2008-08-30 08:36:03 +0800
committerAvi Kivity <avi@qumranet.com>2008-09-01 13:55:53 +0300
commit97fb54e1e49d989a44b64b95fc088b112bd7711c (patch)
tree71d8ea4939fb307604144d5b70ec79a3e1077176 /qemu-kvm-ia64.c
parentRegenerate bios for CMOS NVRAM avoidance (diff)
downloadqemu-kvm-97fb54e1e49d989a44b64b95fc088b112bd7711c.tar.gz
qemu-kvm-97fb54e1e49d989a44b64b95fc088b112bd7711c.tar.bz2
qemu-kvm-97fb54e1e49d989a44b64b95fc088b112bd7711c.zip
Add get/set_mpstate for ia64
Add get/set_mpstate for Ipf. Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'qemu-kvm-ia64.c')
-rw-r--r--qemu-kvm-ia64.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/qemu-kvm-ia64.c b/qemu-kvm-ia64.c
index d227d220b..042c7ed19 100644
--- a/qemu-kvm-ia64.c
+++ b/qemu-kvm-ia64.c
@@ -62,6 +62,43 @@ void kvm_arch_update_regs_for_sipi(CPUState *env)
{
}
+void kvm_save_mpstate(CPUState *env)
+{
+#ifdef KVM_CAP_MP_STATE
+ int r;
+ struct kvm_mp_state mp_state;
+
+ r = kvm_get_mpstate(kvm_context, env->cpu_index, &mp_state);
+ if (r < 0)
+ env->mp_state = -1;
+ else
+ env->mp_state = mp_state.mp_state;
+#endif
+}
+
+void kvm_load_mpstate(CPUState *env)
+{
+#ifdef KVM_CAP_MP_STATE
+ struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
+
+ /*
+ * -1 indicates that the host did not support GET_MP_STATE ioctl,
+ * so don't touch it.
+ */
+ if (env->mp_state != -1)
+ kvm_set_mpstate(kvm_context, env->cpu_index, &mp_state);
+#endif
+}
+
void kvm_arch_cpu_reset(CPUState *env)
{
+ if (kvm_irqchip_in_kernel(kvm_context)) {
+#ifdef KVM_CAP_MP_STATE
+ kvm_reset_mpstate(kvm_context, env->cpu_index);
+#endif
+ } else {
+ env->interrupt_request &= ~CPU_INTERRUPT_HARD;
+ env->halted = 1;
+ env->exception_index = EXCP_HLT;
+ }
}