qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02
@ 2024-02-28 20:35 Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 33/47] meson: ensure dbus-display generated code is built before other units Michael Tokarev
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Michael Tokarev

The following patches are queued for QEMU stable v7.2.10:

  https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2

Patch freeze is 2024-03-02, and the release is planned for 2024-03-04:

  https://wiki.qemu.org/Planning/7.2

Please respond here or CC qemu-stable@nongnu.org on any additional patches
you think should (or shouldn't) be included in the release.

The changes which are staging for inclusion, with the original commit hash
from master branch, are given below the bottom line.

Thanks!

/mjt

--------------------------------------
01* 27eb8499edb2 Fabiano Rosas:
   migration: Fix use-after-free of migration state object
02* db101376af52 Yihuan Pan:
   qemu-docs: Update options for graphical frontends
03* 615eaeab3d31 Richard W.M. Jones:
   block/blkio: Make s->mem_region_alignment be 64 bits
04* f670be1aad33 Jan Klötzke:
   target/arm: fix exception syndrome for AArch32 bkpt insn
05* d2019a9d0c34 Peter Maydell:
   system/vl.c: Fix handling of '-serial none -serial something'
06* 747bfaf3a9d2 Peter Maydell:
   qemu-options.hx: Improve -serial option documentation
07* 8a7315202033 Guenter Roeck:
   pci-host: designware: Limit value range of iATU viewport register
08* cd8a35b913c2 Akihiko Odaki:
   hw/smbios: Fix OEM strings table option validation
09* 196578c9d051 Akihiko Odaki:
   hw/smbios: Fix port connector option validation
10* aa05bd9ef407 Andrey Ignatov:
   vhost-user.rst: Fix vring address description
11* c62926f730d0 Ira Weiny:
   cxl/cdat: Handle cdat table build errors
12* 64fdad5e6758 Ira Weiny:
   cxl/cdat: Fix header sum value in CDAT checksum
13* 729d45a6af06 Li Zhijian:
   hw/cxl: Pass CXLComponentState to cache_mem_ops
14* 9a457383ce9d Zhenzhong Duan:
   virtio_iommu: Clear IOMMUPciBus pointer cache when system reset
15* 8a6b3f4dc95a Zhenzhong Duan:
   smmu: Clear SMMUPciBus pointer cache when system reset
16* 14ec4ff3e429 Jonathan Cameron:
   tests/acpi: Allow update of DSDT.cxl
17* d9ae5802f656 Jonathan Cameron:
   hw/i386: Fix _STA return value for ACPI0017
18* b24a981b9f1c Jonathan Cameron:
   tests/acpi: Update DSDT.cxl to reflect change _STA return value.
19* 681dfc0d5529 Richard Henderson:
   linux-user/aarch64: Choose SYNC as the preferred MTE mode
20* 64c6e7444dff Richard Henderson:
   target/arm: Fix nregs computation in do_{ld,st}_zpa
21* 855f94eca80c Richard Henderson:
   target/arm: Fix SVE/SME gross MTE suppression checks
22* ac1d88e9e7ca Peter Maydell:
   target/arm: Don't get MDCR_EL2 in pmu_counter_enabled() before checking 
   ARM_FEATURE_PMU
23* cc29c12ec629 Kevin Wolf:
   iotests: Make 144 deterministic again
24* 81f5cad3858f Xiaoyao Li:
   i386/cpu: Clear FEAT_XSAVE_XSS_LO/HI leafs when CPUID_EXT_XSAVE is not 
   available
25* a11a365159b9 Xiaoyao Li:
   i386/cpu: Mask with XCR0/XSS mask for FEAT_XSAVE_XCR0_HI and 
   FEAT_XSAVE_XSS_HI leafs
26* 10f92799af8b Xiaoyao Li:
   i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F
27* 0729857c7075 Xiaoyao Li:
   i386/cpuid: Move leaf 7 to correct group
28* 99d0dcd7f102 Ziqiao Kong:
   target/i386: Generate an illegal opcode exception on cmp instructions 
   with lock prefix
29* 4cba8388968b Daniel P. Berrangé:
   ui: reject extended clipboard message if not activated
30* 405484b29f65 Fiona Ebner:
   ui/clipboard: mark type as not available when there is no data
31* 9c416582611b Fiona Ebner:
   ui/clipboard: add asserts for update and request
32* 95b08fee8f68 Tianlan Zhou:
   ui/console: Fix console resize with placeholder surface
33 1222070e7728 Marc-André Lureau:
   meson: ensure dbus-display generated code is built before other units
34* d67611907590 Akihiko Odaki:
   audio: Depend on dbus_display1_dep
35 4a20ac400ff0 Tianlan Zhou:
   docs/system: Update description for input grab key
36 185311130f54 Tianlan Zhou:
   system/vl: Update description for input grab key
37 5cd3ae4903e3 Peter Maydell:
   .gitlab-ci.d/windows.yml: Drop msys2-32bit job
38 2cc0e449d173 Nicholas Piggin:
   target/ppc: Fix lxv/stxv MSR facility check
39 d2b5bb860e6c Klaus Jensen:
   hw/nvme: fix invalid endian conversion
40 4d28d57c9f2e Jessica Clarke:
   pl031: Update last RTCLR value on write in case it's read back
41 68fb78d7d572 Paolo Bonzini:
   target/i386: mask high bits of CR3 in 32-bit mode
42 d09c79010ffd Paolo Bonzini:
   target/i386: check validity of VMCB addresses
43 b1661801c184 Paolo Bonzini:
   target/i386: Fix physical address truncation
44 a28fe7dc1939 Paolo Bonzini:
   target/i386: remove unnecessary/wrong application of the A20 mask
45 b5a9de3259f4 Paolo Bonzini:
   target/i386: leave the A20 bit set in the final NPT walk
46 8467ac75b3b7 Alex Bennée:
   tests/vm: update openbsd image to 7.4
47 151b7dba391f Alex Bennée:
   tests/vm: avoid re-building the VM images all the time

(commit(s) marked with * were in previous series and are not resent)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 33/47] meson: ensure dbus-display generated code is built before other units
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 35/47] docs/system: Update description for input grab key Michael Tokarev
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Marc-André Lureau, Daniel P . Berrangé,
	Michael Tokarev

