Skip to content

Commit 3d3efb6

Browse files
committed
KVM: PPC: Book3S HV: Ignore timebase offset on POWER9 DD1
POWER9 DD1 has an erratum where writing to the TBU40 register, which is used to apply an offset to the timebase, can cause the timebase to lose counts. This results in the timebase on some CPUs getting out of sync with other CPUs, which then results in misbehaviour of the timekeeping code. To work around the problem, we make KVM ignore the timebase offset for all guests on POWER9 DD1 machines. This means that live migration cannot be supported on POWER9 DD1 machines. Cc: [email protected] # v4.10+ Signed-off-by: Paul Mackerras <[email protected]>
1 parent 7ceaa6d commit 3d3efb6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,14 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
14861486
r = set_vpa(vcpu, &vcpu->arch.dtl, addr, len);
14871487
break;
14881488
case KVM_REG_PPC_TB_OFFSET:
1489+
/*
1490+
* POWER9 DD1 has an erratum where writing TBU40 causes
1491+
* the timebase to lose ticks. So we don't let the
1492+
* timebase offset be changed on P9 DD1. (It is
1493+
* initialized to zero.)
1494+
*/
1495+
if (cpu_has_feature(CPU_FTR_POWER9_DD1))
1496+
break;
14891497
/* round up to multiple of 2^24 */
14901498
vcpu->arch.vcore->tb_offset =
14911499
ALIGN(set_reg_val(id, *val), 1UL << 24);

0 commit comments

Comments
 (0)