[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/47] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_pre
From: |
Nicholas Piggin |
Subject: |
[PULL 13/47] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep |
Date: |
Sat, 24 Feb 2024 01:41:32 +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 46/47] target/ppc: 440 optimise tlbwe TLB flushing, (continued)
- [PULL 46/47] target/ppc: 440 optimise tlbwe TLB flushing, Nicholas Piggin, 2024/02/23
- [PULL 29/47] ppc/pnv: Test pnv i2c master and connected devices, Nicholas Piggin, 2024/02/23
- [PULL 37/47] ppc/pnv: Add POWER9/10 chiptod model, Nicholas Piggin, 2024/02/23
- [PULL 35/47] target/ppc: Improve timebase register defines naming, Nicholas Piggin, 2024/02/23
- [PULL 32/47] hw/ppc: N1 chiplet wiring, Nicholas Piggin, 2024/02/23
- [PULL 34/47] target/ppc: Rename TBL to TB on 64-bit, Nicholas Piggin, 2024/02/23
- [PULL 41/47] target/ppc: Add SMT support to time facilities, Nicholas Piggin, 2024/02/23
- [PULL 44/47] target/ppc: 4xx don't flush TLB for a newly written software TLB entry, Nicholas Piggin, 2024/02/23
- [PULL 45/47] target/ppc: 4xx optimise tlbwe_lo TLB flushing, Nicholas Piggin, 2024/02/23
- [PULL 07/47] tests/avocado: Add pseries KVM boot_linux test, Nicholas Piggin, 2024/02/23
- [PULL 13/47] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep,
Nicholas Piggin <=
- [PULL 16/47] ppc/spapr: Introduce SPAPR_IRQ_NR_IPIS to refer IRQ range for CPU IPIs., Nicholas Piggin, 2024/02/23
- [PULL 30/47] hw/ppc: Add pnv nest pervasive common chiplet model, Nicholas Piggin, 2024/02/23
- [PULL 33/47] target/ppc: Update gdbstub to read SPR's CFAR, DEC, HDEC, TB-L/U, Nicholas Piggin, 2024/02/23
- [PULL 36/47] target/ppc: Fix move-to timebase SPR access permissions, Nicholas Piggin, 2024/02/23
- [PULL 38/47] ppc/pnv: Wire ChipTOD model to powernv9 and powernv10 machines, Nicholas Piggin, 2024/02/23
- [PULL 40/47] target/ppc: Implement core timebase state machine and TFMR, Nicholas Piggin, 2024/02/23
- [PULL 43/47] target/ppc: Factor out 4xx ppcemb_tlb_t flushing, Nicholas Piggin, 2024/02/23
- Re: [PULL 00/47] ppc-for-9.0 queue, Peter Maydell, 2024/02/24