Initial buildable RHEL 9 qemu-kvm based on RHEL 5.2.0 rc1

This commit is contained in:
Miroslav Rezanina 2020-11-13 14:09:35 +01:00
parent ae7540466f
commit 7de5fc2e49
75 changed files with 1256 additions and 7154 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@
/qemu-5.0.0-rc4.tar.xz
/qemu-5.0.0.tar.xz
/qemu-5.1.0.tar.xz
/qemu-5.2.0-rc1.tar.xz

View File

@ -1,4 +1,4 @@
From a71208a6b42d0ef657b2f712d2f08d2ed40e7094 Mon Sep 17 00:00:00 2001
From bd38ad15dd837dd3baa136334f667d8d63850ae0 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 29 Jul 2020 07:48:57 +0200
Subject: redhat: Adding slirp to the exploded tree
@ -48,79 +48,77 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Rebase notes (5.1.0-rc2):
- Update slirp directory to commit ce94eba2042d52a0ba3d9e252ebce86715e94275 (used upstream)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
.gitmodules | 3 -
slirp/.clang-format | 58 ++
slirp/.gitignore | 10 +
slirp/.gitlab-ci.yml | 27 +
slirp/.gitpublish | 3 +
slirp/CHANGELOG.md | 88 ++
slirp/CHANGELOG.md | 88 +++
slirp/COPYRIGHT | 62 ++
slirp/Makefile | 62 ++
slirp/README.md | 60 ++
slirp/build-aux/git-version-gen | 158 ++++
slirp/build-aux/meson-dist | 16 +
slirp/meson.build | 134 +++
slirp/src/arp_table.c | 92 ++
slirp/src/bootp.c | 369 ++++++++
slirp/src/bootp.h | 129 +++
slirp/src/cksum.c | 179 ++++
slirp/src/debug.h | 51 +
slirp/src/dhcpv6.c | 224 +++++
slirp/meson.build | 134 ++++
slirp/src/arp_table.c | 92 +++
slirp/src/bootp.c | 369 ++++++++++
slirp/src/bootp.h | 129 ++++
slirp/src/cksum.c | 179 +++++
slirp/src/debug.h | 51 ++
slirp/src/dhcpv6.c | 224 ++++++
slirp/src/dhcpv6.h | 68 ++
slirp/src/dnssearch.c | 306 ++++++
slirp/src/if.c | 213 +++++
slirp/src/dnssearch.c | 306 ++++++++
slirp/src/if.c | 213 ++++++
slirp/src/if.h | 25 +
slirp/src/ip.h | 242 +++++
slirp/src/ip6.h | 214 +++++
slirp/src/ip6_icmp.c | 433 +++++++++
slirp/src/ip6_icmp.h | 219 +++++
slirp/src/ip6_input.c | 85 ++
slirp/src/ip.h | 242 ++++++
slirp/src/ip6.h | 214 ++++++
slirp/src/ip6_icmp.c | 433 +++++++++++
slirp/src/ip6_icmp.h | 219 ++++++
slirp/src/ip6_input.c | 85 +++
slirp/src/ip6_output.c | 39 +
slirp/src/ip_icmp.c | 492 ++++++++++
slirp/src/ip_icmp.h | 166 ++++
slirp/src/ip_input.c | 461 +++++++++
slirp/src/ip_output.c | 169 ++++
slirp/src/ip_icmp.c | 492 +++++++++++++
slirp/src/ip_icmp.h | 166 +++++
slirp/src/ip_input.c | 461 ++++++++++++
slirp/src/ip_output.c | 169 +++++
slirp/src/libslirp-version.h.in | 24 +
slirp/src/libslirp.h | 171 ++++
slirp/src/libslirp.h | 171 +++++
slirp/src/libslirp.map | 30 +
slirp/src/main.h | 16 +
slirp/src/mbuf.c | 224 +++++
slirp/src/mbuf.h | 127 +++
slirp/src/misc.c | 390 ++++++++
slirp/src/mbuf.c | 224 ++++++
slirp/src/mbuf.h | 127 ++++
slirp/src/misc.c | 390 ++++++++++
slirp/src/misc.h | 72 ++
slirp/src/ncsi-pkt.h | 445 +++++++++
slirp/src/ncsi.c | 193 ++++
slirp/src/ndp_table.c | 87 ++
slirp/src/sbuf.c | 168 ++++
slirp/src/ncsi-pkt.h | 445 +++++++++++
slirp/src/ncsi.c | 193 +++++
slirp/src/ndp_table.c | 87 +++
slirp/src/sbuf.c | 168 +++++
slirp/src/sbuf.h | 27 +
slirp/src/slirp.c | 1185 ++++++++++++++++++++++++
slirp/src/slirp.h | 284 ++++++
slirp/src/socket.c | 954 +++++++++++++++++++
slirp/src/socket.h | 164 ++++
slirp/src/state.c | 379 ++++++++
slirp/src/slirp.c | 1185 ++++++++++++++++++++++++++++++
slirp/src/slirp.h | 284 ++++++++
slirp/src/socket.c | 954 ++++++++++++++++++++++++
slirp/src/socket.h | 164 +++++
slirp/src/state.c | 379 ++++++++++
slirp/src/stream.c | 120 +++
slirp/src/stream.h | 35 +
slirp/src/tcp.h | 169 ++++
slirp/src/tcp_input.c | 1539 +++++++++++++++++++++++++++++++
slirp/src/tcp_output.c | 516 +++++++++++
slirp/src/tcp_subr.c | 980 ++++++++++++++++++++
slirp/src/tcp_timer.c | 286 ++++++
slirp/src/tcp_timer.h | 130 +++
slirp/src/tcp.h | 169 +++++
slirp/src/tcp_input.c | 1539 +++++++++++++++++++++++++++++++++++++++
slirp/src/tcp_output.c | 516 +++++++++++++
slirp/src/tcp_subr.c | 980 +++++++++++++++++++++++++
slirp/src/tcp_timer.c | 286 ++++++++
slirp/src/tcp_timer.h | 130 ++++
slirp/src/tcp_var.h | 161 ++++
slirp/src/tcpip.h | 104 +++
slirp/src/tftp.c | 464 ++++++++++
slirp/src/tftp.c | 464 ++++++++++++
slirp/src/tftp.h | 54 ++
slirp/src/udp.c | 365 ++++++++
slirp/src/udp.h | 90 ++
slirp/src/udp6.c | 173 ++++
slirp/src/util.c | 428 +++++++++
slirp/src/util.h | 189 ++++
slirp/src/udp.c | 365 ++++++++++
slirp/src/udp.h | 90 +++
slirp/src/udp6.c | 173 +++++
slirp/src/util.c | 428 +++++++++++
slirp/src/util.h | 189 +++++
slirp/src/version.c | 8 +
slirp/src/vmstate.c | 444 +++++++++
slirp/src/vmstate.h | 391 ++++++++
slirp/src/vmstate.c | 444 +++++++++++
slirp/src/vmstate.h | 391 ++++++++++
70 files changed, 16440 insertions(+), 3 deletions(-)
create mode 100644 slirp/.clang-format
create mode 100644 slirp/.gitignore
@ -194,7 +192,7 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
diff --git a/slirp/.clang-format b/slirp/.clang-format
new file mode 100644
index 0000000000..17fb49fe65
index 0000000..17fb49f
--- /dev/null
+++ b/slirp/.clang-format
@@ -0,0 +1,58 @@
@ -258,7 +256,7 @@ index 0000000000..17fb49fe65
+...
diff --git a/slirp/CHANGELOG.md b/slirp/CHANGELOG.md
new file mode 100644
index 0000000000..67b0a74195
index 0000000..67b0a74
--- /dev/null
+++ b/slirp/CHANGELOG.md
@@ -0,0 +1,88 @@
@ -352,7 +350,7 @@ index 0000000000..67b0a74195
+[4.0.0]: https://gitlab.freedesktop.org/slirp/libslirp/commits/v4.0.0
diff --git a/slirp/COPYRIGHT b/slirp/COPYRIGHT
new file mode 100644
index 0000000000..ed49512dbc
index 0000000..ed49512
--- /dev/null
+++ b/slirp/COPYRIGHT
@@ -0,0 +1,62 @@
@ -420,7 +418,7 @@ index 0000000000..ed49512dbc
+copyrights.
diff --git a/slirp/Makefile b/slirp/Makefile
new file mode 100644
index 0000000000..8857b4159b
index 0000000..8857b41
--- /dev/null
+++ b/slirp/Makefile
@@ -0,0 +1,62 @@
@ -488,7 +486,7 @@ index 0000000000..8857b4159b
+-include $(DEPS)
diff --git a/slirp/README.md b/slirp/README.md
new file mode 100644
index 0000000000..dc11e5f18b
index 0000000..dc11e5f
--- /dev/null
+++ b/slirp/README.md
@@ -0,0 +1,60 @@
@ -554,7 +552,7 @@ index 0000000000..dc11e5f18b
+See the [COPYRIGHT](COPYRIGHT) file for details.
diff --git a/slirp/build-aux/git-version-gen b/slirp/build-aux/git-version-gen
new file mode 100755
index 0000000000..5617eb8d4e
index 0000000..5617eb8
--- /dev/null
+++ b/slirp/build-aux/git-version-gen
@@ -0,0 +1,158 @@
@ -718,7 +716,7 @@ index 0000000000..5617eb8d4e
+# End:
diff --git a/slirp/build-aux/meson-dist b/slirp/build-aux/meson-dist
new file mode 100755
index 0000000000..80d534fec6
index 0000000..80d534f
--- /dev/null
+++ b/slirp/build-aux/meson-dist
@@ -0,0 +1,16 @@
@ -740,7 +738,7 @@ index 0000000000..80d534fec6
+echo "$1" > "$MESON_DIST_ROOT/.tarball-version"
diff --git a/slirp/meson.build b/slirp/meson.build
new file mode 100644
index 0000000000..3a27149373
index 0000000..3a27149
--- /dev/null
+++ b/slirp/meson.build
@@ -0,0 +1,134 @@
@ -880,7 +878,7 @@ index 0000000000..3a27149373
+)
diff --git a/slirp/src/arp_table.c b/slirp/src/arp_table.c
new file mode 100644
index 0000000000..959e5b9ec0
index 0000000..959e5b9
--- /dev/null
+++ b/slirp/src/arp_table.c
@@ -0,0 +1,92 @@
@ -978,7 +976,7 @@ index 0000000000..959e5b9ec0
+}
diff --git a/slirp/src/bootp.c b/slirp/src/bootp.c
new file mode 100644
index 0000000000..46e96810ab
index 0000000..46e9681
--- /dev/null
+++ b/slirp/src/bootp.c
@@ -0,0 +1,369 @@
@ -1353,7 +1351,7 @@ index 0000000000..46e96810ab
+}
diff --git a/slirp/src/bootp.h b/slirp/src/bootp.h
new file mode 100644
index 0000000000..a57fa51bcb
index 0000000..a57fa51
--- /dev/null
+++ b/slirp/src/bootp.h
@@ -0,0 +1,129 @@
@ -1488,7 +1486,7 @@ index 0000000000..a57fa51bcb
+#endif
diff --git a/slirp/src/cksum.c b/slirp/src/cksum.c
new file mode 100644
index 0000000000..4d08380a4e
index 0000000..4d08380
--- /dev/null
+++ b/slirp/src/cksum.c
@@ -0,0 +1,179 @@
@ -1673,7 +1671,7 @@ index 0000000000..4d08380a4e
+}
diff --git a/slirp/src/debug.h b/slirp/src/debug.h
new file mode 100644
index 0000000000..47712bd78b
index 0000000..47712bd
--- /dev/null
+++ b/slirp/src/debug.h
@@ -0,0 +1,51 @@
@ -1730,7 +1728,7 @@ index 0000000000..47712bd78b
+#endif /* DEBUG_H_ */
diff --git a/slirp/src/dhcpv6.c b/slirp/src/dhcpv6.c
new file mode 100644
index 0000000000..77b451b910
index 0000000..77b451b
--- /dev/null
+++ b/slirp/src/dhcpv6.c
@@ -0,0 +1,224 @@
@ -1960,7 +1958,7 @@ index 0000000000..77b451b910
+}
diff --git a/slirp/src/dhcpv6.h b/slirp/src/dhcpv6.h
new file mode 100644
index 0000000000..d12c49b36c
index 0000000..d12c49b
--- /dev/null
+++ b/slirp/src/dhcpv6.h
@@ -0,0 +1,68 @@
@ -2034,7 +2032,7 @@ index 0000000000..d12c49b36c
+#endif
diff --git a/slirp/src/dnssearch.c b/slirp/src/dnssearch.c
new file mode 100644
index 0000000000..55497e860e
index 0000000..55497e8
--- /dev/null
+++ b/slirp/src/dnssearch.c
@@ -0,0 +1,306 @@
@ -2346,7 +2344,7 @@ index 0000000000..55497e860e
+}
diff --git a/slirp/src/if.c b/slirp/src/if.c
new file mode 100644
index 0000000000..23190b5593
index 0000000..23190b5
--- /dev/null
+++ b/slirp/src/if.c
@@ -0,0 +1,213 @@
@ -2565,7 +2563,7 @@ index 0000000000..23190b5593
+}
diff --git a/slirp/src/if.h b/slirp/src/if.h
new file mode 100644
index 0000000000..7cf9d2750e
index 0000000..7cf9d27
--- /dev/null
+++ b/slirp/src/if.h
@@ -0,0 +1,25 @@
@ -2596,7 +2594,7 @@ index 0000000000..7cf9d2750e
+#endif
diff --git a/slirp/src/ip.h b/slirp/src/ip.h
new file mode 100644
index 0000000000..e5d4aa8a6d
index 0000000..e5d4aa8
--- /dev/null
+++ b/slirp/src/ip.h
@@ -0,0 +1,242 @@
@ -2844,7 +2842,7 @@ index 0000000000..e5d4aa8a6d
+#endif
diff --git a/slirp/src/ip6.h b/slirp/src/ip6.h
new file mode 100644
index 0000000000..0630309d29
index 0000000..0630309
--- /dev/null
+++ b/slirp/src/ip6.h
@@ -0,0 +1,214 @@
@ -3064,7 +3062,7 @@ index 0000000000..0630309d29
+#endif
diff --git a/slirp/src/ip6_icmp.c b/slirp/src/ip6_icmp.c
new file mode 100644
index 0000000000..d9c872bc97
index 0000000..d9c872b
--- /dev/null
+++ b/slirp/src/ip6_icmp.c
@@ -0,0 +1,433 @@
@ -3503,7 +3501,7 @@ index 0000000000..d9c872bc97
+}
diff --git a/slirp/src/ip6_icmp.h b/slirp/src/ip6_icmp.h
new file mode 100644
index 0000000000..c37e60f28d
index 0000000..c37e60f
--- /dev/null
+++ b/slirp/src/ip6_icmp.h
@@ -0,0 +1,219 @@
@ -3728,7 +3726,7 @@ index 0000000000..c37e60f28d
+#endif
diff --git a/slirp/src/ip6_input.c b/slirp/src/ip6_input.c
new file mode 100644
index 0000000000..a83e4f8e3d
index 0000000..a83e4f8
--- /dev/null
+++ b/slirp/src/ip6_input.c
@@ -0,0 +1,85 @@
@ -3819,7 +3817,7 @@ index 0000000000..a83e4f8e3d
+}
diff --git a/slirp/src/ip6_output.c b/slirp/src/ip6_output.c
new file mode 100644
index 0000000000..b86110662c
index 0000000..b861106
--- /dev/null
+++ b/slirp/src/ip6_output.c
@@ -0,0 +1,39 @@
@ -3864,7 +3862,7 @@ index 0000000000..b86110662c
+}
diff --git a/slirp/src/ip_icmp.c b/slirp/src/ip_icmp.c
new file mode 100644
index 0000000000..13a0e55085
index 0000000..13a0e55
--- /dev/null
+++ b/slirp/src/ip_icmp.c
@@ -0,0 +1,492 @@
@ -4362,7 +4360,7 @@ index 0000000000..13a0e55085
+}
diff --git a/slirp/src/ip_icmp.h b/slirp/src/ip_icmp.h
new file mode 100644
index 0000000000..84707db247
index 0000000..84707db
--- /dev/null
+++ b/slirp/src/ip_icmp.h
@@ -0,0 +1,166 @@
@ -4534,7 +4532,7 @@ index 0000000000..84707db247
+#endif
diff --git a/slirp/src/ip_input.c b/slirp/src/ip_input.c
new file mode 100644
index 0000000000..7f017a238a
index 0000000..7f017a2
--- /dev/null
+++ b/slirp/src/ip_input.c
@@ -0,0 +1,461 @@
@ -5001,7 +4999,7 @@ index 0000000000..7f017a238a
+}
diff --git a/slirp/src/ip_output.c b/slirp/src/ip_output.c
new file mode 100644
index 0000000000..22916a37df
index 0000000..22916a3
--- /dev/null
+++ b/slirp/src/ip_output.c
@@ -0,0 +1,169 @@
@ -5176,7 +5174,7 @@ index 0000000000..22916a37df
+}
diff --git a/slirp/src/libslirp-version.h.in b/slirp/src/libslirp-version.h.in
new file mode 100644
index 0000000000..faa6c85952
index 0000000..faa6c85
--- /dev/null
+++ b/slirp/src/libslirp-version.h.in
@@ -0,0 +1,24 @@
@ -5206,7 +5204,7 @@ index 0000000000..faa6c85952
+#endif /* LIBSLIRP_VERSION_H_ */
diff --git a/slirp/src/libslirp.h b/slirp/src/libslirp.h
new file mode 100644
index 0000000000..fb4c7e882c
index 0000000..fb4c7e8
--- /dev/null
+++ b/slirp/src/libslirp.h
@@ -0,0 +1,171 @@
@ -5383,7 +5381,7 @@ index 0000000000..fb4c7e882c
+#endif /* LIBSLIRP_H */
diff --git a/slirp/src/libslirp.map b/slirp/src/libslirp.map
new file mode 100644
index 0000000000..72aab912f4
index 0000000..72aab91
--- /dev/null
+++ b/slirp/src/libslirp.map
@@ -0,0 +1,30 @@
@ -5419,7 +5417,7 @@ index 0000000000..72aab912f4
+} SLIRP_4.1;
diff --git a/slirp/src/main.h b/slirp/src/main.h
new file mode 100644
index 0000000000..3b3f883703
index 0000000..3b3f883
--- /dev/null
+++ b/slirp/src/main.h
@@ -0,0 +1,16 @@
@ -5441,7 +5439,7 @@ index 0000000000..3b3f883703
+#endif
diff --git a/slirp/src/mbuf.c b/slirp/src/mbuf.c
new file mode 100644
index 0000000000..54ec721eb5
index 0000000..54ec721
--- /dev/null
+++ b/slirp/src/mbuf.c
@@ -0,0 +1,224 @@
@ -5671,7 +5669,7 @@ index 0000000000..54ec721eb5
+}
diff --git a/slirp/src/mbuf.h b/slirp/src/mbuf.h
new file mode 100644
index 0000000000..546e7852c5
index 0000000..546e785
--- /dev/null
+++ b/slirp/src/mbuf.h
@@ -0,0 +1,127 @@
@ -5804,7 +5802,7 @@ index 0000000000..546e7852c5
+#endif
diff --git a/slirp/src/misc.c b/slirp/src/misc.c
new file mode 100644
index 0000000000..e6bc0a207d
index 0000000..e6bc0a2
--- /dev/null
+++ b/slirp/src/misc.c
@@ -0,0 +1,390 @@
@ -6201,7 +6199,7 @@ index 0000000000..e6bc0a207d
\ No newline at end of file
diff --git a/slirp/src/misc.h b/slirp/src/misc.h
new file mode 100644
index 0000000000..81b370cfb1
index 0000000..81b370c
--- /dev/null
+++ b/slirp/src/misc.h
@@ -0,0 +1,72 @@
@ -6279,7 +6277,7 @@ index 0000000000..81b370cfb1
+#endif
diff --git a/slirp/src/ncsi-pkt.h b/slirp/src/ncsi-pkt.h
new file mode 100644
index 0000000000..7795ad83ee
index 0000000..7795ad8
--- /dev/null
+++ b/slirp/src/ncsi-pkt.h
@@ -0,0 +1,445 @@
@ -6730,7 +6728,7 @@ index 0000000000..7795ad83ee
+#endif /* NCSI_PKT_H */
diff --git a/slirp/src/ncsi.c b/slirp/src/ncsi.c
new file mode 100644
index 0000000000..3c1dfef1ff
index 0000000..3c1dfef
--- /dev/null
+++ b/slirp/src/ncsi.c
@@ -0,0 +1,193 @@
@ -6929,7 +6927,7 @@ index 0000000000..3c1dfef1ff
+}
diff --git a/slirp/src/ndp_table.c b/slirp/src/ndp_table.c
new file mode 100644
index 0000000000..110d6ea0e4
index 0000000..110d6ea
--- /dev/null
+++ b/slirp/src/ndp_table.c
@@ -0,0 +1,87 @@
@ -7022,7 +7020,7 @@ index 0000000000..110d6ea0e4
+}
diff --git a/slirp/src/sbuf.c b/slirp/src/sbuf.c
new file mode 100644
index 0000000000..2fb9176144
index 0000000..2fb9176
--- /dev/null
+++ b/slirp/src/sbuf.c
@@ -0,0 +1,168 @@
@ -7196,7 +7194,7 @@ index 0000000000..2fb9176144
+}
diff --git a/slirp/src/sbuf.h b/slirp/src/sbuf.h
new file mode 100644
index 0000000000..01886fbd01
index 0000000..01886fb
--- /dev/null
+++ b/slirp/src/sbuf.h
@@ -0,0 +1,27 @@
@ -7229,7 +7227,7 @@ index 0000000000..01886fbd01
+#endif
diff --git a/slirp/src/slirp.c b/slirp/src/slirp.c
new file mode 100644
index 0000000000..dba7c98163
index 0000000..dba7c98
--- /dev/null
+++ b/slirp/src/slirp.c
@@ -0,0 +1,1185 @@
@ -8420,7 +8418,7 @@ index 0000000000..dba7c98163
+}
diff --git a/slirp/src/slirp.h b/slirp/src/slirp.h
new file mode 100644
index 0000000000..763a65b9ef
index 0000000..763a65b
--- /dev/null
+++ b/slirp/src/slirp.h
@@ -0,0 +1,284 @@
@ -8710,7 +8708,7 @@ index 0000000000..763a65b9ef
+#endif
diff --git a/slirp/src/socket.c b/slirp/src/socket.c
new file mode 100644
index 0000000000..1e385df0d8
index 0000000..1e385df
--- /dev/null
+++ b/slirp/src/socket.c
@@ -0,0 +1,954 @@
@ -9670,7 +9668,7 @@ index 0000000000..1e385df0d8
+}
diff --git a/slirp/src/socket.h b/slirp/src/socket.h
new file mode 100644
index 0000000000..a6a1e5e214
index 0000000..a6a1e5e
--- /dev/null
+++ b/slirp/src/socket.h
@@ -0,0 +1,164 @@
@ -9840,7 +9838,7 @@ index 0000000000..a6a1e5e214
+#endif /* SLIRP_SOCKET_H */
diff --git a/slirp/src/state.c b/slirp/src/state.c
new file mode 100644
index 0000000000..22af77b256
index 0000000..22af77b
--- /dev/null
+++ b/slirp/src/state.c
@@ -0,0 +1,379 @@
@ -10225,7 +10223,7 @@ index 0000000000..22af77b256
+}
diff --git a/slirp/src/stream.c b/slirp/src/stream.c
new file mode 100644
index 0000000000..6cf326f669
index 0000000..6cf326f
--- /dev/null
+++ b/slirp/src/stream.c
@@ -0,0 +1,120 @@
@ -10351,7 +10349,7 @@ index 0000000000..6cf326f669
+}
diff --git a/slirp/src/stream.h b/slirp/src/stream.h
new file mode 100644
index 0000000000..08bb5b6610
index 0000000..08bb5b6
--- /dev/null
+++ b/slirp/src/stream.h
@@ -0,0 +1,35 @@
@ -10392,7 +10390,7 @@ index 0000000000..08bb5b6610
+#endif /* STREAM_H_ */
diff --git a/slirp/src/tcp.h b/slirp/src/tcp.h
new file mode 100644
index 0000000000..70a9760664
index 0000000..70a9760
--- /dev/null
+++ b/slirp/src/tcp.h
@@ -0,0 +1,169 @@
@ -10567,7 +10565,7 @@ index 0000000000..70a9760664
+#endif
diff --git a/slirp/src/tcp_input.c b/slirp/src/tcp_input.c
new file mode 100644
index 0000000000..d55b0c81dc
index 0000000..d55b0c8
--- /dev/null
+++ b/slirp/src/tcp_input.c
@@ -0,0 +1,1539 @@
@ -12112,7 +12110,7 @@ index 0000000000..d55b0c81dc
+}
diff --git a/slirp/src/tcp_output.c b/slirp/src/tcp_output.c
new file mode 100644
index 0000000000..383fe31dcf
index 0000000..383fe31
--- /dev/null
+++ b/slirp/src/tcp_output.c
@@ -0,0 +1,516 @@
@ -12634,7 +12632,7 @@ index 0000000000..383fe31dcf
+}
diff --git a/slirp/src/tcp_subr.c b/slirp/src/tcp_subr.c
new file mode 100644
index 0000000000..a1016d90df
index 0000000..a1016d9
--- /dev/null
+++ b/slirp/src/tcp_subr.c
@@ -0,0 +1,980 @@
@ -13620,7 +13618,7 @@ index 0000000000..a1016d90df
+}
diff --git a/slirp/src/tcp_timer.c b/slirp/src/tcp_timer.c
new file mode 100644
index 0000000000..102023e7cd
index 0000000..102023e
--- /dev/null
+++ b/slirp/src/tcp_timer.c
@@ -0,0 +1,286 @@
@ -13912,7 +13910,7 @@ index 0000000000..102023e7cd
+}
diff --git a/slirp/src/tcp_timer.h b/slirp/src/tcp_timer.h
new file mode 100644
index 0000000000..584a5594e4
index 0000000..584a559
--- /dev/null
+++ b/slirp/src/tcp_timer.h
@@ -0,0 +1,130 @@
@ -14048,7 +14046,7 @@ index 0000000000..584a5594e4
+#endif
diff --git a/slirp/src/tcp_var.h b/slirp/src/tcp_var.h
new file mode 100644
index 0000000000..c8da8cbd16
index 0000000..c8da8cb
--- /dev/null
+++ b/slirp/src/tcp_var.h
@@ -0,0 +1,161 @@
@ -14215,7 +14213,7 @@ index 0000000000..c8da8cbd16
+#endif
diff --git a/slirp/src/tcpip.h b/slirp/src/tcpip.h
new file mode 100644
index 0000000000..d3df021493
index 0000000..d3df021
--- /dev/null
+++ b/slirp/src/tcpip.h
@@ -0,0 +1,104 @@
@ -14325,7 +14323,7 @@ index 0000000000..d3df021493
+#endif
diff --git a/slirp/src/tftp.c b/slirp/src/tftp.c
new file mode 100644
index 0000000000..c6950ee10f
index 0000000..c6950ee
--- /dev/null
+++ b/slirp/src/tftp.c
@@ -0,0 +1,464 @@
@ -14795,7 +14793,7 @@ index 0000000000..c6950ee10f
+}
diff --git a/slirp/src/tftp.h b/slirp/src/tftp.h
new file mode 100644
index 0000000000..6d75478e83
index 0000000..6d75478
--- /dev/null
+++ b/slirp/src/tftp.h
@@ -0,0 +1,54 @@
@ -14855,7 +14853,7 @@ index 0000000000..6d75478e83
+#endif
diff --git a/slirp/src/udp.c b/slirp/src/udp.c
new file mode 100644
index 0000000000..0ad44d7c03
index 0000000..0ad44d7
--- /dev/null
+++ b/slirp/src/udp.c
@@ -0,0 +1,365 @@
@ -15226,7 +15224,7 @@ index 0000000000..0ad44d7c03
+}
diff --git a/slirp/src/udp.h b/slirp/src/udp.h
new file mode 100644
index 0000000000..c3b83fdc56
index 0000000..c3b83fd
--- /dev/null
+++ b/slirp/src/udp.h
@@ -0,0 +1,90 @@
@ -15322,7 +15320,7 @@ index 0000000000..c3b83fdc56
+#endif
diff --git a/slirp/src/udp6.c b/slirp/src/udp6.c
new file mode 100644
index 0000000000..6f9486bbca
index 0000000..6f9486b
--- /dev/null
+++ b/slirp/src/udp6.c
@@ -0,0 +1,173 @@
@ -15501,7 +15499,7 @@ index 0000000000..6f9486bbca
+}
diff --git a/slirp/src/util.c b/slirp/src/util.c
new file mode 100644
index 0000000000..d3ed5faf8b
index 0000000..d3ed5fa
--- /dev/null
+++ b/slirp/src/util.c
@@ -0,0 +1,428 @@
@ -15935,7 +15933,7 @@ index 0000000000..d3ed5faf8b
+}
diff --git a/slirp/src/util.h b/slirp/src/util.h
new file mode 100644
index 0000000000..d67b3d0de9
index 0000000..d67b3d0
--- /dev/null
+++ b/slirp/src/util.h
@@ -0,0 +1,189 @@
@ -16130,7 +16128,7 @@ index 0000000000..d67b3d0de9
+#endif
diff --git a/slirp/src/version.c b/slirp/src/version.c
new file mode 100644
index 0000000000..93e0be9c24
index 0000000..93e0be9
--- /dev/null
+++ b/slirp/src/version.c
@@ -0,0 +1,8 @@
@ -16144,7 +16142,7 @@ index 0000000000..93e0be9c24
+}
diff --git a/slirp/src/vmstate.c b/slirp/src/vmstate.c
new file mode 100644
index 0000000000..68cc1729c5
index 0000000..68cc172
--- /dev/null
+++ b/slirp/src/vmstate.c
@@ -0,0 +1,444 @@
@ -16594,7 +16592,7 @@ index 0000000000..68cc1729c5
+}
diff --git a/slirp/src/vmstate.h b/slirp/src/vmstate.h
new file mode 100644
index 0000000000..94c6a4bc7b
index 0000000..94c6a4b
--- /dev/null
+++ b/slirp/src/vmstate.h
@@ -0,0 +1,391 @@
@ -16990,5 +16988,5 @@ index 0000000000..94c6a4bc7b
+
+#endif
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From cf7532e0c854b385ee7acdf5788bc407172f7ae9 Mon Sep 17 00:00:00 2001
From 788398591901ece77695d73db0e392ce2c357636 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 12 Oct 2018 07:31:11 +0200
Subject: Initial redhat build
@ -11,7 +11,7 @@ several issues are fixed in QEMU tree:
- Man page renamed from qemu to qemu-kvm
- man page is installed using make install so we have to fix it in qemu tree
This rebase includes changes up to qemu-kvm-4.2.0-29.el8
This rebase includes changes up to qemu-kvm-5.1.0-14.el8
Rebase notes (3.1.0):
- added new configure options
@ -66,6 +66,21 @@ Rebase notes (5.1.0):
- bumped required libusbx-devel version to 1.0.23
- bumped libfdt version to 1.6.0
Rebase notes (5.2.0 rc0):
- Move libfdt dependency to qemu-kvm-core
- Move manpage rename from Makefile to spec file
- rename with-confsuffix configure option to with-suffix (upstream)
- Bump libusbx Requires version to 1.0.234
- Manual copy of keymaps in spec file (BZ 1875217)
- Removed /usr/share/qemu-kvm/npcm7xx_bootrom.bin, considering it
unpackaged for now.
- Removed /usr/share/qemu-kvm/qboot.rom, considering unpackaged.
- Added build dependency for meson and ninja-build
- hw/s390/s390-pci-vfio.c hack - set NULL for g_autofree variables
- Removed Chanelog (upstream)
- Fix in directory used for docs (upstream add %name so we do not pass it in configure)
- Package various .so as part of qemu-kvm-core package.
Merged patches (3.1.0):
- 01f0c9f RHEL8: Add disable configure options to qemu spec file
- Spec file cleanups
@ -95,64 +110,191 @@ Merged patches (5.1.0):
- 9b1e140 redhat: updating the modular target
- 44b8bd0 spec: Fix python shenigans for tests
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- 9238ce7 Add support for simpletrace
- 5797cff Remove explicit glusterfs-api dependency
- fd62478 disable virgl
- 0205018 redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/
- 3645097 redhat: Make all generated so files executable (not only block-*)
---
.gitignore | 1 +
Makefile | 3 +-
configure | 1 +
redhat/Makefile | 86 +
redhat/Makefile.common | 54 +
redhat/README.tests | 39 +
redhat/qemu-kvm.spec.template | 2977 +++++++++++++++++++++++++++
redhat/qemu-pr-helper.service | 2 +-
redhat/scripts/extract_build_cmd.py | 2 +-
redhat/scripts/process-patches.sh | 17 +-
tests/check-block.sh | 2 +
ui/vnc.c | 2 +-
12 files changed, 3173 insertions(+), 13 deletions(-)
.gitignore | 1 +
README.systemtap | 43 +
crypto/meson.build | 1 -
hw/s390x/s390-pci-vfio.c | 4 +-
meson.build | 10 +-
redhat/Makefile | 90 +
redhat/Makefile.common | 53 +
redhat/README.tests | 39 +
redhat/qemu-kvm.spec.template | 3170 +++++++++++++++++++++++++++++++
redhat/scripts/extract_build_cmd.py | 2 +-
redhat/scripts/process-patches.sh | 17 +-
scripts/qemu-guest-agent/fsfreeze-hook | 2 +-
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
tests/check-block.sh | 2 +
ui/vnc.c | 2 +-
16 files changed, 3424 insertions(+), 17 deletions(-)
create mode 100644 README.systemtap
create mode 100644 redhat/Makefile
create mode 100644 redhat/Makefile.common
create mode 100644 redhat/README.tests
create mode 100644 redhat/qemu-kvm.spec.template
create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf
create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp
diff --git a/Makefile b/Makefile
index 13dd708c4a..42e854b2b1 100644
--- a/Makefile
+++ b/Makefile
@@ -549,6 +549,7 @@ CAP_CFLAGS += -DCAPSTONE_HAS_ARM
CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
CAP_CFLAGS += -DCAPSTONE_HAS_X86
+CAP_CFLAGS += -Wp,-D_GLIBCXX_ASSERTIONS
.PHONY: capstone/all
capstone/all: .git-submodule-status
@@ -879,7 +880,7 @@ install-doc: $(DOCS) install-sphinxdocs
$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
ifdef CONFIG_POSIX
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
- $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1/qemu-kvm.1"
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
$(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
diff --git a/configure b/configure
index 2acc4d1465..eb5b695dbe 100755
--- a/configure
+++ b/configure
@@ -2633,6 +2633,7 @@ if test "$seccomp" != "no" ; then
seccomp="no"
fi
fi
diff --git a/README.systemtap b/README.systemtap
new file mode 100644
index 0000000..ad913fc
--- /dev/null
+++ b/README.systemtap
@@ -0,0 +1,43 @@
+QEMU tracing using systemtap-initscript
+---------------------------------------
+
##########################################
# xen probe
+You can capture QEMU trace data all the time using systemtap-initscript. This
+uses SystemTap's flight recorder mode to trace all running guests to a
+fixed-size buffer on the host. Old trace entries are overwritten by new
+entries when the buffer size wraps.
+
+1. Install the systemtap-initscript package:
+ # yum install systemtap-initscript
+
+2. Install the systemtap scripts and the conf file:
+ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/
+ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/
+
+The set of trace events to enable is given in qemu_kvm.stp. This SystemTap
+script can be customized to add or remove trace events provided in
+/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp.
+
+SystemTap customizations can be made to qemu_kvm.conf to control the flight
+recorder buffer size and whether to store traces in memory only or disk too.
+See stap(1) for option documentation.
+
+3. Start the systemtap service.
+ # service systemtap start qemu_kvm
+
+4. Make the service start at boot time.
+ # chkconfig systemtap on
+
+5. Confirm that the service works.
+ # service systemtap status qemu_kvm
+ qemu_kvm is running...
+
+When you want to inspect the trace buffer, perform the following steps:
+
+1. Dump the trace buffer.
+ # staprun -A qemu_kvm >/tmp/trace.log
+
+2. Start the systemtap service because the preceding step stops the service.
+ # service systemtap start qemu_kvm
+
+3. Translate the trace record to readable format.
+ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log
diff --git a/crypto/meson.build b/crypto/meson.build
index 7f37b5d..e30efb8 100644
--- a/crypto/meson.build
+++ b/crypto/meson.build
@@ -50,7 +50,6 @@ if 'CONFIG_GNUTLS' in config_host
crypto_ss.add(gnutls)
endif
-
util_ss.add(files('aes.c'))
util_ss.add(files('init.c'))
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
index d5c7806..19f92eb 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -28,7 +28,7 @@
*/
bool s390_pci_update_dma_avail(int fd, unsigned int *avail)
{
- g_autofree struct vfio_iommu_type1_info *info;
+ g_autofree struct vfio_iommu_type1_info *info = NULL;
uint32_t argsz;
assert(avail);
@@ -229,7 +229,7 @@ static void s390_pci_read_pfip(S390PCIBusDevice *pbdev,
*/
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
{
- g_autofree struct vfio_device_info *info;
+ g_autofree struct vfio_device_info *info = NULL;
VFIOPCIDevice *vfio_pci;
uint32_t argsz;
int fd;
diff --git a/meson.build b/meson.build
index b473620..3636fb9 100644
--- a/meson.build
+++ b/meson.build
@@ -292,6 +292,10 @@ if 'CONFIG_GNUTLS' in config_host
gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
link_args: config_host['GNUTLS_LIBS'].split())
endif
+gcrypt = not_found
+if 'CONFIG_GCRYPT' in config_host
+ gcrypt = dependency('libgcrypt')
+endif
pixman = not_found
if have_system or have_tools
pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
@@ -1123,7 +1127,9 @@ if capstone_opt == 'internal'
# Include all configuration defines via a header file, which will wind up
# as a dependency on the object file, and thus changes here will result
# in a rebuild.
- '-include', 'capstone-defs.h'
+ '-include', 'capstone-defs.h',
+
+ '-Wp,-D_GLIBCXX_ASSERTIONS',
]
libcapstone = static_library('capstone',
@@ -1641,7 +1647,7 @@ libblock = static_library('block', block_ss.sources() + genh,
block = declare_dependency(link_whole: [libblock],
link_args: '@block.syms',
- dependencies: [crypto, io])
+ dependencies: [crypto, io, zlib])
blockdev_ss = blockdev_ss.apply(config_host, strict: false)
libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook
index 13aafd4..e9b84ec 100755
--- a/scripts/qemu-guest-agent/fsfreeze-hook
+++ b/scripts/qemu-guest-agent/fsfreeze-hook
@@ -8,7 +8,7 @@
# request, it is issued with "thaw" argument after filesystem is thawed.
LOGFILE=/var/log/qga-fsfreeze-hook.log
-FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d
+FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d
# Check whether file $1 is a backup or rpm-generated file and should be ignored
is_ignored_file() {
diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf
new file mode 100644
index 0000000..372d816
--- /dev/null
+++ b/scripts/systemtap/conf.d/qemu_kvm.conf
@@ -0,0 +1,4 @@
+# Force load uprobes (see BZ#1118352)
+stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true
+
+qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes
diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp
new file mode 100644
index 0000000..c04abf9
--- /dev/null
+++ b/scripts/systemtap/script.d/qemu_kvm.stp
@@ -0,0 +1 @@
+probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {}
diff --git a/tests/check-block.sh b/tests/check-block.sh
index 8e29c868e5..e9bcb5ac27 100755
index f6b1bda..645b550 100755
--- a/tests/check-block.sh
+++ b/tests/check-block.sh
@@ -53,6 +53,8 @@ if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
@@ -58,6 +58,8 @@ if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
fi
fi
@ -160,12 +302,12 @@ index 8e29c868e5..e9bcb5ac27 100755
+
cd tests/qemu-iotests
ret=0
# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
diff --git a/ui/vnc.c b/ui/vnc.c
index f006aa1afd..992f428fec 100644
index 4923505..eb5520e 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3970,7 +3970,7 @@ void vnc_display_open(const char *id, Error **errp)
@@ -3982,7 +3982,7 @@ void vnc_display_open(const char *id, Error **errp)
#ifdef CONFIG_VNC_SASL
if (sasl) {
@ -175,5 +317,5 @@ index f006aa1afd..992f428fec 100644
if (saslErr != SASL_OK) {
error_setg(errp, "Failed to initialize SASL auth: %s",
--
2.27.0
1.8.3.1

View File

@ -1,6 +1,6 @@
From 3c93dbb29fed4f555904494efe9b823310a14604 Mon Sep 17 00:00:00 2001
From 65eea220dcce6177b306eae08935f5354847bb08 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Mon, 11 Jan 2016 11:53:33 +0100
Date: Wed, 2 Sep 2020 09:11:07 +0200
Subject: Enable/disable devices for RHEL
This commit adds all changes related to changes in supported devices.
@ -47,6 +47,15 @@ Rebase notes (5.1.0):
- removed obsolete hw/bt/Makefile.objs chunk
- removed unnecessary changes in target/i386/cpu.c
Rebase notes (5.2.0 rc0):
- Added CONFIG_USB_XHCI_PCI on aarch64 ppc64 and x86_64
- remove vl.c hack for no hpet
- Enable CONFIG_PTIMER for aarch64
- Do not package hw-display-virtio-gpu.so on s390x
Rebase notes (5.2.0 rc1):
- Added CONFIG_ARM_GIC for aarch64 (required for build)
Merged patches (qemu 3.1.0):
- d51e082 Re-enable CONFIG_HYPERV_TESTDEV
- 4b889f3 Declare cirrus-vga as deprecated
@ -65,58 +74,62 @@ Merged patches (4.1.0):
Merged patches (4.2.0):
- f7587dd RHEL: disable hostmem-memfd
Merged patches (weekly-5.1.0):
Merged patches (5.1.0):
- 4543a3c i386: Remove cpu64-rhel6 CPU model
- 96533 aarch64: Remove tcg cpu types (pjw commit)
- 559d589 Revert "RHEL: disable hostmem-memfd"
- 441128e enable ramfb
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- f70eb50 RHEL-only: Enable vTPM for POWER in downstream configs
- 69d8ae7 redhat: fix 5.0 rebase missing ISA TPM TIS
- 8310f89 RHEL-only: Enable vTPM for ARM in downstream configs
- 4a8ccfd Disable TPM passthrough backend on ARM
---
default-configs/aarch64-rh-devices.mak | 22 ++++++
default-configs/aarch64-softmmu.mak | 10 ++-
default-configs/ppc64-rh-devices.mak | 34 +++++++++
default-configs/ppc64-softmmu.mak | 10 ++-
default-configs/rh-virtio.mak | 10 +++
default-configs/s390x-rh-devices.mak | 15 ++++
default-configs/s390x-softmmu.mak | 4 +-
default-configs/x86_64-rh-devices.mak | 100 +++++++++++++++++++++++++
default-configs/x86_64-softmmu.mak | 4 +-
hw/acpi/ich9.c | 4 +-
hw/arm/Makefile.objs | 2 +-
hw/block/fdc.c | 10 +++
hw/cpu/Makefile.objs | 5 +-
hw/display/cirrus_vga.c | 3 +
hw/ide/piix.c | 5 +-
hw/input/pckbd.c | 2 +
hw/net/e1000.c | 2 +
hw/ppc/spapr_cpu_core.c | 2 +
hw/usb/Makefile.objs | 4 +-
qemu-options.hx | 4 -
redhat/qemu-kvm.spec.template | 5 +-
softmmu/vl.c | 2 +-
target/arm/cpu.c | 4 +-
target/arm/cpu_tcg.c | 3 +
target/i386/cpu.c | 1 +
target/ppc/cpu-models.c | 10 +++
target/s390x/cpu_models.c | 3 +
target/s390x/kvm.c | 8 ++
28 files changed, 263 insertions(+), 25 deletions(-)
create mode 100644 default-configs/aarch64-rh-devices.mak
create mode 100644 default-configs/ppc64-rh-devices.mak
create mode 100644 default-configs/rh-virtio.mak
create mode 100644 default-configs/s390x-rh-devices.mak
create mode 100644 default-configs/x86_64-rh-devices.mak
default-configs/devices/aarch64-rh-devices.mak | 27 +++++++
default-configs/devices/aarch64-softmmu.mak | 10 ++-
default-configs/devices/ppc64-rh-devices.mak | 38 ++++++++++
default-configs/devices/ppc64-softmmu.mak | 10 ++-
default-configs/devices/rh-virtio.mak | 10 +++
default-configs/devices/s390x-rh-devices.mak | 15 ++++
default-configs/devices/s390x-softmmu.mak | 4 +-
default-configs/devices/x86_64-rh-devices.mak | 101 +++++++++++++++++++++++++
default-configs/devices/x86_64-softmmu.mak | 4 +-
hw/acpi/ich9.c | 4 +-
hw/arm/meson.build | 2 +-
hw/block/fdc.c | 10 +++
hw/cpu/meson.build | 5 +-
hw/display/cirrus_vga.c | 3 +
hw/ide/piix.c | 5 +-
hw/input/pckbd.c | 2 +
hw/net/e1000.c | 2 +
hw/ppc/spapr_cpu_core.c | 2 +
hw/usb/meson.build | 2 +-
qemu-options.hx | 4 -
redhat/Makefile.common | 1 +
redhat/qemu-kvm.spec.template | 9 ++-
target/arm/cpu.c | 4 +-
target/arm/cpu_tcg.c | 3 +
target/ppc/cpu-models.c | 10 +++
target/s390x/cpu_models.c | 3 +
target/s390x/kvm.c | 8 ++
27 files changed, 273 insertions(+), 25 deletions(-)
create mode 100644 default-configs/devices/aarch64-rh-devices.mak
create mode 100644 default-configs/devices/ppc64-rh-devices.mak
create mode 100644 default-configs/devices/rh-virtio.mak
create mode 100644 default-configs/devices/s390x-rh-devices.mak
create mode 100644 default-configs/devices/x86_64-rh-devices.mak
diff --git a/default-configs/aarch64-rh-devices.mak b/default-configs/aarch64-rh-devices.mak
diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak
new file mode 100644
index 0000000000..f0cf5a1b22
index 0000000..9831940
--- /dev/null
+++ b/default-configs/aarch64-rh-devices.mak
@@ -0,0 +1,22 @@
+++ b/default-configs/devices/aarch64-rh-devices.mak
@@ -0,0 +1,27 @@
+include rh-virtio.mak
+
+CONFIG_ARM_GIC_KVM=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_SMMUV3=y
+CONFIG_ARM_V7M=y
+CONFIG_ARM_VIRT=y
@ -129,6 +142,7 @@ index 0000000000..f0cf5a1b22
+CONFIG_SEMIHOSTING=y
+CONFIG_USB=y
+CONFIG_USB_XHCI=y
+CONFIG_USB_XHCI_PCI=y
+CONFIG_VFIO=y
+CONFIG_VFIO_PCI=y
+CONFIG_VIRTIO_MMIO=y
@ -136,10 +150,13 @@ index 0000000000..f0cf5a1b22
+CONFIG_XIO3130=y
+CONFIG_NVDIMM=y
+CONFIG_ACPI_APEI=y
diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak
index 958b1e08e4..8f6867d48a 100644
--- a/default-configs/aarch64-softmmu.mak
+++ b/default-configs/aarch64-softmmu.mak
+CONFIG_TPM_EMULATOR=y
+CONFIG_TPM_TIS_SYSBUS=y
+CONFIG_PTIMER=y
diff --git a/default-configs/devices/aarch64-softmmu.mak b/default-configs/devices/aarch64-softmmu.mak
index 958b1e0..8f6867d 100644
--- a/default-configs/devices/aarch64-softmmu.mak
+++ b/default-configs/devices/aarch64-softmmu.mak
@@ -1,8 +1,10 @@
# Default configuration for aarch64-softmmu
@ -155,12 +172,12 @@ index 958b1e08e4..8f6867d48a 100644
+#CONFIG_SBSA_REF=y
+
+include aarch64-rh-devices.mak
diff --git a/default-configs/ppc64-rh-devices.mak b/default-configs/ppc64-rh-devices.mak
diff --git a/default-configs/devices/ppc64-rh-devices.mak b/default-configs/devices/ppc64-rh-devices.mak
new file mode 100644
index 0000000000..ecbe53fe63
index 0000000..467a16b
--- /dev/null
+++ b/default-configs/ppc64-rh-devices.mak
@@ -0,0 +1,34 @@
+++ b/default-configs/devices/ppc64-rh-devices.mak
@@ -0,0 +1,38 @@
+include rh-virtio.mak
+
+CONFIG_DIMM=y
@ -181,6 +198,7 @@ index 0000000000..ecbe53fe63
+CONFIG_USB_STORAGE_BOT=y
+CONFIG_USB_XHCI=y
+CONFIG_USB_XHCI_NEC=y
+CONFIG_USB_XHCI_PCI=y
+CONFIG_VFIO=y
+CONFIG_VFIO_PCI=y
+CONFIG_VGA=y
@ -195,10 +213,13 @@ index 0000000000..ecbe53fe63
+CONFIG_XIVE=y
+CONFIG_XIVE_SPAPR=y
+CONFIG_XIVE_KVM=y
diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak
index ae0841fa3a..040e5575e7 100644
--- a/default-configs/ppc64-softmmu.mak
+++ b/default-configs/ppc64-softmmu.mak
+CONFIG_TPM_SPAPR=y
+CONFIG_TPM_EMULATOR=y
+CONFIG_TPM_PASSTHROUGH=y
diff --git a/default-configs/devices/ppc64-softmmu.mak b/default-configs/devices/ppc64-softmmu.mak
index ae0841f..040e557 100644
--- a/default-configs/devices/ppc64-softmmu.mak
+++ b/default-configs/devices/ppc64-softmmu.mak
@@ -1,11 +1,13 @@
# Default configuration for ppc64-softmmu
@ -217,11 +238,11 @@ index ae0841fa3a..040e5575e7 100644
+#CONFIG_NVDIMM=y
+
+include ppc64-rh-devices.mak
diff --git a/default-configs/rh-virtio.mak b/default-configs/rh-virtio.mak
diff --git a/default-configs/devices/rh-virtio.mak b/default-configs/devices/rh-virtio.mak
new file mode 100644
index 0000000000..94ede1b5f6
index 0000000..94ede1b
--- /dev/null
+++ b/default-configs/rh-virtio.mak
+++ b/default-configs/devices/rh-virtio.mak
@@ -0,0 +1,10 @@
+CONFIG_VIRTIO=y
+CONFIG_VIRTIO_BALLOON=y
@ -233,11 +254,11 @@ index 0000000000..94ede1b5f6
+CONFIG_VIRTIO_RNG=y
+CONFIG_VIRTIO_SCSI=y
+CONFIG_VIRTIO_SERIAL=y
diff --git a/default-configs/s390x-rh-devices.mak b/default-configs/s390x-rh-devices.mak
diff --git a/default-configs/devices/s390x-rh-devices.mak b/default-configs/devices/s390x-rh-devices.mak
new file mode 100644
index 0000000000..c3c73fe752
index 0000000..c3c73fe
--- /dev/null
+++ b/default-configs/s390x-rh-devices.mak
+++ b/default-configs/devices/s390x-rh-devices.mak
@@ -0,0 +1,15 @@
+include rh-virtio.mak
+
@ -254,10 +275,10 @@ index 0000000000..c3c73fe752
+CONFIG_VHOST_USER=y
+CONFIG_VIRTIO_CCW=y
+CONFIG_WDT_DIAG288=y
diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak
index f2287a133f..3e2e388e91 100644
--- a/default-configs/s390x-softmmu.mak
+++ b/default-configs/s390x-softmmu.mak
diff --git a/default-configs/devices/s390x-softmmu.mak b/default-configs/devices/s390x-softmmu.mak
index f2287a1..3e2e388 100644
--- a/default-configs/devices/s390x-softmmu.mak
+++ b/default-configs/devices/s390x-softmmu.mak
@@ -10,4 +10,6 @@
# Boards:
@ -266,12 +287,12 @@ index f2287a133f..3e2e388e91 100644
+#CONFIG_S390_CCW_VIRTIO=y
+
+include s390x-rh-devices.mak
diff --git a/default-configs/x86_64-rh-devices.mak b/default-configs/x86_64-rh-devices.mak
diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak
new file mode 100644
index 0000000000..d59b6d9bb5
index 0000000..e80877d
--- /dev/null
+++ b/default-configs/x86_64-rh-devices.mak
@@ -0,0 +1,100 @@
+++ b/default-configs/devices/x86_64-rh-devices.mak
@@ -0,0 +1,101 @@
+include rh-virtio.mak
+
+CONFIG_AC97=y
@ -354,6 +375,7 @@ index 0000000000..d59b6d9bb5
+CONFIG_USB_UHCI=y
+CONFIG_USB_XHCI=y
+CONFIG_USB_XHCI_NEC=y
+CONFIG_USB_XHCI_PCI=y
+CONFIG_VFIO=y
+CONFIG_VFIO_PCI=y
+CONFIG_VGA=y
@ -369,13 +391,13 @@ index 0000000000..d59b6d9bb5
+CONFIG_WDT_IB700=y
+CONFIG_XIO3130=y
+CONFIG_TPM_CRB=y
+CONFIG_TPM_TIS=y
+CONFIG_TPM_TIS_ISA=y
+CONFIG_TPM_EMULATOR=y
+CONFIG_TPM_PASSTHROUGH=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index 64b2ee2960..b5de7e5279 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
diff --git a/default-configs/devices/x86_64-softmmu.mak b/default-configs/devices/x86_64-softmmu.mak
index 64b2ee2..b5de7e5 100644
--- a/default-configs/devices/x86_64-softmmu.mak
+++ b/default-configs/devices/x86_64-softmmu.mak
@@ -1,3 +1,5 @@
# Default configuration for x86_64-softmmu
@ -384,7 +406,7 @@ index 64b2ee2960..b5de7e5279 100644
+
+include x86_64-rh-devices.mak
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 6a19070cec..bb8379f6a7 100644
index 95cb0f9..f9690a0 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -374,8 +374,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
@ -398,26 +420,26 @@ index 6a19070cec..bb8379f6a7 100644
pm->s4_val = 2;
object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE,
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 534a6a119e..bd62442b54 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -28,7 +28,7 @@ obj-$(CONFIG_VEXPRESS) += vexpress.o
obj-$(CONFIG_ZYNQ) += xilinx_zynq.o
obj-$(CONFIG_SABRELITE) += sabrelite.o
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index be39117..6fcc5ed 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -30,7 +30,7 @@ arm_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c'))
arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c'))
arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c'))
-obj-$(CONFIG_ARM_V7M) += armv7m.o
+#obj-$(CONFIG_ARM_V7M) += armv7m.o
obj-$(CONFIG_EXYNOS4) += exynos4210.o
obj-$(CONFIG_PXA2XX) += pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
obj-$(CONFIG_DIGIC) += digic.o
-arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
+#arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c'))
arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210.c'))
arm_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c', 'pxa2xx_gpio.c', 'pxa2xx_pic.c'))
arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c'))
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index e9ed3eef45..965528a512 100644
index 4c2c35e..e9eb7b8 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -47,6 +47,8 @@
#include "qemu/module.h"
@@ -48,6 +48,8 @@
#include "trace.h"
#include "qom/object.h"
+#include "hw/boards.h"
+
@ -439,24 +461,25 @@ index e9ed3eef45..965528a512 100644
if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
return;
diff --git a/hw/cpu/Makefile.objs b/hw/cpu/Makefile.objs
index 8db9e8a7b3..1601ea93c7 100644
--- a/hw/cpu/Makefile.objs
+++ b/hw/cpu/Makefile.objs
@@ -1,5 +1,6 @@
obj-$(CONFIG_ARM11MPCORE) += arm11mpcore.o
obj-$(CONFIG_REALVIEW) += realview_mpcore.o
obj-$(CONFIG_A9MPCORE) += a9mpcore.o
-obj-$(CONFIG_A15MPCORE) += a15mpcore.o
-common-obj-y += core.o cluster.o
+#obj-$(CONFIG_A15MPCORE) += a15mpcore.o
+common-obj-y += core.o
+# cluster.o
diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build
index 9e52fee..bb71c9f 100644
--- a/hw/cpu/meson.build
+++ b/hw/cpu/meson.build
@@ -1,6 +1,7 @@
-softmmu_ss.add(files('core.c', 'cluster.c'))
+#softmmu_ss.add(files('core.c', 'cluster.c'))
+softmmu_ss.add(files('core.c'))
specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c'))
specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
-specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
+#specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 212d6f5e61..f2504e5649 100644
index 722b9e7..25de8b2 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -2958,6 +2958,9 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
@@ -2963,6 +2963,9 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
int16_t device_id = pc->device_id;
@ -467,10 +490,10 @@ index 212d6f5e61..f2504e5649 100644
Also accept 8 MB/16 MB for backward compatibility. */
if (s->vga.vram_size_mb != 4 && s->vga.vram_size_mb != 8 &&
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index b402a93636..d3621a45d9 100644
index b9860e3..beb1ea6 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -221,7 +221,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
@@ -220,7 +220,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
@ -480,7 +503,7 @@ index b402a93636..d3621a45d9 100644
}
static const TypeInfo piix3_ide_info = {
@@ -250,6 +251,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
@@ -249,6 +250,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
dc->hotpluggable = false;
@ -490,10 +513,10 @@ index b402a93636..d3621a45d9 100644
static const TypeInfo piix4_ide_info = {
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 29d633ca94..1442f46195 100644
index dde85ba..62cf60c 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -599,6 +599,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
@@ -597,6 +597,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_kbd_isa;
isa->build_aml = i8042_build_aml;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
@ -503,10 +526,10 @@ index 29d633ca94..1442f46195 100644
static const TypeInfo i8042_info = {
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index a18f80e369..960b2f00ee 100644
index 83347cb..8fb83a1 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1797,6 +1797,7 @@ static const E1000Info e1000_devices[] = {
@@ -1796,6 +1796,7 @@ static const E1000Info e1000_devices[] = {
.revision = 0x03,
.phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT,
},
@ -514,7 +537,7 @@ index a18f80e369..960b2f00ee 100644
{
.name = "e1000-82544gc",
.device_id = E1000_DEV_ID_82544GC_COPPER,
@@ -1809,6 +1810,7 @@ static const E1000Info e1000_devices[] = {
@@ -1808,6 +1809,7 @@ static const E1000Info e1000_devices[] = {
.revision = 0x03,
.phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT,
},
@ -523,10 +546,10 @@ index a18f80e369..960b2f00ee 100644
static void e1000_register_types(void)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index c4f47dcc04..6a2239d5e5 100644
index 2f7dc3c..55d36e0 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -389,10 +389,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
@@ -376,10 +376,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
.instance_size = sizeof(SpaprCpuCore),
.class_size = sizeof(SpaprCpuCoreClass),
},
@ -539,26 +562,24 @@ index c4f47dcc04..6a2239d5e5 100644
DEFINE_SPAPR_CPU_CORE_TYPE("power7_v2.3"),
DEFINE_SPAPR_CPU_CORE_TYPE("power7+_v2.1"),
DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"),
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index e342ff59fa..abf044a20f 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -31,7 +31,9 @@ ifeq ($(CONFIG_USB_SMARTCARD),y)
common-obj-y += dev-smartcard-reader.o
ifeq ($(CONFIG_SMARTCARD),y)
common-obj-m += smartcard.mo
-smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o
+# Disabled for Red Hat Enterprise Linux:
+#smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o
+smartcard.mo-objs := ccid-card-passthru.o
smartcard.mo-cflags := $(SMARTCARD_CFLAGS)
smartcard.mo-libs := $(SMARTCARD_LIBS)
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 934e4fa..e3abba5 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -48,7 +48,7 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade
if config_host.has_key('CONFIG_SMARTCARD')
usbsmartcard_ss = ss.source_set()
usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
- if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
+ if_true: [cacard, files('ccid-card-passthru.c')])
hw_usb_modules += {'smartcard': usbsmartcard_ss}
endif
diff --git a/qemu-options.hx b/qemu-options.hx
index 708583b4ce..1700205035 100644
index 2c83390..53472fd 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2257,10 +2257,6 @@ ERST
@@ -2251,10 +2251,6 @@ ERST
DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
"-no-hpet disable HPET\n", QEMU_ARCH_I386)
@ -569,24 +590,11 @@ index 708583b4ce..1700205035 100644
DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
"-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n"
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 4eb9d1f7fd..a1fb06dca0 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -145,7 +145,7 @@ static Chardev **serial_hds;
Chardev *parallel_hds[MAX_PARALLEL_PORTS];
int win2k_install_hack = 0;
int singlestep = 0;
-int no_hpet = 0;
+int no_hpet = 1; /* Always disabled for Red Hat Enterprise Linux */
int fd_bootchk = 1;
static int no_reboot;
int no_shutdown = 0;
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 111579554f..13ad40aa7d 100644
index 07492e9..a048714 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -2338,7 +2338,9 @@ static void arm_cpu_register_types(void)
@@ -2358,7 +2358,9 @@ static void arm_cpu_register_types(void)
type_register_static(&idau_interface_type_info);
for (i = 0; i < cpu_count; ++i) {
@ -598,10 +606,10 @@ index 111579554f..13ad40aa7d 100644
}
}
diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c
index 00b0e08f33..94d429b61c 100644
index 0013e25..6540046 100644
--- a/target/arm/cpu_tcg.c
+++ b/target/arm/cpu_tcg.c
@@ -655,6 +655,9 @@ static void arm_tcg_cpu_register_types(void)
@@ -679,6 +679,9 @@ static void arm_tcg_cpu_register_types(void)
{
size_t i;
@ -611,20 +619,8 @@ index 00b0e08f33..94d429b61c 100644
for (i = 0; i < ARRAY_SIZE(arm_tcg_cpus); ++i) {
arm_cpu_register(&arm_tcg_cpus[i]);
}
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 588f32e136..030a5a09ed 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1825,6 +1825,7 @@ static CPUCaches epyc_rome_cache_info = {
static X86CPUDefinition builtin_x86_defs[] = {
{
+ /* qemu64 is the default CPU model for all machine-types */
.name = "qemu64",
.level = 0xd,
.vendor = CPUID_VENDOR_AMD,
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
index 4ad16863c0..16b2185fd8 100644
index 4ad1686..16b2185 100644
--- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c
@@ -66,6 +66,7 @@
@ -694,10 +690,10 @@ index 4ad16863c0..16b2185fd8 100644
{ NULL, NULL }
};
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index c2af226174..e35bf745dd 100644
index b5abff8..abe09d7 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -404,6 +404,9 @@ static void check_unavailable_features(const S390CPUModel *max_model,
@@ -408,6 +408,9 @@ static void check_unavailable_features(const S390CPUModel *max_model,
(max_model->def->gen == model->def->gen &&
max_model->def->ec_ga < model->def->ec_ga)) {
list_add_feat("type", unavailable);
@ -708,10 +704,10 @@ index c2af226174..e35bf745dd 100644
/* detect missing features if any to properly report them */
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index f2f75d2a57..8970e4c374 100644
index baa070f..10ce36a 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -2494,6 +2494,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp)
@@ -2540,6 +2540,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp)
error_setg(errp, "KVM doesn't support CPU models");
return;
}
@ -727,5 +723,5 @@ index f2f75d2a57..8970e4c374 100644
prop.ibc = s390_ibc_from_cpu_model(model);
/* configure cpu features indicated via STFL(e) */
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From a86a622ecc7b0b3c66d21fdd1c5dd279bfc75a03 Mon Sep 17 00:00:00 2001
From 673234091c4073ebc31bf36559e249796772c8b5 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 11 Jan 2019 09:54:45 +0100
Subject: Machine type related general changes
@ -33,22 +33,21 @@ Merged patches (4.2.0):
- ca4a5e8 virtio: Make disable-legacy/disable-modern compat properties optional
- compat: Generic hw_compat_rhel_8_1 (patch 93040/92956)
Merged patches (weekly-200318):
Merged patches (5.1.0):
- e6c3fbf hw/smbios: set new default SMBIOS fields for Windows driver support (partialy)
Merged patches (weekly-200506):
- 8f9f4d8 compat: disable 'edid' for virtio-gpu-ccw
Conflicts:
hw/core/machine.c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- 8348642 redhat: define hw_compat_8_2
- 45b8402 redhat: define hw_compat_8_2
- 4effa71 redhat: Update hw_compat_8_2
- 0e84dff virtio: skip legacy support check on machine types less than 5.1 (partialy)
---
hw/acpi/ich9.c | 15 ++++
hw/acpi/ich9.c | 15 +++
hw/acpi/piix4.c | 5 +-
hw/arm/virt.c | 2 +-
hw/char/serial.c | 16 ++++
hw/core/machine.c | 170 +++++++++++++++++++++++++++++++++++
hw/core/machine.c | 213 +++++++++++++++++++++++++++++++++++++++++++
hw/display/vga-isa.c | 2 +-
hw/i386/pc_piix.c | 2 +
hw/i386/pc_q35.c | 2 +
@ -58,19 +57,19 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
hw/smbios/smbios.c | 46 +++++++++-
hw/timer/i8254_common.c | 2 +-
hw/usb/hcd-uhci.c | 4 +-
hw/usb/hcd-xhci.c | 20 +++++
hw/usb/hcd-xhci.c | 20 ++++
hw/usb/hcd-xhci.h | 2 +
include/hw/acpi/ich9.h | 3 +
include/hw/boards.h | 24 +++++
include/hw/boards.h | 27 ++++++
include/hw/firmware/smbios.h | 5 +-
include/hw/i386/pc.h | 3 +
include/hw/usb.h | 4 +
migration/migration.c | 2 +
migration/migration.h | 5 ++
23 files changed, 354 insertions(+), 11 deletions(-)
migration/migration.h | 5 +
23 files changed, 400 insertions(+), 11 deletions(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index bb8379f6a7..43ad1ff927 100644
index f9690a0..f6c6c6a 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -369,6 +369,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
@ -103,10 +102,10 @@ index bb8379f6a7..43ad1ff927 100644
&pm->disable_s3, OBJ_PROP_FLAG_READWRITE);
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 26bac4f16c..7c2e17ceb6 100644
index 67a1ea4..85312a3 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -276,6 +276,7 @@ static const VMStateDescription vmstate_acpi = {
@@ -277,6 +277,7 @@ static const VMStateDescription vmstate_acpi = {
.name = "piix4_pm",
.version_id = 3,
.minimum_version_id = 3,
@ -114,7 +113,7 @@ index 26bac4f16c..7c2e17ceb6 100644
.post_load = vmstate_acpi_post_load,
.fields = (VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
@@ -630,8 +631,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
@@ -633,8 +634,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
static Property piix4_pm_properties[] = {
DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
@ -126,10 +125,10 @@ index 26bac4f16c..7c2e17ceb6 100644
DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
use_acpi_hotplug_bridge, true),
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index ecfee362a1..43cf75333b 100644
index 27dbeb5..c908b5f 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1450,7 +1450,7 @@ static void virt_build_smbios(VirtMachineState *vms)
@@ -1441,7 +1441,7 @@ static void virt_build_smbios(VirtMachineState *vms)
smbios_set_defaults("QEMU", product,
vmc->smbios_old_sys_ver ? "1.0" : mc->name, false,
@ -139,7 +138,7 @@ index ecfee362a1..43cf75333b 100644
smbios_get_tables(MACHINE(vms), NULL, 0, &smbios_tables, &smbios_tables_len,
&smbios_anchor, &smbios_anchor_len);
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 2386479492..c83f816f42 100644
index 97f7187..aeb207e 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -35,6 +35,7 @@
@ -148,9 +147,9 @@ index 2386479492..c83f816f42 100644
#include "hw/qdev-properties.h"
+#include "migration/migration.h"
//#define DEBUG_SERIAL
#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
@@ -704,6 +705,9 @@ static int serial_post_load(void *opaque, int version_id)
@@ -691,6 +692,9 @@ static int serial_post_load(void *opaque, int version_id)
static bool serial_thr_ipending_needed(void *opaque)
{
SerialState *s = opaque;
@ -160,7 +159,7 @@ index 2386479492..c83f816f42 100644
if (s->ier & UART_IER_THRI) {
bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
@@ -785,6 +789,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
@@ -772,6 +776,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
static bool serial_fifo_timeout_timer_needed(void *opaque)
{
SerialState *s = (SerialState *)opaque;
@ -171,7 +170,7 @@ index 2386479492..c83f816f42 100644
return timer_pending(s->fifo_timeout_timer);
}
@@ -802,6 +810,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
@@ -789,6 +797,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
static bool serial_timeout_ipending_needed(void *opaque)
{
SerialState *s = (SerialState *)opaque;
@ -182,7 +181,7 @@ index 2386479492..c83f816f42 100644
return s->timeout_ipending != 0;
}
@@ -819,6 +831,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
@@ -806,6 +818,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
static bool serial_poll_needed(void *opaque)
{
SerialState *s = (SerialState *)opaque;
@ -194,13 +193,56 @@ index 2386479492..c83f816f42 100644
}
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 8d1a90c6cf..2b8e480040 100644
index 98b87f7..8674586 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -28,6 +28,176 @@
@@ -28,6 +28,219 @@
#include "hw/mem/nvdimm.h"
#include "migration/vmstate.h"
+/*
+ * The same as hw_compat_4_2 + hw_compat_5_0
+ */
+GlobalProperty hw_compat_rhel_8_2[] = {
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-blk-device", "queue-size", "128"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-scsi-device", "virtqueue_size", "128"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-blk-device", "seg-max-adjust", "off"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-scsi-device", "seg_max_adjust", "off"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "vhost-blk-device", "seg_max_adjust", "off"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "usb-host", "suppress-remote-wake", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "usb-redir", "suppress-remote-wake", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "qxl", "revision", "4" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "qxl-vga", "revision", "4" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "fw_cfg", "acpi-mr-restore", "false" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "virtio-balloon-device", "page-poison", "false" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-read-set-eax", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-signal-unsupported-cmd", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-report-vmx-type", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-cmds-v2", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "virtio-device", "x-disable-legacy-check", "true" },
+};
+const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
+
+/*
+ * The same as hw_compat_4_1
+ */
@ -371,14 +413,14 @@ index 8d1a90c6cf..2b8e480040 100644
+};
+const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1);
+
GlobalProperty hw_compat_5_0[] = {
{ "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
{ "virtio-balloon-device", "page-poison", "false" },
GlobalProperty hw_compat_5_1[] = {
{ "vhost-scsi", "num_queues", "1"},
{ "vhost-user-blk", "num-queues", "1"},
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
index 3aaeeeca1e..d88f52a587 100644
index 90851e7..a91c5d7 100644
--- a/hw/display/vga-isa.c
+++ b/hw/display/vga-isa.c
@@ -84,7 +84,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
@@ -85,7 +85,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
}
static Property vga_isa_properties[] = {
@ -388,7 +430,7 @@ index 3aaeeeca1e..d88f52a587 100644
};
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index b789e83f9a..0ecdd57689 100644
index 13d1628..9fcc5aa 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -179,6 +179,8 @@ static void pc_init1(MachineState *machine,
@ -401,10 +443,10 @@ index b789e83f9a..0ecdd57689 100644
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index a3e607a544..b8ea764ce3 100644
index a3f4959..f6c2ef4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -204,6 +204,8 @@ static void pc_q35_init(MachineState *machine)
@@ -198,6 +198,8 @@ static void pc_q35_init(MachineState *machine)
smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
mc->name, pcmc->smbios_legacy_mode,
pcmc->smbios_uuid_encoded,
@ -414,10 +456,10 @@ index a3e607a544..b8ea764ce3 100644
}
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index fda34518c9..be64a6b56f 100644
index b6f1ae3..19955eb 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -79,6 +79,11 @@ typedef struct E1000EState {
@@ -80,6 +80,11 @@ struct E1000EState {
E1000ECore core;
@ -426,10 +468,10 @@ index fda34518c9..be64a6b56f 100644
+ */
+ bool redhat_7_3_intr_state_enable;
+ uint32_t redhat_7_3_intr_state;
} E1000EState;
};
#define E1000E_MMIO_IDX 0
@@ -94,6 +99,10 @@ typedef struct E1000EState {
@@ -95,6 +100,10 @@ struct E1000EState {
#define E1000E_MSIX_TABLE (0x0000)
#define E1000E_MSIX_PBA (0x2000)
@ -440,7 +482,7 @@ index fda34518c9..be64a6b56f 100644
static uint64_t
e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
{
@@ -305,6 +314,8 @@ e1000e_init_msix(E1000EState *s)
@@ -306,6 +315,8 @@ e1000e_init_msix(E1000EState *s)
} else {
if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
msix_uninit(d, &s->msix, &s->msix);
@ -449,7 +491,7 @@ index fda34518c9..be64a6b56f 100644
}
}
}
@@ -476,6 +487,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
@@ -477,6 +488,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
if (ret) {
trace_e1000e_msi_init_fail(ret);
@ -458,7 +500,7 @@ index fda34518c9..be64a6b56f 100644
}
if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
@@ -599,6 +612,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
@@ -600,6 +613,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0, \
e1000e_vmstate_intr_timer, E1000IntrDelayTimer)
@ -470,7 +512,7 @@ index fda34518c9..be64a6b56f 100644
static const VMStateDescription e1000e_vmstate = {
.name = "e1000e",
.version_id = 1,
@@ -610,6 +628,7 @@ static const VMStateDescription e1000e_vmstate = {
@@ -611,6 +629,7 @@ static const VMStateDescription e1000e_vmstate = {
VMSTATE_MSIX(parent_obj, E1000EState),
VMSTATE_UINT32(ioaddr, E1000EState),
@ -478,7 +520,7 @@ index fda34518c9..be64a6b56f 100644
VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
VMSTATE_UINT8(core.rx_desc_len, E1000EState),
VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
@@ -658,6 +677,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
@@ -659,6 +678,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
static Property e1000e_properties[] = {
DEFINE_NIC_PROPERTIES(E1000EState, conf),
@ -488,7 +530,7 @@ index fda34518c9..be64a6b56f 100644
e1000e_prop_disable_vnet, bool),
DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven,
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index ab93d78ab3..48a81354fc 100644
index ba5ace1..a2e6e83 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3179,7 +3179,7 @@ static int rtl8139_pre_save(void *opaque)
@ -511,7 +553,7 @@ index ab93d78ab3..48a81354fc 100644
VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index 7a38540cb9..377d861913 100644
index 7a38540..377d861 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -43,6 +43,7 @@
@ -535,7 +577,7 @@ index 7a38540cb9..377d861913 100644
}
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index f560826904..8875e83941 100644
index 6a3d397..232fd61 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -56,6 +56,9 @@ static bool smbios_legacy = true;
@ -548,7 +590,7 @@ index f560826904..8875e83941 100644
uint8_t *smbios_tables;
size_t smbios_tables_len;
@@ -531,7 +534,7 @@ static void smbios_build_type_1_table(void)
@@ -570,7 +573,7 @@ static void smbios_build_type_1_table(void)
static void smbios_build_type_2_table(void)
{
@ -557,7 +599,7 @@ index f560826904..8875e83941 100644
SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer);
SMBIOS_TABLE_SET_STR(2, product_str, type2.product);
@@ -752,7 +755,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features)
@@ -792,7 +795,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features)
void smbios_set_defaults(const char *manufacturer, const char *product,
const char *version, bool legacy_mode,
@ -569,7 +611,7 @@ index f560826904..8875e83941 100644
{
smbios_have_defaults = true;
smbios_legacy = legacy_mode;
@@ -773,11 +779,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
@@ -813,11 +819,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
g_free(smbios_entries);
}
@ -617,7 +659,7 @@ index f560826904..8875e83941 100644
SMBIOS_SET_DEFAULT(type3.manufacturer, manufacturer);
SMBIOS_SET_DEFAULT(type3.version, version);
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
index 050875b497..32935da46c 100644
index 050875b..32935da 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -231,7 +231,7 @@ static const VMStateDescription vmstate_pit_common = {
@ -630,10 +672,10 @@ index 050875b497..32935da46c 100644
vmstate_pit_channel, PITChannelState),
VMSTATE_INT64(channels[0].next_transition_time,
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 37f7beb3fa..2741edc589 100644
index 27ca237..eb24e39 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1219,12 +1219,14 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
@@ -1221,12 +1221,14 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
UHCIState *s = UHCI(dev);
uint8_t *pci_conf = s->dev.config;
int i;
@ -650,10 +692,10 @@ index 37f7beb3fa..2741edc589 100644
if (s->masterbus) {
USBPort *ports[NB_PORTS];
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 67a18fe2b6..38bdfaf3fd 100644
index 79ce5c4..325cd02 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3600,9 +3600,27 @@ static const VMStateDescription vmstate_xhci_slot = {
@@ -3486,9 +3486,27 @@ static const VMStateDescription vmstate_xhci_slot = {
}
};
@ -681,7 +723,7 @@ index 67a18fe2b6..38bdfaf3fd 100644
.fields = (VMStateField[]) {
VMSTATE_UINT32(type, XHCIEvent),
VMSTATE_UINT32(ccode, XHCIEvent),
@@ -3611,6 +3629,8 @@ static const VMStateDescription vmstate_xhci_event = {
@@ -3497,6 +3515,8 @@ static const VMStateDescription vmstate_xhci_event = {
VMSTATE_UINT32(flags, XHCIEvent),
VMSTATE_UINT8(slotid, XHCIEvent),
VMSTATE_UINT8(epid, XHCIEvent),
@ -691,10 +733,10 @@ index 67a18fe2b6..38bdfaf3fd 100644
}
};
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index 946af51fc2..cc91a7e4bd 100644
index ccf50ae..8716904 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -157,6 +157,8 @@ typedef struct XHCIEvent {
@@ -149,6 +149,8 @@ typedef struct XHCIEvent {
uint32_t flags;
uint8_t slotid;
uint8_t epid;
@ -704,7 +746,7 @@ index 946af51fc2..cc91a7e4bd 100644
typedef struct XHCIInterrupter {
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 28a53181cb..ff4a672b90 100644
index 28a5318..ff4a672 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -61,6 +61,9 @@ typedef struct ICH9LPCPMRegs {
@ -718,13 +760,16 @@ index 28a53181cb..ff4a672b90 100644
#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 426ce5f625..1062df96c0 100644
index a49e3a6..dd18c9e 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -373,4 +373,28 @@ extern const size_t hw_compat_2_2_len;
@@ -367,4 +367,31 @@ extern const size_t hw_compat_2_2_len;
extern GlobalProperty hw_compat_2_1[];
extern const size_t hw_compat_2_1_len;
+extern GlobalProperty hw_compat_rhel_8_2[];
+extern const size_t hw_compat_rhel_8_2_len;
+
+extern GlobalProperty hw_compat_rhel_8_1[];
+extern const size_t hw_compat_rhel_8_1_len;
+
@ -751,7 +796,7 @@ index 426ce5f625..1062df96c0 100644
+
#endif
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
index 02a0ced0a0..67e38a1b13 100644
index 02a0ced..67e38a1 100644
--- a/include/hw/firmware/smbios.h
+++ b/include/hw/firmware/smbios.h
@@ -267,7 +267,10 @@ void smbios_entry_add(QemuOpts *opts, Error **errp);
@ -767,10 +812,10 @@ index 02a0ced0a0..67e38a1b13 100644
void smbios_get_tables(MachineState *ms,
const struct smbios_phys_mem_area *mem_array,
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 3d7ed3a55e..951e825778 100644
index 911e460..ae6bf1d 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -103,6 +103,9 @@ typedef struct PCMachineClass {
@@ -104,6 +104,9 @@ struct PCMachineClass {
bool smbios_defaults;
bool smbios_legacy_mode;
bool smbios_uuid_encoded;
@ -781,10 +826,10 @@ index 3d7ed3a55e..951e825778 100644
/* RAM / address space compat: */
bool gigabyte_align;
diff --git a/include/hw/usb.h b/include/hw/usb.h
index e29a37635b..35ac38c459 100644
index a70a72e..78b9043 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -575,4 +575,8 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
@@ -570,4 +570,8 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
uint8_t interface_class, uint8_t interface_subclass,
uint8_t interface_protocol);
@ -794,10 +839,10 @@ index e29a37635b..35ac38c459 100644
+
#endif
diff --git a/migration/migration.c b/migration/migration.c
index 8fe36339db..bf684185b7 100644
index 3263aa5..c8d54ac 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -129,6 +129,8 @@ enum mig_rp_message_type {
@@ -134,6 +134,8 @@ enum mig_rp_message_type {
MIG_RP_MSG_MAX
};
@ -807,10 +852,10 @@ index 8fe36339db..bf684185b7 100644
migrations at once. For now we don't need to add
dynamic creation of migration */
diff --git a/migration/migration.h b/migration/migration.h
index 6c6a931d0d..721e272713 100644
index d096b77..6134a53 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -340,6 +340,11 @@ void dirty_bitmap_mig_cancel_incoming(void);
@@ -364,6 +364,11 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm,
void migrate_add_address(SocketAddress *address);
int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
@ -823,5 +868,5 @@ index 6c6a931d0d..721e272713 100644
#define qemu_ram_foreach_block \
#warning "Use foreach_not_ignored_block in migration code"
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From 0ba70804c179d934e5be555abff3c4455ac137a0 Mon Sep 17 00:00:00 2001
From be3ca54f04ade6a20265f9aeeb46662caa6d16dc Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 12:53:31 +0200
Subject: Add aarch64 machine types
@ -23,19 +23,13 @@ Rebase notes (4.2.0-rc3):
- aarch64: virt: Allow PCDIMM instantiation (patch 92247)
- aarch64: virt: Enhance the comment related to gic-version (patch 92248)
Rebase notes (weekly-200226):
Rebase notes (5.0.0):
- Set default_ram_id in rhel_machine_class_init
Rebase notes (5.0.0-rc1):
- Added setting acpi properties
Rebase notes (weekly-200520):
Rebase notes (5.1.0):
- Added ras property
Rebase notes (weekly-200701):
- Added to virt_machine_device_unplug_cb to machine type (upstream)
Rebase notes (5.1.0-rc1):
- added mte property (upstream)
Merged patches (4.0.0):
@ -47,14 +41,21 @@ Merged patches (4.1.0):
- c3e39ef aarch64: Add virt-rhel8.1.0 machine type for ARM
- 59a46d1 aarch64: Allow ARM VIRT iommu option in RHEL8.1 machine
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- 12990ad hw/arm: Changes to rhel820 machine
- 46d5a79 hw/arm: Introduce rhel_virt_instance_init() helper
- 098954a hw/arm: Add rhel830 machine type
- ee8e99d arm: Set correct max_cpus value on virt-rhel* machine types
- e5edd38 RHEL-only: arm/virt: Allow the TPM_TIS_SYSBUS device dynamic allocation in machvirt
- 6d7ba66 machine types/numa: set numa_mem_supported on old machine types (partialy)
- 25c5644 machine_types/numa: compatibility for auto_enable_numa_with_memdev (partialy)
---
hw/arm/virt.c | 180 +++++++++++++++++++++++++++++++++++++++++-
include/hw/arm/virt.h | 11 +++
2 files changed, 188 insertions(+), 3 deletions(-)
hw/arm/virt.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++-
include/hw/arm/virt.h | 8 +++
2 files changed, 196 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 43cf75333b..e1a17e7c87 100644
index c908b5f..21e0485 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -79,6 +79,7 @@
@ -116,7 +117,7 @@ index 43cf75333b..e1a17e7c87 100644
/* Number of external interrupt lines to configure the GIC with */
#define NUM_IRQS 256
@@ -1979,6 +2022,7 @@ static void machvirt_init(MachineState *machine)
@@ -2027,6 +2070,7 @@ static void machvirt_init(MachineState *machine)
qemu_add_machine_init_done_notifier(&vms->machine_done);
}
@ -124,7 +125,7 @@ index 43cf75333b..e1a17e7c87 100644
static bool virt_get_secure(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2007,6 +2051,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
@@ -2055,6 +2099,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
vms->virt = value;
}
@ -132,7 +133,15 @@ index 43cf75333b..e1a17e7c87 100644
static bool virt_get_highmem(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2073,7 +2118,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp)
@@ -2108,6 +2153,7 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
visit_type_OnOffAuto(v, name, &vms->acpi, errp);
}
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static bool virt_get_ras(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2121,13 +2167,14 @@ static void virt_set_ras(Object *obj, bool value, Error **errp)
vms->ras = value;
}
@ -141,7 +150,14 @@ index 43cf75333b..e1a17e7c87 100644
static bool virt_get_mte(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2087,7 +2132,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp)
return vms->mte;
}
+#endif /* disabled for RHEL */
static void virt_set_mte(Object *obj, bool value, Error **errp)
{
@@ -2135,7 +2182,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp)
vms->mte = value;
}
@ -150,7 +166,7 @@ index 43cf75333b..e1a17e7c87 100644
static char *virt_get_gic_version(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2401,6 +2446,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str)
@@ -2442,6 +2489,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str)
return requested_pa_size > 40 ? requested_pa_size : 0;
}
@ -158,7 +174,7 @@ index 43cf75333b..e1a17e7c87 100644
static void virt_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -2679,3 +2725,131 @@ static void virt_machine_2_6_options(MachineClass *mc)
@@ -2730,3 +2778,140 @@ static void virt_machine_2_6_options(MachineClass *mc)
vmc->no_pmu = true;
}
DEFINE_VIRT_MACHINE(2, 6)
@ -171,11 +187,9 @@ index 43cf75333b..e1a17e7c87 100644
+
+ mc->family = "virt-rhel-Z";
+ mc->init = machvirt_init;
+ /* Start with max_cpus set to 512, which is the maximum supported by KVM.
+ * The value may be reduced later when we have more information about the
+ * configuration of the particular instance.
+ */
+ mc->max_cpus = 512;
+ /* Maximum supported VCPU count for all virt-rhel* machines */
+ mc->max_cpus = 384;
+ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
+ mc->block_default_type = IF_VIRTIO;
+ mc->no_cdrom = 1;
+ mc->pci_allow_0_address = true;
@ -192,9 +206,9 @@ index 43cf75333b..e1a17e7c87 100644
+ hc->plug = virt_machine_device_plug_cb;
+ hc->unplug_request = virt_machine_device_unplug_request_cb;
+ hc->unplug = virt_machine_device_unplug_cb;
+ mc->numa_mem_supported = true;
+ mc->nvdimm_supported = true;
+ mc->auto_enable_numa_with_memhp = true;
+ mc->auto_enable_numa_with_memdev = true;
+ mc->default_ram_id = "mach-virt.ram";
+
+ object_class_property_add(oc, "acpi", "OnOffAuto",
@ -223,7 +237,7 @@ index 43cf75333b..e1a17e7c87 100644
+}
+type_init(rhel_machine_init);
+
+static void rhel820_virt_instance_init(Object *obj)
+static void rhel_virt_instance_init(Object *obj)
+{
+ VirtMachineState *vms = VIRT_MACHINE(obj);
+ VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@ -239,12 +253,8 @@ index 43cf75333b..e1a17e7c87 100644
+ object_property_set_description(obj, "highmem",
+ "Set on/off to enable/disable using "
+ "physical address space above 32 bits");
+ /*
+ * Default GIC type is still v2, but became configurable for RHEL. We
+ * keep v2 instead of max as TCG CI test cases require an MSI controller
+ * and there is no userspace ITS MSI emulation available.
+ */
+ vms->gic_version = 2;
+
+ vms->gic_version = VIRT_GIC_VERSION_NOSEL;
+ object_property_add_str(obj, "gic-version", virt_get_gic_version,
+ virt_set_gic_version);
+ object_property_set_description(obj, "gic-version",
@ -271,13 +281,8 @@ index 43cf75333b..e1a17e7c87 100644
+ object_property_set_description(obj, "iommu",
+ "Set the IOMMU type. "
+ "Valid values are none and smmuv3");
+ vms->ras = false;
+ object_property_add_bool(obj, "ras", virt_get_ras,
+ virt_set_ras);
+ object_property_set_description(obj, "ras",
+ "Set on/off to enable/disable reporting host memory errors "
+ "to a KVM guest using ACPI and guest external abort exceptions");
+
+ vms->ras = false;
+ /* MTE is disabled by default. */
+ vms->mte = false;
+
@ -285,40 +290,53 @@ index 43cf75333b..e1a17e7c87 100644
+ virt_flash_create(vms);
+}
+
+static void rhel820_virt_options(MachineClass *mc)
+static void rhel830_virt_instance_init(Object *obj)
+{
+ rhel_virt_instance_init(obj);
+}
+
+static void rhel830_virt_options(MachineClass *mc)
+{
+ compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+}
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 2, 0)
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 3, 0)
+
+static void rhel820_virt_instance_init(Object *obj)
+{
+ rhel_virt_instance_init(obj);
+}
+
+static void rhel820_virt_options(MachineClass *mc)
+{
+ rhel830_virt_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+ mc->numa_mem_supported = true;
+ mc->auto_enable_numa_with_memdev = false;
+}
+DEFINE_RHEL_MACHINE(8, 2, 0)
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index dff67e1bef..7c1e085749 100644
index aad6d69..745b76b 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -166,6 +166,7 @@ typedef struct {
@@ -167,9 +167,17 @@ struct VirtMachineState {
#define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM)
+#if 0 /* disabled for Red Hat Enterprise Linux */
#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt")
#define VIRT_MACHINE(obj) \
OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE)
@@ -174,6 +175,16 @@ typedef struct {
#define VIRT_MACHINE_CLASS(klass) \
OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE)
OBJECT_DECLARE_TYPE(VirtMachineState, VirtMachineClass, VIRT_MACHINE)
+#else
+#define TYPE_RHEL_MACHINE MACHINE_TYPE_NAME("virt-rhel")
+#define VIRT_MACHINE(obj) \
+ OBJECT_CHECK(VirtMachineState, (obj), TYPE_RHEL_MACHINE)
+#define VIRT_MACHINE_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_RHEL_MACHINE)
+#define VIRT_MACHINE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_RHEL_MACHINE)
+typedef struct VirtMachineClass VirtMachineClass;
+typedef struct VirtMachineState VirtMachineState;
+DECLARE_OBJ_CHECKERS(VirtMachineState, VirtMachineClass, VIRT_MACHINE, TYPE_RHEL_MACHINE)
+#endif
+
void virt_acpi_setup(VirtMachineState *vms);
bool virt_is_acpi_enabled(VirtMachineState *vms);
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From da49e223e70695ec4ecc5668658d836346e7f29c Mon Sep 17 00:00:00 2001
From d33e7e8c4d6e006d5039782d54f583ea3f242fd6 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:27:13 +0200
Subject: Add ppc64 machine types
@ -31,23 +31,73 @@ Merged patches (4.2.0):
- redhat: update pseries-rhel-7.6.0 machine type (patch 93039)
- redhat: define pseries-rhel8.2.0 machine type (patch 93041)
Merged patches (weekly-200226):
Merged patches (5.1.0):
- eb121ff spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine (partial)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- 311a20f redhat: define pseries-rhel8.3.0 machine type
- 1284167 ppc: Set correct max_cpus value on spapr-rhel* machine types
- 1ab8783 redhat: update pseries-rhel8.2.0 machine type
- b162af531a target/ppc: Add experimental option for enabling secure guests
---
hw/ppc/spapr.c | 280 ++++++++++++++++++++++++++++++++++++++++
hw/ppc/spapr.c | 337 ++++++++++++++++++++++++++++++++++++++++++++++++
hw/ppc/spapr_cpu_core.c | 13 ++
include/hw/ppc/spapr.h | 1 +
include/hw/ppc/spapr.h | 4 +
target/ppc/compat.c | 13 +-
target/ppc/cpu.h | 1 +
5 files changed, 307 insertions(+), 1 deletion(-)
target/ppc/kvm.c | 27 ++++
target/ppc/kvm_ppc.h | 13 ++
7 files changed, 407 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0ae293ec94..756c8667c1 100644
index 12a012d..4a838cc 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4529,6 +4529,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
@@ -1585,6 +1585,9 @@ static void spapr_machine_reset(MachineState *machine)
kvmppc_svm_off(&error_fatal);
spapr_caps_apply(spapr);
+ if (spapr->svm_allowed) {
+ kvmppc_svm_allow(&error_fatal);
+ }
first_ppc_cpu = POWERPC_CPU(first_cpu);
if (kvm_enabled() && kvmppc_has_cap_mmu_radix() &&
@@ -3266,6 +3269,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp)
spapr->host_serial = g_strdup(value);
}
+static bool spapr_get_svm_allowed(Object *obj, Error **errp)
+{
+ SpaprMachineState *spapr = SPAPR_MACHINE(obj);
+
+ return spapr->svm_allowed;
+}
+
+static void spapr_set_svm_allowed(Object *obj, bool value, Error **errp)
+{
+ SpaprMachineState *spapr = SPAPR_MACHINE(obj);
+
+ spapr->svm_allowed = value;
+}
+
static void spapr_instance_init(Object *obj)
{
SpaprMachineState *spapr = SPAPR_MACHINE(obj);
@@ -3321,6 +3338,12 @@ static void spapr_instance_init(Object *obj)
spapr_get_host_serial, spapr_set_host_serial);
object_property_set_description(obj, "host-serial",
"Host serial number to advertise in guest device tree");
+ object_property_add_bool(obj, "x-svm-allowed",
+ spapr_get_svm_allowed,
+ spapr_set_svm_allowed);
+ object_property_set_description(obj, "x-svm-allowed",
+ "Allow the guest to become a Secure Guest"
+ " (experimental only)");
}
static void spapr_machine_finalizefn(Object *obj)
@@ -4459,6 +4482,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
smc->smp_threads_vsmt = true;
smc->nr_xirqs = SPAPR_NR_XIRQS;
xfc->match_nvt = spapr_match_nvt;
@ -55,15 +105,15 @@ index 0ae293ec94..756c8667c1 100644
}
static const TypeInfo spapr_machine_info = {
@@ -4579,6 +4580,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
@@ -4509,6 +4533,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
} \
type_init(spapr_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
/*
* pseries-5.1
* pseries-5.2
*/
@@ -4644,6 +4646,7 @@ static void spapr_machine_4_1_class_options(MachineClass *mc)
@@ -4588,6 +4613,7 @@ static void spapr_machine_4_1_class_options(MachineClass *mc)
}
DEFINE_SPAPR_MACHINE(4_1, "4.1", false);
@ -71,7 +121,7 @@ index 0ae293ec94..756c8667c1 100644
/*
* pseries-4.0
@@ -4660,6 +4663,7 @@ static void phb_placement_4_0(SpaprMachineState *spapr, uint32_t index,
@@ -4604,6 +4630,7 @@ static void phb_placement_4_0(SpaprMachineState *spapr, uint32_t index,
*nv2atsd = 0;
}
@ -79,7 +129,7 @@ index 0ae293ec94..756c8667c1 100644
static void spapr_machine_4_0_class_options(MachineClass *mc)
{
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
@@ -4819,6 +4823,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
@@ -4762,6 +4789,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
/*
* pseries-2.7
*/
@ -87,7 +137,7 @@ index 0ae293ec94..756c8667c1 100644
static void phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
uint64_t *buid, hwaddr *pio,
@@ -4873,6 +4878,7 @@ static void phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
@@ -4816,6 +4844,7 @@ static void phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
*nv2atsd = 0;
}
@ -95,22 +145,57 @@ index 0ae293ec94..756c8667c1 100644
static void spapr_machine_2_7_class_options(MachineClass *mc)
{
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
@@ -4987,6 +4993,280 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
@@ -4930,6 +4959,314 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len);
}
DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
+#endif
+
+/*
+ * pseries-rhel8.3.0
+ * like pseries-5.1
+ */
+
+static void spapr_machine_rhel830_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+
+ /* Maximum supported VCPU count for all pseries-rhel* machines */
+ mc->max_cpus = 384;
+}
+
+DEFINE_SPAPR_MACHINE(rhel830, "rhel8.3.0", true);
+
+/*
+ * pseries-rhel8.2.0
+ * like pseries-4.2 + pseries-5.0
+ * except SPAPR_CAP_CCF_ASSIST that has been backported to pseries-rhel8.1.0
+ */
+
+static void spapr_machine_rhel820_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ /* from pseries-5.0 */
+ static GlobalProperty compat[] = {
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-5.1-associativity", "on" },
+ };
+
+ spapr_machine_rhel830_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
+
+ /* from pseries-4.2 */
+ smc->default_caps.caps[SPAPR_CAP_FWNMI] = SPAPR_CAP_OFF;
+ smc->rma_limit = 16 * GiB;
+ mc->nvdimm_supported = false;
+
+ /* from pseries-5.0 */
+ mc->numa_mem_supported = true;
+ smc->pre_5_1_assoc_refpoints = true;
+}
+
+DEFINE_SPAPR_MACHINE(rhel820, "rhel8.2.0", true);
+DEFINE_SPAPR_MACHINE(rhel820, "rhel8.2.0", false);
+
+/*
+ * pseries-rhel8.1.0
@ -275,7 +360,6 @@ index 0ae293ec94..756c8667c1 100644
+ spapr_machine_rhel750_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
+ compat_props_add(mc->compat_props, spapr_compat_rhel7_4, spapr_compat_rhel7_4_len);
+ mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
+ smc->has_power9_support = false;
+ smc->pre_2_10_has_unused_icps = true;
+ smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED;
@ -377,7 +461,7 @@ index 0ae293ec94..756c8667c1 100644
static void spapr_machine_register_types(void)
{
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 6a2239d5e5..f228f8bb75 100644
index 55d36e0..008074b 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -24,6 +24,7 @@
@ -388,15 +472,15 @@ index 6a2239d5e5..f228f8bb75 100644
static void spapr_reset_vcpu(PowerPCCPU *cpu)
{
@@ -238,6 +239,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
@@ -250,6 +251,7 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
{
CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu);
Error *local_err = NULL;
+ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
if (!qdev_realize(DEVICE(cpu), NULL, errp)) {
return;
@@ -249,6 +251,17 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
return false;
@@ -261,6 +263,17 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
kvmppc_set_papr(cpu);
@ -408,26 +492,36 @@ index 6a2239d5e5..f228f8bb75 100644
+ ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, 0)))) {
+ error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
+ "POWER9 CPU is not supported by this machine class");
+ return;
+ return false;
+ }
+
if (spapr_irq_cpu_intc_create(spapr, cpu, &local_err) < 0) {
cpu_remove_sync(CPU(cpu));
return;
if (spapr_irq_cpu_intc_create(spapr, cpu, errp) < 0) {
qdev_unrealize(DEVICE(cpu));
return false;
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 3134d339e8..f48089edba 100644
index 2e89e36..ba2d814 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -131,6 +131,7 @@ struct SpaprMachineClass {
hwaddr rma_limit; /* clamp the RMA to this size */
@@ -140,6 +140,7 @@ struct SpaprMachineClass {
bool pre_5_1_assoc_refpoints;
bool pre_5_2_numa_associativity;
+ bool has_power9_support;
void (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
uint64_t *buid, hwaddr *pio,
hwaddr *mmio32, hwaddr *mmio64,
@@ -220,6 +221,9 @@ struct SpaprMachineState {
int fwnmi_machine_check_interlock;
QemuCond fwnmi_machine_check_interlock_cond;
+ /* Secure Guest support via x-svm-allowed */
+ bool svm_allowed;
+
/*< public >*/
char *kvm_type;
char *host_model;
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index 08aede88dc..b193445aca 100644
index e9bec5f..74e3db9 100644
--- a/target/ppc/compat.c
+++ b/target/ppc/compat.c
@@ -114,8 +114,19 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
@ -452,10 +546,10 @@ index 08aede88dc..b193445aca 100644
const CompatInfo *compat = compat_by_pvr(compat_pvr);
const CompatInfo *min = compat_by_pvr(min_compat_pvr);
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index e7d382ac10..3cf209dd90 100644
index 2eb41a2..d850521 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1352,6 +1352,7 @@ static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch)
@@ -1347,6 +1347,7 @@ static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch)
/* Compatibility modes */
#if defined(TARGET_PPC64)
@ -463,6 +557,100 @@ index e7d382ac10..3cf209dd90 100644
bool ppc_check_compat(PowerPCCPU *cpu, uint32_t compat_pvr,
uint32_t min_compat_pvr, uint32_t max_compat_pvr);
bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr,
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index daf690a..9bf3449 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -89,6 +89,7 @@ static int cap_ppc_count_cache_flush_assist;
static int cap_ppc_nested_kvm_hv;
static int cap_large_decr;
static int cap_fwnmi;
+static int cap_ppc_secure_guest;
static uint32_t debug_inst_opcode;
@@ -136,6 +137,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
cap_resize_hpt = kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT);
kvmppc_get_cpu_characteristics(s);
cap_ppc_nested_kvm_hv = kvm_vm_check_extension(s, KVM_CAP_PPC_NESTED_HV);
+ cap_ppc_secure_guest = kvm_vm_check_extension(s, KVM_CAP_PPC_SECURE_GUEST);
cap_large_decr = kvmppc_get_dec_bits();
cap_fwnmi = kvm_vm_check_extension(s, KVM_CAP_PPC_FWNMI);
/*
@@ -2538,6 +2540,16 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable)
return 0;
}
+bool kvmppc_has_cap_secure_guest(void)
+{
+ return !!cap_ppc_secure_guest;
+}
+
+int kvmppc_enable_cap_secure_guest(void)
+{
+ return kvm_vm_enable_cap(kvm_state, KVM_CAP_PPC_SECURE_GUEST, 0, 1);
+}
+
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void)
{
uint32_t host_pvr = mfpvr();
@@ -2947,3 +2959,18 @@ void kvmppc_svm_off(Error **errp)
error_setg_errno(errp, -rc, "KVM_PPC_SVM_OFF ioctl failed");
}
}
+
+void kvmppc_svm_allow(Error **errp)
+{
+ if (!kvm_enabled()) {
+ error_setg(errp, "No PEF support in tcg, try x-svm-allowed=off");
+ return;
+ }
+
+ if (!kvmppc_has_cap_secure_guest()) {
+ error_setg(errp, "KVM implementation does not support secure guests, "
+ "try x-svm-allowed=off");
+ } else if (kvmppc_enable_cap_secure_guest() < 0) {
+ error_setg(errp, "Error enabling x-svm-allowed, try x-svm-allowed=off");
+ }
+}
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index 73ce2bc..1239b84 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -40,6 +40,7 @@ target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu,
bool radix, bool gtse,
uint64_t proc_tbl);
void kvmppc_svm_off(Error **errp);
+void kvmppc_svm_allow(Error **errp);
#ifndef CONFIG_USER_ONLY
bool kvmppc_spapr_use_multitce(void);
int kvmppc_spapr_enable_inkernel_multitce(void);
@@ -73,6 +74,8 @@ int kvmppc_set_cap_nested_kvm_hv(int enable);
int kvmppc_get_cap_large_decr(void);
int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable);
int kvmppc_enable_hwrng(void);
+bool kvmppc_has_cap_secure_guest(void);
+int kvmppc_enable_cap_secure_guest(void);
int kvmppc_put_books_sregs(PowerPCCPU *cpu);
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void);
void kvmppc_check_papr_resize_hpt(Error **errp);
@@ -387,6 +390,16 @@ static inline int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable)
return -1;
}
+static inline bool kvmppc_has_cap_secure_guest(void)
+{
+ return false;
+}
+
+static inline int kvmppc_enable_cap_secure_guest(void)
+{
+ return -1;
+}
+
static inline int kvmppc_enable_hwrng(void)
{
return -1;
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From dc0914b5e43a9925217af8ddde44194176822108 Mon Sep 17 00:00:00 2001
From 79307dba97fef45adfbc03ab46db0460b27ceab9 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:47:32 +0200
Subject: Add s390x machine types
@ -20,17 +20,15 @@ Merged patches (4.2.0):
- fb192e5 redhat: s390x: Rename s390-ccw-virtio-rhel8.0.0 to s390-ccw-virtio-rhel8.1.0
- a9b22e8 redhat: s390x: Add proper compatibility options for the -rhel7.6.0 machine
- hw/s390x: Add the s390-ccw-virtio-rhel8.2.0 machine types (patch 92954)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 71 +++++++++++++++++++++++++++++++++++++-
hw/s390x/s390-virtio-ccw.c | 71 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index e72c61d2ea..a6a37cce94 100644
index 22222c4..68cea20 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -777,7 +777,7 @@ bool css_migration_enabled(void)
@@ -761,7 +761,7 @@ bool css_migration_enabled(void)
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
ccw_machine_##suffix##_class_options(mc); \
@ -39,15 +37,15 @@ index e72c61d2ea..a6a37cce94 100644
if (latest) { \
mc->alias = "s390-ccw-virtio"; \
mc->is_default = true; \
@@ -801,6 +801,7 @@ bool css_migration_enabled(void)
@@ -785,6 +785,7 @@ bool css_migration_enabled(void)
} \
type_init(ccw_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void ccw_machine_5_1_instance_options(MachineState *machine)
static void ccw_machine_5_2_instance_options(MachineState *machine)
{
}
@@ -1053,6 +1054,74 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
@@ -1049,6 +1050,74 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
}
DEFINE_CCW_MACHINE(2_4, "2.4", false);
@ -116,12 +114,12 @@ index e72c61d2ea..a6a37cce94 100644
+ ccw_machine_rhel760_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
+ compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len);
+ S390_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
+ S390_CCW_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
+}
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
static void ccw_machine_register_types(void)
{
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From 45d5ef7594e5b07d3a975feea8e72541402a797f Mon Sep 17 00:00:00 2001
From 4c6e7a672399b3962d904c2b01e8844544383d89 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:10:31 +0200
Subject: Add x86_64 machine types
@ -37,29 +37,32 @@ Merged patches (4.2.0):
- 0784125 x86 machine types: add pc-q35-rhel8.1.0
- machines/x86: Add rhel 8.2 machine type (patch 92959)
Merged patches (weekly-200122):
Merged patches (5.1.0):
- 481357e RHEL: hw/i386: disable nested PERF_GLOBAL_CTRL MSR support
Merged patches (weekly-200318):
- e6c3fbf hw/smbios: set new default SMBIOS fields for Windows driver support (partialy)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- b02c9f5 x86: Add 8.3.0 x86_64 machine type
- f2edc4f q35: Set max_cpus to 512
- 6d7ba66 machine types/numa: set numa_mem_supported on old machine types (partialy)
- 25c5644 machine_types/numa: compatibility for auto_enable_numa_with_memdev (partialy)
- e2d3209 x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features (partialy)
---
hw/i386/acpi-build.c | 3 +
hw/i386/pc.c | 265 ++++++++++++++++++++++++++++++++++++++++++-
hw/i386/pc_piix.c | 210 +++++++++++++++++++++++++++++++++-
hw/i386/pc_q35.c | 162 +++++++++++++++++++++++++-
hw/i386/pc.c | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++-
hw/i386/pc_piix.c | 215 +++++++++++++++++++++++++++++++++++++++-
hw/i386/pc_q35.c | 185 +++++++++++++++++++++++++++++++++-
include/hw/boards.h | 2 +
include/hw/i386/pc.h | 33 ++++++
include/hw/i386/pc.h | 36 +++++++
target/i386/cpu.c | 3 +-
target/i386/kvm.c | 4 +
8 files changed, 675 insertions(+), 7 deletions(-)
8 files changed, 714 insertions(+), 7 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index b7bcbbbb2a..fe815c5403 100644
index 4f66642..78f50d4 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -212,6 +212,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
@@ -217,6 +217,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
pm->fadt.reset_reg = r;
pm->fadt.reset_val = 0xf;
pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP;
@ -67,13 +70,13 @@ index b7bcbbbb2a..fe815c5403 100644
+ "__com.redhat_force-rev1-fadt", NULL))
+ pm->fadt.rev = 1;
pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
}
pm->smi_on_cpuhp =
!!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT));
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 47c5ca3e34..063f01d19a 100644
index 17b514d..f3fc695 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -347,6 +347,263 @@ GlobalProperty pc_compat_1_4[] = {
@@ -352,6 +352,271 @@ GlobalProperty pc_compat_1_4[] = {
};
const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
@ -88,9 +91,17 @@ index 47c5ca3e34..063f01d19a 100644
+ { TYPE_X86_CPU, "vmx-exit-load-perf-global-ctrl", "off" },
+ /* bz 1508330 */
+ { "vfio-pci", "x-no-geforce-quirks", "on" },
+ /* BZ 1846886 */
+ { "ICH9-LPC", "x-smi-cpu-hotplug", "off" },
+};
+const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat);
+
+GlobalProperty pc_rhel_8_2_compat[] = {
+ /* pc_rhel_8_2_compat from pc_compat_4_2 */
+ { "mch", "smbase-smram", "off" },
+};
+const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat);
+
+/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */
+GlobalProperty pc_rhel_8_1_compat[] = { };
+const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat);
@ -337,7 +348,7 @@ index 47c5ca3e34..063f01d19a 100644
GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
{
GSIState *s;
@@ -1012,7 +1269,8 @@ void pc_memory_init(PCMachineState *pcms,
@@ -970,7 +1235,8 @@ void pc_memory_init(PCMachineState *pcms,
option_rom_mr = g_malloc(sizeof(*option_rom_mr));
memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
&error_fatal);
@ -347,17 +358,17 @@ index 47c5ca3e34..063f01d19a 100644
memory_region_set_readonly(option_rom_mr, true);
}
memory_region_add_subregion_overlap(rom_memory,
@@ -1956,6 +2214,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->linuxboot_dma_enabled = true;
@@ -1674,6 +1940,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->pvh_enabled = true;
pcmc->kvmclock_create_always = true;
assert(!mc->get_hotplug_handler);
+ pcmc->pc_rom_ro = true;
+ mc->async_pf_vmexit_disable = false;
mc->get_hotplug_handler = pc_get_hotplug_handler;
mc->hotplug_allowed = pc_hotplug_allowed;
mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
@@ -1968,7 +2228,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->hot_add_cpu = pc_hot_add_cpu;
@@ -1685,7 +1953,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->default_boot_order = "cad";
mc->smp_parse = pc_smp_parse;
mc->block_default_type = IF_IDE;
- mc->max_cpus = 255;
@ -367,7 +378,7 @@ index 47c5ca3e34..063f01d19a 100644
mc->wakeup = pc_machine_wakeup;
hc->pre_plug = pc_machine_device_pre_plug_cb;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 0ecdd57689..6d935645b6 100644
index 9fcc5aa..815da79 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -54,6 +54,7 @@
@ -397,7 +408,7 @@ index 0ecdd57689..6d935645b6 100644
static void pc_compat_2_3_fn(MachineState *machine)
{
X86MachineState *x86ms = X86_MACHINE(machine);
@@ -994,3 +996,207 @@ static void xenfv_3_1_machine_options(MachineClass *m)
@@ -1007,3 +1009,212 @@ static void xenfv_3_1_machine_options(MachineClass *m)
DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
xenfv_3_1_machine_options);
#endif
@ -414,6 +425,8 @@ index 0ecdd57689..6d935645b6 100644
+ pcmc->default_nic_model = "e1000";
+ m->default_display = "std";
+ m->no_parallel = 1;
+ m->numa_mem_supported = true;
+ m->auto_enable_numa_with_memdev = false;
+ machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
+ compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
+ m->alias = "pc";
@ -435,6 +448,10 @@ index 0ecdd57689..6d935645b6 100644
+ m->smbus_no_migration_support = true;
+ pcmc->pvh_enabled = false;
+ pcmc->default_cpu_version = CPU_VERSION_LEGACY;
+ compat_props_add(m->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+ compat_props_add(m->compat_props, pc_rhel_8_2_compat,
+ pc_rhel_8_2_compat_len);
+ compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
+ compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len);
+ compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
@ -477,7 +494,6 @@ index 0ecdd57689..6d935645b6 100644
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
+ pc_machine_rhel750_options(m);
+ m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
+ m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
+ pcmc->pc_rom_ro = false;
+ compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
+ compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
@ -606,10 +622,10 @@ index 0ecdd57689..6d935645b6 100644
+DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
+ pc_machine_rhel700_options);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index b8ea764ce3..f4edb049d6 100644
index f6c2ef4..3340008 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -201,8 +201,8 @@ static void pc_q35_init(MachineState *machine)
@@ -195,8 +195,8 @@ static void pc_q35_init(MachineState *machine)
if (pcmc->smbios_defaults) {
/* These values are guest ABI, do not change */
@ -620,7 +636,7 @@ index b8ea764ce3..f4edb049d6 100644
pcmc->smbios_uuid_encoded,
pcmc->smbios_stream_product,
pcmc->smbios_stream_version,
@@ -336,6 +336,7 @@ static void pc_q35_init(MachineState *machine)
@@ -327,6 +327,7 @@ static void pc_q35_init(MachineState *machine)
DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
@ -628,7 +644,7 @@ index b8ea764ce3..f4edb049d6 100644
static void pc_q35_machine_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
@@ -564,3 +565,160 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
@@ -568,3 +569,183 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
pc_q35_2_4_machine_options);
@ -652,10 +668,27 @@ index b8ea764ce3..f4edb049d6 100644
+ machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
+ machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
+ m->alias = "q35";
+ m->max_cpus = 384;
+ m->max_cpus = 512;
+ compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
+}
+
+static void pc_q35_init_rhel830(MachineState *machine)
+{
+ pc_q35_init(machine);
+}
+
+static void pc_q35_machine_rhel830_options(MachineClass *m)
+{
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
+ pc_q35_machine_rhel_options(m);
+ m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)";
+ pcmc->smbios_stream_product = "RHEL-AV";
+ pcmc->smbios_stream_version = "8.3.0";
+}
+
+DEFINE_PC_MACHINE(q35_rhel830, "pc-q35-rhel8.3.0", pc_q35_init_rhel830,
+ pc_q35_machine_rhel830_options);
+
+static void pc_q35_init_rhel820(MachineState *machine)
+{
+ pc_q35_init(machine);
@ -666,8 +699,15 @@ index b8ea764ce3..f4edb049d6 100644
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
+ pc_q35_machine_rhel_options(m);
+ m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)";
+ m->alias = NULL;
+ m->numa_mem_supported = true;
+ m->auto_enable_numa_with_memdev = false;
+ pcmc->smbios_stream_product = "RHEL-AV";
+ pcmc->smbios_stream_version = "8.2.0";
+ compat_props_add(m->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+ compat_props_add(m->compat_props, pc_rhel_8_2_compat,
+ pc_rhel_8_2_compat_len);
+}
+
+DEFINE_PC_MACHINE(q35_rhel820, "pc-q35-rhel8.2.0", pc_q35_init_rhel820,
@ -762,7 +802,6 @@ index b8ea764ce3..f4edb049d6 100644
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
+ pc_q35_machine_rhel750_options(m);
+ m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
+ m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
+ pcmc->pc_rom_ro = false;
+ compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
+ compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
@ -790,39 +829,42 @@ index b8ea764ce3..f4edb049d6 100644
+DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730,
+ pc_q35_machine_rhel730_options);
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 1062df96c0..c3577319c0 100644
index dd18c9e..4e4a54b 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -208,6 +208,8 @@ struct MachineClass {
@@ -202,6 +202,8 @@ struct MachineClass {
strList *allowed_dynamic_sysbus_devices;
bool auto_enable_numa_with_memhp;
bool auto_enable_numa_with_memdev;
+ /* RHEL only */
+ bool async_pf_vmexit_disable;
void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
int nb_nodes, ram_addr_t size);
bool ignore_boot_device_suffixes;
bool smbus_no_migration_support;
bool nvdimm_supported;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 951e825778..156be22995 100644
index ae6bf1d..e2ba9a4 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -121,6 +121,9 @@ typedef struct PCMachineClass {
@@ -125,6 +125,9 @@ struct PCMachineClass {
/* use PVH to load kernels that support this feature */
bool pvh_enabled;
+
/* create kvmclock device even when KVM PV features are not exposed */
bool kvmclock_create_always;
+
+ /* RH only, see bz 1489800 */
+ bool pc_rom_ro;
} PCMachineClass;
};
#define TYPE_PC_MACHINE "generic-pc-machine"
@@ -265,6 +268,36 @@ extern const size_t pc_compat_1_5_len;
@@ -266,6 +269,39 @@ extern const size_t pc_compat_1_5_len;
extern GlobalProperty pc_compat_1_4[];
extern const size_t pc_compat_1_4_len;
+extern GlobalProperty pc_rhel_compat[];
+extern const size_t pc_rhel_compat_len;
+
+extern GlobalProperty pc_rhel_8_2_compat[];
+extern const size_t pc_rhel_8_2_compat_len;
+
+extern GlobalProperty pc_rhel_8_1_compat[];
+extern const size_t pc_rhel_8_1_compat_len;
+
@ -854,10 +896,10 @@ index 951e825778..156be22995 100644
* depending on QEMU versions up to QEMU 2.4.
*/
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 030a5a09ed..cdaa1463f2 100644
index 0d86069..dd52fe5 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1830,7 +1830,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
@@ -1803,7 +1803,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
.level = 0xd,
.vendor = CPUID_VENDOR_AMD,
.family = 6,
@ -866,7 +908,7 @@ index 030a5a09ed..cdaa1463f2 100644
.stepping = 3,
.features[FEAT_1_EDX] =
PPRO_FEATURES |
@@ -4142,6 +4142,7 @@ static PropValue kvm_default_props[] = {
@@ -4117,6 +4117,7 @@ static PropValue kvm_default_props[] = {
{ "acpi", "off" },
{ "monitor", "off" },
{ "svm", "off" },
@ -875,10 +917,10 @@ index 030a5a09ed..cdaa1463f2 100644
};
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 6f18d940a5..98249b2e3b 100644
index cf46259..4e58c09 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -3135,6 +3135,7 @@ static int kvm_get_msrs(X86CPU *cpu)
@@ -3124,6 +3124,7 @@ static int kvm_get_msrs(X86CPU *cpu)
struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries;
int ret, i;
uint64_t mtrr_top_bits;
@ -886,7 +928,7 @@ index 6f18d940a5..98249b2e3b 100644
kvm_msr_buf_reset(cpu);
@@ -3444,6 +3445,9 @@ static int kvm_get_msrs(X86CPU *cpu)
@@ -3436,6 +3437,9 @@ static int kvm_get_msrs(X86CPU *cpu)
break;
case MSR_KVM_ASYNC_PF_EN:
env->async_pf_en_msr = msrs[i].data;
@ -894,8 +936,8 @@ index 6f18d940a5..98249b2e3b 100644
+ env->async_pf_en_msr &= ~(1ULL << 2);
+ }
break;
case MSR_KVM_PV_EOI_EN:
env->pv_eoi_en_msr = msrs[i].data;
case MSR_KVM_ASYNC_PF_INT:
env->async_pf_int_msr = msrs[i].data;
--
2.27.0
1.8.3.1

View File

@ -1,6 +1,6 @@
From 69de445124e71df949a3d5289f8a10a5f771bac2 Mon Sep 17 00:00:00 2001
From 1170780d2fdd4cb8b663603c4d509d65b2e05846 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:48:41 +0200
Date: Wed, 2 Sep 2020 09:39:41 +0200
Subject: Enable make check
Fixing tests after device disabling and machine types changes and enabling
@ -22,37 +22,36 @@ Rebase changes (4.1.0-rc1):
Rebase changes (4.2.0-rc0):
- partially disable hd-geo-test (requires lsi53c895a)
Rebase changes (weekly-200129):
- Disable qtest/q35-test (uses upstream machine types)
Rebased changes (weekly-200212):
- Do not run iotests on make checka
Rebase changes (5.1.0-rc1):
- Disable qtest/q35-test (uses upstream machine types)
- Do not run iotests on make checka
- Enabled iotests 071 and 099
Rebase changes (5.2.0 rc0):
- Disable cdrom tests (unsupported devices) on x86_64
- disable fuzz test
Merged patches (4.0.0):
- f7ffd13 Remove 7 qcow2 and luks iotests that are taking > 25 sec to run during the fast train build proce
Merged patches (4.1.0-rc0):
- 41288ff redhat: Remove raw iotest 205
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
redhat/qemu-kvm.spec.template | 2 +-
tests/qemu-iotests/051 | 12 ++++++------
tests/qtest/Makefile.include | 12 ++++++------
tests/qtest/boot-serial-test.c | 6 +++++-
tests/qtest/cdrom-test.c | 2 ++
tests/qtest/cpu-plug-test.c | 4 ++--
tests/qtest/e1000-test.c | 2 ++
tests/qtest/hd-geo-test.c | 4 ++++
tests/qtest/meson.build | 10 ++--------
tests/qtest/prom-env-test.c | 4 ++++
tests/qtest/test-x86-cpuid-compat.c | 2 ++
tests/qtest/usb-hcd-xhci-test.c | 4 ++++
10 files changed, 36 insertions(+), 16 deletions(-)
11 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index bee26075b2..61d25c4ed7 100755
index bee2607..61d25c4 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -183,11 +183,11 @@ run_qemu -drive if=virtio
@ -85,59 +84,8 @@ index bee26075b2..61d25c4ed7 100755
;;
*)
;;
diff --git a/tests/qtest/Makefile.include b/tests/qtest/Makefile.include
index b0204e44f2..cf8a138791 100644
--- a/tests/qtest/Makefile.include
+++ b/tests/qtest/Makefile.include
@@ -29,7 +29,7 @@ check-qtest-i386-y += ide-test
check-qtest-i386-$(CONFIG_TOOLS) += ahci-test
check-qtest-i386-y += hd-geo-test
check-qtest-i386-y += boot-order-test
-check-qtest-i386-y += bios-tables-test
+#check-qtest-i386-y += bios-tables-test
check-qtest-i386-$(CONFIG_SGA) += boot-serial-test
check-qtest-i386-$(CONFIG_SLIRP) += pxe-test
check-qtest-i386-y += rtc-test
@@ -51,7 +51,7 @@ check-qtest-i386-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test
check-qtest-i386-$(call land,$(CONFIG_USB_EHCI),$(CONFIG_USB_UHCI)) += usb-hcd-ehci-test
check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test
check-qtest-i386-y += cpu-plug-test
-check-qtest-i386-y += q35-test
+#check-qtest-i386-y += q35-test
check-qtest-i386-y += vmgenid-test
check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-swtpm-test
check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-test
@@ -90,7 +90,7 @@ check-qtest-mips64el-$(CONFIG_VGA) += display-vga-test
check-qtest-moxie-y += boot-serial-test
check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = endianness-test
-check-qtest-ppc-y += boot-order-test
+#check-qtest-ppc-y += boot-order-test
check-qtest-ppc-y += prom-env-test
check-qtest-ppc-y += drive_del-test
check-qtest-ppc-y += boot-serial-test
@@ -104,8 +104,8 @@ check-qtest-ppc64-$(CONFIG_PSERIES) += rtas-test
check-qtest-ppc64-$(CONFIG_SLIRP) += pxe-test
check-qtest-ppc64-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test
check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test
-check-qtest-ppc64-$(CONFIG_SLIRP) += test-netfilter
-check-qtest-ppc64-$(CONFIG_POSIX) += test-filter-mirror
+#check-qtest-ppc64-$(CONFIG_SLIRP) += test-netfilter
+#check-qtest-ppc64-$(CONFIG_POSIX) += test-filter-mirror
check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += test-filter-redirector
check-qtest-ppc64-$(CONFIG_VGA) += display-vga-test
check-qtest-ppc64-y += numa-test
@@ -154,7 +154,7 @@ check-qtest-s390x-$(CONFIG_SLIRP) += test-netfilter
check-qtest-s390x-$(CONFIG_POSIX) += test-filter-mirror
check-qtest-s390x-$(CONFIG_POSIX) += test-filter-redirector
check-qtest-s390x-y += drive_del-test
-check-qtest-s390x-y += device-plug-test
+#check-qtest-s390x-y += device-plug-test
check-qtest-s390x-y += virtio-ccw-test
check-qtest-s390x-y += cpu-plug-test
check-qtest-s390x-y += migration-test
diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
index bfe7624dc6..1ffaa0bd7e 100644
index b6b1c23..cefa1b3 100644
--- a/tests/qtest/boot-serial-test.c
+++ b/tests/qtest/boot-serial-test.c
@@ -120,19 +120,23 @@ static testdef_t tests[] = {
@ -165,11 +113,31 @@ index bfe7624dc6..1ffaa0bd7e 100644
{ "x86_64", "q35", "-device sga", "SGABIOS" },
{ "sparc", "LX", "", "TMS390S10" },
{ "sparc", "SS-4", "", "MB86904" },
diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
index 5af944a..cd5b8e0 100644
--- a/tests/qtest/cdrom-test.c
+++ b/tests/qtest/cdrom-test.c
@@ -140,6 +140,7 @@ static void add_x86_tests(void)
qtest_add_data_func("cdrom/boot/isapc", "-M isapc "
"-drive if=ide,media=cdrom,file=", test_cdboot);
}
+#if 0 /* Disabled for Red Hat Enterprise Linux */
qtest_add_data_func("cdrom/boot/am53c974",
"-device am53c974 -device scsi-cd,drive=cd1 "
"-drive if=none,id=cd1,format=raw,file=", test_cdboot);
@@ -155,6 +156,7 @@ static void add_x86_tests(void)
qtest_add_data_func("cdrom/boot/megasas-gen2", "-M q35 "
"-device megasas-gen2 -device scsi-cd,drive=cd1 "
"-blockdev file,node-name=cd1,filename=", test_cdboot);
+#endif
}
static void add_s390x_tests(void)
diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
index e8ffbbce4b..fda7269c82 100644
index a1c6894..a8f0767 100644
--- a/tests/qtest/cpu-plug-test.c
+++ b/tests/qtest/cpu-plug-test.c
@@ -181,8 +181,8 @@ static void add_pseries_test_case(const char *mname)
@@ -110,8 +110,8 @@ static void add_pseries_test_case(const char *mname)
char *path;
PlugTestData *data;
@ -181,7 +149,7 @@ index e8ffbbce4b..fda7269c82 100644
}
data = g_new(PlugTestData, 1);
diff --git a/tests/qtest/e1000-test.c b/tests/qtest/e1000-test.c
index c387984ef6..c89112d6f8 100644
index ea286d1..a1847ac 100644
--- a/tests/qtest/e1000-test.c
+++ b/tests/qtest/e1000-test.c
@@ -22,9 +22,11 @@ struct QE1000 {
@ -197,7 +165,7 @@ index c387984ef6..c89112d6f8 100644
static void *e1000_get_driver(void *obj, const char *interface)
diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c
index 48e8e02d6e..6496196b07 100644
index f7b7cfb..99cccf8 100644
--- a/tests/qtest/hd-geo-test.c
+++ b/tests/qtest/hd-geo-test.c
@@ -737,6 +737,7 @@ static void test_override_ide(void)
@ -228,8 +196,57 @@ index 48e8e02d6e..6496196b07 100644
qtest_add_func("hd-geo/override/virtio_blk", test_override_virtio_blk);
qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs);
qtest_add_func("hd-geo/override/scsi_hot_unplug",
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index c19f1c8..15ed460 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -51,16 +51,13 @@ qtests_i386 = \
'ide-test',
'hd-geo-test',
'boot-order-test',
- 'bios-tables-test',
'rtc-test',
'i440fx-test',
- 'fuzz-test',
'fw_cfg-test',
'device-plug-test',
'drive_del-test',
'tco-test',
'cpu-plug-test',
- 'q35-test',
'vmgenid-test',
'migration-test',
'test-x86-cpuid-compat',
@@ -111,17 +108,15 @@ qtests_moxie = [ 'boot-serial-test' ]
qtests_ppc = \
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
- (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
- ['boot-order-test', 'prom-env-test', 'boot-serial-test'] \
+ (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : [])
qtests_ppc64 = \
(config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
(config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
(config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
- (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
+ (slirp.found() ? ['pxe-test'] : []) + \
(config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
(config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
- (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
@@ -164,7 +159,6 @@ qtests_s390x = \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
['boot-serial-test',
'drive_del-test',
- 'device-plug-test',
'virtio-ccw-test',
'cpu-plug-test',
'migration-test']
diff --git a/tests/qtest/prom-env-test.c b/tests/qtest/prom-env-test.c
index 60e6ec3153..f9d6adcfe9 100644
index f41d801..f8dc478 100644
--- a/tests/qtest/prom-env-test.c
+++ b/tests/qtest/prom-env-test.c
@@ -89,10 +89,14 @@ int main(int argc, char *argv[])
@ -248,7 +265,7 @@ index 60e6ec3153..f9d6adcfe9 100644
add_tests(sparc_machines);
} else if (!strcmp(arch, "sparc64")) {
diff --git a/tests/qtest/test-x86-cpuid-compat.c b/tests/qtest/test-x86-cpuid-compat.c
index 7ca1883a29..983aa0719a 100644
index 7ca1883..983aa07 100644
--- a/tests/qtest/test-x86-cpuid-compat.c
+++ b/tests/qtest/test-x86-cpuid-compat.c
@@ -300,6 +300,7 @@ int main(int argc, char **argv)
@ -268,7 +285,7 @@ index 7ca1883a29..983aa0719a 100644
/* Test feature parsing */
add_feature_test("x86/cpuid/features/plus",
diff --git a/tests/qtest/usb-hcd-xhci-test.c b/tests/qtest/usb-hcd-xhci-test.c
index 10ef9d2a91..3855873050 100644
index 10ef9d2..3855873 100644
--- a/tests/qtest/usb-hcd-xhci-test.c
+++ b/tests/qtest/usb-hcd-xhci-test.c
@@ -21,6 +21,7 @@ static void test_xhci_hotplug(void)
@ -298,5 +315,5 @@ index 10ef9d2a91..3855873050 100644
qtest_start("-device nec-usb-xhci,id=xhci"
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From 08d751996b6c983d037134551f1c4b4691989168 Mon Sep 17 00:00:00 2001
From 3bf885effef5666a13145e7942116ed9ba5039bb Mon Sep 17 00:00:00 2001
From: Bandan Das <bsd@redhat.com>
Date: Tue, 3 Dec 2013 20:05:13 +0100
Subject: vfio: cap number of devices that can be assigned
@ -32,20 +32,16 @@ Merged patches (2.9.0):
Merged patches (4.1.0-rc3):
- 2b89558 vfio: increase the cap on number of assigned devices to 64
(cherry picked from commit 9fa3c9fc6dfcde76d80db1aa601b2d577f72ceec)
(cherry picked from commit 3cb35556dc7d994f203d732fe952f95fcdb03c0a)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/vfio/pci.c | 29 ++++++++++++++++++++++++++++-
hw/vfio/pci.h | 1 +
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2e561c06d6..be1b843e7f 100644
index 58c0ce8..558eea8 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -47,6 +47,9 @@
@@ -45,6 +45,9 @@
#define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
@ -55,7 +51,7 @@ index 2e561c06d6..be1b843e7f 100644
static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
@@ -2712,9 +2715,30 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
@@ -2768,9 +2771,30 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
ssize_t len;
struct stat st;
int groupid;
@ -87,7 +83,7 @@ index 2e561c06d6..be1b843e7f 100644
if (!vdev->vbasedev.sysfsdev) {
if (!(~vdev->host.domain || ~vdev->host.bus ||
~vdev->host.slot || ~vdev->host.function)) {
@@ -3158,6 +3182,9 @@ static Property vfio_pci_dev_properties[] = {
@@ -3202,6 +3226,9 @@ static Property vfio_pci_dev_properties[] = {
DEFINE_PROP_BOOL("x-no-kvm-msix", VFIOPCIDevice, no_kvm_msix, false),
DEFINE_PROP_BOOL("x-no-geforce-quirks", VFIOPCIDevice,
no_geforce_quirks, false),
@ -98,10 +94,10 @@ index 2e561c06d6..be1b843e7f 100644
false),
DEFINE_PROP_BOOL("x-no-vfio-ioeventfd", VFIOPCIDevice, no_vfio_ioeventfd,
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index 0da7a20a7e..5d2b0d2f2d 100644
index 1574ef9..fef907c 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -135,6 +135,7 @@ typedef struct VFIOPCIDevice {
@@ -139,6 +139,7 @@ struct VFIOPCIDevice {
EventNotifier err_notifier;
EventNotifier req_notifier;
int (*resetfn)(struct VFIOPCIDevice *);
@ -110,5 +106,5 @@ index 0da7a20a7e..5d2b0d2f2d 100644
uint32_t device_id;
uint32_t sub_vendor_id;
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From 5ee503bc80a271f9b0fcf3d24df42ee3f8c7d687 Mon Sep 17 00:00:00 2001
From 107ded716aa28243015b41940e660fe72dd4d3de Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 4 Dec 2013 18:53:17 +0100
Subject: Add support statement to -help output
@ -16,18 +16,15 @@ Add support statement to -help output, reporting direct qemu-kvm usage
as unsupported by Red Hat, and advising users to use libvirt instead.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 2a07700936e39856cc9f149c6a6517f0715536a6)
(cherry picked from commit 5dd2f4706e2fef945771949e59a8fcc1b5452de9)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
softmmu/vl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index a1fb06dca0..3c383911cd 100644
index a711644..f951684 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1686,9 +1686,17 @@ static void version(void)
@@ -1687,9 +1687,17 @@ static void version(void)
QEMU_COPYRIGHT "\n");
}
@ -45,7 +42,7 @@ index a1fb06dca0..3c383911cd 100644
printf("usage: %s [options] [disk_image]\n\n"
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
error_get_progname());
@@ -1705,6 +1713,7 @@ static void help(int exitcode)
@@ -1706,6 +1714,7 @@ static void help(int exitcode)
"\n"
QEMU_HELP_BOTTOM "\n");
@ -54,5 +51,5 @@ index a1fb06dca0..3c383911cd 100644
}
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From edf9e38a2ef58908f45e37a63746926a494f9057 Mon Sep 17 00:00:00 2001
From e3883f9d6e74843fd14d44cdf2d36b35123347a3 Mon Sep 17 00:00:00 2001
From: Andrew Jones <drjones@redhat.com>
Date: Tue, 21 Jan 2014 10:46:52 +0100
Subject: globally limit the maximum number of CPUs
@ -25,67 +25,23 @@ Merged patches (2.11.0):
- 0584216921 Match POWER max cpus to x86
Signed-off-by: Andrew Jones <drjones@redhat.com>
(cherry picked from commit a4ceb63bdc5cbac19f5f633ec761b9de0dedb55e)
(cherry picked from commit a1f26d85171b4d554225150053700e93ba6eba10)
redhat: globally limit the maximum number of CPUs
Merged patches (5.1.0):
- redhat: globally limit the maximum number of CPUs
- redhat: remove manual max_cpus limitations for ppc
- use recommended max vcpu count
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20180109103253.24517-2-david@redhat.com>
Patchwork-id: 78531
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH v2 1/2] redhat: globally limit the maximum number of CPUs
Bugzilla: 1527449
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Upstream-status: n/a
For RHEL, we support 240, for RHV up to 384 VCPUs. Let's limit this
globally instead of fixing up all machines. This way, we can easily
change (increase) the product specific levels later.
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
redhat: remove manual max_cpus limitations for ppc
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20180109103253.24517-3-david@redhat.com>
Patchwork-id: 78532
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH v2 2/2] redhat: remove manual max_cpus limitations for ppc
Bugzilla: 1527449
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Upstream-status: n/a
RH-Author: Andrew Jones <drjones@redhat.com>
Message-id: <1390301212-15344-1-git-send-email-drjones@redhat.com>
Patchwork-id: 56862
O-Subject: [RHEL7.0 qemu-kvm PATCH v6] use recommended max vcpu count
Bugzilla: 998708
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
The recommended vcpu max limit (KVM_CAP_NR_VCPUS) should be used instead
of the actual max vcpu limit (KVM_CAP_MAX_VCPUS) to give an error.
This commit matches the limit to current KVM_CAP_NR_VCPUS value.
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Merged patches (5.2.0 rc0):
- f8a4123 vl: Remove downstream-only MAX_RHEL_CPUS code
---
accel/kvm/kvm-all.c | 12 ++++++++++++
softmmu/vl.c | 18 ++++++++++++++++++
2 files changed, 30 insertions(+)
1 file changed, 12 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 63ef6af9a1..db9a6b38b1 100644
index 9ef5daf..4fab04d 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2088,6 +2088,18 @@ static int kvm_init(MachineState *ms)
@@ -2108,6 +2108,18 @@ static int kvm_init(MachineState *ms)
soft_vcpus_limit = kvm_recommended_vcpus(s);
hard_vcpus_limit = kvm_max_vcpus(s);
@ -104,49 +60,6 @@ index 63ef6af9a1..db9a6b38b1 100644
while (nc->name) {
if (nc->num > soft_vcpus_limit) {
warn_report("Number of %s cpus requested (%d) exceeds "
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3c383911cd..62fc7c898f 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -116,6 +116,8 @@
#define MAX_VIRTIO_CONSOLES 1
+#define RHEL_MAX_CPUS 384
+
static const char *data_dir[16];
static int data_dir_idx;
const char *bios_name = NULL;
@@ -1189,6 +1191,20 @@ static MachineClass *find_default_machine(GSList *machines)
return default_machineclass;
}
+/* Maximum number of CPUs limited for Red Hat Enterprise Linux */
+static void limit_max_cpus_in_machines(void)
+{
+ GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
+
+ for (el = machines; el; el = el->next) {
+ MachineClass *mc = el->data;
+
+ if (mc->max_cpus > RHEL_MAX_CPUS) {
+ mc->max_cpus = RHEL_MAX_CPUS;
+ }
+ }
+}
+
static int machine_help_func(QemuOpts *opts, MachineState *machine)
{
ObjectProperty *prop;
@@ -3845,6 +3861,8 @@ void qemu_init(int argc, char **argv, char **envp)
"mutually exclusive");
exit(EXIT_FAILURE);
}
+ /* Maximum number of CPUs limited for Red Hat Enterprise Linux */
+ limit_max_cpus_in_machines();
configure_rtc(qemu_find_opts_singleton("rtc"));
--
2.27.0
1.8.3.1

View File

@ -1,124 +0,0 @@
From 9238ce7ba819979c2df2caa49c5db3185376fedd Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Thu, 8 Oct 2015 09:50:17 +0200
Subject: Add support for simpletrace
As simpletrace is upstream, we just need to properly handle it during rpmbuild.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase notes (3.1.0):
- Fixed python 2 to python3 switch
Rebase notes (2.9.0):
- Added group argument for tracetool.py (upstream)
Rebase notes (2.8.0):
- Changed tracetool.py parameters
Rebase notes (weekly-200219):
- Removed python shenigan (done upstream)
Merged patches (2.3.0):
- db959d6 redhat/qemu-kvm.spec.template: Install qemu-kvm-simpletrace.stp
- 5292fc3 trace: add SystemTap init scripts for simpletrace bridge
- eda9e5e simpletrace: install simpletrace.py
- 85c4c8f trace: add systemtap-initscript README file to RPM
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
.gitignore | 2 ++
Makefile | 4 +++
README.systemtap | 43 +++++++++++++++++++++++++
redhat/qemu-kvm.spec.template | 25 +++++++++++++-
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +++
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
6 files changed, 78 insertions(+), 1 deletion(-)
create mode 100644 README.systemtap
create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf
create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp
diff --git a/Makefile b/Makefile
index 42e854b2b1..3b9ff25f10 100644
--- a/Makefile
+++ b/Makefile
@@ -996,6 +996,10 @@ endif
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
done
$(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/systemtap/script.d"
+ $(INSTALL_DATA) $(SRC_PATH)/scripts/systemtap/script.d/qemu_kvm.stp "$(DESTDIR)$(qemu_datadir)/systemtap/script.d/"
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/systemtap/conf.d"
+ $(INSTALL_DATA) $(SRC_PATH)/scripts/systemtap/conf.d/qemu_kvm.conf "$(DESTDIR)$(qemu_datadir)/systemtap/conf.d/"
.PHONY: ctags
ctags:
diff --git a/README.systemtap b/README.systemtap
new file mode 100644
index 0000000000..ad913fc990
--- /dev/null
+++ b/README.systemtap
@@ -0,0 +1,43 @@
+QEMU tracing using systemtap-initscript
+---------------------------------------
+
+You can capture QEMU trace data all the time using systemtap-initscript. This
+uses SystemTap's flight recorder mode to trace all running guests to a
+fixed-size buffer on the host. Old trace entries are overwritten by new
+entries when the buffer size wraps.
+
+1. Install the systemtap-initscript package:
+ # yum install systemtap-initscript
+
+2. Install the systemtap scripts and the conf file:
+ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/
+ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/
+
+The set of trace events to enable is given in qemu_kvm.stp. This SystemTap
+script can be customized to add or remove trace events provided in
+/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp.
+
+SystemTap customizations can be made to qemu_kvm.conf to control the flight
+recorder buffer size and whether to store traces in memory only or disk too.
+See stap(1) for option documentation.
+
+3. Start the systemtap service.
+ # service systemtap start qemu_kvm
+
+4. Make the service start at boot time.
+ # chkconfig systemtap on
+
+5. Confirm that the service works.
+ # service systemtap status qemu_kvm
+ qemu_kvm is running...
+
+When you want to inspect the trace buffer, perform the following steps:
+
+1. Dump the trace buffer.
+ # staprun -A qemu_kvm >/tmp/trace.log
+
+2. Start the systemtap service because the preceding step stops the service.
+ # service systemtap start qemu_kvm
+
+3. Translate the trace record to readable format.
+ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log
diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf
new file mode 100644
index 0000000000..372d8160a4
--- /dev/null
+++ b/scripts/systemtap/conf.d/qemu_kvm.conf
@@ -0,0 +1,4 @@
+# Force load uprobes (see BZ#1118352)
+stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true
+
+qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes
diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp
new file mode 100644
index 0000000000..c04abf9449
--- /dev/null
+++ b/scripts/systemtap/script.d/qemu_kvm.stp
@@ -0,0 +1 @@
+probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {}
--
2.27.0

View File

@ -1,4 +1,4 @@
From 44c255eddd3096d63ebdc055181d3fcebe202eef Mon Sep 17 00:00:00 2001
From 4f1d9fa771f3932ab14319a9df8cb37e1c9f7547 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 8 Jul 2020 08:35:50 +0200
Subject: Use qemu-kvm in documentation instead of qemu-system-<arch>
@ -17,15 +17,11 @@ to reflect this change. Only architectures available in RHEL are updated.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
Rebase notes (weekly-200129):
Rebase notes (5.1.0 rc0):
- qemu-block-drivers.texi converted to qemu-block-drivers.rst (upstream)
Rebase notes (weekly-200708
Rebase notes (5.2.0 rc0):
- rewrite patch to new docs structure
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
docs/defs.rst.inc | 4 ++--
docs/interop/live-block-operations.rst | 4 ++--
@ -35,7 +31,7 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/docs/defs.rst.inc b/docs/defs.rst.inc
index 48d05aaf33..d74dbdeca9 100644
index 48d05aa..d74dbde 100644
--- a/docs/defs.rst.inc
+++ b/docs/defs.rst.inc
@@ -9,7 +9,7 @@
@ -49,14 +45,14 @@ index 48d05aaf33..d74dbdeca9 100644
.. |I2C| replace:: I\ :sup:`2`\ C
.. |I2S| replace:: I\ :sup:`2`\ S
diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst
index 48afdc7927..6650b2c975 100644
index e13f5a2..6650b2c 100644
--- a/docs/interop/live-block-operations.rst
+++ b/docs/interop/live-block-operations.rst
@@ -129,7 +129,7 @@ To show some example invocations of command-line, we will use the
following invocation of QEMU, with a QMP server running over UNIX
socket::
- $ ./x86_64-softmmu/qemu-system-x86_64 -display none -no-user-config \
- $ ./qemu-system-x86_64 -display none -no-user-config \
+ $ qemu-kvm -display none -no-user-config \
-M q35 -nodefaults -m 512 \
-blockdev node-name=node-A,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./a.qcow2 \
@ -65,13 +61,13 @@ index 48afdc7927..6650b2c975 100644
simplicity's sake, the destination QEMU is started on the same host, but
it could be located elsewhere)::
- $ ./x86_64-softmmu/qemu-system-x86_64 -display none -no-user-config \
- $ ./qemu-system-x86_64 -display none -no-user-config \
+ $ qemu-kvm -display none -no-user-config \
-M q35 -nodefaults -m 512 \
-blockdev node-name=node-TargetDisk,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./target-disk.qcow2 \
-device virtio-blk,drive=node-TargetDisk,id=virtio0 \
diff --git a/docs/tools/qemu-trace-stap.rst b/docs/tools/qemu-trace-stap.rst
index fb70445c75..0d9a783112 100644
index fb70445..0d9a783 100644
--- a/docs/tools/qemu-trace-stap.rst
+++ b/docs/tools/qemu-trace-stap.rst
@@ -45,19 +45,19 @@ The following commands are valid:
@ -129,10 +125,10 @@ index fb70445c75..0d9a783112 100644
See also
--------
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
index 824e713491..8449936c63 100644
index 34a9e40..50fec10 100644
--- a/docs/tools/virtiofsd.rst
+++ b/docs/tools/virtiofsd.rst
@@ -116,7 +116,7 @@ Export ``/var/lib/fs/vm001/`` on vhost-user UNIX domain socket
@@ -297,7 +297,7 @@ Export ``/var/lib/fs/vm001/`` on vhost-user UNIX domain socket
::
host# virtiofsd --socket-path=/var/run/vm001-vhost-fs.sock -o source=/var/lib/fs/vm001
@ -142,10 +138,10 @@ index 824e713491..8449936c63 100644
-device vhost-user-fs-pci,chardev=char0,tag=myfs \
-object memory-backend-memfd,id=mem,size=4G,share=on \
diff --git a/qemu-options.hx b/qemu-options.hx
index 1700205035..697276859b 100644
index 53472fd..fde1a62 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2900,11 +2900,11 @@ SRST
@@ -2935,11 +2935,11 @@ SRST
::
@ -163,5 +159,5 @@ index 1700205035..697276859b 100644
``-netdev vhost-vdpa,vhostdev=/path/to/dev``
Establish a vhost-vdpa netdev.
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From 63a330ad8eeb2025c12d56714cb1271196f80dbe Mon Sep 17 00:00:00 2001
From b8b6ddabd9482c454a68fabe51660fda6a13b0b4 Mon Sep 17 00:00:00 2001
From: Fam Zheng <famz@redhat.com>
Date: Wed, 14 Jun 2017 15:37:01 +0200
Subject: virtio-scsi: Reject scsi-cd if data plane enabled [RHEL only]
@ -36,19 +36,16 @@ crashing.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
(cherry picked from commit b0caf00bbc35c7d89e02999bdce86e1f867728e8)
(cherry picked from commit c9c4f117d8b507c2f86035c282d537c0a327364f)
(cherry picked from commit 5d586bb2543337f0ff172c6ce942dba3acbcedff)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/scsi/virtio-scsi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index b49775269e..d3a64a6582 100644
index 3db9a8a..82c0251 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -814,6 +814,15 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev,
@@ -823,6 +823,15 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev,
SCSIDevice *sd = SCSI_DEVICE(dev);
int ret;
@ -65,5 +62,5 @@ index b49775269e..d3a64a6582 100644
if (blk_op_is_blocked(sd->conf.blk, BLOCK_OP_TYPE_DATAPLANE, errp)) {
return;
--
2.27.0
1.8.3.1

View File

@ -1,4 +1,4 @@
From 9ff2cc74cd1f41abc4b379fbaaaaa03a30415494 Mon Sep 17 00:00:00 2001
From 90dad3577e6873e23eb99c1b55c9e1f8fe0e1e16 Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Wed, 6 Feb 2019 03:58:56 +0000
Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts
@ -32,10 +32,10 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
1 file changed, 7 insertions(+)
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 3225fc5a2e..08ae7724d5 100644
index 9341e97..f11428e 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -326,12 +326,19 @@ void spapr_check_pagesize(SpaprMachineState *spapr, hwaddr pagesize,
@@ -333,12 +333,19 @@ bool spapr_check_pagesize(SpaprMachineState *spapr, hwaddr pagesize,
static void cap_hpt_maxpagesize_apply(SpaprMachineState *spapr,
uint8_t val, Error **errp)
{
@ -56,5 +56,5 @@ index 3225fc5a2e..08ae7724d5 100644
spapr_check_pagesize(spapr, qemu_minrampagesize(), errp);
}
--
2.27.0
1.8.3.1

View File

@ -1,96 +0,0 @@
From 5bb61f2b69d9880dea36d604719ee7bd4cf74ba6 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 5 May 2017 19:06:14 +0200
Subject: usb-xhci: Fix PCI capability order
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20170505190614.15987-2-dgilbert@redhat.com>
Patchwork-id: 75038
O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/1] usb-xhci: Fix PCI capability order
Bugzilla: 1447874
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Juan Quintela <quintela@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Upstream commit 1108b2f8a9 in 2.7.0 changed the order
of the PCI capability chain in the XHCI pci device in the case
where the device has the PCIe endpoint capability (i.e. only
older machine types, pc-i440fx-2.0 upstream, pc-i440fx-rhel7.0.0
apparently for us).
Changing the order breaks migration compatibility; fixing this
upstream would mean breaking the same case going from 2.7.0->current
that currently works 2.7.0->2.9.0 - so upstream it's a choice
of two breakages.
Since we never released 2.7.0/2.8.0 we can fix this downstream.
This reverts the order so that we create the capabilities in the
order:
PCIe
MSI
MSI-X
The symptom is:
qemu-kvm: get_pci_config_device: Bad config data: i=0x71 read: a0 device: 0 cmask: ff wmask: 0 w1cmask:0
qemu-kvm: Failed to load PCIDevice:config
qemu-kvm: Failed to load xhci:parent_obj
qemu-kvm: error while loading state for instance 0x0 of device '0000:00:0d.0/xhci'
qemu-kvm: load of migration failed: Invalid argument
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
--
Rebase notes (2.9.0):
- Change in assert condition (upstream)
(cherry picked from commit aad727a5ecde1ad4935eb8427604d4df5a1f1f35)
(cherry picked from commit 2dd7402227e77d748a7375233ac9e7feab244bda)
Conflicts:
hw/usb/hcd-xhci.c
(cherry picked from commit a42f86dc906cc7d2c16d02bf125ed76847b469cb)
(cherry picked from commit 992ab2e4f6e15d3e51bc716763aa8d6f45c6d29d)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/usb/hcd-xhci.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 38bdfaf3fd..4acd7842ac 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3413,6 +3413,12 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
xhci->max_pstreams_mask = 0;
}
+ if (pci_bus_is_express(pci_get_bus(dev)) ||
+ xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) {
+ ret = pcie_endpoint_cap_init(dev, 0xa0);
+ assert(ret > 0);
+ }
+
if (xhci->msi != ON_OFF_AUTO_OFF) {
ret = msi_init(dev, 0x70, xhci->numintrs, true, false, &err);
/* Any error other than -ENOTSUP(board's MSI support is broken)
@@ -3461,12 +3467,6 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64,
&xhci->mem);
- if (pci_bus_is_express(pci_get_bus(dev)) ||
- xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) {
- ret = pcie_endpoint_cap_init(dev, 0xa0);
- assert(ret > 0);
- }
-
if (xhci->msix != ON_OFF_AUTO_OFF) {
/* TODO check for errors, and should fail when msix=on */
msix_init(dev, xhci->numintrs,
--
2.27.0

View File

@ -1,4 +1,4 @@
From e27f3d72ac38e37758d4ea5b84bccf03cab8219a Mon Sep 17 00:00:00 2001
From 35b0411d0de4e3e8ef4fb4cef9ee2e8f8ef836e6 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Fri, 13 Mar 2020 12:34:32 +0000
Subject: block: Versioned x-blockdev-reopen API with feature flag
@ -29,10 +29,10 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 197bdc1c36..efc0f6a377 100644
index 04ad80b..2a7dca2 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -4118,10 +4118,17 @@
@@ -4143,10 +4143,17 @@
# image does not have a default backing file name as part of its
# metadata.
#
@ -52,5 +52,5 @@ index 197bdc1c36..efc0f6a377 100644
##
# @blockdev-del:
--
2.27.0
1.8.3.1

37
0020-Upstream.patch Normal file
View File

@ -0,0 +1,37 @@
From 36ad7c726f12e4b706eebc7bac185cd91646dbc3 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 11 Nov 2020 15:41:44 +0100
Subject: Upstream
---
default-configs/devices/aarch64-rh-devices.mak | 1 -
hw/arm/Kconfig | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak
index 9831940..d289f34 100644
--- a/default-configs/devices/aarch64-rh-devices.mak
+++ b/default-configs/devices/aarch64-rh-devices.mak
@@ -1,7 +1,6 @@
include rh-virtio.mak
CONFIG_ARM_GIC_KVM=y
-CONFIG_ARM_GIC=y
CONFIG_ARM_SMMUV3=y
CONFIG_ARM_V7M=y
CONFIG_ARM_VIRT=y
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 7d022ee..e69a900 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -6,6 +6,7 @@ config ARM_VIRT
imply VFIO_PLATFORM
imply VFIO_XGMAC
imply TPM_TIS_SYSBUS
+ select ARM_GIC
select ACPI
select ARM_SMMUV3
select GPIO_KEY
--
1.8.3.1

33
0021-RHEL-9-test.patch Normal file
View File

@ -0,0 +1,33 @@
From c7b7fffb5ad743115dac8918200a848513acbd4e Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 13 Nov 2020 11:03:26 +0100
Subject: RHEL 9 test
---
redhat/Makefile.common | 4 ++--
redhat/qemu-kvm.spec.template | 8 --------
tests/meson.build | 3 +--
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/tests/meson.build b/tests/meson.build
index afeb6be..2180fc4 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -136,7 +136,7 @@ if have_block
'test-blockjob': [testblock],
'test-blockjob-txn': [testblock],
'test-block-backend': [testblock],
- 'test-block-iothread': [testblock],
+# 'test-block-iothread': [testblock],
'test-write-threshold': [testblock],
'test-crypto-hash': [crypto],
'test-crypto-hmac': [crypto],
@@ -286,5 +286,4 @@ if not get_option('tcg').disabled()
endif
subdir('qapi-schema')
-subdir('qtest')
subdir('migration')
--
1.8.3.1

View File

@ -1,45 +0,0 @@
From f70eb50b7107ee4e18cec3561bbdde1cbd0a0bdb Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Mon, 27 Jul 2020 13:29:01 +0200
Subject: RHEL-only: Enable vTPM for POWER in downstream configs
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20200522032718.387731-1-dgibson@redhat.com>
Patchwork-id: 96743
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH] RHEL-only: Enable vTPM for POWER in downstream configs
Bugzilla: 1781911
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
From: David Gibson <david@gibson.dropbear.id.au>
With the rebase to 5.0 we have the necessary code to implement virtual TPMs
for POWER targets. However, it's not enabled in the Red Hat configuration.
This downstream only patch corrects that.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1781911
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=28742072
Testing: With brewed qemu was able to see a vTPM device in a guest
Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
default-configs/ppc64-rh-devices.mak | 3 +++
1 file changed, 3 insertions(+)
diff --git a/default-configs/ppc64-rh-devices.mak b/default-configs/ppc64-rh-devices.mak
index ecbe53fe63..032422e103 100644
--- a/default-configs/ppc64-rh-devices.mak
+++ b/default-configs/ppc64-rh-devices.mak
@@ -32,3 +32,6 @@ CONFIG_XICS_SPAPR=y
CONFIG_XIVE=y
CONFIG_XIVE_SPAPR=y
CONFIG_XIVE_KVM=y
+CONFIG_TPM_SPAPR=y
+CONFIG_TPM_EMULATOR=y
+CONFIG_TPM_PASSTHROUGH=y
--
2.27.0

View File

@ -1,44 +0,0 @@
From 69d8ae7ad5314e465c24fdeb1317751fa3e50ceb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 27 Jul 2020 13:29:01 +0200
Subject: redhat: fix 5.0 rebase missing ISA TPM TIS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: <20200608155426.112078-1-marcandre.lureau@redhat.com>
Patchwork-id: 97457
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH] redhat: fix 5.0 rebase missing ISA TPM TIS
Bugzilla: 1841529
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1841529
BRANCH: rhel-av-8.3.0-preview-2020-04-29
UPSTREAM: N/A
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29172313
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
default-configs/x86_64-rh-devices.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/default-configs/x86_64-rh-devices.mak b/default-configs/x86_64-rh-devices.mak
index d59b6d9bb5..1469e05382 100644
--- a/default-configs/x86_64-rh-devices.mak
+++ b/default-configs/x86_64-rh-devices.mak
@@ -95,6 +95,6 @@ CONFIG_WDT_IB6300ESB=y
CONFIG_WDT_IB700=y
CONFIG_XIO3130=y
CONFIG_TPM_CRB=y
-CONFIG_TPM_TIS=y
+CONFIG_TPM_TIS_ISA=y
CONFIG_TPM_EMULATOR=y
CONFIG_TPM_PASSTHROUGH=y
--
2.27.0

View File

@ -1,83 +0,0 @@
From 83486421151111ec118cc703819bd4764fea677e Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Mon, 27 Jul 2020 13:29:01 +0200
Subject: redhat: define hw_compat_8_2
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20200619154227.23845-2-dgilbert@redhat.com>
Patchwork-id: 97662
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 1/2] redhat: define hw_compat_8_2
Bugzilla: 1842902
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
From: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
For minor fix
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/machine.c | 28 ++++++++++++++++++++++++++++
include/hw/boards.h | 3 +++
2 files changed, 31 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2b8e480040..5476af98e1 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -28,6 +28,34 @@
#include "hw/mem/nvdimm.h"
#include "migration/vmstate.h"
+/*
+ * The same as hw_compat_4_2
+ */
+GlobalProperty hw_compat_rhel_8_2[] = {
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-blk-device", "queue-size", "128"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-scsi-device", "virtqueue_size", "128"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-blk-device", "seg-max-adjust", "off"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "virtio-scsi-device", "seg_max_adjust", "off"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "vhost-blk-device", "seg_max_adjust", "off"},
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "usb-host", "suppress-remote-wake", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "usb-redir", "suppress-remote-wake", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "qxl", "revision", "4" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "qxl-vga", "revision", "4" },
+ /* hw_compat_rhel_8_2 from hw_compat_4_2 */
+ { "fw_cfg", "acpi-mr-restore", "false" },
+};
+const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
/*
* The same as hw_compat_4_1
*/
diff --git a/include/hw/boards.h b/include/hw/boards.h
index c3577319c0..f918a15c66 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -375,6 +375,9 @@ extern const size_t hw_compat_2_2_len;
extern GlobalProperty hw_compat_2_1[];
extern const size_t hw_compat_2_1_len;
+extern GlobalProperty hw_compat_rhel_8_2[];
+extern const size_t hw_compat_rhel_8_2_len;
+
extern GlobalProperty hw_compat_rhel_8_1[];
extern const size_t hw_compat_rhel_8_1_len;
--
2.27.0

View File

@ -1,119 +0,0 @@
From b02c9f5373f6ffa65b8ddbdee32d6ed4e59198ad Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Mon, 27 Jul 2020 13:29:01 +0200
Subject: x86: Add 8.3.0 x86_64 machine type
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20200619154227.23845-3-dgilbert@redhat.com>
Patchwork-id: 97663
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 2/2] x86: Add 8.3.0 x86_64 machine type
Bugzilla: 1842902
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Not much change, just the smbase-smram.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc.c | 6 ++++++
hw/i386/pc_piix.c | 4 ++++
hw/i386/pc_q35.c | 22 ++++++++++++++++++++++
include/hw/i386/pc.h | 3 +++
4 files changed, 35 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 063f01d19a..a75e0137ab 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -361,6 +361,12 @@ GlobalProperty pc_rhel_compat[] = {
};
const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat);
+GlobalProperty pc_rhel_8_2_compat[] = {
+ /* pc_rhel_8_2_compat from pc_compat_4_2 */
+ { "mch", "smbase-smram", "off" },
+};
+const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat);
+
/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */
GlobalProperty pc_rhel_8_1_compat[] = { };
const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6d935645b6..4af4497a0c 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1030,6 +1030,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
m->smbus_no_migration_support = true;
pcmc->pvh_enabled = false;
pcmc->default_cpu_version = CPU_VERSION_LEGACY;
+ compat_props_add(m->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+ compat_props_add(m->compat_props, pc_rhel_8_2_compat,
+ pc_rhel_8_2_compat_len);
compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len);
compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len);
compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index f4edb049d6..d75d6d8805 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -589,6 +589,23 @@ static void pc_q35_machine_rhel_options(MachineClass *m)
compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
}
+static void pc_q35_init_rhel830(MachineState *machine)
+{
+ pc_q35_init(machine);
+}
+
+static void pc_q35_machine_rhel830_options(MachineClass *m)
+{
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
+ pc_q35_machine_rhel_options(m);
+ m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)";
+ pcmc->smbios_stream_product = "RHEL-AV";
+ pcmc->smbios_stream_version = "8.3.0";
+}
+
+DEFINE_PC_MACHINE(q35_rhel830, "pc-q35-rhel8.3.0", pc_q35_init_rhel830,
+ pc_q35_machine_rhel830_options);
+
static void pc_q35_init_rhel820(MachineState *machine)
{
pc_q35_init(machine);
@@ -599,8 +616,13 @@ static void pc_q35_machine_rhel820_options(MachineClass *m)
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pc_q35_machine_rhel_options(m);
m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)";
+ m->alias = NULL;
pcmc->smbios_stream_product = "RHEL-AV";
pcmc->smbios_stream_version = "8.2.0";
+ compat_props_add(m->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+ compat_props_add(m->compat_props, pc_rhel_8_2_compat,
+ pc_rhel_8_2_compat_len);
}
DEFINE_PC_MACHINE(q35_rhel820, "pc-q35-rhel8.2.0", pc_q35_init_rhel820,
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 156be22995..e9dc8c370c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -271,6 +271,9 @@ extern const size_t pc_compat_1_4_len;
extern GlobalProperty pc_rhel_compat[];
extern const size_t pc_rhel_compat_len;
+extern GlobalProperty pc_rhel_8_2_compat[];
+extern const size_t pc_rhel_8_2_compat_len;
+
extern GlobalProperty pc_rhel_8_1_compat[];
extern const size_t pc_rhel_8_1_compat_len;
--
2.27.0

View File

@ -1,82 +0,0 @@
From 12990ad9479216d96e4d67a7e613d2ef3b4fb700 Mon Sep 17 00:00:00 2001
From: Gavin Shan <gshan@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: hw/arm: Changes to rhel820 machine
RH-Author: Gavin Shan <gshan@redhat.com>
Message-id: <20200630013648.101937-1-gshan@redhat.com>
Patchwork-id: 97844
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH v5 1/3] hw/arm: Changes to rhel820 machine
Bugzilla: 1818843
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
This applies two changes to rhel820 machine:
* Set the gic version to VIRT_GIC_VERSION_NOSEL by default, which
doesn't cause functional changes.
* Disallow to configure the RAS property, which is hidden by default.
Signed-off-by: Gavin Shan <gshan@redhat.com>
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e1a17e7c87..c22e1e6d5c 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2105,6 +2105,7 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
visit_type_OnOffAuto(v, name, &vms->acpi, errp);
}
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static bool virt_get_ras(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2125,6 +2126,7 @@ static bool virt_get_mte(Object *obj, Error **errp)
return vms->mte;
}
+#endif /* disabled for RHEL */
static void virt_set_mte(Object *obj, bool value, Error **errp)
{
@@ -2802,12 +2804,8 @@ static void rhel820_virt_instance_init(Object *obj)
object_property_set_description(obj, "highmem",
"Set on/off to enable/disable using "
"physical address space above 32 bits");
- /*
- * Default GIC type is still v2, but became configurable for RHEL. We
- * keep v2 instead of max as TCG CI test cases require an MSI controller
- * and there is no userspace ITS MSI emulation available.
- */
- vms->gic_version = 2;
+
+ vms->gic_version = VIRT_GIC_VERSION_NOSEL;
object_property_add_str(obj, "gic-version", virt_get_gic_version,
virt_set_gic_version);
object_property_set_description(obj, "gic-version",
@@ -2834,13 +2832,8 @@ static void rhel820_virt_instance_init(Object *obj)
object_property_set_description(obj, "iommu",
"Set the IOMMU type. "
"Valid values are none and smmuv3");
- vms->ras = false;
- object_property_add_bool(obj, "ras", virt_get_ras,
- virt_set_ras);
- object_property_set_description(obj, "ras",
- "Set on/off to enable/disable reporting host memory errors "
- "to a KVM guest using ACPI and guest external abort exceptions");
+ vms->ras = false;
/* MTE is disabled by default. */
vms->mte = false;
--
2.27.0

View File

@ -1,53 +0,0 @@
From 46d5a797986373ecc0dfa578cae07a3641847935 Mon Sep 17 00:00:00 2001
From: Gavin Shan <gshan@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: hw/arm: Introduce rhel_virt_instance_init() helper
RH-Author: Gavin Shan <gshan@redhat.com>
Message-id: <20200629022939.76453-3-gshan@redhat.com>
Patchwork-id: 97838
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH v4 2/3] hw/arm: Introduce rhel_virt_instance_init() helper
Bugzilla: 1818843
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
This introduces rhel_virt_instance_init() helper function so that
it can be shared by rhel820 and rhel830 machine. This shouldn't
cause functional changes.
Signed-off-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c22e1e6d5c..650668a8d1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2788,7 +2788,7 @@ static void rhel_machine_init(void)
}
type_init(rhel_machine_init);
-static void rhel820_virt_instance_init(Object *obj)
+static void rhel_virt_instance_init(Object *obj)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@@ -2841,6 +2841,11 @@ static void rhel820_virt_instance_init(Object *obj)
virt_flash_create(vms);
}
+static void rhel820_virt_instance_init(Object *obj)
+{
+ rhel_virt_instance_init(obj);
+}
+
static void rhel820_virt_options(MachineClass *mc)
{
compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
--
2.27.0

View File

@ -1,61 +0,0 @@
From 098954acda750a54d2eb512297bcd205212ee718 Mon Sep 17 00:00:00 2001
From: Gavin Shan <gshan@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: hw/arm: Add rhel830 machine type
RH-Author: Gavin Shan <gshan@redhat.com>
Message-id: <20200630014756.102753-1-gshan@redhat.com>
Patchwork-id: 97845
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH v5 3/3] hw/arm: Add rhel830 machine type
Bugzilla: 1818843
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
This adds rhel830 machine type, whose properties are same as to
rhel820.
Signed-off-by: Gavin Shan <gshan@redhat.com>
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 650668a8d1..48b58be597 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2841,6 +2841,17 @@ static void rhel_virt_instance_init(Object *obj)
virt_flash_create(vms);
}
+static void rhel830_virt_instance_init(Object *obj)
+{
+ rhel_virt_instance_init(obj);
+}
+
+static void rhel830_virt_options(MachineClass *mc)
+{
+ compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+}
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 3, 0)
+
static void rhel820_virt_instance_init(Object *obj)
{
rhel_virt_instance_init(obj);
@@ -2848,6 +2859,8 @@ static void rhel820_virt_instance_init(Object *obj)
static void rhel820_virt_options(MachineClass *mc)
{
- compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+ rhel830_virt_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
}
-DEFINE_RHEL_MACHINE_AS_LATEST(8, 2, 0)
+DEFINE_RHEL_MACHINE(8, 2, 0)
--
2.27.0

View File

@ -1,77 +0,0 @@
From 311a20fb12a4d0ebed840be194db8117c8eea595 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: redhat: define pseries-rhel8.3.0 machine type
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200706104117.219174-3-lvivier@redhat.com>
Patchwork-id: 97904
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 2/2] redhat: define pseries-rhel8.3.0 machine type
Bugzilla: 1853265
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Note: rebase to qemu-5.1 introduces
32a354dc6c07 ("numa: forbid '-numa node, mem' for 5.1 and newer machine types")
and so '-numa node, mem' will not be available with pseries-rhel8.3.0
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 756c8667c1..ccceb6d39f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4995,16 +4995,42 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
#endif
+/*
+ * pseries-rhel8.3.0
+ * like pseries-5.1
+ */
+
+static void spapr_machine_rhel830_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(rhel830, "rhel8.3.0", true);
+
/*
* pseries-rhel8.2.0
+ * like pseries-4.2 + pseries-5.0
+ * except SPAPR_CAP_CCF_ASSIST that has been backported to pseries-rhel8.1.0
*/
static void spapr_machine_rhel820_class_options(MachineClass *mc)
{
- /* Defaults for the latest behaviour inherited from the base class */
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel830_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
+ hw_compat_rhel_8_2_len);
+
+ /* from pseries-4.2 */
+ smc->default_caps.caps[SPAPR_CAP_FWNMI] = SPAPR_CAP_OFF;
+ smc->rma_limit = 16 * GiB;
+ mc->nvdimm_supported = false;
+
+ /* from pseries-5.0 */
+ mc->numa_mem_supported = true;
}
-DEFINE_SPAPR_MACHINE(rhel820, "rhel8.2.0", true);
+DEFINE_SPAPR_MACHINE(rhel820, "rhel8.2.0", false);
/*
* pseries-rhel8.1.0
--
2.27.0

View File

@ -1,49 +0,0 @@
From 12841675e2a81f3b98cb9741b54c3041cebf9e87 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: ppc: Set correct max_cpus value on spapr-rhel* machine types
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20200729180236.627559-2-ehabkost@redhat.com>
Patchwork-id: 98073
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 1/4] ppc: Set correct max_cpus value on spapr-rhel* machine types
Bugzilla: 1819292
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
Currently vl.c forces MachineClass::max_cpus to be
<= RHEL_MAX_CPUS (384) on all machine types.
Instead of relying on that global limit, set max_cpus=384
explicitly at spapr_machine_rhel820_class_options(), which will
affect all pseriesl-rhel* machine types.
This will keep exactly the same behavior as before, but will
allow us to remove the downstream-only RHEL_MAX_CPUS code at vl.c
later.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ccceb6d39f..1c367a2367 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -5003,6 +5003,9 @@ DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
static void spapr_machine_rhel830_class_options(MachineClass *mc)
{
/* Defaults for the latest behaviour inherited from the base class */
+
+ /* Maximum supported VCPU count for all pseries-rhel* machines */
+ mc->max_cpus = 384;
}
DEFINE_SPAPR_MACHINE(rhel830, "rhel8.3.0", true);
--
2.27.0

View File

@ -1,53 +0,0 @@
From ee8e99d0a7821b26d0afe20c3a1f7517e4fa6772 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: arm: Set correct max_cpus value on virt-rhel* machine types
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20200729180236.627559-3-ehabkost@redhat.com>
Patchwork-id: 98074
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 2/4] arm: Set correct max_cpus value on virt-rhel* machine types
Bugzilla: 1819292
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
Currently vl.c forces MachineClass::max_cpus to be
<= RHEL_MAX_CPUS (384) on all machine types.
Instead of relying on that global limit, set max_cpus=384
explicitly at the virt-rhel-machine base class, which will affect
all virt-rhel* machine types.
This will keep exactly the same behavior as before, but will
allow us to remove the downstream-only RHEL_MAX_CPUS code at vl.c
later.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 48b58be597..fb5a5a7013 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2736,11 +2736,8 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
mc->family = "virt-rhel-Z";
mc->init = machvirt_init;
- /* Start with max_cpus set to 512, which is the maximum supported by KVM.
- * The value may be reduced later when we have more information about the
- * configuration of the particular instance.
- */
- mc->max_cpus = 512;
+ /* Maximum supported VCPU count for all virt-rhel* machines */
+ mc->max_cpus = 384;
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->pci_allow_0_address = true;
--
2.27.0

View File

@ -1,83 +0,0 @@
From f8a4123e211ed0685097f496c99e73913a6b34d0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: vl: Remove downstream-only MAX_RHEL_CPUS code
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20200729180236.627559-4-ehabkost@redhat.com>
Patchwork-id: 98075
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 3/4] vl: Remove downstream-only MAX_RHEL_CPUS code
Bugzilla: 1819292
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
Now that all machine types have max_cpus set to the actual
supported number of VCPUs, the MAX_RHEL_CPUS code becomes
unnecessary and can be completely removed.
For reference these are the max_cpus values set by the RHEL
machine types:
- arm: virt-rhel*: max_cpus=384 (rhel_machine_class_init());
- ppc: spapr-rhel*: max_cpus=384
(spapr_machine_rhel820_class_options());
- s390: s390-ccw*: max_cpus=248 (ccw_machine_class_init());
- x86: q35: max_cpus=384 (pc_q35_machine_rhel_options());
- x86: q35-rhel7.3.0 and older: max_cpus=255
(pc_q35_machine_rhel730_options());
- x86: pc-i440fx*: max_cpus=240 (pc_machine_class_init()).
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
softmmu/vl.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 62fc7c898f..3c383911cd 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -116,8 +116,6 @@
#define MAX_VIRTIO_CONSOLES 1
-#define RHEL_MAX_CPUS 384
-
static const char *data_dir[16];
static int data_dir_idx;
const char *bios_name = NULL;
@@ -1191,20 +1189,6 @@ static MachineClass *find_default_machine(GSList *machines)
return default_machineclass;
}
-/* Maximum number of CPUs limited for Red Hat Enterprise Linux */
-static void limit_max_cpus_in_machines(void)
-{
- GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
-
- for (el = machines; el; el = el->next) {
- MachineClass *mc = el->data;
-
- if (mc->max_cpus > RHEL_MAX_CPUS) {
- mc->max_cpus = RHEL_MAX_CPUS;
- }
- }
-}
-
static int machine_help_func(QemuOpts *opts, MachineState *machine)
{
ObjectProperty *prop;
@@ -3861,8 +3845,6 @@ void qemu_init(int argc, char **argv, char **envp)
"mutually exclusive");
exit(EXIT_FAILURE);
}
- /* Maximum number of CPUs limited for Red Hat Enterprise Linux */
- limit_max_cpus_in_machines();
configure_rtc(qemu_find_opts_singleton("rtc"));
--
2.27.0

View File

@ -1,45 +0,0 @@
From f2edc4f9262e9130d020ef6caef2443e7ae31371 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 12 Aug 2020 10:58:04 +0200
Subject: q35: Set max_cpus to 512
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20200729180236.627559-5-ehabkost@redhat.com>
Patchwork-id: 98076
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 4/4] q35: Set max_cpus to 512
Bugzilla: 1819292
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
Increase supported VCPU count for the Q35 machine type.
The VCPU count that partners confirmed to work depended on other
parameters (especially RAM size), but fluctuated between 640 and
710 VCPUs. I chose to increase the limit to 512 to be
conservative, until we find out what exactly prevents larger VMs
from booting.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc_q35.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d75d6d8805..c709460ab7 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -585,7 +585,7 @@ static void pc_q35_machine_rhel_options(MachineClass *m)
machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
m->alias = "q35";
- m->max_cpus = 384;
+ m->max_cpus = 512;
compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
}
--
2.27.0

View File

@ -1,39 +0,0 @@
From e5edd3824a782900bcb7aa2a980696e550b55cf6 Mon Sep 17 00:00:00 2001
From: Eric Auger <eric.auger@redhat.com>
Date: Wed, 12 Aug 2020 11:03:02 +0200
Subject: RHEL-only: arm/virt: Allow the TPM_TIS_SYSBUS device dynamic
allocation in machvirt
RH-Author: Auger Eric <eric.auger@redhat.com>
Message-id: <20200811163601.14341-2-eric.auger@redhat.com>
Patchwork-id: 98143
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/2] RHEL-only: arm/virt: Allow the TPM_TIS_SYSBUS device dynamic allocation in machvirt
Bugzilla: 1801242
Allow the TPM_TIS_SYSBUS device dynamic instantiation onto the
platform bus. The TPM_TIS sysbus device compilation will be enabled
in a separate patch. That way associated qmp tests pass once the config
is set.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index fb5a5a7013..f087483a04 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2738,6 +2738,7 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
mc->init = machvirt_init;
/* Maximum supported VCPU count for all virt-rhel* machines */
mc->max_cpus = 384;
+ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->pci_allow_0_address = true;
--
2.27.0

View File

@ -1,35 +0,0 @@
From 8310f89d8818bc9d41b386bbb2824593aa8e8dca Mon Sep 17 00:00:00 2001
From: Auger Eric <eric.auger@redhat.com>
Date: Wed, 12 Aug 2020 11:03:31 +0200
Subject: RHEL-only: Enable vTPM for ARM in downstream configs
RH-Author: Auger Eric <eric.auger@redhat.com>
Message-id: <20200811163601.14341-3-eric.auger@redhat.com>
Patchwork-id: 98144
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 2/2] RHEL-only: Enable vTPM for ARM in downstream configs
Bugzilla: 1801242
We allow the compilation of the TPM_TIS_SYSBUS device and both
passthrough and software emulation backends.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
default-configs/aarch64-rh-devices.mak | 3 +++
1 file changed, 3 insertions(+)
diff --git a/default-configs/aarch64-rh-devices.mak b/default-configs/aarch64-rh-devices.mak
index f0cf5a1b22..0b6a03f816 100644
--- a/default-configs/aarch64-rh-devices.mak
+++ b/default-configs/aarch64-rh-devices.mak
@@ -20,3 +20,6 @@ CONFIG_VIRTIO_PCI=y
CONFIG_XIO3130=y
CONFIG_NVDIMM=y
CONFIG_ACPI_APEI=y
+CONFIG_TPM_EMULATOR=y
+CONFIG_TPM_PASSTHROUGH=y
+CONFIG_TPM_TIS_SYSBUS=y
--
2.27.0

View File

@ -1,44 +0,0 @@
From 4a8ccfdf57fb0e0835faef9d95939d31546202f8 Mon Sep 17 00:00:00 2001
From: Auger Eric <eric.auger@redhat.com>
Date: Wed, 19 Aug 2020 09:16:03 -0400
Subject: [PATCH 3/4] Disable TPM passthrough backend on ARM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Auger Eric <eric.auger@redhat.com>
Message-id: <20200819091603.23319-1-eric.auger@redhat.com>
Patchwork-id: 98190
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH] Disable TPM passthrough backend on ARM
Bugzilla: 1801242
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1801242
UPSTREAM: not applicable
BRANCH: rhel-av-8.3.0
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=30820412
Let's disable the TPM passthrough backend on ARM as this looks
to be a marginal use case and it was not tested comprehensively yet.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
default-configs/aarch64-rh-devices.mak | 1 -
1 file changed, 1 deletion(-)
diff --git a/default-configs/aarch64-rh-devices.mak b/default-configs/aarch64-rh-devices.mak
index 0b6a03f816..6a597384ea 100644
--- a/default-configs/aarch64-rh-devices.mak
+++ b/default-configs/aarch64-rh-devices.mak
@@ -21,5 +21,4 @@ CONFIG_XIO3130=y
CONFIG_NVDIMM=y
CONFIG_ACPI_APEI=y
CONFIG_TPM_EMULATOR=y
-CONFIG_TPM_PASSTHROUGH=y
CONFIG_TPM_TIS_SYSBUS=y
--
2.27.0

View File

@ -1,51 +0,0 @@
From 6ceab004edfb7c1f0f03701bc2ae443941468fd7 Mon Sep 17 00:00:00 2001
From: Jon Maloy <jmaloy@redhat.com>
Date: Mon, 17 Aug 2020 22:06:08 -0400
Subject: [PATCH 1/6] Drop bogus IPv6 messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Jon Maloy <jmaloy@redhat.com>
Message-id: <20200817220608.1142611-2-jmaloy@redhat.com>
Patchwork-id: 98161
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/1] Drop bogus IPv6 messages
Bugzilla: 1867075
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
From: Ralf Haferkamp <rhafer@suse.com>
Drop IPv6 message shorter than what's mentioned in the payload
length header (+ the size of the IPv6 header). They're invalid an could
lead to data leakage in icmp6_send_echoreply().
(cherry picked from libslirp commit c7ede54cbd2e2b25385325600958ba0124e31cc0)
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
slirp/src/ip6_input.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/slirp/src/ip6_input.c b/slirp/src/ip6_input.c
index a83e4f8e3d..f7ef354ee4 100644
--- a/slirp/src/ip6_input.c
+++ b/slirp/src/ip6_input.c
@@ -56,6 +56,13 @@ void ip6_input(struct mbuf *m)
goto bad;
}
+ // Check if the message size is big enough to hold what's
+ // set in the payload length header. If not this is an invalid
+ // packet
+ if (m->m_len < ntohs(ip6->ip_pl) + sizeof(struct ip6)) {
+ goto bad;
+ }
+
/* check ip_ttl for a correct ICMP reply */
if (ip6->ip_hl == 0) {
icmp6_send_error(m, ICMP6_TIMXCEED, ICMP6_TIMXCEED_INTRANS);
--
2.27.0

View File

@ -1,48 +0,0 @@
From 40ce2a0e9f0a9d5c00ba82f187802fdf0a0702d0 Mon Sep 17 00:00:00 2001
From: Danilo de Paula <ddepaula@redhat.com>
Date: Wed, 16 Sep 2020 01:25:22 -0400
Subject: [PATCH 3/4] Revert "Drop bogus IPv6 messages"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Danilo de Paula <ddepaula@redhat.com>
Message-id: <20200916012522.1183051-2-ddepaula@redhat.com>
Patchwork-id: 98394
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/1] Revert "Drop bogus IPv6 messages"
Bugzilla: 1867075
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This reverts commit 6ceab004edfb7c1f0f03701bc2ae443941468fd7.
This fix was applied during the rebase.
The commit above just duplicates it.
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
slirp/src/ip6_input.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/slirp/src/ip6_input.c b/slirp/src/ip6_input.c
index f7ef354ee4..a83e4f8e3d 100644
--- a/slirp/src/ip6_input.c
+++ b/slirp/src/ip6_input.c
@@ -56,13 +56,6 @@ void ip6_input(struct mbuf *m)
goto bad;
}
- // Check if the message size is big enough to hold what's
- // set in the payload length header. If not this is an invalid
- // packet
- if (m->m_len < ntohs(ip6->ip_pl) + sizeof(struct ip6)) {
- goto bad;
- }
-
/* check ip_ttl for a correct ICMP reply */
if (ip6->ip_hl == 0) {
icmp6_send_error(m, ICMP6_TIMXCEED, ICMP6_TIMXCEED_INTRANS);
--
2.27.0

View File

@ -1,168 +0,0 @@
From d2629755385917d277b80267cb88436c950123a7 Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:49 -0400
Subject: [PATCH 07/11] Revert "hw/386: Add EPYC mode topology decoding
functions"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-8-imammedo@redhat.com>
Patchwork-id: 98250
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 7/7] Revert "hw/386: Add EPYC mode topology decoding functions"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit 7568b205555a6405042f62c64af3268f4330aed5.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/i386/topology.h | 100 -------------------------------------
1 file changed, 100 deletions(-)
diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h
index 07239f95f4..b9593b9905 100644
--- a/include/hw/i386/topology.h
+++ b/include/hw/i386/topology.h
@@ -47,7 +47,6 @@ typedef uint32_t apic_id_t;
typedef struct X86CPUTopoIDs {
unsigned pkg_id;
- unsigned node_id;
unsigned die_id;
unsigned core_id;
unsigned smt_id;
@@ -89,11 +88,6 @@ static inline unsigned apicid_die_width(X86CPUTopoInfo *topo_info)
return apicid_bitwidth_for_count(topo_info->dies_per_pkg);
}
-/* Bit width of the node_id field per socket */
-static inline unsigned apicid_node_width_epyc(X86CPUTopoInfo *topo_info)
-{
- return apicid_bitwidth_for_count(MAX(topo_info->nodes_per_pkg, 1));
-}
/* Bit offset of the Core_ID field
*/
static inline unsigned apicid_core_offset(X86CPUTopoInfo *topo_info)
@@ -114,100 +108,6 @@ static inline unsigned apicid_pkg_offset(X86CPUTopoInfo *topo_info)
return apicid_die_offset(topo_info) + apicid_die_width(topo_info);
}
-#define NODE_ID_OFFSET 3 /* Minimum node_id offset if numa configured */
-
-/*
- * Bit offset of the node_id field
- *
- * Make sure nodes_per_pkg > 0 if numa configured else zero.
- */
-static inline unsigned apicid_node_offset_epyc(X86CPUTopoInfo *topo_info)
-{
- unsigned offset = apicid_die_offset(topo_info) +
- apicid_die_width(topo_info);
-
- if (topo_info->nodes_per_pkg) {
- return MAX(NODE_ID_OFFSET, offset);
- } else {
- return offset;
- }
-}
-
-/* Bit offset of the Pkg_ID (socket ID) field */
-static inline unsigned apicid_pkg_offset_epyc(X86CPUTopoInfo *topo_info)
-{
- return apicid_node_offset_epyc(topo_info) +
- apicid_node_width_epyc(topo_info);
-}
-
-/*
- * Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID
- *
- * The caller must make sure core_id < nr_cores and smt_id < nr_threads.
- */
-static inline apic_id_t
-x86_apicid_from_topo_ids_epyc(X86CPUTopoInfo *topo_info,
- const X86CPUTopoIDs *topo_ids)
-{
- return (topo_ids->pkg_id << apicid_pkg_offset_epyc(topo_info)) |
- (topo_ids->node_id << apicid_node_offset_epyc(topo_info)) |
- (topo_ids->die_id << apicid_die_offset(topo_info)) |
- (topo_ids->core_id << apicid_core_offset(topo_info)) |
- topo_ids->smt_id;
-}
-
-static inline void x86_topo_ids_from_idx_epyc(X86CPUTopoInfo *topo_info,
- unsigned cpu_index,
- X86CPUTopoIDs *topo_ids)
-{
- unsigned nr_nodes = MAX(topo_info->nodes_per_pkg, 1);
- unsigned nr_dies = topo_info->dies_per_pkg;
- unsigned nr_cores = topo_info->cores_per_die;
- unsigned nr_threads = topo_info->threads_per_core;
- unsigned cores_per_node = DIV_ROUND_UP((nr_dies * nr_cores * nr_threads),
- nr_nodes);
-
- topo_ids->pkg_id = cpu_index / (nr_dies * nr_cores * nr_threads);
- topo_ids->node_id = (cpu_index / cores_per_node) % nr_nodes;
- topo_ids->die_id = cpu_index / (nr_cores * nr_threads) % nr_dies;
- topo_ids->core_id = cpu_index / nr_threads % nr_cores;
- topo_ids->smt_id = cpu_index % nr_threads;
-}
-
-/*
- * Calculate thread/core/package IDs for a specific topology,
- * based on APIC ID
- */
-static inline void x86_topo_ids_from_apicid_epyc(apic_id_t apicid,
- X86CPUTopoInfo *topo_info,
- X86CPUTopoIDs *topo_ids)
-{
- topo_ids->smt_id = apicid &
- ~(0xFFFFFFFFUL << apicid_smt_width(topo_info));
- topo_ids->core_id =
- (apicid >> apicid_core_offset(topo_info)) &
- ~(0xFFFFFFFFUL << apicid_core_width(topo_info));
- topo_ids->die_id =
- (apicid >> apicid_die_offset(topo_info)) &
- ~(0xFFFFFFFFUL << apicid_die_width(topo_info));
- topo_ids->node_id =
- (apicid >> apicid_node_offset_epyc(topo_info)) &
- ~(0xFFFFFFFFUL << apicid_node_width_epyc(topo_info));
- topo_ids->pkg_id = apicid >> apicid_pkg_offset_epyc(topo_info);
-}
-
-/*
- * Make APIC ID for the CPU 'cpu_index'
- *
- * 'cpu_index' is a sequential, contiguous ID for the CPU.
- */
-static inline apic_id_t x86_apicid_from_cpu_idx_epyc(X86CPUTopoInfo *topo_info,
- unsigned cpu_index)
-{
- X86CPUTopoIDs topo_ids;
- x86_topo_ids_from_idx_epyc(topo_info, cpu_index, &topo_ids);
- return x86_apicid_from_topo_ids_epyc(topo_info, &topo_ids);
-}
/* Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID
*
* The caller must make sure core_id < nr_cores and smt_id < nr_threads.
--
2.27.0

View File

@ -1,80 +0,0 @@
From da24d2c5e2d61043340b601a09f22e41a1d52e5e Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:47 -0400
Subject: [PATCH 05/11] Revert "hw/i386: Introduce apicid functions inside
X86MachineState"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-6-imammedo@redhat.com>
Patchwork-id: 98246
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 5/7] Revert "hw/i386: Introduce apicid functions inside X86MachineState"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit 6121c7fbfd98dbc3af1b00b56ff2eef66df87828.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/x86.c | 5 -----
include/hw/i386/x86.h | 9 ---------
2 files changed, 14 deletions(-)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 41bdf146bd..4d8cb66258 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -896,11 +896,6 @@ static void x86_machine_initfn(Object *obj)
x86ms->smm = ON_OFF_AUTO_AUTO;
x86ms->acpi = ON_OFF_AUTO_AUTO;
x86ms->smp_dies = 1;
-
- x86ms->apicid_from_cpu_idx = x86_apicid_from_cpu_idx;
- x86ms->topo_ids_from_apicid = x86_topo_ids_from_apicid;
- x86ms->apicid_from_topo_ids = x86_apicid_from_topo_ids;
- x86ms->apicid_pkg_offset = apicid_pkg_offset;
}
static void x86_machine_class_init(ObjectClass *oc, void *data)
diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index b79f24e285..4d9a26326d 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -63,15 +63,6 @@ typedef struct {
OnOffAuto smm;
OnOffAuto acpi;
- /* Apic id specific handlers */
- uint32_t (*apicid_from_cpu_idx)(X86CPUTopoInfo *topo_info,
- unsigned cpu_index);
- void (*topo_ids_from_apicid)(apic_id_t apicid, X86CPUTopoInfo *topo_info,
- X86CPUTopoIDs *topo_ids);
- apic_id_t (*apicid_from_topo_ids)(X86CPUTopoInfo *topo_info,
- const X86CPUTopoIDs *topo_ids);
- uint32_t (*apicid_pkg_offset)(X86CPUTopoInfo *topo_info);
-
/*
* Address space used by IOAPIC device. All IOAPIC interrupts
* will be translated to MSI messages in the address space.
--
2.27.0

View File

@ -1,157 +0,0 @@
From 61b9bdeafac573093e171947be1a0c9212ba8b95 Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:45 -0400
Subject: [PATCH 03/11] Revert "hw/i386: Move arch_id decode inside
x86_cpus_init"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-4-imammedo@redhat.com>
Patchwork-id: 98248
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 3/7] Revert "hw/i386: Move arch_id decode inside x86_cpus_init"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit 2e26f4ab3bf8390a2677d3afd9b1a04f015d7721.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc.c | 6 +++---
hw/i386/x86.c | 37 +++++++------------------------------
2 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f469c060e5..ac2cc79fca 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1817,14 +1817,14 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
topo_ids.die_id = cpu->die_id;
topo_ids.core_id = cpu->core_id;
topo_ids.smt_id = cpu->thread_id;
- cpu->apic_id = x86ms->apicid_from_topo_ids(&topo_info, &topo_ids);
+ cpu->apic_id = x86_apicid_from_topo_ids(&topo_info, &topo_ids);
}
cpu_slot = pc_find_cpu_slot(MACHINE(pcms), cpu->apic_id, &idx);
if (!cpu_slot) {
MachineState *ms = MACHINE(pcms);
- x86ms->topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids);
+ x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids);
error_setg(errp,
"Invalid CPU [socket: %u, die: %u, core: %u, thread: %u] with"
" APIC ID %" PRIu32 ", valid index range 0:%d",
@@ -1845,7 +1845,7 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
/* TODO: move socket_id/core_id/thread_id checks into x86_cpu_realizefn()
* once -smp refactoring is complete and there will be CPU private
* CPUState::nr_cores and CPUState::nr_threads fields instead of globals */
- x86ms->topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids);
+ x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids);
if (cpu->socket_id != -1 && cpu->socket_id != topo_ids.pkg_id) {
error_setg(errp, "property socket-id: %u doesn't match set apic-id:"
" 0x%x (socket-id: %u)", cpu->socket_id, cpu->apic_id,
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 67bee1bcb8..41bdf146bd 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -68,22 +68,6 @@ inline void init_topo_info(X86CPUTopoInfo *topo_info,
topo_info->threads_per_core = ms->smp.threads;
}
-/*
- * Set up with the new EPYC topology handlers
- *
- * AMD uses different apic id encoding for EPYC based cpus. Override
- * the default topo handlers with EPYC encoding handlers.
- */
-static void x86_set_epyc_topo_handlers(MachineState *machine)
-{
- X86MachineState *x86ms = X86_MACHINE(machine);
-
- x86ms->apicid_from_cpu_idx = x86_apicid_from_cpu_idx_epyc;
- x86ms->topo_ids_from_apicid = x86_topo_ids_from_apicid_epyc;
- x86ms->apicid_from_topo_ids = x86_apicid_from_topo_ids_epyc;
- x86ms->apicid_pkg_offset = apicid_pkg_offset_epyc;
-}
-
/*
* Calculates initial APIC ID for a specific CPU index
*
@@ -102,7 +86,7 @@ uint32_t x86_cpu_apic_id_from_index(X86MachineState *x86ms,
init_topo_info(&topo_info, x86ms);
- correct_id = x86ms->apicid_from_cpu_idx(&topo_info, cpu_index);
+ correct_id = x86_apicid_from_cpu_idx(&topo_info, cpu_index);
if (x86mc->compat_apic_id_mode) {
if (cpu_index != correct_id && !warned && !qtest_enabled()) {
error_report("APIC IDs set in compatibility mode, "
@@ -136,11 +120,6 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
MachineState *ms = MACHINE(x86ms);
MachineClass *mc = MACHINE_GET_CLASS(x86ms);
- /* Check for apicid encoding */
- if (cpu_x86_use_epyc_apic_id_encoding(ms->cpu_type)) {
- x86_set_epyc_topo_handlers(ms);
- }
-
x86_cpu_set_default_version(default_cpu_version);
/*
@@ -154,12 +133,6 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
x86ms->apic_id_limit = x86_cpu_apic_id_from_index(x86ms,
ms->smp.max_cpus - 1) + 1;
possible_cpus = mc->possible_cpu_arch_ids(ms);
-
- for (i = 0; i < ms->possible_cpus->len; i++) {
- ms->possible_cpus->cpus[i].arch_id =
- x86_cpu_apic_id_from_index(x86ms, i);
- }
-
for (i = 0; i < ms->smp.cpus; i++) {
x86_cpu_new(x86ms, possible_cpus->cpus[i].arch_id, &error_fatal);
}
@@ -184,7 +157,8 @@ int64_t x86_get_default_cpu_node_id(const MachineState *ms, int idx)
init_topo_info(&topo_info, x86ms);
assert(idx < ms->possible_cpus->len);
- x86_topo_ids_from_idx(&topo_info, idx, &topo_ids);
+ x86_topo_ids_from_apicid(ms->possible_cpus->cpus[idx].arch_id,
+ &topo_info, &topo_ids);
return topo_ids.pkg_id % ms->numa_state->num_nodes;
}
@@ -215,7 +189,10 @@ const CPUArchIdList *x86_possible_cpu_arch_ids(MachineState *ms)
ms->possible_cpus->cpus[i].type = ms->cpu_type;
ms->possible_cpus->cpus[i].vcpus_count = 1;
- x86_topo_ids_from_idx(&topo_info, i, &topo_ids);
+ ms->possible_cpus->cpus[i].arch_id =
+ x86_cpu_apic_id_from_index(x86ms, i);
+ x86_topo_ids_from_apicid(ms->possible_cpus->cpus[i].arch_id,
+ &topo_info, &topo_ids);
ms->possible_cpus->cpus[i].props.has_socket_id = true;
ms->possible_cpus->cpus[i].props.socket_id = topo_ids.pkg_id;
if (x86ms->smp_dies > 1) {
--
2.27.0

View File

@ -1,103 +0,0 @@
From 7f7a15ba9ad3f1d906b472cad4972c80d11b77fc Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:43 -0400
Subject: [PATCH 01/11] Revert "i386: Fix pkg_id offset for EPYC cpu models"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-2-imammedo@redhat.com>
Patchwork-id: 98247
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 1/7] Revert "i386: Fix pkg_id offset for EPYC cpu models"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit 7b225762c8c05fd31d4c2be116aedfbc00383f8b.
PS:
fixup an access to pkg_offset that were added by
cac9edfc4da (target/i386: Fix the CPUID leaf CPUID_Fn80000008)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc.c | 1 -
target/i386/cpu.c | 6 +++---
target/i386/cpu.h | 1 -
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a75e0137ab..f469c060e5 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1763,7 +1763,6 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
env->nr_dies = x86ms->smp_dies;
env->nr_nodes = topo_info.nodes_per_pkg;
- env->pkg_offset = x86ms->apicid_pkg_offset(&topo_info);
/*
* If APIC ID is not set,
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index cdaa1463f2..6517cc73a2 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5680,7 +5680,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
*ecx |= CPUID_TOPOLOGY_LEVEL_SMT;
break;
case 1:
- *eax = env->pkg_offset;
+ *eax = apicid_pkg_offset(&topo_info);
*ebx = cs->nr_cores * cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_CORE;
break;
@@ -5714,7 +5714,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
*ecx |= CPUID_TOPOLOGY_LEVEL_CORE;
break;
case 2:
- *eax = env->pkg_offset;
+ *eax = apicid_pkg_offset(&topo_info);
*ebx = env->nr_dies * cs->nr_cores * cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_DIE;
break;
@@ -5895,7 +5895,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
* CPUX86State::pkg_offset.
* Bits 7:0 is "The number of threads in the package is NC+1"
*/
- *ecx = (env->pkg_offset << 12) |
+ *ecx = (apicid_pkg_offset(&topo_info) << 12) |
((cs->nr_cores * cs->nr_threads) - 1);
} else {
*ecx = 0;
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index e1a5c174dc..d5ad42d694 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1630,7 +1630,6 @@ typedef struct CPUX86State {
unsigned nr_dies;
unsigned nr_nodes;
- unsigned pkg_offset;
} CPUX86State;
struct kvm_msrs;
--
2.27.0

View File

@ -1,90 +0,0 @@
From bc3db6832c57b1b28204b376f3c4c61cadfe0a35 Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:46 -0400
Subject: [PATCH 04/11] Revert "i386: Introduce use_epyc_apic_id_encoding in
X86CPUDefinition"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-5-imammedo@redhat.com>
Patchwork-id: 98249
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 4/7] Revert "i386: Introduce use_epyc_apic_id_encoding in X86CPUDefinition"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit 0c1538cb1a26287c072645f4759b9872b1596d79.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 16 ----------------
target/i386/cpu.h | 1 -
2 files changed, 17 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 66b6a77b2f..5e3d086f05 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1638,10 +1638,6 @@ typedef struct X86CPUDefinition {
FeatureWordArray features;
const char *model_id;
CPUCaches *cache_info;
-
- /* Use AMD EPYC encoding for apic id */
- bool use_epyc_apic_id_encoding;
-
/*
* Definitions for alternative versions of CPU model.
* List is terminated by item with version == 0.
@@ -1683,18 +1679,6 @@ static const X86CPUVersionDefinition *x86_cpu_def_get_versions(X86CPUDefinition
return def->versions ?: default_version_list;
}
-bool cpu_x86_use_epyc_apic_id_encoding(const char *cpu_type)
-{
- X86CPUClass *xcc = X86_CPU_CLASS(object_class_by_name(cpu_type));
-
- assert(xcc);
- if (xcc->model && xcc->model->cpudef) {
- return xcc->model->cpudef->use_epyc_apic_id_encoding;
- } else {
- return false;
- }
-}
-
static CPUCaches epyc_cache_info = {
.l1d_cache = &(CPUCacheInfo) {
.type = DATA_CACHE,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index d5ad42d694..5ff8ad8427 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1918,7 +1918,6 @@ void cpu_clear_apic_feature(CPUX86State *env);
void host_cpuid(uint32_t function, uint32_t count,
uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
void host_vendor_fms(char *vendor, int *family, int *model, int *stepping);
-bool cpu_x86_use_epyc_apic_id_encoding(const char *cpu_type);
/* helper.c */
bool x86_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
--
2.27.0

View File

@ -1,288 +0,0 @@
From 4236a54d72270d871ff1ed3fd09a2971327077a1 Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:48 -0400
Subject: [PATCH 06/11] Revert "target/i386: Cleanup and use the EPYC mode
topology functions"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-7-imammedo@redhat.com>
Patchwork-id: 98251
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 6/7] Revert "target/i386: Cleanup and use the EPYC mode topology functions"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit dd08ef0318e2b61d14bc069590d174913f7f437a.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 161 ++++++++++++++++++++++++++++++++++++----------
1 file changed, 127 insertions(+), 34 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 5e3d086f05..73fc83e53f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -338,15 +338,68 @@ static void encode_cache_cpuid80000006(CPUCacheInfo *l2,
}
}
+/*
+ * Definitions used for building CPUID Leaf 0x8000001D and 0x8000001E
+ * Please refer to the AMD64 Architecture Programmers Manual Volume 3.
+ * Define the constants to build the cpu topology. Right now, TOPOEXT
+ * feature is enabled only on EPYC. So, these constants are based on
+ * EPYC supported configurations. We may need to handle the cases if
+ * these values change in future.
+ */
+/* Maximum core complexes in a node */
+#define MAX_CCX 2
+/* Maximum cores in a core complex */
+#define MAX_CORES_IN_CCX 4
+/* Maximum cores in a node */
+#define MAX_CORES_IN_NODE 8
+/* Maximum nodes in a socket */
+#define MAX_NODES_PER_SOCKET 4
+
+/*
+ * Figure out the number of nodes required to build this config.
+ * Max cores in a node is 8
+ */
+static int nodes_in_socket(int nr_cores)
+{
+ int nodes;
+
+ nodes = DIV_ROUND_UP(nr_cores, MAX_CORES_IN_NODE);
+
+ /* Hardware does not support config with 3 nodes, return 4 in that case */
+ return (nodes == 3) ? 4 : nodes;
+}
+
+/*
+ * Decide the number of cores in a core complex with the given nr_cores using
+ * following set constants MAX_CCX, MAX_CORES_IN_CCX, MAX_CORES_IN_NODE and
+ * MAX_NODES_PER_SOCKET. Maintain symmetry as much as possible
+ * L3 cache is shared across all cores in a core complex. So, this will also
+ * tell us how many cores are sharing the L3 cache.
+ */
+static int cores_in_core_complex(int nr_cores)
+{
+ int nodes;
+
+ /* Check if we can fit all the cores in one core complex */
+ if (nr_cores <= MAX_CORES_IN_CCX) {
+ return nr_cores;
+ }
+ /* Get the number of nodes required to build this config */
+ nodes = nodes_in_socket(nr_cores);
+
+ /*
+ * Divide the cores accros all the core complexes
+ * Return rounded up value
+ */
+ return DIV_ROUND_UP(nr_cores, nodes * MAX_CCX);
+}
+
/* Encode cache info for CPUID[8000001D] */
-static void encode_cache_cpuid8000001d(CPUCacheInfo *cache,
- X86CPUTopoInfo *topo_info,
- uint32_t *eax, uint32_t *ebx,
- uint32_t *ecx, uint32_t *edx)
+static void encode_cache_cpuid8000001d(CPUCacheInfo *cache, CPUState *cs,
+ uint32_t *eax, uint32_t *ebx,
+ uint32_t *ecx, uint32_t *edx)
{
uint32_t l3_cores;
- unsigned nodes = MAX(topo_info->nodes_per_pkg, 1);
-
assert(cache->size == cache->line_size * cache->associativity *
cache->partitions * cache->sets);
@@ -355,13 +408,10 @@ static void encode_cache_cpuid8000001d(CPUCacheInfo *cache,
/* L3 is shared among multiple cores */
if (cache->level == 3) {
- l3_cores = DIV_ROUND_UP((topo_info->dies_per_pkg *
- topo_info->cores_per_die *
- topo_info->threads_per_core),
- nodes);
- *eax |= (l3_cores - 1) << 14;
+ l3_cores = cores_in_core_complex(cs->nr_cores);
+ *eax |= ((l3_cores * cs->nr_threads) - 1) << 14;
} else {
- *eax |= ((topo_info->threads_per_core - 1) << 14);
+ *eax |= ((cs->nr_threads - 1) << 14);
}
assert(cache->line_size > 0);
@@ -381,17 +431,55 @@ static void encode_cache_cpuid8000001d(CPUCacheInfo *cache,
(cache->complex_indexing ? CACHE_COMPLEX_IDX : 0);
}
+/* Data structure to hold the configuration info for a given core index */
+struct core_topology {
+ /* core complex id of the current core index */
+ int ccx_id;
+ /*
+ * Adjusted core index for this core in the topology
+ * This can be 0,1,2,3 with max 4 cores in a core complex
+ */
+ int core_id;
+ /* Node id for this core index */
+ int node_id;
+ /* Number of nodes in this config */
+ int num_nodes;
+};
+
+/*
+ * Build the configuration closely match the EPYC hardware. Using the EPYC
+ * hardware configuration values (MAX_CCX, MAX_CORES_IN_CCX, MAX_CORES_IN_NODE)
+ * right now. This could change in future.
+ * nr_cores : Total number of cores in the config
+ * core_id : Core index of the current CPU
+ * topo : Data structure to hold all the config info for this core index
+ */
+static void build_core_topology(int nr_cores, int core_id,
+ struct core_topology *topo)
+{
+ int nodes, cores_in_ccx;
+
+ /* First get the number of nodes required */
+ nodes = nodes_in_socket(nr_cores);
+
+ cores_in_ccx = cores_in_core_complex(nr_cores);
+
+ topo->node_id = core_id / (cores_in_ccx * MAX_CCX);
+ topo->ccx_id = (core_id % (cores_in_ccx * MAX_CCX)) / cores_in_ccx;
+ topo->core_id = core_id % cores_in_ccx;
+ topo->num_nodes = nodes;
+}
+
/* Encode cache info for CPUID[8000001E] */
-static void encode_topo_cpuid8000001e(X86CPUTopoInfo *topo_info, X86CPU *cpu,
+static void encode_topo_cpuid8000001e(CPUState *cs, X86CPU *cpu,
uint32_t *eax, uint32_t *ebx,
uint32_t *ecx, uint32_t *edx)
{
- X86CPUTopoIDs topo_ids = {0};
- unsigned long nodes = MAX(topo_info->nodes_per_pkg, 1);
+ struct core_topology topo = {0};
+ unsigned long nodes;
int shift;
- x86_topo_ids_from_apicid_epyc(cpu->apic_id, topo_info, &topo_ids);
-
+ build_core_topology(cs->nr_cores, cpu->core_id, &topo);
*eax = cpu->apic_id;
/*
* CPUID_Fn8000001E_EBX
@@ -408,8 +496,12 @@ static void encode_topo_cpuid8000001e(X86CPUTopoInfo *topo_info, X86CPU *cpu,
* 3 Core complex id
* 1:0 Core id
*/
- *ebx = ((topo_info->threads_per_core - 1) << 8) | (topo_ids.node_id << 3) |
- (topo_ids.core_id);
+ if (cs->nr_threads - 1) {
+ *ebx = ((cs->nr_threads - 1) << 8) | (topo.node_id << 3) |
+ (topo.ccx_id << 2) | topo.core_id;
+ } else {
+ *ebx = (topo.node_id << 4) | (topo.ccx_id << 3) | topo.core_id;
+ }
/*
* CPUID_Fn8000001E_ECX
* 31:11 Reserved
@@ -418,8 +510,9 @@ static void encode_topo_cpuid8000001e(X86CPUTopoInfo *topo_info, X86CPU *cpu,
* 2 Socket id
* 1:0 Node id
*/
- if (nodes <= 4) {
- *ecx = ((nodes - 1) << 8) | (topo_ids.pkg_id << 2) | topo_ids.node_id;
+ if (topo.num_nodes <= 4) {
+ *ecx = ((topo.num_nodes - 1) << 8) | (cpu->socket_id << 2) |
+ topo.node_id;
} else {
/*
* Node id fix up. Actual hardware supports up to 4 nodes. But with
@@ -434,10 +527,10 @@ static void encode_topo_cpuid8000001e(X86CPUTopoInfo *topo_info, X86CPU *cpu,
* number of nodes. find_last_bit returns last set bit(0 based). Left
* shift(+1) the socket id to represent all the nodes.
*/
- nodes -= 1;
+ nodes = topo.num_nodes - 1;
shift = find_last_bit(&nodes, 8);
- *ecx = (nodes << 8) | (topo_ids.pkg_id << (shift + 1)) |
- topo_ids.node_id;
+ *ecx = ((topo.num_nodes - 1) << 8) | (cpu->socket_id << (shift + 1)) |
+ topo.node_id;
}
*edx = 0;
}
@@ -5473,7 +5566,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
uint32_t signature[3];
X86CPUTopoInfo topo_info;
- topo_info.nodes_per_pkg = env->nr_nodes;
topo_info.dies_per_pkg = env->nr_dies;
topo_info.cores_per_die = cs->nr_cores;
topo_info.threads_per_core = cs->nr_threads;
@@ -5905,20 +5997,20 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
}
switch (count) {
case 0: /* L1 dcache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l1d_cache,
- &topo_info, eax, ebx, ecx, edx);
+ encode_cache_cpuid8000001d(env->cache_info_amd.l1d_cache, cs,
+ eax, ebx, ecx, edx);
break;
case 1: /* L1 icache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l1i_cache,
- &topo_info, eax, ebx, ecx, edx);
+ encode_cache_cpuid8000001d(env->cache_info_amd.l1i_cache, cs,
+ eax, ebx, ecx, edx);
break;
case 2: /* L2 cache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l2_cache,
- &topo_info, eax, ebx, ecx, edx);
+ encode_cache_cpuid8000001d(env->cache_info_amd.l2_cache, cs,
+ eax, ebx, ecx, edx);
break;
case 3: /* L3 cache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l3_cache,
- &topo_info, eax, ebx, ecx, edx);
+ encode_cache_cpuid8000001d(env->cache_info_amd.l3_cache, cs,
+ eax, ebx, ecx, edx);
break;
default: /* end of info */
*eax = *ebx = *ecx = *edx = 0;
@@ -5927,7 +6019,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
break;
case 0x8000001E:
assert(cpu->core_id <= 255);
- encode_topo_cpuid8000001e(&topo_info, cpu, eax, ebx, ecx, edx);
+ encode_topo_cpuid8000001e(cs, cpu,
+ eax, ebx, ecx, edx);
break;
case 0xC0000000:
*eax = env->cpuid_xlevel2;
--
2.27.0

View File

@ -1,63 +0,0 @@
From a36be18a97841a091256e9934fb323afc9c3a57a Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Fri, 28 Aug 2020 16:23:44 -0400
Subject: [PATCH 02/11] Revert "target/i386: Enable new apic id encoding for
EPYC based cpus models"
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20200828162349.1616028-3-imammedo@redhat.com>
Patchwork-id: 98245
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 2/7] Revert "target/i386: Enable new apic id encoding for EPYC based cpus models"
Bugzilla: 1873417
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1873417
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31005031
Branch: rhel-av-8.3.0
Upstream: RHEL only
Tested: locally
A regression was introduced since qemu-5.0, when EPYC specific
APIC ID encoding was introduced. Which leads to migration failing
with:
"
: Unknown savevm section or instance 'apic' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
: load of migration failed: Invalid argument
"
when EPYC cpu model and more than 1 numa node is used.
EPYC specific APIC ID encoding is considered as failed
experiment and upstream is preparing to revert it as well.
This reverts commit 247b18c593ec298446645af8d5d28911daf653b1.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6517cc73a2..66b6a77b2f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3996,7 +3996,6 @@ static X86CPUDefinition builtin_x86_defs[] = {
.xlevel = 0x8000001E,
.model_id = "AMD EPYC Processor",
.cache_info = &epyc_cache_info,
- .use_epyc_apic_id_encoding = 1,
.versions = (X86CPUVersionDefinition[]) {
{ .version = 1 },
{
@@ -4124,7 +4123,6 @@ static X86CPUDefinition builtin_x86_defs[] = {
.xlevel = 0x8000001E,
.model_id = "AMD EPYC-Rome Processor",
.cache_info = &epyc_rome_cache_info,
- .use_epyc_apic_id_encoding = 1,
},
};
--
2.27.0

View File

@ -1,51 +0,0 @@
From ba82420d04b2e2ca69d5ff4720e37dd0748936ea Mon Sep 17 00:00:00 2001
From: Stefano Garzarella <sgarzare@redhat.com>
Date: Wed, 16 Sep 2020 11:40:25 -0400
Subject: [PATCH 4/4] block/rbd: add 'namespace' to
qemu_rbd_strong_runtime_opts[]
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
Message-id: <20200916114025.47973-2-sgarzare@redhat.com>
Patchwork-id: 98399
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/1] block/rbd: add 'namespace' to qemu_rbd_strong_runtime_opts[]
Bugzilla: 1821528
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
Commit 19ae9ae014 ("block/rbd: Add support for ceph namespaces")
introduced namespace support for RBD, but we forgot to add the
new 'namespace' options to qemu_rbd_strong_runtime_opts[].
The 'namespace' is used to identify the image, so it is a strong
option since it can changes the data of a BDS.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1821528
Fixes: 19ae9ae014 ("block/rbd: Add support for ceph namespaces")
Cc: Florian Florensa <fflorensa@online.net>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200914190553.74871-1-sgarzare@redhat.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 7bae7c805d82675eb3a02c744093703d84ada2d6)
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block/rbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/rbd.c b/block/rbd.c
index 688074c64b..5356753fbe 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -1289,6 +1289,7 @@ static QemuOptsList qemu_rbd_create_opts = {
static const char *const qemu_rbd_strong_runtime_opts[] = {
"pool",
+ "namespace",
"image",
"conf",
"snapshot",
--
2.27.0

View File

@ -1,78 +0,0 @@
From d323d7648a64e213d099d7ee3c66edc186b97808 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com>
Date: Fri, 18 Sep 2020 19:35:42 -0400
Subject: [PATCH] hw/nvram/fw_cfg: fix FWCfgDataGeneratorClass::get_data()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: <20200918193542.191031-2-philmd@redhat.com>
Patchwork-id: 98402
O-Subject: [PATCH 1/1] hw/nvram/fw_cfg: fix FWCfgDataGeneratorClass::get_data() consumption
Bugzilla: 1688978
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
From: Laszlo Ersek <lersek@redhat.com>
The documentation on g_byte_array_free()
<https://developer.gnome.org/glib/stable/glib-Byte-Arrays.html#g-byte-array-free>
says:
> Returns
>
> the element data if free_segment is FALSE, otherwise NULL. The element
> data should be freed using g_free().
Because we currently call g_byte_array_free() with free_segment=TRUE, we
end up passing data=NULL to fw_cfg_add_file().
On the plus side, fw_cfg_data_read() and fw_cfg_dma_transfer() both deal
with NULL data gracefully: QEMU does not crash when the guest reads such
an item, the guest just gets a properly sized, but zero-filled blob.
However, the bug breaks UEFI HTTPS boot, as the IANA_TLS_CIPHER array,
generated otherwise correctly by the "tls-cipher-suites" object, is in
effect replaced with a zero blob.
Fix the issue by passing free_segment=FALSE to g_byte_array_free():
- the caller (fw_cfg_add_from_generator()) temporarily assumes ownership
of the generated byte array,
- then ownership of the byte array is transfered to fw_cfg, as
fw_cfg_add_file() links (not copies) "data" into fw_cfg.
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Fixes: 3203148917d035b09f71986ac2eaa19a352d6d9d
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200916151510.22767-1-lersek@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
(cherry picked from commit 4318432ccd3f7fb69b7169f39dcae3d4ee04f5ea)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/nvram/fw_cfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index f3a4728288e..0e95d057fd5 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1056,7 +1056,7 @@ bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
return false;
}
size = array->len;
- fw_cfg_add_file(s, filename, g_byte_array_free(array, TRUE), size);
+ fw_cfg_add_file(s, filename, g_byte_array_free(array, FALSE), size);
return true;
}
--
2.27.0

View File

@ -1,655 +0,0 @@
From 2877fd4f92a86f43a113691f56738b09a0b4d500 Mon Sep 17 00:00:00 2001
From: Max Reitz <mreitz@redhat.com>
Date: Mon, 24 Aug 2020 09:20:38 -0400
Subject: [PATCH 6/6] iotests: Test node/bitmap aliases during migration
RH-Author: Max Reitz <mreitz@redhat.com>
Message-id: <20200824092038.227913-4-mreitz@redhat.com>
Patchwork-id: 98214
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 3/3] iotests: Test node/bitmap aliases during migration
Bugzilla: 1790492
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200820150725.68687-4-mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
[eblake: fold in python cleanups recommended by Vladimir]
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit cb5c6cd2dc984812f560fbe41f57a6bfc34d8708)
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/qemu-iotests/300 | 593 +++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/300.out | 5 +
tests/qemu-iotests/group | 1 +
3 files changed, 599 insertions(+)
create mode 100755 tests/qemu-iotests/300
create mode 100644 tests/qemu-iotests/300.out
diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300
new file mode 100755
index 0000000000..5b75121b84
--- /dev/null
+++ b/tests/qemu-iotests/300
@@ -0,0 +1,593 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2020 Red Hat, Inc.
+#
+# Tests for dirty bitmaps migration with node aliases
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import os
+import random
+import re
+from typing import Dict, List, Optional, Union
+import iotests
+import qemu
+
+BlockBitmapMapping = List[Dict[str, Union[str, List[Dict[str, str]]]]]
+
+assert iotests.sock_dir is not None
+mig_sock = os.path.join(iotests.sock_dir, 'mig_sock')
+
+
+class TestDirtyBitmapMigration(iotests.QMPTestCase):
+ src_node_name: str = ''
+ dst_node_name: str = ''
+ src_bmap_name: str = ''
+ dst_bmap_name: str = ''
+
+ def setUp(self) -> None:
+ self.vm_a = iotests.VM(path_suffix='-a')
+ self.vm_a.add_blockdev(f'node-name={self.src_node_name},'
+ 'driver=null-co')
+ self.vm_a.launch()
+
+ self.vm_b = iotests.VM(path_suffix='-b')
+ self.vm_b.add_blockdev(f'node-name={self.dst_node_name},'
+ 'driver=null-co')
+ self.vm_b.add_incoming(f'unix:{mig_sock}')
+ self.vm_b.launch()
+
+ result = self.vm_a.qmp('block-dirty-bitmap-add',
+ node=self.src_node_name,
+ name=self.src_bmap_name)
+ self.assert_qmp(result, 'return', {})
+
+ # Dirty some random megabytes
+ for _ in range(9):
+ mb_ofs = random.randrange(1024)
+ self.vm_a.hmp_qemu_io(self.src_node_name, f'discard {mb_ofs}M 1M')
+
+ result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
+ node=self.src_node_name,
+ name=self.src_bmap_name)
+ self.bitmap_hash_reference = result['return']['sha256']
+
+ caps = [{'capability': name, 'state': True}
+ for name in ('dirty-bitmaps', 'events')]
+
+ for vm in (self.vm_a, self.vm_b):
+ result = vm.qmp('migrate-set-capabilities', capabilities=caps)
+ self.assert_qmp(result, 'return', {})
+
+ def tearDown(self) -> None:
+ self.vm_a.shutdown()
+ self.vm_b.shutdown()
+ try:
+ os.remove(mig_sock)
+ except OSError:
+ pass
+
+ def check_bitmap(self, bitmap_name_valid: bool) -> None:
+ result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
+ node=self.dst_node_name,
+ name=self.dst_bmap_name)
+ if bitmap_name_valid:
+ self.assert_qmp(result, 'return/sha256',
+ self.bitmap_hash_reference)
+ else:
+ self.assert_qmp(result, 'error/desc',
+ f"Dirty bitmap '{self.dst_bmap_name}' not found")
+
+ def migrate(self, bitmap_name_valid: bool = True,
+ migration_success: bool = True) -> None:
+ result = self.vm_a.qmp('migrate', uri=f'unix:{mig_sock}')
+ self.assert_qmp(result, 'return', {})
+
+ with iotests.Timeout(5, 'Timeout waiting for migration to complete'):
+ self.assertEqual(self.vm_a.wait_migration('postmigrate'),
+ migration_success)
+ self.assertEqual(self.vm_b.wait_migration('running'),
+ migration_success)
+
+ if migration_success:
+ self.check_bitmap(bitmap_name_valid)
+
+ def verify_dest_error(self, msg: Optional[str]) -> None:
+ """
+ Check whether the given error message is present in vm_b's log.
+ (vm_b is shut down to do so.)
+ If @msg is None, check that there has not been any error.
+ """
+ self.vm_b.shutdown()
+ if msg is None:
+ self.assertNotIn('qemu-system-', self.vm_b.get_log())
+ else:
+ self.assertIn(msg, self.vm_b.get_log())
+
+ @staticmethod
+ def mapping(node_name: str, node_alias: str,
+ bitmap_name: str, bitmap_alias: str) -> BlockBitmapMapping:
+ return [{
+ 'node-name': node_name,
+ 'alias': node_alias,
+ 'bitmaps': [{
+ 'name': bitmap_name,
+ 'alias': bitmap_alias
+ }]
+ }]
+
+ def set_mapping(self, vm: iotests.VM, mapping: BlockBitmapMapping,
+ error: Optional[str] = None) -> None:
+ """
+ Invoke migrate-set-parameters on @vm to set the given @mapping.
+ Check for success if @error is None, or verify the error message
+ if it is not.
+ On success, verify that "info migrate_parameters" on HMP returns
+ our mapping. (Just to check its formatting code.)
+ """
+ result = vm.qmp('migrate-set-parameters',
+ block_bitmap_mapping=mapping)
+
+ if error is None:
+ self.assert_qmp(result, 'return', {})
+
+ result = vm.qmp('human-monitor-command',
+ command_line='info migrate_parameters')
+
+ m = re.search(r'^block-bitmap-mapping:\r?(\n .*)*\n',
+ result['return'], flags=re.MULTILINE)
+ hmp_mapping = m.group(0).replace('\r', '') if m else None
+
+ self.assertEqual(hmp_mapping, self.to_hmp_mapping(mapping))
+ else:
+ self.assert_qmp(result, 'error/desc', error)
+
+ @staticmethod
+ def to_hmp_mapping(mapping: BlockBitmapMapping) -> str:
+ result = 'block-bitmap-mapping:\n'
+
+ for node in mapping:
+ result += f" '{node['node-name']}' -> '{node['alias']}'\n"
+
+ assert isinstance(node['bitmaps'], list)
+ for bitmap in node['bitmaps']:
+ result += f" '{bitmap['name']}' -> '{bitmap['alias']}'\n"
+
+ return result
+
+
+class TestAliasMigration(TestDirtyBitmapMigration):
+ src_node_name = 'node0'
+ dst_node_name = 'node0'
+ src_bmap_name = 'bmap0'
+ dst_bmap_name = 'bmap0'
+
+ def test_migration_without_alias(self) -> None:
+ self.migrate(self.src_node_name == self.dst_node_name and
+ self.src_bmap_name == self.dst_bmap_name)
+
+ # Check for error message on the destination
+ if self.src_node_name != self.dst_node_name:
+ self.verify_dest_error(f"Cannot find "
+ f"device={self.src_node_name} nor "
+ f"node_name={self.src_node_name}")
+ else:
+ self.verify_dest_error(None)
+
+ def test_alias_on_src_migration(self) -> None:
+ mapping = self.mapping(self.src_node_name, self.dst_node_name,
+ self.src_bmap_name, self.dst_bmap_name)
+
+ self.set_mapping(self.vm_a, mapping)
+ self.migrate()
+ self.verify_dest_error(None)
+
+ def test_alias_on_dst_migration(self) -> None:
+ mapping = self.mapping(self.dst_node_name, self.src_node_name,
+ self.dst_bmap_name, self.src_bmap_name)
+
+ self.set_mapping(self.vm_b, mapping)
+ self.migrate()
+ self.verify_dest_error(None)
+
+ def test_alias_on_both_migration(self) -> None:
+ src_map = self.mapping(self.src_node_name, 'node-alias',
+ self.src_bmap_name, 'bmap-alias')
+
+ dst_map = self.mapping(self.dst_node_name, 'node-alias',
+ self.dst_bmap_name, 'bmap-alias')
+
+ self.set_mapping(self.vm_a, src_map)
+ self.set_mapping(self.vm_b, dst_map)
+ self.migrate()
+ self.verify_dest_error(None)
+
+
+class TestNodeAliasMigration(TestAliasMigration):
+ src_node_name = 'node-src'
+ dst_node_name = 'node-dst'
+
+
+class TestBitmapAliasMigration(TestAliasMigration):
+ src_bmap_name = 'bmap-src'
+ dst_bmap_name = 'bmap-dst'
+
+
+class TestFullAliasMigration(TestAliasMigration):
+ src_node_name = 'node-src'
+ dst_node_name = 'node-dst'
+ src_bmap_name = 'bmap-src'
+ dst_bmap_name = 'bmap-dst'
+
+
+class TestLongBitmapNames(TestAliasMigration):
+ # Giving long bitmap names is OK, as long as there is a short alias for
+ # migration
+ src_bmap_name = 'a' * 512
+ dst_bmap_name = 'b' * 512
+
+ # Skip all tests that do not use the intermediate alias
+ def test_migration_without_alias(self) -> None:
+ pass
+
+ def test_alias_on_src_migration(self) -> None:
+ pass
+
+ def test_alias_on_dst_migration(self) -> None:
+ pass
+
+
+class TestBlockBitmapMappingErrors(TestDirtyBitmapMigration):
+ src_node_name = 'node0'
+ dst_node_name = 'node0'
+ src_bmap_name = 'bmap0'
+ dst_bmap_name = 'bmap0'
+
+ """
+ Note that mapping nodes or bitmaps that do not exist is not an error.
+ """
+
+ def test_non_injective_node_mapping(self) -> None:
+ mapping: BlockBitmapMapping = [
+ {
+ 'node-name': 'node0',
+ 'alias': 'common-alias',
+ 'bitmaps': [{
+ 'name': 'bmap0',
+ 'alias': 'bmap-alias0'
+ }]
+ },
+ {
+ 'node-name': 'node1',
+ 'alias': 'common-alias',
+ 'bitmaps': [{
+ 'name': 'bmap1',
+ 'alias': 'bmap-alias1'
+ }]
+ }
+ ]
+
+ self.set_mapping(self.vm_a, mapping,
+ "Invalid mapping given for block-bitmap-mapping: "
+ "The node alias 'common-alias' is used twice")
+
+ def test_non_injective_bitmap_mapping(self) -> None:
+ mapping: BlockBitmapMapping = [{
+ 'node-name': 'node0',
+ 'alias': 'node-alias0',
+ 'bitmaps': [
+ {
+ 'name': 'bmap0',
+ 'alias': 'common-alias'
+ },
+ {
+ 'name': 'bmap1',
+ 'alias': 'common-alias'
+ }
+ ]
+ }]
+
+ self.set_mapping(self.vm_a, mapping,
+ "Invalid mapping given for block-bitmap-mapping: "
+ "The bitmap alias 'node-alias0'/'common-alias' is "
+ "used twice")
+
+ def test_ambiguous_node_mapping(self) -> None:
+ mapping: BlockBitmapMapping = [
+ {
+ 'node-name': 'node0',
+ 'alias': 'node-alias0',
+ 'bitmaps': [{
+ 'name': 'bmap0',
+ 'alias': 'bmap-alias0'
+ }]
+ },
+ {
+ 'node-name': 'node0',
+ 'alias': 'node-alias1',
+ 'bitmaps': [{
+ 'name': 'bmap0',
+ 'alias': 'bmap-alias0'
+ }]
+ }
+ ]
+
+ self.set_mapping(self.vm_a, mapping,
+ "Invalid mapping given for block-bitmap-mapping: "
+ "The node name 'node0' is mapped twice")
+
+ def test_ambiguous_bitmap_mapping(self) -> None:
+ mapping: BlockBitmapMapping = [{
+ 'node-name': 'node0',
+ 'alias': 'node-alias0',
+ 'bitmaps': [
+ {
+ 'name': 'bmap0',
+ 'alias': 'bmap-alias0'
+ },
+ {
+ 'name': 'bmap0',
+ 'alias': 'bmap-alias1'
+ }
+ ]
+ }]
+
+ self.set_mapping(self.vm_a, mapping,
+ "Invalid mapping given for block-bitmap-mapping: "
+ "The bitmap 'node0'/'bmap0' is mapped twice")
+
+ def test_migratee_node_is_not_mapped_on_src(self) -> None:
+ self.set_mapping(self.vm_a, [])
+ # Should just ignore all bitmaps on unmapped nodes
+ self.migrate(False)
+ self.verify_dest_error(None)
+
+ def test_migratee_node_is_not_mapped_on_dst(self) -> None:
+ self.set_mapping(self.vm_b, [])
+ self.migrate(False)
+ self.verify_dest_error(f"Unknown node alias '{self.src_node_name}'")
+
+ def test_migratee_bitmap_is_not_mapped_on_src(self) -> None:
+ mapping: BlockBitmapMapping = [{
+ 'node-name': self.src_node_name,
+ 'alias': self.dst_node_name,
+ 'bitmaps': []
+ }]
+
+ self.set_mapping(self.vm_a, mapping)
+ # Should just ignore all unmapped bitmaps
+ self.migrate(False)
+ self.verify_dest_error(None)
+
+ def test_migratee_bitmap_is_not_mapped_on_dst(self) -> None:
+ mapping: BlockBitmapMapping = [{
+ 'node-name': self.dst_node_name,
+ 'alias': self.src_node_name,
+ 'bitmaps': []
+ }]
+
+ self.set_mapping(self.vm_b, mapping)
+ self.migrate(False)
+ self.verify_dest_error(f"Unknown bitmap alias "
+ f"'{self.src_bmap_name}' "
+ f"on node '{self.dst_node_name}' "
+ f"(alias '{self.src_node_name}')")
+
+ def test_unused_mapping_on_dst(self) -> None:
+ # Let the source not send any bitmaps
+ self.set_mapping(self.vm_a, [])
+
+ # Establish some mapping on the destination
+ self.set_mapping(self.vm_b, [])
+
+ # The fact that there is a mapping on B without any bitmaps
+ # being received should be fine, not fatal
+ self.migrate(False)
+ self.verify_dest_error(None)
+
+ def test_non_wellformed_node_alias(self) -> None:
+ alias = '123-foo'
+
+ mapping: BlockBitmapMapping = [{
+ 'node-name': self.src_node_name,
+ 'alias': alias,
+ 'bitmaps': []
+ }]
+
+ self.set_mapping(self.vm_a, mapping,
+ f"Invalid mapping given for block-bitmap-mapping: "
+ f"The node alias '{alias}' is not well-formed")
+
+ def test_node_alias_too_long(self) -> None:
+ alias = 'a' * 256
+
+ mapping: BlockBitmapMapping = [{
+ 'node-name': self.src_node_name,
+ 'alias': alias,
+ 'bitmaps': []
+ }]
+
+ self.set_mapping(self.vm_a, mapping,
+ f"Invalid mapping given for block-bitmap-mapping: "
+ f"The node alias '{alias}' is longer than 255 bytes")
+
+ def test_bitmap_alias_too_long(self) -> None:
+ alias = 'a' * 256
+
+ mapping = self.mapping(self.src_node_name, self.dst_node_name,
+ self.src_bmap_name, alias)
+
+ self.set_mapping(self.vm_a, mapping,
+ f"Invalid mapping given for block-bitmap-mapping: "
+ f"The bitmap alias '{alias}' is longer than 255 "
+ f"bytes")
+
+ def test_bitmap_name_too_long(self) -> None:
+ name = 'a' * 256
+
+ result = self.vm_a.qmp('block-dirty-bitmap-add',
+ node=self.src_node_name,
+ name=name)
+ self.assert_qmp(result, 'return', {})
+
+ self.migrate(False, False)
+
+ # Check for the error in the source's log
+ self.vm_a.shutdown()
+ self.assertIn(f"Cannot migrate bitmap '{name}' on node "
+ f"'{self.src_node_name}': Name is longer than 255 bytes",
+ self.vm_a.get_log())
+
+ # Expect abnormal shutdown of the destination VM because of
+ # the failed migration
+ try:
+ self.vm_b.shutdown()
+ except qemu.machine.AbnormalShutdown:
+ pass
+
+ def test_aliased_bitmap_name_too_long(self) -> None:
+ # Longer than the maximum for bitmap names
+ self.dst_bmap_name = 'a' * 1024
+
+ mapping = self.mapping(self.dst_node_name, self.src_node_name,
+ self.dst_bmap_name, self.src_bmap_name)
+
+ # We would have to create this bitmap during migration, and
+ # that would fail, because the name is too long. Better to
+ # catch it early.
+ self.set_mapping(self.vm_b, mapping,
+ f"Invalid mapping given for block-bitmap-mapping: "
+ f"The bitmap name '{self.dst_bmap_name}' is longer "
+ f"than 1023 bytes")
+
+ def test_node_name_too_long(self) -> None:
+ # Longer than the maximum for node names
+ self.dst_node_name = 'a' * 32
+
+ mapping = self.mapping(self.dst_node_name, self.src_node_name,
+ self.dst_bmap_name, self.src_bmap_name)
+
+ # During migration, this would appear simply as a node that
+ # cannot be found. Still better to catch impossible node
+ # names early (similar to test_non_wellformed_node_alias).
+ self.set_mapping(self.vm_b, mapping,
+ f"Invalid mapping given for block-bitmap-mapping: "
+ f"The node name '{self.dst_node_name}' is longer "
+ f"than 31 bytes")
+
+
+class TestCrossAliasMigration(TestDirtyBitmapMigration):
+ """
+ Swap aliases, both to see that qemu does not get confused, and
+ that we can migrate multiple things at once.
+
+ So we migrate this:
+ node-a.bmap-a -> node-b.bmap-b
+ node-a.bmap-b -> node-b.bmap-a
+ node-b.bmap-a -> node-a.bmap-b
+ node-b.bmap-b -> node-a.bmap-a
+ """
+
+ src_node_name = 'node-a'
+ dst_node_name = 'node-b'
+ src_bmap_name = 'bmap-a'
+ dst_bmap_name = 'bmap-b'
+
+ def setUp(self) -> None:
+ TestDirtyBitmapMigration.setUp(self)
+
+ # Now create another block device and let both have two bitmaps each
+ result = self.vm_a.qmp('blockdev-add',
+ node_name='node-b', driver='null-co')
+ self.assert_qmp(result, 'return', {})
+
+ result = self.vm_b.qmp('blockdev-add',
+ node_name='node-a', driver='null-co')
+ self.assert_qmp(result, 'return', {})
+
+ bmaps_to_add = (('node-a', 'bmap-b'),
+ ('node-b', 'bmap-a'),
+ ('node-b', 'bmap-b'))
+
+ for (node, bmap) in bmaps_to_add:
+ result = self.vm_a.qmp('block-dirty-bitmap-add',
+ node=node, name=bmap)
+ self.assert_qmp(result, 'return', {})
+
+ @staticmethod
+ def cross_mapping() -> BlockBitmapMapping:
+ return [
+ {
+ 'node-name': 'node-a',
+ 'alias': 'node-b',
+ 'bitmaps': [
+ {
+ 'name': 'bmap-a',
+ 'alias': 'bmap-b'
+ },
+ {
+ 'name': 'bmap-b',
+ 'alias': 'bmap-a'
+ }
+ ]
+ },
+ {
+ 'node-name': 'node-b',
+ 'alias': 'node-a',
+ 'bitmaps': [
+ {
+ 'name': 'bmap-b',
+ 'alias': 'bmap-a'
+ },
+ {
+ 'name': 'bmap-a',
+ 'alias': 'bmap-b'
+ }
+ ]
+ }
+ ]
+
+ def verify_dest_has_all_bitmaps(self) -> None:
+ bitmaps = self.vm_b.query_bitmaps()
+
+ # Extract and sort bitmap names
+ for node in bitmaps:
+ bitmaps[node] = sorted((bmap['name'] for bmap in bitmaps[node]))
+
+ self.assertEqual(bitmaps,
+ {'node-a': ['bmap-a', 'bmap-b'],
+ 'node-b': ['bmap-a', 'bmap-b']})
+
+ def test_alias_on_src(self) -> None:
+ self.set_mapping(self.vm_a, self.cross_mapping())
+
+ # Checks that node-a.bmap-a was migrated to node-b.bmap-b, and
+ # that is enough
+ self.migrate()
+ self.verify_dest_has_all_bitmaps()
+ self.verify_dest_error(None)
+
+ def test_alias_on_dst(self) -> None:
+ self.set_mapping(self.vm_b, self.cross_mapping())
+
+ # Checks that node-a.bmap-a was migrated to node-b.bmap-b, and
+ # that is enough
+ self.migrate()
+ self.verify_dest_has_all_bitmaps()
+ self.verify_dest_error(None)
+
+
+if __name__ == '__main__':
+ iotests.main(supported_protocols=['file'])
diff --git a/tests/qemu-iotests/300.out b/tests/qemu-iotests/300.out
new file mode 100644
index 0000000000..cafb8161f7
--- /dev/null
+++ b/tests/qemu-iotests/300.out
@@ -0,0 +1,5 @@
+.....................................
+----------------------------------------------------------------------
+Ran 37 tests
+
+OK
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 025ed5238d..b0b55e241c 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -307,5 +307,6 @@
296 rw
297 meta
299 auto quick
+300 migration
301 backing quick
302 quick
--
2.27.0

View File

@ -1,66 +0,0 @@
From 2a597bba9b1e07adb6531628962682a0e53d29b1 Mon Sep 17 00:00:00 2001
From: Max Reitz <mreitz@redhat.com>
Date: Mon, 24 Aug 2020 09:20:37 -0400
Subject: [PATCH 5/6] iotests.py: Let wait_migration() return on failure
RH-Author: Max Reitz <mreitz@redhat.com>
Message-id: <20200824092038.227913-3-mreitz@redhat.com>
Patchwork-id: 98213
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 2/3] iotests.py: Let wait_migration() return on failure
Bugzilla: 1790492
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Let wait_migration() return on failure (with the return value indicating
whether the migration was completed or has failed), so we can use it for
migrations that are expected to fail, too.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200820150725.68687-3-mreitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 4bf63c80357031be4eb8fff8a751f40e73ef1c10)
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/qemu-iotests/iotests.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 717b5b652c..e197c73ca5 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -729,16 +729,22 @@ class VM(qtest.QEMUQtestMachine):
}
]))
- def wait_migration(self, expect_runstate):
+ def wait_migration(self, expect_runstate: Optional[str]) -> bool:
while True:
event = self.event_wait('MIGRATION')
log(event, filters=[filter_qmp_event])
- if event['data']['status'] == 'completed':
+ if event['data']['status'] in ('completed', 'failed'):
break
- # The event may occur in finish-migrate, so wait for the expected
- # post-migration runstate
- while self.qmp('query-status')['return']['status'] != expect_runstate:
- pass
+
+ if event['data']['status'] == 'completed':
+ # The event may occur in finish-migrate, so wait for the expected
+ # post-migration runstate
+ runstate = None
+ while runstate != expect_runstate:
+ runstate = self.qmp('query-status')['return']['status']
+ return True
+ else:
+ return False
def node_info(self, node_name):
nodes = self.qmp('query-named-block-nodes')
--
2.27.0

View File

@ -1,77 +0,0 @@
From 6d7ba662e980fcc6f3056173043136063e6d68db Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 20 Aug 2020 15:14:18 -0400
Subject: [PATCH 2/6] machine types/numa: set numa_mem_supported on old machine
types
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20200820151419.14723-2-dgilbert@redhat.com>
Patchwork-id: 98197
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 1/2] machine types/numa: set numa_mem_supported on old machine types
Bugzilla: 1849707
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: David Hildenbrand <david@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reenable the -numa mem= syntax for old machine types, this is making
the downstream old machines behave in the same way as the upstream old
machines changed in upstream 32a354dc6c07d7.
Power already seems to have the change.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 2 +-
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index f087483a04..26a7920081 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2755,7 +2755,6 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
hc->plug = virt_machine_device_plug_cb;
hc->unplug_request = virt_machine_device_unplug_request_cb;
hc->unplug = virt_machine_device_unplug_cb;
- mc->numa_mem_supported = true;
mc->nvdimm_supported = true;
mc->auto_enable_numa_with_memhp = true;
mc->default_ram_id = "mach-virt.ram";
@@ -2860,5 +2859,6 @@ static void rhel820_virt_options(MachineClass *mc)
rhel830_virt_options(mc);
compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
hw_compat_rhel_8_2_len);
+ mc->numa_mem_supported = true;
}
DEFINE_RHEL_MACHINE(8, 2, 0)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 4af4497a0c..bda2d9ffc8 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1009,6 +1009,7 @@ static void pc_machine_rhel7_options(MachineClass *m)
pcmc->default_nic_model = "e1000";
m->default_display = "std";
m->no_parallel = 1;
+ m->numa_mem_supported = true;
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
m->alias = "pc";
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index c709460ab7..d1e3a9b575 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -617,6 +617,7 @@ static void pc_q35_machine_rhel820_options(MachineClass *m)
pc_q35_machine_rhel_options(m);
m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)";
m->alias = NULL;
+ m->numa_mem_supported = true;
pcmc->smbios_stream_product = "RHEL-AV";
pcmc->smbios_stream_version = "8.2.0";
compat_props_add(m->compat_props, hw_compat_rhel_8_2,
--
2.27.0

View File

@ -1,81 +0,0 @@
From 25c5644164e3286dc722d59c8d7876b1c49c1385 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 20 Aug 2020 15:14:19 -0400
Subject: [PATCH 3/6] machine_types/numa: compatibility for
auto_enable_numa_with_memdev
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20200820151419.14723-3-dgilbert@redhat.com>
Patchwork-id: 98196
O-Subject: [RHEL-AV 8.3.0 qemu-kvm PATCH 2/2] machine_types/numa: compatibility for auto_enable_numa_with_memdev
Bugzilla: 1849707
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: David Hildenbrand <david@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The auto_enable_numa_with_memdev flag automatically creates NUMA a
NUMA node in a case like:
-m 8G,maxmem=16G
but we need it to keep old machine types the same.
This is (mostly) done for upstream machine types in 195784a0cfad.
Power seems to have auto_enable_numa permenantly on anyway.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 2 ++
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
3 files changed, 4 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 26a7920081..26102f22ff 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2757,6 +2757,7 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
hc->unplug = virt_machine_device_unplug_cb;
mc->nvdimm_supported = true;
mc->auto_enable_numa_with_memhp = true;
+ mc->auto_enable_numa_with_memdev = true;
mc->default_ram_id = "mach-virt.ram";
object_class_property_add(oc, "acpi", "OnOffAuto",
@@ -2860,5 +2861,6 @@ static void rhel820_virt_options(MachineClass *mc)
compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
hw_compat_rhel_8_2_len);
mc->numa_mem_supported = true;
+ mc->auto_enable_numa_with_memdev = false;
}
DEFINE_RHEL_MACHINE(8, 2, 0)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index bda2d9ffc8..2415c5edd6 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1010,6 +1010,7 @@ static void pc_machine_rhel7_options(MachineClass *m)
m->default_display = "std";
m->no_parallel = 1;
m->numa_mem_supported = true;
+ m->auto_enable_numa_with_memdev = false;
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
m->alias = "pc";
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d1e3a9b575..87a0572ec1 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -618,6 +618,7 @@ static void pc_q35_machine_rhel820_options(MachineClass *m)
m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)";
m->alias = NULL;
m->numa_mem_supported = true;
+ m->auto_enable_numa_with_memdev = false;
pcmc->smbios_stream_product = "RHEL-AV";
pcmc->smbios_stream_version = "8.2.0";
compat_props_add(m->compat_props, hw_compat_rhel_8_2,
--
2.27.0

View File

@ -1,947 +0,0 @@
From 8ac15801169cb8744b57b939a3c751ea9d381d98 Mon Sep 17 00:00:00 2001
From: Max Reitz <mreitz@redhat.com>
Date: Mon, 24 Aug 2020 09:20:36 -0400
Subject: [PATCH 4/6] migration: Add block-bitmap-mapping parameter
RH-Author: Max Reitz <mreitz@redhat.com>
Message-id: <20200824092038.227913-2-mreitz@redhat.com>
Patchwork-id: 98211
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/3] migration: Add block-bitmap-mapping parameter
Bugzilla: 1790492
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
This migration parameter allows mapping block node names and bitmap
names to aliases for the purpose of block dirty bitmap migration.
This way, management tools can use different node and bitmap names on
the source and destination and pass the mapping of how bitmaps are to be
transferred to qemu (on the source, the destination, or even both with
arbitrary aliases in the migration stream).
While touching this code, fix a bug where bitmap names longer than 255
bytes would fail an assertion in qemu_put_counted_string().
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200820150725.68687-2-mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 31e4c354b38cd42a051ad030eb7779d5e7ee32fe)
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
migration/block-dirty-bitmap.c | 412 ++++++++++++++++++++++++++++-----
migration/migration.c | 30 +++
migration/migration.h | 3 +
monitor/hmp-cmds.c | 30 +++
qapi/migration.json | 104 ++++++++-
5 files changed, 522 insertions(+), 57 deletions(-)
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 784330ebe1..549e14daba 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -29,10 +29,10 @@
*
* # Header (shared for different chunk types)
* 1, 2 or 4 bytes: flags (see qemu_{put,put}_flags)
- * [ 1 byte: node name size ] \ flags & DEVICE_NAME
- * [ n bytes: node name ] /
- * [ 1 byte: bitmap name size ] \ flags & BITMAP_NAME
- * [ n bytes: bitmap name ] /
+ * [ 1 byte: node alias size ] \ flags & DEVICE_NAME
+ * [ n bytes: node alias ] /
+ * [ 1 byte: bitmap alias size ] \ flags & BITMAP_NAME
+ * [ n bytes: bitmap alias ] /
*
* # Start of bitmap migration (flags & START)
* header
@@ -72,7 +72,9 @@
#include "migration/register.h"
#include "qemu/hbitmap.h"
#include "qemu/cutils.h"
+#include "qemu/id.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-migration.h"
#include "trace.h"
#define CHUNK_SIZE (1 << 10)
@@ -104,7 +106,8 @@
typedef struct SaveBitmapState {
/* Written during setup phase. */
BlockDriverState *bs;
- const char *node_name;
+ char *node_alias;
+ char *bitmap_alias;
BdrvDirtyBitmap *bitmap;
uint64_t total_sectors;
uint64_t sectors_per_chunk;
@@ -138,8 +141,9 @@ typedef struct LoadBitmapState {
/* State of the dirty bitmap migration (DBM) during load process */
typedef struct DBMLoadState {
uint32_t flags;
- char node_name[256];
- char bitmap_name[256];
+ char node_alias[256];
+ char bitmap_alias[256];
+ char bitmap_name[BDRV_BITMAP_MAX_NAME_SIZE + 1];
BlockDriverState *bs;
BdrvDirtyBitmap *bitmap;
@@ -165,6 +169,188 @@ typedef struct DBMState {
static DBMState dbm_state;
+/* For hash tables that map node/bitmap names to aliases */
+typedef struct AliasMapInnerNode {
+ char *string;
+ GHashTable *subtree;
+} AliasMapInnerNode;
+
+static void free_alias_map_inner_node(void *amin_ptr)
+{
+ AliasMapInnerNode *amin = amin_ptr;
+
+ g_free(amin->string);
+ g_hash_table_unref(amin->subtree);
+ g_free(amin);
+}
+
+/**
+ * Construct an alias map based on the given QMP structure.
+ *
+ * (Note that we cannot store such maps in the MigrationParameters
+ * object, because that struct is defined by the QAPI schema, which
+ * makes it basically impossible to have dicts with arbitrary keys.
+ * Therefore, we instead have to construct these maps when migration
+ * starts.)
+ *
+ * @bbm is the block_bitmap_mapping from the migration parameters.
+ *
+ * If @name_to_alias is true, the returned hash table will map node
+ * and bitmap names to their respective aliases (for outgoing
+ * migration).
+ *
+ * If @name_to_alias is false, the returned hash table will map node
+ * and bitmap aliases to their respective names (for incoming
+ * migration).
+ *
+ * The hash table maps node names/aliases to AliasMapInnerNode
+ * objects, whose .string is the respective node alias/name, and whose
+ * .subtree table maps bitmap names/aliases to the respective bitmap
+ * alias/name.
+ */
+static GHashTable *construct_alias_map(const BitmapMigrationNodeAliasList *bbm,
+ bool name_to_alias,
+ Error **errp)
+{
+ GHashTable *alias_map;
+ size_t max_node_name_len = sizeof_field(BlockDriverState, node_name) - 1;
+
+ alias_map = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, free_alias_map_inner_node);
+
+ for (; bbm; bbm = bbm->next) {
+ const BitmapMigrationNodeAlias *bmna = bbm->value;
+ const BitmapMigrationBitmapAliasList *bmbal;
+ AliasMapInnerNode *amin;
+ GHashTable *bitmaps_map;
+ const char *node_map_from, *node_map_to;
+
+ if (!id_wellformed(bmna->alias)) {
+ error_setg(errp, "The node alias '%s' is not well-formed",
+ bmna->alias);
+ goto fail;
+ }
+
+ if (strlen(bmna->alias) > UINT8_MAX) {
+ error_setg(errp, "The node alias '%s' is longer than %u bytes",
+ bmna->alias, UINT8_MAX);
+ goto fail;
+ }
+
+ if (strlen(bmna->node_name) > max_node_name_len) {
+ error_setg(errp, "The node name '%s' is longer than %zu bytes",
+ bmna->node_name, max_node_name_len);
+ goto fail;
+ }
+
+ if (name_to_alias) {
+ if (g_hash_table_contains(alias_map, bmna->node_name)) {
+ error_setg(errp, "The node name '%s' is mapped twice",
+ bmna->node_name);
+ goto fail;
+ }
+
+ node_map_from = bmna->node_name;
+ node_map_to = bmna->alias;
+ } else {
+ if (g_hash_table_contains(alias_map, bmna->alias)) {
+ error_setg(errp, "The node alias '%s' is used twice",
+ bmna->alias);
+ goto fail;
+ }
+
+ node_map_from = bmna->alias;
+ node_map_to = bmna->node_name;
+ }
+
+ bitmaps_map = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, g_free);
+
+ amin = g_new(AliasMapInnerNode, 1);
+ *amin = (AliasMapInnerNode){
+ .string = g_strdup(node_map_to),
+ .subtree = bitmaps_map,
+ };
+
+ g_hash_table_insert(alias_map, g_strdup(node_map_from), amin);
+
+ for (bmbal = bmna->bitmaps; bmbal; bmbal = bmbal->next) {
+ const BitmapMigrationBitmapAlias *bmba = bmbal->value;
+ const char *bmap_map_from, *bmap_map_to;
+
+ if (strlen(bmba->alias) > UINT8_MAX) {
+ error_setg(errp,
+ "The bitmap alias '%s' is longer than %u bytes",
+ bmba->alias, UINT8_MAX);
+ goto fail;
+ }
+
+ if (strlen(bmba->name) > BDRV_BITMAP_MAX_NAME_SIZE) {
+ error_setg(errp, "The bitmap name '%s' is longer than %d bytes",
+ bmba->name, BDRV_BITMAP_MAX_NAME_SIZE);
+ goto fail;
+ }
+
+ if (name_to_alias) {
+ bmap_map_from = bmba->name;
+ bmap_map_to = bmba->alias;
+
+ if (g_hash_table_contains(bitmaps_map, bmba->name)) {
+ error_setg(errp, "The bitmap '%s'/'%s' is mapped twice",
+ bmna->node_name, bmba->name);
+ goto fail;
+ }
+ } else {
+ bmap_map_from = bmba->alias;
+ bmap_map_to = bmba->name;
+
+ if (g_hash_table_contains(bitmaps_map, bmba->alias)) {
+ error_setg(errp, "The bitmap alias '%s'/'%s' is used twice",
+ bmna->alias, bmba->alias);
+ goto fail;
+ }
+ }
+
+ g_hash_table_insert(bitmaps_map,
+ g_strdup(bmap_map_from), g_strdup(bmap_map_to));
+ }
+ }
+
+ return alias_map;
+
+fail:
+ g_hash_table_destroy(alias_map);
+ return NULL;
+}
+
+/**
+ * Run construct_alias_map() in both directions to check whether @bbm
+ * is valid.
+ * (This function is to be used by migration/migration.c to validate
+ * the user-specified block-bitmap-mapping migration parameter.)
+ *
+ * Returns true if and only if the mapping is valid.
+ */
+bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm,
+ Error **errp)
+{
+ GHashTable *alias_map;
+
+ alias_map = construct_alias_map(bbm, true, errp);
+ if (!alias_map) {
+ return false;
+ }
+ g_hash_table_destroy(alias_map);
+
+ alias_map = construct_alias_map(bbm, false, errp);
+ if (!alias_map) {
+ return false;
+ }
+ g_hash_table_destroy(alias_map);
+
+ return true;
+}
+
static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
{
uint8_t flags = qemu_get_byte(f);
@@ -207,11 +393,11 @@ static void send_bitmap_header(QEMUFile *f, DBMSaveState *s,
qemu_put_bitmap_flags(f, flags);
if (flags & DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME) {
- qemu_put_counted_string(f, dbms->node_name);
+ qemu_put_counted_string(f, dbms->node_alias);
}
if (flags & DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME) {
- qemu_put_counted_string(f, bdrv_dirty_bitmap_name(bitmap));
+ qemu_put_counted_string(f, dbms->bitmap_alias);
}
}
@@ -282,18 +468,25 @@ static void dirty_bitmap_do_save_cleanup(DBMSaveState *s)
QSIMPLEQ_REMOVE_HEAD(&s->dbms_list, entry);
bdrv_dirty_bitmap_set_busy(dbms->bitmap, false);
bdrv_unref(dbms->bs);
+ g_free(dbms->node_alias);
+ g_free(dbms->bitmap_alias);
g_free(dbms);
}
}
/* Called with iothread lock taken. */
static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs,
- const char *bs_name)
+ const char *bs_name, GHashTable *alias_map)
{
BdrvDirtyBitmap *bitmap;
SaveBitmapState *dbms;
+ GHashTable *bitmap_aliases;
+ const char *node_alias, *bitmap_name, *bitmap_alias;
Error *local_err = NULL;
+ /* When an alias map is given, @bs_name must be @bs's node name */
+ assert(!alias_map || !strcmp(bs_name, bdrv_get_node_name(bs)));
+
FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
if (bdrv_dirty_bitmap_name(bitmap)) {
break;
@@ -303,21 +496,39 @@ static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs,
return 0;
}
+ bitmap_name = bdrv_dirty_bitmap_name(bitmap);
+
if (!bs_name || strcmp(bs_name, "") == 0) {
error_report("Bitmap '%s' in unnamed node can't be migrated",
- bdrv_dirty_bitmap_name(bitmap));
+ bitmap_name);
return -1;
}
- if (bs_name[0] == '#') {
+ if (alias_map) {
+ const AliasMapInnerNode *amin = g_hash_table_lookup(alias_map, bs_name);
+
+ if (!amin) {
+ /* Skip bitmaps on nodes with no alias */
+ return 0;
+ }
+
+ node_alias = amin->string;
+ bitmap_aliases = amin->subtree;
+ } else {
+ node_alias = bs_name;
+ bitmap_aliases = NULL;
+ }
+
+ if (node_alias[0] == '#') {
error_report("Bitmap '%s' in a node with auto-generated "
"name '%s' can't be migrated",
- bdrv_dirty_bitmap_name(bitmap), bs_name);
+ bitmap_name, node_alias);
return -1;
}
FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
- if (!bdrv_dirty_bitmap_name(bitmap)) {
+ bitmap_name = bdrv_dirty_bitmap_name(bitmap);
+ if (!bitmap_name) {
continue;
}
@@ -326,12 +537,29 @@ static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs,
return -1;
}
+ if (bitmap_aliases) {
+ bitmap_alias = g_hash_table_lookup(bitmap_aliases, bitmap_name);
+ if (!bitmap_alias) {
+ /* Skip bitmaps with no alias */
+ continue;
+ }
+ } else {
+ if (strlen(bitmap_name) > UINT8_MAX) {
+ error_report("Cannot migrate bitmap '%s' on node '%s': "
+ "Name is longer than %u bytes",
+ bitmap_name, bs_name, UINT8_MAX);
+ return -1;
+ }
+ bitmap_alias = bitmap_name;
+ }
+
bdrv_ref(bs);
bdrv_dirty_bitmap_set_busy(bitmap, true);
dbms = g_new0(SaveBitmapState, 1);
dbms->bs = bs;
- dbms->node_name = bs_name;
+ dbms->node_alias = g_strdup(node_alias);
+ dbms->bitmap_alias = g_strdup(bitmap_alias);
dbms->bitmap = bitmap;
dbms->total_sectors = bdrv_nb_sectors(bs);
dbms->sectors_per_chunk = CHUNK_SIZE * 8 *
@@ -356,43 +584,52 @@ static int init_dirty_bitmap_migration(DBMSaveState *s)
SaveBitmapState *dbms;
GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
BlockBackend *blk;
+ const MigrationParameters *mig_params = &migrate_get_current()->parameters;
+ GHashTable *alias_map = NULL;
+
+ if (mig_params->has_block_bitmap_mapping) {
+ alias_map = construct_alias_map(mig_params->block_bitmap_mapping, true,
+ &error_abort);
+ }
s->bulk_completed = false;
s->prev_bs = NULL;
s->prev_bitmap = NULL;
s->no_bitmaps = false;
- /*
- * Use blockdevice name for direct (or filtered) children of named block
- * backends.
- */
- for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
- const char *name = blk_name(blk);
-
- if (!name || strcmp(name, "") == 0) {
- continue;
- }
+ if (!alias_map) {
+ /*
+ * Use blockdevice name for direct (or filtered) children of named block
+ * backends.
+ */
+ for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
+ const char *name = blk_name(blk);
- bs = blk_bs(blk);
+ if (!name || strcmp(name, "") == 0) {
+ continue;
+ }
- /* Skip filters without bitmaps */
- while (bs && bs->drv && bs->drv->is_filter &&
- !bdrv_has_named_bitmaps(bs))
- {
- if (bs->backing) {
- bs = bs->backing->bs;
- } else if (bs->file) {
- bs = bs->file->bs;
- } else {
- bs = NULL;
+ bs = blk_bs(blk);
+
+ /* Skip filters without bitmaps */
+ while (bs && bs->drv && bs->drv->is_filter &&
+ !bdrv_has_named_bitmaps(bs))
+ {
+ if (bs->backing) {
+ bs = bs->backing->bs;
+ } else if (bs->file) {
+ bs = bs->file->bs;
+ } else {
+ bs = NULL;
+ }
}
- }
- if (bs && bs->drv && !bs->drv->is_filter) {
- if (add_bitmaps_to_list(s, bs, name)) {
- goto fail;
+ if (bs && bs->drv && !bs->drv->is_filter) {
+ if (add_bitmaps_to_list(s, bs, name, NULL)) {
+ goto fail;
+ }
+ g_hash_table_add(handled_by_blk, bs);
}
- g_hash_table_add(handled_by_blk, bs);
}
}
@@ -401,7 +638,7 @@ static int init_dirty_bitmap_migration(DBMSaveState *s)
continue;
}
- if (add_bitmaps_to_list(s, bs, bdrv_get_node_name(bs))) {
+ if (add_bitmaps_to_list(s, bs, bdrv_get_node_name(bs), alias_map)) {
goto fail;
}
}
@@ -416,11 +653,17 @@ static int init_dirty_bitmap_migration(DBMSaveState *s)
}
g_hash_table_destroy(handled_by_blk);
+ if (alias_map) {
+ g_hash_table_destroy(alias_map);
+ }
return 0;
fail:
g_hash_table_destroy(handled_by_blk);
+ if (alias_map) {
+ g_hash_table_destroy(alias_map);
+ }
dirty_bitmap_do_save_cleanup(s);
return -1;
@@ -770,8 +1013,10 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
return 0;
}
-static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
+static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s,
+ GHashTable *alias_map)
{
+ GHashTable *bitmap_alias_map = NULL;
Error *local_err = NULL;
bool nothing;
s->flags = qemu_get_bitmap_flags(f);
@@ -780,28 +1025,75 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
nothing = s->flags == (s->flags & DIRTY_BITMAP_MIG_FLAG_EOS);
if (s->flags & DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME) {
- if (!qemu_get_counted_string(f, s->node_name)) {
- error_report("Unable to read node name string");
+ if (!qemu_get_counted_string(f, s->node_alias)) {
+ error_report("Unable to read node alias string");
return -EINVAL;
}
+
if (!s->cancelled) {
- s->bs = bdrv_lookup_bs(s->node_name, s->node_name, &local_err);
+ if (alias_map) {
+ const AliasMapInnerNode *amin;
+
+ amin = g_hash_table_lookup(alias_map, s->node_alias);
+ if (!amin) {
+ error_setg(&local_err, "Error: Unknown node alias '%s'",
+ s->node_alias);
+ s->bs = NULL;
+ } else {
+ bitmap_alias_map = amin->subtree;
+ s->bs = bdrv_lookup_bs(NULL, amin->string, &local_err);
+ }
+ } else {
+ s->bs = bdrv_lookup_bs(s->node_alias, s->node_alias,
+ &local_err);
+ }
if (!s->bs) {
error_report_err(local_err);
cancel_incoming_locked(s);
}
}
- } else if (!s->bs && !nothing && !s->cancelled) {
+ } else if (s->bs) {
+ if (alias_map) {
+ const AliasMapInnerNode *amin;
+
+ /* Must be present in the map, or s->bs would not be set */
+ amin = g_hash_table_lookup(alias_map, s->node_alias);
+ assert(amin != NULL);
+
+ bitmap_alias_map = amin->subtree;
+ }
+ } else if (!nothing && !s->cancelled) {
error_report("Error: block device name is not set");
cancel_incoming_locked(s);
}
+ assert(nothing || s->cancelled || !!alias_map == !!bitmap_alias_map);
+
if (s->flags & DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME) {
- if (!qemu_get_counted_string(f, s->bitmap_name)) {
- error_report("Unable to read bitmap name string");
+ const char *bitmap_name;
+
+ if (!qemu_get_counted_string(f, s->bitmap_alias)) {
+ error_report("Unable to read bitmap alias string");
return -EINVAL;
}
+
+ if (!s->cancelled) {
+ if (bitmap_alias_map) {
+ bitmap_name = g_hash_table_lookup(bitmap_alias_map,
+ s->bitmap_alias);
+ if (!bitmap_name) {
+ error_report("Error: Unknown bitmap alias '%s' on node "
+ "'%s' (alias '%s')", s->bitmap_alias,
+ s->bs->node_name, s->node_alias);
+ cancel_incoming_locked(s);
+ }
+ } else {
+ bitmap_name = s->bitmap_alias;
+ }
+ }
+
if (!s->cancelled) {
+ g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name));
s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
/*
@@ -811,7 +1103,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) {
error_report("Error: unknown dirty bitmap "
"'%s' for block device '%s'",
- s->bitmap_name, s->node_name);
+ s->bitmap_name, s->bs->node_name);
cancel_incoming_locked(s);
}
}
@@ -835,6 +1127,8 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
*/
static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
{
+ GHashTable *alias_map = NULL;
+ const MigrationParameters *mig_params = &migrate_get_current()->parameters;
DBMLoadState *s = &((DBMState *)opaque)->load;
int ret = 0;
@@ -846,13 +1140,18 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
return -EINVAL;
}
+ if (mig_params->has_block_bitmap_mapping) {
+ alias_map = construct_alias_map(mig_params->block_bitmap_mapping,
+ false, &error_abort);
+ }
+
do {
QEMU_LOCK_GUARD(&s->lock);
- ret = dirty_bitmap_load_header(f, s);
+ ret = dirty_bitmap_load_header(f, s, alias_map);
if (ret < 0) {
cancel_incoming_locked(s);
- return ret;
+ goto fail;
}
if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) {
@@ -869,12 +1168,17 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
if (ret) {
cancel_incoming_locked(s);
- return ret;
+ goto fail;
}
} while (!(s->flags & DIRTY_BITMAP_MIG_FLAG_EOS));
trace_dirty_bitmap_load_success();
- return 0;
+ ret = 0;
+fail:
+ if (alias_map) {
+ g_hash_table_destroy(alias_map);
+ }
+ return ret;
}
static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
diff --git a/migration/migration.c b/migration/migration.c
index bf684185b7..7a89ce39a7 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -36,6 +36,7 @@
#include "block/block.h"
#include "qapi/error.h"
#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-migration.h"
#include "qapi/qapi-visit-sockets.h"
#include "qapi/qapi-commands-migration.h"
#include "qapi/qapi-events-migration.h"
@@ -845,6 +846,13 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
params->has_announce_step = true;
params->announce_step = s->parameters.announce_step;
+ if (s->parameters.has_block_bitmap_mapping) {
+ params->has_block_bitmap_mapping = true;
+ params->block_bitmap_mapping =
+ QAPI_CLONE(BitmapMigrationNodeAliasList,
+ s->parameters.block_bitmap_mapping);
+ }
+
return params;
}
@@ -1310,6 +1318,13 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
"is invalid, it must be in the range of 1 to 10000 ms");
return false;
}
+
+ if (params->has_block_bitmap_mapping &&
+ !check_dirty_bitmap_mig_alias_map(params->block_bitmap_mapping, errp)) {
+ error_prepend(errp, "Invalid mapping given for block-bitmap-mapping: ");
+ return false;
+ }
+
return true;
}
@@ -1404,6 +1419,11 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
if (params->has_announce_step) {
dest->announce_step = params->announce_step;
}
+
+ if (params->has_block_bitmap_mapping) {
+ dest->has_block_bitmap_mapping = true;
+ dest->block_bitmap_mapping = params->block_bitmap_mapping;
+ }
}
static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
@@ -1516,6 +1536,16 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
if (params->has_announce_step) {
s->parameters.announce_step = params->announce_step;
}
+
+ if (params->has_block_bitmap_mapping) {
+ qapi_free_BitmapMigrationNodeAliasList(
+ s->parameters.block_bitmap_mapping);
+
+ s->parameters.has_block_bitmap_mapping = true;
+ s->parameters.block_bitmap_mapping =
+ QAPI_CLONE(BitmapMigrationNodeAliasList,
+ params->block_bitmap_mapping);
+ }
}
void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
diff --git a/migration/migration.h b/migration/migration.h
index 721e272713..4be42e8c11 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -337,6 +337,9 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
void dirty_bitmap_mig_before_vm_start(void);
void dirty_bitmap_mig_cancel_outgoing(void);
void dirty_bitmap_mig_cancel_incoming(void);
+bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm,
+ Error **errp);
+
void migrate_add_address(SocketAddress *address);
int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index ae4b6a4246..7711726fd2 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -469,6 +469,32 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "%s: '%s'\n",
MigrationParameter_str(MIGRATION_PARAMETER_TLS_AUTHZ),
params->tls_authz);
+
+ if (params->has_block_bitmap_mapping) {
+ const BitmapMigrationNodeAliasList *bmnal;
+
+ monitor_printf(mon, "%s:\n",
+ MigrationParameter_str(
+ MIGRATION_PARAMETER_BLOCK_BITMAP_MAPPING));
+
+ for (bmnal = params->block_bitmap_mapping;
+ bmnal;
+ bmnal = bmnal->next)
+ {
+ const BitmapMigrationNodeAlias *bmna = bmnal->value;
+ const BitmapMigrationBitmapAliasList *bmbal;
+
+ monitor_printf(mon, " '%s' -> '%s'\n",
+ bmna->node_name, bmna->alias);
+
+ for (bmbal = bmna->bitmaps; bmbal; bmbal = bmbal->next) {
+ const BitmapMigrationBitmapAlias *bmba = bmbal->value;
+
+ monitor_printf(mon, " '%s' -> '%s'\n",
+ bmba->name, bmba->alias);
+ }
+ }
+ }
}
qapi_free_MigrationParameters(params);
@@ -1384,6 +1410,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
p->has_announce_step = true;
visit_type_size(v, param, &p->announce_step, &err);
break;
+ case MIGRATION_PARAMETER_BLOCK_BITMAP_MAPPING:
+ error_setg(&err, "The block-bitmap-mapping parameter can only be set "
+ "through QMP");
+ break;
default:
assert(0);
}
diff --git a/qapi/migration.json b/qapi/migration.json
index ea53b23dca..5f6b06172c 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -508,6 +508,44 @@
'data': [ 'none', 'zlib',
{ 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
+##
+# @BitmapMigrationBitmapAlias:
+#
+# @name: The name of the bitmap.
+#
+# @alias: An alias name for migration (for example the bitmap name on
+# the opposite site).
+#
+# Since: 5.2
+##
+{ 'struct': 'BitmapMigrationBitmapAlias',
+ 'data': {
+ 'name': 'str',
+ 'alias': 'str'
+ } }
+
+##
+# @BitmapMigrationNodeAlias:
+#
+# Maps a block node name and the bitmaps it has to aliases for dirty
+# bitmap migration.
+#
+# @node-name: A block node name.
+#
+# @alias: An alias block node name for migration (for example the
+# node name on the opposite site).
+#
+# @bitmaps: Mappings for the bitmaps on this node.
+#
+# Since: 5.2
+##
+{ 'struct': 'BitmapMigrationNodeAlias',
+ 'data': {
+ 'node-name': 'str',
+ 'alias': 'str',
+ 'bitmaps': [ 'BitmapMigrationBitmapAlias' ]
+ } }
+
##
# @MigrationParameter:
#
@@ -642,6 +680,25 @@
# will consume more CPU.
# Defaults to 1. (Since 5.0)
#
+# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
+# aliases for the purpose of dirty bitmap migration. Such
+# aliases may for example be the corresponding names on the
+# opposite site.
+# The mapping must be one-to-one, but not necessarily
+# complete: On the source, unmapped bitmaps and all bitmaps
+# on unmapped nodes will be ignored. On the destination,
+# encountering an unmapped alias in the incoming migration
+# stream will result in a report, and all further bitmap
+# migration data will then be discarded.
+# Note that the destination does not know about bitmaps it
+# does not receive, so there is no limitation or requirement
+# regarding the number of bitmaps received, or how they are
+# named, or on which nodes they are placed.
+# By default (when this parameter has never been set), bitmap
+# names are mapped to themselves. Nodes are mapped to their
+# block device name if there is one, and to their node name
+# otherwise. (Since 5.2)
+#
# Since: 2.4
##
{ 'enum': 'MigrationParameter',
@@ -656,7 +713,8 @@
'multifd-channels',
'xbzrle-cache-size', 'max-postcopy-bandwidth',
'max-cpu-throttle', 'multifd-compression',
- 'multifd-zlib-level' ,'multifd-zstd-level' ] }
+ 'multifd-zlib-level' ,'multifd-zstd-level',
+ 'block-bitmap-mapping' ] }
##
# @MigrateSetParameters:
@@ -782,6 +840,25 @@
# will consume more CPU.
# Defaults to 1. (Since 5.0)
#
+# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
+# aliases for the purpose of dirty bitmap migration. Such
+# aliases may for example be the corresponding names on the
+# opposite site.
+# The mapping must be one-to-one, but not necessarily
+# complete: On the source, unmapped bitmaps and all bitmaps
+# on unmapped nodes will be ignored. On the destination,
+# encountering an unmapped alias in the incoming migration
+# stream will result in a report, and all further bitmap
+# migration data will then be discarded.
+# Note that the destination does not know about bitmaps it
+# does not receive, so there is no limitation or requirement
+# regarding the number of bitmaps received, or how they are
+# named, or on which nodes they are placed.
+# By default (when this parameter has never been set), bitmap
+# names are mapped to themselves. Nodes are mapped to their
+# block device name if there is one, and to their node name
+# otherwise. (Since 5.2)
+#
# Since: 2.4
##
# TODO either fuse back into MigrationParameters, or make
@@ -812,7 +889,8 @@
'*max-cpu-throttle': 'int',
'*multifd-compression': 'MultiFDCompression',
'*multifd-zlib-level': 'int',
- '*multifd-zstd-level': 'int' } }
+ '*multifd-zstd-level': 'int',
+ '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
##
# @migrate-set-parameters:
@@ -958,6 +1036,25 @@
# will consume more CPU.
# Defaults to 1. (Since 5.0)
#
+# @block-bitmap-mapping: Maps block nodes and bitmaps on them to
+# aliases for the purpose of dirty bitmap migration. Such
+# aliases may for example be the corresponding names on the
+# opposite site.
+# The mapping must be one-to-one, but not necessarily
+# complete: On the source, unmapped bitmaps and all bitmaps
+# on unmapped nodes will be ignored. On the destination,
+# encountering an unmapped alias in the incoming migration
+# stream will result in a report, and all further bitmap
+# migration data will then be discarded.
+# Note that the destination does not know about bitmaps it
+# does not receive, so there is no limitation or requirement
+# regarding the number of bitmaps received, or how they are
+# named, or on which nodes they are placed.
+# By default (when this parameter has never been set), bitmap
+# names are mapped to themselves. Nodes are mapped to their
+# block device name if there is one, and to their node name
+# otherwise. (Since 5.2)
+#
# Since: 2.4
##
{ 'struct': 'MigrationParameters',
@@ -986,7 +1083,8 @@
'*max-cpu-throttle': 'uint8',
'*multifd-compression': 'MultiFDCompression',
'*multifd-zlib-level': 'uint8',
- '*multifd-zstd-level': 'uint8' } }
+ '*multifd-zstd-level': 'uint8',
+ '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
##
# @query-migrate-parameters:
--
2.27.0

View File

@ -1,56 +0,0 @@
From 60e1b84487fead757b5feaf0e55448338f2b2671 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Mon, 28 Sep 2020 11:06:48 -0400
Subject: [PATCH 1/2] migration: increase max-bandwidth to 128 MiB/s (1 Gib/s)
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200928110648.342290-1-lvivier@redhat.com>
Patchwork-id: 98494
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH] migration: increase max-bandwidth to 128 MiB/s (1 Gib/s)
Bugzilla: 1874004
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
max-bandwidth is set by default to 32 MiB/s (256 Mib/s)
since 2008 (5bb7910af031c).
Most of the CPUs can dirty memory faster than that now,
and this is clearly a problem with POWER where the page
size is 64 kiB and not 4 KiB.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20200921144957.979989-1-lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
(cherry picked from commit 7590a2ae091fde8bb72d5df93977ab9707e23242)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=31576368
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1874004
Upstream: Merged
Tested: checked a migration while an installation is running can end
before the end of installation
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
migration/migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index 7a89ce39a76..8193f33f768 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -57,7 +57,7 @@
#include "qemu/queue.h"
#include "multifd.h"
-#define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttling */
+#define MAX_THROTTLE (128 << 20) /* Migration transfer speed throttling */
/* Amount of time to allocate to each "chunk" of bandwidth-throttled
* data. */
--
2.27.0

View File

@ -1,254 +0,0 @@
From 74ce16018bcb202ab81f3aa7b5a33279dd4800da Mon Sep 17 00:00:00 2001
From: Greg Kurz <gkurz@redhat.com>
Date: Tue, 1 Sep 2020 19:07:04 -0400
Subject: [PATCH 08/11] nvram: Exit QEMU if NVRAM cannot contain all -prom-env
data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Greg Kurz <gkurz@redhat.com>
Message-id: <20200901190704.474799-2-gkurz@redhat.com>
Patchwork-id: 98256
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/1] nvram: Exit QEMU if NVRAM cannot contain all -prom-env data
Bugzilla: 1867739
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Greg Kurz <groug@kaod.org>
Since commit 61f20b9dc5b7 ("spapr_nvram: Pre-initialize the NVRAM to
support the -prom-env parameter"), pseries machines can pre-initialize
the "system" partition in the NVRAM with the data passed to all -prom-env
parameters on the QEMU command line.
In this case it is assumed that all the data fits in 64 KiB, but the user
can easily pass more and crash QEMU:
$ qemu-system-ppc64 -M pseries $(for ((x=0;x<128;x++)); do \
echo -n " -prom-env " ; printf "%0.sx" {1..1024}; \
done) # this requires ~128 Kib
malloc(): corrupted top size
Aborted (core dumped)
This happens because we don't check if all the prom-env data fits in
the NVRAM and chrp_nvram_set_var() happily memcpy() it passed the
buffer.
This crash affects basically all ppc/ppc64 machine types that use -prom-env:
- pseries (all versions)
- g3beige
- mac99
and also sparc/sparc64 machine types:
- LX
- SPARCClassic
- SPARCbook
- SS-10
- SS-20
- SS-4
- SS-5
- SS-600MP
- Voyager
- sun4u
- sun4v
Add a max_len argument to chrp_nvram_create_system_partition() so that
it can check the available size before writing to memory.
Since NVRAM is populated at machine init, it seems reasonable to consider
this error as fatal. So, instead of reporting an error when we detect that
the NVRAM is too small and adapt all machine types to handle it, we simply
exit QEMU in all cases. This is still better than crashing. If someone
wants another behavior, I guess this can be reworked later.
Tested with:
$ yes q | \
(for arch in ppc ppc64 sparc sparc64; do \
echo == $arch ==; \
qemu=${arch}-softmmu/qemu-system-$arch; \
for mach in $($qemu -M help | awk '! /^Supported/ { print $1 }'); do \
echo $mach; \
$qemu -M $mach -monitor stdio -nodefaults -nographic \
$(for ((x=0;x<128;x++)); do \
echo -n " -prom-env " ; printf "%0.sx" {1..1024}; \
done) >/dev/null; \
done; echo; \
done)
Without the patch, affected machine types cause QEMU to report some
memory corruption and crash:
malloc(): corrupted top size
free(): invalid size
*** stack smashing detected ***: terminated
With the patch, QEMU prints the following message and exits:
NVRAM is too small. Try to pass less data to -prom-env
It seems that the conditions for the crash have always existed, but it
affects pseries, the machine type I care for, since commit 61f20b9dc5b7
only.
Fixes: 61f20b9dc5b7 ("spapr_nvram: Pre-initialize the NVRAM to support the -prom-env parameter")
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1867739
Reported-by: John Snow <jsnow@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <159736033937.350502.12402444542194031035.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 37035df51eaabb8d26b71da75b88a1c6727de8fa)
Signed-off-by: Greg Kurz <gkurz@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/nvram/chrp_nvram.c | 24 +++++++++++++++++++++---
hw/nvram/mac_nvram.c | 2 +-
hw/nvram/spapr_nvram.c | 3 ++-
hw/sparc/sun4m.c | 2 +-
hw/sparc64/sun4u.c | 2 +-
include/hw/nvram/chrp_nvram.h | 3 ++-
6 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/hw/nvram/chrp_nvram.c b/hw/nvram/chrp_nvram.c
index d969f26704..d4d10a7c03 100644
--- a/hw/nvram/chrp_nvram.c
+++ b/hw/nvram/chrp_nvram.c
@@ -21,14 +21,21 @@
#include "qemu/osdep.h"
#include "qemu/cutils.h"
+#include "qemu/error-report.h"
#include "hw/nvram/chrp_nvram.h"
#include "sysemu/sysemu.h"
-static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str)
+static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str,
+ int max_len)
{
int len;
len = strlen(str) + 1;
+
+ if (max_len < len) {
+ return -1;
+ }
+
memcpy(&nvram[addr], str, len);
return addr + len;
@@ -38,19 +45,26 @@ static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str)
* Create a "system partition", used for the Open Firmware
* environment variables.
*/
-int chrp_nvram_create_system_partition(uint8_t *data, int min_len)
+int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len)
{
ChrpNvramPartHdr *part_header;
unsigned int i;
int end;
+ if (max_len < sizeof(*part_header)) {
+ goto fail;
+ }
+
part_header = (ChrpNvramPartHdr *)data;
part_header->signature = CHRP_NVPART_SYSTEM;
pstrcpy(part_header->name, sizeof(part_header->name), "system");
end = sizeof(ChrpNvramPartHdr);
for (i = 0; i < nb_prom_envs; i++) {
- end = chrp_nvram_set_var(data, end, prom_envs[i]);
+ end = chrp_nvram_set_var(data, end, prom_envs[i], max_len - end);
+ if (end == -1) {
+ goto fail;
+ }
}
/* End marker */
@@ -65,6 +79,10 @@ int chrp_nvram_create_system_partition(uint8_t *data, int min_len)
chrp_nvram_finish_partition(part_header, end);
return end;
+
+fail:
+ error_report("NVRAM is too small. Try to pass less data to -prom-env");
+ exit(EXIT_FAILURE);
}
/**
diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c
index beec1c4e4d..11f2d31cdb 100644
--- a/hw/nvram/mac_nvram.c
+++ b/hw/nvram/mac_nvram.c
@@ -141,7 +141,7 @@ static void pmac_format_nvram_partition_of(MacIONVRAMState *nvr, int off,
/* OpenBIOS nvram variables partition */
sysp_end = chrp_nvram_create_system_partition(&nvr->data[off],
- DEF_SYSTEM_SIZE) + off;
+ DEF_SYSTEM_SIZE, len) + off;
/* Free space partition */
chrp_nvram_create_free_partition(&nvr->data[sysp_end], len - sysp_end);
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c
index 15d08281d4..386513499f 100644
--- a/hw/nvram/spapr_nvram.c
+++ b/hw/nvram/spapr_nvram.c
@@ -188,7 +188,8 @@ static void spapr_nvram_realize(SpaprVioDevice *dev, Error **errp)
}
} else if (nb_prom_envs > 0) {
/* Create a system partition to pass the -prom-env variables */
- chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4);
+ chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4,
+ nvram->size);
chrp_nvram_create_free_partition(&nvram->buf[MIN_NVRAM_SIZE / 4],
nvram->size - MIN_NVRAM_SIZE / 4);
}
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 9be930415f..cf7dfa4af5 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -143,7 +143,7 @@ static void nvram_init(Nvram *nvram, uint8_t *macaddr,
memset(image, '\0', sizeof(image));
/* OpenBIOS nvram variables partition */
- sysp_end = chrp_nvram_create_system_partition(image, 0);
+ sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0);
/* Free space partition */
chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end);
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 9e30203dcc..37310b73e6 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -136,7 +136,7 @@ static int sun4u_NVRAM_set_params(Nvram *nvram, uint16_t NVRAM_size,
memset(image, '\0', sizeof(image));
/* OpenBIOS nvram variables partition */
- sysp_end = chrp_nvram_create_system_partition(image, 0);
+ sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0);
/* Free space partition */
chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end);
diff --git a/include/hw/nvram/chrp_nvram.h b/include/hw/nvram/chrp_nvram.h
index 09941a9be4..4a0f5c21b8 100644
--- a/include/hw/nvram/chrp_nvram.h
+++ b/include/hw/nvram/chrp_nvram.h
@@ -50,7 +50,8 @@ chrp_nvram_finish_partition(ChrpNvramPartHdr *header, uint32_t size)
header->checksum = sum & 0xff;
}
-int chrp_nvram_create_system_partition(uint8_t *data, int min_len);
+/* chrp_nvram_create_system_partition() failure is fatal */
+int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len);
int chrp_nvram_create_free_partition(uint8_t *data, int len);
#endif
--
2.27.0

View File

@ -1,82 +0,0 @@
From 5dd7cdf3739c73d910d5df6443b39e9b0b79f3fd Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Tue, 8 Sep 2020 18:47:16 -0400
Subject: [PATCH 4/4] ppc/spapr: Use start-powered-off CPUState property
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200908184716.1125192-4-lvivier@redhat.com>
Patchwork-id: 98302
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 3/3] ppc/spapr: Use start-powered-off CPUState property
Bugzilla: 1849483
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
PowerPC sPAPR CPUs start in the halted state, and spapr_reset_vcpu()
attempts to implement this by setting CPUState::halted to 1. But that's too
late for the case of hotplugged CPUs in a machine configure with 2 or more
threads per core.
By then, other parts of QEMU have already caused the vCPU to run in an
unitialized state a couple of times. For example, ppc_cpu_reset() calls
ppc_tlb_invalidate_all(), which ends up calling async_run_on_cpu(). This
kicks the new vCPU while it has CPUState::halted = 0, causing QEMU to issue
a KVM_RUN ioctl on the new vCPU before the guest is able to make the
start-cpu RTAS call to initialize its register state.
This problem doesn't seem to cause visible issues for regular guests, but
on a secure guest running under the Ultravisor it does. The Ultravisor
relies on being able to snoop on the start-cpu RTAS call to map vCPUs to
guests, and this issue causes it to see a stray vCPU that doesn't belong to
any guest.
Fix by setting the start-powered-off CPUState property in
spapr_create_vcpu(), which makes cpu_common_reset() initialize
CPUState::halted to 1 at an earlier moment.
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-4-bauerman@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 554c2169e9251ca2829ab968bd9ba5641a5abe1d)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr_cpu_core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index f228f8bb75..86fed5c528 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -37,11 +37,6 @@ static void spapr_reset_vcpu(PowerPCCPU *cpu)
cpu_reset(cs);
- /* All CPUs start halted. CPU0 is unhalted from the machine level
- * reset code and the rest are explicitly started up by the guest
- * using an RTAS call */
- cs->halted = 1;
-
env->spr[SPR_HIOR] = 0;
lpcr = env->spr[SPR_LPCR];
@@ -287,6 +282,11 @@ static PowerPCCPU *spapr_create_vcpu(SpaprCpuCore *sc, int i, Error **errp)
cs = CPU(obj);
cpu = POWERPC_CPU(obj);
+ /*
+ * All CPUs start halted. CPU0 is unhalted from the machine level reset code
+ * and the rest are explicitly started up by the guest using an RTAS call.
+ */
+ cs->start_powered_off = true;
cs->cpu_index = cc->core_id + i;
spapr_set_vcpu_id(cpu, cs->cpu_index, &local_err);
if (local_err) {
--
2.27.0

View File

@ -1,203 +0,0 @@
From a768aa960a2e9e3b8dd72dfc7135a7e7d0814d3f Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Wed, 23 Sep 2020 17:49:40 -0400
Subject: [PATCH] qemu-img: Support bitmap --merge into backing image
RH-Author: Eric Blake <eblake@redhat.com>
Message-id: <20200923174940.704681-2-eblake@redhat.com>
Patchwork-id: 98487
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/1] qemu-img: Support bitmap --merge into backing image
Bugzilla: 1877209
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
If you have the chain 'base.qcow2 <- top.qcow2' and want to merge a
bitmap from top into base, qemu-img was failing with:
qemu-img: Could not open 'top.qcow2': Could not open backing file: Failed to get shared "write" lock
Is another process using the image [base.qcow2]?
The easiest fix is to not open the entire backing chain of either
image (source or destination); after all, the point of 'qemu-img
bitmap' is solely to manipulate bitmaps directly within a single qcow2
image, and this is made more precise if we don't pay attention to
other images in the chain that may happen to have a bitmap by the same
name.
However, note that on a case-by-case analysis, there _are_ times where
we treat it as a feature that we can access a bitmap from a backing
layer in association with an overlay BDS. A demonstration of this is
using NBD to expose both an overlay BDS (for constant contents) and a
bitmap (for learning which blocks are interesting) during an
incremental backup:
Base <- Active <- Temporary
\--block job ->/
where Temporary is being fed by a backup 'sync=none' job. When
exposing Temporary over NBD, referring to a bitmap that lives only in
Active is less effort than having to copy a bitmap into Temporary [1].
So the testsuite additions in this patch check both where bitmaps get
allocated (the qemu-img info output), and that qemu-nbd is indeed able
to access a bitmap inherited from the backing chain since it is a
different use case than 'qemu-img bitmap'.
[1] Full disclosure: prior to the recent commit 374eedd1c4 and
friends, we were NOT able to see bitmaps through filters, which meant
that we actually did not have nice clean semantics for uniformly being
able to pick up bitmaps from anywhere in the backing chain (seen as a
change in behavior between qemu 4.1 and 4.2 at commit 00e30f05de, when
block-copy swapped from a one-off to a filter). Which means libvirt
was already coded to copy bitmaps around for the sake of older qemu,
even though modern qemu no longer needs it. Oh well.
Fixes: http://bugzilla.redhat.com/1877209
Reported-by: Eyal Shenitzky <eshenitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200914191009.644842-1-eblake@redhat.com>
[eblake: more commit message tweaks, per Max Reitz review]
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
(cherry picked from commit 14f16bf9474c860ecc127a66a86961942319f7af)
Tweak 291.out since extended L2 is not backported.
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
qemu-img.c | 11 +++++---
tests/qemu-iotests/291 | 12 +++++++++
tests/qemu-iotests/291.out | 54 ++++++++++++++++++++++++++++++++++++++
3 files changed, 74 insertions(+), 3 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 5308773811f..b0ca321a6be 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4747,14 +4747,19 @@ static int img_bitmap(int argc, char **argv)
filename = argv[optind];
bitmap = argv[optind + 1];
- blk = img_open(image_opts, filename, fmt, BDRV_O_RDWR, false, false,
- false);
+ /*
+ * No need to open backing chains; we will be manipulating bitmaps
+ * directly in this image without reference to image contents.
+ */
+ blk = img_open(image_opts, filename, fmt, BDRV_O_RDWR | BDRV_O_NO_BACKING,
+ false, false, false);
if (!blk) {
goto out;
}
bs = blk_bs(blk);
if (src_filename) {
- src = img_open(false, src_filename, src_fmt, 0, false, false, false);
+ src = img_open(false, src_filename, src_fmt, BDRV_O_NO_BACKING,
+ false, false, false);
if (!src) {
goto out;
}
diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/291
index 1e0bb76959b..4f837b20565 100755
--- a/tests/qemu-iotests/291
+++ b/tests/qemu-iotests/291
@@ -91,6 +91,15 @@ $QEMU_IMG bitmap --remove --image-opts \
driver=$IMGFMT,file.driver=file,file.filename="$TEST_IMG" tmp
_img_info --format-specific
+echo
+echo "=== Merge from top layer into backing image ==="
+echo
+
+$QEMU_IMG rebase -u -F qcow2 -b "$TEST_IMG.base" "$TEST_IMG"
+$QEMU_IMG bitmap --add --merge b2 -b "$TEST_IMG" -F $IMGFMT \
+ -f $IMGFMT "$TEST_IMG.base" b3
+_img_info --format-specific --backing-chain
+
echo
echo "=== Check bitmap contents ==="
echo
@@ -107,6 +116,9 @@ $QEMU_IMG map --output=json --image-opts \
nbd_server_start_unix_socket -r -f qcow2 -B b2 "$TEST_IMG"
$QEMU_IMG map --output=json --image-opts \
"$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+nbd_server_start_unix_socket -r -f qcow2 -B b3 "$TEST_IMG"
+$QEMU_IMG map --output=json --image-opts \
+ "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b3" | _filter_qemu_img_map
# success, all done
echo '*** done'
diff --git a/tests/qemu-iotests/291.out b/tests/qemu-iotests/291.out
index 9f661515b41..332584f67a8 100644
--- a/tests/qemu-iotests/291.out
+++ b/tests/qemu-iotests/291.out
@@ -66,6 +66,57 @@ Format specific information:
refcount bits: 16
corrupt: false
+=== Merge from top layer into backing image ===
+
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 10 MiB (10485760 bytes)
+cluster_size: 65536
+backing file: TEST_DIR/t.IMGFMT.base
+backing file format: IMGFMT
+Format specific information:
+ compat: 1.1
+ compression type: zlib
+ lazy refcounts: false
+ bitmaps:
+ [0]:
+ flags:
+ name: b1
+ granularity: 524288
+ [1]:
+ flags:
+ [0]: auto
+ name: b2
+ granularity: 65536
+ [2]:
+ flags:
+ name: b0
+ granularity: 65536
+ refcount bits: 16
+ corrupt: false
+
+image: TEST_DIR/t.IMGFMT.base
+file format: IMGFMT
+virtual size: 10 MiB (10485760 bytes)
+cluster_size: 65536
+Format specific information:
+ compat: 1.1
+ compression type: zlib
+ lazy refcounts: false
+ bitmaps:
+ [0]:
+ flags:
+ [0]: auto
+ name: b0
+ granularity: 65536
+ [1]:
+ flags:
+ [0]: auto
+ name: b3
+ granularity: 65536
+ refcount bits: 16
+ corrupt: false
+
=== Check bitmap contents ===
[{ "start": 0, "length": 3145728, "depth": 0, "zero": false, "data": true, "offset": OFFSET},
@@ -77,4 +128,7 @@ Format specific information:
[{ "start": 0, "length": 2097152, "depth": 0, "zero": false, "data": true, "offset": OFFSET},
{ "start": 2097152, "length": 1048576, "depth": 0, "zero": false, "data": false},
{ "start": 3145728, "length": 7340032, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
+[{ "start": 0, "length": 2097152, "depth": 0, "zero": false, "data": true, "offset": OFFSET},
+{ "start": 2097152, "length": 1048576, "depth": 0, "zero": false, "data": false},
+{ "start": 3145728, "length": 7340032, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
*** done
--
2.27.0

View File

@ -1,64 +0,0 @@
From 4effa711a867eaf0f10b38c2bcf4c8c39a00c1ab Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Fri, 14 Aug 2020 16:02:48 -0400
Subject: [PATCH 1/4] redhat: Update hw_compat_8_2
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200814160249.217753-2-lvivier@redhat.com>
Patchwork-id: 98157
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/2] redhat: Update hw_compat_8_2
Bugzilla: 1843348
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
v5.1.0-rc2 has introduced a new entry in hw_compat_5_0:
2ebc21216f58 ("hw/pci-host: save/restore pci host config register")
Add it in hw_compat_rhel_8_2
Update hw_compat_8_2 comment as it also includes hw_compat_5_0
Move a blank line
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/machine.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 6d17d9938d..10fa9b8c75 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -29,7 +29,7 @@
#include "migration/vmstate.h"
/*
- * The same as hw_compat_4_2
+ * The same as hw_compat_4_2 + hw_compat_5_0
*/
GlobalProperty hw_compat_rhel_8_2[] = {
/* hw_compat_rhel_8_2 from hw_compat_4_2 */
@@ -55,6 +55,8 @@ GlobalProperty hw_compat_rhel_8_2[] = {
/* hw_compat_rhel_8_2 from hw_compat_4_2 */
{ "fw_cfg", "acpi-mr-restore", "false" },
/* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
{ "virtio-balloon-device", "page-poison", "false" },
/* hw_compat_rhel_8_2 from hw_compat_5_0 */
{ "vmport", "x-read-set-eax", "off" },
@@ -64,9 +66,9 @@ GlobalProperty hw_compat_rhel_8_2[] = {
{ "vmport", "x-report-vmx-type", "off" },
/* hw_compat_rhel_8_2 from hw_compat_5_0 */
{ "vmport", "x-cmds-v2", "off" },
-
};
const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
+
/*
* The same as hw_compat_4_1
*/
--
2.27.0

View File

@ -1,47 +0,0 @@
From 45b840275a5f5d3a3e4803c72c02a1db7fe1927d Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Mon, 6 Jul 2020 09:41:16 +0000
Subject: [PATCH] redhat: define hw_compat_8_2
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200706104117.219174-2-lvivier@redhat.com>
Patchwork-id: 97903
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 1/2] redhat: define hw_compat_8_2
Bugzilla: 1853265
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
For minor fix
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/machine.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 5476af98e1..6d17d9938d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -54,6 +54,17 @@ GlobalProperty hw_compat_rhel_8_2[] = {
{ "qxl-vga", "revision", "4" },
/* hw_compat_rhel_8_2 from hw_compat_4_2 */
{ "fw_cfg", "acpi-mr-restore", "false" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "virtio-balloon-device", "page-poison", "false" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-read-set-eax", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-signal-unsupported-cmd", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-report-vmx-type", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "vmport", "x-cmds-v2", "off" },
+
};
const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
/*
--
2.27.0

View File

@ -1,61 +0,0 @@
From 020501879841afb788087f0455df79367c0337a0 Mon Sep 17 00:00:00 2001
From: Danilo de Paula <ddepaula@redhat.com>
Date: Fri, 11 Sep 2020 14:23:22 -0400
Subject: [PATCH 1/4] redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Danilo de Paula <ddepaula@redhat.com>
Message-id: <20200911142322.1865501-2-ddepaula@redhat.com>
Patchwork-id: 98358
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 1/1] redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/
Bugzilla: 1738820
RH-Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
When qemu-ga was introduced to RHEL-8, we used the qemu-guest-agent
from RHEL-7 as base.
In RHEL-7, qemu-guest-agent is built as standalone package.
It's built as "qemu-ga", hence the "qemu-ga" folders.
For RHEL-8, that should have been renamed to qemu-kvm, but I missed it.
Renaming those folders to /etc/qemu-kvm is a no go today, because
users might have populated the /etc/qemu-ga/fsfreeze-hook.d folder.
So, in order to make qemu-ga -F works in RHEL-8, a link is being
created in the expected place, pointing to the real one.
Also, fsfreeze-hook opens up the fsfreeze-hook.d on the same PATH where
it is stored. However, it doesn't follow symlinks. In order to fix this,
I had to change it to make sure it follows the link.
An option would be to also link the fsfreeze-hook.d folder, but I choose
not to do so as it creates a permanent/visible change in users
environments. The downside is to keep another downstream-only change.
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
redhat/qemu-kvm.spec.template | 6 ++++++
scripts/qemu-guest-agent/fsfreeze-hook | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook
index 13aafd4845..e9b84ec028 100755
--- a/scripts/qemu-guest-agent/fsfreeze-hook
+++ b/scripts/qemu-guest-agent/fsfreeze-hook
@@ -8,7 +8,7 @@
# request, it is issued with "thaw" argument after filesystem is thawed.
LOGFILE=/var/log/qga-fsfreeze-hook.log
-FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d
+FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d
# Check whether file $1 is a backup or rpm-generated file and should be ignored
is_ignored_file() {
--
2.27.0

View File

@ -1,58 +0,0 @@
From 1ab8783e716eb5ae2fb44b06a2db16b9fb91dad9 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Fri, 14 Aug 2020 16:02:49 -0400
Subject: [PATCH 2/4] redhat: update pseries-rhel8.2.0 machine type
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200814160249.217753-3-lvivier@redhat.com>
Patchwork-id: 98156
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 2/2] redhat: update pseries-rhel8.2.0 machine type
Bugzilla: 1843348
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
v5.1.0-rc1 has modified the default state of pseries-5.1 and
introduced a new entry in pseries-5.0 machine type:
a6030d7e0b35 ("spapr: Add a new level of NUMA for GPUs")
Add this entry to pseries-rhel8.2.0 as the default state has
also changed for pseries-rhel8.3.0
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 1c367a2367..5e3964326d 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -5019,10 +5019,15 @@ DEFINE_SPAPR_MACHINE(rhel830, "rhel8.3.0", true);
static void spapr_machine_rhel820_class_options(MachineClass *mc)
{
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ /* from pseries-5.0 */
+ static GlobalProperty compat[] = {
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-5.1-associativity", "on" },
+ };
spapr_machine_rhel830_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_rhel_8_2,
hw_compat_rhel_8_2_len);
+ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
/* from pseries-4.2 */
smc->default_caps.caps[SPAPR_CAP_FWNMI] = SPAPR_CAP_OFF;
@@ -5031,6 +5036,7 @@ static void spapr_machine_rhel820_class_options(MachineClass *mc)
/* from pseries-5.0 */
mc->numa_mem_supported = true;
+ smc->pre_5_1_assoc_refpoints = true;
}
DEFINE_SPAPR_MACHINE(rhel820, "rhel8.2.0", false);
--
2.27.0

View File

@ -1,79 +0,0 @@
From 4740b2ba008ca469409cf5af58ac85ae5dc7f6a5 Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo@redhat.com>
Date: Tue, 15 Sep 2020 15:15:49 -0400
Subject: [PATCH 2/4] seccomp: fix killing of whole process instead of thread
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Eduardo Otubo <otubo@redhat.com>
Message-id: <20200915151549.5007-1-otubo@redhat.com>
Patchwork-id: 98392
O-Subject: [RHEL-AV-8.3.0/RHEL-8.3.0 qemu-kvm PATCH] seccomp: fix killing of whole process instead of thread
Bugzilla: 1752376
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1752376
BRANCH: rhel-av-8.3.0
UPSTREAM: Merged
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=31339152
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1752376
BRANCH: rhel-8.3.0
UPSTREAM: Merged
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=31339111
From: Daniel P. Berrangé <berrange@redhat.com>
Back in 2018 we introduced support for killing the whole QEMU process
instead of just one thread, when a seccomp rule is violated:
commit bda08a5764d470f101fa38635d30b41179a313e1
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date: Wed Aug 22 19:02:48 2018 +0200
seccomp: prefer SCMP_ACT_KILL_PROCESS if available
Fast forward a year and we introduced a patch to avoid killing the
process for resource control syscalls tickled by Mesa.
commit 9a1565a03b79d80b236bc7cc2dbce52a2ef3a1b8
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Wed Mar 13 09:49:03 2019 +0000
seccomp: don't kill process for resource control syscalls
Unfortunately a logic bug effectively reverted the first commit
mentioned so that we go back to only killing the thread, not the whole
process.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Eduardo Otubo <otubo@redhat.com>
(cherry picked from commit e474e3aacf4276eb0781d11c45e2fab996f9dc56)
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
qemu-seccomp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index e0a1829b3d..8325ecb766 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -136,8 +136,9 @@ static uint32_t qemu_seccomp_get_action(int set)
if (qemu_seccomp(SECCOMP_GET_ACTION_AVAIL, 0, &action) == 0) {
kill_process = 1;
+ } else {
+ kill_process = 0;
}
- kill_process = 0;
}
if (kill_process == 1) {
return SCMP_ACT_KILL_PROCESS;
--
2.27.0

View File

@ -1,66 +0,0 @@
From de7263538a5cab64163edd1bdb3a934dabd625f2 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Tue, 8 Sep 2020 18:47:15 -0400
Subject: [PATCH 3/4] target/arm: Move setting of CPU halted state to generic
code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200908184716.1125192-3-lvivier@redhat.com>
Patchwork-id: 98300
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 2/3] target/arm: Move setting of CPU halted state to generic code
Bugzilla: 1849483
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
This change is in a separate patch because it's not so obvious that it
won't cause a regression.
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-3-bauerman@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 6ad1da667c8e21f019d4adc21702e06dd9225790)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/cpu.c | 2 +-
target/arm/cpu.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/core/cpu.c b/hw/core/cpu.c
index 594441a150..71bb7859f1 100644
--- a/hw/core/cpu.c
+++ b/hw/core/cpu.c
@@ -258,7 +258,7 @@ static void cpu_common_reset(DeviceState *dev)
}
cpu->interrupt_request = 0;
- cpu->halted = 0;
+ cpu->halted = cpu->start_powered_off;
cpu->mem_io_pc = 0;
cpu->icount_extra = 0;
atomic_set(&cpu->icount_decr_ptr->u32, 0);
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 54fb653229..059a5ced6e 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -175,7 +175,6 @@ static void arm_cpu_reset(DeviceState *dev)
env->vfp.xregs[ARM_VFP_MVFR2] = cpu->isar.mvfr2;
cpu->power_state = s->start_powered_off ? PSCI_OFF : PSCI_ON;
- s->halted = s->start_powered_off;
if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
--
2.27.0

View File

@ -1,141 +0,0 @@
From 76821af8b6d74237718fb554ae1a96f969308c69 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Tue, 8 Sep 2020 18:47:14 -0400
Subject: [PATCH 2/4] target/arm: Move start-powered-off property to generic
CPUState
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20200908184716.1125192-2-lvivier@redhat.com>
Patchwork-id: 98299
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/3] target/arm: Move start-powered-off property to generic CPUState
Bugzilla: 1849483
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
There are other platforms which also have CPUs that start powered off, so
generalize the start-powered-off property so that it can be used by them.
Note that ARMv7MState also has a property of the same name but this patch
doesn't change it because that class isn't a subclass of CPUState so it
wouldn't be a trivial change.
This change should not cause any change in behavior.
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-2-bauerman@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit c1b701587e59d9569c38d1d6033cd7cc2a992105)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
exec.c | 1 +
include/hw/core/cpu.h | 4 ++++
target/arm/cpu.c | 5 ++---
target/arm/cpu.h | 3 ---
target/arm/kvm32.c | 2 +-
target/arm/kvm64.c | 2 +-
6 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/exec.c b/exec.c
index 6f381f98e2..82e82fab09 100644
--- a/exec.c
+++ b/exec.c
@@ -899,6 +899,7 @@ Property cpu_common_props[] = {
DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION,
MemoryRegion *),
#endif
+ DEFINE_PROP_BOOL("start-powered-off", CPUState, start_powered_off, false),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 8f145733ce..9fc2696db5 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -374,6 +374,10 @@ struct CPUState {
bool created;
bool stop;
bool stopped;
+
+ /* Should CPU start in powered-off state? */
+ bool start_powered_off;
+
bool unplug;
bool crash_occurred;
bool exit_request;
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 13ad40aa7d..54fb653229 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -174,8 +174,8 @@ static void arm_cpu_reset(DeviceState *dev)
env->vfp.xregs[ARM_VFP_MVFR1] = cpu->isar.mvfr1;
env->vfp.xregs[ARM_VFP_MVFR2] = cpu->isar.mvfr2;
- cpu->power_state = cpu->start_powered_off ? PSCI_OFF : PSCI_ON;
- s->halted = cpu->start_powered_off;
+ cpu->power_state = s->start_powered_off ? PSCI_OFF : PSCI_ON;
+ s->halted = s->start_powered_off;
if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
@@ -2182,7 +2182,6 @@ static const ARMCPUInfo arm_cpus[] = {
};
static Property arm_cpu_properties[] = {
- DEFINE_PROP_BOOL("start-powered-off", ARMCPU, start_powered_off, false),
DEFINE_PROP_UINT32("psci-conduit", ARMCPU, psci_conduit, 0),
DEFINE_PROP_UINT64("midr", ARMCPU, midr, 0),
DEFINE_PROP_UINT64("mp-affinity", ARMCPU,
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 9e8ed423ea..a925d26996 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -810,9 +810,6 @@ struct ARMCPU {
*/
uint32_t psci_version;
- /* Should CPU start in PSCI powered-off state? */
- bool start_powered_off;
-
/* Current power state, access guarded by BQL */
ARMPSCIState power_state;
diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c
index 0af46b41c8..1f2b8f8b7a 100644
--- a/target/arm/kvm32.c
+++ b/target/arm/kvm32.c
@@ -218,7 +218,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
/* Determine init features for this CPU */
memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features));
- if (cpu->start_powered_off) {
+ if (cs->start_powered_off) {
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
}
if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index 1169237905..f8a6d905fb 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -775,7 +775,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
/* Determine init features for this CPU */
memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features));
- if (cpu->start_powered_off) {
+ if (cs->start_powered_off) {
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
}
if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
--
2.27.0

View File

@ -1,219 +0,0 @@
From b162af531abdf6f5e8ad13b93699a3ba28de6702 Mon Sep 17 00:00:00 2001
From: Michael Roth <mroth@redhat.com>
Date: Thu, 20 Aug 2020 23:00:51 -0400
Subject: [PATCH 1/4] target/ppc: Add experimental option for enabling secure
guests
RH-Author: Michael Roth <mroth@redhat.com>
Message-id: <20200820230051.516359-2-mroth@redhat.com>
Patchwork-id: 98208
O-Subject: [RHEL-AV-8.3.0 qemu virt PATCH 1/1] target/ppc: Add experimental option for enabling secure guests
Bugzilla: 1870384
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Fabiano Rosas <farosas@linux.ibm.com>
Making use of ppc's Protected Execution Facility (PEF) feature, a
guest can become a secure guest (aka. secure VM - SVM) and have its
memory protected from access by the host. This feature is mediated by
a piece of firmware called the Ultravisor (UV).
The transition from a regular to a secure VM is initiated by the guest
kernel during prom_init via the use of an ultracall (enter secure mode
- UV_ESM) and with cooperation from the hypervisor via an hcall
(H_SVM_INIT_START).
Currently QEMU has no knowledge of this process and no way to
determine if a host supports the feature. A guest with PEF support
enabled would always try to enter secure mode regardless of user
intent or hardware support.
To address the above, a new KVM capability (KVM_CAP_PPC_SECURE_GUEST
[1]) is being introduced in the kernel without which KVM will block
the secure transition.
This patch adds support for checking/enabling this KVM capability via
a new experimental spapr machine option, e.g.:
-machine pseries,x-svm-allowed=on
The capability defaults to off.
1- https://lore.kernel.org/kvm/20200319043301.GA13052@blackberry
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1789757
Upstream: RHEL-only
*re-worked to drop use of spapr capabilities infrastructure in favor
of a simple one-off machine option
Signed-off-by: Michael Roth <mroth@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 23 +++++++++++++++++++++++
include/hw/ppc/spapr.h | 3 +++
target/ppc/kvm.c | 27 +++++++++++++++++++++++++++
target/ppc/kvm_ppc.h | 13 +++++++++++++
4 files changed, 66 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5e3964326d..e77c90bfc5 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1636,6 +1636,9 @@ static void spapr_machine_reset(MachineState *machine)
kvmppc_svm_off(&error_fatal);
spapr_caps_apply(spapr);
+ if (spapr->svm_allowed) {
+ kvmppc_svm_allow(&error_fatal);
+ }
first_ppc_cpu = POWERPC_CPU(first_cpu);
if (kvm_enabled() && kvmppc_has_cap_mmu_radix() &&
@@ -3303,6 +3306,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp)
spapr->host_serial = g_strdup(value);
}
+static bool spapr_get_svm_allowed(Object *obj, Error **errp)
+{
+ SpaprMachineState *spapr = SPAPR_MACHINE(obj);
+
+ return spapr->svm_allowed;
+}
+
+static void spapr_set_svm_allowed(Object *obj, bool value, Error **errp)
+{
+ SpaprMachineState *spapr = SPAPR_MACHINE(obj);
+
+ spapr->svm_allowed = value;
+}
+
static void spapr_instance_init(Object *obj)
{
SpaprMachineState *spapr = SPAPR_MACHINE(obj);
@@ -3358,6 +3375,12 @@ static void spapr_instance_init(Object *obj)
spapr_get_host_serial, spapr_set_host_serial);
object_property_set_description(obj, "host-serial",
"Host serial number to advertise in guest device tree");
+ object_property_add_bool(obj, "x-svm-allowed",
+ spapr_get_svm_allowed,
+ spapr_set_svm_allowed);
+ object_property_set_description(obj, "x-svm-allowed",
+ "Allow the guest to become a Secure Guest"
+ " (experimental only)");
}
static void spapr_machine_finalizefn(Object *obj)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index f48089edba..d0728a4758 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -212,6 +212,9 @@ struct SpaprMachineState {
int fwnmi_machine_check_interlock;
QemuCond fwnmi_machine_check_interlock_cond;
+ /* Secure Guest support via x-svm-allowed */
+ bool svm_allowed;
+
/*< public >*/
char *kvm_type;
char *host_model;
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index d85ba8ffe0..ce63f8b6f3 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -89,6 +89,7 @@ static int cap_ppc_count_cache_flush_assist;
static int cap_ppc_nested_kvm_hv;
static int cap_large_decr;
static int cap_fwnmi;
+static int cap_ppc_secure_guest;
static uint32_t debug_inst_opcode;
@@ -136,6 +137,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
cap_resize_hpt = kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT);
kvmppc_get_cpu_characteristics(s);
cap_ppc_nested_kvm_hv = kvm_vm_check_extension(s, KVM_CAP_PPC_NESTED_HV);
+ cap_ppc_secure_guest = kvm_vm_check_extension(s, KVM_CAP_PPC_SECURE_GUEST);
cap_large_decr = kvmppc_get_dec_bits();
cap_fwnmi = kvm_vm_check_extension(s, KVM_CAP_PPC_FWNMI);
/*
@@ -2538,6 +2540,16 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable)
return 0;
}
+bool kvmppc_has_cap_secure_guest(void)
+{
+ return !!cap_ppc_secure_guest;
+}
+
+int kvmppc_enable_cap_secure_guest(void)
+{
+ return kvm_vm_enable_cap(kvm_state, KVM_CAP_PPC_SECURE_GUEST, 0, 1);
+}
+
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void)
{
uint32_t host_pvr = mfpvr();
@@ -2948,3 +2960,18 @@ void kvmppc_svm_off(Error **errp)
error_setg_errno(errp, -rc, "KVM_PPC_SVM_OFF ioctl failed");
}
}
+
+void kvmppc_svm_allow(Error **errp)
+{
+ if (!kvm_enabled()) {
+ error_setg(errp, "No PEF support in tcg, try x-svm-allowed=off");
+ return;
+ }
+
+ if (!kvmppc_has_cap_secure_guest()) {
+ error_setg(errp, "KVM implementation does not support secure guests, "
+ "try x-svm-allowed=off");
+ } else if (kvmppc_enable_cap_secure_guest() < 0) {
+ error_setg(errp, "Error enabling x-svm-allowed, try x-svm-allowed=off");
+ }
+}
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index 72e05f1cd2..3fd5ea2414 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -40,6 +40,7 @@ target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu,
bool radix, bool gtse,
uint64_t proc_tbl);
void kvmppc_svm_off(Error **errp);
+void kvmppc_svm_allow(Error **errp);
#ifndef CONFIG_USER_ONLY
bool kvmppc_spapr_use_multitce(void);
int kvmppc_spapr_enable_inkernel_multitce(void);
@@ -73,6 +74,8 @@ int kvmppc_set_cap_nested_kvm_hv(int enable);
int kvmppc_get_cap_large_decr(void);
int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable);
int kvmppc_enable_hwrng(void);
+bool kvmppc_has_cap_secure_guest(void);
+int kvmppc_enable_cap_secure_guest(void);
int kvmppc_put_books_sregs(PowerPCCPU *cpu);
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void);
void kvmppc_check_papr_resize_hpt(Error **errp);
@@ -386,6 +389,16 @@ static inline int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable)
return -1;
}
+static inline bool kvmppc_has_cap_secure_guest(void)
+{
+ return false;
+}
+
+static inline int kvmppc_enable_cap_secure_guest(void)
+{
+ return -1;
+}
+
static inline int kvmppc_enable_hwrng(void)
{
return -1;
--
2.27.0

View File

@ -1,102 +0,0 @@
From e6d43ded51d658d77bb7f8a490f2bf93946d3215 Mon Sep 17 00:00:00 2001
From: Jon Maloy <jmaloy@redhat.com>
Date: Thu, 3 Sep 2020 14:27:19 -0400
Subject: [PATCH 09/11] usb: fix setup_len init (CVE-2020-14364)
RH-Author: Jon Maloy <jmaloy@redhat.com>
Message-id: <20200903142719.1415757-2-jmaloy@redhat.com>
Patchwork-id: 98265
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/1] usb: fix setup_len init (CVE-2020-14364)
Bugzilla: 1869715
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
Store calculated setup_len in a local variable, verify it, and only
write it to the struct (USBDevice->setup_len) in case it passed the
sanity checks.
This prevents other code (do_token_{in,out} functions specifically)
from working with invalid USBDevice->setup_len values and overrunning
the USBDevice->setup_buf[] buffer.
Fixes: CVE-2020-14364
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20200825053636.29648-1-kraxel@redhat.com
(cherry picked from commit b946434f2659a182afc17e155be6791ebfb302eb)
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/usb/core.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/hw/usb/core.c b/hw/usb/core.c
index 5abd128b6b..5234dcc73f 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -129,6 +129,7 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
static void do_token_setup(USBDevice *s, USBPacket *p)
{
int request, value, index;
+ unsigned int setup_len;
if (p->iov.size != 8) {
p->status = USB_RET_STALL;
@@ -138,14 +139,15 @@ static void do_token_setup(USBDevice *s, USBPacket *p)
usb_packet_copy(p, s->setup_buf, p->iov.size);
s->setup_index = 0;
p->actual_length = 0;
- s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
- if (s->setup_len > sizeof(s->data_buf)) {
+ setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
+ if (setup_len > sizeof(s->data_buf)) {
fprintf(stderr,
"usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
- s->setup_len, sizeof(s->data_buf));
+ setup_len, sizeof(s->data_buf));
p->status = USB_RET_STALL;
return;
}
+ s->setup_len = setup_len;
request = (s->setup_buf[0] << 8) | s->setup_buf[1];
value = (s->setup_buf[3] << 8) | s->setup_buf[2];
@@ -259,26 +261,28 @@ static void do_token_out(USBDevice *s, USBPacket *p)
static void do_parameter(USBDevice *s, USBPacket *p)
{
int i, request, value, index;
+ unsigned int setup_len;
for (i = 0; i < 8; i++) {
s->setup_buf[i] = p->parameter >> (i*8);
}
s->setup_state = SETUP_STATE_PARAM;
- s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
s->setup_index = 0;
request = (s->setup_buf[0] << 8) | s->setup_buf[1];
value = (s->setup_buf[3] << 8) | s->setup_buf[2];
index = (s->setup_buf[5] << 8) | s->setup_buf[4];
- if (s->setup_len > sizeof(s->data_buf)) {
+ setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
+ if (setup_len > sizeof(s->data_buf)) {
fprintf(stderr,
"usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
- s->setup_len, sizeof(s->data_buf));
+ setup_len, sizeof(s->data_buf));
p->status = USB_RET_STALL;
return;
}
+ s->setup_len = setup_len;
if (p->pid == USB_TOKEN_OUT) {
usb_packet_copy(p, s->data_buf, s->setup_len);
--
2.27.0

View File

@ -1,71 +0,0 @@
From b969c169c82c3022949a7717d6f5745fbdc579bc Mon Sep 17 00:00:00 2001
From: Stefano Garzarella <sgarzare@redhat.com>
Date: Tue, 29 Sep 2020 12:41:42 -0400
Subject: [PATCH 3/4] vhost-user-vsock-pci: force virtio version 1
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
Message-id: <20200929124143.41520-4-sgarzare@redhat.com>
Patchwork-id: 98513
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 3/4] vhost-user-vsock-pci: force virtio version 1
Bugzilla: 1868449
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Commit 9b3a35ec82 ("virtio: verify that legacy support is not
accidentally on") added a safety check that requires to set
'disable-legacy=on' on vhost-user-vsock-pci device:
$ ./qemu-system-x86_64 ... \
-chardev socket,id=char0,reconnect=0,path=/tmp/vhost4.socket \
-device vhost-user-vsock-pci,chardev=char0
qemu-system-x86_64: -device vhost-user-vsock-pci,chardev=char0:
device is modern-only, use disable-legacy=on
virtio-vsock was introduced after the release of VIRTIO 1.0
specifications, so it should be 'modern-only'.
This patch forces virtio version 1 and removes the 'transitional_name'
property, as done for vhost-vsock-pci, removing the need to specify
'disable-legacy=on' on vhost-user-vsock-pci device.
Cc: qemu-stable@nongnu.org
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200921122506.82515-4-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 27eda699f59d430c33fc054a36a17251992e70dc)
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/virtio/vhost-user-vsock-pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-user-vsock-pci.c b/hw/virtio/vhost-user-vsock-pci.c
index f4cf95873d3..492df6418a4 100644
--- a/hw/virtio/vhost-user-vsock-pci.c
+++ b/hw/virtio/vhost-user-vsock-pci.c
@@ -40,6 +40,9 @@ static void vhost_user_vsock_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
VHostUserVSockPCI *dev = VHOST_USER_VSOCK_PCI(vpci_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
+ /* unlike vhost-vsock, we do not need to care about pre-5.1 compat */
+ virtio_pci_force_virtio_1(vpci_dev);
+
qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
}
@@ -68,7 +71,6 @@ static void vhost_user_vsock_pci_instance_init(Object *obj)
static const VirtioPCIDeviceTypeInfo vhost_user_vsock_pci_info = {
.base_name = TYPE_VHOST_USER_VSOCK_PCI,
.generic_name = "vhost-user-vsock-pci",
- .transitional_name = "vhost-user-vsock-pci-transitional",
.non_transitional_name = "vhost-user-vsock-pci-non-transitional",
.instance_size = sizeof(VHostUserVSockPCI),
.instance_init = vhost_user_vsock_pci_instance_init,
--
2.27.0

View File

@ -1,66 +0,0 @@
From 41467dab8f8e312bbb13a47454724e20c4b08d60 Mon Sep 17 00:00:00 2001
From: Stefano Garzarella <sgarzare@redhat.com>
Date: Tue, 29 Sep 2020 12:41:43 -0400
Subject: [PATCH 4/4] vhost-vsock-ccw: force virtio version 1
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
Message-id: <20200929124143.41520-5-sgarzare@redhat.com>
Patchwork-id: 98514
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 4/4] vhost-vsock-ccw: force virtio version 1
Bugzilla: 1868449
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
virtio-vsock was introduced after the release of VIRTIO 1.0
specifications, so it should be 'modern-only'.
This patch forces virtio version 1 as done for vhost-vsock-pci.
To avoid migration issues, we force virtio version 1 only when
legacy check is enabled in the new machine types (>= 5.1).
Cc: qemu-stable@nongnu.org
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200921122506.82515-5-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit a6704a34cf02add13964149e0de6453ae62bd9db)
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/s390x/vhost-vsock-ccw.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/s390x/vhost-vsock-ccw.c b/hw/s390x/vhost-vsock-ccw.c
index 0822ecca893..246416a8f96 100644
--- a/hw/s390x/vhost-vsock-ccw.c
+++ b/hw/s390x/vhost-vsock-ccw.c
@@ -40,9 +40,21 @@ static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data)
static void vhost_vsock_ccw_instance_init(Object *obj)
{
VHostVSockCCWState *dev = VHOST_VSOCK_CCW(obj);
+ VirtioCcwDevice *ccw_dev = VIRTIO_CCW_DEVICE(obj);
+ VirtIODevice *virtio_dev;
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
TYPE_VHOST_VSOCK);
+
+ virtio_dev = VIRTIO_DEVICE(&dev->vdev);
+
+ /*
+ * To avoid migration issues, we force virtio version 1 only when
+ * legacy check is enabled in the new machine types (>= 5.1).
+ */
+ if (!virtio_legacy_check_disabled(virtio_dev)) {
+ ccw_dev->force_revision_1 = true;
+ }
}
static const TypeInfo vhost_vsock_ccw_info = {
--
2.27.0

View File

@ -1,87 +0,0 @@
From 7153f4862bf6c4396412a8ba0d7db45ae087a337 Mon Sep 17 00:00:00 2001
From: Stefano Garzarella <sgarzare@redhat.com>
Date: Tue, 29 Sep 2020 12:41:41 -0400
Subject: [PATCH 2/4] vhost-vsock-pci: force virtio version 1
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
Message-id: <20200929124143.41520-3-sgarzare@redhat.com>
Patchwork-id: 98511
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 2/4] vhost-vsock-pci: force virtio version 1
Bugzilla: 1868449
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Commit 9b3a35ec82 ("virtio: verify that legacy support is not
accidentally on") added a safety check that requires to set
'disable-legacy=on' on vhost-vsock-pci device:
$ ./qemu-system-x86_64 ... -device vhost-vsock-pci,guest-cid=5
qemu-system-x86_64: -device vhost-vsock-pci,guest-cid=5:
device is modern-only, use disable-legacy=on
virtio-vsock was introduced after the release of VIRTIO 1.0
specifications, so it should be 'modern-only'.
In addition Cornelia verified that forcing a legacy mode on
vhost-vsock-pci device using x86-64 host and s390x guest, so with
different endianness, produces strange behaviours.
This patch forces virtio version 1 and removes the 'transitional_name'
property removing the need to specify 'disable-legacy=on' on
vhost-vsock-pci device.
To avoid migration issues, we force virtio version 1 only when
legacy check is enabled in the new machine types (>= 5.1).
As the transitional device name is not commonly used, we do not
provide compatibility handling for it.
Cc: qemu-stable@nongnu.org
Reported-by: Qian Cai <caiqian@redhat.com>
Reported-by: Qinghua Cheng <qcheng@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1868449
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200921122506.82515-3-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 6209070503989cf4f28549f228989419d4f0b236)
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/virtio/vhost-vsock-pci.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-vsock-pci.c b/hw/virtio/vhost-vsock-pci.c
index a815278e69c..f11a38292fe 100644
--- a/hw/virtio/vhost-vsock-pci.c
+++ b/hw/virtio/vhost-vsock-pci.c
@@ -43,6 +43,15 @@ static void vhost_vsock_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
{
VHostVSockPCI *dev = VHOST_VSOCK_PCI(vpci_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
+ VirtIODevice *virtio_dev = VIRTIO_DEVICE(vdev);
+
+ /*
+ * To avoid migration issues, we force virtio version 1 only when
+ * legacy check is enabled in the new machine types (>= 5.1).
+ */
+ if (!virtio_legacy_check_disabled(virtio_dev)) {
+ virtio_pci_force_virtio_1(vpci_dev);
+ }
qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
}
@@ -72,7 +81,6 @@ static void vhost_vsock_pci_instance_init(Object *obj)
static const VirtioPCIDeviceTypeInfo vhost_vsock_pci_info = {
.base_name = TYPE_VHOST_VSOCK_PCI,
.generic_name = "vhost-vsock-pci",
- .transitional_name = "vhost-vsock-pci-transitional",
.non_transitional_name = "vhost-vsock-pci-non-transitional",
.instance_size = sizeof(VHostVSockPCI),
.instance_init = vhost_vsock_pci_instance_init,
--
2.27.0

View File

@ -1,169 +0,0 @@
From 0e84dffa20452130768c81390d9df56fab8ba260 Mon Sep 17 00:00:00 2001
From: Stefano Garzarella <sgarzare@redhat.com>
Date: Tue, 29 Sep 2020 12:41:40 -0400
Subject: [PATCH 1/4] virtio: skip legacy support check on machine types less
than 5.1
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
Message-id: <20200929124143.41520-2-sgarzare@redhat.com>
Patchwork-id: 98512
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/4] virtio: skip legacy support check on machine types less than 5.1
Bugzilla: 1868449
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Commit 9b3a35ec82 ("virtio: verify that legacy support is not accidentally
on") added a check that returns an error if legacy support is on, but the
device does not support legacy.
Unfortunately some devices were wrongly declared legacy capable even if
they were not (e.g vhost-vsock).
To avoid migration issues, we add a virtio-device property
(x-disable-legacy-check) to skip the legacy error, printing a warning
instead, for machine types < 5.1.
Cc: qemu-stable@nongnu.org
Fixes: 9b3a35ec82 ("virtio: verify that legacy support is not accidentally on")
Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200921122506.82515-2-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit d55f518248f263bb8d0852f98e47102ea09d4f89)
Added 'x-disable-legacy-check' in hw_compat_rhel_8_2
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/machine.c | 3 +++
hw/s390x/virtio-ccw.c | 15 ++++++++++++---
hw/virtio/virtio-pci.c | 14 ++++++++++++--
hw/virtio/virtio.c | 7 +++++++
include/hw/virtio/virtio.h | 2 ++
5 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 10fa9b8c756..86ce3af71e4 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -66,6 +66,8 @@ GlobalProperty hw_compat_rhel_8_2[] = {
{ "vmport", "x-report-vmx-type", "off" },
/* hw_compat_rhel_8_2 from hw_compat_5_0 */
{ "vmport", "x-cmds-v2", "off" },
+ /* hw_compat_rhel_8_2 from hw_compat_5_0 */
+ { "virtio-device", "x-disable-legacy-check", "true" },
};
const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2);
@@ -246,6 +248,7 @@ GlobalProperty hw_compat_5_0[] = {
{ "vmport", "x-signal-unsupported-cmd", "off" },
{ "vmport", "x-report-vmx-type", "off" },
{ "vmport", "x-cmds-v2", "off" },
+ { "virtio-device", "x-disable-legacy-check", "true" },
};
const size_t hw_compat_5_0_len = G_N_ELEMENTS(hw_compat_5_0);
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 0e602702971..3dfc93d4f6f 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1122,9 +1122,18 @@ static void virtio_ccw_device_plugged(DeviceState *d, Error **errp)
}
if (!virtio_ccw_rev_max(dev) && !virtio_legacy_allowed(vdev)) {
- error_setg(errp, "Invalid value of property max_rev "
- "(is %d expected >= 1)", virtio_ccw_rev_max(dev));
- return;
+ /*
+ * To avoid migration issues, we allow legacy mode when legacy
+ * check is disabled in the old machine types (< 5.1).
+ */
+ if (virtio_legacy_check_disabled(vdev)) {
+ warn_report("device requires revision >= 1, but for backward "
+ "compatibility max_revision=0 is allowed");
+ } else {
+ error_setg(errp, "Invalid value of property max_rev "
+ "(is %d expected >= 1)", virtio_ccw_rev_max(dev));
+ return;
+ }
}
if (virtio_get_num_queues(vdev) > VIRTIO_QUEUE_MAX) {
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ccdf54e81c7..4211565f2c9 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1596,8 +1596,18 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
if (legacy) {
if (!virtio_legacy_allowed(vdev)) {
- error_setg(errp, "device is modern-only, use disable-legacy=on");
- return;
+ /*
+ * To avoid migration issues, we allow legacy mode when legacy
+ * check is disabled in the old machine types (< 5.1).
+ */
+ if (virtio_legacy_check_disabled(vdev)) {
+ warn_report("device is modern-only, but for backward "
+ "compatibility legacy is allowed");
+ } else {
+ error_setg(errp,
+ "device is modern-only, use disable-legacy=on");
+ return;
+ }
}
if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
error_setg(errp, "VIRTIO_F_IOMMU_PLATFORM was supported by"
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index e9830252176..b85277da673 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3304,6 +3304,11 @@ bool virtio_legacy_allowed(VirtIODevice *vdev)
}
}
+bool virtio_legacy_check_disabled(VirtIODevice *vdev)
+{
+ return vdev->disable_legacy_check;
+}
+
hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n)
{
return vdev->vq[n].vring.desc;
@@ -3713,6 +3718,8 @@ static Property virtio_properties[] = {
DEFINE_VIRTIO_COMMON_FEATURES(VirtIODevice, host_features),
DEFINE_PROP_BOOL("use-started", VirtIODevice, use_started, true),
DEFINE_PROP_BOOL("use-disabled-flag", VirtIODevice, use_disabled_flag, true),
+ DEFINE_PROP_BOOL("x-disable-legacy-check", VirtIODevice,
+ disable_legacy_check, false),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index e424df12cf6..c50f5a9dfe8 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -105,6 +105,7 @@ struct VirtIODevice
bool use_started;
bool started;
bool start_on_kick; /* when virtio 1.0 feature has not been negotiated */
+ bool disable_legacy_check;
VMChangeStateEntry *vmstate;
char *bus_name;
uint8_t device_endian;
@@ -398,5 +399,6 @@ static inline bool virtio_device_disabled(VirtIODevice *vdev)
}
bool virtio_legacy_allowed(VirtIODevice *vdev);
+bool virtio_legacy_check_disabled(VirtIODevice *vdev);
#endif
--
2.27.0

View File

@ -1,99 +0,0 @@
From 98eced5d367a6a69006cab1ea2b77c2c2622694a Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Mon, 5 Oct 2020 15:27:02 -0400
Subject: [PATCH 2/3] x86: cpuhp: prevent guest crash on CPU hotplug when
broadcast SMI is in use
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20201005152703.1555401-3-imammedo@redhat.com>
Patchwork-id: 98550
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 2/3] x86: cpuhp: prevent guest crash on CPU hotplug when broadcast SMI is in use
Bugzilla: 1846886
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1846886
BRANCH: rhel-av-8.3.0
UPSTREAM: Merged
BREW: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31759628
Upstream commit: c5be7517d658
There were reports of guest crash on CPU hotplug, when using q35 machine
type and OVMF with SMM, due to hotplugged CPU trying to process SMI at
default SMI handler location without it being relocated by firmware first.
Fix it by refusing hotplug if firmware hasn't negotiated CPU hotplug with
SMI support while SMI broadcast is in use.
Conflicts:
hw/i386/x86.c
cpu wiring routines were moved to x86.c upstream
to be shared with micro vm, so the second hunk
has to be put into pc_cpu_pre_plug() and s/x86ms/pcms/.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200923094650.1301166-3-imammedo@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/acpi/ich9.c | 12 +++++++++++-
hw/i386/pc.c | 11 +++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 43ad1ff9278..37286a03288 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -423,10 +423,20 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev);
if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) &&
- !lpc->pm.acpi_memory_hotplug.is_enabled)
+ !lpc->pm.acpi_memory_hotplug.is_enabled) {
error_setg(errp,
"memory hotplug is not enabled: %s.memory-hotplug-support "
"is not set", object_get_typename(OBJECT(lpc)));
+ } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
+ uint64_t negotiated = lpc->smi_negotiated_features;
+
+ if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) &&
+ !(negotiated & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT))) {
+ error_setg(errp, "cpu hotplug with SMI wasn't enabled by firmware");
+ error_append_hint(errp, "update machine type to newer than 5.1 "
+ "and firmware that suppors CPU hotplug with SMM");
+ }
+ }
}
void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 6e0a3f391b0..0332589359b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1761,6 +1761,17 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
return;
}
+ if (pcms->acpi_dev) {
+ Error *local_err = NULL;
+
+ hotplug_handler_pre_plug(HOTPLUG_HANDLER(pcms->acpi_dev), dev,
+ &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+ }
+
init_topo_info(&topo_info, x86ms);
env->nr_dies = x86ms->smp_dies;
--
2.27.0

View File

@ -1,68 +0,0 @@
From 77c5df3ab28f294f7b21d33a2f6116b0889292ed Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Mon, 5 Oct 2020 15:27:03 -0400
Subject: [PATCH 3/3] x86: cpuhp: refuse cpu hot-unplug request earlier if not
supported
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20201005152703.1555401-4-imammedo@redhat.com>
Patchwork-id: 98551
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 3/3] x86: cpuhp: refuse cpu hot-unplug request earlier if not supported
Bugzilla: 1846886
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1846886
BRANCH: rhel-av-8.3.0
UPSTREAM: Merged
BREW: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31759628
Upstream commit: b48ad7c02ba7
CPU hot-unplug with SMM requires firmware participation to prevent
guest crash (i.e. CPU can be removed only after OS _and_ firmware
were prepared for the action).
Previous patches introduced ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT
feature bit, which is advertised by firmware when it has support
for CPU hot-unplug. Use it to check if guest is able to handle
unplug and make device_del fail gracefully if hot-unplug feature
hasn't been negotiated.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200923094650.1301166-4-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/acpi/ich9.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 37286a03288..f6c6c6a916a 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -475,6 +475,18 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev,
errp);
} else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) &&
!lpc->pm.cpu_hotplug_legacy) {
+ uint64_t negotiated = lpc->smi_negotiated_features;
+
+ if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) &&
+ !(negotiated & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT))) {
+ error_setg(errp, "cpu hot-unplug with SMI wasn't enabled "
+ "by firmware");
+ error_append_hint(errp, "update machine type to a version having "
+ "x-smi-cpu-hotunplug=on and firmware that "
+ "supports CPU hot-unplug with SMM");
+ return;
+ }
+
acpi_cpu_unplug_request_cb(hotplug_dev, &lpc->pm.cpuhp_state,
dev, errp);
} else {
--
2.27.0

View File

@ -1,110 +0,0 @@
From e2d32096071d7175d11b444db80e25709d6bf3d4 Mon Sep 17 00:00:00 2001
From: Igor Mammedov <imammedo@redhat.com>
Date: Mon, 5 Oct 2020 15:27:01 -0400
Subject: [PATCH 1/3] x86: lpc9: let firmware negotiate 'CPU hotplug with SMI'
features
RH-Author: Igor Mammedov <imammedo@redhat.com>
Message-id: <20201005152703.1555401-2-imammedo@redhat.com>
Patchwork-id: 98549
O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH 1/3] x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features
Bugzilla: 1846886
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1846886
BRANCH: rhel-av-8.3.0
UPSTREAM: Merged
BREW: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=31759628
Upstream commit: 00dc02d284ea
It will allow firmware to notify QEMU that firmware requires SMI
being triggered on CPU hot[un]plug, so that it would be able to account
for hotplugged CPU and relocate it to new SMM base and/or safely remove
CPU on unplug.
Using negotiated features, follow up patches will insert SMI upcall
into AML code, to make sure that firmware processes hotplug before
guest OS would attempt to use new CPU.
Conflicts:
hw/i386/pc.c
move x-smi-cpu-hotplug chunk from missing pc_compat_5_1[] compat props
to pc_rhel_compat[] to disable cpu hotplug for [ovmf+smi] config
(should be moved to versioned q35 machine type later, when RHEL gets
complete feature and we decide to support it downstream)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200923094650.1301166-2-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc.c | 2 ++
hw/isa/lpc_ich9.c | 13 +++++++++++++
include/hw/i386/ich9.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ac2cc79fca2..6e0a3f391b0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -358,6 +358,8 @@ GlobalProperty pc_rhel_compat[] = {
{ TYPE_X86_CPU, "vmx-exit-load-perf-global-ctrl", "off" },
/* bz 1508330 */
{ "vfio-pci", "x-no-geforce-quirks", "on" },
+ /* BZ 1846886 */
+ { "ICH9-LPC", "x-smi-cpu-hotplug", "off" },
};
const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat);
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index cd6e169d47a..19f32bed3e9 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -373,6 +373,15 @@ static void smi_features_ok_callback(void *opaque)
/* guest requests invalid features, leave @features_ok at zero */
return;
}
+ if (!(guest_features & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT)) &&
+ guest_features & (BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT) |
+ BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT))) {
+ /*
+ * cpu hot-[un]plug with SMI requires SMI broadcast,
+ * leave @features_ok at zero
+ */
+ return;
+ }
/* valid feature subset requested, lock it down, report success */
lpc->smi_negotiated_features = guest_features;
@@ -747,6 +756,10 @@ static Property ich9_lpc_properties[] = {
DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true),
DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features,
ICH9_LPC_SMI_F_BROADCAST_BIT, true),
+ DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features,
+ ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT, true),
+ DEFINE_PROP_BIT64("x-smi-cpu-hotunplug", ICH9LPCState, smi_host_features,
+ ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT, false),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index a98d10b252d..d1bb3f7bf0e 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -247,5 +247,7 @@ typedef struct ICH9LPCState {
/* bit positions used in fw_cfg SMI feature negotiation */
#define ICH9_LPC_SMI_F_BROADCAST_BIT 0
+#define ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT 1
+#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT 2
#endif /* HW_ICH9_H */
--
2.27.0

View File

@ -1,18 +0,0 @@
#!/bin/sh
case $(uname -m) in
ppc64)
grep OPAL /proc/cpuinfo >/dev/null 2>&1 && opal=1
modprobe -b kvm >/dev/null 2>&1
modprobe -b kvm-pr >/dev/null 2>&1 && kvm=1
if [ "$opal" ]; then
modprobe -b kvm-hv >/dev/null 2>&1
fi
;;
s390x)
modprobe -b kvm >/dev/null 2>&1 && kvm=1
;;
esac
exit 0

View File

@ -8,6 +8,7 @@
%global have_gluster 1
%global have_kvm_setup 0
%global have_memlock_limits 0
%global rcversion -rc1
%ifnarch %{ix86} x86_64
@ -61,14 +62,11 @@ Requires: %{name}-block-rbd = %{epoch}:%{version}-%{release} \
Requires: %{name}-block-ssh = %{epoch}:%{version}-%{release}
# Macro to properly setup RHEL/RHEV conflict handling
%define rhev_ma_conflicts() \
Obsoletes: %1-ma \
Obsoletes: %1-rhev
Summary: QEMU is a machine emulator and virtualizer
Name: qemu-kvm
Version: 5.1.0
Release: 13%{?dist}
Version: 5.2.0-rc1
Release: 1%{?dist}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
Epoch: 15
License: GPLv2 and GPLv2+ and CC-BY
@ -76,8 +74,7 @@ Group: Development/Tools
URL: http://www.qemu.org/
ExclusiveArch: x86_64 %{power64} aarch64 s390x
Source0: http://wiki.qemu.org/download/qemu-5.1.0.tar.xz
Source0: http://wiki.qemu.org/download/qemu-5.2.0-rc1.tar.xz
# KSM control scripts
Source4: ksm.service
@ -117,104 +114,17 @@ Patch0012: 0012-Enable-make-check.patch
Patch0013: 0013-vfio-cap-number-of-devices-that-can-be-assigned.patch
Patch0014: 0014-Add-support-statement-to-help-output.patch
Patch0015: 0015-globally-limit-the-maximum-number-of-CPUs.patch
Patch0016: 0016-Add-support-for-simpletrace.patch
Patch0017: 0017-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch
Patch0018: 0018-usb-xhci-Fix-PCI-capability-order.patch
Patch0019: 0019-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch
Patch0020: 0020-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch
Patch0021: 0021-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch
Patch0022: 0022-RHEL-only-Enable-vTPM-for-POWER-in-downstream-config.patch
Patch0023: 0023-redhat-fix-5.0-rebase-missing-ISA-TPM-TIS.patch
Patch0024: 0024-redhat-define-hw_compat_8_2.patch
Patch0025: 0025-x86-Add-8.3.0-x86_64-machine-type.patch
Patch0027: 0027-hw-arm-Changes-to-rhel820-machine.patch
Patch0028: 0028-hw-arm-Introduce-rhel_virt_instance_init-helper.patch
Patch0029: 0029-hw-arm-Add-rhel830-machine-type.patch
Patch0030: 0030-redhat-define-pseries-rhel8.3.0-machine-type.patch
Patch0031: 0031-ppc-Set-correct-max_cpus-value-on-spapr-rhel-machine.patch
Patch0032: 0032-arm-Set-correct-max_cpus-value-on-virt-rhel-machine-.patch
Patch0033: 0033-vl-Remove-downstream-only-MAX_RHEL_CPUS-code.patch
Patch0034: 0034-q35-Set-max_cpus-to-512.patch
Patch0035: 0035-RHEL-only-arm-virt-Allow-the-TPM_TIS_SYSBUS-device-d.patch
Patch0036: 0036-RHEL-only-Enable-vTPM-for-ARM-in-downstream-configs.patch
# For bz#1853265 - Forward and backward migration from rhel-av-8.3.0(qemu-kvm-5.0.0) to rhel-av-8.2.1(qemu-kvm-4.2.0) failed with "qemu-kvm: error while loading state for instance 0x0 of device 'spapr'"
Patch37: kvm-redhat-define-hw_compat_8_2.patch
# For bz#1843348 - 8.3 machine types for POWER
Patch38: kvm-redhat-Update-hw_compat_8_2.patch
# For bz#1843348 - 8.3 machine types for POWER
Patch39: kvm-redhat-update-pseries-rhel8.2.0-machine-type.patch
# For bz#1801242 - [aarch64] vTPM support in machvirt
Patch40: kvm-Disable-TPM-passthrough-backend-on-ARM.patch
# For bz#1867075 - CVE-2020-10756 virt:8.3/qemu-kvm: QEMU: slirp: networking out-of-bounds read information disclosure vulnerability [rhel-av-8]
Patch41: kvm-Drop-bogus-IPv6-messages.patch
# For bz#1849707 - 8.3 machine types for x86 - 5.1 update
Patch42: kvm-machine-types-numa-set-numa_mem_supported-on-old-mac.patch
# For bz#1849707 - 8.3 machine types for x86 - 5.1 update
Patch43: kvm-machine_types-numa-compatibility-for-auto_enable_num.patch
# For bz#1790492 - 'dirty-bitmaps' migration capability should allow configuring target nodenames
Patch44: kvm-migration-Add-block-bitmap-mapping-parameter.patch
# For bz#1790492 - 'dirty-bitmaps' migration capability should allow configuring target nodenames
Patch45: kvm-iotests.py-Let-wait_migration-return-on-failure.patch
# For bz#1790492 - 'dirty-bitmaps' migration capability should allow configuring target nodenames
Patch46: kvm-iotests-Test-node-bitmap-aliases-during-migration.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch47: kvm-Revert-i386-Fix-pkg_id-offset-for-EPYC-cpu-models.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch48: kvm-Revert-target-i386-Enable-new-apic-id-encoding-for-E.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch49: kvm-Revert-hw-i386-Move-arch_id-decode-inside-x86_cpus_i.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch50: kvm-Revert-i386-Introduce-use_epyc_apic_id_encoding-in-X.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch51: kvm-Revert-hw-i386-Introduce-apicid-functions-inside-X86.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch52: kvm-Revert-target-i386-Cleanup-and-use-the-EPYC-mode-top.patch
# For bz#1873417 - AMD/NUMA topology - revert 5.1 changes
Patch53: kvm-Revert-hw-386-Add-EPYC-mode-topology-decoding-functi.patch
# For bz#1867739 - -prom-env does not validate input
Patch54: kvm-nvram-Exit-QEMU-if-NVRAM-cannot-contain-all-prom-env.patch
# For bz#1869715 - CVE-2020-14364 qemu-kvm: QEMU: usb: out-of-bounds r/w access issue while processing usb packets [rhel-av-8.3.0]
Patch55: kvm-usb-fix-setup_len-init-CVE-2020-14364.patch
# For bz#1789757 - [IBM 8.4 FEAT] Add machine option to enable secure VM support
# For bz#1870384 - [IBM 8.3 FEAT] Add interim/unsupported machine option to enable secure VM support for testing purposes
Patch56: kvm-target-ppc-Add-experimental-option-for-enabling-secu.patch
# For bz#1849483 - Failed to boot up guest when hotplugging vcpus on bios stage
Patch57: kvm-target-arm-Move-start-powered-off-property-to-generi.patch
# For bz#1849483 - Failed to boot up guest when hotplugging vcpus on bios stage
Patch58: kvm-target-arm-Move-setting-of-CPU-halted-state-to-gener.patch
# For bz#1849483 - Failed to boot up guest when hotplugging vcpus on bios stage
Patch59: kvm-ppc-spapr-Use-start-powered-off-CPUState-property.patch
# For bz#1738820 - '-F' option of qemu-ga command cause the guest-fsfreeze-freeze command doesn't work
Patch60: kvm-redhat-link-etc-qemu-ga-fsfreeze-hook-to-etc-qemu-kv.patch
# For bz#1752376 - qemu use SCMP_ACT_TRAP even SCMP_ACT_KILL_PROCESS is available
Patch61: kvm-seccomp-fix-killing-of-whole-process-instead-of-thre.patch
# For bz#1867075 - CVE-2020-10756 virt:8.3/qemu-kvm: QEMU: slirp: networking out-of-bounds read information disclosure vulnerability [rhel-av-8]
Patch62: kvm-Revert-Drop-bogus-IPv6-messages.patch
# For bz#1821528 - missing namespace attribute when access the rbd image with namespace
Patch63: kvm-block-rbd-add-namespace-to-qemu_rbd_strong_runtime_o.patch
# For bz#1688978 - RFE: forward host preferences for cipher suites and CA certs to guest firmware
Patch64: kvm-hw-nvram-fw_cfg-fix-FWCfgDataGeneratorClass-get_data.patch
# For bz#1877209 - 'qemu-img bitmaps --merge' failed when trying to merge top volume bitmap to base volume bitmap
Patch65: kvm-qemu-img-Support-bitmap-merge-into-backing-image.patch
# For bz#1874004 - Live migration performance is poor during guest installation process on power host
Patch66: kvm-migration-increase-max-bandwidth-to-128-MiB-s-1-Gib-.patch
# For bz#1868449 - vhost_vsock error: device is modern-only, use disable-legacy=on
Patch67: kvm-virtio-skip-legacy-support-check-on-machine-types-le.patch
# For bz#1868449 - vhost_vsock error: device is modern-only, use disable-legacy=on
Patch68: kvm-vhost-vsock-pci-force-virtio-version-1.patch
# For bz#1868449 - vhost_vsock error: device is modern-only, use disable-legacy=on
Patch69: kvm-vhost-user-vsock-pci-force-virtio-version-1.patch
# For bz#1868449 - vhost_vsock error: device is modern-only, use disable-legacy=on
Patch70: kvm-vhost-vsock-ccw-force-virtio-version-1.patch
# For bz#1846886 - Guest hit soft lockup or reboots if hotplug vcpu under ovmf
Patch71: kvm-x86-lpc9-let-firmware-negotiate-CPU-hotplug-with-SMI.patch
# For bz#1846886 - Guest hit soft lockup or reboots if hotplug vcpu under ovmf
Patch72: kvm-x86-cpuhp-prevent-guest-crash-on-CPU-hotplug-when-br.patch
# For bz#1846886 - Guest hit soft lockup or reboots if hotplug vcpu under ovmf
Patch73: kvm-x86-cpuhp-refuse-cpu-hot-unplug-request-earlier-if-n.patch
Patch0016: 0016-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch
Patch0017: 0017-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch
Patch0018: 0018-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch
Patch0019: 0019-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch
Patch0020: 0020-Upstream.patch
Patch0021: 0021-RHEL-9-test.patch
BuildRequires: wget
BuildRequires: rpm-build
BuildRequires: ninja-build
BuildRequires: meson
BuildRequires: zlib-devel
BuildRequires: glib2-devel
BuildRequires: which
@ -323,7 +233,6 @@ Requires: mesa-dri-drivers
BuildRequires: perl-Test-Harness
Requires: qemu-kvm-core = %{epoch}:%{version}-%{release}
%rhev_ma_conflicts qemu-kvm
%{requires_all_modules}
@ -374,7 +283,6 @@ Requires: usbredir >= 0.7.1
Requires: libfdt >= 1.6.0
%endif
%rhev_ma_conflicts qemu-kvm
%description -n qemu-kvm-core
qemu-kvm is an open source virtualizer that provides hardware
@ -387,7 +295,6 @@ hardware for a full system such as a PC and its associated peripherals.
Summary: QEMU command line tool for manipulating disk images
Group: Development/Tools
%rhev_ma_conflicts qemu-img
%description -n qemu-img
This package provides a command line tool for manipulating disk images.
@ -402,7 +309,6 @@ Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%rhev_ma_conflicts qemu-kvm-common
%description -n qemu-kvm-common
qemu-kvm is an open source virtualizer that provides hardware emulation for
@ -518,15 +424,16 @@ cd qemu-kvm-build
../configure \
--prefix="%{_prefix}" \
--libdir="%{_libdir}" \
--datadir="%{_datadir}" \
--sysconfdir="%{_sysconfdir}" \
--interp-prefix=%{_prefix}/qemu-%M \
--localstatedir="%{_localstatedir}" \
--docdir="%{qemudocdir}" \
--docdir="%{_docdir}" \
--libexecdir="%{_libexecdir}" \
--extra-ldflags="-Wl,--build-id -Wl,-z,relro -Wl,-z,now" \
--extra-cflags="%{optflags}" \
--with-pkgversion="%{name}-%{version}-%{release}" \
--with-confsuffix=/"%{name}" \
--with-suffix="%{name}" \
--firmwarepath=%{_prefix}/share/qemu-firmware \
--python=%{__python3} \
--target-list="%{buildarch}" \
@ -694,15 +601,15 @@ make V=1 %{?_smp_mflags} $buildldflags
# Setup back compat qemu-kvm binary
%{__python3} scripts/tracetool.py --backend dtrace --format stap \
--group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \
trace-events-all > qemu-kvm.stp
trace/trace-events-all > qemu-kvm.stp
%{__python3} scripts/tracetool.py --backends=dtrace --format=log-stap \
--group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \
trace-events-all > qemu-kvm-log.stp
trace/trace-events-all > qemu-kvm-log.stp
%{__python3} scripts/tracetool.py --backend dtrace --format simpletrace-stap \
--group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \
trace-events-all > qemu-kvm-simpletrace.stp
trace/trace-events-all > qemu-kvm-simpletrace.stp
cp -a %{kvm_target}-softmmu/qemu-system-%{kvm_target} qemu-kvm
@ -759,7 +666,7 @@ install -p -m 0755 ../tests/Makefile.include $RPM_BUILD_ROOT%{testsdir}/tests/
# Install qemu-iotests
cp -R ../tests/qemu-iotests/* $RPM_BUILD_ROOT%{testsdir}/tests/qemu-iotests/
cp -u tests/qemu-iotests/* $RPM_BUILD_ROOT%{testsdir}/tests/qemu-iotests/
cp -ur tests/qemu-iotests/* $RPM_BUILD_ROOT%{testsdir}/tests/qemu-iotests/
# Avoid ambiguous 'python' interpreter name
find $RPM_BUILD_ROOT%{testsdir}/tests/qemu-iotests/* -maxdepth 1 -type f -exec sed -i -e '1 s+/usr/bin/env \(python\|python3\)+%{__python3}+' {} \;
find $RPM_BUILD_ROOT%{testsdir}/scripts/qmp/* -maxdepth 1 -type f -exec sed -i -e '1 s+/usr/bin/env \(python\|python3\)+%{__python3}+' {} \;
@ -802,14 +709,18 @@ install --preserve-timestamps --mode=0644 \
mkdir -p -v $RPM_BUILD_ROOT%{_localstatedir}/log/qemu-ga/
mkdir -p $RPM_BUILD_ROOT%{_bindir}
install -c -m 0755 qemu-ga ${RPM_BUILD_ROOT}%{_bindir}/qemu-ga
install -c -m 0755 qga/qemu-ga ${RPM_BUILD_ROOT}%{_bindir}/qemu-ga
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
install -m 0755 qemu-kvm $RPM_BUILD_ROOT%{_libexecdir}/
install -m 0755 %{kvm_target}-softmmu/qemu-system-%{kvm_target} $RPM_BUILD_ROOT%{_libexecdir}/qemu-kvm
install -m 0644 qemu-kvm.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/
install -m 0644 qemu-kvm-log.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/
install -m 0644 qemu-kvm-simpletrace.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/
install -d -m 0755 "$RPM_BUILD_ROOT%{_datadir}/%{name}/systemtap/script.d"
install -c -m 0644 scripts/systemtap/script.d/qemu_kvm.stp "$RPM_BUILD_ROOT%{_datadir}/%{name}/systemtap/script.d/"
install -d -m 0755 "$RPM_BUILD_ROOT%{_datadir}/%{name}/systemtap/conf.d"
install -c -m 0644 scripts/systemtap/conf.d/qemu_kvm.conf "$RPM_BUILD_ROOT%{_datadir}/%{name}/systemtap/conf.d/"
rm $RPM_BUILD_ROOT/%{_datadir}/applications/qemu.desktop
rm $RPM_BUILD_ROOT%{_bindir}/qemu-system-%{kvm_target}
@ -829,12 +740,27 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/tracetool/format
install -m 0644 -t $RPM_BUILD_ROOT%{_datadir}/%{name}/tracetool/format scripts/tracetool/format/*.py
mkdir -p $RPM_BUILD_ROOT%{qemudocdir}
install -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} ../Changelog ../README.rst ../README.systemtap ../COPYING ../COPYING.LIB ../LICENSE ../docs/interop/qmp-spec.txt
install -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} ../README.rst ../README.systemtap ../COPYING ../COPYING.LIB ../LICENSE ../docs/interop/qmp-spec.txt
# Rename man page
pushd ${RPM_BUILD_ROOT}%{_mandir}/man1/
for fn in qemu.1*; do
mv $fn "qemu-kvm${fn#qemu}"
done
popd
chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man1/*
chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man8/*
install -D -p -m 0644 ../qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl2/%{name}.conf
# Install keymaps
pushd pc-bios/keymaps
for kmp in *; do
install $kmp ${RPM_BUILD_ROOT}%{_datadir}/%{name}/keymaps/
done
rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/keymaps/*.stamp
popd
# Provided by package openbios
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/openbios-ppc
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/openbios-sparc32
@ -851,6 +777,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-zipl.rom
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/u-boot.e500
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/qemu_vga.ndrv
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/skiboot.lid
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/qboot.rom
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-ccw.img
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/hppa-firmware.img
@ -863,9 +790,12 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/edk2-licenses.txt
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/opensbi-riscv32-sifive_u-fw_jump.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/opensbi-riscv32-virt-fw_jump.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/opensbi-riscv32-generic-fw_dynamic.*
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/opensbi-riscv64-sifive_u-fw_jump.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/opensbi-riscv64-virt-fw_jump.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/opensbi-riscv64-generic-fw_dynamic.*
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/qemu-nsis.bmp
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/npcm7xx_bootrom.bin
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/qemu-kvm/ui-spice-app.so
@ -974,9 +904,6 @@ rm -rf $RPM_BUILD_ROOT%{qemudocdir}/user/.buildinfo
# Remove spec
rm -rf $RPM_BUILD_ROOT%{qemudocdir}/specs
# Hack to keep qemu-pr-helper in original location
mv $RPM_BUILD_ROOT%{_libexecdir}/qemu-pr-helper $RPM_BUILD_ROOT%{_bindir}/qemu-pr-helper
%check
cd qemu-kvm-build
export DIFF=diff; make check V=1
@ -1025,7 +952,6 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%files -n qemu-kvm-common
%defattr(-,root,root)
%dir %{qemudocdir}
%doc %{qemudocdir}/Changelog
%doc %{qemudocdir}/README.rst
%doc %{qemudocdir}/COPYING
%doc %{qemudocdir}/COPYING.LIB
@ -1083,6 +1009,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%{_datadir}/%{name}/kvmvapic.bin
%{_datadir}/%{name}/sgabios.bin
%{_datadir}/%{name}/pvh.bin
%{_libdir}/qemu-kvm/ui-egl-headless.so
%endif
%ifarch s390x
%{_datadir}/%{name}/s390-ccw.img
@ -1103,6 +1030,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%{_datadir}/%{name}/efi-pcnet.rom
%{_datadir}/%{name}/efi-rtl8139.rom
%{_datadir}/%{name}/efi-ne2k_pci.rom
%{_libdir}/qemu-kvm/hw-display-virtio-vga.so
%endif
%{_datadir}/icons/*
%{_datadir}/%{name}/linuxboot_dma.bin
@ -1129,10 +1057,20 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%endif
%if 0%{have_spice}
%{_libdir}/qemu-kvm/hw-usb-smartcard.so
%{_libdir}/qemu-kvm/audio-spice.so
%{_libdir}/qemu-kvm/ui-spice-core.so
%{_libdir}/qemu-kvm/chardev-spice.so
%endif
%ifarch x86_64
%{_libdir}/qemu-kvm/hw-display-qxl.so
%endif
%{_libdir}/qemu-kvm/hw-display-virtio-gpu.so
%ifnarch s390x
%{_libdir}/qemu-kvm/hw-display-virtio-gpu-pci.so
%endif
%if 0%{have_opengl}
%{_libdir}/qemu-kvm/ui-opengl.so
%endif
%files -n qemu-img
%defattr(-,root,root)
@ -1177,6 +1115,11 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%changelog
* Tue Oct 13 2020 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 5.1.0-14.el8_3
- kvm-virtiofsd-avoid-proc-self-fd-tempdir.patch [bz#1884276]
- Resolves: bz#1884276
(Pod with kata-runtime won't start, QEMU: "vhost_user_dev init failed, Operation not permitted" [mkdtemp failing in sandboxing])
* Thu Oct 08 2020 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 5.1.0-13.el8_3
- kvm-x86-lpc9-let-firmware-negotiate-CPU-hotplug-with-SMI.patch [bz#1846886]
- kvm-x86-cpuhp-prevent-guest-crash-on-CPU-hotplug-when-br.patch [bz#1846886]

View File

@ -1 +1 @@
SHA512 (qemu-5.1.0.tar.xz) = e213edb71d93d5167ddce7546220ecb7b52a7778586a4f476f65bd1e510c9cfc6d1876238a7b501d9cc3fd31cc2ae4b7fb9e753bc3f12cc17cd16dfce2a96ba3
SHA512 (qemu-5.2.0-rc1.tar.xz) = 5345c9e8811efe2c1bab92ecb846f267dc6ef2a67ac03a39547344dc810a13027ef7352c7209d528ec81108dbc1e5e9ca96da6f7306c682ad8f785f596fa4dde