Compare commits

...

4 Commits
a10 ... a10s

Author SHA1 Message Date
eabdullin
42f92ec3c2 Apply upstream fix 2025-05-15 09:38:27 +03:00
eabdullin
57ec3c4923 Update patch 2025-05-14 15:20:48 +03:00
eabdullin
8d39745a55 Update config 2025-04-24 10:21:08 +03:00
eabdullin
7eaad30a78 Update config 2025-04-24 10:15:09 +03:00
3 changed files with 158 additions and 70 deletions

View File

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

View File

@ -1,19 +1,20 @@
From eb742e8a7c75e3be5c158cb19185d9cf6ae4862c Mon Sep 17 00:00:00 2001 From 9928955dc717c10f4c1084ef1ba71308fef68376 Mon Sep 17 00:00:00 2001
From: eabdullin <ed.abdullin.1@gmail.com> From: eabdullin <ed.abdullin.1@gmail.com>
Date: Tue, 15 Oct 2024 10:48:05 +0300 Date: Tue, 15 Oct 2024 10:48:05 +0300
Subject: [PATCH] Add ppc64 support Subject: [PATCH] Add ppc64 support
--- ---
.../ppc64-softmmu/ppc64-rh-devices.mak | 39 ++++++ .../ppc64-softmmu/ppc64-rh-devices.mak | 39 ++++++
hw/ppc/spapr.c | 125 +++++++++++++++++- hw/ppc/spapr.c | 128 +++++++++++++++++-
hw/ppc/spapr_cpu_core.c | 16 +++ hw/ppc/spapr_cpu_core.c | 15 ++
include/hw/ppc/spapr.h | 3 + include/hw/ppc/spapr.h | 3 +
target/ppc/compat.c | 11 ++ target/ppc/compat.c | 11 ++
target/ppc/cpu-models.c | 9 +- target/ppc/cpu-models.c | 8 ++
target/ppc/cpu.h | 1 + target/ppc/cpu.h | 1 +
target/ppc/kvm.c | 27 ++++ target/ppc/kvm.c | 27 ++++
target/ppc/kvm_ppc.h | 13 ++ target/ppc/kvm_ppc.h | 13 ++
9 files changed, 237 insertions(+), 7 deletions(-) target/ppc/misc_helper.c | 8 --
10 files changed, 240 insertions(+), 13 deletions(-)
create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak 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 diff --git a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
@ -62,13 +63,14 @@ index 000000000..4b801b126
+CONFIG_VHOST_VSOCK=y +CONFIG_VHOST_VSOCK=y
+CONFIG_VHOST_USER_VSOCK=y +CONFIG_VHOST_USER_VSOCK=y
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 370d7c35d..aed36a4de 100644 index b0a0f8c68..5369bbba4 100644
--- a/hw/ppc/spapr.c --- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c
@@ -1746,6 +1746,13 @@ static void spapr_machine_reset(MachineState *machine, ShutdownCause reason) @@ -1717,7 +1717,13 @@ static void spapr_machine_reset(MachineState *machine, ResetType type)
} }
spapr_caps_apply(spapr); spapr_caps_apply(spapr);
spapr_nested_reset(spapr); spapr_nested_reset(spapr);
-
+ if (spapr->svm_allowed) { + if (spapr->svm_allowed) {
+#ifdef CONFIG_KVM +#ifdef CONFIG_KVM
+ kvmppc_svm_allow(&error_fatal); + kvmppc_svm_allow(&error_fatal);
@ -76,10 +78,10 @@ index 370d7c35d..aed36a4de 100644
+ error_setg(&error_fatal, "No PEF support in tcg, try x-svm-allowed=off"); + error_setg(&error_fatal, "No PEF support in tcg, try x-svm-allowed=off");
+#endif +#endif
+ } + }
first_ppc_cpu = POWERPC_CPU(first_cpu); first_ppc_cpu = POWERPC_CPU(first_cpu);
if (kvm_enabled() && kvmppc_has_cap_mmu_radix() && if (kvm_enabled() && kvmppc_has_cap_mmu_radix() &&
@@ -3452,6 +3459,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp) 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); spapr->host_serial = g_strdup(value);
} }
@ -96,11 +98,12 @@ index 370d7c35d..aed36a4de 100644
+ +
+ spapr->svm_allowed = value; + spapr->svm_allowed = value;
+} +}
+
+ +
static void spapr_instance_init(Object *obj) static void spapr_instance_init(Object *obj)
{ {
SpaprMachineState *spapr = SPAPR_MACHINE(obj); SpaprMachineState *spapr = SPAPR_MACHINE(obj);
@@ -3530,6 +3551,12 @@ static void spapr_instance_init(Object *obj) @@ -3486,6 +3507,12 @@ static void spapr_instance_init(Object *obj)
spapr_get_host_serial, spapr_set_host_serial); spapr_get_host_serial, spapr_set_host_serial);
object_property_set_description(obj, "host-serial", object_property_set_description(obj, "host-serial",
"Host serial number to advertise in guest device tree"); "Host serial number to advertise in guest device tree");
@ -113,7 +116,7 @@ index 370d7c35d..aed36a4de 100644
} }
static void spapr_machine_finalizefn(Object *obj) static void spapr_machine_finalizefn(Object *obj)
@@ -4775,6 +4802,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) @@ -4706,6 +4733,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
vmc->client_architecture_support = spapr_vof_client_architecture_support; vmc->client_architecture_support = spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce; vmc->quiesce = spapr_vof_quiesce;
vmc->setprop = spapr_vof_setprop; vmc->setprop = spapr_vof_setprop;
@ -121,7 +124,7 @@ index 370d7c35d..aed36a4de 100644
} }
static const TypeInfo spapr_machine_info = { static const TypeInfo spapr_machine_info = {
@@ -4830,13 +4858,14 @@ static void spapr_machine_latest_class_options(MachineClass *mc) @@ -4761,11 +4789,12 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
} \ } \
type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__)) type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__))
@ -129,33 +132,19 @@ index 370d7c35d..aed36a4de 100644
- DEFINE_SPAPR_MACHINE_IMPL(true, major, minor) - DEFINE_SPAPR_MACHINE_IMPL(true, major, minor)
-#define DEFINE_SPAPR_MACHINE(major, minor) \ -#define DEFINE_SPAPR_MACHINE(major, minor) \
- DEFINE_SPAPR_MACHINE_IMPL(false, 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 DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor, micro) \
+ DEFINE_SPAPR_MACHINE_IMPL(true, major, minor, micro) + DEFINE_SPAPR_MACHINE_IMPL(true, major, minor, micro)
+#define DEFINE_SPAPR_MACHINE(major, minor, micro) \ +#define DEFINE_SPAPR_MACHINE(major, minor, micro) \
+ DEFINE_SPAPR_MACHINE_IMPL(false, 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 */ +#if 0 /* Disabled for Red Hat Enterprise Linux */
/* /*
* pseries-9.1 * pseries-10.0
*/ */
@@ -5056,6 +5085,9 @@ static bool phb_placement_4_0(SpaprMachineState *spapr, uint32_t index, @@ -5060,6 +5089,95 @@ static void spapr_machine_3_0_class_options(MachineClass *mc)
} }
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 */ +#endif /* disabled for RHEL */
+ +
+static void spapr_rhel_machine_default_class_options(MachineClass *mc) +static void spapr_rhel_machine_default_class_options(MachineClass *mc)
@ -183,9 +172,18 @@ index 370d7c35d..aed36a4de 100644
+ +
+DEFINE_SPAPR_MACHINE_AS_LATEST(10, 0, 0); +DEFINE_SPAPR_MACHINE_AS_LATEST(10, 0, 0);
+ +
+static void spapr_rhel_machine_9_5_0_class_options(MachineClass *mc) +static void spapr_rhel_machine_9_6_0_class_options(MachineClass *mc)
+{ +{
+ spapr_rhel_machine_10_0_0_class_options(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, + compat_props_add(mc->compat_props, hw_compat_rhel_9_5,
+ hw_compat_rhel_9_5_len); + hw_compat_rhel_9_5_len);
+} +}
@ -236,23 +234,22 @@ index 370d7c35d..aed36a4de 100644
+} +}
+ +
+DEFINE_SPAPR_MACHINE(9, 0, 0); +DEFINE_SPAPR_MACHINE(9, 0, 0);
+
static void spapr_machine_register_types(void) static void spapr_machine_register_types(void)
{ {
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 56090abcd..e3371b24f 100644 index faf9170ba..df3bde0db 100644
--- a/hw/ppc/spapr_cpu_core.c --- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include "sysemu/reset.h" #include "system/reset.h"
#include "sysemu/hw_accel.h" #include "system/hw_accel.h"
#include "qemu/error-report.h" #include "qemu/error-report.h"
+#include "cpu-models.h" +#include "cpu-models.h"
static void spapr_reset_vcpu(PowerPCCPU *cpu) static void spapr_reset_vcpu(PowerPCCPU *cpu)
{ {
@@ -264,6 +265,7 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr, @@ -268,6 +269,7 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
{ {
CPUPPCState *env = &cpu->env; CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu); CPUState *cs = CPU(cpu);
@ -260,7 +257,7 @@ index 56090abcd..e3371b24f 100644
if (!qdev_realize(DEVICE(cpu), NULL, errp)) { if (!qdev_realize(DEVICE(cpu), NULL, errp)) {
return false; return false;
@@ -280,6 +282,18 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr, @@ -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. */ /* Set time-base frequency to 512 MHz. vhyp must be set first. */
cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ); cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ);
@ -274,12 +271,11 @@ index 56090abcd..e3371b24f 100644
+ "POWER9 CPU is not supported by this machine class"); + "POWER9 CPU is not supported by this machine class");
+ return false; + return false;
+ } + }
+
+ +
if (spapr_irq_cpu_intc_create(spapr, cpu, errp) < 0) { if (spapr_irq_cpu_intc_create(spapr, cpu, errp) < 0) {
qdev_unrealize(DEVICE(cpu)); qdev_unrealize(DEVICE(cpu));
return false; return false;
@@ -399,10 +413,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = { @@ -401,10 +414,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
.instance_size = sizeof(SpaprCpuCore), .instance_size = sizeof(SpaprCpuCore),
.class_size = sizeof(SpaprCpuCoreClass), .class_size = sizeof(SpaprCpuCoreClass),
}, },
@ -293,10 +289,10 @@ index 56090abcd..e3371b24f 100644
DEFINE_SPAPR_CPU_CORE_TYPE("power7p_v2.1"), DEFINE_SPAPR_CPU_CORE_TYPE("power7p_v2.1"),
DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"), DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"),
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index f6de3e997..3cc7ef0c0 100644 index 39bd5bd5e..e50e8328d 100644
--- a/include/hw/ppc/spapr.h --- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h
@@ -157,6 +157,7 @@ struct SpaprMachineClass { @@ -156,6 +156,7 @@ struct SpaprMachineClass {
bool pre_5_2_numa_associativity; bool pre_5_2_numa_associativity;
bool pre_6_2_numa_affinity; bool pre_6_2_numa_affinity;
@ -314,10 +310,10 @@ index f6de3e997..3cc7ef0c0 100644
/*< public >*/ /*< public >*/
char *kvm_type; char *kvm_type;
diff --git a/target/ppc/compat.c b/target/ppc/compat.c diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index ebef2ccce..ab7ed7680 100644 index 55de3bd5d..1bf6994da 100644
--- a/target/ppc/compat.c --- a/target/ppc/compat.c
+++ b/target/ppc/compat.c +++ b/target/ppc/compat.c
@@ -114,6 +114,17 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr) @@ -121,6 +121,17 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
return NULL; return NULL;
} }
@ -336,7 +332,7 @@ index ebef2ccce..ab7ed7680 100644
uint32_t min_compat_pvr, uint32_t max_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 diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
index f2301b43f..4c38fa517 100644 index ece348178..6cfa71eec 100644
--- a/target/ppc/cpu-models.c --- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c +++ b/target/ppc/cpu-models.c
@@ -66,6 +66,7 @@ @@ -66,6 +66,7 @@
@ -366,7 +362,7 @@ index f2301b43f..4c38fa517 100644
POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER7, POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER7,
"POWER7 v2.3") "POWER7 v2.3")
POWERPC_DEF("power7p_v2.1", CPU_POWERPC_POWER7P_v21, POWER7, POWERPC_DEF("power7p_v2.1", CPU_POWERPC_POWER7P_v21, POWER7,
@@ -895,12 +899,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { @@ -897,12 +901,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
{ "7457a", "7457a_v1.2" }, { "7457a", "7457a_v1.2" },
{ "apollo7pm", "7457a_v1.0" }, { "apollo7pm", "7457a_v1.0" },
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
@ -381,11 +377,10 @@ index f2301b43f..4c38fa517 100644
{ "power7", "power7_v2.3" }, { "power7", "power7_v2.3" },
{ "power7+", "power7p_v2.1" }, { "power7+", "power7p_v2.1" },
{ "power7+_v2.1", "power7p_v2.1" }, { "power7+_v2.1", "power7p_v2.1" },
@@ -910,13 +916,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { @@ -914,12 +920,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
{ "power9", "power9_v2.2" }, { "power11", "power11_v2.0" },
{ "power10", "power10_v2.0" },
#endif #endif
-
+#if 0 /* Disabled for Red Hat Enterprise Linux */ +#if 0 /* Disabled for Red Hat Enterprise Linux */
/* Generic PowerPCs */ /* Generic PowerPCs */
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
@ -398,10 +393,10 @@ index f2301b43f..4c38fa517 100644
{ NULL, NULL } { NULL, NULL }
}; };
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 321ed2da7..e35a99762 100644 index 3ee83517d..121e57482 100644
--- a/target/ppc/cpu.h --- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h +++ b/target/ppc/cpu.h
@@ -1673,6 +1673,7 @@ static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch) @@ -1686,6 +1686,7 @@ static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch)
/* Compatibility modes */ /* Compatibility modes */
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
@ -410,26 +405,26 @@ index 321ed2da7..e35a99762 100644
uint32_t min_compat_pvr, uint32_t max_compat_pvr); uint32_t min_compat_pvr, uint32_t max_compat_pvr);
bool ppc_type_check_compat(const char *cputype, uint32_t 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 diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 907dba60d..c942ff55b 100644 index 992356cb7..43c468343 100644
--- a/target/ppc/kvm.c --- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c +++ b/target/ppc/kvm.c
@@ -92,6 +92,7 @@ static int cap_large_decr; @@ -93,6 +93,7 @@ static int cap_fwnmi;
static int cap_fwnmi;
static int cap_rpt_invalidate; static int cap_rpt_invalidate;
static int cap_ail_mode_3; static int cap_ail_mode_3;
static int cap_dawr1;
+static int cap_ppc_secure_guest; +static int cap_ppc_secure_guest;
#ifdef CONFIG_PSERIES #ifdef CONFIG_PSERIES
static int cap_papr; static int cap_papr;
@@ -150,6 +151,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) @@ -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); cap_resize_hpt = kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT);
kvmppc_get_cpu_characteristics(s); kvmppc_get_cpu_characteristics(s);
cap_ppc_nested_kvm_hv = kvm_vm_check_extension(s, KVM_CAP_PPC_NESTED_HV); 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_ppc_secure_guest = kvm_vm_check_extension(s, KVM_CAP_PPC_SECURE_GUEST);
cap_large_decr = kvmppc_get_dec_bits(); cap_large_decr = kvmppc_get_dec_bits();
cap_fwnmi = kvm_vm_check_extension(s, KVM_CAP_PPC_FWNMI); cap_fwnmi = kvm_vm_check_extension(s, KVM_CAP_PPC_FWNMI);
/* cap_dawr1 = kvm_vm_check_extension(s, KVM_CAP_PPC_DAWR1);
@@ -2597,6 +2599,16 @@ bool kvmppc_supports_ail_3(void) @@ -2609,6 +2611,16 @@ bool kvmppc_supports_ail_3(void)
return cap_ail_mode_3; return cap_ail_mode_3;
} }
@ -446,7 +441,7 @@ index 907dba60d..c942ff55b 100644
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void) PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void)
{ {
uint32_t host_pvr = mfpvr(); uint32_t host_pvr = mfpvr();
@@ -3012,3 +3024,18 @@ static void kvm_cpu_accel_register_types(void) @@ -3024,3 +3036,18 @@ static void kvm_cpu_accel_register_types(void)
type_register_static(&kvm_cpu_accel_type_info); type_register_static(&kvm_cpu_accel_type_info);
} }
type_init(kvm_cpu_accel_register_types); type_init(kvm_cpu_accel_register_types);
@ -466,7 +461,7 @@ index 907dba60d..c942ff55b 100644
+ } + }
+} +}
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index 1975fb5ee..d1017f98b 100644 index a8768c1df..59f50cb79 100644
--- a/target/ppc/kvm_ppc.h --- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h
@@ -46,6 +46,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu); @@ -46,6 +46,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu);
@ -477,7 +472,7 @@ index 1975fb5ee..d1017f98b 100644
bool kvmppc_spapr_use_multitce(void); bool kvmppc_spapr_use_multitce(void);
int kvmppc_spapr_enable_inkernel_multitce(void); int kvmppc_spapr_enable_inkernel_multitce(void);
void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift,
@@ -79,6 +80,8 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable); @@ -81,6 +82,8 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable);
int kvmppc_has_cap_rpt_invalidate(void); int kvmppc_has_cap_rpt_invalidate(void);
bool kvmppc_supports_ail_3(void); bool kvmppc_supports_ail_3(void);
int kvmppc_enable_hwrng(void); int kvmppc_enable_hwrng(void);
@ -486,7 +481,7 @@ index 1975fb5ee..d1017f98b 100644
int kvmppc_put_books_sregs(PowerPCCPU *cpu); int kvmppc_put_books_sregs(PowerPCCPU *cpu);
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void); PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void);
void kvmppc_check_papr_resize_hpt(Error **errp); void kvmppc_check_papr_resize_hpt(Error **errp);
@@ -427,6 +430,16 @@ static inline bool kvmppc_supports_ail_3(void) @@ -439,6 +442,16 @@ static inline bool kvmppc_supports_ail_3(void)
return false; return false;
} }
@ -503,5 +498,32 @@ index 1975fb5ee..d1017f98b 100644
static inline int kvmppc_enable_hwrng(void) static inline int kvmppc_enable_hwrng(void)
{ {
return -1; 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) 2.39.5 (Apple Git-154)

View File

@ -0,0 +1,67 @@
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
~~~~~~~~~~