[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/26] s390x/cpumodel: add Concurrent-functions facility support
From: |
Thomas Huth |
Subject: |
[PULL 10/26] s390x/cpumodel: add Concurrent-functions facility support |
Date: |
Wed, 11 Dec 2024 09:59:54 +0100 |
From: Hendrik Brueckner <brueckner@linux.ibm.com>
The Concurrent-functions facility introduces the new instruction
Perform Functions with Concurrent Results (PFCR) with few subfunctions.
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Message-ID: <20241206122751.189721-8-brueckner@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/cpu_features.h | 1 +
target/s390x/cpu_features_def.h.inc | 8 ++++++++
target/s390x/cpu_features.c | 2 ++
target/s390x/cpu_models.c | 5 +++++
target/s390x/gen-features.c | 13 +++++++++++++
target/s390x/kvm/kvm.c | 6 ++++++
6 files changed, 35 insertions(+)
diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h
index 661a8cd6db..5635839d03 100644
--- a/target/s390x/cpu_features.h
+++ b/target/s390x/cpu_features.h
@@ -44,6 +44,7 @@ typedef enum {
S390_FEAT_TYPE_SORTL,
S390_FEAT_TYPE_DFLTCC,
S390_FEAT_TYPE_UV_FEAT_GUEST,
+ S390_FEAT_TYPE_PFCR,
} S390FeatType;
/* Definition of a CPU feature */
diff --git a/target/s390x/cpu_features_def.h.inc
b/target/s390x/cpu_features_def.h.inc
index f96cb5a7d8..09872ab3d8 100644
--- a/target/s390x/cpu_features_def.h.inc
+++ b/target/s390x/cpu_features_def.h.inc
@@ -116,6 +116,7 @@ DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement
facility")
DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility")
DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility")
DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation
extension-1")
+DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility")
/* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to
byte-80) */
DEF_FEAT(SIE_GSLS, "gsls", SCLP_CONF_CHAR, 40, "SIE:
Guest-storage-limit-suppression facility")
@@ -413,3 +414,10 @@ DEF_FEAT(DEFLATE_F0, "dfltcc-f0", DFLTCC, 192, "DFLTCC
format 0 parameter-block"
/* Features exposed via the UV-CALL instruction */
DEF_FEAT(UV_FEAT_AP, "appv", UV_FEAT_GUEST, 4, "AP instructions installed for
secure guests")
DEF_FEAT(UV_FEAT_AP_INTR, "appvi", UV_FEAT_GUEST, 5, "AP instructions
interruption support for secure guests")
+
+/* Features exposed via the PFCR instruction (concurrent-functions facility).
*/
+DEF_FEAT(PFCR_QAF, "pfcr-qaf", PFCR, 0, "PFCR Query-Available-Functions")
+DEF_FEAT(PFCR_CSDST, "pfcr-csdst", PFCR, 1, "PFCR
Compare-and-Swap-and-Double-Store (32)")
+DEF_FEAT(PFCR_CSDSTG, "pfcr-csdstg", PFCR, 2, "PFCR
Compare-and-Swap-and-Double-Store (64)")
+DEF_FEAT(PFCR_CSTST, "pfcr-cstst", PFCR, 3, "PFCR
Compare-and-Swap-and-Triple-Store (32)")
+DEF_FEAT(PFCR_CSTSTG, "pfcr-cststg", PFCR, 4, "PFCR
Compare-and-Swap-and-Triple-Store (64)")
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index 385a2ff860..5f8b02f12c 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -93,6 +93,7 @@ void s390_fill_feat_block(const S390FeatBitmap features,
S390FeatType type,
case S390_FEAT_TYPE_KDSA:
case S390_FEAT_TYPE_SORTL:
case S390_FEAT_TYPE_DFLTCC:
+ case S390_FEAT_TYPE_PFCR:
set_be_bit(0, data); /* query is always available */
break;
default:
@@ -263,6 +264,7 @@ static S390FeatGroupDef s390_feature_groups[] = {
FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements
introduced with Multiple-epoch facility"),
FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"),
FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion
facility"),
+ FEAT_GROUP_INIT("ccf", CONCURRENT_FUNCTIONS, "Concurrent-functions
facility"),
};
const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group)
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index a62a3c3771..117434b9a8 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -504,6 +504,11 @@ static void check_consistency(const S390CPUModel *model)
{ S390_FEAT_RDP, S390_FEAT_LOCAL_TLB_CLEARING },
{ S390_FEAT_UV_FEAT_AP, S390_FEAT_AP },
{ S390_FEAT_UV_FEAT_AP_INTR, S390_FEAT_UV_FEAT_AP },
+ { S390_FEAT_PFCR_QAF, S390_FEAT_CCF_BASE },
+ { S390_FEAT_PFCR_CSDST, S390_FEAT_CCF_BASE },
+ { S390_FEAT_PFCR_CSDSTG, S390_FEAT_CCF_BASE },
+ { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE },
+ { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE },
};
int i;
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 302b653214..6d00ffcda7 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -308,6 +308,14 @@
S390_FEAT_DEFLATE_XPND, \
S390_FEAT_DEFLATE_F0
+#define S390_FEAT_GROUP_CONCURRENT_FUNCTIONS \
+ S390_FEAT_CCF_BASE, \
+ S390_FEAT_PFCR_QAF, \
+ S390_FEAT_PFCR_CSDST, \
+ S390_FEAT_PFCR_CSDSTG, \
+ S390_FEAT_PFCR_CSTST, \
+ S390_FEAT_PFCR_CSTSTG
+
/* cpu feature groups */
static uint16_t group_PLO[] = {
S390_FEAT_GROUP_PLO,
@@ -398,6 +406,10 @@ static uint16_t group_DEFLATE_CONVERSION[] = {
S390_FEAT_GROUP_DEFLATE_CONVERSION,
};
+static uint16_t group_CONCURRENT_FUNCTIONS[] = {
+ S390_FEAT_GROUP_CONCURRENT_FUNCTIONS,
+};
+
/* Base features (in order of release)
* Only non-hypervisor managed features belong here.
* Base feature sets are static meaning they do not change in future QEMU
@@ -948,6 +960,7 @@ static FeatGroupDefSpec FeatGroupDef[] = {
FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF),
FEAT_GROUP_INITIALIZER(ENH_SORT),
FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION),
+ FEAT_GROUP_INITIALIZER(CONCURRENT_FUNCTIONS),
};
#define QEMU_FEAT_INITIALIZER(_name) \
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 8ffe0159d8..dd0322c43a 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -2195,6 +2195,9 @@ static int query_cpu_subfunc(S390FeatBitmap features)
if (test_bit(S390_FEAT_DEFLATE_BASE, features)) {
s390_add_from_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc);
}
+ if (test_bit(S390_FEAT_CCF_BASE, features)) {
+ s390_add_from_feat_block(features, S390_FEAT_TYPE_PFCR, prop.pfcr);
+ }
return 0;
}
@@ -2248,6 +2251,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap
features)
if (test_bit(S390_FEAT_DEFLATE_BASE, features)) {
s390_fill_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc);
}
+ if (test_bit(S390_FEAT_CCF_BASE, features)) {
+ s390_fill_feat_block(features, S390_FEAT_TYPE_PFCR, prop.pfcr);
+ }
return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
}
--
2.47.1
- [PULL 00/26] First s390x and functional testing patches for v10.0, Thomas Huth, 2024/12/11
- [PULL 01/26] hw/i386: define _AS_LATEST() macros for machine types, Thomas Huth, 2024/12/11
- [PULL 02/26] hw: add compat machines for 10.0, Thomas Huth, 2024/12/11
- [PULL 03/26] docs: replace 'Edit on GitLab' with 'View page source', Thomas Huth, 2024/12/11
- [PULL 04/26] s390x/cpumodel: add msa10 subfunctions, Thomas Huth, 2024/12/11
- [PULL 05/26] s390x/cpumodel: add msa11 subfunctions, Thomas Huth, 2024/12/11
- [PULL 08/26] s390x/cpumodel: Add ptff Query Time-Stamp Event (QTSE) support, Thomas Huth, 2024/12/11
- [PULL 12/26] s390x/cpumodel: add Miscellaneous-Instruction-Extensions Facility 4, Thomas Huth, 2024/12/11
- [PULL 10/26] s390x/cpumodel: add Concurrent-functions facility support,
Thomas Huth <=
- [PULL 13/26] s390x/cpumodel: add Vector-Packed-Decimal-Enhancement facility 3, Thomas Huth, 2024/12/11
- [PULL 16/26] s390x/cpumodel: correct PLO feature wording, Thomas Huth, 2024/12/11
- [PULL 18/26] s390x/cpumodel: gen17 model, Thomas Huth, 2024/12/11
- [PULL 06/26] s390x/cpumodel: add msa12 changes, Thomas Huth, 2024/12/11
- [PULL 07/26] s390x/cpumodel: add msa13 subfunctions, Thomas Huth, 2024/12/11
- [PULL 09/26] linux-headers: Update to Linux 6.13-rc1, Thomas Huth, 2024/12/11
- [PULL 19/26] tests/functional: Bump the timeout of the sh4_tuxrun test, Thomas Huth, 2024/12/11
- [PULL 22/26] tests/functional: Convert the emcraft_sf2 avocado test, Thomas Huth, 2024/12/11
- [PULL 24/26] tests/functional: Convert the cubieboard avocado tests, Thomas Huth, 2024/12/11
- [PULL 25/26] tests/functional: remove unused system imports, Thomas Huth, 2024/12/11