From: Zhang Xiantao <[EMAIL PROTECTED]> Date: Mon, 3 Dec 2007 16:29:16 +0800 Subject: [PATCH] kvm: qemu, Add kvm_arch_halt to handle arch-specific halt operations. In this patch, one arch-specific interface kvm_arch_halt is added to handle arch halts. Signed-off-by: Zhang Xiantao <[EMAIL PROTECTED]> --- qemu/qemu-kvm-x86.c | 12 ++++++++++++ qemu/qemu-kvm.c | 10 +--------- qemu/qemu-kvm.h | 1 + 3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
index a5df6d0..3eeb419 100644
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -553,4 +553,16 @@ int kvm_arch_qemu_init_env(CPUState *cenv)
return 0;
}
+int kvm_arch_halt(void *opaque, int vcpu)
+{
+ CPUState *env = cpu_single_env;
+
+ if (!((env->interrupt_request & CPU_INTERRUPT_HARD) &&
+ (env->eflags & IF_MASK))) {
+ env->hflags |= HF_HALTED_MASK;
+ env->exception_index = EXCP_HLT;
+ }
+ return 1;
+}
+
#endif
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 2812a89..a20a393 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -570,15 +570,7 @@ static int kvm_io_window(void *opaque)
static int kvm_halt(void *opaque, int vcpu)
{
- CPUState *env = cpu_single_env;
-
- if (!((env->interrupt_request & CPU_INTERRUPT_HARD) &&
- (env->eflags & IF_MASK))) {
- env->hflags |= HF_HALTED_MASK;
- env->exception_index = EXCP_HLT;
- }
-
- return 1;
+ return kvm_arch_halt(opaque, vcpu);
}
static int kvm_shutdown(void *opaque, int vcpu)
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
index 212e1ca..2f0e696 100644
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -33,6 +33,7 @@ int kvm_arch_qemu_create_context(void);
void kvm_arch_save_regs(CPUState *env);
void kvm_arch_load_regs(CPUState *env);
int kvm_arch_qemu_init_env(CPUState *cenv);
+int kvm_arch_halt(void *opaque, int vcpu);
#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
#define BITMAP_SIZE(m) (ALIGN(((m)>>TARGET_PAGE_BITS), HOST_LONG_BITS)
/ 8)
--
1.5.1.2
0005-kvm-qemu-Add-kvm_arch_halt-to-handle-arch-specific.patch
Description: 0005-kvm-qemu-Add-kvm_arch_halt-to-handle-arch-specific.patch
------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________ kvm-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kvm-devel
