From 359b131a32bbad83c45e25e21a023a18a5328e857cc35e0e409b0d92ee84484e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 14 Aug 2019 09:49:32 +0000 Subject: [PATCH 1/2] - Add more patches for s390 fate#327911 bsc#1145464: * 0001-s390-cpumf-add-IBM-z14-ZR1-support.patch * 0001-s390-cpumf-add-support-for-counter-second-version-nu.patch * 0001-s390-cpumf-add-support-for-machine-type-8561.patch OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libpfm?expand=0&rev=42 --- 0001-s390-cpumf-add-IBM-z14-ZR1-support.patch | 27 ++++++ ...upport-for-counter-second-version-nu.patch | 88 +++++++++++++++++++ ...mf-add-support-for-machine-type-8561.patch | 29 ++++++ libpfm.changes | 8 ++ libpfm.spec | 9 +- 5 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 0001-s390-cpumf-add-IBM-z14-ZR1-support.patch create mode 100644 0001-s390-cpumf-add-support-for-counter-second-version-nu.patch create mode 100644 0001-s390-cpumf-add-support-for-machine-type-8561.patch diff --git a/0001-s390-cpumf-add-IBM-z14-ZR1-support.patch b/0001-s390-cpumf-add-IBM-z14-ZR1-support.patch new file mode 100644 index 0000000..bfc4e9d --- /dev/null +++ b/0001-s390-cpumf-add-IBM-z14-ZR1-support.patch @@ -0,0 +1,27 @@ +From dc643f4a460063a628b4bfba57dbbb36673a0789 Mon Sep 17 00:00:00 2001 +From: Thomas Richter +Date: Thu, 11 Jul 2019 17:48:03 -0700 +Subject: [PATCH] s390/cpumf: add IBM z14 ZR1 support + +Add support for machine type 0x3907. + +Signed-off-by: Thomas Richter +--- + lib/pfmlib_s390x_cpumf.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index 4e03fc4..7566aa0 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -192,6 +192,7 @@ static int pfm_cpumcf_init(void *this) + ext_set_count = LIBPFM_ARRAY_SIZE(cpumcf_z13_counters); + break; + case 3906: /* IBM z14 */ ++ case 3907: /* IBM z14 ZR1 */ + ext_set = cpumcf_z14_counters; + ext_set_count = LIBPFM_ARRAY_SIZE(cpumcf_z14_counters); + break; +-- +2.22.0 + diff --git a/0001-s390-cpumf-add-support-for-counter-second-version-nu.patch b/0001-s390-cpumf-add-support-for-counter-second-version-nu.patch new file mode 100644 index 0000000..7222f27 --- /dev/null +++ b/0001-s390-cpumf-add-support-for-counter-second-version-nu.patch @@ -0,0 +1,88 @@ +From c08003fb085e23f2229e58cc176fcfcf58a3b238 Mon Sep 17 00:00:00 2001 +From: Thomas Richter +Date: Thu, 11 Jul 2019 17:49:42 -0700 +Subject: [PATCH] s390/cpumf: add support for counter second version number 6 + +IBM added secound version number 6 in the CPU Measurement +Counter facility to indicate additional counters in the +crypto counter set. + +Signed-off-by: Thomas Richter +--- + lib/events/s390x_cpumf_events.h | 39 +++++++++++++++++++++++++++++++++ + lib/pfmlib_s390x_cpumf.c | 2 ++ + 2 files changed, 41 insertions(+) + +diff --git a/lib/events/s390x_cpumf_events.h b/lib/events/s390x_cpumf_events.h +index 8be1d55..8587a3b 100644 +--- a/lib/events/s390x_cpumf_events.h ++++ b/lib/events/s390x_cpumf_events.h +@@ -13,6 +13,8 @@ + #define CPUMF_CTRSET_EXTENDED 1 + #define CPUMF_CTRSET_MT_DIAG 32 + ++#define CPUMF_SVN6_ECC 4 ++ + + static const pme_cpumf_ctr_t cpumcf_fvn1_counters[] = { + { +@@ -270,6 +272,43 @@ static const pme_cpumf_ctr_t cpumcf_svn_generic_counters[] = { + " coprocessor is busy performing a function issued by" + " another CPU", + }, ++ { ++ .ctrnum = 80, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_FUNCTION_COUNT", ++ .desc = "This counter counts the" ++ " total number of the elliptic-curve cryptography (ECC)" ++ " functions issued by the CPU.", ++ }, ++ { ++ .ctrnum = 81, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_CYCLES_COUNT", ++ .desc = "This counter counts the total" ++ " number of CPU cycles when the ECC coprocessor is" ++ " busy performing the elliptic-curve cryptography" ++ " (ECC) functions issued by the CPU.", ++ }, ++ { ++ .ctrnum = 82, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_BLOCKED_FUNCTION_COUNT", ++ .desc = "This counter counts the total number of the" ++ " elliptic-curve cryptography (ECC) functions that are" ++ " issued by the CPU and are blocked because the ECC" ++ " coprocessor is busy performing a function issued by" ++ " another CPU.", ++ }, ++ { ++ .ctrnum = 83, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_BLOCKED_CYCLES_COUNT", ++ .desc = "This counter counts the total number of CPU cycles " ++ " blocked for the elliptic-curve cryptography (ECC) " ++ " functions issued by the CPU because the ECC" ++ " coprocessor is busy perform ing a function issued" ++ " by another CPU.", ++ }, + }; + + static const pme_cpumf_ctr_t cpumcf_z10_counters[] = { +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index 7566aa0..e68b000 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -168,6 +168,8 @@ static int pfm_cpumcf_init(void *this) + /* counters based on second version number */ + csvn_set = cpumcf_svn_generic_counters; + csvn_set_count = LIBPFM_ARRAY_SIZE(cpumcf_svn_generic_counters); ++ if (csvn < 6) /* Crypto counter set enlarged for SVN == 6 */ ++ csvn_set_count -= CPUMF_SVN6_ECC; + + /* check and assign a machine-specific extended counter set */ + switch (get_machine_type()) { +-- +2.22.0 + diff --git a/0001-s390-cpumf-add-support-for-machine-type-8561.patch b/0001-s390-cpumf-add-support-for-machine-type-8561.patch new file mode 100644 index 0000000..2397109 --- /dev/null +++ b/0001-s390-cpumf-add-support-for-machine-type-8561.patch @@ -0,0 +1,29 @@ +From b831b04254ac7fd1700b20b349799810952ff66e Mon Sep 17 00:00:00 2001 +From: Thomas Richter +Date: Thu, 11 Jul 2019 17:51:03 -0700 +Subject: [PATCH] s390/cpumf: add support for machine type 8561 + +Add extended counter set support for s390 machine types +8561 and 8562. + +Signed-off-by: Thomas Richter +--- + lib/pfmlib_s390x_cpumf.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index e68b000..c11f9d9 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -195,6 +195,8 @@ static int pfm_cpumcf_init(void *this) + break; + case 3906: /* IBM z14 */ + case 3907: /* IBM z14 ZR1 */ ++ case 8561: /* IBM Machine types 8561 and 8562 */ ++ case 8562: + ext_set = cpumcf_z14_counters; + ext_set_count = LIBPFM_ARRAY_SIZE(cpumcf_z14_counters); + break; +-- +2.22.0 + diff --git a/libpfm.changes b/libpfm.changes index 933a913..410d7b3 100644 --- a/libpfm.changes +++ b/libpfm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Aug 14 09:44:49 UTC 2019 - Tomáš Chvátal + +- Add more patches for s390 fate#327911 bsc#1145464: + * 0001-s390-cpumf-add-IBM-z14-ZR1-support.patch + * 0001-s390-cpumf-add-support-for-counter-second-version-nu.patch + * 0001-s390-cpumf-add-support-for-machine-type-8561.patch + ------------------------------------------------------------------- Thu Jul 4 06:35:27 UTC 2019 - Martin Liška diff --git a/libpfm.spec b/libpfm.spec index fd56871..1d124b6 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -17,18 +17,21 @@ %global python_config CONFIG_PFMLIB_NOPYTHON=y -%bcond_without python2 %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define vname libpfm4 +%bcond_without python2 Name: libpfm Version: 4.10.1 Release: 0 Summary: Library to encode performance events License: MIT Group: Development/Libraries/C and C++ -Url: http://perfmon2.sourceforge.net/ +URL: http://perfmon2.sourceforge.net/ Source: http://downloads.sourceforge.net/project/perfmon2/libpfm4/%{name}-%{version}.tar.gz Source1: baselibs.conf +Patch0: 0001-s390-cpumf-add-IBM-z14-ZR1-support.patch +Patch1: 0001-s390-cpumf-add-support-for-counter-second-version-nu.patch +Patch2: 0001-s390-cpumf-add-support-for-machine-type-8561.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros @@ -85,13 +88,13 @@ Requires: %{vname} = %{version} %description -n python3-%{name} This package provides python3 bindings for the libpfm4 package and the perf_event_open system call. - %prep %setup -q # disable werror sed -i \ -e 's:-Werror::g' \ config.mk +%autopatch -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects From 97be709dbe41f836bce12c941a76c4ee870974dc518d7d181b64f7e1f6303bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 15 Aug 2019 08:26:04 +0000 Subject: [PATCH 2/2] - Add provides/obsoletes wrt bsc#1145710 to avoid file conflict OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libpfm?expand=0&rev=43 --- libpfm.changes | 5 +++++ libpfm.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/libpfm.changes b/libpfm.changes index 410d7b3..20489da 100644 --- a/libpfm.changes +++ b/libpfm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 15 08:25:29 UTC 2019 - Tomáš Chvátal + +- Add provides/obsoletes wrt bsc#1145710 to avoid file conflict + ------------------------------------------------------------------- Wed Aug 14 09:44:49 UTC 2019 - Tomáš Chvátal diff --git a/libpfm.spec b/libpfm.spec index 1d124b6..29843ab 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -75,6 +75,8 @@ This package contains the static variant of libpfm. %package -n python2-%{name} Summary: Python bindings for libpfm and perf_event_open system call Group: Development/Libraries/Python +Provides: python-%{name} +Obsoletes: python-%{name} Requires: %{vname} = %{version} %description -n python2-%{name}