[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/49] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_pre
From: |
Nicholas Piggin |
Subject: |
[PULL 14/49] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep |
Date: |
Mon, 19 Feb 2024 18:29:03 +1000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Check tcg_enabled() before calling softmmu_resize_hpt_prepare()
and softmmu_resize_hpt_commit() to allow the compiler to elide
their calls. The stubs are then unnecessary, remove them.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/spapr_hcall.c | 12 ++++++++----
target/ppc/tcg-stub.c | 15 ---------------
2 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index fcefd1d1c7..0d7d523e6d 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -123,9 +123,11 @@ static target_ulong h_resize_hpt_prepare(PowerPCCPU *cpu,
if (kvm_enabled()) {
return H_HARDWARE;
+ } else if (tcg_enabled()) {
+ return softmmu_resize_hpt_prepare(cpu, spapr, shift);
+ } else {
+ g_assert_not_reached();
}
-
- return softmmu_resize_hpt_prepare(cpu, spapr, shift);
}
static void do_push_sregs_to_kvm_pr(CPUState *cs, run_on_cpu_data data)
@@ -191,9 +193,11 @@ static target_ulong h_resize_hpt_commit(PowerPCCPU *cpu,
if (kvm_enabled()) {
return H_HARDWARE;
+ } else if (tcg_enabled()) {
+ return softmmu_resize_hpt_commit(cpu, spapr, flags, shift);
+ } else {
+ g_assert_not_reached();
}
-
- return softmmu_resize_hpt_commit(cpu, spapr, flags, shift);
}
diff --git a/target/ppc/tcg-stub.c b/target/ppc/tcg-stub.c
index aadcf59d26..740d796b98 100644
--- a/target/ppc/tcg-stub.c
+++ b/target/ppc/tcg-stub.c
@@ -28,18 +28,3 @@ void create_ppc_opcodes(PowerPCCPU *cpu, Error **errp)
void destroy_ppc_opcodes(PowerPCCPU *cpu)
{
}
-
-target_ulong softmmu_resize_hpt_prepare(PowerPCCPU *cpu,
- SpaprMachineState *spapr,
- target_ulong shift)
-{
- g_assert_not_reached();
-}
-
-target_ulong softmmu_resize_hpt_commit(PowerPCCPU *cpu,
- SpaprMachineState *spapr,
- target_ulong flags,
- target_ulong shift)
-{
- g_assert_not_reached();
-}
--
2.42.0
- [PULL 04/49] tests/avocado: improve flaky ppc/pnv boot_linux_console.py test, (continued)
- [PULL 04/49] tests/avocado: improve flaky ppc/pnv boot_linux_console.py test, Nicholas Piggin, 2024/02/19
- [PULL 05/49] tests/avocado: ppc add powernv10 boot_linux_console test, Nicholas Piggin, 2024/02/19
- [PULL 06/49] tests/avocado: Add ppc pseries and powernv hash MMU tests, Nicholas Piggin, 2024/02/19
- [PULL 07/49] tests/avocado: Add pseries KVM boot_linux test, Nicholas Piggin, 2024/02/19
- [PULL 08/49] tests/avocado: ppc add hypervisor tests, Nicholas Piggin, 2024/02/19
- [PULL 10/49] tests/avocado: Use default CPU for pseries machine, Nicholas Piggin, 2024/02/19
- [PULL 09/49] tests/avocado: Add FreeBSD distro boot tests for ppc, Nicholas Piggin, 2024/02/19
- [PULL 12/49] target/ppc: Rename registers to match ISA, Nicholas Piggin, 2024/02/19
- [PULL 14/49] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep,
Nicholas Piggin <=
- [PULL 13/49] hw/ppc/spapr: Add missing license, Nicholas Piggin, 2024/02/19
- [PULL 11/49] ppc/pnv: Update skiboot to v7.1, Nicholas Piggin, 2024/02/19
- [PULL 15/49] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr, Nicholas Piggin, 2024/02/19
- [PULL 16/49] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu', Nicholas Piggin, 2024/02/19
- [PULL 18/49] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS., Nicholas Piggin, 2024/02/19
- [PULL 17/49] ppc/spapr: Introduce SPAPR_IRQ_NR_IPIS to refer IRQ range for CPU IPIs., Nicholas Piggin, 2024/02/19
- [PULL 19/49] ppc/spapr: change pseries machine default to POWER10 CPU, Nicholas Piggin, 2024/02/19
- [PULL 20/49] spapr: Tag pseries-2.1 - 2.11 machines as deprecated, Nicholas Piggin, 2024/02/19
- [PULL 22/49] hw/pci-host/raven.c: Mark raven_io_ops as implementing unaligned accesses, Nicholas Piggin, 2024/02/19