Compare commits

..

No commits in common. "a10s" and "a10" have entirely different histories.
a10s ... a10

3 changed files with 70 additions and 158 deletions

View File

@ -84,11 +84,11 @@ actions:
count: 1
- target: "spec"
find: |
%ifarch aarch64 s390x x86_64 riscv64
%ifarch aarch64 s390x x86_64
--with-devices-%{kvm_target}=%{kvm_target}-rh-devices \
%endif
replace: |
%ifarch aarch64 s390x x86_64 riscv64
%ifarch aarch64 s390x x86_64
--with-devices-%{kvm_target}=%{kvm_target}-rh-devices \
%endif
%ifarch %{power64}
@ -135,9 +135,14 @@ actions:
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
@ -176,7 +181,6 @@ actions:
- "Enable building for ppc64le"
- "Re-added Spice support"
- "Don't remove slof.bin for ppc64le"
- "Apply patch to fix duplicate label in docs"
- add_files:
- type: "patch"
@ -185,6 +189,3 @@ actions:
- type: "patch"
name: "2002-Enable-QXL-device-build.patch"
number: 2002
- type: "patch"
name: "docs-Dont-define-duplicate-label-in-qemu-block-.patch"
number: 2003

View File

@ -1,20 +1,19 @@
From 9928955dc717c10f4c1084ef1ba71308fef68376 Mon Sep 17 00:00:00 2001
From eb742e8a7c75e3be5c158cb19185d9cf6ae4862c 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 ++
hw/ppc/spapr.c | 125 +++++++++++++++++-
hw/ppc/spapr_cpu_core.c | 16 +++
include/hw/ppc/spapr.h | 3 +
target/ppc/compat.c | 11 ++
target/ppc/cpu-models.c | 8 ++
target/ppc/cpu-models.c | 9 +-
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(-)
9 files changed, 237 insertions(+), 7 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
@ -63,14 +62,13 @@ index 000000000..4b801b126
+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
index 370d7c35d..aed36a4de 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1717,7 +1717,13 @@ static void spapr_machine_reset(MachineState *machine, ResetType type)
@@ -1746,6 +1746,13 @@ static void spapr_machine_reset(MachineState *machine, ShutdownCause reason)
}
spapr_caps_apply(spapr);
spapr_nested_reset(spapr);
-
+ if (spapr->svm_allowed) {
+#ifdef CONFIG_KVM
+ kvmppc_svm_allow(&error_fatal);
@ -78,10 +76,10 @@ index b0a0f8c68..5369bbba4 100644
+ 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)
@@ -3452,6 +3459,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp)
spapr->host_serial = g_strdup(value);
}
@ -98,12 +96,11 @@ index b0a0f8c68..5369bbba4 100644
+
+ 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)
@@ -3530,6 +3551,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");
@ -116,7 +113,7 @@ index b0a0f8c68..5369bbba4 100644
}
static void spapr_machine_finalizefn(Object *obj)
@@ -4706,6 +4733,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
@@ -4775,6 +4802,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;
@ -124,7 +121,7 @@ index b0a0f8c68..5369bbba4 100644
}
static const TypeInfo spapr_machine_info = {
@@ -4761,11 +4789,12 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
@@ -4830,13 +4858,14 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
} \
type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__))
@ -132,19 +129,33 @@ index b0a0f8c68..5369bbba4 100644
- DEFINE_SPAPR_MACHINE_IMPL(true, major, minor)
-#define DEFINE_SPAPR_MACHINE(major, minor) \
- DEFINE_SPAPR_MACHINE_IMPL(false, major, minor)
-#define DEFINE_SPAPR_MACHINE_TAGGED(major, minor, tag) \
- DEFINE_SPAPR_MACHINE_IMPL(false, major, minor, _, tag)
+#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)
+#define DEFINE_SPAPR_MACHINE_TAGGED(major, minor, micro, tag) \
+ DEFINE_SPAPR_MACHINE_IMPL(false, major, minor, micro, _, tag)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
/*
* pseries-10.0
* pseries-9.1
*/
@@ -5060,6 +5089,95 @@ static void spapr_machine_3_0_class_options(MachineClass *mc)
@@ -5056,6 +5085,9 @@ static bool phb_placement_4_0(SpaprMachineState *spapr, uint32_t index,
}
return true;
}
DEFINE_SPAPR_MACHINE(3, 0);
+#endif
+
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void spapr_machine_4_0_class_options(MachineClass *mc)
{
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
@@ -5380,6 +5412,87 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len);
}
DEFINE_SPAPR_MACHINE(2, 1);
+#endif /* disabled for RHEL */
+
+static void spapr_rhel_machine_default_class_options(MachineClass *mc)
@ -172,18 +183,9 @@ index b0a0f8c68..5369bbba4 100644
+
+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);
+ spapr_rhel_machine_10_0_0_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_5,
+ hw_compat_rhel_9_5_len);
+}
@ -234,22 +236,23 @@ index b0a0f8c68..5369bbba4 100644
+}
+
+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
index 56090abcd..e3371b24f 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 "sysemu/reset.h"
#include "sysemu/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,
@@ -264,6 +265,7 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
{
CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu);
@ -257,7 +260,7 @@ index faf9170ba..df3bde0db 100644
if (!qdev_realize(DEVICE(cpu), NULL, errp)) {
return false;
@@ -286,6 +288,17 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
@@ -280,6 +282,18 @@ 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);
@ -271,11 +274,12 @@ index faf9170ba..df3bde0db 100644
+ "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[] = {
@@ -399,10 +413,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
.instance_size = sizeof(SpaprCpuCore),
.class_size = sizeof(SpaprCpuCoreClass),
},
@ -289,10 +293,10 @@ index faf9170ba..df3bde0db 100644
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
index f6de3e997..3cc7ef0c0 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -156,6 +156,7 @@ struct SpaprMachineClass {
@@ -157,6 +157,7 @@ struct SpaprMachineClass {
bool pre_5_2_numa_associativity;
bool pre_6_2_numa_affinity;
@ -310,10 +314,10 @@ index 39bd5bd5e..e50e8328d 100644
/*< public >*/
char *kvm_type;
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index 55de3bd5d..1bf6994da 100644
index ebef2ccce..ab7ed7680 100644
--- a/target/ppc/compat.c
+++ b/target/ppc/compat.c
@@ -121,6 +121,17 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
@@ -114,6 +114,17 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
return NULL;
}
@ -332,7 +336,7 @@ index 55de3bd5d..1bf6994da 100644
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
index f2301b43f..4c38fa517 100644
--- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c
@@ -66,6 +66,7 @@
@ -362,7 +366,7 @@ index ece348178..6cfa71eec 100644
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[] = {
@@ -895,12 +899,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
{ "7457a", "7457a_v1.2" },
{ "apollo7pm", "7457a_v1.0" },
#if defined(TARGET_PPC64)
@ -377,10 +381,11 @@ index ece348178..6cfa71eec 100644
{ "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" },
@@ -910,13 +916,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
{ "power9", "power9_v2.2" },
{ "power10", "power10_v2.0" },
#endif
-
+#if 0 /* Disabled for Red Hat Enterprise Linux */
/* Generic PowerPCs */
#if defined(TARGET_PPC64)
@ -393,10 +398,10 @@ index ece348178..6cfa71eec 100644
{ NULL, NULL }
};
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 3ee83517d..121e57482 100644
index 321ed2da7..e35a99762 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)
@@ -1673,6 +1673,7 @@ static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch)
/* Compatibility modes */
#if defined(TARGET_PPC64)
@ -405,26 +410,26 @@ index 3ee83517d..121e57482 100644
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
index 907dba60d..c942ff55b 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -93,6 +93,7 @@ static int cap_fwnmi;
@@ -92,6 +92,7 @@ static int cap_large_decr;
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)
@@ -150,6 +151,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)
/*
@@ -2597,6 +2599,16 @@ bool kvmppc_supports_ail_3(void)
return cap_ail_mode_3;
}
@ -441,7 +446,7 @@ index 992356cb7..43c468343 100644
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)
@@ -3012,3 +3024,18 @@ static void kvm_cpu_accel_register_types(void)
type_register_static(&kvm_cpu_accel_type_info);
}
type_init(kvm_cpu_accel_register_types);
@ -461,7 +466,7 @@ index 992356cb7..43c468343 100644
+ }
+}
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index a8768c1df..59f50cb79 100644
index 1975fb5ee..d1017f98b 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -46,6 +46,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu);
@ -472,7 +477,7 @@ index a8768c1df..59f50cb79 100644
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);
@@ -79,6 +80,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);
@ -481,7 +486,7 @@ index a8768c1df..59f50cb79 100644
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)
@@ -427,6 +430,16 @@ static inline bool kvmppc_supports_ail_3(void)
return false;
}
@ -498,32 +503,5 @@ index a8768c1df..59f50cb79 100644
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,67 +0,0 @@
From 82707dd4f07613eed8d639956a43bddffca5cd5c Mon Sep 17 00:00:00 2001
From: Peter Maydell <peter.maydell@linaro.org>
Date: Thu, 1 May 2025 10:31:26 +0100
Subject: [PATCH] docs: Don't define duplicate label in
qemu-block-drivers.rst.inc
Sphinx requires that labels within documents are unique across the
whole manual. This is because the "create a hyperlink" directive
specifies only the name of the label, not a filename+label. Some
Sphinx versions will warn about duplicate labels, but even if there
is no warning there is still an ambiguity and no guarantee that the
hyperlink will be created to the right target.
For QEMU this is awkward, because we have various .rst.inc fragments
which we include into multiple .rst files. If you define a label in
the .rst.inc file then it will be a duplicate label. We have mostly
worked around this by not putting labels into those .rst.inc files,
or by adding "insert a label" functionality into the hxtool extension
(see commit 1eeb432a953b0 "doc/sphinx/hxtool.py: add optional label
argument to SRST directive").
Unfortunately in commit 7f6314427e78 ("docs/devel: add a codebase
section") we accidentally added a duplicate label, because not all
Sphinx versions warn about the mistake.
In this case the link was only from the developer docs codebase
summary, so as the simplest fix for the stable branch, we drop
the link entirely.
Cc: qemu-stable@nongnu.org
Fixes: 1eeb432a953b0 "doc/sphinx/hxtool.py: add optional label argument to SRST directive"
Reported-by: Dario Faggioli <dfaggioli@suse.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20250501093126.716667-1-peter.maydell@linaro.org
---
docs/devel/codebase.rst | 2 +-
docs/system/qemu-block-drivers.rst.inc | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/docs/devel/codebase.rst b/docs/devel/codebase.rst
index 40273e7d31e1..2a3143787a6c 100644
--- a/docs/devel/codebase.rst
+++ b/docs/devel/codebase.rst
@@ -116,7 +116,7 @@ yet, so sometimes the source code is all you have.
* `monitor <https://gitlab.com/qemu-project/qemu/-/tree/master/monitor>`_:
`Monitor <QEMU monitor>` implementation (HMP & QMP).
* `nbd <https://gitlab.com/qemu-project/qemu/-/tree/master/nbd>`_:
- QEMU `NBD (Network Block Device) <nbd>` server.
+ QEMU NBD (Network Block Device) server.
* `net <https://gitlab.com/qemu-project/qemu/-/tree/master/net>`_:
Network (host) support.
* `pc-bios <https://gitlab.com/qemu-project/qemu/-/tree/master/pc-bios>`_:
diff --git a/docs/system/qemu-block-drivers.rst.inc b/docs/system/qemu-block-drivers.rst.inc
index cfe1acb78ae5..384e95ba7650 100644
--- a/docs/system/qemu-block-drivers.rst.inc
+++ b/docs/system/qemu-block-drivers.rst.inc
@@ -500,8 +500,6 @@ What you should *never* do:
- expect it to work when loadvm'ing
- write to the FAT directory on the host system while accessing it with the guest system
-.. _nbd:
-
NBD access
~~~~~~~~~~