All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Palatin <vpalatin@chromium.org>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Vincent Palatin <vpalatin@chromium.org>
Subject: [Qemu-devel] [PATCH 0/3] [RFC] Add HAX support
Date: Tue,  8 Nov 2016 16:39:26 +0100	[thread overview]
Message-ID: <cover.1478619442.git.vpalatin@chromium.org> (raw)

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/3, 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.
So it might contain some outdated constructs and probably requires more
attention (thus the 'RFC' for this patchset).

In patch 3/3, 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 +++++++
 cpu-exec.c                |  23 ++++++++-
 cpus.c                    | 125 ++++++++++++++++++++++++++++++++++++++++------
 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 +++
 target-i386/seg_helper.c  |   5 ++
 target-i386/translate.c   |   8 +++
 vl.c                      |  17 +++++--
 13 files changed, 229 insertions(+), 19 deletions(-)

I'm not so happy with the qemu_cpu_kick_thread mess in cpus.c,
if somebody can help/advise.

The patch 1/3 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.


Vincent Palatin (3):
  kvm: move cpu synchronization code
  target-i386: Add Intel HAX files
  Plumb the HAXM-based hardware acceleration support

 Makefile.target             |    1 +
 configure                   |   18 +
 cpu-exec.c                  |   23 +-
 cpus.c                      |  126 +++-
 exec.c                      |   16 +
 gdbstub.c                   |    1 +
 hax-stub.c                  |   66 ++
 hw/i386/kvm/apic.c          |    1 +
 hw/i386/kvmvapic.c          |    1 +
 hw/intc/apic_common.c       |    3 +-
 hw/misc/vmport.c            |    2 +-
 include/qom/cpu.h           |    5 +
 include/sysemu/hax.h        |   66 ++
 include/sysemu/hw_accel.h   |   48 ++
 include/sysemu/kvm.h        |   23 -
 monitor.c                   |    2 +-
 qemu-options.hx             |   11 +
 qom/cpu.c                   |    2 +-
 target-arm/cpu.c            |    2 +-
 target-i386/Makefile.objs   |    7 +
 target-i386/hax-all.c       | 1449 +++++++++++++++++++++++++++++++++++++++++++
 target-i386/hax-darwin.c    |  315 ++++++++++
 target-i386/hax-darwin.h    |   63 ++
 target-i386/hax-i386.h      |   94 +++
 target-i386/hax-interface.h |  357 +++++++++++
 target-i386/hax-slot.c      |  332 ++++++++++
 target-i386/hax-slot.h      |   58 ++
 target-i386/hax-windows.c   |  478 ++++++++++++++
 target-i386/hax-windows.h   |   89 +++
 target-i386/helper.c        |    1 +
 target-i386/kvm.c           |    1 +
 target-i386/seg_helper.c    |    5 +
 target-i386/translate.c     |    8 +
 vl.c                        |   17 +-
 34 files changed, 3645 insertions(+), 46 deletions(-)
 create mode 100644 hax-stub.c
 create mode 100644 include/sysemu/hax.h
 create mode 100644 include/sysemu/hw_accel.h
 create mode 100644 target-i386/hax-all.c
 create mode 100644 target-i386/hax-darwin.c
 create mode 100644 target-i386/hax-darwin.h
 create mode 100644 target-i386/hax-i386.h
 create mode 100644 target-i386/hax-interface.h
 create mode 100644 target-i386/hax-slot.c
 create mode 100644 target-i386/hax-slot.h
 create mode 100644 target-i386/hax-windows.c
 create mode 100644 target-i386/hax-windows.h

-- 
2.8.0.rc3.226.g39d4020

             reply	other threads:[~2016-11-08 15:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 15:39 Vincent Palatin [this message]
2016-11-08 15:39 ` [Qemu-devel] [PATCH 1/3] kvm: move cpu synchronization code Vincent Palatin
2016-11-08 17:34   ` Paolo Bonzini
2016-11-08 15:39 ` [Qemu-devel] [PATCH 2/3] target-i386: Add Intel HAX files Vincent Palatin
2016-11-08 17:46   ` Paolo Bonzini
2016-11-08 19:43     ` Vincent Palatin
2016-11-09 17:08     ` Vincent Palatin
2016-11-09 12:30   ` Stefan Hajnoczi
2016-11-09 17:08     ` Vincent Palatin
2016-11-08 15:39 ` [Qemu-devel] [PATCH 3/3] Plumb the HAXM-based hardware acceleration support Vincent Palatin
2016-11-08 20:37   ` Paolo Bonzini
2016-11-09 17:19     ` Vincent Palatin
2016-11-09 17:32       ` Paolo Bonzini
2016-11-11 11:25         ` Vincent Palatin
2016-11-11 11:26           ` Paolo Bonzini
2016-11-08 17:43 ` [Qemu-devel] [PATCH 0/3] [RFC] Add HAX support Paolo Bonzini
2016-11-08 19:41   ` Vincent Palatin
2016-11-08 20:41     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1478619442.git.vpalatin@chromium.org \
    --to=vpalatin@chromium.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.