Skip to content

Commit 8d9fcac

Browse files
committed
KVM: PPC: Book3S HV: Don't use streamlined entry path on early POWER9 chips
This disables the use of the streamlined entry path for radix guests on early POWER9 chips that need the workaround added in commit a25bd72 ("powerpc/mm/radix: Workaround prefetch issue with KVM", 2017-07-24), because the streamlined entry path does not include that workaround. This also means that we can't do nested HV-KVM on those chips. Since the chips that need that workaround are the same ones that can't run both radix and HPT guests at the same time on different threads of a core, we use the existing 'no_mixing_hpt_and_radix' variable that identifies those chips to identify when we can't use the new guest entry path, and when we can't do nested virtualization. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
1 parent 3d0d0d9 commit 8d9fcac

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,7 +4174,16 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
41744174
vcpu->arch.state = KVMPPC_VCPU_BUSY_IN_HOST;
41754175

41764176
do {
4177-
if (kvm->arch.threads_indep && kvm_is_radix(kvm))
4177+
/*
4178+
* The early POWER9 chips that can't mix radix and HPT threads
4179+
* on the same core also need the workaround for the problem
4180+
* where the TLB would prefetch entries in the guest exit path
4181+
* for radix guests using the guest PIDR value and LPID 0.
4182+
* The workaround is in the old path (kvmppc_run_vcpu())
4183+
* but not the new path (kvmhv_run_single_vcpu()).
4184+
*/
4185+
if (kvm->arch.threads_indep && kvm_is_radix(kvm) &&
4186+
!no_mixing_hpt_and_radix)
41784187
r = kvmhv_run_single_vcpu(run, vcpu, ~(u64)0,
41794188
vcpu->arch.vcore->lpcr);
41804189
else
@@ -5196,7 +5205,7 @@ static int kvmhv_enable_nested(struct kvm *kvm)
51965205
{
51975206
if (!nested)
51985207
return -EPERM;
5199-
if (!cpu_has_feature(CPU_FTR_ARCH_300))
5208+
if (!cpu_has_feature(CPU_FTR_ARCH_300) || no_mixing_hpt_and_radix)
52005209
return -ENODEV;
52015210

52025211
/* kvm == NULL means the caller is testing if the capability exists */

0 commit comments

Comments
 (0)