Compare commits

..

6 Commits
a10s ... a9

Author SHA1 Message Date
eabdullin
3adf3bcb44 - Add new patch
- Add missing changes
2025-07-16 12:14:19 +03:00
eabdullin
7fbdb46078 Update patch 2025-04-16 13:06:59 +03:00
eabdullin
3f20440349 usb: add config options for hub and hid devices for ppc 2025-04-10 13:18:16 +03:00
eabdullin
c19c74ca43 Bring back missing line in target/ppc/cpu-models.c 2025-04-09 16:52:01 +03:00
eabdullin
05d29fd9d1 Don't remove SLOF for ppc64le 2025-04-08 17:57:50 +03:00
eabdullin
baaa1d2a62 Bring kvm on ppc 2025-04-08 16:30:23 +03:00
7 changed files with 218 additions and 686 deletions

View File

@ -1,19 +1,5 @@
actions:
- replace:
- target: "spec"
find: "%global have_safe_stack 0"
replace: |
%global have_safe_stack 0
%global have_spice 0
%if 0%{?almalinux}
%global have_spice 1
%ifnarch x86_64 aarch64
%global have_spice 0
%endif
%endif
count: 1
- target: "spec"
find: |
%global tools_only 0
@ -22,99 +8,12 @@ actions:
%endif
replace: |
%global tools_only 0
%if 0%{?almalinux} < 10
%if 0%{?almalinux} < 9
%ifarch %{power64}
%global tools_only 1
%endif
%endif
count: 1
- target: "spec"
find: |
%global requires_all_modules \
%if %{have_opengl} \
replace: |
%global requires_all_modules \
%if %{have_spice} \
Requires: %{name}-ui-spice = %{epoch}:%{version}-%{release} \
%endif \
%if %{have_opengl} \
count: 1
- target: "spec"
find: |
%global obsoletes_some_modules \
Obsoletes: %{name}-ui-spice <= %{epoch}:%{version} \
replace: |
%global obsoletes_some_modules \
%if !%{have_spice} \
Obsoletes: %{name}-ui-spice <= %{epoch}:%{version} \
%endif \
count: 1
- target: "spec"
find: "BuildRequires: capstone-devel"
replace: |
BuildRequires: capstone-devel
%if %{have_spice}
BuildRequires: spice-server-devel
BuildRequires: libcacard-devel
BuildRequires: nss-devel
%endif
count: 1
- target: "spec"
find: |
%description audio-pa
This package provides the additional PulseAudio audio driver for QEMU.
replace: |
%description audio-pa
This package provides the additional PulseAudio audio driver for QEMU.
%if %{have_spice}
%package ui-spice
Summary: QEMU spice support
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
%if %{have_opengl}
Requires: %{name}-ui-opengl%{?_isa} = %{epoch}:%{version}-%{release}
%endif
%description ui-spice
This package provides spice support.
%endif
count: 1
- target: "spec"
find: |
%ifarch aarch64 s390x x86_64 riscv64
--with-devices-%{kvm_target}=%{kvm_target}-rh-devices \
%endif
replace: |
%ifarch aarch64 s390x x86_64 riscv64
--with-devices-%{kvm_target}=%{kvm_target}-rh-devices \
%endif
%ifarch %{power64}
%if 0%{?almalinux}
--with-devices-%{kvm_target}=%{kvm_target}-rh-devices \
%endif
%endif
count: 1
- target: "spec"
find: |
%endif
--enable-seccomp \
--enable-selinux \
--enable-slirp \
--enable-snappy \
replace: |
%endif
--enable-seccomp \
--enable-selinux \
--enable-slirp \
--enable-snappy \
%if 0%{have_spice}
--enable-smartcard \
--enable-spice \
%endif
count: 1
- target: "spec"
find: |
# Provided by package SLOF
@ -125,44 +24,61 @@ actions:
rm -rf %{buildroot}%{_datadir}/%{name}/slof.bin
%endif
count: 1
- target: "spec"
find: "rm -rf %{buildroot}%{_datadir}/%{name}/npcm7xx_bootrom.bin"
replace: |
rm -rf %{buildroot}%{_datadir}/%{name}/npcm7xx_bootrom.bin
rm -rf %{buildroot}%{_libdir}/%{name}/ui-spice-app.so
count: 1
- target: "spec"
find: |
%files core
%ifarch x86_64
%{_libdir}/%{name}/accel-tcg-%{kvm_target}.so
%endif
replace: |
%files core
%ifarch x86_64
%{_libdir}/%{name}/accel-tcg-%{kvm_target}.so
%endif
%ifarch ppc64le
%{_datadir}/%{name}/slof.bin
%endif
count: 1
- target: "spec"
find: |
%files audio-pa
%{_libdir}/%{name}/audio-pa.so
rm -rf %{buildroot}%{_datadir}/%{name}/vgabios*bin
replace: |
%files audio-pa
%{_libdir}/%{name}/audio-pa.so
%if 0%{have_spice}
%files ui-spice
%{_libdir}/%{name}/hw-usb-smartcard.so
%{_libdir}/%{name}/audio-spice.so
%{_libdir}/%{name}/ui-spice-core.so
%{_libdir}/%{name}/chardev-spice.so
%ifarch x86_64
%{_libdir}/%{name}/hw-display-qxl.so
%ifnarch %{power64}
rm -rf %{buildroot}%{_datadir}/%{name}/vgabios*bin
%else
rm -rf %{buildroot}%{_datadir}/%{name}/vgabios-*.bin
%endif
%endif
count: 1
- target: "spec"
find: |
%if %{have_memlock_limits}
%{_sysconfdir}/security/limits.d/95-kvm-memlock.conf
%endif
replace: |
%if %{have_memlock_limits}
%{_sysconfdir}/security/limits.d/95-kvm-memlock.conf
%endif
%ifarch %{power64}
%{_datadir}/%{name}/vgabios.bin
%endif
count: 1
- add_files:
- type: "patch"
name: "0001-Bring-back-missing-line-in-target-ppc-cpu-models.patch"
number: "Latest"
- add_files:
- type: "patch"
name: "0001-usb-add-config-options-for-hub-and-hid-devices-for-p.patch"
number: "Latest"
- add_files:
- type: "patch"
name: "0001-Add-AlmaLinux-9-to-machine-class-options.patch"
number: "Latest"
- add_files:
- type: "patch"
name: "osuosl-enable-ppc64.patch"
number: "Latest"
- modify_release:
- suffix: ".alma.1"
@ -172,15 +88,6 @@ actions:
- name: "Eduard Abdullin"
email: "eabdullin@almalinux.org"
line:
- "Enable QXL device build"
- "Enable building for ppc64le"
- "Re-added Spice support"
- "Don't remove slof.bin for ppc64le"
- add_files:
- type: "patch"
name: "2001-Add-ppc64-support.patch"
number: 2001
- type: "patch"
name: "2002-Enable-QXL-device-build.patch"
number: 2002
- "usb: add config options for hub and hid devices for ppc"