From: Marc-André Lureau <marcandre.lureau@redhat.com>

It's simply by luck that dbus-display header is built first before the
other units using it.

With sourceset, I can't find an easier way out than declaring an extra
dependency for dbus-display1 generate code.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 1222070e772833c6875e0ca63565db12c22df39e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/ui/meson.build b/ui/meson.build
index c1b137bf33..76c6644b3f 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -81,7 +81,9 @@ if dbus_display
                                           '--interface-prefix', 'org.qemu.',
                                           '--c-namespace', 'QemuDBus',
                                           '--generate-c-code', '@BASENAME@'])
-  dbus_ss.add(when: [gio, pixman, opengl, gbm],
+  dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio)
+  dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.'))
+  dbus_ss.add(when: [gio, pixman, opengl, gbm, dbus_display1_dep],
               if_true: [files(
                 'dbus-chardev.c',
                 'dbus-clipboard.c',
@@ -89,7 +91,7 @@ if dbus_display
                 'dbus-error.c',
                 'dbus-listener.c',
                 'dbus.c',
-              ), dbus_display1])
+              )])
   ui_modules += {'dbus' : dbus_ss}
 endif
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 35/47] docs/system: Update description for input grab key
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 33/47] meson: ensure dbus-display generated code is built before other units Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 36/47] system/vl: " Michael Tokarev
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Tianlan Zhou, Thomas Huth, Michael Tokarev

From: Tianlan Zhou <bobby825@126.com>

Input grab key should be Ctrl-Alt-g, not just Ctrl-Alt.

Fixes: f8d2c9369b ("sdl: use ctrl-alt-g as grab hotkey")
Signed-off-by: Tianlan Zhou <bobby825@126.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 4a20ac400ff0753f159071764826b20e5320cde9)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/docs/system/keys.rst.inc b/docs/system/keys.rst.inc
index 2e2c97aa23..59966a3fe7 100644
--- a/docs/system/keys.rst.inc
+++ b/docs/system/keys.rst.inc
@@ -29,7 +29,7 @@ Ctrl-Alt-n
    *3*
       Serial port
 
-Ctrl-Alt
+Ctrl-Alt-g
    Toggle mouse and keyboard grab.
 
 In the virtual consoles, you can use Ctrl-Up, Ctrl-Down, Ctrl-PageUp and
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 36/47] system/vl: Update description for input grab key
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 33/47] meson: ensure dbus-display generated code is built before other units Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 35/47] docs/system: Update description for input grab key Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 37/47] .gitlab-ci.d/windows.yml: Drop msys2-32bit job Michael Tokarev
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Tianlan Zhou, Thomas Huth, Michael Tokarev

From: Tianlan Zhou <bobby825@126.com>

Input grab key should be Ctrl-Alt-g, not just Ctrl-Alt.

Fixes: f8d2c9369b ("sdl: use ctrl-alt-g as grab hotkey")
Signed-off-by: Tianlan Zhou <bobby825@126.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 185311130f54ead75c407cdf83004d575829b5d2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/softmmu/vl.c b/softmmu/vl.c
index ab4394c53d..38d76d6e51 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -856,7 +856,7 @@ static void help(int exitcode)
     printf("\nDuring emulation, the following keys are useful:\n"
            "ctrl-alt-f      toggle full screen\n"
            "ctrl-alt-n      switch to virtual console 'n'\n"
-           "ctrl-alt        toggle mouse and keyboard grab\n"
+           "ctrl-alt-g      toggle mouse and keyboard grab\n"
            "\n"
            "When using -nographic, press 'ctrl-a h' to get some help.\n"
            "\n"
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 37/47] .gitlab-ci.d/windows.yml: Drop msys2-32bit job
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (2 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 36/47] system/vl: " Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 38/47] target/ppc: Fix lxv/stxv MSR facility check Michael Tokarev
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Peter Maydell, Daniel P . Berrangé, Thomas Huth,
	Alex Bennée, Michael Tokarev

From: Peter Maydell <peter.maydell@linaro.org>

MSYS2 is dropping support for 32-bit Windows.  This shows up for us
as various packages we were using in our CI job no longer being
available to install, which causes the job to fail.  In commit
8e31b744fdf we dropped the dependency on libusb and spice, but the
dtc package has also now been removed.

For us as QEMU upstream, "32 bit x86 hosts for system emulation" have
already been deprecated as of QEMU 8.0, so we are ready to drop them
anyway.

Drop the msys2-32bit CI job, as the first step in doing this.

This is cc'd to stable, because this job will also be broken for CI
on the stable branches.  We can't drop 32-bit support entirely there,
but we will still be covering at least compilation for 32-bit Windows
via the cross-win32-system job.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20240220165602.135695-1-peter.maydell@linaro.org
(cherry picked from commit 5cd3ae4903e33982e7a9bbd04674af517e796d6e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: in 7.2 the piece being removed is different but the job has to go anyway)

diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml
index a3e7a37022..0180261b7f 100644
--- a/.gitlab-ci.d/windows.yml
+++ b/.gitlab-ci.d/windows.yml
@@ -63,37 +63,3 @@ msys2-64bit:
       --enable-capstone --without-default-devices'
   - .\msys64\usr\bin\bash -lc 'make'
   - .\msys64\usr\bin\bash -lc 'make check || { cat build/meson-logs/testlog.txt; exit 1; } ;'
-
-msys2-32bit:
-  extends: .shared_msys2_builder
-  script:
-  - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed
-      bison diffutils flex
-      git grep make sed
-      mingw-w64-i686-capstone
-      mingw-w64-i686-curl
-      mingw-w64-i686-cyrus-sasl
-      mingw-w64-i686-gcc
-      mingw-w64-i686-glib2
-      mingw-w64-i686-gnutls
-      mingw-w64-i686-gtk3
-      mingw-w64-i686-libgcrypt
-      mingw-w64-i686-libjpeg-turbo
-      mingw-w64-i686-libssh
-      mingw-w64-i686-libtasn1
-      mingw-w64-i686-libusb
-      mingw-w64-i686-lzo2
-      mingw-w64-i686-ninja
-      mingw-w64-i686-pixman
-      mingw-w64-i686-pkgconf
-      mingw-w64-i686-python
-      mingw-w64-i686-snappy
-      mingw-w64-i686-usbredir "
-  - $env:CHERE_INVOKING = 'yes'  # Preserve the current working directory
-  - $env:MSYSTEM = 'MINGW32'     # Start a 32-bit MinG environment
-  - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
-  - mkdir output
-  - cd output
-  - ..\msys64\usr\bin\bash -lc "../configure --target-list=ppc64-softmmu"
-  - ..\msys64\usr\bin\bash -lc 'make'
-  - ..\msys64\usr\bin\bash -lc 'make check || { cat meson-logs/testlog.txt; exit 1; } ;'
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 38/47] target/ppc: Fix lxv/stxv MSR facility check
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (3 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 37/47] .gitlab-ci.d/windows.yml: Drop msys2-32bit job Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 39/47] hw/nvme: fix invalid endian conversion Michael Tokarev
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Nicholas Piggin, Joel Stanley, Harsh Prateek Bora,
	Cédric Le Goater, Michael Tokarev

From: Nicholas Piggin <npiggin@gmail.com>

The move to decodetree flipped the inequality test for the VEC / VSX
MSR facility check.

This caused application crashes under Linux, where these facility
unavailable interrupts are used for lazy-switching of VEC/VSX register
sets. Getting the incorrect interrupt would result in wrong registers
being loaded, potentially overwriting live values and/or exposing
stale ones.

Cc: qemu-stable@nongnu.org
Reported-by: Joel Stanley <joel@jms.id.au>
Fixes: 70426b5bb738 ("target/ppc: moved stxvx and lxvx from legacy to decodtree")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1769
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Tested-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

(cherry picked from commit 2cc0e449d17310877fb28a942d4627ad22bb68ea)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
index 4deb29ee42..de1709809d 100644
--- a/target/ppc/translate/vsx-impl.c.inc
+++ b/target/ppc/translate/vsx-impl.c.inc
@@ -2518,7 +2518,7 @@ static bool do_lstxv(DisasContext *ctx, int ra, TCGv displ,
 
 static bool do_lstxv_D(DisasContext *ctx, arg_D *a, bool store, bool paired)
 {
-    if (paired || a->rt >= 32) {
+    if (paired || a->rt < 32) {
         REQUIRE_VSX(ctx);
     } else {
         REQUIRE_VECTOR(ctx);
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 39/47] hw/nvme: fix invalid endian conversion
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (4 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 38/47] target/ppc: Fix lxv/stxv MSR facility check Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 40/47] pl031: Update last RTCLR value on write in case it's read back Michael Tokarev
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Klaus Jensen, Kevin Wolf, Minwoo Im,
	Philippe Mathieu-Daudé, Michael Tokarev

From: Klaus Jensen <k.jensen@samsung.com>

numcntl is one byte and so is max_vfs. Using cpu_to_le16 on big endian
hosts results in numcntl being set to 0.

Fix by dropping the endian conversion.

Fixes: 99f48ae7ae ("hw/nvme: Add support for Secondary Controller List")
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
Message-ID: <20240222-fix-sriov-numcntl-v1-1-d60bea5e72d0@samsung.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit d2b5bb860e6c17442ad95cc275feb07c1665be5c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 4d29033556..a87f79296c 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -7140,7 +7140,7 @@ static void nvme_init_state(NvmeCtrl *n)
     n->aer_reqs = g_new0(NvmeRequest *, n->params.aerl + 1);
     QTAILQ_INIT(&n->aer_queue);
 
-    list->numcntl = cpu_to_le16(max_vfs);
+    list->numcntl = max_vfs;
     for (i = 0; i < max_vfs; i++) {
         sctrl = &list->sec[i];
         sctrl->pcid = cpu_to_le16(n->cntlid);
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 40/47] pl031: Update last RTCLR value on write in case it's read back
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (5 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 39/47] hw/nvme: fix invalid endian conversion Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 41/47] target/i386: mask high bits of CR3 in 32-bit mode Michael Tokarev
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Jessica Clarke, Alex Bennée, Peter Maydell,
	Michael Tokarev

From: Jessica Clarke <jrtc27@jrtc27.com>

The PL031 allows you to read RTCLR, which is meant to give you the last
value written. PL031State has an lr field which is used when reading
from RTCLR, and is present in the VM migration state, but we never
actually update it, so it always reads as its initial 0 value.

Cc: qemu-stable@nongnu.org
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20240222000341.1562443-1-jrtc27@jrtc27.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 4d28d57c9f2eb1cdf70b29cea6e50282e010075b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c
index b01d0e75d1..2f3cd04eeb 100644
--- a/hw/rtc/pl031.c
+++ b/hw/rtc/pl031.c
@@ -141,6 +141,7 @@ static void pl031_write(void * opaque, hwaddr offset,
         g_autofree const char *qom_path = object_get_canonical_path(opaque);
         struct tm tm;
 
+        s->lr = value;
         s->tick_offset += value - pl031_get_count(s);
 
         qemu_get_timedate(&tm, s->tick_offset);
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 41/47] target/i386: mask high bits of CR3 in 32-bit mode
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (6 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 40/47] pl031: Update last RTCLR value on write in case it's read back Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 42/47] target/i386: check validity of VMCB addresses Michael Tokarev
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Richard Henderson, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

CR3 bits 63:32 are ignored in 32-bit mode (either legacy 2-level
paging or PAE paging).  Do this in mmu_translate() to remove
the last where get_physical_address() meaningfully drops the high
bits of the address.

Cc: qemu-stable@nongnu.org
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Fixes: 4a1e9d4d11c ("target/i386: Use atomic operations for pte updates", 2022-10-18)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 68fb78d7d5723066ec2cacee7d25d67a4143b42f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
index 55bd1194d3..c253226b3c 100644
--- a/target/i386/tcg/sysemu/excp_helper.c
+++ b/target/i386/tcg/sysemu/excp_helper.c
@@ -236,7 +236,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
             /*
              * Page table level 3
              */
-            pte_addr = ((in->cr3 & ~0x1f) + ((addr >> 27) & 0x18)) & a20_mask;
+            pte_addr = ((in->cr3 & 0xffffffe0ULL) + ((addr >> 27) & 0x18)) & a20_mask;
             if (!ptw_translate(&pte_trans, pte_addr)) {
                 return false;
             }
@@ -304,7 +304,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
         /*
          * Page table level 2
          */
-        pte_addr = ((in->cr3 & ~0xfff) + ((addr >> 20) & 0xffc)) & a20_mask;
+        pte_addr = ((in->cr3 & 0xfffff000ULL) + ((addr >> 20) & 0xffc)) & a20_mask;
         if (!ptw_translate(&pte_trans, pte_addr)) {
             return false;
         }
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 42/47] target/i386: check validity of VMCB addresses
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (7 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 41/47] target/i386: mask high bits of CR3 in 32-bit mode Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 43/47] target/i386: Fix physical address truncation Michael Tokarev
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

MSR_VM_HSAVE_PA bits 0-11 are reserved, as are the bits above the
maximum physical address width of the processor.  Setting them to
1 causes a #GP (see "15.30.4 VM_HSAVE_PA MSR" in the AMD manual).

The same is true of VMCB addresses passed to VMRUN/VMLOAD/VMSAVE,
even though the manual is not clear on that.

Cc: qemu-stable@nongnu.org
Fixes: 4a1e9d4d11c ("target/i386: Use atomic operations for pte updates", 2022-10-18)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit d09c79010ffd880dc69e7a21e3cfdef90b928fb8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/sysemu/misc_helper.c b/target/i386/tcg/sysemu/misc_helper.c
index e1528b7f80..1901712ece 100644
--- a/target/i386/tcg/sysemu/misc_helper.c
+++ b/target/i386/tcg/sysemu/misc_helper.c
@@ -201,6 +201,9 @@ void helper_wrmsr(CPUX86State *env)
         tlb_flush(cs);
         break;
     case MSR_VM_HSAVE_PA:
+        if (val & (0xfff | ((~0ULL) << env_archcpu(env)->phys_bits))) {
+            goto error;
+        }
         env->vm_hsave = val;
         break;
 #ifdef TARGET_X86_64
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index 2d27731b60..744aed4b31 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -164,14 +164,19 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
     uint64_t new_cr3;
     uint64_t new_cr4;
 
-    cpu_svm_check_intercept_param(env, SVM_EXIT_VMRUN, 0, GETPC());
-
     if (aflag == 2) {
         addr = env->regs[R_EAX];
     } else {
         addr = (uint32_t)env->regs[R_EAX];
     }
 
+    /* Exceptions are checked before the intercept.  */
+    if (addr & (0xfff | ((~0ULL) << env_archcpu(env)->phys_bits))) {
+        raise_exception_err_ra(env, EXCP0D_GPF, 0, GETPC());
+    }
+
+    cpu_svm_check_intercept_param(env, SVM_EXIT_VMRUN, 0, GETPC());
+
     qemu_log_mask(CPU_LOG_TB_IN_ASM, "vmrun! " TARGET_FMT_lx "\n", addr);
 
     env->vm_vmcb = addr;
@@ -465,14 +470,19 @@ void helper_vmload(CPUX86State *env, int aflag)
     int mmu_idx = MMU_PHYS_IDX;
     target_ulong addr;
 
-    cpu_svm_check_intercept_param(env, SVM_EXIT_VMLOAD, 0, GETPC());
-
     if (aflag == 2) {
         addr = env->regs[R_EAX];
     } else {
         addr = (uint32_t)env->regs[R_EAX];
     }
 
+    /* Exceptions are checked before the intercept.  */
+    if (addr & (0xfff | ((~0ULL) << env_archcpu(env)->phys_bits))) {
+        raise_exception_err_ra(env, EXCP0D_GPF, 0, GETPC());
+    }
+
+    cpu_svm_check_intercept_param(env, SVM_EXIT_VMLOAD, 0, GETPC());
+
     if (virtual_vm_load_save_enabled(env, SVM_EXIT_VMLOAD, GETPC())) {
         mmu_idx = MMU_NESTED_IDX;
     }
@@ -521,14 +531,19 @@ void helper_vmsave(CPUX86State *env, int aflag)
     int mmu_idx = MMU_PHYS_IDX;
     target_ulong addr;
 
-    cpu_svm_check_intercept_param(env, SVM_EXIT_VMSAVE, 0, GETPC());
-
     if (aflag == 2) {
         addr = env->regs[R_EAX];
     } else {
         addr = (uint32_t)env->regs[R_EAX];
     }
 
+    /* Exceptions are checked before the intercept.  */
+    if (addr & (0xfff | ((~0ULL) << env_archcpu(env)->phys_bits))) {
+        raise_exception_err_ra(env, EXCP0D_GPF, 0, GETPC());
+    }
+
+    cpu_svm_check_intercept_param(env, SVM_EXIT_VMSAVE, 0, GETPC());
+
     if (virtual_vm_load_save_enabled(env, SVM_EXIT_VMSAVE, GETPC())) {
         mmu_idx = MMU_NESTED_IDX;
     }
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 43/47] target/i386: Fix physical address truncation
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (8 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 42/47] target/i386: check validity of VMCB addresses Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 44/47] target/i386: remove unnecessary/wrong application of the A20 mask Michael Tokarev
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Michael Brown, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

The address translation logic in get_physical_address() will currently
truncate physical addresses to 32 bits unless long mode is enabled.
This is incorrect when using physical address extensions (PAE) outside
of long mode, with the result that a 32-bit operating system using PAE
to access memory above 4G will experience undefined behaviour.

The truncation code was originally introduced in commit 33dfdb5 ("x86:
only allow real mode to access 32bit without LMA"), where it applied
only to translations performed while paging is disabled (and so cannot
affect guests using PAE).

Commit 9828198 ("target/i386: Add MMU_PHYS_IDX and MMU_NESTED_IDX")
rearranged the code such that the truncation also applied to the use
of MMU_PHYS_IDX and MMU_NESTED_IDX.  Commit 4a1e9d4 ("target/i386: Use
atomic operations for pte updates") brought this truncation into scope
for page table entry accesses, and is the first commit for which a
Windows 10 32-bit guest will reliably fail to boot if memory above 4G
is present.

The truncation code however is not completely redundant.  Even though the
maximum address size for any executed instruction is 32 bits, helpers for
operations such as BOUND, FSAVE or XSAVE may ask get_physical_address()
to translate an address outside of the 32-bit range, if invoked with an
argument that is close to the 4G boundary.  Likewise for processor
accesses, for example TSS or IDT accesses, when EFER.LMA==0.

So, move the address truncation in get_physical_address() so that it
applies to 32-bit MMU indexes, but not to MMU_PHYS_IDX and MMU_NESTED_IDX.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2040
Fixes: 4a1e9d4d11c ("target/i386: Use atomic operations for pte updates", 2022-10-18)
Cc: qemu-stable@nongnu.org
Co-developed-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit b1661801c184119a10ad6cbc3b80330fc22e7b2c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: drop unrelated change in target/i386/cpu.c)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index f67cee477a..7be047ce33 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2195,6 +2195,12 @@ static inline int cpu_mmu_index(CPUX86State *env, bool ifetch)
         ? MMU_KNOSMAP_IDX : MMU_KSMAP_IDX;
 }
 
