[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/7] spapr: Correctly set LPCR[GTSE] in H_REGISTER_PR
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 1/7] spapr: Correctly set LPCR[GTSE] in H_REGISTER_PROCESS_TABLE |
Date: |
Tue, 19 Mar 2019 21:06:39 +1100 |
176dccee "target/ppc/spapr: Clear partition table entry when allocating
hash table" reworked the H_REGISTER_PROCESS_TABLE hypercall, but
unfortunately due to a small error no longer correctly sets the LPCR[GTSE]
bit which allows the guest to directly execute (some types of) tlbie (TLB
flush) instructions without involving the hypervisor.
We got away with this, initially, because POWER9 did not have hypervisor
mode enabled in its msr_mask, which meant we didn't actually run hypervisor
privilege checks in TCG at all. However, da874d90 "target/ppc: add HV
support for POWER9" turned on HV support on POWER9 for the benefit of the
powernv machine type.
This exposed the earlier bug in H_REGISTER_PROCESS_TABLE, and causes guests
which rely on LPCR[GTSE] (i.e. basically all of them) to crash during early
boot when their first tlbie instruction causes an unexpected trap.
Fixes: 176dccee target/ppc/spapr: Clear partition table entry when allocating
hash table
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Cleber Rosa <address@hidden>
---
hw/ppc/spapr_hcall.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 0761e10142..8a736797b9 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1400,7 +1400,8 @@ static target_ulong h_register_process_table(PowerPCCPU
*cpu,
else if (flags & FLAG_HASH_PROC_TBL) /* Hash with process tables */
update_lpcr |= LPCR_UPRT;
if (flags & FLAG_GTSE) /* Guest translation shootdown enable */
- update_lpcr |= FLAG_GTSE;
+ update_lpcr |= LPCR_GTSE;
+
spapr_set_all_lpcrs(update_lpcr, LPCR_UPRT | LPCR_HR | LPCR_GTSE);
if (kvm_enabled()) {
--
2.20.1
- [Qemu-devel] [PULL 0/7] ppc-for-4.0 queue 20190319, David Gibson, 2019/03/19
- [Qemu-devel] [PULL 1/7] spapr: Correctly set LPCR[GTSE] in H_REGISTER_PROCESS_TABLE,
David Gibson <=
- [Qemu-devel] [PULL 7/7] spapr: Remove NULL checks on error_propagate() calls, David Gibson, 2019/03/19
- [Qemu-devel] [PULL 6/7] ppc/xics/spapr: Fix H_IPOLL implementation, David Gibson, 2019/03/19
- [Qemu-devel] [PULL 5/7] ppc/pnv: Fix variable size in pnv_psi_power9_irq_set(), David Gibson, 2019/03/19
- [Qemu-devel] [PULL 3/7] MAINTAINERS: PPC: add a PowerNV machine entry, David Gibson, 2019/03/19
- [Qemu-devel] [PULL 4/7] ppc/pnv: Use local_err variable in pnv_chip_power9_intc_create(), David Gibson, 2019/03/19
- [Qemu-devel] [PULL 2/7] ppc/pnv: update skiboot to commit 261ca8e779e5., David Gibson, 2019/03/19
- Re: [Qemu-devel] [PULL 0/7] ppc-for-4.0 queue 20190319, Peter Maydell, 2019/03/19