Skip to content

Commit a295320

Browse files
committed
Merge tag 'powerpc-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "An assortment of fixes that were either missed by me, or didn't arrive quite in time for the first v5.4 pull. - Most notable is a fix for an issue with tlbie (broadcast TLB invalidation) on Power9, when using the Radix MMU. The tlbie can race with an mtpid (move to PID register, essentially MMU context switch) on another thread of the core, which can cause stores to continue to go to a page after it's unmapped. - A fix in our KVM code to add a missing barrier, the lack of which has been observed to cause missed IPIs and subsequently stuck CPUs in the host. - A change to the way we initialise PCR (Processor Compatibility Register) to make it forward compatible with future CPUs. - On some older PowerVM systems our H_BLOCK_REMOVE support could oops, fix it to detect such systems and fallback to the old invalidation method. - A fix for an oops seen on some machines when using KASAN on 32-bit. - A handful of other minor fixes, and two new selftests. Thanks to: Alistair Popple, Aneesh Kumar K.V, Christophe Leroy, Gustavo Romero, Joel Stanley, Jordan Niethe, Laurent Dufour, Michael Roth, Oliver O'Halloran" * tag 'powerpc-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/eeh: Fix eeh eeh_debugfs_break_device() with SRIOV devices powerpc/nvdimm: use H_SCM_QUERY hcall on H_OVERLAP error powerpc/nvdimm: Use HCALL error as the return value selftests/powerpc: Add test case for tlbie vs mtpidr ordering issue powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9 powerpc/book3s64/radix: Rename CPU_FTR_P9_TLBIE_BUG feature flag powerpc/book3s64/mm: Don't do tlbie fixup for some hardware revisions powerpc/pseries: Call H_BLOCK_REMOVE when supported powerpc/pseries: Read TLB Block Invalidate Characteristics KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag powerpc/mm: Fix an Oops in kasan_mmu_init() powerpc/mm: Add a helper to select PAGE_KERNEL_RO or PAGE_READONLY powerpc/64s: Set reserved PCR bits powerpc: Fix definition of PCR bits to work with old binutils powerpc/book3s64/radix: Remove WARN_ON in destroy_context() powerpc/tm: Add tm-poison test
2 parents f19e00e + 253c892 commit a295320

File tree

28 files changed

+1476
-93
lines changed

28 files changed

+1476
-93
lines changed

arch/powerpc/include/asm/cputable.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ static inline void cpu_feature_keys_init(void) { }
209209
#define CPU_FTR_POWER9_DD2_1 LONG_ASM_CONST(0x0000080000000000)
210210
#define CPU_FTR_P9_TM_HV_ASSIST LONG_ASM_CONST(0x0000100000000000)
211211
#define CPU_FTR_P9_TM_XER_SO_BUG LONG_ASM_CONST(0x0000200000000000)
212-
#define CPU_FTR_P9_TLBIE_BUG LONG_ASM_CONST(0x0000400000000000)
212+
#define CPU_FTR_P9_TLBIE_STQ_BUG LONG_ASM_CONST(0x0000400000000000)
213213
#define CPU_FTR_P9_TIDR LONG_ASM_CONST(0x0000800000000000)
214+
#define CPU_FTR_P9_TLBIE_ERAT_BUG LONG_ASM_CONST(0x0001000000000000)
214215

215216
#ifndef __ASSEMBLY__
216217

@@ -457,7 +458,7 @@ static inline void cpu_feature_keys_init(void) { }
457458
CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
458459
CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
459460
CPU_FTR_TM_COMP | CPU_FTR_ARCH_300 | CPU_FTR_PKEY | \
460-
CPU_FTR_P9_TLBIE_BUG | CPU_FTR_P9_TIDR)
461+
CPU_FTR_P9_TLBIE_STQ_BUG | CPU_FTR_P9_TLBIE_ERAT_BUG | CPU_FTR_P9_TIDR)
461462
#define CPU_FTRS_POWER9_DD2_0 CPU_FTRS_POWER9
462463
#define CPU_FTRS_POWER9_DD2_1 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1)
463464
#define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \

