[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 05/20] ppc: Introduce a ppc_cpu_pir() helper
From: |
Cédric Le Goater |
Subject: |
[PATCH v6 05/20] ppc: Introduce a ppc_cpu_pir() helper |
Date: |
Mon, 25 Nov 2019 07:58:05 +0100 |
Signed-off-by: Cédric Le Goater <address@hidden>
---
include/hw/ppc/ppc.h | 1 +
hw/ppc/ppc.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h
index 4bdcb8bacd4e..585be6ab98c5 100644
--- a/include/hw/ppc/ppc.h
+++ b/include/hw/ppc/ppc.h
@@ -5,6 +5,7 @@
void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level);
PowerPCCPU *ppc_get_vcpu_by_pir(int pir);
+int ppc_cpu_pir(PowerPCCPU *cpu);
/* PowerPC hardware exceptions management helpers */
typedef void (*clk_setup_cb)(void *opaque, uint32_t freq);
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index 52a18eb7d7a3..8dd982fc1e40 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -1495,15 +1495,20 @@ void PPC_debug_write (void *opaque, uint32_t addr,
uint32_t val)
}
}
+int ppc_cpu_pir(PowerPCCPU *cpu)
+{
+ CPUPPCState *env = &cpu->env;
+ return env->spr_cb[SPR_PIR].default_value;
+}
+
PowerPCCPU *ppc_get_vcpu_by_pir(int pir)
{
CPUState *cs;
CPU_FOREACH(cs) {
PowerPCCPU *cpu = POWERPC_CPU(cs);
- CPUPPCState *env = &cpu->env;
- if (env->spr_cb[SPR_PIR].default_value == pir) {
+ if (ppc_cpu_pir(cpu) == pir) {
return cpu;
}
}
--
2.21.0
- [PATCH v6 00/20] ppc/pnv: add XIVE support for KVM guests, Cédric Le Goater, 2019/11/25
- [PATCH v6 02/20] ppc/xive: Implement the XivePresenter interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 01/20] ppc/xive: Introduce a XivePresenter interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 03/20] ppc/pnv: Instantiate cores separately, Cédric Le Goater, 2019/11/25
- [PATCH v6 04/20] ppc/pnv: Loop on the threads of the chip to find a matching NVT, Cédric Le Goater, 2019/11/25
- [PATCH v6 05/20] ppc: Introduce a ppc_cpu_pir() helper,
Cédric Le Goater <=
- [PATCH v6 06/20] ppc/pnv: Introduce a pnv_xive_is_cpu_enabled() helper, Cédric Le Goater, 2019/11/25
- [PATCH v6 07/20] ppc/pnv: Fix TIMA indirect access, Cédric Le Goater, 2019/11/25
- [PATCH v6 08/20] ppc/xive: Introduce a XiveFabric interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 09/20] ppc/pnv: Implement the XiveFabric interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 10/20] ppc/spapr: Implement the XiveFabric interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 11/20] ppc/xive: Use the XiveFabric and XivePresenter interfaces, Cédric Le Goater, 2019/11/25
- [PATCH v6 12/20] ppc/xive: Extend the TIMA operation with a XivePresenter parameter, Cédric Le Goater, 2019/11/25