[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/26] spapr/xive: Deduce the SpaprXive pointer from XiveTCTX::xpt
From: |
David Gibson |
Subject: |
[PULL 21/26] spapr/xive: Deduce the SpaprXive pointer from XiveTCTX::xptr |
Date: |
Wed, 8 Jan 2020 16:23:07 +1100 |
From: Greg Kurz <address@hidden>
And use it instead of reaching out to the machine. This allows to get rid
of a call to qdev_get_machine() and to reduce the scope of another one so
that it is only used within the argument list of error_append_hint(). This
is an acceptable tradeoff compared to all it would require to know about
the maximum number of CPUs here without calling qdev_get_machine().
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/spapr_xive_kvm.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index 32b2809210..edb7ee0e74 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -75,7 +75,7 @@ static void kvm_cpu_disable_all(void)
void kvmppc_xive_cpu_set_state(XiveTCTX *tctx, Error **errp)
{
- SpaprXive *xive = SPAPR_MACHINE(qdev_get_machine())->xive;
+ SpaprXive *xive = SPAPR_XIVE(tctx->xptr);
uint64_t state[2];
int ret;
@@ -97,7 +97,7 @@ void kvmppc_xive_cpu_set_state(XiveTCTX *tctx, Error **errp)
void kvmppc_xive_cpu_get_state(XiveTCTX *tctx, Error **errp)
{
- SpaprXive *xive = SPAPR_MACHINE(qdev_get_machine())->xive;
+ SpaprXive *xive = SPAPR_XIVE(tctx->xptr);
uint64_t state[2] = { 0 };
int ret;
@@ -152,8 +152,7 @@ void kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx,
Error **errp)
void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp)
{
- MachineState *ms = MACHINE(qdev_get_machine());
- SpaprXive *xive = SPAPR_MACHINE(ms)->xive;
+ SpaprXive *xive = SPAPR_XIVE(tctx->xptr);
unsigned long vcpu_id;
int ret;
@@ -179,7 +178,7 @@ void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp)
vcpu_id, strerror(errno));
if (errno == ENOSPC) {
error_append_hint(&local_err, "Try -smp maxcpus=N with N < %u\n",
- ms->smp.max_cpus);
+ MACHINE(qdev_get_machine())->smp.max_cpus);
}
error_propagate(errp, local_err);
return;
--
2.24.1
- [PULL 16/26] spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router, (continued)
- [PULL 16/26] spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router, David Gibson, 2020/01/08
- [PULL 25/26] ppc/pnv: check return value of blk_pwrite(), David Gibson, 2020/01/08
- [PULL 09/26] spapr.c: remove 'out' label in spapr_dt_cas_updates(), David Gibson, 2020/01/08
- [PULL 18/26] ppc/pnv: Add an "nr-threads" property to the base chip class, David Gibson, 2020/01/08
- [PULL 15/26] pnv/xive: Use device_class_set_parent_realize(), David Gibson, 2020/01/08
- [PULL 22/26] pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr, David Gibson, 2020/01/08
- [PULL 14/26] ppc/pnv: Introduce a "xics" property under the POWER8 chip, David Gibson, 2020/01/08
- [PULL 19/26] ppc/pnv: Add a "pnor" const link property to the BMC internal simulator, David Gibson, 2020/01/08
- [PULL 13/26] ppc/pnv: Introduce a "xics" property alias under the PSI model, David Gibson, 2020/01/08
- [PULL 17/26] xive: Use the XIVE fabric link under the XIVE router, David Gibson, 2020/01/08
- [PULL 21/26] spapr/xive: Deduce the SpaprXive pointer from XiveTCTX::xptr,
David Gibson <=
- [PULL 06/26] mos6522: remove anh register, David Gibson, 2020/01/08
- [PULL 11/26] ppc/pnv: Drop "num-chips" machine property, David Gibson, 2020/01/08
- [PULL 03/26] linux-headers: Update, David Gibson, 2020/01/08
- [PULL 12/26] spapr/xive: remove redundant check in spapr_match_nvt(), David Gibson, 2020/01/08
- [PULL 20/26] xive: Add a "presenter" link property to the TCTX object, David Gibson, 2020/01/08
- [PULL 26/26] ppc/pnv: fix check on return value of blk_getlength(), David Gibson, 2020/01/08
- [PULL 23/26] pnv/psi: Add device reset hook, David Gibson, 2020/01/08
- [PULL 24/26] pnv/psi: Consolidate some duplicated code in pnv_psi_realize(), David Gibson, 2020/01/08
- Re: [PULL 00/26] ppc-for-5.0 queue 20200108, Peter Maydell, 2020/01/10