arch/powerpc/include/asm/kvm_ppc.h

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,100 @@ static inline u32 kvmppc_get_xics_latch(void)
452452
return xirr;
453453
}
454454

455-
static inline void kvmppc_set_host_ipi(int cpu, u8 host_ipi)
455+
/*
456+
* To avoid the need to unnecessarily exit fully to the host kernel, an IPI to
457+
* a CPU thread that's running/napping inside of a guest is by default regarded
458+
* as a request to wake the CPU (if needed) and continue execution within the
459+
* guest, potentially to process new state like externally-generated
460+
* interrupts or IPIs sent from within the guest itself (e.g. H_PROD/H_IPI).
461+
*
462+
* To force an exit to the host kernel, kvmppc_set_host_ipi() must be called
463+
* prior to issuing the IPI to set the corresponding 'host_ipi' flag in the
464+
* target CPU's PACA. To avoid unnecessary exits to the host, this flag should
465+
* be immediately cleared via kvmppc_clear_host_ipi() by the IPI handler on
466+
* the receiving side prior to processing the IPI work.
467+
*
468+
* NOTE:
469+
*
470+
* We currently issue an smp_mb() at the beginning of kvmppc_set_host_ipi().
471+
* This is to guard against sequences such as the following:
472+
*
473+
* CPU
474+
* X: smp_muxed_ipi_set_message():
475+
* X: smp_mb()
476+
* X: message[RESCHEDULE] = 1
477+
* X: doorbell_global_ipi(42):
478+
* X: kvmppc_set_host_ipi(42)
479+
* X: ppc_msgsnd_sync()/smp_mb()
480+
* X: ppc_msgsnd() -> 42
481+
* 42: doorbell_exception(): // from CPU X
482+
* 42: ppc_msgsync()
483+
* 105: smp_muxed_ipi_set_message():
484+
* 105: smb_mb()
485+
* // STORE DEFERRED DUE TO RE-ORDERING
486+
* --105: message[CALL_FUNCTION] = 1
487+
* | 105: doorbell_global_ipi(42):
488+
* | 105: kvmppc_set_host_ipi(42)
489+
* | 42: kvmppc_clear_host_ipi(42)
490+
* | 42: smp_ipi_demux_relaxed()
491+
* | 42: // returns to executing guest
492+
* | // RE-ORDERED STORE COMPLETES
493+
* ->105: message[CALL_FUNCTION] = 1
494+
* 105: ppc_msgsnd_sync()/smp_mb()
495+
* 105: ppc_msgsnd() -> 42
496+
* 42: local_paca->kvm_hstate.host_ipi == 0 // IPI ignored
497+
* 105: // hangs waiting on 42 to process messages/call_single_queue
498+
*
499+
* We also issue an smp_mb() at the end of kvmppc_clear_host_ipi(). This is
500+
* to guard against sequences such as the following (as well as to create
501+
* a read-side pairing with the barrier in kvmppc_set_host_ipi()):
502+
*
503+
* CPU
504+
* X: smp_muxed_ipi_set_message():
505+
* X: smp_mb()
506+
* X: message[RESCHEDULE] = 1
507+
* X: doorbell_global_ipi(42):
508+
* X: kvmppc_set_host_ipi(42)
509+
* X: ppc_msgsnd_sync()/smp_mb()
510+
* X: ppc_msgsnd() -> 42
511+
* 42: doorbell_exception(): // from CPU X
512+
* 42: ppc_msgsync()
513+
* // STORE DEFERRED DUE TO RE-ORDERING
514+
* -- 42: kvmppc_clear_host_ipi(42)
515+
* | 42: smp_ipi_demux_relaxed()
516+
* | 105: smp_muxed_ipi_set_message():
517+
* | 105: smb_mb()
518+
* | 105: message[CALL_FUNCTION] = 1
519+
* | 105: doorbell_global_ipi(42):
520+
* | 105: kvmppc_set_host_ipi(42)
521+
* | // RE-ORDERED STORE COMPLETES
522+
* -> 42: kvmppc_clear_host_ipi(42)
523+
* 42: // returns to executing guest
524+
* 105: ppc_msgsnd_sync()/smp_mb()
525+
* 105: ppc_msgsnd() -> 42
526+
* 42: local_paca->kvm_hstate.host_ipi == 0 // IPI ignored
527+
* 105: // hangs waiting on 42 to process messages/call_single_queue
528+
*/
529+
static inline void kvmppc_set_host_ipi(int cpu)
456530
{
457-
paca_ptrs[cpu]->kvm_hstate.host_ipi = host_ipi;
531+
/*
532+
* order stores of IPI messages vs. setting of host_ipi flag
533+
*
534+
* pairs with the barrier in kvmppc_clear_host_ipi()
535+
*/
536+
smp_mb();
537+
paca_ptrs[cpu]->kvm_hstate.host_ipi = 1;
538+
}
539+
540+
static inline void kvmppc_clear_host_ipi(int cpu)
541+
{
542+
paca_ptrs[cpu]->kvm_hstate.host_ipi = 0;
543+
/*
544+
* order clearing of host_ipi flag vs. processing of IPI messages
545+
*
546+
* pairs with the barrier in kvmppc_set_host_ipi()
547+
*/
548+
smp_mb();
458549
}
459550

