From 1321c76d96910c2c807207f3fdfeb560c598ca60 Mon Sep 17 00:00:00 2001 From: Jun Nakajima Date: Fri, 4 Mar 2011 17:17:45 -0800 Subject: x86: Enable KVM mode for Android x86 emulator (update/rebase) This patch enables KVM mode on x86 Linux to boost performance of x86 emulaiton if the hardware-based virtualization feature is present on the host machine. Change-Id: I4b24474b3ec115a3b9a7bf017801f4f610253b09 Signed-off-by: Xiaohui Xin Signed-off-by: Yunhong Jiang Signed-off-by: Jun Nakajima --- hw/goldfish_device.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'hw/goldfish_device.c') diff --git a/hw/goldfish_device.c b/hw/goldfish_device.c index 3ced4ce..e98161a 100644 --- a/hw/goldfish_device.c +++ b/hw/goldfish_device.c @@ -12,6 +12,9 @@ #include "qemu_file.h" #include "arm_pic.h" #include "goldfish_device.h" +#ifdef TARGET_I386 +#include "kvm.h" +#endif #define PDEV_BUS_OP_DONE (0x00) #define PDEV_BUS_OP_REMOVE_DEV (0x04) @@ -148,8 +151,13 @@ static void goldfish_bus_write(void *opaque, target_phys_addr_t offset, uint32_t }; break; case PDEV_BUS_GET_NAME: - if(s->current) + if(s->current) { +#ifdef TARGET_I386 + if(kvm_enabled()) + cpu_synchronize_state(cpu_single_env, 0); +#endif cpu_memory_rw_debug(cpu_single_env, value, (void*)s->current->name, strlen(s->current->name), 1); + } break; default: cpu_abort (cpu_single_env, "goldfish_bus_write: Bad offset %x\n", offset); -- cgit v1.1