Skip to content

Commit ae3853e

Browse files
committed
Automatic merge of 'topic/ppc-kvm-test' into merge-test (2024-11-10 21:23)
2 parents 379f981 + 96e266e commit ae3853e

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

arch/powerpc/include/asm/cputable.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static inline void cpu_feature_keys_init(void) { }
193193
#define CPU_FTR_ARCH_31 LONG_ASM_CONST(0x0004000000000000)
194194
#define CPU_FTR_DAWR1 LONG_ASM_CONST(0x0008000000000000)
195195
#define CPU_FTR_DEXCR_NPHIE LONG_ASM_CONST(0x0010000000000000)
196+
#define CPU_FTR_P11_PVR LONG_ASM_CONST(0x0020000000000000)
196197

197198
#ifndef __ASSEMBLY__
198199

@@ -454,7 +455,7 @@ static inline void cpu_feature_keys_init(void) { }
454455
CPU_FTR_DAWR | CPU_FTR_DAWR1 | \
455456
CPU_FTR_DEXCR_NPHIE)
456457

457-
#define CPU_FTRS_POWER11 CPU_FTRS_POWER10
458+
#define CPU_FTRS_POWER11 (CPU_FTRS_POWER10 | CPU_FTR_P11_PVR)
458459

459460
#define CPU_FTRS_CELL (CPU_FTR_LWSYNC | \
460461
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
@@ -475,15 +476,15 @@ static inline void cpu_feature_keys_init(void) { }
475476
(CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \
476477
CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | CPU_FTRS_POWER9 | \
477478
CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
478-
CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
479+
CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10 | CPU_FTRS_POWER11)
479480
#else
480481
#define CPU_FTRS_POSSIBLE \
481482
(CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
482483
CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
483484
CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \
484485
CPU_FTR_VSX_COMP | CPU_FTR_ALTIVEC_COMP | CPU_FTRS_POWER9 | \
485486
CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
486-
CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
487+
CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10 | CPU_FTRS_POWER11)
487488
#endif /* CONFIG_CPU_LITTLE_ENDIAN */
488489
#endif
489490
#else
@@ -547,15 +548,15 @@ enum {
547548
(CPU_FTRS_POSSIBLE & ~CPU_FTR_HVMODE & ~CPU_FTR_DBELL & \
548549
CPU_FTRS_POWER7 & CPU_FTRS_POWER8E & CPU_FTRS_POWER8 & \
549550
CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD2_1 & CPU_FTRS_POWER9_DD2_2 & \
550-
CPU_FTRS_POWER10 & CPU_FTRS_DT_CPU_BASE)
551+
CPU_FTRS_POWER10 & CPU_FTRS_POWER11 & CPU_FTRS_DT_CPU_BASE)
551552
#else
552553
#define CPU_FTRS_ALWAYS \
553554
(CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \
554555
CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \
555556
CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \
556557
~CPU_FTR_HVMODE & ~CPU_FTR_DBELL & CPU_FTRS_POSSIBLE & \
557558
CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD2_1 & CPU_FTRS_POWER9_DD2_2 & \
558-
CPU_FTRS_POWER10 & CPU_FTRS_DT_CPU_BASE)
559+
CPU_FTRS_POWER10 & CPU_FTRS_POWER11 & CPU_FTRS_DT_CPU_BASE)
559560
#endif /* CONFIG_CPU_LITTLE_ENDIAN */
560561
#endif
561562
#else

arch/powerpc/include/asm/hvcall.h

+1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@
495495
#define H_GUEST_CAP_COPY_MEM (1UL<<(63-0))
496496
#define H_GUEST_CAP_POWER9 (1UL<<(63-1))
497497
#define H_GUEST_CAP_POWER10 (1UL<<(63-2))
498+
#define H_GUEST_CAP_POWER11 (1UL<<(63-3))
498499
#define H_GUEST_CAP_BITMAP2 (1UL<<(63-63))
499500

500501
#ifndef __ASSEMBLY__

arch/powerpc/kvm/book3s_hv.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,10 @@ static inline unsigned long map_pcr_to_cap(unsigned long pcr)
400400
cap = H_GUEST_CAP_POWER9;
401401
break;
402402
case PCR_ARCH_31:
403-
cap = H_GUEST_CAP_POWER10;
403+
if (cpu_has_feature(CPU_FTR_P11_PVR))
404+
cap = H_GUEST_CAP_POWER11;
405+
else
406+
cap = H_GUEST_CAP_POWER10;
404407
break;
405408
default:
406409
break;
@@ -415,7 +418,7 @@ static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
415418
struct kvmppc_vcore *vc = vcpu->arch.vcore;
416419

417420
/* We can (emulate) our own architecture version and anything older */
418-
if (cpu_has_feature(CPU_FTR_ARCH_31))
421+
if (cpu_has_feature(CPU_FTR_P11_PVR) || cpu_has_feature(CPU_FTR_ARCH_31))
419422
host_pcr_bit = PCR_ARCH_31;
420423
else if (cpu_has_feature(CPU_FTR_ARCH_300))
421424
host_pcr_bit = PCR_ARCH_300;

arch/powerpc/kvm/book3s_hv_nested.c

+2
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ long kvmhv_nested_init(void)
445445
if (rc == H_SUCCESS) {
446446
unsigned long capabilities = 0;
447447

448+
if (cpu_has_feature(CPU_FTR_P11_PVR))
449+
capabilities |= H_GUEST_CAP_POWER11;
448450
if (cpu_has_feature(CPU_FTR_ARCH_31))
449451
capabilities |= H_GUEST_CAP_POWER10;
450452
if (cpu_has_feature(CPU_FTR_ARCH_300))

arch/powerpc/kvm/book3s_hv_nestedv2.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,9 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb,
370370
* default to L1's PVR.
371371
*/
372372
if (!vcpu->arch.vcore->arch_compat) {
373-
if (cpu_has_feature(CPU_FTR_ARCH_31))
373+
if (cpu_has_feature(CPU_FTR_P11_PVR))
374+
arch_compat = PVR_ARCH_31_P11;
375+
else if (cpu_has_feature(CPU_FTR_ARCH_31))
374376
arch_compat = PVR_ARCH_31;
375377
else if (cpu_has_feature(CPU_FTR_ARCH_300))
376378
arch_compat = PVR_ARCH_300;

arch/powerpc/kvm/book3s_mmu_hpte.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ void kvmppc_mmu_hpte_cache_map(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
9292
spin_unlock(&vcpu3s->mmu_lock);
9393
}
9494

95-
static void free_pte_rcu(struct rcu_head *head)
96-
{
97-
struct hpte_cache *pte = container_of(head, struct hpte_cache, rcu_head);
98-
kmem_cache_free(hpte_cache, pte);
99-
}
100-
10195
static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
10296
{
10397
struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
@@ -126,7 +120,7 @@ static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
126120

127121
spin_unlock(&vcpu3s->mmu_lock);
128122

129-
call_rcu(&pte->rcu_head, free_pte_rcu);
123+
kfree_rcu(pte, rcu_head);
130124
}
131125

132126
static void kvmppc_mmu_pte_flush_all(struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)