460551
static inline void kvmppc_fast_vcpu_kick(struct kvm_vcpu *vcpu)
@@ -486,7 +577,10 @@ static inline u32 kvmppc_get_xics_latch(void)
486577
return 0;
487578
}
488579

489-
static inline void kvmppc_set_host_ipi(int cpu, u8 host_ipi)
580+
static inline void kvmppc_set_host_ipi(int cpu)
581+
{}
582+
583+
static inline void kvmppc_clear_host_ipi(int cpu)
490584
{}
491585

492586
static inline void kvmppc_fast_vcpu_kick(struct kvm_vcpu *vcpu)

arch/powerpc/include/asm/reg.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,10 @@
475475
#define HMER_DEBUG_TRIG (1ul << (63 - 17)) /* Debug trigger */
476476
#define SPRN_HMEER 0x151 /* Hyp maintenance exception enable reg */
477477
#define SPRN_PCR 0x152 /* Processor compatibility register */
478-
#define PCR_VEC_DIS (1ul << (63-0)) /* Vec. disable (bit NA since POWER8) */
479-
#define PCR_VSX_DIS (1ul << (63-1)) /* VSX disable (bit NA since POWER8) */
480-
#define PCR_TM_DIS (1ul << (63-2)) /* Trans. memory disable (POWER8) */
478+
#define PCR_VEC_DIS (__MASK(63-0)) /* Vec. disable (bit NA since POWER8) */
479+
#define PCR_VSX_DIS (__MASK(63-1)) /* VSX disable (bit NA since POWER8) */
480+
#define PCR_TM_DIS (__MASK(63-2)) /* Trans. memory disable (POWER8) */
481+
#define PCR_HIGH_BITS (PCR_VEC_DIS | PCR_VSX_DIS | PCR_TM_DIS)
481482
/*
482483
* These bits are used in the function kvmppc_set_arch_compat() to specify and
483484
* determine both the compatibility level which we want to emulate and the
@@ -486,6 +487,8 @@
486487
#define PCR_ARCH_207 0x8 /* Architecture 2.07 */
487488
#define PCR_ARCH_206 0x4 /* Architecture 2.06 */
488489
#define PCR_ARCH_205 0x2 /* Architecture 2.05 */
490+
#define PCR_LOW_BITS (PCR_ARCH_207 | PCR_ARCH_206 | PCR_ARCH_205)
491+
#define PCR_MASK ~(PCR_HIGH_BITS | PCR_LOW_BITS) /* PCR Reserved Bits */
489492
#define SPRN_HEIR 0x153 /* Hypervisor Emulated Instruction Register */
490493
#define SPRN_TLBINDEXR 0x154 /* P7 TLB control register */
491494
#define SPRN_TLBVPNR 0x155 /* P7 TLB control register */

