Message ID | 20220204211536.321475-30-mjrosato@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: s390: enable zPCI for interpretive execution | expand |
On 2/4/22 22:15, Matthew Rosato wrote: > KVM_S390_VM_CPU_FEAT_ZPCI_INTERP relays whether zPCI interpretive > execution is possible based on the available hardware facilities. > > Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.ibm.com> > --- > arch/s390/include/uapi/asm/kvm.h | 1 + > arch/s390/kvm/kvm-s390.c | 5 +++++ > 2 files changed, 6 insertions(+) > > diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h > index 7a6b14874d65..ed06458a871f 100644 > --- a/arch/s390/include/uapi/asm/kvm.h > +++ b/arch/s390/include/uapi/asm/kvm.h > @@ -130,6 +130,7 @@ struct kvm_s390_vm_cpu_machine { > #define KVM_S390_VM_CPU_FEAT_PFMFI 11 > #define KVM_S390_VM_CPU_FEAT_SIGPIF 12 > #define KVM_S390_VM_CPU_FEAT_KSS 13 > +#define KVM_S390_VM_CPU_FEAT_ZPCI_INTERP 14 > struct kvm_s390_vm_cpu_feat { > __u64 feat[16]; > }; > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 208b09d08385..e20d9ac1935d 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -434,6 +434,11 @@ static void kvm_s390_cpu_feat_init(void) > if (test_facility(151)) /* DFLTCC */ > __insn32_query(INSN_DFLTCC, kvm_s390_available_subfunc.dfltcc); > > + /* zPCI Interpretation */ > + if (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV) && test_facility(69) && > + test_facility(70) && test_facility(71) && test_facility(72)) > + allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ZPCI_INTERP); > + > if (MACHINE_HAS_ESOP) > allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ESOP); > /* >
diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h index 7a6b14874d65..ed06458a871f 100644 --- a/arch/s390/include/uapi/asm/kvm.h +++ b/arch/s390/include/uapi/asm/kvm.h @@ -130,6 +130,7 @@ struct kvm_s390_vm_cpu_machine { #define KVM_S390_VM_CPU_FEAT_PFMFI 11 #define KVM_S390_VM_CPU_FEAT_SIGPIF 12 #define KVM_S390_VM_CPU_FEAT_KSS 13 +#define KVM_S390_VM_CPU_FEAT_ZPCI_INTERP 14 struct kvm_s390_vm_cpu_feat { __u64 feat[16]; }; diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 208b09d08385..e20d9ac1935d 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -434,6 +434,11 @@ static void kvm_s390_cpu_feat_init(void) if (test_facility(151)) /* DFLTCC */ __insn32_query(INSN_DFLTCC, kvm_s390_available_subfunc.dfltcc); + /* zPCI Interpretation */ + if (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV) && test_facility(69) && + test_facility(70) && test_facility(71) && test_facility(72)) + allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ZPCI_INTERP); + if (MACHINE_HAS_ESOP) allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ESOP); /*
KVM_S390_VM_CPU_FEAT_ZPCI_INTERP relays whether zPCI interpretive execution is possible based on the available hardware facilities. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> --- arch/s390/include/uapi/asm/kvm.h | 1 + arch/s390/kvm/kvm-s390.c | 5 +++++ 2 files changed, 6 insertions(+)