[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 03/13] pseries: Use new method to correct reset sequen
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 03/13] pseries: Use new method to correct reset sequence |
Date: |
Thu, 13 Sep 2012 12:57:11 +1000 |
A number of things need to occur during reset of the PAPR
paravirtualized platform in a specific order. For example, the hash
table needs to be cleared before the CPUs are reset, so that they
initialize their register state correctly, and the CPUs need to have
their main reset called before we set up the entry point state on the
boot cpu. We also need to have the main qdev reset happen before the
creation and installation of the device tree for the new boot, because
we need the state of the devices settled to correctly construct the
device tree.
We currently do the pseries once-per-reset initializations done from a
reset handler. However we can't adequately control when this handler
is called during the reset - in particular we can't guarantee it
happens after all the qdev resets (since qdevs might be registered
after the machine init function has executed).
This patch uses the new QEMUMachine reset method to to fix this
problem, ensuring the various order dependent reset steps happen in
the correct order.
Signed-off-by: David Gibson <address@hidden>
---
hw/spapr.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/spapr.c b/hw/spapr.c
index d88525a..68542e8 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -559,13 +559,13 @@ static void emulate_spapr_hypercall(CPUPPCState *env)
env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]);
}
-static void spapr_reset(void *opaque)
+static void ppc_spapr_reset(void)
{
- sPAPREnvironment *spapr = (sPAPREnvironment *)opaque;
-
/* flush out the hash table */
memset(spapr->htab, 0, spapr->htab_size);
+ qemu_devices_reset();
+
/* Load the fdt */
spapr_finalize_fdt(spapr, spapr->fdt_addr, spapr->rtas_addr,
spapr->rtas_size);
@@ -845,14 +845,13 @@ static void ppc_spapr_init(ram_addr_t ram_size,
boot_device, kernel_cmdline,
pteg_shift + 7);
assert(spapr->fdt_skel != NULL);
-
- qemu_register_reset(spapr_reset, spapr);
}
static QEMUMachine spapr_machine = {
.name = "pseries",
.desc = "pSeries Logical Partition (PAPR compliant)",
.init = ppc_spapr_init,
+ .reset = ppc_spapr_reset,
.max_cpus = MAX_CPUS,
.no_parallel = 1,
.use_scsi = 1,
--
1.7.10.4
- [Qemu-ppc] [0/13] pseries patch queue, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 09/13] pseries: Remove C bitfields from xics code, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 02/13] pseries: Fix and cleanup CPU initialization and reset, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 10/13] pseries: Remove XICS irq type enum type, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 07/13] pseries: Fix XICS reset, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 03/13] pseries: Use new method to correct reset sequence,
David Gibson <=
- [Qemu-ppc] [PATCH 06/13] pseries: Reset emulated PCI TCE tables on system reset, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 05/13] pseries: Clear TCE and signal state when resetting PAPR VIO devices, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 11/13] pseries: Remove never used flags field from spapr vio devices, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 08/13] pseries: Small cleanup to H_CEDE implementation, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 01/13] ppc: Make kvm_arch_put_registers() put *all* the registers, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 12/13] pseries: Rework implementation of TCE bypass, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 04/13] pseries: Add support for new KVM hash table control call, David Gibson, 2012/09/12
- [Qemu-ppc] [PATCH 13/13] pseries: Fix semantics of RTAS int-on, int-off and set-xive functions, David Gibson, 2012/09/12
- Re: [Qemu-ppc] [0/13] pseries patch queue, Alexander Graf, 2012/09/19