+static inline bool is_mmu_index_32(int mmu_index)
+{
+    assert(mmu_index < MMU_PHYS_IDX);
+    return mmu_index & 1;
+}
+
 static inline int cpu_mmu_index_kernel(CPUX86State *env)
 {
     return !(env->hflags & HF_SMAP_MASK) ? MMU_KNOSMAP_IDX :
diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
index c253226b3c..389a0d6912 100644
--- a/target/i386/tcg/sysemu/excp_helper.c
+++ b/target/i386/tcg/sysemu/excp_helper.c
@@ -556,6 +556,10 @@ static bool get_physical_address(CPUX86State *env, vaddr addr,
         break;
 
     default:
+        if (is_mmu_index_32(mmu_idx)) {
+            addr = (uint32_t)addr;
+        }
+
         if (likely(env->cr[0] & CR0_PG_MASK)) {
             in.cr3 = env->cr[3];
             in.mmu_idx = mmu_idx;
@@ -579,14 +583,8 @@ static bool get_physical_address(CPUX86State *env, vaddr addr,
         break;
     }
 
-    /* Translation disabled. */
+    /* No translation needed. */
     out->paddr = addr & x86_get_a20_mask(env);
-#ifdef TARGET_X86_64
-    if (!(env->hflags & HF_LMA_MASK)) {
-        /* Without long mode we can only address 32bits in real mode */
-        out->paddr = (uint32_t)out->paddr;
-    }
-#endif
     out->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
     out->page_size = TARGET_PAGE_SIZE;
     return true;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 44/47] target/i386: remove unnecessary/wrong application of the A20 mask
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (9 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 43/47] target/i386: Fix physical address truncation Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 45/47] target/i386: leave the A20 bit set in the final NPT walk Michael Tokarev
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

If ptw_translate() does a MMU_PHYS_IDX access, the A20 mask is already
applied in get_physical_address(), which is called via probe_access_full()
and x86_cpu_tlb_fill().

If ptw_translate() on the other hand does a MMU_NESTED_IDX access,
the A20 mask must not be applied to the address that is looked up in
the nested page tables; it must be applied only to the addresses that
hold the NPT entries (which is achieved via MMU_PHYS_IDX, per the
previous paragraph).

Therefore, we can remove A20 masking from the computation of the page
table entry's address, and let get_physical_address() or mmu_translate()
apply it when they know they are returning a host-physical address.

Cc: qemu-stable@nongnu.org
Fixes: 4a1e9d4d11c ("target/i386: Use atomic operations for pte updates", 2022-10-18)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit a28fe7dc1939333c81b895cdced81c69eb7c5ad0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
index 389a0d6912..61b8d2fdde 100644
--- a/target/i386/tcg/sysemu/excp_helper.c
+++ b/target/i386/tcg/sysemu/excp_helper.c
@@ -162,8 +162,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
                 /*
                  * Page table level 5
                  */
-                pte_addr = ((in->cr3 & ~0xfff) +
-                            (((addr >> 48) & 0x1ff) << 3)) & a20_mask;
+                pte_addr = (in->cr3 & ~0xfff) + (((addr >> 48) & 0x1ff) << 3);
                 if (!ptw_translate(&pte_trans, pte_addr)) {
                     return false;
                 }
@@ -187,8 +186,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
             /*
              * Page table level 4
              */
-            pte_addr = ((pte & PG_ADDRESS_MASK) +
-                        (((addr >> 39) & 0x1ff) << 3)) & a20_mask;
+            pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 39) & 0x1ff) << 3);
             if (!ptw_translate(&pte_trans, pte_addr)) {
                 return false;
             }
@@ -208,8 +206,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
             /*
              * Page table level 3
              */
-            pte_addr = ((pte & PG_ADDRESS_MASK) +
-                        (((addr >> 30) & 0x1ff) << 3)) & a20_mask;
+            pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 30) & 0x1ff) << 3);
             if (!ptw_translate(&pte_trans, pte_addr)) {
                 return false;
             }
@@ -236,7 +233,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
             /*
              * Page table level 3
              */
-            pte_addr = ((in->cr3 & 0xffffffe0ULL) + ((addr >> 27) & 0x18)) & a20_mask;
+            pte_addr = (in->cr3 & 0xffffffe0ULL) + ((addr >> 27) & 0x18);
             if (!ptw_translate(&pte_trans, pte_addr)) {
                 return false;
             }
@@ -258,8 +255,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
         /*
          * Page table level 2
          */
-        pte_addr = ((pte & PG_ADDRESS_MASK) +
-                    (((addr >> 21) & 0x1ff) << 3)) & a20_mask;
+        pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) << 3);
         if (!ptw_translate(&pte_trans, pte_addr)) {
             return false;
         }
@@ -285,8 +281,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
         /*
          * Page table level 1
          */
-        pte_addr = ((pte & PG_ADDRESS_MASK) +
-                    (((addr >> 12) & 0x1ff) << 3)) & a20_mask;
+        pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) << 3);
         if (!ptw_translate(&pte_trans, pte_addr)) {
             return false;
         }
@@ -304,7 +299,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
         /*
          * Page table level 2
          */
-        pte_addr = ((in->cr3 & 0xfffff000ULL) + ((addr >> 20) & 0xffc)) & a20_mask;
+        pte_addr = (in->cr3 & 0xfffff000ULL) + ((addr >> 20) & 0xffc);
         if (!ptw_translate(&pte_trans, pte_addr)) {
             return false;
         }
@@ -333,7 +328,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
         /*
          * Page table level 1
          */
-        pte_addr = ((pte & ~0xfffu) + ((addr >> 10) & 0xffc)) & a20_mask;
+        pte_addr = (pte & ~0xfffu) + ((addr >> 10) & 0xffc);
         if (!ptw_translate(&pte_trans, pte_addr)) {
             return false;
         }
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 45/47] target/i386: leave the A20 bit set in the final NPT walk
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (10 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 44/47] target/i386: remove unnecessary/wrong application of the A20 mask Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 46/47] tests/vm: update openbsd image to 7.4 Michael Tokarev
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

The A20 mask is only applied to the final memory access.  Nested
page tables are always walked with the raw guest-physical address.

Unlike the previous patch, in this one the masking must be kept, but
it was done too early.

Cc: qemu-stable@nongnu.org
Fixes: 4a1e9d4d11c ("target/i386: Use atomic operations for pte updates", 2022-10-18)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit b5a9de3259f4c791bde2faff086dd5737625e41e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
index 61b8d2fdde..5999cdedf5 100644
--- a/target/i386/tcg/sysemu/excp_helper.c
+++ b/target/i386/tcg/sysemu/excp_helper.c
@@ -133,7 +133,6 @@ static inline bool ptw_setl(const PTETranslate *in, uint32_t old, uint32_t set)
 static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
                           TranslateResult *out, TranslateFault *err)
 {
-    const int32_t a20_mask = x86_get_a20_mask(env);
     const target_ulong addr = in->addr;
     const int pg_mode = in->pg_mode;
     const bool is_user = (in->mmu_idx == MMU_USER_IDX);
@@ -415,10 +414,13 @@ do_check_protect_pse36:
         }
     }
 
