Skip to contentSkip to conversation

accel: Remove HAX accelerator

PATCH In review Philippe Mathieu-Daudé 3 participants 3 messages Aug 31, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 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.

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.

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.

[*] https://github.com/intel/haxm/releases/tag/v7.8.0

---
I plan to commit this in my next PR.

---
 MAINTAINERS                                   |    8 -
 docs/about/build-platforms.rst                |    2 +-
 docs/about/deprecated.rst                     |    6 -
 docs/about/index.rst                          |    2 +-
 docs/about/removed-features.rst               |   11 +-
 docs/system/index.rst                         |    2 +-
 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/Kconfig                                 |    3 -
 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 -
 34 files changed, 16 insertions(+), 3149 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 6111b6b4d9..3b29568ed4 100644
@@ -543,14 +543,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 92a2bafd2b..dc4da95329 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/index.rst +1 -1
index b00b584b31..4f96ab5d91 100644
@@ -8,7 +8,7 @@ QEMU can be used in several different ways. The most common is for
 :ref:`System Emulation`, where it provides a virtual model of an
 entire machine (CPU, memory and emulated devices) to run a guest OS.
 In this mode the CPU may be fully emulated, or it may work with a
-hypervisor such as KVM, Xen, Hax or Hypervisor.Framework to allow the
+hypervisor such as KVM, Xen or Hypervisor.Framework to allow the
 guest to run directly on the host CPU.
 
 The second supported way to use QEMU is :ref:`User Mode Emulation`,
docs/about/removed-features.rst +7 -4
index 5b258b446b..c2043fd415 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.2)
+''''''''''''''''''''''''''''''''''''''
+
+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/index.rst +1 -1
index 3605bbe1ce..45bf1f19e7 100644
@@ -6,7 +6,7 @@ System Emulation
 
 This section of the manual is the overall guide for users using QEMU
 for full system emulation (as opposed to user-mode emulation).
-This includes working with hypervisors such as KVM, Xen, Hax
+This includes working with hypervisors such as KVM, Xen
 or Hypervisor.Framework.
 
 .. toctree::
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 98e68ef0b1..ec14079c67 100644
@@ -140,7 +140,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'],
@@ -663,11 +662,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()
@@ -4140,7 +4134,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 fdcbe87352..92a4234439 100644
@@ -422,7 +422,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

233 lines not on this page · raw message

accel/Kconfig +0 -3
index 8bdedb7d15..a30cf2eb48 100644

Lines of this file are not shown. View the 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 aaea5ddd77..4f3b1ecab0 100644

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

qemu-options.hx +4 -4
index 29b98c3d4c..463f520c57 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 9da3fe299b..504a61ad01 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.41.0

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

Reviewed-by on v2 1/1
#1 lore raw
Quoted 20 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 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.

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.

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.

Quoted 7 lines

[*] https://github.com/intel/haxm/releases/tag/v7.8.0

---
I plan to commit this in my next PR.

Yes, please!

Reviewed-by on v2 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 20 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 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.

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.

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.

Quoted 5 lines

[*] https://github.com/intel/haxm/releases/tag/v7.8.0

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro