mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
KVM: s390: add concurrent-function facility to cpu model
Adding support for concurrent-functions facility which provides additional subfunctions. Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Link: https://lore.kernel.org/r/20241107152319.77816-2-brueckner@linux.ibm.com Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Message-ID: <20241107152319.77816-2-brueckner@linux.ibm.com>
This commit is contained in:
parent
b638094440
commit
66ff6bf59b
3 changed files with 25 additions and 1 deletions
|
@ -469,7 +469,8 @@ struct kvm_s390_vm_cpu_subfunc {
|
|||
__u8 kdsa[16]; /* with MSA9 */
|
||||
__u8 sortl[32]; /* with STFLE.150 */
|
||||
__u8 dfltcc[32]; /* with STFLE.151 */
|
||||
__u8 reserved[1728];
|
||||
__u8 pfcr[16]; /* with STFLE.201 */
|
||||
__u8 reserved[1712];
|
||||
};
|
||||
|
||||
#define KVM_S390_VM_CPU_PROCESSOR_UV_FEAT_GUEST 6
|
||||
|
|
|
@ -348,6 +348,16 @@ static inline int plo_test_bit(unsigned char nr)
|
|||
return cc == 0;
|
||||
}
|
||||
|
||||
static __always_inline void pfcr_query(u8 (*query)[16])
|
||||
{
|
||||
asm volatile(
|
||||
" lghi 0,0\n"
|
||||
" .insn rsy,0xeb0000000016,0,0,%[query]\n"
|
||||
: [query] "=QS" (*query)
|
||||
:
|
||||
: "cc", "0");
|
||||
}
|
||||
|
||||
static __always_inline void __sortl_query(u8 (*query)[32])
|
||||
{
|
||||
asm volatile(
|
||||
|
@ -429,6 +439,9 @@ static void __init kvm_s390_cpu_feat_init(void)
|
|||
if (test_facility(151)) /* DFLTCC */
|
||||
__dfltcc_query(&kvm_s390_available_subfunc.dfltcc);
|
||||
|
||||
if (test_facility(201)) /* PFCR */
|
||||
pfcr_query(&kvm_s390_available_subfunc.pfcr);
|
||||
|
||||
if (MACHINE_HAS_ESOP)
|
||||
allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ESOP);
|
||||
/*
|
||||
|
@ -1543,6 +1556,9 @@ static int kvm_s390_set_processor_subfunc(struct kvm *kvm,
|
|||
((unsigned long *) &kvm->arch.model.subfuncs.dfltcc)[1],
|
||||
((unsigned long *) &kvm->arch.model.subfuncs.dfltcc)[2],
|
||||
((unsigned long *) &kvm->arch.model.subfuncs.dfltcc)[3]);
|
||||
VM_EVENT(kvm, 3, "GET: guest PFCR subfunc 0x%16.16lx.%16.16lx",
|
||||
((unsigned long *) &kvm_s390_available_subfunc.pfcr)[0],
|
||||
((unsigned long *) &kvm_s390_available_subfunc.pfcr)[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1757,6 +1773,9 @@ static int kvm_s390_get_processor_subfunc(struct kvm *kvm,
|
|||
((unsigned long *) &kvm->arch.model.subfuncs.dfltcc)[1],
|
||||
((unsigned long *) &kvm->arch.model.subfuncs.dfltcc)[2],
|
||||
((unsigned long *) &kvm->arch.model.subfuncs.dfltcc)[3]);
|
||||
VM_EVENT(kvm, 3, "GET: guest PFCR subfunc 0x%16.16lx.%16.16lx",
|
||||
((unsigned long *) &kvm_s390_available_subfunc.pfcr)[0],
|
||||
((unsigned long *) &kvm_s390_available_subfunc.pfcr)[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1825,6 +1844,9 @@ static int kvm_s390_get_machine_subfunc(struct kvm *kvm,
|
|||
((unsigned long *) &kvm_s390_available_subfunc.dfltcc)[1],
|
||||
((unsigned long *) &kvm_s390_available_subfunc.dfltcc)[2],
|
||||
((unsigned long *) &kvm_s390_available_subfunc.dfltcc)[3]);
|
||||
VM_EVENT(kvm, 3, "GET: host PFCR subfunc 0x%16.16lx.%16.16lx",
|
||||
((unsigned long *) &kvm_s390_available_subfunc.pfcr)[0],
|
||||
((unsigned long *) &kvm_s390_available_subfunc.pfcr)[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ static struct facility_def facility_defs[] = {
|
|||
194, /* rdp enhancement facility */
|
||||
196, /* processor activity instrumentation facility */
|
||||
197, /* processor activity instrumentation extension 1 */
|
||||
201, /* concurrent-functions facility */
|
||||
-1 /* END */
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue