mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
ppc/pnv: Add an LPAR per core machine option
Recent POWER CPUs can operate in "LPAR per core" or "LPAR per thread" modes. In per-core mode, some SPRs and IPI doorbells are shared between threads in a core. In per-thread mode, supervisor and user state is not shared between threads. OpenPOWER systems after POWER8 use LPAR per thread mode, and it is required for KVM. Enterprise systems use LPAR per core mode, as they partition the machine by core. Implement a lpar-per-core machine option for powernv machines. This is fixed true for POWER8 machines, and defaults off for P9 and P10. With this change, powernv8 SMT now works sufficiently to run Linux, with a single socket. Multi-threaded KVM guests still have problems, as does multi-socket Linux boot. Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
This commit is contained in:
parent
c889195508
commit
3b5ea01e98
6 changed files with 52 additions and 1 deletions
|
@ -208,6 +208,9 @@ static uint64_t pnv_core_power10_xscom_read(void *opaque, hwaddr addr,
|
|||
val |= PPC_BIT(56 + i);
|
||||
}
|
||||
}
|
||||
if (pc->lpar_per_core) {
|
||||
val |= PPC_BIT(62);
|
||||
}
|
||||
break;
|
||||
case PNV10_XSCOM_EC_CORE_THREAD_INFO:
|
||||
break;
|
||||
|
@ -321,6 +324,10 @@ static void pnv_core_cpu_realize(PnvCore *pc, PowerPCCPU *cpu, Error **errp,
|
|||
env->core_index = core_hwid;
|
||||
}
|
||||
|
||||
if (pc->lpar_per_core) {
|
||||
cpu_ppc_set_1lpar(cpu);
|
||||
}
|
||||
|
||||
/* Set time-base frequency to 512 MHz */
|
||||
cpu_ppc_tb_init(env, PNV_TIMEBASE_FREQ);
|
||||
}
|
||||
|
@ -427,6 +434,7 @@ static Property pnv_core_properties[] = {
|
|||
DEFINE_PROP_BOOL("big-core", PnvCore, big_core, false),
|
||||
DEFINE_PROP_BOOL("quirk-tb-big-core", PnvCore, tod_state.big_core_quirk,
|
||||
false),
|
||||
DEFINE_PROP_BOOL("lpar-per-core", PnvCore, lpar_per_core, false),
|
||||
DEFINE_PROP_LINK("chip", PnvCore, chip, TYPE_PNV_CHIP, PnvChip *),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue