s390x/kvm: Add ASTFLE facility 2 for nested virtualization
v2 cover s390x/kvm: Add ASTFLE facility 2 for nested virtualization
Update the kernel headers to get access to KVM_S390_VM_CPU_FEAT_ASTFLEIE2 and allow passing the feature through to guest on IBM z16 onwards.
Cc: [email protected]
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Eric Farman <[email protected]>
Cc: Matthew Rosato <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Ilya Leoshkevich <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
To: [email protected]
Cc: [email protected]
---
Changes in v2:
- Isolate the linux-header update into its own commit (thanks Thomas)
- Correct naming of the feature (thanks Hendrik)
- Add S390_FEAT_SIE_ASTFLEIE2 to full_GEN16_GA1 only as it depends on SIEF2 (thanks Christian)
---
Christoph Schlameuss (2):
linux-headers: Update to Linux v7.x with KVM_S390_VM_CPU_FEAT_ASTFLEIE2 s390x/kvm: Add ASTFLE facility 2 for nested virtualization
hw/s390x/sclp.c | 2 ++ include/hw/s390x/sclp.h | 4 +++- linux-headers/asm-s390/kvm.h | 1 + target/s390x/cpu_features.c | 3 +++ target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 3 +++ target/s390x/cpu_models.c | 2 ++ target/s390x/gen-features.c | 1 + target/s390x/kvm/kvm.c | 1 + 9 files changed, 17 insertions(+), 1 deletion(-)
---
base-commit: fa4b2e31e649ba6fdb3eb2dd43952aad4a3bd675
change-id: 20260209-astfleie2-85eec9fd9213
Best regards,
Signature · 1 line
Christoph Schlameuss <[email protected]>
PATCH v2 1/2 linux-headers: Update to Linux v7.x with KVM_S390_VM_CPU_FEAT_ASTFLEIE2
Need KVM_S390_VM_CPU_FEAT_ASTFLEIE2 specifically.
---
To merge this this needs to be changed to a proper update of the linux-headers once the kernel change is upstream.
For now only include the needed change here.
--- linux-headers/asm-s390/kvm.h | 1 + 1 file changed, 1 insertion(+)
linux-headers/asm-s390/kvm.h +1 -0
@@ -444,6 +444,7 @@ struct kvm_s390_vm_cpu_machine {#define KVM_S390_VM_CPU_FEAT_PFMFI 11#define KVM_S390_VM_CPU_FEAT_SIGPIF 12#define KVM_S390_VM_CPU_FEAT_KSS 13 +#define KVM_S390_VM_CPU_FEAT_ASTFLEIE2 14struct kvm_s390_vm_cpu_feat {__u64 feat[16 ]; };
Signature · 1 line
2.53.0
PATCH v2 2/2 s390x/kvm: Add ASTFLE facility 2 for nested virtualization
In reply to Christoph SchlameussAllow propagation of the ASTFLEIE2 feature bit.
If the host does have the ASTFLE Interpretive Execution Facility 2 the guest can enable the ASTFLE format 2 for its guests.
--- hw/s390x/sclp.c | 2 ++ include/hw/s390x/sclp.h | 4 +++- target/s390x/cpu_features.c | 3 +++ target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 3 +++ target/s390x/cpu_models.c | 2 ++ target/s390x/gen-features.c | 1 + target/s390x/kvm/kvm.c | 1 + 8 files changed, 16 insertions(+), 1 deletion(-)
hw/s390x/sclp.c +2 -0
@@ -146,6 +146,8 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)if (s390_has_feat (S390_FEAT_EXTENDED_LENGTH_SCCB )) {s390_get_feat_block (S390_FEAT_TYPE_SCLP_FAC134 , &read_info->fac134); +s390_get_feat_block (S390_FEAT_TYPE_SCLP_FAC139 , + &read_info->fac139); } read_info->facilities = cpu_to_be64(SCLP_HAS_CPU_INFO |
include/hw/s390x/sclp.h +3 -1
@@ -136,7 +136,9 @@ typedef struct ReadInfo {uint32_t hmfai;uint8_t _reserved7[134 -128 ];/* 128-133 */ uint8_t fac134; -uint8_t _reserved8[144 -135 ];/* 135-143 */ +uint8_t _reserved8[139 -135 ];/* 135-138 */ +uint8_t fac139; +uint8_t _reserved9[144 -140 ];/* 140-143 */ struct CPUEntry entries[];/* * When the Extended-Length SCCB (ELS) feature is enabled the
target/s390x/cpu_features.c +3 -0
@@ -148,6 +148,9 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,case S390_FEAT_TYPE_SCLP_FAC134 :clear_be_bit (s390_feat_def (S390_FEAT_DIAG_318 )->bit, data);break ; +case S390_FEAT_TYPE_SCLP_FAC139 : +clear_be_bit (s390_feat_def (S390_FEAT_SIE_ASTFLEIE2 )->bit, data); +break ;default :return ; }
target/s390x/cpu_features.h +1 -0
@@ -24,6 +24,7 @@ typedef enum {S390_FEAT_TYPE_SCLP_CONF_CHAR ,S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT ,S390_FEAT_TYPE_SCLP_FAC134 , +S390_FEAT_TYPE_SCLP_FAC139 ,S390_FEAT_TYPE_SCLP_CPU ,S390_FEAT_TYPE_MISC , S390_FEAT_TYPE_PLO,
target/s390x/cpu_features_def.h.inc +3 -0
@@ -139,6 +139,9 @@ DEF_FEAT(SIE_IBS, "ibs", SCLP_CONF_CHAR_EXT, 10, "SIE: Interlock-and-broadcast-s /* Features exposed via SCLP SCCB Facilities byte 134 (bit numbers relative to byte-134) */ DEF_FEAT(DIAG_318, "diag318", SCLP_FAC134, 0, "Control program name and version codes") +/* Features exposed via SCLP SCCB Facilities byte 139 (bit numbers relative to byte-139) */ +DEF_FEAT(SIE_ASTFLEIE2, "astfleie2", SCLP_FAC139, 1, "SIE: ASTFLE interpretation execution facility 2") + /* Features exposed via SCLP CPU info. */ DEF_FEAT(SIE_F2, "sief2", SCLP_CPU, 4, "SIE: interception format 2 (Virtual SIE)") DEF_FEAT(SIE_SKEY, "skey", SCLP_CPU, 5, "SIE: Storage-key facility")
target/s390x/cpu_models.c +2 -0
@@ -263,6 +263,7 @@ bool s390_has_feat(S390Feat feat)case S390_FEAT_SIE_PFMFI :case S390_FEAT_SIE_IBS :case S390_FEAT_CONFIGURATION_TOPOLOGY : +case S390_FEAT_SIE_ASTFLEIE2 :return false;break ;default :
@@ -553,6 +554,7 @@ static void check_consistency(const S390CPUModel *model) { S390_FEAT_PLO_QSTG, S390_FEAT_PLO_EXT }, { S390_FEAT_PLO_QSTX, S390_FEAT_PLO_EXT }, { S390_FEAT_PLO_QSTO, S390_FEAT_PLO_EXT }, + { S390_FEAT_SIE_ASTFLEIE2, S390_FEAT_STFLE }, };int i;
target/s390x/gen-features.c +1 -0
@@ -720,6 +720,7 @@ static uint16_t full_GEN16_GA1[] = {S390_FEAT_PAIE ,S390_FEAT_UV_FEAT_AP ,S390_FEAT_UV_FEAT_AP_INTR , + S390_FEAT_SIE_ASTFLEIE2, }; static uint16_t full_GEN17_GA1[] = {
target/s390x/kvm/kvm.c +1 -0
@@ -2305,6 +2305,7 @@ static int kvm_to_feat[][2] = { { KVM_S390_VM_CPU_FEAT_PFMFI, S390_FEAT_SIE_PFMFI}, { KVM_S390_VM_CPU_FEAT_SIGPIF, S390_FEAT_SIE_SIGPIF}, { KVM_S390_VM_CPU_FEAT_KSS, S390_FEAT_SIE_KSS}, + { KVM_S390_VM_CPU_FEAT_ASTFLEIE2, S390_FEAT_SIE_ASTFLEIE2 }, };static int query_cpu_feat (S390FeatBitmap features)
Signature · 1 line
2.53.0
Quoted 42 lines · Christoph Schlameuss
Update the kernel headers to get access to
KVM_S390_VM_CPU_FEAT_ASTFLEIE2and allow passing the feature through to guest on IBM z16 onwards.Cc: [email protected]
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Eric Farman <[email protected]>
Cc: Matthew Rosato <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Ilya Leoshkevich <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
To: [email protected]
Cc: [email protected]Signed-off-by Christoph Schlameuss <[email protected]>---
Changes in v2:
- Isolate the linux-header update into its own commit (thanks Thomas)
- Correct naming of the feature (thanks Hendrik)
- AddS390_FEAT_SIE_ASTFLEIE2tofull_GEN16_GA1only as it depends on SIEF2 (thanks Christian)---
Christoph Schlameuss (2):
linux-headers: Update to Linux v7.x withKVM_S390_VM_CPU_FEAT_ASTFLEIE2s390x/kvm: Add ASTFLE facility 2 for nested virtualizationhw/s390x/sclp.c | 2 ++ include/hw/s390x/sclp.h | 4 +++- linux-headers/asm-s390/kvm.h | 1 + target/s390x/cpu_features.c | 3 +++ target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 3 +++ target/s390x/cpu_models.c | 2 ++ target/s390x/gen-features.c | 1 + target/s390x/kvm/kvm.c | 1 + 9 files changed, 17 insertions(+), 1 deletion(-)
Quoted 7 lines
---
base-commit:fa4b2e31e649ba6fdb3eb2dd43952aad4a3bd675
change-id: 20260209-astfleie2-85eec9fd9213Best regards,
Signature · 1 line
Christoph Schlameuss <[email protected]>
Looking through old emails: Can we respin with a proper headers update by now, or is the kernel change still pending? (Or did I miss an update? :)
Quoted 48 lines · Cornelia Huck
Quoted 46 lines · Christoph Schlameuss
Update the kernel headers to get access to
KVM_S390_VM_CPU_FEAT_ASTFLEIE2and allow passing the feature through to guest on IBM z16 onwards.Cc: [email protected]
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Eric Farman <[email protected]>
Cc: Matthew Rosato <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Ilya Leoshkevich <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
To: [email protected]
Cc: [email protected]Signed-off-by Christoph Schlameuss <[email protected]>---
Changes in v2:
- Isolate the linux-header update into its own commit (thanks Thomas)
- Correct naming of the feature (thanks Hendrik)
- AddS390_FEAT_SIE_ASTFLEIE2tofull_GEN16_GA1only as it depends on SIEF2 (thanks Christian)---
Christoph Schlameuss (2):
linux-headers: Update to Linux v7.x withKVM_S390_VM_CPU_FEAT_ASTFLEIE2s390x/kvm: Add ASTFLE facility 2 for nested virtualizationhw/s390x/sclp.c | 2 ++ include/hw/s390x/sclp.h | 4 +++- linux-headers/asm-s390/kvm.h | 1 + target/s390x/cpu_features.c | 3 +++ target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 3 +++ target/s390x/cpu_models.c | 2 ++ target/s390x/gen-features.c | 1 + target/s390x/kvm/kvm.c | 1 + 9 files changed, 17 insertions(+), 1 deletion(-)---
base-commit:fa4b2e31e649ba6fdb3eb2dd43952aad4a3bd675
change-id: 20260209-astfleie2-85eec9fd9213
Quoted 6 lines
Quoted 3 lines
Best regards,
Signature · 1 line
Christoph Schlameuss <[email protected]>Looking through old emails: Can we respin with a proper headers update by now, or is the kernel change still pending? (Or did I miss an update? :)
The kernel change is still pending. I will respin this as soon as the kernel part is out.