[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/18] ppc/pnv: Add a pointer from PnvChip to PnvMachineState
From: |
Nicholas Piggin |
Subject: |
[PATCH 03/18] ppc/pnv: Add a pointer from PnvChip to PnvMachineState |
Date: |
Fri, 12 Jul 2024 00:18:35 +1000 |
This helps avoid qdev_get_machine() calls.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
include/hw/ppc/pnv_chip.h | 2 ++
hw/ppc/pnv.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h
index 4eaa7d3999..decfbc0ff7 100644
--- a/include/hw/ppc/pnv_chip.h
+++ b/include/hw/ppc/pnv_chip.h
@@ -23,6 +23,8 @@ struct PnvChip {
SysBusDevice parent_obj;
/*< public >*/
+ PnvMachineState *pnv_machine;
+
uint32_t chip_id;
uint64_t ram_start;
uint64_t ram_size;
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 7878fed43c..3bcf11984c 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -2202,6 +2202,7 @@ static void pnv_chip_core_realize(PnvChip *chip, Error
**errp)
return;
}
+ chip->pnv_machine = pnv;
chip->cores = g_new0(PnvCore *, chip->nr_cores);
for (i = 0, core_hwid = 0; (core_hwid < sizeof(chip->cores_mask) * 8)
@@ -2614,7 +2615,7 @@ static void pnv_cpu_do_nmi(PnvChip *chip, PowerPCCPU
*cpu, void *opaque)
static void pnv_nmi(NMIState *n, int cpu_index, Error **errp)
{
- PnvMachineState *pnv = PNV_MACHINE(qdev_get_machine());
+ PnvMachineState *pnv = PNV_MACHINE(n);
int i;
for (i = 0; i < pnv->num_chips; i++) {
--
2.45.1
- [PATCH 00/18] ppc/pnv: Better big-core model, lpar-per-core, PC unit, Nicholas Piggin, 2024/07/11
- [PATCH 01/18] target/ppc: Fix msgsnd for POWER8, Nicholas Piggin, 2024/07/11
- [PATCH 02/18] ppc/pnv: Add pointer from PnvCPUState to PnvCore, Nicholas Piggin, 2024/07/11
- [PATCH 03/18] ppc/pnv: Add a pointer from PnvChip to PnvMachineState,
Nicholas Piggin <=
- [PATCH 04/18] ppc/pnv: Move timebase state into PnvCore, Nicholas Piggin, 2024/07/11
- [PATCH 05/18] target/ppc: Move SPR indirect registers into PnvCore, Nicholas Piggin, 2024/07/11
- [PATCH 06/18] ppc/pnv: specialise init for powernv8/9/10 machines, Nicholas Piggin, 2024/07/11
- [PATCH 07/18] ppc/pnv: Extend chip_pir class method to TIR as well, Nicholas Piggin, 2024/07/11
- [PATCH 08/18] ppc: Add a core_index to CPUPPCState for SMT vCPUs, Nicholas Piggin, 2024/07/11
- [PATCH 10/18] ppc: Add has_smt_siblings property to CPUPPCState, Nicholas Piggin, 2024/07/11