arch/powerpc/kernel/cpu_setup_power.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _GLOBAL(__setup_cpu_power7)
2323
beqlr
2424
li r0,0
2525
mtspr SPRN_LPID,r0
26+
LOAD_REG_IMMEDIATE(r0, PCR_MASK)
2627
mtspr SPRN_PCR,r0
2728
mfspr r3,SPRN_LPCR
2829
li r4,(LPCR_LPES1 >> LPCR_LPES_SH)
@@ -37,6 +38,7 @@ _GLOBAL(__restore_cpu_power7)
3738
beqlr
3839
li r0,0
3940
mtspr SPRN_LPID,r0
41+
LOAD_REG_IMMEDIATE(r0, PCR_MASK)
4042
mtspr SPRN_PCR,r0
4143
mfspr r3,SPRN_LPCR
4244
li r4,(LPCR_LPES1 >> LPCR_LPES_SH)
@@ -54,6 +56,7 @@ _GLOBAL(__setup_cpu_power8)
5456
beqlr
5557
li r0,0
5658
mtspr SPRN_LPID,r0
59+
LOAD_REG_IMMEDIATE(r0, PCR_MASK)
5760
mtspr SPRN_PCR,r0
5861
mfspr r3,SPRN_LPCR
5962
ori r3, r3, LPCR_PECEDH
@@ -76,6 +79,7 @@ _GLOBAL(__restore_cpu_power8)
7679
beqlr
7780
li r0,0
7881
mtspr SPRN_LPID,r0
82+
LOAD_REG_IMMEDIATE(r0, PCR_MASK)
7983
mtspr SPRN_PCR,r0
8084
mfspr r3,SPRN_LPCR
8185
ori r3, r3, LPCR_PECEDH
@@ -98,6 +102,7 @@ _GLOBAL(__setup_cpu_power9)
98102
mtspr SPRN_PSSCR,r0
99103
mtspr SPRN_LPID,r0
100104
mtspr SPRN_PID,r0
105+
LOAD_REG_IMMEDIATE(r0, PCR_MASK)
101106
mtspr SPRN_PCR,r0
102107
mfspr r3,SPRN_LPCR
103108
LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC)
@@ -123,6 +128,7 @@ _GLOBAL(__restore_cpu_power9)
123128
mtspr SPRN_PSSCR,r0
124129
mtspr SPRN_LPID,r0
125130
mtspr SPRN_PID,r0
131+
LOAD_REG_IMMEDIATE(r0, PCR_MASK)
126132
mtspr SPRN_PCR,r0
127133
mfspr r3,SPRN_LPCR
128134
LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC)

