From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6GG7-0002yH-8z for qemu-devel@nongnu.org; Mon, 14 Nov 2016 07:21:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6GG2-00075q-RH for qemu-devel@nongnu.org; Mon, 14 Nov 2016 07:21:11 -0500 Received: from smtp.mail.uni-mannheim.de ([134.155.96.80]:43673) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6GG2-00075U-Jz for qemu-devel@nongnu.org; Mon, 14 Nov 2016 07:21:06 -0500 References: From: Stefan Weil Message-ID: <534ec708-1466-df02-37f0-14df6aba2fd0@weilnetz.de> Date: Mon, 14 Nov 2016 13:21:02 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/5] [RFC] Add HAX support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincent Palatin , qemu-devel Cc: Paolo Bonzini Am 11.11.2016 um 12:28 schrieb Vincent Palatin: > I took a stab at trying to rebase/upstream the support for Intel HAXM. > (Hardware Accelerated Execution Manager). > Intel HAX is kernel-based hardware acceleration module for Windows and MacOSX. > > I have based my work on the last version of the source code I found: > the emu-2.2-release branch in the external/qemu-android repository as used by > the Android emulator. > In patch 2/5, I have forward-ported the core HAX code mostly unmodified from > there, I just did some minor touch up to make it build and run properly, > and fixed the style issues to go through checkpatch.pl. > I have not included the Darwin support. > It might contain some outdated constructs and probably requires more > attention (thus the 'RFC' for this patchset). > > In patch 3/5, I'm removing a good chunk of the support for CPUs without UG mode > as advised by Paolo to simplify the initial version. > > In patch 5/5, I have put the plumbing into the QEMU code base, I did some clean > up there and it is reasonably intrusive: i.e. > Makefile.target | 1 + > configure | 18 ++++++++++ > cpus.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++- > exec.c | 16 +++++++++ > hw/intc/apic_common.c | 3 +- > include/qom/cpu.h | 5 +++ > include/sysemu/hw_accel.h | 9 +++++ > qemu-options.hx | 11 ++++++ > target-i386/Makefile.objs | 7 ++++ > vl.c | 15 ++++++-- > 10 files changed, 167 insertions(+), 5 deletions(-) > > The qemu_cpu_kick_thread mess in cpus.c is probably still not perfact though. > > The patch 1/5 just extracts from KVM specific header the cpu_synchronize_ > functions that HAX is also using. > > I have tested the end result on a Windows 10 Pro machine (with UG support) > with the Intel HAXM module 6.0.4 and a large ChromiumOS x86_64 image to > exercise various code paths. It looks stable. > I also did a quick regression testing of the integration by running a Linux > build with KVM enabled. A full build for Windows needs the patch below to fix missing declarations, otherwise it fails with compiler warnings and linker errors. Stefan >>From 91481639a1005ed3278eb55c77c99bb1bcc135ce Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 14 Nov 2016 13:09:53 +0100 Subject: [PATCH] Fix include statements for HAXM support We need sysemu/hw_accel.h. As sysemu/hw_accel.h already includes sysemu/kvm.h, that one can be removed. Signed-off-by: Stefan Weil --- hw/ppc/pnv_xscom.c | 2 +- hw/ppc/ppce500_spin.c | 4 ++-- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_hcall.c | 2 +- hw/s390x/s390-pci-inst.c | 1 + target-ppc/mmu-hash64.c | 2 +- target-ppc/translate_init.c | 2 +- target-s390x/gdbstub.c | 1 + 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index 5aaa264..abcb85d 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -20,7 +20,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "qemu/log.h" -#include "sysemu/kvm.h" +#include "sysemu/hw_accel.h" #include "target-ppc/cpu.h" #include "hw/sysbus.h" diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c index cf958a9..eb219ab 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -29,9 +29,9 @@ #include "qemu/osdep.h" #include "hw/hw.h" -#include "sysemu/sysemu.h" #include "hw/sysbus.h" -#include "sysemu/kvm.h" +#include "sysemu/hw_accel.h" +#include "sysemu/sysemu.h" #include "e500.h" #define MAX_CPUS 32 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0cbab24..174f4d3 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -36,7 +36,7 @@ #include "sysemu/device_tree.h" #include "sysemu/block-backend.h" #include "sysemu/cpus.h" -#include "sysemu/kvm.h" +#include "sysemu/hw_accel.h" #include "kvm_ppc.h" #include "migration/migration.h" #include "mmu-hash64.h" diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 9a9bedf..b2a8e48 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "sysemu/hw_accel.h" #include "sysemu/sysemu.h" #include "qemu/log.h" #include "cpu.h" @@ -9,7 +10,6 @@ #include "mmu-hash64.h" #include "cpu-models.h" #include "trace.h" -#include "sysemu/kvm.h" #include "kvm_ppc.h" #include "hw/ppc/spapr_ovec.h" diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 0864d9b..4d0775c 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -18,6 +18,7 @@ #include "s390-pci-bus.h" #include "exec/memory-internal.h" #include "qemu/error-report.h" +#include "sysemu/hw_accel.h" /* #define DEBUG_S390PCI_INST */ #ifdef DEBUG_S390PCI_INST diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c index fdb7a78..0efc8c6 100644 --- a/target-ppc/mmu-hash64.c +++ b/target-ppc/mmu-hash64.c @@ -23,7 +23,7 @@ #include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/error-report.h" -#include "sysemu/kvm.h" +#include "sysemu/hw_accel.h" #include "kvm_ppc.h" #include "mmu-hash64.h" #include "exec/log.h" diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 208fa1e..1a049af 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -21,10 +21,10 @@ #include "qemu/osdep.h" #include "disas/bfd.h" #include "exec/gdbstub.h" -#include "sysemu/kvm.h" #include "kvm_ppc.h" #include "sysemu/arch_init.h" #include "sysemu/cpus.h" +#include "sysemu/hw_accel.h" #include "cpu-models.h" #include "mmu-hash32.h" #include "mmu-hash64.h" diff --git a/target-s390x/gdbstub.c b/target-s390x/gdbstub.c index 3d223de..3c652fb 100644 --- a/target-s390x/gdbstub.c +++ b/target-s390x/gdbstub.c @@ -23,6 +23,7 @@ #include "exec/exec-all.h" #include "exec/gdbstub.h" #include "qemu/bitops.h" +#include "sysemu/hw_accel.h" int s390_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n) { -- 2.10.2