-    /* align to page_size */
-    paddr = (pte & a20_mask & PG_ADDRESS_MASK & ~(page_size - 1))
-          | (addr & (page_size - 1));
+    /* merge offset within page */
+    paddr = (pte & PG_ADDRESS_MASK & ~(page_size - 1)) | (addr & (page_size - 1));
 
+    /*
+     * Note that NPT is walked (for both paging structures and final guest
+     * addresses) using the address with the A20 bit set.
+     */
     if (in->ptw_idx == MMU_NESTED_IDX) {
         CPUTLBEntryFull *full;
         int flags, nested_page_size;
@@ -457,7 +459,7 @@ do_check_protect_pse36:
         }
     }
 
-    out->paddr = paddr;
+    out->paddr = paddr & x86_get_a20_mask(env);
     out->prot = prot;
     out->page_size = page_size;
     return true;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 46/47] tests/vm: update openbsd image to 7.4
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (11 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 45/47] target/i386: leave the A20 bit set in the final NPT walk Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-02-28 20:35 ` [Stable-7.2.10 47/47] tests/vm: avoid re-building the VM images all the time Michael Tokarev
  2024-03-01 19:04 ` [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Cole Robinson
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Alex Bennée, Thomas Huth, Michael Tokarev

From: Alex Bennée <alex.bennee@linaro.org>

The old links are dead so even if we have the ISO cached we can't
finish the install. Update to the current stable and tweak the install
strings.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2192
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240227144335.1196131-5-alex.bennee@linaro.org>
(cherry picked from commit 8467ac75b3b7207a49a1c6c7b87f0f7d2d0cea18)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index eaeb201e91..f185aa96ab 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -22,8 +22,8 @@ class OpenBSDVM(basevm.BaseVM):
     name = "openbsd"
     arch = "x86_64"
 
-    link = "https://cdn.openbsd.org/pub/OpenBSD/7.2/amd64/install72.iso"
-    csum = "0369ef40a3329efcb978c578c7fdc7bda71e502aecec930a74b44160928c91d3"
+    link = "https://cdn.openbsd.org/pub/OpenBSD/7.4/amd64/install74.iso"
+    csum = "a1001736ed9fe2307965b5fcdb426ae11f9b80d26eb21e404a705144a0a224a0"
     size = "20G"
     pkgs = [
         # tools
@@ -97,10 +97,10 @@ class OpenBSDVM(basevm.BaseVM):
         self.console_wait_send("(I)nstall",               "i\n")
         self.console_wait_send("Terminal type",           "xterm\n")
         self.console_wait_send("System hostname",         "openbsd\n")
-        self.console_wait_send("Which network interface", "vio0\n")
+        self.console_wait_send("Network interface to configure", "vio0\n")
         self.console_wait_send("IPv4 address",            "autoconf\n")
         self.console_wait_send("IPv6 address",            "none\n")
-        self.console_wait_send("Which network interface", "done\n")
+        self.console_wait_send("Network interface to configure", "done\n")
         self.console_wait("Password for root account")
         self.console_send("%s\n" % self._config["root_pass"])
         self.console_wait("Password for root account")
@@ -123,6 +123,7 @@ class OpenBSDVM(basevm.BaseVM):
         self.console_wait_send("Allow root ssh login",    "yes\n")
         self.console_wait_send("timezone",                "UTC\n")
         self.console_wait_send("root disk",               "\n")
+        self.console_wait_send("Encrypt the root disk with a passphrase", "no\n")
         self.console_wait_send("(W)hole disk",            "\n")
         self.console_wait_send("(A)uto layout",           "\n")
         self.console_wait_send("Location of sets",        "cd0\n")
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [Stable-7.2.10 47/47] tests/vm: avoid re-building the VM images all the time
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (12 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 46/47] tests/vm: update openbsd image to 7.4 Michael Tokarev
@ 2024-02-28 20:35 ` Michael Tokarev
  2024-03-01 19:04 ` [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Cole Robinson
  14 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-02-28 20:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Alex Bennée, Thomas Huth, Michael Tokarev

From: Alex Bennée <alex.bennee@linaro.org>

The main problem is that "check-venv" is a .PHONY target will always
evaluate and trigger a full re-build of the VM images. While its
tempting to drop it from the dependencies that does introduce a
breakage on freshly configured builds.

Fortunately we do have the otherwise redundant --force flag for the
script which up until now was always on. If we make the usage of
--force conditional on dependencies other than check-venv triggering
the update we can avoid the costly rebuild and still run cleanly on a
fresh checkout.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2118
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240227144335.1196131-4-alex.bennee@linaro.org>
(cherry picked from commit 151b7dba391fab64cc008a1fdba6ddcf6f8c39c8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index 2cc2203d09..e332fd13c3 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -103,7 +103,7 @@ $(IMAGES_DIR)/%.img:	$(SRC_PATH)/tests/vm/% \
 		$(if $(LOG_CONSOLE),--log-console) \
 		--source-path $(SRC_PATH) \
 		--image "$@" \
-		--force \
+		$(if $(filter-out check-venv, $?), --force) \
 		--build-image $@, \
 		"  VM-IMAGE $*")
 
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 2276364c42..6a54d9d4e0 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -634,9 +634,9 @@ def main(vmcls, config=None):
         vm = vmcls(args, config=config)
         if args.build_image:
             if os.path.exists(args.image) and not args.force:
-                sys.stderr.writelines(["Image file exists: %s\n" % args.image,
+                sys.stderr.writelines(["Image file exists, skipping build: %s\n" % args.image,
                                       "Use --force option to overwrite\n"])
-                return 1
+                return 0
             return vm.build_image(args.image)
         if args.build_qemu:
             vm.add_source_dir(args.build_qemu)
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02
  2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
                   ` (13 preceding siblings ...)
  2024-02-28 20:35 ` [Stable-7.2.10 47/47] tests/vm: avoid re-building the VM images all the time Michael Tokarev
@ 2024-03-01 19:04 ` Cole Robinson
  2024-03-01 19:19   ` Michael Tokarev
  14 siblings, 1 reply; 17+ messages in thread
From: Cole Robinson @ 2024-03-01 19:04 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel; +Cc: qemu-stable

On 2/28/24 3:35 PM, Michael Tokarev wrote:
> The following patches are queued for QEMU stable v7.2.10:
> 
> https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2
> 
> Patch freeze is 2024-03-02, and the release is planned for 
> 2024-03-04:
> 
> https://wiki.qemu.org/Planning/7.2
> 
> Please respond here or CC qemu-stable@nongnu.org on any additional 
> patches you think should (or shouldn't) be included in the release.
> 
> The changes which are staging for inclusion, with the original commit
> hash from master branch, are given below the bottom line.
> 
> Thanks!
> 
> /mjt
> 


Response might be too late, But here's the patches we are still carrying
in Fedora 38 7.2.X and the explanations


* abe2c4bdb6 test-vmstate: fix bad GTree usage, use-after-free

  Fixes an intermittent crash in test-vmstate


* f2e57851b8 tests/qtest/display-vga-test: Add proper checks if a device
is available

  Fixes this reliable unittest error with device modules:
  476/657 qemu:qtest+qtest-ppc64 / qtest-ppc64/display-vga-test
           ERROR           0.71s   killed by signal 6 SIGABRT


* b6903cbe3a tests/unit/test-blockjob: Disable complete_in_standby test

  Fixes flakey blockjob test


* 2196157404 target/i386: the sgx_epc_get_section stub is reachable

  This is in 8.2.X series already, but applies to 7.2.X as well


Thanks!
Cole



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02
  2024-03-01 19:04 ` [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Cole Robinson
@ 2024-03-01 19:19   ` Michael Tokarev
  0 siblings, 0 replies; 17+ messages in thread
From: Michael Tokarev @ 2024-03-01 19:19 UTC (permalink / raw)
  To: Cole Robinson, qemu-devel; +Cc: qemu-stable

01.03.2024 22:04, Cole Robinson wrote:

>> Patch freeze is 2024-03-02, and the release is planned for
>> 2024-03-04:
...
> Response might be too late, But here's the patches we are still carrying
> in Fedora 38 7.2.X and the explanations

Nah, we've whole day left before the freeze.

> 
> * abe2c4bdb6 test-vmstate: fix bad GTree usage, use-after-free
> 
>    Fixes an intermittent crash in test-vmstate
> 
> 
> * f2e57851b8 tests/qtest/display-vga-test: Add proper checks if a device
> is available
> 
>    Fixes this reliable unittest error with device modules:
>    476/657 qemu:qtest+qtest-ppc64 / qtest-ppc64/display-vga-test
>             ERROR           0.71s   killed by signal 6 SIGABRT
> 
> 
> * b6903cbe3a tests/unit/test-blockjob: Disable complete_in_standby test
> 
>    Fixes flakey blockjob test
> 
> 
> * 2196157404 target/i386: the sgx_epc_get_section stub is reachable
> 
>    This is in 8.2.X series already, but applies to 7.2.X as well


Okay, picked up all of them - all of them are in 8.2.x already.
Interesting, I haven't seen these test failures on main qemu
gitlab-ci pipelines.   Maybe only the test-vmstate one, very rare.
But again, I don't run tests often, so some intermittent failures
might went unnoticed.

Also, I often skip changes to tests which might be good to have
in older releases.

Thanks,

/mjt


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-03-01 19:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 20:35 [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 33/47] meson: ensure dbus-display generated code is built before other units Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 35/47] docs/system: Update description for input grab key Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 36/47] system/vl: " Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 37/47] .gitlab-ci.d/windows.yml: Drop msys2-32bit job Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 38/47] target/ppc: Fix lxv/stxv MSR facility check Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 39/47] hw/nvme: fix invalid endian conversion Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 40/47] pl031: Update last RTCLR value on write in case it's read back Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 41/47] target/i386: mask high bits of CR3 in 32-bit mode Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 42/47] target/i386: check validity of VMCB addresses Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 43/47] target/i386: Fix physical address truncation Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 44/47] target/i386: remove unnecessary/wrong application of the A20 mask Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 45/47] target/i386: leave the A20 bit set in the final NPT walk Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 46/47] tests/vm: update openbsd image to 7.4 Michael Tokarev
2024-02-28 20:35 ` [Stable-7.2.10 47/47] tests/vm: avoid re-building the VM images all the time Michael Tokarev
2024-03-01 19:04 ` [Stable-7.2.10 v1 00/47] Patch Round-up for stable 7.2.10, freeze on 2024-03-02 Cole Robinson
2024-03-01 19:19   ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).