arch/powerpc/kernel/dbell.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void doorbell_global_ipi(int cpu)
3333
{
3434
u32 tag = get_hard_smp_processor_id(cpu);
3535

36-
kvmppc_set_host_ipi(cpu, 1);
36+
kvmppc_set_host_ipi(cpu);
3737
/* Order previous accesses vs. msgsnd, which is treated as a store */
3838
ppc_msgsnd_sync();
3939
ppc_msgsnd(PPC_DBELL_MSGTYPE, 0, tag);
@@ -48,7 +48,7 @@ void doorbell_core_ipi(int cpu)
4848
{
4949
u32 tag = cpu_thread_in_core(cpu);
5050

51-
kvmppc_set_host_ipi(cpu, 1);
51+
kvmppc_set_host_ipi(cpu);
5252
/* Order previous accesses vs. msgsnd, which is treated as a store */
5353
ppc_msgsnd_sync();
5454
ppc_msgsnd(PPC_DBELL_MSGTYPE, 0, tag);
@@ -84,7 +84,7 @@ void doorbell_exception(struct pt_regs *regs)
8484

8585
may_hard_irq_enable();
8686

87-
kvmppc_set_host_ipi(smp_processor_id(), 0);
87+
kvmppc_clear_host_ipi(smp_processor_id());
8888
__this_cpu_inc(irq_stat.doorbell_irqs);
8989

9090
smp_ipi_demux_relaxed(); /* already performed the barrier */

arch/powerpc/kernel/dt_cpu_ftrs.c

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static void __restore_cpu_cpufeatures(void)
101101
if (hv_mode) {
102102
mtspr(SPRN_LPID, 0);
103103
mtspr(SPRN_HFSCR, system_registers.hfscr);
104-
mtspr(SPRN_PCR, 0);
104+
mtspr(SPRN_PCR, PCR_MASK);
105105
}
106106
mtspr(SPRN_FSCR, system_registers.fscr);
107107

@@ -144,6 +144,7 @@ static void __init cpufeatures_setup_cpu(void)
144144
mtspr(SPRN_HFSCR, 0);
145145
}
146146
mtspr(SPRN_FSCR, 0);
147+
mtspr(SPRN_PCR, PCR_MASK);
147148

148149
/*
149150
* LPCR does not get cleared, to match behaviour with secondaries
@@ -691,9 +692,37 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f)
691692
return true;
692693
}
693694

695+
/*
696+
* Handle POWER9 broadcast tlbie invalidation issue using
697+
* cpu feature flag.
698+
*/
699+
static __init void update_tlbie_feature_flag(unsigned long pvr)
700+
{
701+
if (PVR_VER(pvr) == PVR_POWER9) {
702+
/*
703+
* Set the tlbie feature flag for anything below
704+
* Nimbus DD 2.3 and Cumulus DD 1.3
705+
*/
706+
if ((pvr & 0xe000) == 0) {
707+
/* Nimbus */
708+
if ((pvr & 0xfff) < 0x203)
709+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_STQ_BUG;
710+
} else if ((pvr & 0xc000) == 0) {
711+
/* Cumulus */
712+
if ((pvr & 0xfff) < 0x103)
713+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_STQ_BUG;
714+
} else {
715+
WARN_ONCE(1, "Unknown PVR");
716+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_STQ_BUG;
717+
}
718+
719+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_ERAT_BUG;
720+
}
721+
}
722+
694723
static __init void cpufeatures_cpu_quirks(void)
695724
{
696-
int version = mfspr(SPRN_PVR);
725+
unsigned long version = mfspr(SPRN_PVR);
697726

698727
/*
699728
* Not all quirks can be derived from the cpufeatures device tree.
@@ -712,10 +741,10 @@ static __init void cpufeatures_cpu_quirks(void)
712741

713742
if ((version & 0xffff0000) == 0x004e0000) {
714743
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
715-
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
716744
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR;
717745
}
718746

747+
update_tlbie_feature_flag(version);
719748
/*
720749
* PKEY was not in the initial base or feature node
721750
* specification, but it should become optional in the next

arch/powerpc/kernel/eeh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ static int eeh_debugfs_break_device(struct pci_dev *pdev)
19601960
pci_err(pdev, "Going to break: %pR\n", bar);
19611961

19621962
if (pdev->is_virtfn) {
1963-
#ifndef CONFIG_IOV
1963+
#ifndef CONFIG_PCI_IOV
19641964
return -ENXIO;
19651965
#else
19661966
/*
@@ -1980,7 +1980,7 @@ static int eeh_debugfs_break_device(struct pci_dev *pdev)
19801980
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
19811981
pos += PCI_SRIOV_CTRL;
19821982
bit = PCI_SRIOV_CTRL_MSE;
1983-
#endif /* !CONFIG_IOV */
1983+
#endif /* !CONFIG_PCI_IOV */
19841984
} else {
19851985
bit = PCI_COMMAND_MEMORY;
19861986
pos = PCI_COMMAND;

arch/powerpc/kvm/book3s_hv.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,11 @@ static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
401401

402402
spin_lock(&vc->lock);
403403
vc->arch_compat = arch_compat;
404-
/* Set all PCR bits for which guest_pcr_bit <= bit < host_pcr_bit */
405-
vc->pcr = host_pcr_bit - guest_pcr_bit;
404+
/*
405+
* Set all PCR bits for which guest_pcr_bit <= bit < host_pcr_bit
406+
* Also set all reserved PCR bits
407+
*/
408+
vc->pcr = (host_pcr_bit - guest_pcr_bit) | PCR_MASK;
406409
spin_unlock(&vc->lock);
407410

408411
return 0;
@@ -3410,7 +3413,7 @@ static int kvmhv_load_hv_regs_and_go(struct kvm_vcpu *vcpu, u64 time_limit,
34103413
}
34113414

34123415
if (vc->pcr)
3413-
mtspr(SPRN_PCR, vc->pcr);
3416+
mtspr(SPRN_PCR, vc->pcr | PCR_MASK);
34143417
mtspr(SPRN_DPDES, vc->dpdes);
34153418
mtspr(SPRN_VTB, vc->vtb);
34163419

@@ -3490,7 +3493,7 @@ static int kvmhv_load_hv_regs_and_go(struct kvm_vcpu *vcpu, u64 time_limit,
34903493
vc->vtb = mfspr(SPRN_VTB);
34913494
mtspr(SPRN_DPDES, 0);
34923495
if (vc->pcr)
3493-
mtspr(SPRN_PCR, 0);
3496+
mtspr(SPRN_PCR, PCR_MASK);
34943497

34953498
if (vc->tb_offset_applied) {
34963499
u64 new_tb = mftb() - vc->tb_offset_applied;

arch/powerpc/kvm/book3s_hv_nested.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void kvmhv_save_hv_regs(struct kvm_vcpu *vcpu, struct hv_guest_state *hr)
2929
{
3030
struct kvmppc_vcore *vc = vcpu->arch.vcore;
3131

32-
hr->pcr = vc->pcr;
32+
hr->pcr = vc->pcr | PCR_MASK;
3333
hr->dpdes = vc->dpdes;
3434
hr->hfscr = vcpu->arch.hfscr;
3535
hr->tb_offset = vc->tb_offset;
@@ -65,7 +65,7 @@ static void byteswap_hv_regs(struct hv_guest_state *hr)
6565
hr->lpid = swab32(hr->lpid);
6666
hr->vcpu_token = swab32(hr->vcpu_token);
6767
hr->lpcr = swab64(hr->lpcr);
68-
hr->pcr = swab64(hr->pcr);
68+
hr->pcr = swab64(hr->pcr) | PCR_MASK;
6969
hr->amor = swab64(hr->amor);
7070
hr->dpdes = swab64(hr->dpdes);
7171
hr->hfscr = swab64(hr->hfscr);
@@ -148,7 +148,7 @@ static void restore_hv_regs(struct kvm_vcpu *vcpu, struct hv_guest_state *hr)
148148
{
149149
struct kvmppc_vcore *vc = vcpu->arch.vcore;
150150

151-
vc->pcr = hr->pcr;
151+
vc->pcr = hr->pcr | PCR_MASK;
152152
vc->dpdes = hr->dpdes;
153153
vcpu->arch.hfscr = hr->hfscr;
154154
vcpu->arch.dawr = hr->dawr0;

0 commit comments

Comments
 (0)