Commit 482969d6 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by David Gibson
Browse files

spapr: initialize VSMT before initializing the IRQ backend



We will need to use xics_max_server_number() to create the sPAPRXive
object modeling the interrupt controller of the machine which is
created before the CPUs.

Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
[dwg: Fix style nit]
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent e4ddaac6
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2464,11 +2464,6 @@ static void spapr_init_cpus(sPAPRMachineState *spapr)
        boot_cores_nr = possible_cpus->len;
    }

    /* VSMT must be set in order to be able to compute VCPU ids, ie to
     * call xics_max_server_number() or spapr_vcpu_id().
     */
    spapr_set_vsmt_mode(spapr, &error_fatal);

    if (smc->pre_2_10_has_unused_icps) {
        int i;

@@ -2591,6 +2586,12 @@ static void spapr_machine_init(MachineState *machine)
    /* Setup a load limit for the ramdisk leaving room for SLOF and FDT */
    load_limit = MIN(spapr->rma_size, RTAS_MAX_ADDR) - FW_OVERHEAD;

    /*
     * VSMT must be set in order to be able to compute VCPU ids, ie to
     * call xics_max_server_number() or spapr_vcpu_id().
     */
    spapr_set_vsmt_mode(spapr, &error_fatal);

    /* Set up Interrupt Controller before we create the VCPUs */
    smc->irq->init(spapr, &error_fatal);