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 v2 0/5] [RFC] Add HAX support
Date: Fri, 11 Nov 2016 12:28:30 +0100	[thread overview]
Message-ID: <cover.1478863621.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/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.

Changes from v1 to v2:
- fix all style issues in the original code to get it through checkpatch.pl.
- remove Darwin support, it was barely tested and not fully functional.
- remove the support for CPU without UG mode.
- fix most review comments

Vincent Palatin (5):
  kvm: move cpu synchronization code
  target-i386: Add Intel HAX files
  hax: remove non UG code
  hax: simplify init
  Plumb the HAXM-based hardware acceleration support

 Makefile.target             |    1 +
 configure                   |   18 +
 cpus.c                      |   88 ++-
 exec.c                      |   16 +
 gdbstub.c                   |    1 +
 hax-stub.c                  |   39 ++
 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        |   56 ++
 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       | 1327 +++++++++++++++++++++++++++++++++++++++++++
 target-i386/hax-i386.h      |   90 +++
 target-i386/hax-interface.h |  357 ++++++++++++
 target-i386/hax-slot.c      |  333 +++++++++++
 target-i386/hax-slot.h      |   58 ++
 target-i386/hax-windows.c   |  489 ++++++++++++++++
 target-i386/hax-windows.h   |   89 +++
 target-i386/helper.c        |    1 +
 target-i386/kvm.c           |    1 +
 vl.c                        |   15 +-
 29 files changed, 3054 insertions(+), 32 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-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-11 11:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 11:28 Vincent Palatin [this message]
2016-11-11 11:28 ` [Qemu-devel] [PATCH v2 1/5] kvm: move cpu synchronization code Vincent Palatin
2016-11-11 11:28 ` [Qemu-devel] [PATCH v2 2/5] target-i386: Add Intel HAX files Vincent Palatin
2016-11-14  9:29   ` Stefan Weil
2016-11-14  9:38     ` Vincent Palatin
2016-11-14 10:15   ` Paolo Bonzini
2016-11-14 12:07     ` Vincent Palatin
2016-11-14 11:55   ` Paolo Bonzini
2016-11-11 11:28 ` [Qemu-devel] [PATCH v2 3/5] hax: remove non UG code Vincent Palatin
2016-11-11 11:28 ` [Qemu-devel] [PATCH v2 4/5] hax: simplify init Vincent Palatin
2016-11-11 11:28 ` [Qemu-devel] [PATCH v2 5/5] Plumb the HAXM-based hardware acceleration support Vincent Palatin
2016-11-14 11:56   ` Paolo Bonzini
2016-11-14 12:09     ` Vincent Palatin
2016-11-13  3:20 ` [Qemu-devel] [PATCH v2 0/5] [RFC] Add HAX support no-reply
2016-11-14  8:21   ` Vincent Palatin
2016-11-14  8:47     ` Paolo Bonzini
2016-11-14  8:55     ` Stefan Weil
2016-11-14  9:28       ` Vincent Palatin
2016-11-14 12:21 ` Stefan Weil
2016-11-14 12:33   ` Vincent Palatin
2016-11-14 12:38     ` Stefan Weil
2016-11-14 12:36 ` Stefan Weil
2016-11-14 13:09   ` Vincent Palatin
2016-11-17 11:09     ` Vincent Palatin
2016-11-18 10:42       ` Vincent Palatin

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.1478863621.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.