s390x/cpumodel: add Concurrent-functions facility support
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>
This commit is contained in:
parent
44fe383c27
commit
c9ea365dce
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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)")
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) \
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user