Merge ~paelzer/ubuntu/+source/qemu:lp-1829380-vhost-1828288-amd-xenial into ubuntu/+source/qemu:ubuntu/xenial-devel

Proposed by Christian Ehrhardt 
Status: Rejected
Rejected by: Christian Ehrhardt 
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-1829380-vhost-1828288-amd-xenial
Merge into: ubuntu/+source/qemu:ubuntu/xenial-devel
Diff against target: 137 lines (+104/-2)
4 files modified
debian/changelog (+16/-0)
debian/patches/lp1823458/lp1829380.patch (+20/-0)
debian/patches/lp1828288/target-i386-Set-AMD-alias-bits-after-filtering-CPUID.patch (+64/-0)
debian/patches/series (+4/-2)
Reviewer Review Type Date Requested Status
Rafael David Tinoco (community) tested package and reviewed code. Approve
Dan Streetman (community) Approve
Canonical Server Pending
Christian Ehrhardt  Pending
git-ubuntu developers Pending
Review via email: mp+367971@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

PPA: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3729

Adding original Authors as reviewers -> Dan/Rafael

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

It seems 1:2.5+dfsg-5ubuntu10.39 wasn't imported correctly yet which makes this look odd in LP at the moment.
For now, if you clone the git branch you should get a better view I'd think.

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

I rebased to a new git fetch, now things look more reasonable

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

@Christian,

Just discovered that might be something else going on blocking my AMD QEMU test. This time I was able to boot my guest with versions 10.39 (-updates) and yours (ppa) - and I'm not able to boot nested KVM.

So, for my patch, only difference was esthetic since it did not show the unsupported CPUID features in libvirt qemu log. You may keep it in the SRU or remove, if you judge its not worth. The patch is small and already tested, might be good to keep it, just wanted you to know that it is not fixing boot issue in AMD, just the feature check.

Thanks

Rafael

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

@Rafael - thanks for the test - Lets fix the aesthetics now that things seem ready and prepared, but throw anything on the "other" issue blocking your boot into a new bug then please.

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

@Christian,

Finished testing nested AMD KVM (AMD FX(tm)-8350). Cosmic is okay, all the others are "broken" for nested KVM. I just discovered it seems to be a kernel issue since I installed 4.19 in Xenial (1st level) running on top of Debian Sid (4.19) and it was able to boot my nested KVM guest.

I might have to bisect kernel for this :\, maybe add this to server-next somehow ? (Unsure because of possible LTS openstack releases that might be affected by this).

Cheers o/

Revision history for this message
Dan Streetman (ddstreet) wrote :

Since this is the same code content as my pkg in the upload queue, I approve of the patch for lp #1829380, that i tested with:
https://launchpad.net/~ddstreet/+archive/ubuntu/lp1829380/+packages

I will defer to tinoco to approve his patch.

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

Thanks Dan!

Yep, It's good for me, since my AMD issue does not seem to have anything to do with previous QEMU version, or this one. If Christian is okay with my SRU being aesthetics... I can confirm package worked for me!!

Thanks a lot!

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) :
review: Approve (tested package and reviewed code.)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks you two.
I have verified that the code in -unapproved by Dan is (other than changelog wording and patch naming) identical.
So we can leave that upload there as is without replacing it.

I'm currently wrestling with my test setup, once working I'll comment on the bugs as well.

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

Since this will be uploaded by ddstreet (in unapproved already) we can set this one to "rejected"

Unmerged commits

c2fd05a... by Christian Ehrhardt 

