dcavalca / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

Blame 0001-xen-fix-condition-for-enabling-the-Xen-accelerator.patch

c29054
From 5fed25c696c0e32933d71b4133afe7856b82c11b Mon Sep 17 00:00:00 2001
c29054
From: Paolo Bonzini <pbonzini@redhat.com>
c29054
Date: Sat, 9 Dec 2023 15:32:22 +0100
c29054
Subject: [PATCH] xen: fix condition for enabling the Xen accelerator
c29054
MIME-Version: 1.0
c29054
Content-Type: text/plain; charset=UTF-8
c29054
Content-Transfer-Encoding: 8bit
c29054
c29054
A misspelled condition in xen_native.h is hiding a bug in the enablement of
c29054
Xen for qemu-system-aarch64.  The bug becomes apparent when building for
c29054
Xen 4.18.
c29054
c29054
While the i386 emulator provides the xenpv machine type for multiple architectures,
c29054
and therefore can be compiled with Xen enabled even when the host is Arm, the
c29054
opposite is not true: qemu-system-aarch64 can only be compiled with Xen support
c29054
enabled when the host is Arm.
c29054
c29054
Expand the computation of accelerator_targets['CONFIG_XEN'] similar to what is
c29054
already there for KVM, and fix xen_native.h.
c29054
c29054
Cc: Stefano Stabellini <stefano.stabellini@amd.com>
c29054
Cc: Richard W.M. Jones <rjones@redhat.com>
c29054
Cc: Daniel P. Berrangé <berrange@redhat.com>
c29054
Reported-by: Michael Young <m.a.young@durham.ac.uk>
c29054
Supersedes: <277e21fc78b75ec459efc7f5fde628a0222c63b0.1701989261.git.m.a.young@durham.ac.uk>
c29054
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
c29054
---
c29054
 include/hw/xen/xen_native.h |  2 +-
c29054
 meson.build                 | 17 ++++++++++-------
c29054
 2 files changed, 11 insertions(+), 8 deletions(-)
c29054
c29054
diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h
c29054
index 6f09c48823..1a5ad693a4 100644
c29054
--- a/include/hw/xen/xen_native.h
c29054
+++ b/include/hw/xen/xen_native.h
c29054
@@ -532,7 +532,7 @@ static inline int xendevicemodel_set_irq_level(xendevicemodel_handle *dmod,
c29054
 }
c29054
 #endif
c29054
 
c29054
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION <= 41700
c29054
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41700
c29054
 #define GUEST_VIRTIO_MMIO_BASE   xen_mk_ullong(0x02000000)
c29054
 #define GUEST_VIRTIO_MMIO_SIZE   xen_mk_ullong(0x00100000)
c29054
 #define GUEST_VIRTIO_MMIO_SPI_FIRST   33
c29054
diff --git a/meson.build b/meson.build
c29054
index d2c4c2adb3..6c77d9687d 100644
c29054
--- a/meson.build
c29054
+++ b/meson.build
c29054
@@ -123,21 +123,24 @@ if get_option('kvm').allowed() and targetos == 'linux'
c29054
   kvm_targets_c = '"' + '" ,"'.join(kvm_targets) + '"'
c29054
 endif
c29054
 config_host_data.set('CONFIG_KVM_TARGETS', kvm_targets_c)
c29054
-
c29054
 accelerator_targets = { 'CONFIG_KVM': kvm_targets }
c29054
 
c29054
+if cpu in ['x86', 'x86_64']
c29054
+  xen_targets = ['i386-softmmu', 'x86_64-softmmu']
c29054
+elif cpu in ['arm', 'aarch64']
c29054
+  # i386 emulator provides xenpv machine type for multiple architectures
c29054
+  xen_targets = ['i386-softmmu', 'x86_64-softmmu', 'aarch64-softmmu']
c29054
+else
c29054
+  xen_targets = []
c29054
+endif
c29054
+accelerator_targets += { 'CONFIG_XEN': xen_targets }
c29054
+
c29054
 if cpu in ['aarch64']
c29054
   accelerator_targets += {
c29054
     'CONFIG_HVF': ['aarch64-softmmu']
c29054
   }
c29054
 endif
c29054
 
c29054
-if cpu in ['x86', 'x86_64', 'arm', 'aarch64']
c29054
-  # i386 emulator provides xenpv machine type for multiple architectures
c29054
-  accelerator_targets += {
c29054
-    'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu', 'aarch64-softmmu'],
c29054
-  }
c29054
-endif
c29054
 if cpu in ['x86', 'x86_64']
c29054
   accelerator_targets += {
c29054
     'CONFIG_HVF': ['x86_64-softmmu'],
c29054
-- 
c29054
2.41.0
c29054