aboutsummaryrefslogtreecommitdiff
path: root/target/ppc/translate_init.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2017-07-14 18:13:58 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2017-07-17 15:07:05 +1000
commit346ebfc6fbf1a0c07cbdfc52beef0f0b9b5180d4 (patch)
tree733b8f121f448a838ddae7a755088f8e52e04fec /target/ppc/translate_init.c
parentdf8658de43db242ea82183d75cc957c2b0fa013a (diff)
target/ppc: fix CPU hotplug when radix is enabled (TCG)
But when a guest initializes radix mode, it issues a H_REGISTER_PROC_TBL to update the LPCR of all CPUs. Hot-plugged CPUs inherit from the same setting under KVM but not under TCG. So, Let's check for radix and update the default LPCR to keep new CPUs in sync. Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/translate_init.c')
-rw-r--r--target/ppc/translate_init.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
index ae25fafab9..b325c2cce6 100644
--- a/target/ppc/translate_init.c
+++ b/target/ppc/translate_init.c
@@ -9011,8 +9011,16 @@ void cpu_ppc_set_papr(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp)
/* By default we choose legacy mode and switch to new hash or radix
* when a register process table hcall is made. So disable process
* tables and guest translation shootdown by default
+ *
+ * Hot-plugged CPUs inherit from the guest radix setting under
+ * KVM but not under TCG. Update the default LPCR to keep new
+ * CPUs in sync when radix is enabled.
*/
- lpcr->default_value &= ~(LPCR_UPRT | LPCR_GTSE);
+ if (ppc64_radix_guest(cpu)) {
+ lpcr->default_value |= LPCR_UPRT | LPCR_GTSE;
+ } else {
+ lpcr->default_value &= ~(LPCR_UPRT | LPCR_GTSE);
+ }
lpcr->default_value |= LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE |
LPCR_OEE;
break;