Skip to contentSkip to conversation

accel: Remove HAX accelerator

RFC Superseded Philippe Mathieu-Daudé 4 participants 5 messages Jun 23, 2023 – Aug 29, 2023 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 accel: Remove HAX accelerator

HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark HAXM in QEMU as deprecated"), released in v8.0.0.

Per the QEMU deprecation policy, we shouldn't remove it before QEMU release v8.2.0. However per the latest HAXM release (v7.8), the latest QEMU supported is v7.2:

Note: Up to this release, HAXM supports QEMU from 2.9.0 to 7.2.0.

(https://github.com/intel/haxm/releases/tag/v7.8.0)

The next commit (https://github.com/intel/haxm/commit/da1b8ec072)
added:

HAXM v7.8.0 is our last release and we will not accept pull requests or respond to issues after this.

As of commit b455ce4c2f, it became very hard to build and test HAXM. Its previous maintainers made it clear they won't help. It doesn't seem to be a very good use of QEMU maintainers to spend their time in a dead project. Save our time by removing this orphan zombie code before the QEMU v8.2 release.

---
 MAINTAINERS                                   |    8 -
 docs/about/build-platforms.rst                |    2 +-
 docs/about/deprecated.rst                     |    6 -
 docs/about/removed-features.rst               |    9 +-
 docs/system/introduction.rst                  |    3 -
 meson.build                                   |    7 -
 include/exec/poison.h                         |    1 -
 include/hw/core/cpu.h                         |    2 +-
 include/sysemu/hax.h                          |   49 -
 include/sysemu/hw_accel.h                     |    1 -
 target/i386/hax/hax-accel-ops.h               |   31 -
 target/i386/hax/hax-i386.h                    |   98 --
 target/i386/hax/hax-interface.h               |  369 ------
 target/i386/hax/hax-posix.h                   |   61 -
 target/i386/hax/hax-windows.h                 |   88 --
 accel/stubs/hax-stub.c                        |   24 -
 hw/intc/apic_common.c                         |    3 +-
 softmmu/cpus.c                                |    6 -
 softmmu/vl.c                                  |    6 -
 target/i386/hax/hax-accel-ops.c               |  105 --
 target/i386/hax/hax-all.c                     | 1141 -----------------
 target/i386/hax/hax-mem.c                     |  323 -----
 target/i386/hax/hax-posix.c                   |  305 -----
 target/i386/hax/hax-windows.c                 |  485 -------
 accel/stubs/meson.build                       |    1 -
 meson_options.txt                             |    2 -
 qemu-options.hx                               |    8 +-
 .../ci/org.centos/stream/8/x86_64/configure   |    1 -
 scripts/meson-buildoptions.sh                 |    3 -
 target/i386/hax/meson.build                   |    7 -
 target/i386/meson.build                       |    1 -
 31 files changed, 13 insertions(+), 3143 deletions(-)
 delete mode 100644 include/sysemu/hax.h
 delete mode 100644 target/i386/hax/hax-accel-ops.h
 delete mode 100644 target/i386/hax/hax-i386.h
 delete mode 100644 target/i386/hax/hax-interface.h
 delete mode 100644 target/i386/hax/hax-posix.h
 delete mode 100644 target/i386/hax/hax-windows.h
 delete mode 100644 accel/stubs/hax-stub.c
 delete mode 100644 target/i386/hax/hax-accel-ops.c
 delete mode 100644 target/i386/hax/hax-all.c
 delete mode 100644 target/i386/hax/hax-mem.c
 delete mode 100644 target/i386/hax/hax-posix.c
 delete mode 100644 target/i386/hax/hax-windows.c
 delete mode 100644 target/i386/hax/meson.build
MAINTAINERS +0 -8
index 1da135b0c8..aa30640670 100644
@@ -544,14 +544,6 @@ F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 F: stubs/xen-hw-stub.c
 
-Guest CPU Cores (HAXM)
----------------------
-X86 HAXM CPUs
-S: Orphan
-F: accel/stubs/hax-stub.c
-F: include/sysemu/hax.h
-F: target/i386/hax/
-
 Guest CPU Cores (NVMM)
 ----------------------
 NetBSD Virtual Machine Monitor (NVMM) CPU support
docs/about/build-platforms.rst +1 -1
index 0e2cb9e770..f2a7aec56f 100644
@@ -52,7 +52,7 @@ Those hosts are officially supported, with various accelerators:
    * - SPARC
      - tcg
    * - x86
-     - hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
+     - hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
 
 Other host architectures are not supported. It is possible to build QEMU system
 emulation on an unsupported host architecture using the configure
docs/about/deprecated.rst +0 -6
index 0743459862..c1d6dde8f7 100644
@@ -105,12 +105,6 @@ Use ``-machine hpet=off`` instead.
 The ``-no-acpi`` setting has been turned into a machine property.
 Use ``-machine acpi=off`` instead.
 
-``-accel hax`` (since 8.0)
-''''''''''''''''''''''''''
-
-The HAXM project has been retired (see https://github.com/intel/haxm#status).
-Use "whpx" (on Windows) or "hvf" (on macOS) instead.
-
 ``-async-teardown`` (since 8.1)
 '''''''''''''''''''''''''''''''
 
docs/about/removed-features.rst +6 -3
index 5b258b446b..cc8a1e38a9 100644
@@ -659,15 +659,18 @@ Use ``Icelake-Server`` instead.
 System accelerators
 -------------------
 
-Userspace local APIC with KVM (x86, removed 8.0)
+Userspace local APIC with KVM (x86, removed in 8.0)
 ''''''''''''''''''''''''''''''''''''''''''''''''
 
 ``-M kernel-irqchip=off`` cannot be used on KVM if the CPU model includes
 a local APIC.  The ``split`` setting is supported, as is using ``-M
 kernel-irqchip=off`` when the CPU does not have a local APIC.
 
-System accelerators
--------------------
+HAXM (``-accel hax``) (removed in 8.1)
+''''''''''''''''''''''''''''''''''''''
+
+The HAXM project has been retired (see https://github.com/intel/haxm#status).
+Use "whpx" (on Windows) or "hvf" (on macOS) instead.
 
 MIPS "Trap-and-Emulate" KVM support (removed in 8.0)
 ''''''''''''''''''''''''''''''''''''''''''''''''''''
docs/system/introduction.rst +0 -3
index 3e256f8326..51ac132d6c 100644
@@ -21,9 +21,6 @@ Tiny Code Generator (TCG) capable of emulating many CPUs.
   * - Xen
     - Linux (as dom0)
     - Arm, x86
-  * - Intel HAXM (hax)
-    - Linux, Windows
-    - x86
   * - Hypervisor Framework (hvf)
     - MacOS
     - x86 (64 bit only), Arm (64 bit only)
meson.build +0 -7
index 6ef78ea278..5c4c62b41a 100644
@@ -141,7 +141,6 @@ if cpu in ['x86', 'x86_64', 'arm', 'aarch64']
 endif
 if cpu in ['x86', 'x86_64']
   accelerator_targets += {
-    'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'],
     'CONFIG_HVF': ['x86_64-softmmu'],
     'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'],
     'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
@@ -673,11 +672,6 @@ if get_option('hvf').allowed()
     accelerators += 'CONFIG_HVF'
   endif
 endif
-if get_option('hax').allowed()
-  if get_option('hax').enabled() or targetos in ['windows', 'darwin', 'netbsd']
-    accelerators += 'CONFIG_HAX'
-  endif
-endif
 if targetos == 'netbsd'
   nvmm = cc.find_library('nvmm', required: get_option('nvmm'))
   if nvmm.found()
@@ -4136,7 +4130,6 @@ endif
 summary_info = {}
 if have_system
   summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
-  summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
   summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
   summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
   summary_info += {'NVMM support':      config_all.has_key('CONFIG_NVMM')}
include/exec/poison.h +0 -1
index e94ee8dfef..1ea5633eb3 100644
@@ -81,7 +81,6 @@
 #pragma GCC poison CONFIG_SPARC_DIS
 #pragma GCC poison CONFIG_XTENSA_DIS
 
-#pragma GCC poison CONFIG_HAX
 #pragma GCC poison CONFIG_HVF
 #pragma GCC poison CONFIG_LINUX_USER
 #pragma GCC poison CONFIG_KVM
include/hw/core/cpu.h +1 -1
index 44c91240f2..1b3ae0aabf 100644
@@ -420,7 +420,7 @@ struct CPUState {
     int32_t exception_index;
 
     AccelCPUState *accel;
-    /* shared by kvm, hax and hvf */
+    /* shared by kvm and hvf */
     bool vcpu_dirty;
 
     /* Used to keep track of an outstanding cpu throttle thread for migration
include/sysemu/hax.h deleted +0 -49

49 lines not on this page · raw message

include/sysemu/hw_accel.h +0 -1
index 22903a55f7..c71b77e71f 100644
@@ -12,7 +12,6 @@
 #define QEMU_HW_ACCEL_H
 
 #include "hw/core/cpu.h"
-#include "sysemu/hax.h"
 #include "sysemu/kvm.h"
 #include "sysemu/hvf.h"
 #include "sysemu/whpx.h"
target/i386/hax/hax-accel-ops.h deleted +0 -31
deleted file mode 100644
index 9e357e7b40..0000000000
@@ -1,31 +0,0 @@
-/*
- * Accelerator CPUS Interface
- *
- * Copyright 2020 SUSE LLC
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- */
-
-#ifndef TARGET_I386_HAX_ACCEL_OPS_H
-#define TARGET_I386_HAX_ACCEL_OPS_H
-
-#include "sysemu/cpus.h"
-
-#include "hax-interface.h"
-#include "hax-i386.h"
-
-int hax_init_vcpu(CPUState *cpu);
-int hax_smp_cpu_exec(CPUState *cpu);
-int hax_populate_ram(uint64_t va, uint64_t size);
-
-void hax_cpu_synchronize_state(CPUState *cpu);
-void hax_cpu_synchronize_post_reset(CPUState *cpu);
-void hax_cpu_synchronize_post_init(CPUState *cpu);
-void hax_cpu_synchronize_pre_loadvm(CPUState *cpu);
-
-int hax_vcpu_destroy(CPUState *cpu);
-void hax_raise_event(CPUState *cpu);
-void hax_reset_vcpu_state(void *opaque);
-
-#endif /* TARGET_I386_HAX_ACCEL_OPS_H */
target/i386/hax/hax-i386.h deleted +0 -98

98 lines not on this page · raw message

target/i386/hax/hax-interface.h deleted +0 -369

369 lines not on this page · raw message

target/i386/hax/hax-posix.h deleted +0 -61

61 lines not on this page · raw message

target/i386/hax/hax-windows.h deleted +0 -88

88 lines not on this page · raw message

accel/stubs/hax-stub.c deleted +0 -24
deleted file mode 100644
index 2fe31aaa9a..0000000000
@@ -1,24 +0,0 @@
-/*
- * QEMU HAXM support
- *
- * Copyright (c) 2015, Intel Corporation
- *
- * Copyright 2016 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * See the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-#include "sysemu/hax.h"
-
-bool hax_allowed;
-
-int hax_sync_vcpus(void)
-{
-    return 0;
-}
hw/intc/apic_common.c +1 -2
index 4a34f03047..68ad30e2f5 100644
@@ -28,7 +28,6 @@
 #include "hw/intc/kvm_irqcount.h"
 #include "trace.h"
 #include "hw/boards.h"
-#include "sysemu/hax.h"
 #include "sysemu/kvm.h"
 #include "hw/qdev-properties.h"
 #include "hw/sysbus.h"
@@ -271,7 +270,7 @@ static void apic_common_realize(DeviceState *dev, Error **errp)
 
     /* Note: We need at least 1M to map the VAPIC option ROM */
     if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK &&
-        !hax_enabled() && current_machine->ram_size >= 1024 * 1024) {
+            current_machine->ram_size >= 1024 * 1024) {
         vapic = sysbus_create_simple("kvmvapic", -1, NULL);
     }
     s->vapic = vapic;
softmmu/cpus.c +0 -6
index fed20ffb5d..0848e0dbdb 100644
@@ -427,12 +427,6 @@ void qemu_wait_io_event(CPUState *cpu)
         qemu_plugin_vcpu_resume_cb(cpu);
     }
 
-#ifdef _WIN32
-    /* Eat dummy APC queued by cpus_kick_thread. */
-    if (hax_enabled()) {
-        SleepEx(0, TRUE);
-    }
-#endif
     qemu_wait_io_event_common(cpu);
 }
 
softmmu/vl.c +0 -6
index b0b96f67fa..5a10b3c309 100644
@@ -86,7 +86,6 @@
 #include "migration/colo.h"
 #include "migration/postcopy-ram.h"
 #include "sysemu/kvm.h"
-#include "sysemu/hax.h"
 #include "qapi/qobject-input-visitor.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
@@ -2546,11 +2545,6 @@ static void qemu_init_board(void)
     drive_check_orphaned();
 
     realtime_init();
-
-    if (hax_enabled()) {
-        /* FIXME: why isn't cpu_synchronize_all_post_init enough? */
-        hax_sync_vcpus();
-    }
 }
 
 static void qemu_create_cli_devices(void)
target/i386/hax/hax-accel-ops.c deleted +0 -105

105 lines not on this page · raw message

target/i386/hax/hax-all.c deleted +0 -1141

1,141 lines not on this page · raw message

target/i386/hax/hax-mem.c deleted +0 -323

323 lines not on this page · raw message

target/i386/hax/hax-posix.c deleted +0 -305

305 lines not on this page · raw message

target/i386/hax/hax-windows.c deleted +0 -485

250 lines not on this page · raw message

accel/stubs/meson.build +0 -1
index f7a9486e06..6b0f200efe 100644

Lines of this file are not shown. View the raw message.

meson_options.txt +0 -2
index 90237389e2..8139ef1534 100644

Lines of this file are not shown. View the raw message.

qemu-options.hx +4 -4
index b57489d7ca..f8fd147e42 100644

Lines of this file are not shown. View the raw message.

scripts/ci/org.centos/stream/8/x86_64/configure +0 -1
index d02b09a4b9..131f8ee5f3 100755

Lines of this file are not shown. View the raw message.

scripts/meson-buildoptions.sh +0 -3
index 5714fd93d9..449d05928f 100644

Lines of this file are not shown. View the raw message.

target/i386/hax/meson.build deleted +0 -7
deleted file mode 100644
index 6ac314aa35..0000000000

Lines of this file are not shown. View the raw message.

target/i386/meson.build +0 -1
index 1effe1ed9a..6f1036d469 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.38.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 33 lines · Philippe Mathieu-Daudé

HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark HAXM in QEMU as deprecated"), released in v8.0.0.

Per the QEMU deprecation policy, we shouldn't remove it before QEMU release v8.2.0. However per the latest HAXM release (v7.8), the latest QEMU supported is v7.2:

Note: Up to this release, HAXM supports QEMU from 2.9.0 to 7.2.0.

(https://github.com/intel/haxm/releases/tag/v7.8.0)

The next commit (https://github.com/intel/haxm/commit/da1b8ec072)
added:

HAXM v7.8.0 is our last release and we will not accept pull requests or respond to issues after this.

As of commit b455ce4c2f, it became very hard to build and test HAXM. Its previous maintainers made it clear they won't help. It doesn't seem to be a very good use of QEMU maintainers to spend their time in a dead project. Save our time by removing this orphan zombie code before the QEMU v8.2 release.

---

docs/about/removed-features.rst +0 -0
index 5b258b446b..cc8a1e38a9 100644

docs/about/removed-features.rst Use ``Icelake-Server`` instead. · line 663

Quoted 6 lines
docs/about/removed-features.rst +1 -1
@@ -659,15 +659,18 @@ Use ``Icelake-Server`` instead.
  System accelerators
  -------------------
 
-Userspace local APIC with KVM (x86, removed 8.0)
+Userspace local APIC with KVM (x86, removed in 8.0)
  ''''''''''''''''''''''''''''''''''''''''''''''''

Oops I didn't mean to commit this line. The doc won't build with padding.

Quoted 3 lines
docs/about/removed-features.rst +0 -0
  ``-M kernel-irqchip=off`` cannot be used on KVM if the CPU model includes
  a local APIC.  The ``split`` setting is supported, as is using ``-M
  kernel-irqchip=off`` when the CPU does not have a local APIC.
#2 lore raw
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 26 lines · Philippe Mathieu-Daudé

HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark HAXM in QEMU as deprecated"), released in v8.0.0.

Per the QEMU deprecation policy, we shouldn't remove it before QEMU release v8.2.0. However per the latest HAXM release (v7.8), the latest QEMU supported is v7.2:

   Note: Up to this release, HAXM supports QEMU from 2.9.0 to 7.2.0.

(https://github.com/intel/haxm/releases/tag/v7.8.0)

The next commit (https://github.com/intel/haxm/commit/da1b8ec072)
added:

   HAXM v7.8.0 is our last release and we will not accept pull requests or respond to issues after this.

As of commit b455ce4c2f, it became very hard to build and test HAXM. Its previous maintainers made it clear they won't help. It doesn't seem to be a very good use of QEMU maintainers to spend their time in a dead project. Save our time by removing this orphan zombie code before the QEMU v8.2 release.

---

Quoted 12 lines
Quoted 10 lines
docs/about/removed-features.rst +0 -0
index 5b258b446b..cc8a1e38a9 100644
@@ -659,15 +659,18 @@ Use ``Icelake-Server`` instead.

  System accelerators
  -------------------

docs/about/removed-features.rst +1 -1
-Userspace local APIC with KVM (x86, removed 8.0)
+Userspace local APIC with KVM (x86, removed in 8.0)

  ''''''''''''''''''''''''''''''''''''''''''''''''

Oops I didn't mean to commit this line. The doc won't build with padding.

Hi Philippe,

now that 8.1 has been released, could you please update your patch by removing this bad hunk and by updating the commit description?

Thanks,
Thomas

Reviewed-by on v1 1/1
#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 58 lines · Philippe Mathieu-Daudé

HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark HAXM in QEMU as deprecated"), released in v8.0.0.

Per the QEMU deprecation policy, we shouldn't remove it before QEMU release v8.2.0. However per the latest HAXM release (v7.8), the latest QEMU supported is v7.2:

Note: Up to this release, HAXM supports QEMU from 2.9.0 to 7.2.0.

(https://github.com/intel/haxm/releases/tag/v7.8.0)

The next commit (https://github.com/intel/haxm/commit/da1b8ec072)
added:

HAXM v7.8.0 is our last release and we will not accept pull requests or respond to issues after this.

As of commit b455ce4c2f, it became very hard to build and test HAXM. Its previous maintainers made it clear they won't help. It doesn't seem to be a very good use of QEMU maintainers to spend their time in a dead project. Save our time by removing this orphan zombie code before the QEMU v8.2 release.

---
  MAINTAINERS                                   |    8 -
  docs/about/build-platforms.rst                |    2 +-
  docs/about/deprecated.rst                     |    6 -
  docs/about/removed-features.rst               |    9 +-
  docs/system/introduction.rst                  |    3 -
  meson.build                                   |    7 -
  include/exec/poison.h                         |    1 -
  include/hw/core/cpu.h                         |    2 +-
  include/sysemu/hax.h                          |   49 -
  include/sysemu/hw_accel.h                     |    1 -
  target/i386/hax/hax-accel-ops.h               |   31 -
  target/i386/hax/hax-i386.h                    |   98 --
  target/i386/hax/hax-interface.h               |  369 ------
  target/i386/hax/hax-posix.h                   |   61 -
  target/i386/hax/hax-windows.h                 |   88 --
  accel/stubs/hax-stub.c                        |   24 -
  hw/intc/apic_common.c                         |    3 +-
  softmmu/cpus.c                                |    6 -
  softmmu/vl.c                                  |    6 -
  target/i386/hax/hax-accel-ops.c               |  105 --
  target/i386/hax/hax-all.c                     | 1141 -----------------
  target/i386/hax/hax-mem.c                     |  323 -----
  target/i386/hax/hax-posix.c                   |  305 -----
  target/i386/hax/hax-windows.c                 |  485 -------
  accel/stubs/meson.build                       |    1 -
  meson_options.txt                             |    2 -
  qemu-options.hx                               |    8 +-
  .../ci/org.centos/stream/8/x86_64/configure   |    1 -
  scripts/meson-buildoptions.sh                 |    3 -
  target/i386/hax/meson.build                   |    7 -
  target/i386/meson.build                       |    1 -
  31 files changed, 13 insertions(+), 3143 deletions(-)
Quoted 13 lines

delete mode 100644 include/sysemu/hax.h delete mode 100644 target/i386/hax/hax-accel-ops.h delete mode 100644 target/i386/hax/hax-i386.h delete mode 100644 target/i386/hax/hax-interface.h delete mode 100644 target/i386/hax/hax-posix.h delete mode 100644 target/i386/hax/hax-windows.h delete mode 100644 accel/stubs/hax-stub.c delete mode 100644 target/i386/hax/hax-accel-ops.c delete mode 100644 target/i386/hax/hax-all.c delete mode 100644 target/i386/hax/hax-mem.c delete mode 100644 target/i386/hax/hax-posix.c delete mode 100644 target/i386/hax/hax-windows.c delete mode 100644 target/i386/hax/meson.build

r~

Acked-by on v1 1/1
#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 18 lines · Philippe Mathieu-Daudé

HAX is deprecated since commits 73741fda6c ("MAINTAINERS: Abort HAXM maintenance") and 90c167a1da ("docs/about/deprecated: Mark HAXM in QEMU as deprecated"), released in v8.0.0.

Per the QEMU deprecation policy, we shouldn't remove it before QEMU release v8.2.0. However per the latest HAXM release (v7.8), the latest QEMU supported is v7.2:

Note: Up to this release, HAXM supports QEMU from 2.9.0 to 7.2.0.

(https://github.com/intel/haxm/releases/tag/v7.8.0)

The next commit (https://github.com/intel/haxm/commit/da1b8ec072)
added:

HAXM v7.8.0 is our last release and we will not accept pull requests or respond to issues after this.

Quoted 7 lines

As of commit b455ce4c2f, it became very hard to build and test HAXM. Its previous maintainers made it clear they won't help. It doesn't seem to be a very good use of QEMU maintainers to spend their time in a dead project. Save our time by removing this orphan zombie code before the QEMU v8.2 release.

Your argument for short-cutting the grace period is compelling.