View File

@ -0,0 +1,113 @@
From 149cfc4ec6367978ad764a6d99ce143c0429b996 Mon Sep 17 00:00:00 2001
From: eabdullin <eabdullin@almalinux.org>
Date: Tue, 15 Jul 2025 15:00:43 +0300
Subject: [PATCH] Add AlmaLinux 9 to machine class options
---
hw/ppc/spapr.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 82 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 29e66f1b3..1001e0f92 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -5425,6 +5425,87 @@ static void spapr_rhel_machine_default_class_options(MachineClass *mc)
mc->max_cpus = 384;
}
+static void spapr_rhel_machine_9_6_0_class_options(MachineClass *mc)
+{
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_rhel_machine_default_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_6,
+ hw_compat_rhel_9_6_len);
+ smc->pre_6_2_numa_affinity = true;
+ mc->smp_props.prefer_sockets = true;
+}
+
+DEFINE_SPAPR_MACHINE_AS_LATEST(9, 6, 0);
+
+static void spapr_rhel_machine_9_5_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_6_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_5,
+ hw_compat_rhel_9_5_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 5, 0);
+
+static void spapr_rhel_machine_9_4_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_5_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_4,
+ hw_compat_rhel_9_4_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 4, 0);
+
+static void spapr_rhel_machine_9_3_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_4_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_3,
+ hw_compat_rhel_9_3_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 3, 0);
+
+static void spapr_rhel_machine_9_2_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_3_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_2,
+ hw_compat_rhel_9_2_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 2, 0);
+
+static void spapr_rhel_machine_9_1_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_2_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_1,
+ hw_compat_rhel_9_1_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 1, 0);
+
+static void spapr_rhel_machine_9_0_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_1_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_0,
+ hw_compat_rhel_9_0_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 0, 0);
+
+static void spapr_rhel_machine_8_6_0_class_options(MachineClass *mc)
+{
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ /* The default machine type must apply the RHEL specific defaults */
+ spapr_rhel_machine_default_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_6,
+ hw_compat_rhel_8_6_len);
+ smc->pre_6_2_numa_affinity = true;
+ mc->smp_props.prefer_sockets = true;
+}
+
+DEFINE_SPAPR_MACHINE(8, 6, 0);
+
/*
* pseries-rhel8.5.0
* like pseries-6.0
@@ -5442,7 +5523,7 @@ static void spapr_rhel_machine_8_5_0_class_options(MachineClass *mc)
mc->smp_props.prefer_sockets = true;
}
-DEFINE_SPAPR_MACHINE_AS_LATEST(8, 5, 0);
+DEFINE_SPAPR_MACHINE(8, 5, 0);
/*
* pseries-rhel8.4.0
--
2.39.5 (Apple Git-154)

View File

@ -0,0 +1,24 @@
From 3fba57ee91df62b5efa82ee0e066a5a2efc1da04 Mon Sep 17 00:00:00 2001
From: eabdullin <eabdullin@almalinux.org>
Date: Wed, 9 Apr 2025 16:43:18 +0300
Subject: [PATCH] Bring back missing line in target/ppc/cpu-models.c
---
target/ppc/cpu-models.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
index f77ebfcc8..18e942200 100644
--- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c
@@ -744,6 +744,7 @@
/* PowerPC CPU aliases */
PowerPCCPUAlias ppc_cpu_aliases[] = {
+#if 0 /* Disabled for Red Hat Enterprise Linux */
{ "405", "405d4" },
{ "405cr", "405crc" },
{ "405gp", "405gpd" },
--
2.39.5 (Apple Git-154)

View File

@ -0,0 +1,25 @@
From 142dc9a4a974867563c751663bbeec5e9b675522 Mon Sep 17 00:00:00 2001
From: eabdullin <eabdullin@almalinux.org>
Date: Thu, 10 Apr 2025 13:16:31 +0300
Subject: [PATCH] usb: add config options for hub and hid devices for ppc
---
configs/devices/ppc64-softmmu/ppc64-rh-devices.mak | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
index dbb7d3082..4b801b126 100644
--- a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
+++ b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
@@ -20,6 +20,8 @@ CONFIG_USB_STORAGE_CLASSIC=y
CONFIG_USB_XHCI=y
CONFIG_USB_XHCI_NEC=y
CONFIG_USB_XHCI_PCI=y
+CONFIG_USB_HUB=y
+CONFIG_USB_HID=y
CONFIG_VFIO=y
CONFIG_VFIO_PCI=y
CONFIG_VGA=y
--
2.39.5 (Apple Git-154)

View File

@ -1,528 +0,0 @@
From 9928955dc717c10f4c1084ef1ba71308fef68376 Mon Sep 17 00:00:00 2001
From: eabdullin <ed.abdullin.1@gmail.com>
Date: Tue, 15 Oct 2024 10:48:05 +0300
Subject: [PATCH] Add ppc64 support
---
.../ppc64-softmmu/ppc64-rh-devices.mak | 39 ++++++
hw/ppc/spapr.c | 128 +++++++++++++++++-
hw/ppc/spapr_cpu_core.c | 15 ++
include/hw/ppc/spapr.h | 3 +
target/ppc/compat.c | 11 ++
target/ppc/cpu-models.c | 8 ++
target/ppc/cpu.h | 1 +
target/ppc/kvm.c | 27 ++++
target/ppc/kvm_ppc.h | 13 ++
target/ppc/misc_helper.c | 8 --
10 files changed, 240 insertions(+), 13 deletions(-)
create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
diff --git a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
new file mode 100644
index 000000000..4b801b126
--- /dev/null
+++ b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
@@ -0,0 +1,39 @@
+include ../rh-virtio.mak
+
+CONFIG_DIMM=y
+CONFIG_MEM_DEVICE=y
+CONFIG_NVDIMM=y
+CONFIG_PCI=y
+CONFIG_PCI_DEVICES=y
+CONFIG_PCI_TESTDEV=y
+CONFIG_PCI_EXPRESS=y
+CONFIG_PSERIES=y
+CONFIG_SCSI=y
+CONFIG_SPAPR_VSCSI=y
+CONFIG_TEST_DEVICES=y
+CONFIG_USB=y
+CONFIG_USB_OHCI=y
+CONFIG_USB_OHCI_PCI=y
+CONFIG_USB_SMARTCARD=y
+CONFIG_USB_STORAGE_CORE=y
+CONFIG_USB_STORAGE_CLASSIC=y
+CONFIG_USB_XHCI=y
+CONFIG_USB_XHCI_NEC=y
+CONFIG_USB_XHCI_PCI=y
+CONFIG_USB_HUB=y
+CONFIG_USB_HID=y
+CONFIG_VFIO=y
+CONFIG_VFIO_PCI=y
+CONFIG_VGA=y
+CONFIG_VGA_PCI=y
+CONFIG_VHOST_USER=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_VGA=y
+CONFIG_WDT_IB6300ESB=y
+CONFIG_XICS=y
+CONFIG_XIVE=y
+CONFIG_TPM=y
+CONFIG_TPM_SPAPR=y
+CONFIG_TPM_EMULATOR=y
+CONFIG_VHOST_VSOCK=y
+CONFIG_VHOST_USER_VSOCK=y
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b0a0f8c68..5369bbba4 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1717,7 +1717,13 @@ static void spapr_machine_reset(MachineState *machine, ResetType type)
}
spapr_caps_apply(spapr);
spapr_nested_reset(spapr);
-
+ if (spapr->svm_allowed) {
+#ifdef CONFIG_KVM
+ kvmppc_svm_allow(&error_fatal);
+#else
+ error_setg(&error_fatal, "No PEF support in tcg, try x-svm-allowed=off");
+#endif
+ }
first_ppc_cpu = POWERPC_CPU(first_cpu);
if (kvm_enabled() && kvmppc_has_cap_mmu_radix() &&
ppc_type_check_compat(machine->cpu_type, CPU_POWERPC_LOGICAL_3_00, 0,
@@ -3408,6 +3414,21 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp)
spapr->host_serial = g_strdup(value);
}
+static bool spapr_get_svm_allowed(Object *obj, Error **errp)
+{
+ SpaprMachineState *spapr = SPAPR_MACHINE(obj);
+
+ return spapr->svm_allowed;
+}
+
+static void spapr_set_svm_allowed(Object *obj, bool value, Error **errp)
+{
+ SpaprMachineState *spapr = SPAPR_MACHINE(obj);
+
+ spapr->svm_allowed = value;
+}
+
+
static void spapr_instance_init(Object *obj)
{
SpaprMachineState *spapr = SPAPR_MACHINE(obj);
@@ -3486,6 +3507,12 @@ static void spapr_instance_init(Object *obj)
spapr_get_host_serial, spapr_set_host_serial);
object_property_set_description(obj, "host-serial",
"Host serial number to advertise in guest device tree");
+ object_property_add_bool(obj, "x-svm-allowed",
+ spapr_get_svm_allowed,
+ spapr_set_svm_allowed);
+ object_property_set_description(obj, "x-svm-allowed",
+ "Allow the guest to become a Secure Guest"
+ " (experimental only)");
}
static void spapr_machine_finalizefn(Object *obj)
@@ -4706,6 +4733,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
vmc->client_architecture_support = spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce;
vmc->setprop = spapr_vof_setprop;
+ smc->has_power9_support = true;
}
static const TypeInfo spapr_machine_info = {
@@ -4761,11 +4789,12 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
} \
type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__))
-#define DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor) \
- DEFINE_SPAPR_MACHINE_IMPL(true, major, minor)
-#define DEFINE_SPAPR_MACHINE(major, minor) \
- DEFINE_SPAPR_MACHINE_IMPL(false, major, minor)
+#define DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor, micro) \
+ DEFINE_SPAPR_MACHINE_IMPL(true, major, minor, micro)
+#define DEFINE_SPAPR_MACHINE(major, minor, micro) \
+ DEFINE_SPAPR_MACHINE_IMPL(false, major, minor, micro)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
/*
* pseries-10.1
*/
@@ -5060,6 +5089,95 @@ static void spapr_machine_3_0_class_options(MachineClass *mc)
}
DEFINE_SPAPR_MACHINE(3, 0);
+#endif /* disabled for RHEL */
+
+static void spapr_rhel_machine_default_class_options(MachineClass *mc)
+{
+ /*
+ * Defaults for the latest behaviour inherited from the base class
+ * can be overriden here for all pseries-rhel* machines.
+ */
+
+ /* Maximum supported VCPU count */
+ mc->max_cpus = 384;
+}
+
+static void spapr_rhel_machine_10_0_0_class_options(MachineClass *mc)
+{
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ /* The default machine type must apply the RHEL specific defaults */
+ spapr_rhel_machine_default_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_10_0,
+ hw_compat_rhel_10_0_len);
+ smc->pre_6_2_numa_affinity = true;
+ mc->smp_props.prefer_sockets = true;
+}
+
+DEFINE_SPAPR_MACHINE_AS_LATEST(10, 0, 0);
+
+static void spapr_rhel_machine_9_6_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_10_0_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9,
+ hw_compat_rhel_9_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 6, 0);
+
+static void spapr_rhel_machine_9_5_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_6_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_5,
+ hw_compat_rhel_9_5_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 5, 0);
+
+static void spapr_rhel_machine_9_4_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_5_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_4,
+ hw_compat_rhel_9_4_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 4, 0);
+
+static void spapr_rhel_machine_9_3_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_4_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_3,
+ hw_compat_rhel_9_3_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 3, 0);
+
+static void spapr_rhel_machine_9_2_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_3_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_2,
+ hw_compat_rhel_9_2_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 2, 0);
+
+static void spapr_rhel_machine_9_1_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_2_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_1,
+ hw_compat_rhel_9_1_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 1, 0);
+
+static void spapr_rhel_machine_9_0_0_class_options(MachineClass *mc)
+{
+ spapr_rhel_machine_9_1_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_0,
+ hw_compat_rhel_9_0_len);
+}
+
+DEFINE_SPAPR_MACHINE(9, 0, 0);
static void spapr_machine_register_types(void)
{
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index faf9170ba..df3bde0db 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -25,6 +25,7 @@
#include "system/reset.h"
#include "system/hw_accel.h"
#include "qemu/error-report.h"
+#include "cpu-models.h"
static void spapr_reset_vcpu(PowerPCCPU *cpu)
{
@@ -268,6 +269,7 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
{
CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu);
+ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
if (!qdev_realize(DEVICE(cpu), NULL, errp)) {
return false;
@@ -286,6 +288,17 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
/* Set time-base frequency to 512 MHz. vhyp must be set first. */
cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ);
+ if (!smc->has_power9_support &&
+ (((spapr->max_compat_pvr &&
+ ppc_compat_cmp(spapr->max_compat_pvr,
+ CPU_POWERPC_LOGICAL_3_00) >= 0)) ||
+ (!spapr->max_compat_pvr &&
+ ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, 0)))) {
+ error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
+ "POWER9 CPU is not supported by this machine class");
+ return false;
+ }
+
if (spapr_irq_cpu_intc_create(spapr, cpu, errp) < 0) {
qdev_unrealize(DEVICE(cpu));
return false;
@@ -401,10 +414,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
.instance_size = sizeof(SpaprCpuCore),
.class_size = sizeof(SpaprCpuCoreClass),
},
+#if 0 /* Disabled for Red Hat Enterprise Linux */
DEFINE_SPAPR_CPU_CORE_TYPE("970_v2.2"),
DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.0"),
DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.1"),
DEFINE_SPAPR_CPU_CORE_TYPE("power5p_v2.1"),
+#endif
DEFINE_SPAPR_CPU_CORE_TYPE("power7_v2.3"),
DEFINE_SPAPR_CPU_CORE_TYPE("power7p_v2.1"),
DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"),
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 39bd5bd5e..e50e8328d 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -156,6 +156,7 @@ struct SpaprMachineClass {
bool pre_5_2_numa_associativity;
bool pre_6_2_numa_affinity;
+ bool has_power9_support;
bool (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
uint64_t *buid, hwaddr *pio,
hwaddr *mmio32, hwaddr *mmio64,
@@ -258,6 +259,8 @@ struct SpaprMachineState {
/* Set by -boot */
char *boot_device;
+ /* Secure Guest support via x-svm-allowed */
+ bool svm_allowed;
/*< public >*/
char *kvm_type;
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index 55de3bd5d..1bf6994da 100644
--- a/target/ppc/compat.c
+++ b/target/ppc/compat.c
@@ -121,6 +121,17 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
return NULL;
}
+long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2)
+{
+ const CompatInfo *compat1 = compat_by_pvr(pvr1);
+ const CompatInfo *compat2 = compat_by_pvr(pvr2);
+
+ g_assert(compat1);
+ g_assert(compat2);
+
+ return compat1 - compat2;
+}
+
static bool pcc_compat(PowerPCCPUClass *pcc, uint32_t compat_pvr,
uint32_t min_compat_pvr, uint32_t max_compat_pvr)
{
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
index ece348178..6cfa71eec 100644
--- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c
@@ -66,6 +66,7 @@
#define POWERPC_DEF(_name, _pvr, _type, _desc) \
POWERPC_DEF_SVR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type)
+#if 0 /* Embedded and 32-bit CPUs disabled for Red Hat Enterprise Linux */
/* Embedded PowerPC */
/* PowerPC 405 family */
/* PowerPC 405 cores */
@@ -698,8 +699,10 @@
"PowerPC 7447A v1.2 (G4)")
POWERPC_DEF("7457a_v1.2", CPU_POWERPC_74x7A_v12, 7455,
"PowerPC 7457A v1.2 (G4)")
+#endif
/* 64 bits PowerPC */
#if defined(TARGET_PPC64)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
POWERPC_DEF("970_v2.2", CPU_POWERPC_970_v22, 970,
"PowerPC 970 v2.2")
POWERPC_DEF("970fx_v1.0", CPU_POWERPC_970FX_v10, 970,
@@ -718,6 +721,7 @@
"PowerPC 970MP v1.1")
POWERPC_DEF("power5p_v2.1", CPU_POWERPC_POWER5P_v21, POWER5P,
"POWER5+ v2.1")
+#endif
POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER7,
"POWER7 v2.3")
POWERPC_DEF("power7p_v2.1", CPU_POWERPC_POWER7P_v21, POWER7,
@@ -897,12 +901,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
{ "7457a", "7457a_v1.2" },
{ "apollo7pm", "7457a_v1.0" },
#if defined(TARGET_PPC64)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
{ "970", "970_v2.2" },
{ "970fx", "970fx_v3.1" },
{ "970mp", "970mp_v1.1" },
{ "power5+", "power5p_v2.1" },
{ "power5+_v2.1", "power5p_v2.1" },
{ "power5gs", "power5+_v2.1" },
+#endif
{ "power7", "power7_v2.3" },
{ "power7+", "power7p_v2.1" },
{ "power7+_v2.1", "power7p_v2.1" },
@@ -914,12 +920,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
{ "power11", "power11_v2.0" },
#endif
+#if 0 /* Disabled for Red Hat Enterprise Linux */
/* Generic PowerPCs */
#if defined(TARGET_PPC64)
{ "ppc64", "970fx_v3.1" },
#endif
{ "ppc32", "604" },
{ "ppc", "604" },
+#endif
{ NULL, NULL }
};
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 3ee83517d..121e57482 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1686,6 +1686,7 @@ static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch)
/* Compatibility modes */
#if defined(TARGET_PPC64)
+long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2);
bool ppc_check_compat(PowerPCCPU *cpu, uint32_t compat_pvr,
uint32_t min_compat_pvr, uint32_t max_compat_pvr);
bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr,
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 992356cb7..43c468343 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -93,6 +93,7 @@ static int cap_fwnmi;
static int cap_rpt_invalidate;
static int cap_ail_mode_3;
static int cap_dawr1;
+static int cap_ppc_secure_guest;
#ifdef CONFIG_PSERIES
static int cap_papr;
@@ -151,6 +152,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
cap_resize_hpt = kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT);
kvmppc_get_cpu_characteristics(s);
cap_ppc_nested_kvm_hv = kvm_vm_check_extension(s, KVM_CAP_PPC_NESTED_HV);
+ cap_ppc_secure_guest = kvm_vm_check_extension(s, KVM_CAP_PPC_SECURE_GUEST);
cap_large_decr = kvmppc_get_dec_bits();
cap_fwnmi = kvm_vm_check_extension(s, KVM_CAP_PPC_FWNMI);
cap_dawr1 = kvm_vm_check_extension(s, KVM_CAP_PPC_DAWR1);
@@ -2609,6 +2611,16 @@ bool kvmppc_supports_ail_3(void)
return cap_ail_mode_3;
}
+bool kvmppc_has_cap_secure_guest(void)
+{
+ return !!cap_ppc_secure_guest;
+}
+
+int kvmppc_enable_cap_secure_guest(void)
+{
+ return kvm_vm_enable_cap(kvm_state, KVM_CAP_PPC_SECURE_GUEST, 0, 1);
+}
+
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void)
{
uint32_t host_pvr = mfpvr();
@@ -3024,3 +3036,18 @@ static void kvm_cpu_accel_register_types(void)
type_register_static(&kvm_cpu_accel_type_info);
}
type_init(kvm_cpu_accel_register_types);
+
+void kvmppc_svm_allow(Error **errp)
+{
+ if (!kvm_enabled()) {
+ error_setg(errp, "No PEF support in tcg, try x-svm-allowed=off");
+ return;
+ }
+
+ if (!kvmppc_has_cap_secure_guest()) {
+ error_setg(errp, "KVM implementation does not support secure guests, "
+ "try x-svm-allowed=off");
+ } else if (kvmppc_enable_cap_secure_guest() < 0) {
+ error_setg(errp, "Error enabling x-svm-allowed, try x-svm-allowed=off");
+ }
+}
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index a8768c1df..59f50cb79 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -46,6 +46,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu);
target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu,
bool radix, bool gtse,
uint64_t proc_tbl);
+void kvmppc_svm_allow(Error **errp);
bool kvmppc_spapr_use_multitce(void);
int kvmppc_spapr_enable_inkernel_multitce(void);
void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift,
@@ -81,6 +82,8 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable);
int kvmppc_has_cap_rpt_invalidate(void);
bool kvmppc_supports_ail_3(void);
int kvmppc_enable_hwrng(void);
+bool kvmppc_has_cap_secure_guest(void);
+int kvmppc_enable_cap_secure_guest(void);
int kvmppc_put_books_sregs(PowerPCCPU *cpu);
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void);
void kvmppc_check_papr_resize_hpt(Error **errp);
@@ -439,6 +442,16 @@ static inline bool kvmppc_supports_ail_3(void)
return false;
}
+static inline bool kvmppc_has_cap_secure_guest(void)
+{
+ return false;
+}
+
+static inline int kvmppc_enable_cap_secure_guest(void)
+{
+ return -1;
+}
+
static inline int kvmppc_enable_hwrng(void)
{
return -1;
diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c
index 46ae454af..607ed3735 100644
--- a/target/ppc/misc_helper.c
+++ b/target/ppc/misc_helper.c
@@ -332,10 +332,6 @@ target_ulong helper_load_sprd(CPUPPCState *env)
PnvCore *pc = pnv_cpu_state(cpu)->pnv_core;
target_ulong sprc = env->spr[SPR_POWER_SPRC];
- if (pc->big_core) {
- pc = pnv_chip_find_core(pc->chip, CPU_CORE(pc)->core_id & ~0x1);
- }
-
switch (sprc & 0x3e0) {
case 0: /* SCRATCH0-3 */
case 1: /* SCRATCH4-7 */
@@ -372,10 +368,6 @@ void helper_store_sprd(CPUPPCState *env, target_ulong val)
PnvCore *pc = pnv_cpu_state(cpu)->pnv_core;
int nr;
- if (pc->big_core) {
- pc = pnv_chip_find_core(pc->chip, CPU_CORE(pc)->core_id & ~0x1);
- }
-
switch (sprc & 0x3e0) {
case 0: /* SCRATCH0-3 */
case 1: /* SCRATCH4-7 */
--
2.39.5 (Apple Git-154)

View File

@ -1,20 +0,0 @@
From 32c5296efbb9e9a4e7ede9591e37bd307f3b1ced Mon Sep 17 00:00:00 2001
From: Andrew Lukoshko <alukoshko@almalinux.org>
Date: Sat, 26 Oct 2024 20:09:06 +0000
Subject: [PATCH] Enable QXL device build
---
configs/devices/x86_64-softmmu/x86_64-rh-devices.mak | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
index 45a8a1529..2769c1eb4 100644
--- a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
+++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
@@ -118,3 +118,4 @@ CONFIG_VHOST_USER_FS=y
CONFIG_VHOST_USER_SND=y
CONFIG_VHOST_USER_GPU=y
CONFIG_UEFI_VARS=y
+CONFIG_QXL=y
--
2.43.5

View File

@ -0,0 +1,11 @@
diff -ur old/hw/ppc/spapr.c new/hw/ppc/spapr.c
--- old/hw/ppc/spapr.c 2025-04-17 22:54:19.662932754 +0000
+++ new/hw/ppc/spapr.c 2025-04-18 03:45:15.811916763 +0000
@@ -4840,7 +4840,6 @@
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
MACHINE_VER_SYM(class_options, spapr, __VA_ARGS__)(mc); \
- MACHINE_VER_DEPRECATION(__VA_ARGS__); \
if (latest) { \
spapr_machine_latest_class_options(mc); \
} \