Merge ~paelzer/ubuntu/+source/qemu:SRU-lp-1836154-z14-hw-cpu-model-bionic into ubuntu/+source/qemu:ubuntu/bionic-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 5fae6c6a8bc8014b975d03d823475baa71e902c0
Merge reported by: Christian Ehrhardt 
Merged at revision: 44de81f491b3ac47c683e31b901eadf25f5cc6ee
Proposed branch: ~paelzer/ubuntu/+source/qemu:SRU-lp-1836154-z14-hw-cpu-model-bionic
Merge into: ubuntu/+source/qemu:ubuntu/bionic-devel
Diff against target: 1206 lines (+1115/-0) (has conflicts)
13 files modified
debian/changelog (+7/-0)
debian/patches/series (+14/-0)
debian/patches/ubuntu/lp-1836154-01-mimimal-header-sync-against-5.2.patch (+36/-0)
debian/patches/ubuntu/lp-1836154-02-s390x-cpumodel-Miscellaneous-Instruction-Extensions-.patch (+51/-0)
debian/patches/ubuntu/lp-1836154-03-s390x-cpumodel-msa9-facility.patch (+298/-0)
debian/patches/ubuntu/lp-1836154-04-s390x-cpumodel-vector-enhancements.patch (+51/-0)
debian/patches/ubuntu/lp-1836154-05-s390x-cpumodel-enhanced-sort-facility.patch (+186/-0)
debian/patches/ubuntu/lp-1836154-06-s390x-cpumodel-add-Deflate-conversion-facility.patch (+182/-0)
debian/patches/ubuntu/lp-1836154-07-s390x-cpumodel-add-gen15-defintions.patch (+119/-0)
debian/patches/ubuntu/lp-1836154-08-s390x-cpumodel-wire-up-8561-and-8562-as-gen15-machin.patch (+53/-0)
debian/patches/ubuntu/lp-1836154-09-s390-cpumodel-fix-description-for-the-new-vector-fac.patch (+40/-0)
debian/patches/ubuntu/lp-1836154-s390x-cpumodel-also-change-name-of-vxbeh.patch (+41/-0)
debian/patches/ubuntu/lp-1836154-s390x-cpumodel-remove-esort-from-the-default-model.patch (+37/-0)
Conflict in debian/changelog
Conflict in debian/patches/series
Reviewer Review Type Date Requested Status
Rafael David Tinoco (community) Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+370708@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

PPA: https://launchpad.net/~paelzer/+archive/ubuntu/bug-1836154-s390x-hwmodels/+packages
was tested by IBM already on the new HW.

Eventually this might be SRUed together with bug 1832622, but that isn't sure yet so I ask for individual reviews.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Sorry for taking too long for reviewing this, this is next in my TODO list. Will provide feedback very soon.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :
Download full text (4.7 KiB)

You already know that, but this is a review, I should mention everything I see and let you decide things.. so here it goes:

We just pushed a fix to Bionic (for MDS-NO) which means that you have to rebase this merge request to the one currently in -proposed. I see
you've also included the boot signature toleration patch in previous version,
I confess I missed that from the current -proposed for Bionic.

------------

About the backported patches:

1) lp-1836154-01-MIMIMAL-header-sync-against-5.2.patch

Despite the small typo for "minimal", I could not find this commit as being a upstream QEMU commit. The commit I found, related to this change, was:

commit d9cb4336159a00bd0d9c81b93f02874ef3626057
Author: Cornelia Huck <email address hidden>
Date: Thu May 16 14:10:36 2019

    linux headers: update against Linux 5.2-rc1

    commit a188339ca5a396acc588e5851ed7e19f66b0ebd9

    Signed-off-by: Cornelia Huck <email address hidden>

diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h
index 0265482f8f..03ab5968c7 100644
--- a/linux-headers/asm-s390/kvm.h
+++ b/linux-headers/asm-s390/kvm.h
@@ -152,7 +152,10 @@ struct kvm_s390_vm_cpu_subfunc {
        __u8 pcc[16]; /* with MSA4 */
        __u8 ppno[16]; /* with MSA5 */
        __u8 kma[16]; /* with MSA8 */
- __u8 reserved[1808];
+ __u8 kdsa[16]; /* with MSA9 */
+ __u8 sortl[32]; /* with STFLE.150 */
+ __u8 dfltcc[32]; /* with STFLE.151 */
+ __u8 reserved[1728];
 };

 /* kvm attributes for crypto */

(the exact same content) as given by IBM DE in the backport list.
Did you get this patch (w/ diff desc) somewhere else ?

2) lp-1836154-02-s390x-cpumodel-Miscellaneous-Instruction-Extensions-.patch

Where is the commit ID coming from ? Your local repo ? Correct if I'm wrong but, in this case, using DEP-3 compliant headers is the correct choice, no ?

I saw you added (cherry picked from commit ...) message but that implies in having "Origin:"" header flag (according to DEP3), and changing commit Author, at least it seems that way according to (https://dep-team.pages.debian.net/deps/dep3/).

Patches contents are good and equivalent to the upstream ones.

3) lp-1836154-03-s390x-cpumodel-msa9-facility.patch

Same as (1), (2), (3), ...

I believe you did the same thing for:

lp-1836154-01-mimimal-header-sync-against-5.2.patch (d9cb4336159a)
lp-1836154-02-s390x-cpumodel-...-Extensions-.patch (2ec038836fa0)
lp-1836154-03-s390x-cpumodel-msa9-facility.patch (5dacbe23d23c)
lp-1836154-04-s390x-cpumodel-vector-enhancements.patch (54d65de0b525)
lp-1836154-05-s390x-cpumodel-enhanced-sort-facility.patch (d220fabf1609)
lp-1836154-06-s390x-cpumodel-add-Def...ion-facility.patch (afc7b8666b62)
lp-1836154-07-s390x-cpumodel-add-gen15-defintions.patch (caef62430fed)
lp-1836154-08-s390x-cpumodel-wire...-as-gen15-machin.patch (c657e84faee4)
lp-1836154-09-s390-cpumodel-fix-desc...new-vector-fac.patch (d05be57ddc2e)

and then for the next two:

lp-1836154-s390x-cpumodel-remove-esort-from-the-default-model.patch
lp-1836154-s390x-cpumodel-also-change-name-of-vxbeh.patch

you have the correct cherry-picked patch with a DEP3 header, a...

Read more...

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Functional part of the merge LGTM after testing code in real s390x HW. Patches format, style and normalization will be up to you, since you're the maintainer. +1 from me.

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The need for a rebase was known.
But since we have so many qemu changes in flight I tend to propose them more reviewable feature by feature and then group all that are ready at the same time.

Yes the reduced set for the 5.2 header backport came from https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1836154/comments/6
Let me add dep3 headers to the first 9 patches that were provided (so far only those I added ahd proper headers), that will make tracking of their source better.
Thanks for the finding - that can later on ease our life a lot.

And for your question, they always should have headers.
I just have forgotten to add some on those patches that we got handed for this bug.
The only difference between "applies cleanly" and "needs backport" are in the header content, but they should all have headers.

And don't excuse too much, you are neither "annoying with minimal details" nor anything else. You perfectly spotted an issue - so thanks from me for doing so :-)

44de81f... by Christian Ehrhardt 

d/p/ubuntu/lp-1836154-*: add dep3 headers for pacthes provided by IBM

Signed-off-by: Christian Ehrhardt <email address hidden>

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Fixups pushed, set to approved

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Note: Disco branch is ok as there it were direct git-to-dquilt picks.
An ack there (if ok) would be nice as well.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

