Revisão | d220fabf16091ca5c26f3313541bdfb7435d6a08 (tree) |
---|---|
Hora | 2019-05-21 23:59:16 |
Autor | Christian Borntraeger <borntraeger@de.i...> |
Commiter | Cornelia Huck |
s390x/cpumodel: enhanced sort facility
add the enhanced sort facility.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190429090250.7648-7-borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
@@ -109,6 +109,7 @@ static const S390FeatDef s390_features[] = { | ||
109 | 109 | FEAT_INIT("msa8-base", S390_FEAT_TYPE_STFL, 146, "Message-security-assist-extension-8 facility (excluding subfunctions)"), |
110 | 110 | FEAT_INIT("cmmnt", S390_FEAT_TYPE_STFL, 147, "CMM: ESSA-enhancement (no translate) facility"), |
111 | 111 | FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"), |
112 | + FEAT_INIT("esort-base", S390_FEAT_TYPE_STFL, 150, "Enhanced-sort facility (excluding subfunctions)"), | |
112 | 113 | FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector BCD enhancements facility 1"), |
113 | 114 | FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"), |
114 | 115 | FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"), |
@@ -340,6 +341,12 @@ static const S390FeatDef s390_features[] = { | ||
340 | 341 | FEAT_INIT("kdsa-eddsa-sign-ed448", S390_FEAT_TYPE_KDSA, 44, "KDSA EdDSA-Sign-Ed448"), |
341 | 342 | FEAT_INIT("kdsa-eeddsa-sign-ed25519", S390_FEAT_TYPE_KDSA, 48, "KDSA Encrypted-EdDSA-Sign-Ed25519"), |
342 | 343 | FEAT_INIT("kdsa-eeddsa-sign-ed448", S390_FEAT_TYPE_KDSA, 52, "KDSA Encrypted-EdDSA-Sign-Ed448"), |
344 | + | |
345 | + FEAT_INIT("sortl-sflr", S390_FEAT_TYPE_SORTL, 1, "SORTL SFLR"), | |
346 | + FEAT_INIT("sortl-svlr", S390_FEAT_TYPE_SORTL, 2, "SORTL SVLR"), | |
347 | + FEAT_INIT("sortl-32", S390_FEAT_TYPE_SORTL, 130, "SORTL 32 input lists"), | |
348 | + FEAT_INIT("sortl-128", S390_FEAT_TYPE_SORTL, 132, "SORTL 128 input lists"), | |
349 | + FEAT_INIT("sortl-f0", S390_FEAT_TYPE_SORTL, 192, "SORTL format 0 parameter-block"), | |
343 | 350 | }; |
344 | 351 | |
345 | 352 | const S390FeatDef *s390_feat_def(S390Feat feat) |
@@ -403,6 +410,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, | ||
403 | 410 | case S390_FEAT_TYPE_PPNO: |
404 | 411 | case S390_FEAT_TYPE_KMA: |
405 | 412 | case S390_FEAT_TYPE_KDSA: |
413 | + case S390_FEAT_TYPE_SORTL: | |
406 | 414 | set_be_bit(0, data); /* query is always available */ |
407 | 415 | break; |
408 | 416 | default: |
@@ -430,6 +438,7 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type, | ||
430 | 438 | nr_bits = 16384; |
431 | 439 | break; |
432 | 440 | case S390_FEAT_TYPE_PLO: |
441 | + case S390_FEAT_TYPE_SORTL: | |
433 | 442 | nr_bits = 256; |
434 | 443 | break; |
435 | 444 | default: |
@@ -501,6 +510,7 @@ static S390FeatGroupDef s390_feature_groups[] = { | ||
501 | 510 | FEAT_GROUP_INIT("msa9", MSA_EXT_9, "Message-security-assist-extension 9 facility"), |
502 | 511 | FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"), |
503 | 512 | FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), |
513 | + FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), | |
504 | 514 | }; |
505 | 515 | |
506 | 516 | const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group) |
@@ -40,6 +40,7 @@ typedef enum { | ||
40 | 40 | S390_FEAT_TYPE_PPNO, |
41 | 41 | S390_FEAT_TYPE_KMA, |
42 | 42 | S390_FEAT_TYPE_KDSA, |
43 | + S390_FEAT_TYPE_SORTL, | |
43 | 44 | } S390FeatType; |
44 | 45 | |
45 | 46 | /* Definition of a CPU feature */ |
@@ -97,6 +97,7 @@ typedef enum { | ||
97 | 97 | S390_FEAT_MSA_EXT_8, |
98 | 98 | S390_FEAT_CMM_NT, |
99 | 99 | S390_FEAT_VECTOR_ENH2, |
100 | + S390_FEAT_ESORT_BASE, | |
100 | 101 | S390_FEAT_VECTOR_BCD_ENH, |
101 | 102 | S390_FEAT_MSA_EXT_9, |
102 | 103 | S390_FEAT_ETOKEN, |
@@ -346,6 +347,13 @@ typedef enum { | ||
346 | 347 | S390_FEAT_EEDDSA_SIGN_ED25519, |
347 | 348 | S390_FEAT_EEDDSA_SIGN_ED448, |
348 | 349 | |
350 | + /* SORTL */ | |
351 | + S390_FEAT_SORTL_SFLR, | |
352 | + S390_FEAT_SORTL_SVLR, | |
353 | + S390_FEAT_SORTL_32, | |
354 | + S390_FEAT_SORTL_128, | |
355 | + S390_FEAT_SORTL_F0, | |
356 | + | |
349 | 357 | S390_FEAT_MAX, |
350 | 358 | } S390Feat; |
351 | 359 |
@@ -245,6 +245,15 @@ | ||
245 | 245 | S390_FEAT_PCKMO_ECC_ED25519, \ |
246 | 246 | S390_FEAT_PCKMO_ECC_ED448 |
247 | 247 | |
248 | +#define S390_FEAT_GROUP_ENH_SORT \ | |
249 | + S390_FEAT_ESORT_BASE, \ | |
250 | + S390_FEAT_SORTL_SFLR, \ | |
251 | + S390_FEAT_SORTL_SVLR, \ | |
252 | + S390_FEAT_SORTL_32, \ | |
253 | + S390_FEAT_SORTL_128, \ | |
254 | + S390_FEAT_SORTL_F0 | |
255 | + | |
256 | + | |
248 | 257 | /* cpu feature groups */ |
249 | 258 | static uint16_t group_PLO[] = { |
250 | 259 | S390_FEAT_GROUP_PLO, |
@@ -294,6 +303,10 @@ static uint16_t group_MSA_EXT_9_PCKMO[] = { | ||
294 | 303 | S390_FEAT_GROUP_MSA_EXT_9_PCKMO, |
295 | 304 | }; |
296 | 305 | |
306 | +static uint16_t group_ENH_SORT[] = { | |
307 | + S390_FEAT_GROUP_ENH_SORT, | |
308 | +}; | |
309 | + | |
297 | 310 | /* Base features (in order of release) |
298 | 311 | * Only non-hypervisor managed features belong here. |
299 | 312 | * Base feature sets are static meaning they do not change in future QEMU |
@@ -752,6 +765,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { | ||
752 | 765 | FEAT_GROUP_INITIALIZER(MSA_EXT_9), |
753 | 766 | FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO), |
754 | 767 | FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), |
768 | + FEAT_GROUP_INITIALIZER(ENH_SORT), | |
755 | 769 | }; |
756 | 770 | |
757 | 771 | #define QEMU_FEAT_INITIALIZER(_name) \ |
@@ -2076,6 +2076,9 @@ static int query_cpu_subfunc(S390FeatBitmap features) | ||
2076 | 2076 | if (test_bit(S390_FEAT_MSA_EXT_9, features)) { |
2077 | 2077 | s390_add_from_feat_block(features, S390_FEAT_TYPE_KDSA, prop.kdsa); |
2078 | 2078 | } |
2079 | + if (test_bit(S390_FEAT_ESORT_BASE, features)) { | |
2080 | + s390_add_from_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl); | |
2081 | + } | |
2079 | 2082 | return 0; |
2080 | 2083 | } |
2081 | 2084 |
@@ -2123,6 +2126,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features) | ||
2123 | 2126 | if (test_bit(S390_FEAT_MSA_EXT_9, features)) { |
2124 | 2127 | s390_fill_feat_block(features, S390_FEAT_TYPE_KDSA, prop.kdsa); |
2125 | 2128 | } |
2129 | + if (test_bit(S390_FEAT_ESORT_BASE, features)) { | |
2130 | + s390_fill_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl); | |
2131 | + } | |
2126 | 2132 | return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr); |
2127 | 2133 | } |
2128 | 2134 |