Message ID | 20210510150015.11119-4-frankja@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | s390x: cpumodel: Add sclp checks | expand |
On 10.05.21 17:00, Janosch Frank wrote: > SCLP is also part of the cpumodel, so we need to make sure that the > features indicated via read info / read cpu info are correct. > > Signed-off-by: Janosch Frank <frankja@linux.ibm.com> > --- > s390x/cpumodel.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 58 insertions(+), 1 deletion(-) > > diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c > index 4dd8b96f..619c3dc7 100644 > --- a/s390x/cpumodel.c > +++ b/s390x/cpumodel.c > @@ -2,14 +2,69 @@ > /* > * Test the known dependencies for facilities > * > - * Copyright 2019 IBM Corp. > + * Copyright 2019, 2021 IBM Corp. > * > * Authors: > * Christian Borntraeger <borntraeger@de.ibm.com> > + * Janosch Frank <frankja@linux.ibm.com> > */ > > #include <asm/facility.h> > #include <vm.h> > +#include <sclp.h> > +#include <uv.h> > +#include <asm/uv.h> > + > +static void test_sclp_missing_sief2_implications(void) > +{ > + /* Virtualization related facilities */ > + report(!sclp_facilities.has_64bscao, "!64bscao"); > + report(!sclp_facilities.has_pfmfi, "!pfmfi"); > + report(!sclp_facilities.has_gsls, "!gsls"); > + report(!sclp_facilities.has_cmma, "!cmma"); > + report(!sclp_facilities.has_esca, "!esca"); > + report(!sclp_facilities.has_kss, "!kss"); > + report(!sclp_facilities.has_ibs, "!ibs"); > + > + /* Virtualization related facilities reported via CPU entries */ > + report(!sclp_facilities.has_sigpif, "!sigpif"); > + report(!sclp_facilities.has_sief2, "!sief2"); > + report(!sclp_facilities.has_skeyi, "!skeyi"); > + report(!sclp_facilities.has_siif, "!siif"); > + report(!sclp_facilities.has_cei, "!cei"); > + report(!sclp_facilities.has_ib, "!ib"); > +} > + > +static void test_sclp_features_fmt4(void) > +{ > + /* > + * STFLE facilities are handled by the Ultravisor but SCLP > + * facilities are advertised by the hypervisor. > + */ > + report_prefix_push("PV guest implies"); > + > + /* General facilities */ > + report(!sclp_facilities.has_diag318, "!diag318"); > + > + /* > + * Virtualization related facilities, all of which are > + * unavailable because there's no virtualization support in a > + * protected guest. > + */ > + test_sclp_missing_sief2_implications(); > + > + report_prefix_pop(); > +} > + > +static void test_sclp_features(void) > +{ > + report_prefix_push("sclp"); > + > + if (uv_os_is_guest()) > + test_sclp_features_fmt4(); > + > + report_prefix_pop(); > +} > > static struct { > int facility; > @@ -60,6 +115,8 @@ int main(void) > } > report_prefix_pop(); > > + test_sclp_features(); > + > report_prefix_pop(); > return report_summary(); > } > Acked-by: David Hildenbrand <david@redhat.com>
On Mon, 10 May 2021 15:00:14 +0000 Janosch Frank <frankja@linux.ibm.com> wrote: > SCLP is also part of the cpumodel, so we need to make sure that the > features indicated via read info / read cpu info are correct. > > Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> > --- > s390x/cpumodel.c | 59 > +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 > insertions(+), 1 deletion(-) > > diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c > index 4dd8b96f..619c3dc7 100644 > --- a/s390x/cpumodel.c > +++ b/s390x/cpumodel.c > @@ -2,14 +2,69 @@ > /* > * Test the known dependencies for facilities > * > - * Copyright 2019 IBM Corp. > + * Copyright 2019, 2021 IBM Corp. > * > * Authors: > * Christian Borntraeger <borntraeger@de.ibm.com> > + * Janosch Frank <frankja@linux.ibm.com> > */ > > #include <asm/facility.h> > #include <vm.h> > +#include <sclp.h> > +#include <uv.h> > +#include <asm/uv.h> > + > +static void test_sclp_missing_sief2_implications(void) > +{ > + /* Virtualization related facilities */ > + report(!sclp_facilities.has_64bscao, "!64bscao"); > + report(!sclp_facilities.has_pfmfi, "!pfmfi"); > + report(!sclp_facilities.has_gsls, "!gsls"); > + report(!sclp_facilities.has_cmma, "!cmma"); > + report(!sclp_facilities.has_esca, "!esca"); > + report(!sclp_facilities.has_kss, "!kss"); > + report(!sclp_facilities.has_ibs, "!ibs"); > + > + /* Virtualization related facilities reported via CPU > entries */ > + report(!sclp_facilities.has_sigpif, "!sigpif"); > + report(!sclp_facilities.has_sief2, "!sief2"); > + report(!sclp_facilities.has_skeyi, "!skeyi"); > + report(!sclp_facilities.has_siif, "!siif"); > + report(!sclp_facilities.has_cei, "!cei"); > + report(!sclp_facilities.has_ib, "!ib"); > +} > + > +static void test_sclp_features_fmt4(void) > +{ > + /* > + * STFLE facilities are handled by the Ultravisor but SCLP > + * facilities are advertised by the hypervisor. > + */ > + report_prefix_push("PV guest implies"); > + > + /* General facilities */ > + report(!sclp_facilities.has_diag318, "!diag318"); > + > + /* > + * Virtualization related facilities, all of which are > + * unavailable because there's no virtualization support in a > + * protected guest. > + */ > + test_sclp_missing_sief2_implications(); > + > + report_prefix_pop(); > +} > + > +static void test_sclp_features(void) > +{ > + report_prefix_push("sclp"); > + > + if (uv_os_is_guest()) > + test_sclp_features_fmt4(); > + > + report_prefix_pop(); > +} > > static struct { > int facility; > @@ -60,6 +115,8 @@ int main(void) > } > report_prefix_pop(); > > + test_sclp_features(); > + > report_prefix_pop(); > return report_summary(); > }
diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c index 4dd8b96f..619c3dc7 100644 --- a/s390x/cpumodel.c +++ b/s390x/cpumodel.c @@ -2,14 +2,69 @@ /* * Test the known dependencies for facilities * - * Copyright 2019 IBM Corp. + * Copyright 2019, 2021 IBM Corp. * * Authors: * Christian Borntraeger <borntraeger@de.ibm.com> + * Janosch Frank <frankja@linux.ibm.com> */ #include <asm/facility.h> #include <vm.h> +#include <sclp.h> +#include <uv.h> +#include <asm/uv.h> + +static void test_sclp_missing_sief2_implications(void) +{ + /* Virtualization related facilities */ + report(!sclp_facilities.has_64bscao, "!64bscao"); + report(!sclp_facilities.has_pfmfi, "!pfmfi"); + report(!sclp_facilities.has_gsls, "!gsls"); + report(!sclp_facilities.has_cmma, "!cmma"); + report(!sclp_facilities.has_esca, "!esca"); + report(!sclp_facilities.has_kss, "!kss"); + report(!sclp_facilities.has_ibs, "!ibs"); + + /* Virtualization related facilities reported via CPU entries */ + report(!sclp_facilities.has_sigpif, "!sigpif"); + report(!sclp_facilities.has_sief2, "!sief2"); + report(!sclp_facilities.has_skeyi, "!skeyi"); + report(!sclp_facilities.has_siif, "!siif"); + report(!sclp_facilities.has_cei, "!cei"); + report(!sclp_facilities.has_ib, "!ib"); +} + +static void test_sclp_features_fmt4(void) +{ + /* + * STFLE facilities are handled by the Ultravisor but SCLP + * facilities are advertised by the hypervisor. + */ + report_prefix_push("PV guest implies"); + + /* General facilities */ + report(!sclp_facilities.has_diag318, "!diag318"); + + /* + * Virtualization related facilities, all of which are + * unavailable because there's no virtualization support in a + * protected guest. + */ + test_sclp_missing_sief2_implications(); + + report_prefix_pop(); +} + +static void test_sclp_features(void) +{ + report_prefix_push("sclp"); + + if (uv_os_is_guest()) + test_sclp_features_fmt4(); + + report_prefix_pop(); +} static struct { int facility; @@ -60,6 +115,8 @@ int main(void) } report_prefix_pop(); + test_sclp_features(); + report_prefix_pop(); return report_summary(); }
SCLP is also part of the cpumodel, so we need to make sure that the features indicated via read info / read cpu info are correct. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> --- s390x/cpumodel.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-)