For sure!

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This migrated, closing forgotten MP

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 89fced9..38cd270 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,11 +1,18 @@
6 qemu (1:2.11+dfsg-1ubuntu7.17) bionic; urgency=medium
7
8+<<<<<<< debian/changelog
9 * {Ice,Cascade}Lake IA32_ARCH_CAPABILITIES support (LP: 1828495)
10 Needed patch is in d/p/u/lp1828495-:
11 - 0017-target-i386-add-MDS-NO-feature.patch:
12 target/i386: add MDS-NO feature
13
14 -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Mon, 05 Aug 2019 19:12:08 +0000
15+=======
16+ * d/p/ubuntu/lp-1836154-*: add HW CPU model for newer s390x machines
17+ (LP: #1836154)
18+
19+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 16 Jul 2019 13:05:34 +0200
20+>>>>>>> debian/changelog
21
22 qemu (1:2.11+dfsg-1ubuntu7.16) bionic; urgency=medium
23
24diff --git a/debian/patches/series b/debian/patches/series
25index fe176a0..e18383e 100644
26--- a/debian/patches/series
27+++ b/debian/patches/series
28@@ -104,4 +104,18 @@ ubuntu/lp1828495-0013-cascadelake-server.patch
29 ubuntu/lp1828495-0014-remove-cpuid-pconfig.patch
30 ubuntu/lp1828495-0015-remove-cpuid-intel_pt.patch
31 ubuntu/lp1828495-0016-no-ospke-on-some.patch
32+<<<<<<< debian/patches/series
33 ubuntu/lp1828495-0017-target-i386-add-MDS-NO-feature.patch
34+=======
35+ubuntu/lp-1836154-01-mimimal-header-sync-against-5.2.patch
36+ubuntu/lp-1836154-02-s390x-cpumodel-Miscellaneous-Instruction-Extensions-.patch
37+ubuntu/lp-1836154-03-s390x-cpumodel-msa9-facility.patch
38+ubuntu/lp-1836154-04-s390x-cpumodel-vector-enhancements.patch
39+ubuntu/lp-1836154-05-s390x-cpumodel-enhanced-sort-facility.patch
40+ubuntu/lp-1836154-06-s390x-cpumodel-add-Deflate-conversion-facility.patch
41+ubuntu/lp-1836154-07-s390x-cpumodel-add-gen15-defintions.patch
42+ubuntu/lp-1836154-08-s390x-cpumodel-wire-up-8561-and-8562-as-gen15-machin.patch
43+ubuntu/lp-1836154-09-s390-cpumodel-fix-description-for-the-new-vector-fac.patch
44+ubuntu/lp-1836154-s390x-cpumodel-remove-esort-from-the-default-model.patch
45+ubuntu/lp-1836154-s390x-cpumodel-also-change-name-of-vxbeh.patch
46+>>>>>>> debian/patches/series
47diff --git a/debian/patches/ubuntu/lp-1836154-01-mimimal-header-sync-against-5.2.patch b/debian/patches/ubuntu/lp-1836154-01-mimimal-header-sync-against-5.2.patch
48new file mode 100644
49index 0000000..c23f3dd
50--- /dev/null
51+++ b/debian/patches/ubuntu/lp-1836154-01-mimimal-header-sync-against-5.2.patch
52@@ -0,0 +1,36 @@
53+From bc3442e7becc9c67f29000c1e7b2193004ad1e8c Mon Sep 17 00:00:00 2001
54+From: Christian Borntraeger <borntraeger@de.ibm.com>
55+Date: Fri, 12 Jul 2019 10:14:09 +0200
56+Subject: [PATCH 1/9] mimimal header sync against 5.2
57+
58+only kvm/s390 parts.
59+
60+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
61+
62+Author: Christian Borntraeger <borntraeger@de.ibm.com>
63+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=d9cb4336159a00bd0d9c81b93f02874ef3626057
64+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
65+Last-Update: 2019-08-07
66+---
67+ linux-headers/asm-s390/kvm.h | 5 ++++-
68+ 1 file changed, 4 insertions(+), 1 deletion(-)
69+
70+diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h
71+index 0265482f8fdf..03ab5968c75d 100644
72+--- a/linux-headers/asm-s390/kvm.h
73++++ b/linux-headers/asm-s390/kvm.h
74+@@ -152,7 +152,10 @@ struct kvm_s390_vm_cpu_subfunc {
75+ __u8 pcc[16]; /* with MSA4 */
76+ __u8 ppno[16]; /* with MSA5 */
77+ __u8 kma[16]; /* with MSA8 */
78+- __u8 reserved[1808];
79++ __u8 kdsa[16]; /* with MSA9 */
80++ __u8 sortl[32]; /* with STFLE.150 */
81++ __u8 dfltcc[32]; /* with STFLE.151 */
82++ __u8 reserved[1728];
83+ };
84+
85+ /* kvm attributes for crypto */
86+--
87+2.12.3
88+
89diff --git a/debian/patches/ubuntu/lp-1836154-02-s390x-cpumodel-Miscellaneous-Instruction-Extensions-.patch b/debian/patches/ubuntu/lp-1836154-02-s390x-cpumodel-Miscellaneous-Instruction-Extensions-.patch
90new file mode 100644
91index 0000000..c0eceeb
92--- /dev/null
93+++ b/debian/patches/ubuntu/lp-1836154-02-s390x-cpumodel-Miscellaneous-Instruction-Extensions-.patch
94@@ -0,0 +1,51 @@
95+From 81a992fdea16e44f4d0eae7dc859a0dc8be2d6f9 Mon Sep 17 00:00:00 2001
96+From: Christian Borntraeger <borntraeger@de.ibm.com>
97+Date: Mon, 29 Apr 2019 05:02:44 -0400
98+Subject: [PATCH 2/9] s390x/cpumodel: Miscellaneous-Instruction-Extensions
99+ Facility 3
100+
101+Provide the "Miscellaneous-Instruction-Extensions Facility 3" via
102+stfle.61.
103+
104+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
105+Reviewed-by: David Hildenbrand <david@redhat.com>
106+Message-Id: <20190429090250.7648-4-borntraeger@de.ibm.com>
107+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
108+(cherry picked from commit 2ec038836fa03103596023e4a1ad7e6eb50ee7c7)
109+
110+Author: Christian Borntraeger <borntraeger@de.ibm.com>
111+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=2ec038836fa03103596023e4a1ad7e6eb50ee7c7
112+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
113+Last-Update: 2019-08-07
114+---
115+ target/s390x/cpu_features.c | 1 +
116+ target/s390x/cpu_features_def.h | 1 +
117+ 2 files changed, 2 insertions(+)
118+
119+diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
120+index 15738afee154..f03c3c1b9263 100644
121+--- a/target/s390x/cpu_features.c
122++++ b/target/s390x/cpu_features.c
123+@@ -80,6 +80,7 @@ static const S390FeatDef s390_features[] = {
124+ FEAT_INIT("minste2", S390_FEAT_TYPE_STFL, 58, "Miscellaneous-instruction-extensions facility 2"),
125+ FEAT_INIT("sema", S390_FEAT_TYPE_STFL, 59, "Semaphore-assist facility"),
126+ FEAT_INIT("tsi", S390_FEAT_TYPE_STFL, 60, "Time-slice Instrumentation facility"),
127++ FEAT_INIT("minste3", S390_FEAT_TYPE_STFL, 61, "Miscellaneous-Instruction-Extensions Facility 3"),
128+ FEAT_INIT("ri", S390_FEAT_TYPE_STFL, 64, "CPU runtime-instrumentation facility"),
129+ FEAT_INIT("zpci", S390_FEAT_TYPE_STFL, 69, "z/PCI facility"),
130+ FEAT_INIT("aen", S390_FEAT_TYPE_STFL, 71, "General-purpose-adapter-event-notification facility"),
131+diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h
132+index 965bde306acd..b233b7137860 100644
133+--- a/target/s390x/cpu_features_def.h
134++++ b/target/s390x/cpu_features_def.h
135+@@ -71,6 +71,7 @@ typedef enum {
136+ S390_FEAT_MISC_INSTRUCTION_EXT,
137+ S390_FEAT_SEMAPHORE_ASSIST,
138+ S390_FEAT_TIME_SLICE_INSTRUMENTATION,
139++ S390_FEAT_MISC_INSTRUCTION_EXT3,
140+ S390_FEAT_RUNTIME_INSTRUMENTATION,
141+ S390_FEAT_ZPCI,
142+ S390_FEAT_ADAPTER_EVENT_NOTIFICATION,
143+--
144+2.12.3
145+
146diff --git a/debian/patches/ubuntu/lp-1836154-03-s390x-cpumodel-msa9-facility.patch b/debian/patches/ubuntu/lp-1836154-03-s390x-cpumodel-msa9-facility.patch
147new file mode 100644
148index 0000000..2df3046
149--- /dev/null
150+++ b/debian/patches/ubuntu/lp-1836154-03-s390x-cpumodel-msa9-facility.patch
151@@ -0,0 +1,298 @@
152+From ba9165e0f4e3f09893362901f4ba8845dd992cf5 Mon Sep 17 00:00:00 2001
153+From: Christian Borntraeger <borntraeger@de.ibm.com>
154+Date: Mon, 29 Apr 2019 05:02:45 -0400
155+Subject: [PATCH 3/9] s390x/cpumodel: msa9 facility
156+
157+Provide the MSA9 facility (stfle.155). This also contains pckmo
158+subfunctions for key wrapping. Keep them in a separate group to disable
159+those as a block if necessary. This is for example needed when disabling
160+key wrapping via the HMC.
161+
162+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
163+Message-Id: <20190429090250.7648-5-borntraeger@de.ibm.com>
164+Reviewed-by: David Hildenbrand <david@redhat.com>
165+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
166+(cherry picked from commit 5dacbe23d23c7f0395fa0e65ff1698f632846714)
167+
168+Author: Christian Borntraeger <borntraeger@de.ibm.com>
169+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=5dacbe23d23c7f0395fa0e65ff1698f632846714
170+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
171+Last-Update: 2019-08-07
172+---
173+ target/s390x/cpu_features.c | 32 +++++++++++++++++++++++++++++++
174+ target/s390x/cpu_features.h | 3 +++
175+ target/s390x/cpu_features_def.h | 31 ++++++++++++++++++++++++++++++
176+ target/s390x/cpu_models.c | 2 ++
177+ target/s390x/gen-features.c | 42 +++++++++++++++++++++++++++++++++++++++++
178+ target/s390x/kvm.c | 6 ++++++
179+ 6 files changed, 116 insertions(+)
180+
181+diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
182+index f03c3c1b9263..78e26044ad17 100644
183+--- a/target/s390x/cpu_features.c
184++++ b/target/s390x/cpu_features.c
185+@@ -105,6 +105,7 @@ static const S390FeatDef s390_features[] = {
186+ FEAT_INIT("irbm", S390_FEAT_TYPE_STFL, 145, "Insert-reference-bits-multiple facility"),
187+ FEAT_INIT("msa8-base", S390_FEAT_TYPE_STFL, 146, "Message-security-assist-extension-8 facility (excluding subfunctions)"),
188+ FEAT_INIT("cmmnt", S390_FEAT_TYPE_STFL, 147, "CMM: ESSA-enhancement (no translate) facility"),
189++ FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"),
190+ FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"),
191+
192+ /* SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */
193+@@ -235,6 +236,11 @@ static const S390FeatDef s390_features[] = {
194+ FEAT_INIT("pckmo-aes-128", S390_FEAT_TYPE_PCKMO, 18, "PCKMO Encrypted-AES-128-Key"),
195+ FEAT_INIT("pckmo-aes-192", S390_FEAT_TYPE_PCKMO, 19, "PCKMO Encrypted-AES-192-Key"),
196+ FEAT_INIT("pckmo-aes-256", S390_FEAT_TYPE_PCKMO, 20, "PCKMO Encrypted-AES-256-Key"),
197++ FEAT_INIT("pckmo-ecc-p256", S390_FEAT_TYPE_PCKMO, 32, "PCKMO Encrypt-ECC-P256-Key"),
198++ FEAT_INIT("pckmo-ecc-p384", S390_FEAT_TYPE_PCKMO, 33, "PCKMO Encrypt-ECC-P384-Key"),
199++ FEAT_INIT("pckmo-ecc-p521", S390_FEAT_TYPE_PCKMO, 34, "PCKMO Encrypt-ECC-P521-Key"),
200++ FEAT_INIT("pckmo-ecc-ed25519", S390_FEAT_TYPE_PCKMO, 40 , "PCKMO Encrypt-ECC-Ed25519-Key"),
201++ FEAT_INIT("pckmo-ecc-ed448", S390_FEAT_TYPE_PCKMO, 41 , "PCKMO Encrypt-ECC-Ed448-Key"),
202+
203+ FEAT_INIT("kmctr-dea", S390_FEAT_TYPE_KMCTR, 1, "KMCTR DEA"),
204+ FEAT_INIT("kmctr-tdea-128", S390_FEAT_TYPE_KMCTR, 2, "KMCTR TDEA-128"),
205+@@ -291,6 +297,13 @@ static const S390FeatDef s390_features[] = {
206+ FEAT_INIT("pcc-xts-aes-256", S390_FEAT_TYPE_PCC, 52, "PCC Compute-XTS-Parameter-Using-AES-256"),
207+ FEAT_INIT("pcc-xts-eaes-128", S390_FEAT_TYPE_PCC, 58, "PCC Compute-XTS-Parameter-Using-Encrypted-AES-128"),
208+ FEAT_INIT("pcc-xts-eaes-256", S390_FEAT_TYPE_PCC, 60, "PCC Compute-XTS-Parameter-Using-Encrypted-AES-256"),
209++ FEAT_INIT("pcc-scalar-mult-p256", S390_FEAT_TYPE_PCC, 64, "PCC Scalar-Multiply-P256"),
210++ FEAT_INIT("pcc-scalar-mult-p384", S390_FEAT_TYPE_PCC, 65, "PCC Scalar-Multiply-P384"),
211++ FEAT_INIT("pcc-scalar-mult-p521", S390_FEAT_TYPE_PCC, 66, "PCC Scalar-Multiply-P521"),
212++ FEAT_INIT("pcc-scalar-mult-ed25519", S390_FEAT_TYPE_PCC, 72, "PCC Scalar-Multiply-Ed25519"),
213++ FEAT_INIT("pcc-scalar-mult-ed448", S390_FEAT_TYPE_PCC, 73, "PCC Scalar-Multiply-Ed448"),
214++ FEAT_INIT("pcc-scalar-mult-x25519", S390_FEAT_TYPE_PCC, 80, "PCC Scalar-Multiply-X25519"),
215++ FEAT_INIT("pcc-scalar-mult-x448", S390_FEAT_TYPE_PCC, 81, "PCC Scalar-Multiply-X448"),
216+
217+ FEAT_INIT("ppno-sha-512-drng", S390_FEAT_TYPE_PPNO, 3, "PPNO SHA-512-DRNG"),
218+ FEAT_INIT("prno-trng-qrtcr", S390_FEAT_TYPE_PPNO, 112, "PRNO TRNG-Query-Raw-to-Conditioned-Ratio"),
219+@@ -302,6 +315,22 @@ static const S390FeatDef s390_features[] = {
220+ FEAT_INIT("kma-gcm-eaes-128", S390_FEAT_TYPE_KMA, 26, "KMA GCM-Encrypted-AES-128"),
221+ FEAT_INIT("kma-gcm-eaes-192", S390_FEAT_TYPE_KMA, 27, "KMA GCM-Encrypted-AES-192"),
222+ FEAT_INIT("kma-gcm-eaes-256", S390_FEAT_TYPE_KMA, 28, "KMA GCM-Encrypted-AES-256"),
223++
224++ FEAT_INIT("kdsa-ecdsa-verify-p256", S390_FEAT_TYPE_KDSA, 1, "KDSA ECDSA-Verify-P256"),
225++ FEAT_INIT("kdsa-ecdsa-verify-p384", S390_FEAT_TYPE_KDSA, 2, "KDSA ECDSA-Verify-P384"),
226++ FEAT_INIT("kdsa-ecdsa-verify-p521", S390_FEAT_TYPE_KDSA, 3, "KDSA ECDSA-Verify-P521"),
227++ FEAT_INIT("kdsa-ecdsa-sign-p256", S390_FEAT_TYPE_KDSA, 9, "KDSA ECDSA-Sign-P256"),
228++ FEAT_INIT("kdsa-ecdsa-sign-p384", S390_FEAT_TYPE_KDSA, 10, "KDSA ECDSA-Sign-P384"),
229++ FEAT_INIT("kdsa-ecdsa-sign-p521", S390_FEAT_TYPE_KDSA, 11, "KDSA ECDSA-Sign-P521"),
230++ FEAT_INIT("kdsa-eecdsa-sign-p256", S390_FEAT_TYPE_KDSA, 17, "KDSA Encrypted-ECDSA-Sign-P256"),
231++ FEAT_INIT("kdsa-eecdsa-sign-p384", S390_FEAT_TYPE_KDSA, 18, "KDSA Encrypted-ECDSA-Sign-P384"),
232++ FEAT_INIT("kdsa-eecdsa-sign-p521", S390_FEAT_TYPE_KDSA, 19, "KDSA Encrypted-ECDSA-Sign-P521"),
233++ FEAT_INIT("kdsa-eddsa-verify-ed25519", S390_FEAT_TYPE_KDSA, 32, "KDSA EdDSA-Verify-Ed25519"),
234++ FEAT_INIT("kdsa-eddsa-verify-ed448", S390_FEAT_TYPE_KDSA, 36, "KDSA EdDSA-Verify-Ed448"),
235++ FEAT_INIT("kdsa-eddsa-sign-ed25519", S390_FEAT_TYPE_KDSA, 40, "KDSA EdDSA-Sign-Ed25519"),
236++ FEAT_INIT("kdsa-eddsa-sign-ed448", S390_FEAT_TYPE_KDSA, 44, "KDSA EdDSA-Sign-Ed448"),
237++ FEAT_INIT("kdsa-eeddsa-sign-ed25519", S390_FEAT_TYPE_KDSA, 48, "KDSA Encrypted-EdDSA-Sign-Ed25519"),
238++ FEAT_INIT("kdsa-eeddsa-sign-ed448", S390_FEAT_TYPE_KDSA, 52, "KDSA Encrypted-EdDSA-Sign-Ed448"),
239+ };
240+
241+ const S390FeatDef *s390_feat_def(S390Feat feat)
242+@@ -364,6 +393,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,
243+ case S390_FEAT_TYPE_PCC:
244+ case S390_FEAT_TYPE_PPNO:
245+ case S390_FEAT_TYPE_KMA:
246++ case S390_FEAT_TYPE_KDSA:
247+ set_be_bit(0, data); /* query is always available */
248+ break;
249+ default:
250+@@ -459,6 +489,8 @@ static S390FeatGroupDef s390_feature_groups[] = {
251+ FEAT_GROUP_INIT("msa6", MSA_EXT_6, "Message-security-assist-extension 6 facility"),
252+ FEAT_GROUP_INIT("msa7", MSA_EXT_7, "Message-security-assist-extension 7 facility"),
253+ FEAT_GROUP_INIT("msa8", MSA_EXT_8, "Message-security-assist-extension 8 facility"),
254++ FEAT_GROUP_INIT("msa9", MSA_EXT_9, "Message-security-assist-extension 9 facility"),
255++ FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"),
256+ };
257+
258+ const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group)
259+diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h
260+index e306aa7ab2ac..23a89dbe63f8 100644
261+--- a/target/s390x/cpu_features.h
262++++ b/target/s390x/cpu_features.h
263+@@ -38,6 +38,7 @@ typedef enum {
264+ S390_FEAT_TYPE_PCC,
265+ S390_FEAT_TYPE_PPNO,
266+ S390_FEAT_TYPE_KMA,
267++ S390_FEAT_TYPE_KDSA,
268+ } S390FeatType;
269+
270+ /* Definition of a CPU feature */
271+@@ -78,6 +79,8 @@ typedef enum {
272+ S390_FEAT_GROUP_MSA_EXT_6,
273+ S390_FEAT_GROUP_MSA_EXT_7,
274+ S390_FEAT_GROUP_MSA_EXT_8,
275++ S390_FEAT_GROUP_MSA_EXT_9,
276++ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
277+ S390_FEAT_GROUP_MAX,
278+ } S390FeatGroup;
279+
280+diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h
281+index b233b7137860..6ac8e6ded6f7 100644
282+--- a/target/s390x/cpu_features_def.h
283++++ b/target/s390x/cpu_features_def.h
284+@@ -96,6 +96,7 @@ typedef enum {
285+ S390_FEAT_INSERT_REFERENCE_BITS_MULT,
286+ S390_FEAT_MSA_EXT_8,
287+ S390_FEAT_CMM_NT,
288++ S390_FEAT_MSA_EXT_9,
289+ S390_FEAT_ETOKEN,
290+
291+ /* Sclp Conf Char */
292+@@ -236,6 +237,11 @@ typedef enum {
293+ S390_FEAT_PCKMO_AES_128,
294+ S390_FEAT_PCKMO_AES_192,
295+ S390_FEAT_PCKMO_AES_256,
296++ S390_FEAT_PCKMO_ECC_P256,
297++ S390_FEAT_PCKMO_ECC_P384,
298++ S390_FEAT_PCKMO_ECC_P521,
299++ S390_FEAT_PCKMO_ECC_ED25519,
300++ S390_FEAT_PCKMO_ECC_ED448,
301+
302+ /* KMCTR */
303+ S390_FEAT_KMCTR_DEA,
304+@@ -296,6 +302,13 @@ typedef enum {
305+ S390_FEAT_PCC_XTS_AES_256,
306+ S390_FEAT_PCC_XTS_EAES_128,
307+ S390_FEAT_PCC_XTS_EAES_256,
308++ S390_FEAT_PCC_SCALAR_MULT_P256,
309++ S390_FEAT_PCC_SCALAR_MULT_P384,
310++ S390_FEAT_PCC_SCALAR_MULT_P512,
311++ S390_FEAT_PCC_SCALAR_MULT_ED25519,
312++ S390_FEAT_PCC_SCALAR_MULT_ED448,
313++ S390_FEAT_PCC_SCALAR_MULT_X25519,
314++ S390_FEAT_PCC_SCALAR_MULT_X448,
315+
316+ /* PPNO/PRNO */
317+ S390_FEAT_PPNO_SHA_512_DRNG,
318+@@ -309,6 +322,24 @@ typedef enum {
319+ S390_FEAT_KMA_GCM_EAES_128,
320+ S390_FEAT_KMA_GCM_EAES_192,
321+ S390_FEAT_KMA_GCM_EAES_256,
322++
323++ /* KDSA */
324++ S390_FEAT_ECDSA_VERIFY_P256,
325++ S390_FEAT_ECDSA_VERIFY_P384,
326++ S390_FEAT_ECDSA_VERIFY_P512,
327++ S390_FEAT_ECDSA_SIGN_P256,
328++ S390_FEAT_ECDSA_SIGN_P384,
329++ S390_FEAT_ECDSA_SIGN_P512,
330++ S390_FEAT_EECDSA_SIGN_P256,
331++ S390_FEAT_EECDSA_SIGN_P384,
332++ S390_FEAT_EECDSA_SIGN_P512,
333++ S390_FEAT_EDDSA_VERIFY_ED25519,
334++ S390_FEAT_EDDSA_VERIFY_ED448,
335++ S390_FEAT_EDDSA_SIGN_ED25519,
336++ S390_FEAT_EDDSA_SIGN_ED448,
337++ S390_FEAT_EEDDSA_SIGN_ED25519,
338++ S390_FEAT_EEDDSA_SIGN_ED448,
339++
340+ S390_FEAT_MAX,
341+ } S390Feat;
342+
343+diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
344+index 541840006edc..1e8714afe3a8 100644
345+--- a/target/s390x/cpu_models.c
346++++ b/target/s390x/cpu_models.c
347+@@ -740,6 +740,8 @@ static void check_consistency(const S390CPUModel *model)
348+ { S390_FEAT_SIE_CMMA, S390_FEAT_SIE_GSLS },
349+ { S390_FEAT_SIE_PFMFI, S390_FEAT_EDAT },
350+ { S390_FEAT_MSA_EXT_8, S390_FEAT_MSA_EXT_3 },
351++ { S390_FEAT_MSA_EXT_9, S390_FEAT_MSA_EXT_3 },
352++ { S390_FEAT_MSA_EXT_9, S390_FEAT_MSA_EXT_4 },
353+ { S390_FEAT_MULTIPLE_EPOCH, S390_FEAT_TOD_CLOCK_STEERING },
354+ { S390_FEAT_VECTOR_PACKED_DECIMAL, S390_FEAT_VECTOR },
355+ { S390_FEAT_VECTOR_ENH, S390_FEAT_VECTOR },
356+diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
357+index fb7a7f23fb58..8b042a15a410 100644
358+--- a/target/s390x/gen-features.c
359++++ b/target/s390x/gen-features.c
360+@@ -209,6 +209,38 @@
361+ S390_FEAT_KMA_GCM_EAES_192, \
362+ S390_FEAT_KMA_GCM_EAES_256
363+
364++#define S390_FEAT_GROUP_MSA_EXT_9 \
365++ S390_FEAT_MSA_EXT_9, \
366++ S390_FEAT_ECDSA_VERIFY_P256, \
367++ S390_FEAT_ECDSA_VERIFY_P384, \
368++ S390_FEAT_ECDSA_VERIFY_P512, \
369++ S390_FEAT_ECDSA_SIGN_P256, \
370++ S390_FEAT_ECDSA_SIGN_P384, \
371++ S390_FEAT_ECDSA_SIGN_P512, \
372++ S390_FEAT_EECDSA_SIGN_P256, \
373++ S390_FEAT_EECDSA_SIGN_P384, \
374++ S390_FEAT_EECDSA_SIGN_P512, \
375++ S390_FEAT_EDDSA_VERIFY_ED25519, \
376++ S390_FEAT_EDDSA_VERIFY_ED448, \
377++ S390_FEAT_EDDSA_SIGN_ED25519, \
378++ S390_FEAT_EDDSA_SIGN_ED448, \
379++ S390_FEAT_EEDDSA_SIGN_ED25519, \
380++ S390_FEAT_EEDDSA_SIGN_ED448, \
381++ S390_FEAT_PCC_SCALAR_MULT_P256, \
382++ S390_FEAT_PCC_SCALAR_MULT_P384, \
383++ S390_FEAT_PCC_SCALAR_MULT_P512, \
384++ S390_FEAT_PCC_SCALAR_MULT_ED25519, \
385++ S390_FEAT_PCC_SCALAR_MULT_ED448, \
386++ S390_FEAT_PCC_SCALAR_MULT_X25519, \
387++ S390_FEAT_PCC_SCALAR_MULT_X448
388++
389++#define S390_FEAT_GROUP_MSA_EXT_9_PCKMO \
390++ S390_FEAT_PCKMO_ECC_P256, \
391++ S390_FEAT_PCKMO_ECC_P384, \
392++ S390_FEAT_PCKMO_ECC_P521, \
393++ S390_FEAT_PCKMO_ECC_ED25519, \
394++ S390_FEAT_PCKMO_ECC_ED448
395++
396+ /* cpu feature groups */
397+ static uint16_t group_PLO[] = {
398+ S390_FEAT_GROUP_PLO,
399+@@ -247,6 +279,14 @@ static uint16_t group_MSA_EXT_8[] = {
400+ S390_FEAT_GROUP_MSA_EXT_8,
401+ };
402+
403++static uint16_t group_MSA_EXT_9[] = {
404++ S390_FEAT_GROUP_MSA_EXT_9,
405++};
406++
407++static uint16_t group_MSA_EXT_9_PCKMO[] = {
408++ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
409++};
410++
411+ /* Base features (in order of release)
412+ * Only non-hypervisor managed features belong here.
413+ * Base feature sets are static meaning they do not change in future QEMU
414+@@ -631,6 +671,8 @@ static FeatGroupDefSpec FeatGroupDef[] = {
415+ FEAT_GROUP_INITIALIZER(MSA_EXT_6),
416+ FEAT_GROUP_INITIALIZER(MSA_EXT_7),
417+ FEAT_GROUP_INITIALIZER(MSA_EXT_8),
418++ FEAT_GROUP_INITIALIZER(MSA_EXT_9),
419++ FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO),
420+ };
421+
422+ static void set_bits(uint64_t list[], BitSpec bits)
423+diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
424+index 23a03d74a65e..de67450ebebb 100644
425+--- a/target/s390x/kvm.c
426++++ b/target/s390x/kvm.c
427+@@ -2132,6 +2132,9 @@ static int query_cpu_subfunc(S390FeatBitmap features)
428+ if (test_bit(S390_FEAT_MSA_EXT_8, features)) {
429+ s390_add_from_feat_block(features, S390_FEAT_TYPE_KMA, prop.kma);
430+ }
431++ if (test_bit(S390_FEAT_MSA_EXT_9, features)) {
432++ s390_add_from_feat_block(features, S390_FEAT_TYPE_KDSA, prop.kdsa);
433++ }
434+ return 0;
435+ }
436+
437+@@ -2176,6 +2179,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features)
438+ if (test_bit(S390_FEAT_MSA_EXT_8, features)) {
439+ s390_fill_feat_block(features, S390_FEAT_TYPE_KMA, prop.kma);
440+ }
441++ if (test_bit(S390_FEAT_MSA_EXT_9, features)) {
442++ s390_fill_feat_block(features, S390_FEAT_TYPE_KDSA, prop.kdsa);
443++ }
444+ return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
445+ }
446+
447+--
448+2.12.3
449+
450diff --git a/debian/patches/ubuntu/lp-1836154-04-s390x-cpumodel-vector-enhancements.patch b/debian/patches/ubuntu/lp-1836154-04-s390x-cpumodel-vector-enhancements.patch
451new file mode 100644
452index 0000000..9f039cc
453--- /dev/null
454+++ b/debian/patches/ubuntu/lp-1836154-04-s390x-cpumodel-vector-enhancements.patch
455@@ -0,0 +1,51 @@
456+From c83bd115bc91acde9931fc91b46df474d96ebb76 Mon Sep 17 00:00:00 2001
457+From: Christian Borntraeger <borntraeger@de.ibm.com>
458+Date: Mon, 29 Apr 2019 05:02:46 -0400
459+Subject: [PATCH 4/9] s390x/cpumodel: vector enhancements
460+
461+Add vector enhancements to the cpu model.
462+
463+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
464+Reviewed-by: David Hildenbrand <david@redhat.com>
465+Message-Id: <20190429090250.7648-6-borntraeger@de.ibm.com>
466+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
467+(cherry picked from commit 54d65de0b525272edfa66eb75c3f67b183f8aff4)
468+
469+Author: Christian Borntraeger <borntraeger@de.ibm.com>
470+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=54d65de0b525272edfa66eb75c3f67b183f8aff4
471+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
472+Last-Update: 2019-08-07
473+---
474+ target/s390x/cpu_features.c | 2 ++
475+ target/s390x/cpu_features_def.h | 2 ++
476+ 2 files changed, 4 insertions(+)
477+
478+diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
479+index 78e26044ad17..7073dcb5d8ea 100644
480+--- a/target/s390x/cpu_features.c
481++++ b/target/s390x/cpu_features.c
482+@@ -105,6 +105,8 @@ static const S390FeatDef s390_features[] = {
483+ FEAT_INIT("irbm", S390_FEAT_TYPE_STFL, 145, "Insert-reference-bits-multiple facility"),
484+ FEAT_INIT("msa8-base", S390_FEAT_TYPE_STFL, 146, "Message-security-assist-extension-8 facility (excluding subfunctions)"),
485+ FEAT_INIT("cmmnt", S390_FEAT_TYPE_STFL, 147, "CMM: ESSA-enhancement (no translate) facility"),
486++ FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"),
487++ FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector BCD enhancements facility 1"),
488+ FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"),
489+ FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"),
490+
491+diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h
492+index 6ac8e6ded6f7..209303ea0d53 100644
493+--- a/target/s390x/cpu_features_def.h
494++++ b/target/s390x/cpu_features_def.h
495+@@ -96,6 +96,8 @@ typedef enum {
496+ S390_FEAT_INSERT_REFERENCE_BITS_MULT,
497+ S390_FEAT_MSA_EXT_8,
498+ S390_FEAT_CMM_NT,
499++ S390_FEAT_VECTOR_ENH2,
500++ S390_FEAT_VECTOR_BCD_ENH,
501+ S390_FEAT_MSA_EXT_9,
502+ S390_FEAT_ETOKEN,
503+
504+--
505+2.12.3
506+
507diff --git a/debian/patches/ubuntu/lp-1836154-05-s390x-cpumodel-enhanced-sort-facility.patch b/debian/patches/ubuntu/lp-1836154-05-s390x-cpumodel-enhanced-sort-facility.patch
508new file mode 100644
509index 0000000..141b7d8
510--- /dev/null
511+++ b/debian/patches/ubuntu/lp-1836154-05-s390x-cpumodel-enhanced-sort-facility.patch
512@@ -0,0 +1,186 @@
513+From 0fa9768063532758fe4713421cffea2e555cae87 Mon Sep 17 00:00:00 2001
514+From: Christian Borntraeger <borntraeger@de.ibm.com>
515+Date: Mon, 29 Apr 2019 05:02:47 -0400
516+Subject: [PATCH 5/9] s390x/cpumodel: enhanced sort facility
517+
518+add the enhanced sort facility.
519+
520+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
521+Reviewed-by: David Hildenbrand <david@redhat.com>
522+Message-Id: <20190429090250.7648-7-borntraeger@de.ibm.com>
523+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
524+(cherry picked from commit d220fabf16091ca5c26f3313541bdfb7435d6a08)
525+
526+Author: Christian Borntraeger <borntraeger@de.ibm.com>
527+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=d220fabf16091ca5c26f3313541bdfb7435d6a08
528+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
529+Last-Update: 2019-08-07
530+---
531+ target/s390x/cpu_features.c | 10 ++++++++++
532+ target/s390x/cpu_features.h | 2 ++
533+ target/s390x/cpu_features_def.h | 8 ++++++++
534+ target/s390x/gen-features.c | 14 ++++++++++++++
535+ target/s390x/kvm.c | 6 ++++++
536+ 5 files changed, 40 insertions(+)
537+
538+diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
539+index 7073dcb5d8ea..f1d784beeb52 100644
540+--- a/target/s390x/cpu_features.c
541++++ b/target/s390x/cpu_features.c
542+@@ -106,6 +106,7 @@ static const S390FeatDef s390_features[] = {
543+ FEAT_INIT("msa8-base", S390_FEAT_TYPE_STFL, 146, "Message-security-assist-extension-8 facility (excluding subfunctions)"),
544+ FEAT_INIT("cmmnt", S390_FEAT_TYPE_STFL, 147, "CMM: ESSA-enhancement (no translate) facility"),
545+ FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"),
546++ FEAT_INIT("esort-base", S390_FEAT_TYPE_STFL, 150, "Enhanced-sort facility (excluding subfunctions)"),
547+ FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector BCD enhancements facility 1"),
548+ FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"),
549+ FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"),
550+@@ -333,6 +334,12 @@ static const S390FeatDef s390_features[] = {
551+ FEAT_INIT("kdsa-eddsa-sign-ed448", S390_FEAT_TYPE_KDSA, 44, "KDSA EdDSA-Sign-Ed448"),
552+ FEAT_INIT("kdsa-eeddsa-sign-ed25519", S390_FEAT_TYPE_KDSA, 48, "KDSA Encrypted-EdDSA-Sign-Ed25519"),
553+ FEAT_INIT("kdsa-eeddsa-sign-ed448", S390_FEAT_TYPE_KDSA, 52, "KDSA Encrypted-EdDSA-Sign-Ed448"),
554++
555++ FEAT_INIT("sortl-sflr", S390_FEAT_TYPE_SORTL, 1, "SORTL SFLR"),
556++ FEAT_INIT("sortl-svlr", S390_FEAT_TYPE_SORTL, 2, "SORTL SVLR"),
557++ FEAT_INIT("sortl-32", S390_FEAT_TYPE_SORTL, 130, "SORTL 32 input lists"),
558++ FEAT_INIT("sortl-128", S390_FEAT_TYPE_SORTL, 132, "SORTL 128 input lists"),
559++ FEAT_INIT("sortl-f0", S390_FEAT_TYPE_SORTL, 192, "SORTL format 0 parameter-block"),
560+ };
561+
562+ const S390FeatDef *s390_feat_def(S390Feat feat)
563+@@ -396,6 +403,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,
564+ case S390_FEAT_TYPE_PPNO:
565+ case S390_FEAT_TYPE_KMA:
566+ case S390_FEAT_TYPE_KDSA:
567++ case S390_FEAT_TYPE_SORTL:
568+ set_be_bit(0, data); /* query is always available */
569+ break;
570+ default:
571+@@ -423,6 +431,7 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
572+ nr_bits = 16384;
573+ break;
574+ case S390_FEAT_TYPE_PLO:
575++ case S390_FEAT_TYPE_SORTL:
576+ nr_bits = 256;
577+ break;
578+ default:
579+@@ -493,6 +502,7 @@ static S390FeatGroupDef s390_feature_groups[] = {
580+ FEAT_GROUP_INIT("msa8", MSA_EXT_8, "Message-security-assist-extension 8 facility"),
581+ FEAT_GROUP_INIT("msa9", MSA_EXT_9, "Message-security-assist-extension 9 facility"),
582+ FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"),
583++ FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"),
584+ };
585+
586+ const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group)
587+diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h
588+index 23a89dbe63f8..c829f367861d 100644
589+--- a/target/s390x/cpu_features.h
590++++ b/target/s390x/cpu_features.h
591+@@ -39,6 +39,7 @@ typedef enum {
592+ S390_FEAT_TYPE_PPNO,
593+ S390_FEAT_TYPE_KMA,
594+ S390_FEAT_TYPE_KDSA,
595++ S390_FEAT_TYPE_SORTL,
596+ } S390FeatType;
597+
598+ /* Definition of a CPU feature */
599+@@ -81,6 +82,7 @@ typedef enum {
600+ S390_FEAT_GROUP_MSA_EXT_8,
601+ S390_FEAT_GROUP_MSA_EXT_9,
602+ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
603++ S390_FEAT_GROUP_ENH_SORT,
604+ S390_FEAT_GROUP_MAX,
605+ } S390FeatGroup;
606+
607+diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h
608+index 209303ea0d53..f13f74a3ade2 100644
609+--- a/target/s390x/cpu_features_def.h
610++++ b/target/s390x/cpu_features_def.h
611+@@ -97,6 +97,7 @@ typedef enum {
612+ S390_FEAT_MSA_EXT_8,
613+ S390_FEAT_CMM_NT,
614+ S390_FEAT_VECTOR_ENH2,
615++ S390_FEAT_ESORT_BASE,
616+ S390_FEAT_VECTOR_BCD_ENH,
617+ S390_FEAT_MSA_EXT_9,
618+ S390_FEAT_ETOKEN,
619+@@ -342,6 +343,13 @@ typedef enum {
620+ S390_FEAT_EEDDSA_SIGN_ED25519,
621+ S390_FEAT_EEDDSA_SIGN_ED448,
622+
623++ /* SORTL */
624++ S390_FEAT_SORTL_SFLR,
625++ S390_FEAT_SORTL_SVLR,
626++ S390_FEAT_SORTL_32,
627++ S390_FEAT_SORTL_128,
628++ S390_FEAT_SORTL_F0,
629++
630+ S390_FEAT_MAX,
631+ } S390Feat;
632+
633+diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
634+index 8b042a15a410..bb457afe8b64 100644
635+--- a/target/s390x/gen-features.c
636++++ b/target/s390x/gen-features.c
637+@@ -241,6 +241,15 @@
638+ S390_FEAT_PCKMO_ECC_ED25519, \
639+ S390_FEAT_PCKMO_ECC_ED448
640+
641++#define S390_FEAT_GROUP_ENH_SORT \
642++ S390_FEAT_ESORT_BASE, \
643++ S390_FEAT_SORTL_SFLR, \
644++ S390_FEAT_SORTL_SVLR, \
645++ S390_FEAT_SORTL_32, \
646++ S390_FEAT_SORTL_128, \
647++ S390_FEAT_SORTL_F0
648++
649++
650+ /* cpu feature groups */
651+ static uint16_t group_PLO[] = {
652+ S390_FEAT_GROUP_PLO,
653+@@ -287,6 +296,10 @@ static uint16_t group_MSA_EXT_9_PCKMO[] = {
654+ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
655+ };
656+
657++static uint16_t group_ENH_SORT[] = {
658++ S390_FEAT_GROUP_ENH_SORT,
659++};
660++
661+ /* Base features (in order of release)
662+ * Only non-hypervisor managed features belong here.
663+ * Base feature sets are static meaning they do not change in future QEMU
664+@@ -673,6 +686,7 @@ static FeatGroupDefSpec FeatGroupDef[] = {
665+ FEAT_GROUP_INITIALIZER(MSA_EXT_8),
666+ FEAT_GROUP_INITIALIZER(MSA_EXT_9),
667+ FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO),
668++ FEAT_GROUP_INITIALIZER(ENH_SORT),
669+ };
670+
671+ static void set_bits(uint64_t list[], BitSpec bits)
672+diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
673+index de67450ebebb..360b04db7698 100644
674+--- a/target/s390x/kvm.c
675++++ b/target/s390x/kvm.c
676+@@ -2135,6 +2135,9 @@ static int query_cpu_subfunc(S390FeatBitmap features)
677+ if (test_bit(S390_FEAT_MSA_EXT_9, features)) {
678+ s390_add_from_feat_block(features, S390_FEAT_TYPE_KDSA, prop.kdsa);
679+ }
680++ if (test_bit(S390_FEAT_ESORT_BASE, features)) {
681++ s390_add_from_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl);
682++ }
683+ return 0;
684+ }
685+
686+@@ -2182,6 +2185,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features)
687+ if (test_bit(S390_FEAT_MSA_EXT_9, features)) {
688+ s390_fill_feat_block(features, S390_FEAT_TYPE_KDSA, prop.kdsa);
689+ }
690++ if (test_bit(S390_FEAT_ESORT_BASE, features)) {
691++ s390_fill_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl);
692++ }
693+ return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
694+ }
695+
696+--
697+2.12.3
698+
699diff --git a/debian/patches/ubuntu/lp-1836154-06-s390x-cpumodel-add-Deflate-conversion-facility.patch b/debian/patches/ubuntu/lp-1836154-06-s390x-cpumodel-add-Deflate-conversion-facility.patch
700new file mode 100644
701index 0000000..7800ab1
702--- /dev/null
703+++ b/debian/patches/ubuntu/lp-1836154-06-s390x-cpumodel-add-Deflate-conversion-facility.patch
704@@ -0,0 +1,182 @@
705+From ee6b6209e534d15aa458cf0e20161c08da4fe31d Mon Sep 17 00:00:00 2001
706+From: Christian Borntraeger <borntraeger@de.ibm.com>
707+Date: Mon, 29 Apr 2019 05:02:48 -0400
708+Subject: [PATCH 6/9] s390x/cpumodel: add Deflate-conversion facility
709+
710+add the deflate conversion facility.
711+
712+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
713+Message-Id: <20190429090250.7648-8-borntraeger@de.ibm.com>
714+Reviewed-by: David Hildenbrand <david@redhat.com>
715+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
716+(cherry picked from commit afc7b8666b62fe72fdbad7ab0c3f206d4c57c1d1)
717+
718+Author: Christian Borntraeger <borntraeger@de.ibm.com>
719+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=afc7b8666b62fe72fdbad7ab0c3f206d4c57c1d1
720+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
721+Last-Update: 2019-08-07
722+---
723+ target/s390x/cpu_features.c | 9 +++++++++
724+ target/s390x/cpu_features.h | 2 ++
725+ target/s390x/cpu_features_def.h | 7 +++++++
726+ target/s390x/gen-features.c | 12 ++++++++++++
727+ target/s390x/kvm.c | 6 ++++++
728+ 5 files changed, 36 insertions(+)
729+
730+diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
731+index f1d784beeb52..98fa3a66dc81 100644
732+--- a/target/s390x/cpu_features.c
733++++ b/target/s390x/cpu_features.c
734+@@ -107,6 +107,7 @@ static const S390FeatDef s390_features[] = {
735+ FEAT_INIT("cmmnt", S390_FEAT_TYPE_STFL, 147, "CMM: ESSA-enhancement (no translate) facility"),
736+ FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"),
737+ FEAT_INIT("esort-base", S390_FEAT_TYPE_STFL, 150, "Enhanced-sort facility (excluding subfunctions)"),
738++ FEAT_INIT("deflate-base", S390_FEAT_TYPE_STFL, 151, "Deflate-conversion facility (excluding subfunctions)"),
739+ FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector BCD enhancements facility 1"),
740+ FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"),
741+ FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"),
742+@@ -340,6 +341,11 @@ static const S390FeatDef s390_features[] = {
743+ FEAT_INIT("sortl-32", S390_FEAT_TYPE_SORTL, 130, "SORTL 32 input lists"),
744+ FEAT_INIT("sortl-128", S390_FEAT_TYPE_SORTL, 132, "SORTL 128 input lists"),
745+ FEAT_INIT("sortl-f0", S390_FEAT_TYPE_SORTL, 192, "SORTL format 0 parameter-block"),
746++
747++ FEAT_INIT("dfltcc-gdht", S390_FEAT_TYPE_DFLTCC, 1, "DFLTCC GDHT"),
748++ FEAT_INIT("dfltcc-cmpr", S390_FEAT_TYPE_DFLTCC, 2, "DFLTCC CMPR"),
749++ FEAT_INIT("dfltcc-xpnd", S390_FEAT_TYPE_DFLTCC, 4, "DFLTCC XPND"),
750++ FEAT_INIT("dfltcc-f0", S390_FEAT_TYPE_DFLTCC, 192, "DFLTCC format 0 parameter-block"),
751+ };
752+
753+ const S390FeatDef *s390_feat_def(S390Feat feat)
754+@@ -404,6 +410,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,
755+ case S390_FEAT_TYPE_KMA:
756+ case S390_FEAT_TYPE_KDSA:
757+ case S390_FEAT_TYPE_SORTL:
758++ case S390_FEAT_TYPE_DFLTCC:
759+ set_be_bit(0, data); /* query is always available */
760+ break;
761+ default:
762+@@ -432,6 +439,7 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
763+ break;
764+ case S390_FEAT_TYPE_PLO:
765+ case S390_FEAT_TYPE_SORTL:
766++ case S390_FEAT_TYPE_DFLTCC:
767+ nr_bits = 256;
768+ break;
769+ default:
770+@@ -503,6 +511,7 @@ static S390FeatGroupDef s390_feature_groups[] = {
771+ FEAT_GROUP_INIT("msa9", MSA_EXT_9, "Message-security-assist-extension 9 facility"),
772+ FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"),
773+ FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"),
774++ FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"),
775+ };
776+
777+ const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group)
778+diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h
779+index c829f367861d..7e161380963b 100644
780+--- a/target/s390x/cpu_features.h
781++++ b/target/s390x/cpu_features.h
782+@@ -40,6 +40,7 @@ typedef enum {
783+ S390_FEAT_TYPE_KMA,
784+ S390_FEAT_TYPE_KDSA,
785+ S390_FEAT_TYPE_SORTL,
786++ S390_FEAT_TYPE_DFLTCC,
787+ } S390FeatType;
788+
789+ /* Definition of a CPU feature */
790+@@ -83,6 +84,7 @@ typedef enum {
791+ S390_FEAT_GROUP_MSA_EXT_9,
792+ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
793+ S390_FEAT_GROUP_ENH_SORT,
794++ S390_FEAT_GROUP_DEFLATE_CONVERSION,
795+ S390_FEAT_GROUP_MAX,
796+ } S390FeatGroup;
797+
798+diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h
799+index f13f74a3ade2..973ef0ccf982 100644
800+--- a/target/s390x/cpu_features_def.h
801++++ b/target/s390x/cpu_features_def.h
802+@@ -98,6 +98,7 @@ typedef enum {
803+ S390_FEAT_CMM_NT,
804+ S390_FEAT_VECTOR_ENH2,
805+ S390_FEAT_ESORT_BASE,
806++ S390_FEAT_DEFLATE_BASE,
807+ S390_FEAT_VECTOR_BCD_ENH,
808+ S390_FEAT_MSA_EXT_9,
809+ S390_FEAT_ETOKEN,
810+@@ -350,6 +351,12 @@ typedef enum {
811+ S390_FEAT_SORTL_128,
812+ S390_FEAT_SORTL_F0,
813+
814++ /* DEFLATE */
815++ S390_FEAT_DEFLATE_GHDT,
816++ S390_FEAT_DEFLATE_CMPR,
817++ S390_FEAT_DEFLATE_XPND,
818++ S390_FEAT_DEFLATE_F0,
819++
820+ S390_FEAT_MAX,
821+ } S390Feat;
822+
823+diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
824+index bb457afe8b64..9ebef0506e5f 100644
825+--- a/target/s390x/gen-features.c
826++++ b/target/s390x/gen-features.c
827+@@ -250,6 +250,13 @@
828+ S390_FEAT_SORTL_F0
829+
830+
831++#define S390_FEAT_GROUP_DEFLATE_CONVERSION \
832++ S390_FEAT_DEFLATE_BASE, \
833++ S390_FEAT_DEFLATE_GHDT, \
834++ S390_FEAT_DEFLATE_CMPR, \
835++ S390_FEAT_DEFLATE_XPND, \
836++ S390_FEAT_DEFLATE_F0
837++
838+ /* cpu feature groups */
839+ static uint16_t group_PLO[] = {
840+ S390_FEAT_GROUP_PLO,
841+@@ -300,6 +307,10 @@ static uint16_t group_ENH_SORT[] = {
842+ S390_FEAT_GROUP_ENH_SORT,
843+ };
844+
845++static uint16_t group_DEFLATE_CONVERSION[] = {
846++ S390_FEAT_GROUP_DEFLATE_CONVERSION,
847++};
848++
849+ /* Base features (in order of release)
850+ * Only non-hypervisor managed features belong here.
851+ * Base feature sets are static meaning they do not change in future QEMU
852+@@ -687,6 +698,7 @@ static FeatGroupDefSpec FeatGroupDef[] = {
853+ FEAT_GROUP_INITIALIZER(MSA_EXT_9),
854+ FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO),
855+ FEAT_GROUP_INITIALIZER(ENH_SORT),
856++ FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION),
857+ };
858+
859+ static void set_bits(uint64_t list[], BitSpec bits)
860+diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
861+index 360b04db7698..4e425a9fd3a5 100644
862+--- a/target/s390x/kvm.c
863++++ b/target/s390x/kvm.c
864+@@ -2138,6 +2138,9 @@ static int query_cpu_subfunc(S390FeatBitmap features)
865+ if (test_bit(S390_FEAT_ESORT_BASE, features)) {
866+ s390_add_from_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl);
867+ }
868++ if (test_bit(S390_FEAT_DEFLATE_BASE, features)) {
869++ s390_add_from_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc);
870++ }
871+ return 0;
872+ }
873+
874+@@ -2188,6 +2191,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features)
875+ if (test_bit(S390_FEAT_ESORT_BASE, features)) {
876+ s390_fill_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl);
877+ }
878++ if (test_bit(S390_FEAT_DEFLATE_BASE, features)) {
879++ s390_fill_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc);
880++ }
881+ return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
882+ }
883+
884+--
885+2.12.3
886+
887diff --git a/debian/patches/ubuntu/lp-1836154-07-s390x-cpumodel-add-gen15-defintions.patch b/debian/patches/ubuntu/lp-1836154-07-s390x-cpumodel-add-gen15-defintions.patch
888new file mode 100644
889index 0000000..db0dc1b
890--- /dev/null
891+++ b/debian/patches/ubuntu/lp-1836154-07-s390x-cpumodel-add-gen15-defintions.patch
892@@ -0,0 +1,119 @@
893+From c30eac9c451ac6032f8a76ff1dd4e59e4109fef1 Mon Sep 17 00:00:00 2001
894+From: Christian Borntraeger <borntraeger@de.ibm.com>
895+Date: Mon, 29 Apr 2019 05:02:49 -0400
896+Subject: [PATCH 7/9] s390x/cpumodel: add gen15 defintions
897+
898+add several new features (msa9, sort, deflate, additional vector
899+instructions, new general purpose instructions) to generation 15.
900+
901+Also disable csske and bpb from the default and base models >=15.
902+This will allow to migrate gen15 machines to future machines that
903+do not have these features.
904+
905+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
906+Message-Id: <20190429090250.7648-9-borntraeger@de.ibm.com>
907+Reviewed-by: David Hildenbrand <david@redhat.com>
908+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
909+(cherry picked from commit caef62430fed6e732d3e43d76752d165cf02ad67)
910+
911+Author: Christian Borntraeger <borntraeger@de.ibm.com>
912+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=caef62430fed6e732d3e43d76752d165cf02ad67
913+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
914+Last-Update: 2019-08-07
915+---
916+ target/s390x/gen-features.c | 37 +++++++++++++++++++++++++++++++++++++
917+ 1 file changed, 37 insertions(+)
918+
919+diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
920+index 9ebef0506e5f..f7b598d53ca5 100644
921+--- a/target/s390x/gen-features.c
922++++ b/target/s390x/gen-features.c
923+@@ -15,6 +15,7 @@
924+
925+ #include "inttypes.h"
926+ #include "stdio.h"
927++#include <string.h>
928+ #include "cpu_features_def.h"
929+
930+ #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
931+@@ -410,6 +411,10 @@ static uint16_t base_GEN14_GA1[] = {
932+ S390_FEAT_ORDER_PRESERVING_COMPRESSION,
933+ };
934+
935++static uint16_t base_GEN15_GA1[] = {
936++ S390_FEAT_MISC_INSTRUCTION_EXT3,
937++};
938++
939+ /* Full features (in order of release)
940+ * Automatically includes corresponding base features.
941+ * Full features are all features this hardware supports even if kvm/QEMU do not
942+@@ -536,6 +541,16 @@ static uint16_t full_GEN14_GA1[] = {
943+ S390_FEAT_SIE_KSS,
944+ };
945+
946++static uint16_t full_GEN15_GA1[] = {
947++ S390_FEAT_VECTOR_ENH2,
948++ S390_FEAT_GROUP_ENH_SORT,
949++ S390_FEAT_GROUP_DEFLATE_CONVERSION,
950++ S390_FEAT_VECTOR_BCD_ENH,
951++ S390_FEAT_GROUP_MSA_EXT_9,
952++ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
953++ S390_FEAT_ETOKEN,
954++};
955++
956+ /* Default features (in order of release)
957+ * Automatically includes corresponding base features.
958+ * Default features are all features this version of QEMU supports for this
959+@@ -606,6 +621,16 @@ static uint16_t default_GEN14_GA1[] = {
960+ S390_FEAT_GROUP_MSA_EXT_8,
961+ };
962+
963++static uint16_t default_GEN15_GA1[] = {
964++ S390_FEAT_VECTOR_ENH2,
965++ S390_FEAT_GROUP_ENH_SORT,
966++ S390_FEAT_GROUP_DEFLATE_CONVERSION,
967++ S390_FEAT_VECTOR_BCD_ENH,
968++ S390_FEAT_GROUP_MSA_EXT_9,
969++ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
970++ S390_FEAT_ETOKEN,
971++};
972++
973+ /****** END FEATURE DEFS ******/
974+
975+ #define _YEARS "2016"
976+@@ -664,6 +689,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
977+ CPU_FEAT_INITIALIZER(GEN13_GA1),
978+ CPU_FEAT_INITIALIZER(GEN13_GA2),
979+ CPU_FEAT_INITIALIZER(GEN14_GA1),
980++ CPU_FEAT_INITIALIZER(GEN15_GA1),
981+ };
982+
983+ #define FEAT_GROUP_INITIALIZER(_name) \
984+@@ -710,6 +736,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
985+ }
986+ }
987+
988++static inline void clear_bit(uint64_t list[], unsigned long nr)
989++{
990++ list[nr / 64] &= ~(1ULL << (nr % 64));
991++}
992++
993+ static void print_feature_defs(void)
994+ {
995+ uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
996+@@ -720,6 +751,12 @@ static void print_feature_defs(void)
997+ printf("\n/* CPU model feature list data */\n");
998+
999+ for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
1000++ /* With gen15 CSSKE and BPB are deprecated */
1001++ if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
1002++ clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
1003++ clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
1004++ clear_bit(default_feat, S390_FEAT_BPB);
1005++ }
1006+ set_bits(base_feat, CpuFeatDef[i].base_bits);
1007+ /* add the base to the default features */
1008+ set_bits(default_feat, CpuFeatDef[i].base_bits);
1009+--
1010+2.12.3
1011+
1012diff --git a/debian/patches/ubuntu/lp-1836154-08-s390x-cpumodel-wire-up-8561-and-8562-as-gen15-machin.patch b/debian/patches/ubuntu/lp-1836154-08-s390x-cpumodel-wire-up-8561-and-8562-as-gen15-machin.patch
1013new file mode 100644
1014index 0000000..e64f5ec
1015--- /dev/null
1016+++ b/debian/patches/ubuntu/lp-1836154-08-s390x-cpumodel-wire-up-8561-and-8562-as-gen15-machin.patch
1017@@ -0,0 +1,53 @@
1018+From 7ad963d1a299970a49da9372527cd3cc3990a39f Mon Sep 17 00:00:00 2001
1019+From: Christian Borntraeger <borntraeger@de.ibm.com>
1020+Date: Mon, 29 Apr 2019 05:02:50 -0400
1021+Subject: [PATCH 8/9] s390x/cpumodel: wire up 8561 and 8562 as gen15 machines
1022+
1023+8561 and 8562 will be gen15 machines. There is no name yet, let us use
1024+gen15a and gen15b as base name. Later on we can provide aliases with
1025+the proper name.
1026+
1027+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
1028+Message-Id: <20190429090250.7648-10-borntraeger@de.ibm.com>
1029+Reviewed-by: David Hildenbrand <david@redhat.com>
1030+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
1031+(cherry picked from commit c657e84faee48d6ab36665da5a008b8f0649593d)
1032+
1033+Author: Christian Borntraeger <borntraeger@de.ibm.com>
1034+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=c657e84faee48d6ab36665da5a008b8f0649593d
1035+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
1036+Last-Update: 2019-08-07
1037+---
1038+ target/s390x/cpu_models.c | 9 +++++----
1039+ 1 file changed, 5 insertions(+), 4 deletions(-)
1040+
1041+diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
1042+index 1e8714afe3a8..6052983051d0 100644
1043+--- a/target/s390x/cpu_models.c
1044++++ b/target/s390x/cpu_models.c
1045+@@ -41,10 +41,9 @@
1046+ }
1047+
1048+ /*
1049+- * CPU definiton list in order of release. For now, base features of a
1050+- * following release are always a subset of base features of the previous
1051+- * release. Same is correct for the other feature sets.
1052+- * A BC release always follows the corresponding EC release.
1053++ * CPU definition list in order of release. Up to generation 14 base features
1054++ * of a following release have been a superset of the previous release. With
1055++ * generation 15 one base feature and one optional feature have been deprecated.
1056+ */
1057+ static S390CPUDef s390_cpu_defs[] = {
1058+ CPUDEF_INIT(0x2064, 7, 1, 38, 0x00000000U, "z900", "IBM zSeries 900 GA1"),
1059+@@ -80,6 +79,8 @@ static S390CPUDef s390_cpu_defs[] = {
1060+ CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
1061+ CPUDEF_INIT(0x3906, 14, 1, 47, 0x08000000U, "z14", "IBM z14 GA1"),
1062+ CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model ZR1 GA1"),
1063++ CPUDEF_INIT(0x8561, 15, 1, 47, 0x08000000U, "gen15a", "IBM 8561 GA1"),
1064++ CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM 8562 GA1"),
1065+ };
1066+
1067+ /* features part of a base model but not relevant for finding a base model */
1068+--
1069+2.12.3
1070+
1071diff --git a/debian/patches/ubuntu/lp-1836154-09-s390-cpumodel-fix-description-for-the-new-vector-fac.patch b/debian/patches/ubuntu/lp-1836154-09-s390-cpumodel-fix-description-for-the-new-vector-fac.patch
1072new file mode 100644
1073index 0000000..518d6aa
1074--- /dev/null
1075+++ b/debian/patches/ubuntu/lp-1836154-09-s390-cpumodel-fix-description-for-the-new-vector-fac.patch
1076@@ -0,0 +1,40 @@
1077+From 9b54810232977c2eb2b32b28c3dde39a1fa82e87 Mon Sep 17 00:00:00 2001
1078+From: Christian Borntraeger <borntraeger@de.ibm.com>
1079+Date: Mon, 8 Jul 2019 17:09:31 +0200
1080+Subject: [PATCH 9/9] s390: cpumodel: fix description for the new vector
1081+ facility
1082+
1083+The new facility is called "Vector-Packed-Decimal-Enhancement Facility"
1084+and not "Vector BCD enhancements facility 1". As the shortname might
1085+have already found its way into some backports, let's keep vxbeh.
1086+
1087+Fixes: 54d65de0b525 ("s390x/cpumodel: vector enhancements")
1088+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
1089+Message-Id: <20190708150931.93448-1-borntraeger@de.ibm.com>
1090+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
1091+(cherry picked from commit d05be57ddc2e1722f527aa4c20d84dfd15c840ec)
1092+
1093+Author: Christian Borntraeger <borntraeger@de.ibm.com>
1094+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=d05be57ddc2e1722f527aa4c20d84dfd15c840ec
1095+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
1096+Last-Update: 2019-08-07
1097+---
1098+ target/s390x/cpu_features.c | 2 +-
1099+ 1 file changed, 1 insertion(+), 1 deletion(-)
1100+
1101+diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
1102+index 98fa3a66dc81..24538fc6091e 100644
1103+--- a/target/s390x/cpu_features.c
1104++++ b/target/s390x/cpu_features.c
1105+@@ -108,7 +108,7 @@ static const S390FeatDef s390_features[] = {
1106+ FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"),
1107+ FEAT_INIT("esort-base", S390_FEAT_TYPE_STFL, 150, "Enhanced-sort facility (excluding subfunctions)"),
1108+ FEAT_INIT("deflate-base", S390_FEAT_TYPE_STFL, 151, "Deflate-conversion facility (excluding subfunctions)"),
1109+- FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector BCD enhancements facility 1"),
1110++ FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector-Packed-Decimal-Enhancement Facility"),
1111+ FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"),
1112+ FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"),
1113+
1114+--
1115+2.12.3
1116+
1117diff --git a/debian/patches/ubuntu/lp-1836154-s390x-cpumodel-also-change-name-of-vxbeh.patch b/debian/patches/ubuntu/lp-1836154-s390x-cpumodel-also-change-name-of-vxbeh.patch
1118new file mode 100644
1119index 0000000..2da5273
1120--- /dev/null
1121+++ b/debian/patches/ubuntu/lp-1836154-s390x-cpumodel-also-change-name-of-vxbeh.patch
1122@@ -0,0 +1,41 @@
1123+From 0d4cb295db7503fbac2f5bb3e878a56630231fed Mon Sep 17 00:00:00 2001
1124+From: Christian Borntraeger <borntraeger@de.ibm.com>
1125+Date: Mon, 15 Jul 2019 16:23:03 +0200
1126+Subject: [PATCH] s390x/cpumodel: also change name of vxbeh
1127+
1128+David suggested to keep everything in sync as 4.1 is not yet released.
1129+This patch fixes the name "vxbeh" into "vxpdeh".
1130+
1131+To simplify the backports this patch will not change VECTOR_BCD_ENH as
1132+this is just an internal name. That will be done by an extra patch that
1133+does not need to be backported.
1134+
1135+Suggested-by: David Hildenbrand <david@redhat.com>
1136+Fixes: d05be57ddc2e ("s390: cpumodel: fix description for the new vector facility")
1137+Fixes: 54d65de0b525 ("s390x/cpumodel: vector enhancements")
1138+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
1139+Message-Id: <20190715142304.215018-3-borntraeger@de.ibm.com>
1140+[CH: vxp->vxpdeh, as discussed]
1141+Reviewed-by: David Hildenbrand <david@redhat.com>
1142+Reviewed-by: Thomas Huth <thuth@redhat.com>
1143+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
1144+
1145+Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=0d4cb295db75
1146+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
1147+Last-Update: 2019-07-17
1148+
1149+---
1150+ target/s390x/cpu_features_def.inc.h | 2 +-
1151+ 1 file changed, 1 insertion(+), 1 deletion(-)
1152+
1153+--- a/target/s390x/cpu_features.c
1154++++ b/target/s390x/cpu_features.c
1155+@@ -108,7 +108,7 @@ static const S390FeatDef s390_features[]
1156+ FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"),
1157+ FEAT_INIT("esort-base", S390_FEAT_TYPE_STFL, 150, "Enhanced-sort facility (excluding subfunctions)"),
1158+ FEAT_INIT("deflate-base", S390_FEAT_TYPE_STFL, 151, "Deflate-conversion facility (excluding subfunctions)"),
1159+- FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector-Packed-Decimal-Enhancement Facility"),
1160++ FEAT_INIT("vxpdeh", S390_FEAT_TYPE_STFL, 152, "Vector-Packed-Decimal-Enhancement Facility"),
1161+ FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"),
1162+ FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"),
1163+
1164diff --git a/debian/patches/ubuntu/lp-1836154-s390x-cpumodel-remove-esort-from-the-default-model.patch b/debian/patches/ubuntu/lp-1836154-s390x-cpumodel-remove-esort-from-the-default-model.patch
1165new file mode 100644
1166index 0000000..74df0f5
1167--- /dev/null
1168+++ b/debian/patches/ubuntu/lp-1836154-s390x-cpumodel-remove-esort-from-the-default-model.patch
1169@@ -0,0 +1,37 @@
1170+From de6bb08570065eb318849dfd7f316448e51197b5 Mon Sep 17 00:00:00 2001
1171+From: Christian Borntraeger <borntraeger@de.ibm.com>
1172+Date: Mon, 15 Jul 2019 16:23:02 +0200
1173+Subject: [PATCH] s390x/cpumodel: remove esort from the default model
1174+
1175+esort might not be available on all models.
1176+
1177+Fixes: caef62430fed6e73 ("s390x/cpumodel: add gen15 defintions")
1178+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
1179+Message-Id: <20190715142304.215018-2-borntraeger@de.ibm.com>
1180+Reviewed-by: David Hildenbrand <david@redhat.com>
1181+Reviewed-by: Thomas Huth <thuth@redhat.com>
1182+Signed-off-by: Cornelia Huck <cohuck@redhat.com>
1183+
1184+Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=de6bb0857006
1185+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836154
1186+Last-Update: 2019-07-17
1187+
1188+---
1189+ target/s390x/gen-features.c | 1 -
1190+ 1 file changed, 1 deletion(-)
1191+
1192+diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
1193+index 9f216219ff..6debfc1d21 100644
1194+--- a/target/s390x/gen-features.c
1195++++ b/target/s390x/gen-features.c
1196+@@ -642,7 +642,6 @@ static uint16_t default_GEN14_GA1[] = {
1197+
1198+ static uint16_t default_GEN15_GA1[] = {
1199+ S390_FEAT_VECTOR_ENH2,
1200+- S390_FEAT_GROUP_ENH_SORT,
1201+ S390_FEAT_GROUP_DEFLATE_CONVERSION,
1202+ S390_FEAT_VECTOR_BCD_ENH,
1203+ S390_FEAT_GROUP_MSA_EXT_9,
1204+--
1205+2.22.0
1206+

Subscribers

People subscribed via source and target branches