changelog: Fix issues with CPUID_EXT2_AMD_ALIASES allowing guests using cpu passthrough to boot. (LP: #1828288)

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

d09e09b... by Christian Ehrhardt 

Fix issues with CPUID_EXT2_AMD_ALIASES allowing guests using cpu passthrough to boot. (LP: #1828288)

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

0b310e6... by Christian Ehrhardt 

changelog: Re-enable patches for (LP: 1823458) with a fixup for the former regression added (LP: #1829380)

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

17f438f... by Christian Ehrhardt 

Re-enable patches for (LP: 1823458) with a fixup for the former regression added (LP: #1829380)

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

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 5342ca8..edc5b6d 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,19 @@
6+qemu (1:2.5+dfsg-5ubuntu10.40) xenial; urgency=medium
7+
8+ [ Dan Streetman ]
9+ * Re-enable patches for (LP: 1823458) with a fixup for the former
10+ regression added (LP: #1829380).
11+ - d/p/lp1823458/add-VirtIONet-vhost_stopped-flag-to-prevent-multiple.patch
12+ - d/p/lp1823458/do-not-call-vhost_net_cleanup-on-running-net-from-ch.patch
13+ - d/p/lp1823458/lp1829380.patch
14+
15+ [ Rafael David Tinoco ]
16+ * d/p/lp1828288/target-i386-Set-AMD-alias-bits-after-filtering-CPUID.patch
17+ - Fix issues with CPUID_EXT2_AMD_ALIASES allowing guests using
18+ cpu passthrough to boot. (LP: #1828288)
19+
20+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 28 May 2019 09:35:55 +0200
21+
22 qemu (1:2.5+dfsg-5ubuntu10.39) xenial-security; urgency=medium
23
24 * Disable patches from 1:2.5+dfsg-5ubuntu10.37 to prevent regression
25diff --git a/debian/patches/lp1823458/lp1829380.patch b/debian/patches/lp1823458/lp1829380.patch
26new file mode 100644
27index 0000000..06b3f62
28--- /dev/null
29+++ b/debian/patches/lp1823458/lp1829380.patch
30@@ -0,0 +1,20 @@
31+From: Dan Streetman <ddstreet@canonical.com>
32+Subject: Fix regression of failing qemu guest networking
33+Bug-Ubuntu: https://launchpad.net/bugs/1829380
34+
35+This fixes the regression detailed in LP: #1829245
36+
37+The original patch that caused the regression is from LP: #1823458
38+
39+This fix will be uploaded to Xenial in LP: #1829380
40+
41+--- qemu-2.5+dfsg.orig/hw/net/virtio-net.c
42++++ qemu-2.5+dfsg/hw/net/virtio-net.c
43+@@ -140,6 +140,7 @@ static void virtio_net_vhost_status(Virt
44+ qemu_net_queue_purge(qnc->incoming_queue, qnc->peer);
45+ }
46+
47++ atomic_set(&n->vhost_stopped, 0);
48+ n->vhost_started = 1;
49+ r = vhost_net_start(vdev, n->nic->ncs, queues);
50+ if (r < 0) {
51diff --git a/debian/patches/lp1828288/target-i386-Set-AMD-alias-bits-after-filtering-CPUID.patch b/debian/patches/lp1828288/target-i386-Set-AMD-alias-bits-after-filtering-CPUID.patch
52new file mode 100644
53index 0000000..bb74c77
54--- /dev/null
55+++ b/debian/patches/lp1828288/target-i386-Set-AMD-alias-bits-after-filtering-CPUID.patch
56@@ -0,0 +1,64 @@
57+Description: target-i386: Set AMD alias bits after filtering CPUID data
58+
59+QEMU complains about -cpu host on an AMD machine:
60+ warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 0]
61+For bits 0,1,3,4,5,6,7,8,9,12,13,14,15,16,17,23,24.
62+
63+KVM_GET_SUPPORTED_CPUID and and x86_cpu_get_migratable_flags()
64+don't handle the AMD CPUID aliases bits, making
65+x86_cpu_filter_features() print warnings and clear those CPUID
66+bits incorrectly.
67+
68+To avoid hacking x86_cpu_get_migratable_flags() to handle
69+CPUID_EXT2_AMD_ALIASES (just like the existing hack inside
70+kvm_arch_get_supported_cpuid()), simply move the
71+CPUID_EXT2_AMD_ALIASES code in x86_cpu_realizefn() after the
72+x86_cpu_filter_features() call.
73+
74+This will probably make the CPUID_EXT2_AMD_ALIASES hack in
75+kvm_arch_get_supported_cpuid() unnecessary, too. The hack will be
76+removed in a follow-up patch after v2.6.0.
77+
78+Reported-by: Radim Krčmář <rkrcmar@redhat.com>
79+Tested-by: Radim Krčmář <rkrcmar@redhat.com>
80+Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
81+---
82+Author: Eduardo Habkost <ehabkost@redhat.com>
83+Origin: upstream, commit: 9997cf7bdac056aeed246613639675c5a9f8fdc2
84+Bug: http://lists.nongnu.org/archive/html/qemu-devel/2016-04/msg02597.html
85+Bug-Ubuntu: https://launchpad.net/bugs/1828288
86+Reviewed-By: Rafael David Tinoco <rafaeldtinoco@gmail.com>
87+Last-Update: <2019-05-08>
88+
89+--- qemu-2.5+dfsg.orig/target-i386/cpu.c
90++++ qemu-2.5+dfsg/target-i386/cpu.c
91+@@ -3156,6 +3156,14 @@ static void x86_cpu_realizefn(DeviceStat
92+ env->cpuid_level = 7;
93+ }
94+
95++ if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
96++ error_setg(&local_err,
97++ kvm_enabled() ?
98++ "Host doesn't support requested features" :
99++ "TCG doesn't support requested features");
100++ goto out;
101++ }
102++
103+ /* On AMD CPUs, some CPUID[8000_0001].EDX bits must match the bits on
104+ * CPUID[1].EDX.
105+ */
106+@@ -3166,14 +3174,6 @@ static void x86_cpu_realizefn(DeviceStat
107+ }
108+
109+
110+- if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
111+- error_setg(&local_err,
112+- kvm_enabled() ?
113+- "Host doesn't support requested features" :
114+- "TCG doesn't support requested features");
115+- goto out;
116+- }
117+-
118+ #ifndef CONFIG_USER_ONLY
119+ qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
120+
121diff --git a/debian/patches/series b/debian/patches/series
122index 4b12a37..0b7e586 100644
123--- a/debian/patches/series
124+++ b/debian/patches/series
125@@ -278,8 +278,10 @@ lp1765364/0024-ppc-spapr_caps-Don-t-disable-cap_cfpc-on-POWER8-by-d.patch
126 lp1765364/0025-missing-header.patch
127 CVE-2018-19489.patch
128 CVE-2019-6778.patch
129-#lp1823458/add-VirtIONet-vhost_stopped-flag-to-prevent-multiple.patch
130-#lp1823458/do-not-call-vhost_net_cleanup-on-running-net-from-ch.patch
131+lp1823458/add-VirtIONet-vhost_stopped-flag-to-prevent-multiple.patch
132+lp1823458/do-not-call-vhost_net_cleanup-on-running-net-from-ch.patch
133+lp1823458/lp1829380.patch
134 ubuntu/enable-md-clear.patch
135 CVE-2018-20815.patch
136 CVE-2019-9824.patch
137+lp1828288/target-i386-Set-AMD-alias-bits-after-filtering-CPUID.patch

Subscribers

People subscribed via source and target branches