* [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21
@ 2025-07-11 8:15 Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 01/39] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang Michael Tokarev
` (39 more replies)
0 siblings, 40 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Michael Tokarev
The following patches are queued for QEMU stable v10.0.3:
https://gitlab.com/qemu-project/qemu/-/commits/staging-10.0
Patch freeze is 2025-07-21, and the release is planned for 2025-07-23:
https://wiki.qemu.org/Planning/10.0
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 fb8e59abbe46 Jamin Lin:
hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware
hang
02 e6941ac10619 Jamin Lin:
hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts
03 9498e2f7e1a2 Weifeng Liu:
ui/gtk: Document scale and coordinate handling
04 3a6b314409b4 Weifeng Liu:
ui/gtk: Use consistent naming for variables in different coordinates
05 a19665448156 Weifeng Liu:
gtk/ui: Introduce helper gd_update_scale
06 8fb072472c38 Weifeng Liu:
ui/gtk: Update scales in fixed-scale mode when rendering GL area
07 30aa105640b0 Weifeng Liu:
ui/sdl: Consider scaling in mouse event handling
08 7ed96710e82c Daniel P. Berrangé:
ui/vnc.c: replace big endian flag with byte order value
09 70097442853c Daniel P. Berrangé:
ui/vnc: take account of client byte order in pixman format
10 63d320909220 Daniel P. Berrangé:
ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats
11 e6bc01777e5a Guenter Roeck:
hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info
12 a9403bfcd930 Huaitong Han:
vhost: Don't set vring call if guest notifier is unused
13 0b006153b7ec Bernhard Beschow:
hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine
14 31753d5a336f Sairaj Kodilkar:
hw/i386/amd_iommu: Fix device setup failure when PT is on.
15 0f178860df34 Vasant Hegde:
hw/i386/amd_iommu: Fix xtsup when vcpus < 255
16 5ddd6c8dc849 Volker Rümelin:
audio: fix SIGSEGV in AUD_get_buffer_size_out()
17 ccb4fec0e5f2 Volker Rümelin:
audio: fix size calculation in AUD_get_buffer_size_out()
18 d009f26a54f5 Volker Rümelin:
hw/audio/asc: fix SIGSEGV in asc_realize()
19 0b901459a87a Xin Li (Intel):
target/i386: Remove FRED dependency on WRMSRNS
20 2e887187454e Stefan Hajnoczi:
iotests: fix 240
21 eef2dd03f948 Fiona Ebner:
hw/core/qdev-properties-system: Add missing return in set_drive_helper()
22 9c55c03c05c1 Bibo Mao:
hw/loongarch/virt: Fix big endian support with MCFG table
23 f5ec751ee70d Shameer Kolothum:
hw/arm/virt: Check bypass iommu is not set for iommu-map DT property
24 e372214e663a Ethan Chen:
qemu-options.hx: Fix reversed description of icount sleep behavior
25 cd38e638c43e Peter Maydell:
hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions
26 5ad2b1f443a9 J. Neuschäfer:
linux-user/arm: Fix return value of SYS_cacheflush
27 e7788da9860c Song Gao:
target/loongarch: add check for fcond
28 c2a2e1ad2a74 Song Gao:
target/loongarch: fix vldi/xvldi raise wrong error
29 0d0fc3f46589 Richard Henderson:
tcg: Fix constant propagation in tcg_reg_alloc_dup
30 9a3bf0e0ab62 Solomon Tan:
target/arm: Make RETA[AB] UNDEF when pauth is not implemented
31 a412575837b6 Philippe Mathieu-Daudé:
target/arm: Correct KVM & HVF dtb_compatible value
32 1fa2ffdbec55 Yiwei Zhang:
virtio-gpu: support context init multiple timeline
33 78e378154120 Kevin Wolf:
hw/s390x/ccw-device: Fix memory leak in loadparm setter
34 f9b0f6930407 Richard Henderson:
target/arm: Fix SME vs AdvSIMD exception priority
35 b4b2e070f41d Richard Henderson:
target/arm: Fix sve_access_check for SME
36 e6ffd009c771 Richard Henderson:
target/arm: Fix 128-bit element ZIP, UZP, TRN
37 3801c5b75ffc Richard Henderson:
target/arm: Fix PSEL size operands to tcg_gen_gvec_ands
38 cfc688c00ade Richard Henderson:
target/arm: Fix f16_dotadd vs nan selection
39 bf020eaa6741 Richard Henderson:
target/arm: Fix bfdotadd_ebf vs nan selection
^ permalink raw reply [flat|nested] 42+ messages in thread
* [Stable-10.0.3 01/39] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
@ 2025-07-11 8:15 ` Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 02/39] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts Michael Tokarev
` (38 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Jamin Lin, Cédric Le Goater, Michael Tokarev
From: Jamin Lin <jamin_lin@aspeedtech.com>
Currently, if the program encounters an unsupported algorithm, it does not set
the HASH_IRQ bit in the status register and send an interrupt to indicate
command completion. As a result, the FW gets stuck waiting for a completion
signal from the HACE module.
Additionally, in do_hash_operation, if an error occurs within the conditional
statement, the HASH_IRQ bit is not set in the status register. This causes the
firmware to continuously send HASH commands, as it is unaware that the HACE
model has completed processing the command.
To fix this, the HASH_IRQ bit in the status register must always be set to
ensure that the firmware receives an interrupt from the HACE module, preventing
it from getting stuck or repeatedly sending HASH commands.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Fixes: c5475b3 ("hw: Model ASPEED's Hash and Crypto Engine")
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250515081008.583578-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
(cherry picked from commit fb8e59abbe46957cd599bb9aa9221fad1e4e989e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c
index d75da33353..96997a03fc 100644
--- a/hw/misc/aspeed_hace.c
+++ b/hw/misc/aspeed_hace.c
@@ -301,12 +301,6 @@ static void do_hash_operation(AspeedHACEState *s, int algo, bool sg_mode,
iov[i - 1].iov_len, false,
iov[i - 1].iov_len);
}
-
- /*
- * Set status bits to indicate completion. Testing shows hardware sets
- * these irrespective of HASH_IRQ_EN.
- */
- s->regs[R_STATUS] |= HASH_IRQ;
}
static uint64_t aspeed_hace_read(void *opaque, hwaddr addr, unsigned int size)
@@ -390,10 +384,16 @@ static void aspeed_hace_write(void *opaque, hwaddr addr, uint64_t data,
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Invalid hash algorithm selection 0x%"PRIx64"\n",
__func__, data & ahc->hash_mask);
- break;
+ } else {
+ do_hash_operation(s, algo, data & HASH_SG_EN,
+ ((data & HASH_HMAC_MASK) == HASH_DIGEST_ACCUM));
}
- do_hash_operation(s, algo, data & HASH_SG_EN,
- ((data & HASH_HMAC_MASK) == HASH_DIGEST_ACCUM));
+
+ /*
+ * Set status bits to indicate completion. Testing shows hardware sets
+ * these irrespective of HASH_IRQ_EN.
+ */
+ s->regs[R_STATUS] |= HASH_IRQ;
if (data & HASH_IRQ_EN) {
qemu_irq_raise(s->irq);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 02/39] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 01/39] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang Michael Tokarev
@ 2025-07-11 8:15 ` Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 03/39] ui/gtk: Document scale and coordinate handling Michael Tokarev
` (37 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Jamin Lin, Cédric Le Goater, Michael Tokarev
From: Jamin Lin <jamin_lin@aspeedtech.com>
On big-endian hosts, the aspeed_ram_capacity_write() function previously passed
the address of a 64-bit "data" variable directly to address_space_write(),
assuming host and guest endianness matched.
However, the data is expected to be written in little-endian format to DRAM.
On big-endian hosts, this led to incorrect data being written into DRAM,
which caused the guest firmware to misdetect the DRAM size.
As a result, U-Boot fails to boot and hangs.
- Replaces the "address_space_write()" call with "address_space_stl_le()",
which performs an explicit 32-bit little-endian write.
- Updating the MemoryRegionOps to restrict access to exactly 4 bytes
using .valid.{min,max}_access_size = 4 and .impl.min_access_size = 4.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Fixes: 7436db1 ("aspeed/soc: fix incorrect dram size for AST2700")
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250522023305.2486536-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
(cherry picked from commit e6941ac106190490d8b455eedc5b368e6d94d4cc)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index dce7255a2c..b810891b16 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -325,8 +325,9 @@ static void aspeed_ram_capacity_write(void *opaque, hwaddr addr, uint64_t data,
* If writes the data to the address which is beyond the ram size,
* it would write the data to the "address % ram_size".
*/
- result = address_space_write(&s->dram_as, addr % ram_size,
- MEMTXATTRS_UNSPECIFIED, &data, 4);
+ address_space_stl_le(&s->dram_as, addr % ram_size, data,
+ MEMTXATTRS_UNSPECIFIED, &result);
+
if (result != MEMTX_OK) {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: DRAM write failed, addr:0x%" HWADDR_PRIx
@@ -339,9 +340,10 @@ static const MemoryRegionOps aspeed_ram_capacity_ops = {
.read = aspeed_ram_capacity_read,
.write = aspeed_ram_capacity_write,
.endianness = DEVICE_LITTLE_ENDIAN,
+ .impl.min_access_size = 4,
.valid = {
- .min_access_size = 1,
- .max_access_size = 8,
+ .min_access_size = 4,
+ .max_access_size = 4,
},
};
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 03/39] ui/gtk: Document scale and coordinate handling
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 01/39] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 02/39] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts Michael Tokarev
@ 2025-07-11 8:15 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 04/39] ui/gtk: Use consistent naming for variables in different coordinates Michael Tokarev
` (36 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:15 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Weifeng Liu, Gerd Hoffmann, Marc-André Lureau,
Michael Tokarev
From: Weifeng Liu <weifeng.liu.z@gmail.com>
The existence of multiple scaling factors forces us to deal with various
coordinate systems and this would be confusing. It would be beneficial
to define the concepts clearly and use consistent representation for
variables in different coordinates.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
Message-ID: <20250511073337.876650-2-weifeng.liu.z@gmail.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit 9498e2f7e1a247557cfa0f830a86c398a23c6809)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/gtk.c b/ui/gtk.c
index 59bda83da6..582841e031 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -800,6 +800,71 @@ void gd_update_monitor_refresh_rate(VirtualConsole *vc, GtkWidget *widget)
#endif
}
+/**
+ * DOC: Coordinate handling.
+ *
+ * We are coping with sizes and positions in various coordinates and the
+ * handling of these coordinates is somewhat confusing. It would benefit us
+ * all if we define these coordinates explicitly and clearly. Besides, it's
+ * also helpful to follow the same naming convention for variables
+ * representing values in different coordinates.
+ *
+ * I. Definitions
+ *
+ * - (guest) buffer coordinate: this is the coordinates that the guest will
+ * see. The x/y offsets and width/height specified in commands sent by
+ * guest is basically in buffer coordinate.
+ *
+ * - (host) pixel coordinate: this is the coordinate in pixel level on the
+ * host destop. A window/widget of width 300 in pixel coordinate means it
+ * occupies 300 pixels horizontally.
+ *
+ * - (host) logical window coordinate: the existence of global scaling
+ * factor in desktop level makes this kind of coordinate play a role. It
+ * always holds that (logical window size) * (global scale factor) =
+ * (pixel size).
+ *
+ * - global scale factor: this is specified in desktop level and is
+ * typically invariant during the life cycle of the process. Users with
+ * high-DPI monitors might set this scale, for example, to 2, in order to
+ * make the UI look larger.
+ *
+ * - zooming scale: this can be freely controlled by the QEMU user to zoom
+ * in/out the guest content.
+ *
+ * II. Representation
+ *
+ * We'd like to use consistent representation for variables in different
+ * coordinates:
+ * - buffer coordinate: prefix fb
+ * - pixel coordinate: prefix p
+ * - logical window coordinate: prefix w
+ *
+ * For scales:
+ * - global scale factor: prefix gs
+ * - zooming scale: prefix scale/s
+ *
+ * Example: fbw, pw, ww for width in different coordinates
+ *
+ * III. Equation
+ *
+ * - fbw * gs * scale_x = pw
+ * - pw = gs * ww
+ *
+ * Consequently we have
+ *
+ * - fbw * scale_x = ww
+ *
+ * Example: assuming we are running QEMU on a 3840x2160 screen and have set
+ * global scaling factor to 2, if the guest buffer size is 1920x1080 and the
+ * zooming scale is 0.5, then we have:
+ * - fbw = 1920, fbh = 1080
+ * - pw = 1920, ph = 1080
+ * - ww = 960, wh = 540
+ * A bonus of this configuration is that we can achieve pixel to pixel
+ * presentation of the guest content.
+ */
+
static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
{
VirtualConsole *vc = opaque;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 04/39] ui/gtk: Use consistent naming for variables in different coordinates
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (2 preceding siblings ...)
2025-07-11 8:15 ` [Stable-10.0.3 03/39] ui/gtk: Document scale and coordinate handling Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 05/39] gtk/ui: Introduce helper gd_update_scale Michael Tokarev
` (35 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Weifeng Liu, Gerd Hoffmann, Marc-André Lureau,
Michael Tokarev
From: Weifeng Liu <weifeng.liu.z@gmail.com>
Now that we've documented definitions and presentation of various
coordinates, let's enforce the rules.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
Message-ID: <20250511073337.876650-3-weifeng.liu.z@gmail.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit 3a6b314409b42fe7c46c2bd80cfc2a6744d414fe)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index f7a428c86a..947c99334b 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -70,16 +70,18 @@ void gd_egl_draw(VirtualConsole *vc)
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
int fence_fd;
#endif
- int ww, wh, ws;
+ int ww, wh, pw, ph, gs;
if (!vc->gfx.gls) {
return;
}
window = gtk_widget_get_window(vc->gfx.drawing_area);
- ws = gdk_window_get_scale_factor(window);
- ww = gdk_window_get_width(window) * ws;
- wh = gdk_window_get_height(window) * ws;
+ gs = gdk_window_get_scale_factor(window);
+ ww = gdk_window_get_width(window);
+ wh = gdk_window_get_height(window);
+ pw = ww * gs;
+ ph = wh * gs;
if (vc->gfx.scanout_mode) {
#ifdef CONFIG_GBM
@@ -115,7 +117,7 @@ void gd_egl_draw(VirtualConsole *vc)
eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, vc->gfx.ectx);
- surface_gl_setup_viewport(vc->gfx.gls, vc->gfx.ds, ww, wh);
+ surface_gl_setup_viewport(vc->gfx.gls, vc->gfx.ds, pw, ph);
surface_gl_render_texture(vc->gfx.gls, vc->gfx.ds);
eglSwapBuffers(qemu_egl_display, vc->gfx.esurface);
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 2c9a0db425..ba9fbec432 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -42,16 +42,16 @@ void gd_gl_area_draw(VirtualConsole *vc)
#ifdef CONFIG_GBM
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
#endif
- int ww, wh, ws, y1, y2;
+ int pw, ph, gs, y1, y2;
if (!vc->gfx.gls) {
return;
}
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
- ws = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
- ww = gtk_widget_get_allocated_width(vc->gfx.drawing_area) * ws;
- wh = gtk_widget_get_allocated_height(vc->gfx.drawing_area) * ws;
+ gs = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
+ pw = gtk_widget_get_allocated_width(vc->gfx.drawing_area) * gs;
+ ph = gtk_widget_get_allocated_height(vc->gfx.drawing_area) * gs;
if (vc->gfx.scanout_mode) {
if (!vc->gfx.guest_fb.framebuffer) {
@@ -71,11 +71,11 @@ void gd_gl_area_draw(VirtualConsole *vc)
glBindFramebuffer(GL_READ_FRAMEBUFFER, vc->gfx.guest_fb.framebuffer);
/* GtkGLArea sets GL_DRAW_FRAMEBUFFER for us */
- glViewport(0, 0, ww, wh);
+ glViewport(0, 0, pw, ph);
y1 = vc->gfx.y0_top ? 0 : vc->gfx.h;
y2 = vc->gfx.y0_top ? vc->gfx.h : 0;
glBlitFramebuffer(0, y1, vc->gfx.w, y2,
- 0, 0, ww, wh,
+ 0, 0, pw, ph,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
#ifdef CONFIG_GBM
if (dmabuf) {
@@ -101,7 +101,7 @@ void gd_gl_area_draw(VirtualConsole *vc)
}
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
- surface_gl_setup_viewport(vc->gfx.gls, vc->gfx.ds, ww, wh);
+ surface_gl_setup_viewport(vc->gfx.gls, vc->gfx.ds, pw, ph);
surface_gl_render_texture(vc->gfx.gls, vc->gfx.ds);
}
}
diff --git a/ui/gtk.c b/ui/gtk.c
index 582841e031..956d4ab9d1 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -387,16 +387,16 @@ static void *gd_win32_get_hwnd(VirtualConsole *vc)
/** DisplayState Callbacks **/
static void gd_update(DisplayChangeListener *dcl,
- int x, int y, int w, int h)
+ int fbx, int fby, int fbw, int fbh)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
GdkWindow *win;
- int x1, x2, y1, y2;
- int mx, my;
- int fbw, fbh;
- int ww, wh;
+ int wx1, wx2, wy1, wy2;
+ int wx_offset, wy_offset;
+ int ww_surface, wh_surface;
+ int ww_widget, wh_widget;
- trace_gd_update(vc->label, x, y, w, h);
+ trace_gd_update(vc->label, fbx, fby, fbw, fbh);
if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
return;
@@ -405,35 +405,36 @@ static void gd_update(DisplayChangeListener *dcl,
if (vc->gfx.convert) {
pixman_image_composite(PIXMAN_OP_SRC, vc->gfx.ds->image,
NULL, vc->gfx.convert,
- x, y, 0, 0, x, y, w, h);
+ fbx, fby, 0, 0, fbx, fby, fbw, fbh);
}
- x1 = floor(x * vc->gfx.scale_x);
- y1 = floor(y * vc->gfx.scale_y);
+ wx1 = floor(fbx * vc->gfx.scale_x);
+ wy1 = floor(fby * vc->gfx.scale_y);
- x2 = ceil(x * vc->gfx.scale_x + w * vc->gfx.scale_x);
- y2 = ceil(y * vc->gfx.scale_y + h * vc->gfx.scale_y);
+ wx2 = ceil(fbx * vc->gfx.scale_x + fbw * vc->gfx.scale_x);
+ wy2 = ceil(fby * vc->gfx.scale_y + fbh * vc->gfx.scale_y);
- fbw = surface_width(vc->gfx.ds) * vc->gfx.scale_x;
- fbh = surface_height(vc->gfx.ds) * vc->gfx.scale_y;
+ ww_surface = surface_width(vc->gfx.ds) * vc->gfx.scale_x;
+ wh_surface = surface_height(vc->gfx.ds) * vc->gfx.scale_y;
win = gtk_widget_get_window(vc->gfx.drawing_area);
if (!win) {
return;
}
- ww = gdk_window_get_width(win);
- wh = gdk_window_get_height(win);
+ ww_widget = gdk_window_get_width(win);
+ wh_widget = gdk_window_get_height(win);
- mx = my = 0;
- if (ww > fbw) {
- mx = (ww - fbw) / 2;
+ wx_offset = wy_offset = 0;
+ if (ww_widget > ww_surface) {
+ wx_offset = (ww_widget - ww_surface) / 2;
}
- if (wh > fbh) {
- my = (wh - fbh) / 2;
+ if (wh_widget > wh_surface) {
+ wy_offset = (wh_widget - wh_surface) / 2;
}
gtk_widget_queue_draw_area(vc->gfx.drawing_area,
- mx + x1, my + y1, (x2 - x1), (y2 - y1));
+ wx_offset + wx1, wy_offset + wy1,
+ (wx2 - wx1), (wy2 - wy1));
}
static void gd_refresh(DisplayChangeListener *dcl)
@@ -869,8 +870,8 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
{
VirtualConsole *vc = opaque;
GtkDisplayState *s = vc->s;
- int mx, my;
- int ww, wh;
+ int wx_offset, wy_offset;
+ int ww_widget, wh_widget, ww_surface, wh_surface;
int fbw, fbh;
#if defined(CONFIG_OPENGL)
@@ -904,46 +905,47 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
fbw = surface_width(vc->gfx.ds);
fbh = surface_height(vc->gfx.ds);
- ww = gdk_window_get_width(gtk_widget_get_window(widget));
- wh = gdk_window_get_height(gtk_widget_get_window(widget));
+ ww_widget = gdk_window_get_width(gtk_widget_get_window(widget));
+ wh_widget = gdk_window_get_height(gtk_widget_get_window(widget));
if (s->full_screen) {
- vc->gfx.scale_x = (double)ww / fbw;
- vc->gfx.scale_y = (double)wh / fbh;
+ vc->gfx.scale_x = (double)ww_widget / fbw;
+ vc->gfx.scale_y = (double)wh_widget / fbh;
} else if (s->free_scale) {
double sx, sy;
- sx = (double)ww / fbw;
- sy = (double)wh / fbh;
+ sx = (double)ww_widget / fbw;
+ sy = (double)wh_widget / fbh;
vc->gfx.scale_x = vc->gfx.scale_y = MIN(sx, sy);
}
- fbw *= vc->gfx.scale_x;
- fbh *= vc->gfx.scale_y;
+ ww_surface = fbw * vc->gfx.scale_x;
+ wh_surface = fbh * vc->gfx.scale_y;
- mx = my = 0;
- if (ww > fbw) {
- mx = (ww - fbw) / 2;
+ wx_offset = wy_offset = 0;
+ if (ww_widget > ww_surface) {
+ wx_offset = (ww_widget - ww_surface) / 2;
}
- if (wh > fbh) {
- my = (wh - fbh) / 2;
+ if (wh_widget > wh_surface) {
+ wy_offset = (wh_widget - wh_surface) / 2;
}
- cairo_rectangle(cr, 0, 0, ww, wh);
+ cairo_rectangle(cr, 0, 0, ww_widget, wh_widget);
/* Optionally cut out the inner area where the pixmap
will be drawn. This avoids 'flashing' since we're
not double-buffering. Note we're using the undocumented
behaviour of drawing the rectangle from right to left
to cut out the whole */
- cairo_rectangle(cr, mx + fbw, my,
- -1 * fbw, fbh);
+ cairo_rectangle(cr, wx_offset + ww_surface, wy_offset,
+ -1 * ww_surface, wh_surface);
cairo_fill(cr);
cairo_scale(cr, vc->gfx.scale_x, vc->gfx.scale_y);
cairo_set_source_surface(cr, vc->gfx.surface,
- mx / vc->gfx.scale_x, my / vc->gfx.scale_y);
+ wx_offset / vc->gfx.scale_x,
+ wy_offset / vc->gfx.scale_y);
cairo_paint(cr);
return TRUE;
@@ -954,19 +956,19 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
{
VirtualConsole *vc = opaque;
GtkDisplayState *s = vc->s;
- int x, y;
- int mx, my;
- int fbh, fbw;
- int ww, wh;
+ int fbx, fby;
+ int wx_offset, wy_offset;
+ int wh_surface, ww_surface;
+ int ww_widget, wh_widget;
if (!vc->gfx.ds) {
return TRUE;
}
- fbw = surface_width(vc->gfx.ds) * vc->gfx.scale_x;
- fbh = surface_height(vc->gfx.ds) * vc->gfx.scale_y;
- ww = gtk_widget_get_allocated_width(widget);
- wh = gtk_widget_get_allocated_height(widget);
+ ww_surface = surface_width(vc->gfx.ds) * vc->gfx.scale_x;
+ wh_surface = surface_height(vc->gfx.ds) * vc->gfx.scale_y;
+ ww_widget = gtk_widget_get_allocated_width(widget);
+ wh_widget = gtk_widget_get_allocated_height(widget);
/*
* `widget` may not have the same size with the frame buffer.
@@ -974,41 +976,42 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
* To achieve that, `vc` will be displayed at (mx, my)
* so that it is displayed at the center of the widget.
*/
- mx = my = 0;
- if (ww > fbw) {
- mx = (ww - fbw) / 2;
+ wx_offset = wy_offset = 0;
+ if (ww_widget > ww_surface) {
+ wx_offset = (ww_widget - ww_surface) / 2;
}
- if (wh > fbh) {
- my = (wh - fbh) / 2;
+ if (wh_widget > wh_surface) {
+ wy_offset = (wh_widget - wh_surface) / 2;
}
/*
* `motion` is reported in `widget` coordinates
* so translating it to the coordinates in `vc`.
*/
- x = (motion->x - mx) / vc->gfx.scale_x;
- y = (motion->y - my) / vc->gfx.scale_y;
+ fbx = (motion->x - wx_offset) / vc->gfx.scale_x;
+ fby = (motion->y - wy_offset) / vc->gfx.scale_y;
- trace_gd_motion_event(ww, wh, gtk_widget_get_scale_factor(widget), x, y);
+ trace_gd_motion_event(ww_widget, wh_widget,
+ gtk_widget_get_scale_factor(widget), fbx, fby);
if (qemu_input_is_absolute(vc->gfx.dcl.con)) {
- if (x < 0 || y < 0 ||
- x >= surface_width(vc->gfx.ds) ||
- y >= surface_height(vc->gfx.ds)) {
+ if (fbx < 0 || fby < 0 ||
+ fbx >= surface_width(vc->gfx.ds) ||
+ fby >= surface_height(vc->gfx.ds)) {
return TRUE;
}
- qemu_input_queue_abs(vc->gfx.dcl.con, INPUT_AXIS_X, x,
+ qemu_input_queue_abs(vc->gfx.dcl.con, INPUT_AXIS_X, fbx,
0, surface_width(vc->gfx.ds));
- qemu_input_queue_abs(vc->gfx.dcl.con, INPUT_AXIS_Y, y,
+ qemu_input_queue_abs(vc->gfx.dcl.con, INPUT_AXIS_Y, fby,
0, surface_height(vc->gfx.ds));
qemu_input_event_sync();
} else if (s->last_set && s->ptr_owner == vc) {
- qemu_input_queue_rel(vc->gfx.dcl.con, INPUT_AXIS_X, x - s->last_x);
- qemu_input_queue_rel(vc->gfx.dcl.con, INPUT_AXIS_Y, y - s->last_y);
+ qemu_input_queue_rel(vc->gfx.dcl.con, INPUT_AXIS_X, fbx - s->last_x);
+ qemu_input_queue_rel(vc->gfx.dcl.con, INPUT_AXIS_Y, fby - s->last_y);
qemu_input_event_sync();
}
- s->last_x = x;
- s->last_y = y;
+ s->last_x = fbx;
+ s->last_y = fby;
s->last_set = TRUE;
if (!qemu_input_is_absolute(vc->gfx.dcl.con) && s->ptr_owner == vc) {
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 05/39] gtk/ui: Introduce helper gd_update_scale
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (3 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 04/39] ui/gtk: Use consistent naming for variables in different coordinates Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 06/39] ui/gtk: Update scales in fixed-scale mode when rendering GL area Michael Tokarev
` (34 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Weifeng Liu, Gerd Hoffmann, Marc-André Lureau,
Michael Tokarev
From: Weifeng Liu <weifeng.liu.z@gmail.com>
The code snippet updating scale_x/scale_y is general and will be used in
next patch. Make it a function.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
Message-ID: <20250511073337.876650-4-weifeng.liu.z@gmail.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit a19665448156f17b52b7f33e7960d57efcfca067)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index aa3d637029..d3944046db 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -224,4 +224,6 @@ int gd_gl_area_make_current(DisplayGLCtx *dgc,
/* gtk-clipboard.c */
void gd_clipboard_init(GtkDisplayState *gd);
+void gd_update_scale(VirtualConsole *vc, int ww, int wh, int fbw, int fbh);
+
#endif /* UI_GTK_H */
diff --git a/ui/gtk.c b/ui/gtk.c
index 956d4ab9d1..ea3f403b02 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -801,6 +801,24 @@ void gd_update_monitor_refresh_rate(VirtualConsole *vc, GtkWidget *widget)
#endif
}
+void gd_update_scale(VirtualConsole *vc, int ww, int wh, int fbw, int fbh)
+{
+ if (!vc) {
+ return;
+ }
+
+ if (vc->s->full_screen) {
+ vc->gfx.scale_x = (double)ww / fbw;
+ vc->gfx.scale_y = (double)wh / fbh;
+ } else if (vc->s->free_scale) {
+ double sx, sy;
+
+ sx = (double)ww / fbw;
+ sy = (double)wh / fbh;
+
+ vc->gfx.scale_x = vc->gfx.scale_y = MIN(sx, sy);
+ }
+}
/**
* DOC: Coordinate handling.
*
@@ -908,17 +926,7 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
ww_widget = gdk_window_get_width(gtk_widget_get_window(widget));
wh_widget = gdk_window_get_height(gtk_widget_get_window(widget));
- if (s->full_screen) {
- vc->gfx.scale_x = (double)ww_widget / fbw;
- vc->gfx.scale_y = (double)wh_widget / fbh;
- } else if (s->free_scale) {
- double sx, sy;
-
- sx = (double)ww_widget / fbw;
- sy = (double)wh_widget / fbh;
-
- vc->gfx.scale_x = vc->gfx.scale_y = MIN(sx, sy);
- }
+ gd_update_scale(vc, ww_widget, wh_widget, fbw, fbh);
ww_surface = fbw * vc->gfx.scale_x;
wh_surface = fbh * vc->gfx.scale_y;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 06/39] ui/gtk: Update scales in fixed-scale mode when rendering GL area
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (4 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 05/39] gtk/ui: Introduce helper gd_update_scale Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 07/39] ui/sdl: Consider scaling in mouse event handling Michael Tokarev
` (33 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Weifeng Liu, Gerd Hoffmann, Marc-André Lureau,
Michael Tokarev
From: Weifeng Liu <weifeng.liu.z@gmail.com>
When gl=on, scale_x and scale_y were set to 1 on startup that didn't
reflect the real situation of the scan-out in free scale mode, resulting
in incorrect cursor coordinates to be sent when moving the mouse
pointer. Simply updating the scales before rendering the image fixes
this issue.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
Message-ID: <20250511073337.876650-5-weifeng.liu.z@gmail.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit 8fb072472c38cb1778c5b0bebf535a8b13533857)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index ba9fbec432..db93cd6204 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -43,6 +43,8 @@ void gd_gl_area_draw(VirtualConsole *vc)
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
#endif
int pw, ph, gs, y1, y2;
+ int ww, wh;
+ int fbw, fbh;
if (!vc->gfx.gls) {
return;
@@ -50,8 +52,14 @@ void gd_gl_area_draw(VirtualConsole *vc)
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
gs = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
- pw = gtk_widget_get_allocated_width(vc->gfx.drawing_area) * gs;
- ph = gtk_widget_get_allocated_height(vc->gfx.drawing_area) * gs;
+ fbw = surface_width(vc->gfx.ds);
+ fbh = surface_height(vc->gfx.ds);
+ ww = gtk_widget_get_allocated_width(vc->gfx.drawing_area);
+ wh = gtk_widget_get_allocated_height(vc->gfx.drawing_area);
+ pw = ww * gs;
+ ph = wh * gs;
+
+ gd_update_scale(vc, ww, wh, fbw, fbh);
if (vc->gfx.scanout_mode) {
if (!vc->gfx.guest_fb.framebuffer) {
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 07/39] ui/sdl: Consider scaling in mouse event handling
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (5 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 06/39] ui/gtk: Update scales in fixed-scale mode when rendering GL area Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 08/39] ui/vnc.c: replace big endian flag with byte order value Michael Tokarev
` (32 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Weifeng Liu, Gerd Hoffmann, Marc-André Lureau,
Michael Tokarev
From: Weifeng Liu <weifeng.liu@intel.com>
When using sdl display backend, if the window is scaled, incorrect mouse
positions will be reported since scaling is not properly handled. Fix it
by transforming the positions from window coordinate to guest buffer
coordinate.
Signed-off-by: Weifeng Liu <weifeng.liu@intel.com>
Message-ID: <20250511073337.876650-6-weifeng.liu.z@gmail.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit 30aa105640b0a2a541744b6584d57c9a4b86debd)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/sdl2.c b/ui/sdl2.c
index cda4293a53..b00e421f7f 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -488,14 +488,14 @@ static void handle_mousemotion(SDL_Event *ev)
{
int max_x, max_y;
struct sdl2_console *scon = get_scon_from_window(ev->motion.windowID);
+ int scr_w, scr_h, surf_w, surf_h, x, y, dx, dy;
if (!scon || !qemu_console_is_graphic(scon->dcl.con)) {
return;
}
+ SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h);
if (qemu_input_is_absolute(scon->dcl.con) || absolute_enabled) {
- int scr_w, scr_h;
- SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h);
max_x = scr_w - 1;
max_y = scr_h - 1;
if (gui_grab && !gui_fullscreen
@@ -509,9 +509,14 @@ static void handle_mousemotion(SDL_Event *ev)
sdl_grab_start(scon);
}
}
+ surf_w = surface_width(scon->surface);
+ surf_h = surface_height(scon->surface);
+ x = (int64_t)ev->motion.x * surf_w / scr_w;
+ y = (int64_t)ev->motion.y * surf_h / scr_h;
+ dx = (int64_t)ev->motion.xrel * surf_w / scr_w;
+ dy = (int64_t)ev->motion.yrel * surf_h / scr_h;
if (gui_grab || qemu_input_is_absolute(scon->dcl.con) || absolute_enabled) {
- sdl_send_mouse_event(scon, ev->motion.xrel, ev->motion.yrel,
- ev->motion.x, ev->motion.y, ev->motion.state);
+ sdl_send_mouse_event(scon, dx, dy, x, y, ev->motion.state);
}
}
@@ -520,12 +525,17 @@ static void handle_mousebutton(SDL_Event *ev)
int buttonstate = SDL_GetMouseState(NULL, NULL);
SDL_MouseButtonEvent *bev;
struct sdl2_console *scon = get_scon_from_window(ev->button.windowID);
+ int scr_w, scr_h, x, y;
if (!scon || !qemu_console_is_graphic(scon->dcl.con)) {
return;
}
bev = &ev->button;
+ SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h);
+ x = (int64_t)bev->x * surface_width(scon->surface) / scr_w;
+ y = (int64_t)bev->y * surface_height(scon->surface) / scr_h;
+
if (!gui_grab && !qemu_input_is_absolute(scon->dcl.con)) {
if (ev->type == SDL_MOUSEBUTTONUP && bev->button == SDL_BUTTON_LEFT) {
/* start grabbing all events */
@@ -537,7 +547,7 @@ static void handle_mousebutton(SDL_Event *ev)
} else {
buttonstate &= ~SDL_BUTTON(bev->button);
}
- sdl_send_mouse_event(scon, 0, 0, bev->x, bev->y, buttonstate);
+ sdl_send_mouse_event(scon, 0, 0, x, y, buttonstate);
}
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 08/39] ui/vnc.c: replace big endian flag with byte order value
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (6 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 07/39] ui/sdl: Consider scaling in mouse event handling Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 09/39] ui/vnc: take account of client byte order in pixman format Michael Tokarev
` (31 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Daniel P. Berrangé, BALATON Zoltan,
Philippe Mathieu-Daudé, Michael Tokarev
From: Daniel P. Berrangé <berrange@redhat.com>
It will make it easier to do certain comparisons in future if we
store G_BIG_ENDIAN/G_LITTLE_ENDIAN directly, instead of a boolean
flag, as we can then compare directly to the G_BYTE_ORDER constant.
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 7ed96710e82c385c6cfc3d064eec7dde20f0f3fd)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 41f559eb83..f8aaa8f346 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -150,7 +150,7 @@ tight_detect_smooth_image24(VncState *vs, int w, int h)
* If client is big-endian, color samples begin from the second
* byte (offset 1) of a 32-bit pixel value.
*/
- off = vs->client_be;
+ off = vs->client_endian == G_BIG_ENDIAN ? 1 : 0;
memset(stats, 0, sizeof (stats));
diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c
index bd33b89063..97ec6c7119 100644
--- a/ui/vnc-enc-zrle.c
+++ b/ui/vnc-enc-zrle.c
@@ -255,7 +255,7 @@ static void zrle_write_u8(VncState *vs, uint8_t value)
static int zrle_send_framebuffer_update(VncState *vs, int x, int y,
int w, int h)
{
- bool be = vs->client_be;
+ bool be = vs->client_endian == G_BIG_ENDIAN;
size_t bytes;
int zywrle_level;
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index fcca7ec632..d3486af9e2 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -188,7 +188,7 @@ static void vnc_async_encoding_start(VncState *orig, VncState *local)
local->lossy_rect = orig->lossy_rect;
local->write_pixels = orig->write_pixels;
local->client_pf = orig->client_pf;
- local->client_be = orig->client_be;
+ local->client_endian = orig->client_endian;
local->tight = orig->tight;
local->zlib = orig->zlib;
local->hextile = orig->hextile;
diff --git a/ui/vnc.c b/ui/vnc.c
index 9241caaad9..d47879f579 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -893,7 +893,7 @@ void vnc_convert_pixel(VncState *vs, uint8_t *buf, uint32_t v)
buf[0] = v;
break;
case 2:
- if (vs->client_be) {
+ if (vs->client_endian == G_BIG_ENDIAN) {
buf[0] = v >> 8;
buf[1] = v;
} else {
@@ -903,7 +903,7 @@ void vnc_convert_pixel(VncState *vs, uint8_t *buf, uint32_t v)
break;
default:
case 4:
- if (vs->client_be) {
+ if (vs->client_endian == G_BIG_ENDIAN) {
buf[0] = v >> 24;
buf[1] = v >> 16;
buf[2] = v >> 8;
@@ -2314,7 +2314,7 @@ static void set_pixel_format(VncState *vs, int bits_per_pixel,
vs->client_pf.bits_per_pixel = bits_per_pixel;
vs->client_pf.bytes_per_pixel = bits_per_pixel / 8;
vs->client_pf.depth = bits_per_pixel == 32 ? 24 : bits_per_pixel;
- vs->client_be = big_endian_flag;
+ vs->client_endian = big_endian_flag ? G_BIG_ENDIAN : G_LITTLE_ENDIAN;
if (!true_color_flag) {
send_color_map(vs);
diff --git a/ui/vnc.h b/ui/vnc.h
index acc53a2cc1..02613aa63a 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -323,7 +323,7 @@ struct VncState
VncWritePixels *write_pixels;
PixelFormat client_pf;
pixman_format_code_t client_format;
- bool client_be;
+ int client_endian; /* G_LITTLE_ENDIAN or G_BIG_ENDIAN */
CaptureVoiceOut *audio_cap;
struct audsettings as;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 09/39] ui/vnc: take account of client byte order in pixman format
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (7 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 08/39] ui/vnc.c: replace big endian flag with byte order value Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 10/39] ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats Michael Tokarev
` (30 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Daniel P. Berrangé, Philippe Mathieu-Daudé,
Michael Tokarev
From: Daniel P. Berrangé <berrange@redhat.com>
The set_pixel_conversion() method is responsible for determining whether
the VNC client pixel format matches the server format, and thus whether
we can use the fast path "copy" impl for sending pixels, or must use
the generic impl with bit swizzling.
The VNC server format is set at build time to VNC_SERVER_FB_FORMAT,
which corresponds to PIXMAN_x8r8g8b8.
The qemu_pixman_get_format() method is then responsible for converting
the VNC pixel format into a pixman format.
The VNC client pixel shifts are relative to the associated endianness.
The pixman formats are always relative to the host native endianness.
The qemu_pixman_get_format() method does not take into account the
VNC client endianness, and is thus returning a pixman format that is
only valid with the host endianness matches that of the VNC client.
This has been broken since pixman was introduced to the VNC server:
commit 9f64916da20eea67121d544698676295bbb105a7
Author: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed Oct 10 13:29:43 2012 +0200
pixman/vnc: use pixman images in vnc.
The flaw can be demonstrated using the Tigervnc client by using
vncviewer -AutoSelect=0 -PreferredEncoding=raw server:display
connecting from a LE client to a QEMU on a BE server, or the
reverse.
The bug was masked, however, because almost all VNC clients will
advertize support for the "tight" encoding and the QEMU VNC server
will prefer "tight" if advertized.
The tight_pack24 method is responsible for taking a set of pixels
which have already been converted into client endianness and then
repacking them into the TPIXEL format which the RFB spec defines
as
"TPIXEL is only 3 bytes long, where the first byte is the
red component, the second byte is the green component,
and the third byte is the blue component of the pixel
color value"
IOW, the TPIXEL format is fixed on the wire, regardless of what
the VNC client declare as its endianness.
Since the VNC pixel encoding code was failing to honour the endian
flag of the client, the tight_pack24 method was always operating
on data in native endianness. Its impl cancelled out the VNC pixel
encoding bug.
With the VNC pixel encoding code now fixed, the tight_pack24 method
needs to take into account that it is operating on data in client
endianness, not native endianness. It thus may need to invert the
pixel shifts.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 70097442853c389a765c9f6502d861d182b092ae)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index 193bc046d1..2ca0ed7029 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -75,12 +75,12 @@ PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format);
pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian);
pixman_format_code_t qemu_drm_format_to_pixman(uint32_t drm_format);
uint32_t qemu_pixman_to_drm_format(pixman_format_code_t pixman);
-int qemu_pixman_get_type(int rshift, int gshift, int bshift);
+int qemu_pixman_get_type(int rshift, int gshift, int bshift, int endian);
bool qemu_pixman_check_format(DisplayChangeListener *dcl,
pixman_format_code_t format);
#ifdef CONFIG_PIXMAN
-pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf);
+pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf, int endian);
pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
int width);
void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb,
diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index 6ef4376f4e..ef4e71da11 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -126,33 +126,34 @@ uint32_t qemu_pixman_to_drm_format(pixman_format_code_t pixman_format)
return 0;
}
-int qemu_pixman_get_type(int rshift, int gshift, int bshift)
+int qemu_pixman_get_type(int rshift, int gshift, int bshift, int endian)
{
int type = PIXMAN_TYPE_OTHER;
+ bool native_endian = (endian == G_BYTE_ORDER);
if (rshift > gshift && gshift > bshift) {
if (bshift == 0) {
- type = PIXMAN_TYPE_ARGB;
+ type = native_endian ? PIXMAN_TYPE_ARGB : PIXMAN_TYPE_BGRA;
} else {
- type = PIXMAN_TYPE_RGBA;
+ type = native_endian ? PIXMAN_TYPE_RGBA : PIXMAN_TYPE_ABGR;
}
} else if (rshift < gshift && gshift < bshift) {
if (rshift == 0) {
- type = PIXMAN_TYPE_ABGR;
+ type = native_endian ? PIXMAN_TYPE_ABGR : PIXMAN_TYPE_RGBA;
} else {
- type = PIXMAN_TYPE_BGRA;
+ type = native_endian ? PIXMAN_TYPE_BGRA : PIXMAN_TYPE_ARGB;
}
}
return type;
}
#ifdef CONFIG_PIXMAN
-pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf)
+pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf, int endian)
{
pixman_format_code_t format;
int type;
- type = qemu_pixman_get_type(pf->rshift, pf->gshift, pf->bshift);
+ type = qemu_pixman_get_type(pf->rshift, pf->gshift, pf->bshift, endian);
format = PIXMAN_FORMAT(pf->bits_per_pixel, type,
pf->abits, pf->rbits, pf->gbits, pf->bbits);
if (!pixman_format_supported_source(format)) {
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index f8aaa8f346..a5bdc19ebb 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -891,7 +891,7 @@ static void tight_pack24(VncState *vs, uint8_t *buf, size_t count, size_t *ret)
buf8 = buf;
- if (1 /* FIXME */) {
+ if (vs->client_endian == G_BYTE_ORDER) {
rshift = vs->client_pf.rshift;
gshift = vs->client_pf.gshift;
bshift = vs->client_pf.bshift;
diff --git a/ui/vnc.c b/ui/vnc.c
index d47879f579..c96bd8ceea 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2242,7 +2242,8 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
static void set_pixel_conversion(VncState *vs)
{
- pixman_format_code_t fmt = qemu_pixman_get_format(&vs->client_pf);
+ pixman_format_code_t fmt = qemu_pixman_get_format(&vs->client_pf,
+ vs->client_endian);
if (fmt == VNC_SERVER_FB_FORMAT) {
vs->write_pixels = vnc_write_pixels_copy;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 10/39] ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (8 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 09/39] ui/vnc: take account of client byte order in pixman format Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 11/39] hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info Michael Tokarev
` (29 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Daniel P. Berrangé, Philippe Mathieu-Daudé,
Michael Tokarev
From: Daniel P. Berrangé <berrange@redhat.com>
When sending a tight rectangle with the palette filter, if the client
format was 8/16bpp, the colours on big endian hosts are not set as
we're sending the wrong bytes. We must first cast the 32-bit colour
to a 16/8-bit value, and then send the result.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 63d320909220a90647c484263ae5e2f26eb54587)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index a5bdc19ebb..25c7b2c788 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -1001,16 +1001,24 @@ static int send_mono_rect(VncState *vs, int x, int y,
break;
}
case 2:
- vnc_write(vs, &bg, 2);
- vnc_write(vs, &fg, 2);
+ {
+ uint16_t bg16 = bg;
+ uint16_t fg16 = fg;
+ vnc_write(vs, &bg16, 2);
+ vnc_write(vs, &fg16, 2);
tight_encode_mono_rect16(vs->tight->tight.buffer, w, h, bg, fg);
break;
+ }
default:
- vnc_write_u8(vs, bg);
- vnc_write_u8(vs, fg);
+ {
+ uint8_t bg8 = bg;
+ uint8_t fg8 = fg;
+ vnc_write_u8(vs, bg8);
+ vnc_write_u8(vs, fg8);
tight_encode_mono_rect8(vs->tight->tight.buffer, w, h, bg, fg);
break;
}
+ }
vs->tight->tight.offset = bytes;
bytes = tight_compress_data(vs, stream, bytes, level, Z_DEFAULT_STRATEGY);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 11/39] hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (9 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 10/39] ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 12/39] vhost: Don't set vring call if guest notifier is unused Michael Tokarev
` (28 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Guenter Roeck, Hao Wu, Peter Maydell,
Michael Tokarev
From: Guenter Roeck <linux@roeck-us.net>
Without psci_conduit, the Linux kernel crashes almost immediately.
psci: probing for conduit method from DT.
Internal error: Oops - Undefined instruction: 0000000002000000 [#1] PREEMPT SMP
Fixes: ae0c4d1a1290 ("hw/arm: Add NPCM8XX SoC")
Cc: qemu-stable@nongnu.org
Cc: Hao Wu <wuhaotsh@google.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Message-id: 20250315142050.3642741-1-linux@roeck-us.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit e6bc01777e5a4b6ecf3414b21a2d7b4846bf4817)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/arm/npcm8xx.c b/hw/arm/npcm8xx.c
index f182accc47..e5a1929ed7 100644
--- a/hw/arm/npcm8xx.c
+++ b/hw/arm/npcm8xx.c
@@ -346,6 +346,7 @@ static struct arm_boot_info npcm8xx_binfo = {
.secure_boot = false,
.board_id = -1,
.board_setup_addr = NPCM8XX_BOARD_SETUP_ADDR,
+ .psci_conduit = QEMU_PSCI_CONDUIT_SMC,
};
void npcm8xx_load_kernel(MachineState *machine, NPCM8xxState *soc)
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 12/39] vhost: Don't set vring call if guest notifier is unused
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (10 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 11/39] hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 13/39] hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine Michael Tokarev
` (27 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Huaitong Han, Zhiyuan Yuan, Jidong Xia,
Michael S. Tsirkin, Michael Tokarev
From: Huaitong Han <hanht2@chinatelecom.cn>
The vring call fd is set even when the guest does not use MSI-X (e.g., in the
case of virtio PMD), leading to unnecessary CPU overhead for processing
interrupts.
The commit 96a3d98d2c("vhost: don't set vring call if no vector") optimized the
case where MSI-X is enabled but the queue vector is unset. However, there's an
additional case where the guest uses INTx and the INTx_DISABLED bit in the PCI
config is set, meaning that no interrupt notifier will actually be used.
In such cases, the vring call fd should also be cleared to avoid redundant
interrupt handling.
Fixes: 96a3d98d2c("vhost: don't set vring call if no vector")
Reported-by: Zhiyuan Yuan <yuanzhiyuan@chinatelecom.cn>
Signed-off-by: Jidong Xia <xiajd@chinatelecom.cn>
Signed-off-by: Huaitong Han <hanht2@chinatelecom.cn>
Message-Id: <20250522100548.212740-1-hanht2@chinatelecom.cn>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit a9403bfcd93025df7b1924d0cf34fbc408955b33)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2844ec5556..503a897528 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1719,7 +1719,7 @@ static void pci_update_mappings(PCIDevice *d)
pci_update_vga(d);
}
-static inline int pci_irq_disabled(PCIDevice *d)
+int pci_irq_disabled(PCIDevice *d)
{
return pci_get_word(d->config + PCI_COMMAND) & PCI_COMMAND_INTX_DISABLE;
}
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 3ca3f849d3..e60ad843fc 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1215,7 +1215,12 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
static bool virtio_pci_query_guest_notifiers(DeviceState *d)
{
VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
- return msix_enabled(&proxy->pci_dev);
+
+ if (msix_enabled(&proxy->pci_dev)) {
+ return true;
+ } else {
+ return pci_irq_disabled(&proxy->pci_dev);
+ }
}
static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 822fbacdf0..7e382552b9 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -668,6 +668,7 @@ void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev);
qemu_irq pci_allocate_irq(PCIDevice *pci_dev);
void pci_set_irq(PCIDevice *pci_dev, int level);
+int pci_irq_disabled(PCIDevice *d);
static inline void pci_irq_assert(PCIDevice *pci_dev)
{
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 13/39] hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (11 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 12/39] vhost: Don't set vring call if guest notifier is unused Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 14/39] hw/i386/amd_iommu: Fix device setup failure when PT is on Michael Tokarev
` (26 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Bernhard Beschow, Mark Cave-Ayland,
Michael S. Tsirkin, Michael Tokarev
From: Bernhard Beschow <shentey@gmail.com>
Commit 56b1f50e3c10 ("hw/i386/pc: Wire RTC ISA IRQs in south bridges")
attempted to refactor RTC IRQ wiring which was previously done in
pc_basic_device_init() but forgot about the isapc machine. Fix this by
wiring in the code section dedicated exclusively to the isapc machine.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2961
Fixes: 56b1f50e3c10 ("hw/i386/pc: Wire RTC ISA IRQs in south bridges")
cc: qemu-stable
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Message-Id: <20250526203820.1853-1-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 0b006153b7ec66505cb2d231235aa19ca5d2ce37)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6c91e2d292..7cfa142b11 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -285,6 +285,8 @@ static void pc_init1(MachineState *machine, const char *pci_type)
pcms->idebus[0] = qdev_get_child_bus(dev, "ide.0");
pcms->idebus[1] = qdev_get_child_bus(dev, "ide.1");
} else {
+ uint32_t irq;
+
isa_bus = isa_bus_new(NULL, system_memory, system_io,
&error_abort);
isa_bus_register_input_irqs(isa_bus, x86ms->gsi);
@@ -292,6 +294,9 @@ static void pc_init1(MachineState *machine, const char *pci_type)
x86ms->rtc = isa_new(TYPE_MC146818_RTC);
qdev_prop_set_int32(DEVICE(x86ms->rtc), "base_year", 2000);
isa_realize_and_unref(x86ms->rtc, isa_bus, &error_fatal);
+ irq = object_property_get_uint(OBJECT(x86ms->rtc), "irq",
+ &error_fatal);
+ isa_connect_gpio_out(ISA_DEVICE(x86ms->rtc), 0, irq);
i8257_dma_init(OBJECT(machine), isa_bus, 0);
pcms->hpet_enabled = false;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 14/39] hw/i386/amd_iommu: Fix device setup failure when PT is on.
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (12 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 13/39] hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 15/39] hw/i386/amd_iommu: Fix xtsup when vcpus < 255 Michael Tokarev
` (25 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Sairaj Kodilkar, Vasant Hegde, Michael Tokarev
From: Sairaj Kodilkar <sarunkod@amd.com>
Commit c1f46999ef506 ("amd_iommu: Add support for pass though mode")
introduces the support for "pt" flag by enabling nodma memory when
"pt=off". This allowed VFIO devices to successfully register notifiers
by using nodma region.
But, This also broke things when guest is booted with the iommu=nopt
because, devices bypass the IOMMU and use untranslated addresses (IOVA) to
perform DMA reads/writes to the nodma memory region, ultimately resulting in
a failure to setup the devices in the guest.
Fix the above issue by always enabling the amdvi_dev_as->iommu memory region.
But this will once again cause VFIO devices to fail while registering the
notifiers with AMD IOMMU memory region.
Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode")
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Message-Id: <20250516100535.4980-2-sarunkod@amd.com>
Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode")
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
(cherry picked from commit 31753d5a336fbb4e9246397f4b90b6f611f27f22)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 5f9b952799..df8ba5d39a 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1426,7 +1426,6 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
AMDVIState *s = opaque;
AMDVIAddressSpace **iommu_as, *amdvi_dev_as;
int bus_num = pci_bus_num(bus);
- X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s);
iommu_as = s->address_spaces[bus_num];
@@ -1486,15 +1485,8 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
AMDVI_INT_ADDR_FIRST,
&amdvi_dev_as->iommu_ir, 1);
- if (!x86_iommu->pt_supported) {
- memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, false);
- memory_region_set_enabled(MEMORY_REGION(&amdvi_dev_as->iommu),
- true);
- } else {
- memory_region_set_enabled(MEMORY_REGION(&amdvi_dev_as->iommu),
- false);
- memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, true);
- }
+ memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, false);
+ memory_region_set_enabled(MEMORY_REGION(&amdvi_dev_as->iommu), true);
}
return &iommu_as[devfn]->as;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 15/39] hw/i386/amd_iommu: Fix xtsup when vcpus < 255
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (13 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 14/39] hw/i386/amd_iommu: Fix device setup failure when PT is on Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 16/39] audio: fix SIGSEGV in AUD_get_buffer_size_out() Michael Tokarev
` (24 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Vasant Hegde, Alejandro Jimenez,
Philippe Mathieu-Daudé, Joao Martins, Sairaj Kodilkar,
Michael Tokarev
From: Vasant Hegde <vasant.hegde@amd.com>
If vCPUs > 255 then x86 common code (x86_cpus_init()) call kvm_enable_x2apic().
But if vCPUs <= 255 then the common code won't calls kvm_enable_x2apic().
This is because commit 8c6619f3e692 ("hw/i386/amd_iommu: Simplify non-KVM
checks on XTSup feature") removed the call to kvm_enable_x2apic when xtsup
is "on", which break things when guest is booted with x2apic mode and
there are <= 255 vCPUs.
Fix this by adding back kvm_enable_x2apic() call when xtsup=on.
Fixes: 8c6619f3e692 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup feature")
Reported-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Tested-by: Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Message-Id: <20250516100535.4980-3-sarunkod@amd.com>
Fixes: 8c6619f3e692 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup feature")
Reported-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Tested-by: Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
(cherry picked from commit 0f178860df3489a9d3c19a5f7f024e6aa6c26515)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index df8ba5d39a..af85706b8a 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1649,6 +1649,14 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp)
exit(EXIT_FAILURE);
}
+ if (s->xtsup) {
+ if (kvm_irqchip_is_split() && !kvm_enable_x2apic()) {
+ error_report("AMD IOMMU xtsup=on requires x2APIC support on "
+ "the KVM side");
+ exit(EXIT_FAILURE);
+ }
+ }
+
pci_setup_iommu(bus, &amdvi_iommu_ops, s);
amdvi_init(s);
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 16/39] audio: fix SIGSEGV in AUD_get_buffer_size_out()
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (14 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 15/39] hw/i386/amd_iommu: Fix xtsup when vcpus < 255 Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 17/39] audio: fix size calculation " Michael Tokarev
` (23 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Volker Rümelin, Marc-André Lureau,
Michael Tokarev
From: Volker Rümelin <vr_qemu@t-online.de>
As far as the emulated audio devices are concerned the pointer
returned by AUD_open_out() is an opaque handle. This includes
the NULL pointer. In this case, AUD_get_buffer_size_out() should
return a sensible buffer size instead of triggering a segmentation
fault. All other public AUD_*_out() and audio_*_out() functions
handle this case.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20250515054429.7385-2-vr_qemu@t-online.de>
(cherry picked from commit 5ddd6c8dc849b4af44bd06840c9133d64e62c27c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/audio/audio.c b/audio/audio.c
index 41ee11aaad..70ef22b1a4 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -905,6 +905,10 @@ size_t AUD_read(SWVoiceIn *sw, void *buf, size_t size)
int AUD_get_buffer_size_out(SWVoiceOut *sw)
{
+ if (!sw) {
+ return 0;
+ }
+
return sw->hw->samples * sw->hw->info.bytes_per_frame;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 17/39] audio: fix size calculation in AUD_get_buffer_size_out()
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (15 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 16/39] audio: fix SIGSEGV in AUD_get_buffer_size_out() Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 18/39] hw/audio/asc: fix SIGSEGV in asc_realize() Michael Tokarev
` (22 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Volker Rümelin, Marc-André Lureau,
Michael Tokarev
From: Volker Rümelin <vr_qemu@t-online.de>
The buffer size calculated by AUD_get_buffer_size_out() is often
incorrect. sw->hw->samples * sw->hw->info.bytes_per_frame is the
size of the mixing engine buffer in audio frames multiplied by
the size of one frame of the audio backend. Due to resampling or
format conversion, the size of the frontend buffer can differ
significantly.
Return the correct buffer size when the mixing engine is used.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20250515054429.7385-3-vr_qemu@t-online.de>
(cherry picked from commit ccb4fec0e5f233cb61a83b3af59ae11716ea06c0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/audio/audio.c b/audio/audio.c
index 70ef22b1a4..3f5baf0cc6 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -909,6 +909,10 @@ int AUD_get_buffer_size_out(SWVoiceOut *sw)
return 0;
}
+ if (audio_get_pdo_out(sw->s->dev)->mixing_engine) {
+ return sw->resample_buf.size * sw->info.bytes_per_frame;
+ }
+
return sw->hw->samples * sw->hw->info.bytes_per_frame;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 18/39] hw/audio/asc: fix SIGSEGV in asc_realize()
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (16 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 17/39] audio: fix size calculation " Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 19/39] target/i386: Remove FRED dependency on WRMSRNS Michael Tokarev
` (21 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Volker Rümelin, Marc-André Lureau,
Mark Cave-Ayland, Michael Tokarev
From: Volker Rümelin <vr_qemu@t-online.de>
AUD_open_out() may fail and return NULL. This may then lead to
a segmentation fault in memset() below. The memset() behaviour
is undefined if the pointer to the destination object is a null
pointer.
Add the missing error handling code.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20250515054429.7385-4-vr_qemu@t-online.de>
(cherry picked from commit d009f26a54f573468be721590a19350c224bc730)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/audio/asc.c b/hw/audio/asc.c
index cc205bf063..b7d0fd8acd 100644
--- a/hw/audio/asc.c
+++ b/hw/audio/asc.c
@@ -12,6 +12,7 @@
#include "qemu/osdep.h"
#include "qemu/timer.h"
+#include "qapi/error.h"
#include "hw/sysbus.h"
#include "hw/irq.h"
#include "audio/audio.h"
@@ -654,6 +655,12 @@ static void asc_realize(DeviceState *dev, Error **errp)
s->voice = AUD_open_out(&s->card, s->voice, "asc.out", s, asc_out_cb,
&as);
+ if (!s->voice) {
+ AUD_remove_card(&s->card);
+ error_setg(errp, "Initializing audio stream failed");
+ return;
+ }
+
s->shift = 1;
s->samples = AUD_get_buffer_size_out(s->voice) >> s->shift;
s->mixbuf = g_malloc0(s->samples << s->shift);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 19/39] target/i386: Remove FRED dependency on WRMSRNS
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (17 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 18/39] hw/audio/asc: fix SIGSEGV in asc_realize() Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 20/39] iotests: fix 240 Michael Tokarev
` (20 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Xin Li (Intel), Xiaoyao Li, Paolo Bonzini,
Michael Tokarev
From: "Xin Li (Intel)" <xin@zytor.com>
WRMSRNS doesn't become a required feature for FERD, and Linux has
removed the dependency, as such remove it from Qemu.
Cc: qemu-stable@nongnu.org
Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250103084827.1820007-2-xin@zytor.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 0b901459a87a7fdbed36e574aae33e0635a3e9af)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 5e12cba1b8..2c9517f56d 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1774,10 +1774,6 @@ static FeatureDep feature_dependencies[] = {
.from = { FEAT_7_1_EAX, CPUID_7_1_EAX_LKGS },
.to = { FEAT_7_1_EAX, CPUID_7_1_EAX_FRED },
},
- {
- .from = { FEAT_7_1_EAX, CPUID_7_1_EAX_WRMSRNS },
- .to = { FEAT_7_1_EAX, CPUID_7_1_EAX_FRED },
- },
{
.from = { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX },
.to = { FEAT_7_0_ECX, CPUID_7_0_ECX_SGX_LC },
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 20/39] iotests: fix 240
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (18 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 19/39] target/i386: Remove FRED dependency on WRMSRNS Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 21/39] hw/core/qdev-properties-system: Add missing return in set_drive_helper() Michael Tokarev
` (19 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Stefan Hajnoczi, Thomas Huth, Eric Blake, Kevin Wolf,
Michael Tokarev
From: Stefan Hajnoczi <stefanha@redhat.com>
Commit 2e8e18c2e463 ("virtio-scsi: add iothread-vq-mapping parameter")
removed the limitation that virtio-scsi devices must successfully set
the AioContext on their BlockBackends. This was made possible thanks to
the QEMU multi-queue block layer.
This change broke qemu-iotests 240, which checks that adding a
virtio-scsi device with a drive that is already in another AioContext
will fail.
Update the test to take the relaxed behavior into account. I considered
removing this test case entirely, but the code coverage still seems
valuable.
Fixes: 2e8e18c2e463 ("virtio-scsi: add iothread-vq-mapping parameter")
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Message-ID: <20250529203147.180338-1-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 2e887187454e57d04522099d4f04d17137d6e05c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240
index 9b281e1dc0..f8af9ff648 100755
--- a/tests/qemu-iotests/240
+++ b/tests/qemu-iotests/240
@@ -81,8 +81,6 @@ class TestCase(iotests.QMPTestCase):
self.vm.qmp_log('device_del', id='scsi-hd0')
self.vm.event_wait('DEVICE_DELETED')
- self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0', bus="scsi1.0")
-
self.vm.qmp_log('device_del', id='scsi-hd1')
self.vm.event_wait('DEVICE_DELETED')
self.vm.qmp_log('blockdev-del', node_name='hd0')
diff --git a/tests/qemu-iotests/240.out b/tests/qemu-iotests/240.out
index 89ed25e506..10dcc42e06 100644
--- a/tests/qemu-iotests/240.out
+++ b/tests/qemu-iotests/240.out
@@ -46,10 +46,8 @@
{"execute": "device_add", "arguments": {"bus": "scsi0.0", "drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd0"}}
{"return": {}}
{"execute": "device_add", "arguments": {"bus": "scsi1.0", "drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd1"}}
-{"error": {"class": "GenericError", "desc": "Cannot change iothread of active block backend"}}
-{"execute": "device_del", "arguments": {"id": "scsi-hd0"}}
{"return": {}}
-{"execute": "device_add", "arguments": {"bus": "scsi1.0", "drive": "hd0", "driver": "scsi-hd", "id": "scsi-hd1"}}
+{"execute": "device_del", "arguments": {"id": "scsi-hd0"}}
{"return": {}}
{"execute": "device_del", "arguments": {"id": "scsi-hd1"}}
{"return": {}}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 21/39] hw/core/qdev-properties-system: Add missing return in set_drive_helper()
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (19 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 20/39] iotests: fix 240 Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 22/39] hw/loongarch/virt: Fix big endian support with MCFG table Michael Tokarev
` (18 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Fiona Ebner, Daniel P. Berrangé, Kevin Wolf,
Michael Tokarev
From: Fiona Ebner <f.ebner@proxmox.com>
Currently, changing the 'drive' property of e.g. a scsi-hd object will
result in an assertion failure if the aio context of the block node
it's replaced with doesn't match the current aio context:
> bdrv_replace_child_noperm: Assertion `bdrv_get_aio_context(old_bs) ==
> bdrv_get_aio_context(new_bs)' failed.
The problematic scenario is already detected, but a 'return' statement
was missing.
Cc: qemu-stable@nongnu.org
Fixes: d1a58c176a ("qdev: allow setting drive property for realized device")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20250523070211.280498-1-f.ebner@proxmox.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit eef2dd03f948a512499775043bdc0c5c88d8a2dd)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index a7dde73c29..6b73127123 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -145,6 +145,7 @@ static void set_drive_helper(Object *obj, Visitor *v, const char *name,
if (ctx != bdrv_get_aio_context(bs)) {
error_setg(errp, "Different aio context is not supported for new "
"node");
+ return;
}
blk_replace_bs(blk, bs, errp);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 22/39] hw/loongarch/virt: Fix big endian support with MCFG table
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (20 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 21/39] hw/core/qdev-properties-system: Add missing return in set_drive_helper() Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 23/39] hw/arm/virt: Check bypass iommu is not set for iommu-map DT property Michael Tokarev
` (17 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Bibo Mao, Song Gao, Michael Tokarev
From: Bibo Mao <maobibo@loongson.cn>
With API build_mcfg(), it is not necessary with parameter structure
AcpiMcfgInfo to convert to little endian since it is directly used
with host native endian.
Here remove endian conversion before calling function build_mcfg().
With this patch, bios-tables-test passes to run on big endian host
machine S390.
Fixes: 735143f10d3e ("hw/loongarch: Add acpi ged support")
Cc: qemu-stable@nongnu.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20250604065502.1114098-2-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
(cherry picked from commit 9c55c03c05c1899521ff0c991b9296633d759890)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/loongarch/virt-acpi-build.c b/hw/loongarch/virt-acpi-build.c
index fced6c445a..24ccb580bd 100644
--- a/hw/loongarch/virt-acpi-build.c
+++ b/hw/loongarch/virt-acpi-build.c
@@ -575,8 +575,8 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
acpi_add_table(table_offsets, tables_blob);
{
AcpiMcfgInfo mcfg = {
- .base = cpu_to_le64(VIRT_PCI_CFG_BASE),
- .size = cpu_to_le64(VIRT_PCI_CFG_SIZE),
+ .base = VIRT_PCI_CFG_BASE,
+ .size = VIRT_PCI_CFG_SIZE,
};
build_mcfg(tables_blob, tables->linker, &mcfg, lvms->oem_id,
lvms->oem_table_id);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 23/39] hw/arm/virt: Check bypass iommu is not set for iommu-map DT property
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (21 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 22/39] hw/loongarch/virt: Fix big endian support with MCFG table Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 24/39] qemu-options.hx: Fix reversed description of icount sleep behavior Michael Tokarev
` (16 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Shameer Kolothum, Eric Auger, Donald Dutile,
Peter Maydell, Michael Tokarev
From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
default_bus_bypass_iommu tells us whether the bypass_iommu is set
for the default PCIe root bus. Make sure we check that before adding
the "iommu-map" DT property.
Cc: qemu-stable@nongnu.org
Fixes: 6d7a85483a06 ("hw/arm/virt: Add default_bus_bypass_iommu machine option")
Suggested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Donald Dutile <ddutile@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20250602114655.42920-1-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit f5ec751ee70d7960a97c6c675f69e924d82dc60d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a96452f17a..0e78616aac 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1492,9 +1492,12 @@ static void create_virtio_iommu_dt_bindings(VirtMachineState *vms)
qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle);
g_free(node);
- qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map",
- 0x0, vms->iommu_phandle, 0x0, bdf,
- bdf + 1, vms->iommu_phandle, bdf + 1, 0xffff - bdf);
+ if (!vms->default_bus_bypass_iommu) {
+ qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map",
+ 0x0, vms->iommu_phandle, 0x0, bdf,
+ bdf + 1, vms->iommu_phandle, bdf + 1,
+ 0xffff - bdf);
+ }
}
static void create_pcie(VirtMachineState *vms)
@@ -1617,8 +1620,10 @@ static void create_pcie(VirtMachineState *vms)
switch (vms->iommu) {
case VIRT_IOMMU_SMMUV3:
create_smmu(vms, vms->bus);
- qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map",
- 0x0, vms->iommu_phandle, 0x0, 0x10000);
+ if (!vms->default_bus_bypass_iommu) {
+ qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map",
+ 0x0, vms->iommu_phandle, 0x0, 0x10000);
+ }
break;
default:
g_assert_not_reached();
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 24/39] qemu-options.hx: Fix reversed description of icount sleep behavior
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (22 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 23/39] hw/arm/virt: Check bypass iommu is not set for iommu-map DT property Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 25/39] hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions Michael Tokarev
` (15 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Ethan Chen, Peter Maydell, Michael Tokarev
From: Ethan Chen <ethan84@andestech.com>
The documentation for the -icount option incorrectly describes the behavior
of the sleep suboption. Based on the actual implementation and system
behavior, the effects of sleep=on and sleep=off were inadvertently reversed.
This commit updates the description to reflect their intended functionality.
Cc: qemu-stable@nongnu.org
Fixes: fa647905e6ba ("qemu-options.hx: Fix minor issues in icount documentation")
Signed-off-by: Ethan Chen <ethan84@andestech.com>
Message-id: 20250606095728.3672832-1-ethan84@andestech.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit e372214e663a4370fe064f7867f402eade37357e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/qemu-options.hx b/qemu-options.hx
index dc694a99a3..396eea7ef2 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4936,13 +4936,13 @@ SRST
with actual performance.
When the virtual cpu is sleeping, the virtual time will advance at
- default speed unless ``sleep=on`` is specified. With
- ``sleep=on``, the virtual time will jump to the next timer
+ default speed unless ``sleep=off`` is specified. With
+ ``sleep=off``, the virtual time will jump to the next timer
deadline instantly whenever the virtual cpu goes to sleep mode and
will not advance if no timer is enabled. This behavior gives
deterministic execution times from the guest point of view.
- The default if icount is enabled is ``sleep=off``.
- ``sleep=on`` cannot be used together with either ``shift=auto``
+ The default if icount is enabled is ``sleep=on``.
+ ``sleep=off`` cannot be used together with either ``shift=auto``
or ``align=on``.
``align=on`` will activate the delay algorithm which will try to
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 25/39] hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (23 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 24/39] qemu-options.hx: Fix reversed description of icount sleep behavior Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 26/39] linux-user/arm: Fix return value of SYS_cacheflush Michael Tokarev
` (14 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Peter Maydell, Corentin GENDRE, Alex Bennée,
Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The AN500 application note documents that it configures the Cortex-M7
CPU to have 16 MPU regions. We weren't doing this in our emulation,
so the CPU had only the default 8 MPU regions. Set the mpu-ns-regions
property to 16 for this board.
This bug doesn't affect any of the other board types we model in
this source file, because they all use either the Cortex-M3 or
Cortex-M4. Those CPUs do not have an RTL configurable number of
MPU regions, and always provide 8 regions if the MPU is built in.
Cc: qemu-stable@nongnu.org
Reported-by: Corentin GENDRE <cocotroupe20@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20250605141801.1083266-1-peter.maydell@linaro.org
(cherry picked from commit cd38e638c43e4d5d3fd65dd4529c2e6153c9c408)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 3f8db0cab6..313c401eb8 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -224,7 +224,11 @@ static void mps2_common_init(MachineState *machine)
switch (mmc->fpga_type) {
case FPGA_AN385:
case FPGA_AN386:
+ qdev_prop_set_uint32(armv7m, "num-irq", 32);
+ break;
case FPGA_AN500:
+ /* The AN500 configures its Cortex-M7 with 16 MPU regions */
+ qdev_prop_set_uint32(armv7m, "mpu-ns-regions", 16);
qdev_prop_set_uint32(armv7m, "num-irq", 32);
break;
case FPGA_AN511:
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 26/39] linux-user/arm: Fix return value of SYS_cacheflush
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (24 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 25/39] hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 27/39] target/loongarch: add check for fcond Michael Tokarev
` (13 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, J. Neuschäfer, Peter Maydell, Michael Tokarev
From: J. Neuschäfer <j.neuschaefer@gmx.net>
Although the emulated cacheflush syscall does nothing, it still needs to
return zero to indicate success.
Cc: qemu-stable@nongnu.org
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
Message-id: 20250613-cache-v1-1-ee9f4a9ba81b@gmx.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 5ad2b1f443a96444cf3e7a2fbe17aae696201012)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c
index 7416e3216e..098b54d10e 100644
--- a/linux-user/arm/cpu_loop.c
+++ b/linux-user/arm/cpu_loop.c
@@ -362,6 +362,7 @@ void cpu_loop(CPUARMState *env)
switch (n) {
case ARM_NR_cacheflush:
/* nop */
+ env->regs[0] = 0;
break;
case ARM_NR_set_tls:
cpu_set_tls(env, env->regs[0]);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 27/39] target/loongarch: add check for fcond
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (25 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 26/39] linux-user/arm: Fix return value of SYS_cacheflush Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 28/39] target/loongarch: fix vldi/xvldi raise wrong error Michael Tokarev
` (12 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Song Gao, Richard Henderson, Michael Tokarev
From: Song Gao <gaosong@loongson.cn>
fcond only has 22 types, add a check for fcond.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2972
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250603024810.350510-1-gaosong@loongson.cn>
(cherry picked from commit e7788da9860c97920c19fa1150806186513ef256)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/loongarch/tcg/insn_trans/trans_fcmp.c.inc b/target/loongarch/tcg/insn_trans/trans_fcmp.c.inc
index 3babf69e4a..6a2c030a6b 100644
--- a/target/loongarch/tcg/insn_trans/trans_fcmp.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_fcmp.c.inc
@@ -4,10 +4,15 @@
*/
/* bit0(signaling/quiet) bit1(lt) bit2(eq) bit3(un) bit4(neq) */
-static uint32_t get_fcmp_flags(int cond)
+static uint32_t get_fcmp_flags(DisasContext *ctx, int cond)
{
uint32_t flags = 0;
+ /*check cond , cond =[0-8,10,12] */
+ if ((cond > 8) &&(cond != 10) && (cond != 12)) {
+ return -1;
+ }
+
if (cond & 0x1) {
flags |= FCMP_LT;
}
@@ -26,9 +31,14 @@ static uint32_t get_fcmp_flags(int cond)
static bool trans_fcmp_cond_s(DisasContext *ctx, arg_fcmp_cond_s *a)
{
TCGv var, src1, src2;
- uint32_t flags;
+ uint32_t flags = get_fcmp_flags(ctx, a->fcond >>1);
void (*fn)(TCGv, TCGv_env, TCGv, TCGv, TCGv_i32);
+ if (flags == -1) {
+ generate_exception(ctx, EXCCODE_INE);
+ return true;
+ }
+
if (!avail_FP_SP(ctx)) {
return false;
}
@@ -39,8 +49,6 @@ static bool trans_fcmp_cond_s(DisasContext *ctx, arg_fcmp_cond_s *a)
src1 = get_fpr(ctx, a->fj);
src2 = get_fpr(ctx, a->fk);
fn = (a->fcond & 1 ? gen_helper_fcmp_s_s : gen_helper_fcmp_c_s);
- flags = get_fcmp_flags(a->fcond >> 1);
-
fn(var, tcg_env, src1, src2, tcg_constant_i32(flags));
tcg_gen_st8_tl(var, tcg_env, offsetof(CPULoongArchState, cf[a->cd]));
@@ -50,9 +58,14 @@ static bool trans_fcmp_cond_s(DisasContext *ctx, arg_fcmp_cond_s *a)
static bool trans_fcmp_cond_d(DisasContext *ctx, arg_fcmp_cond_d *a)
{
TCGv var, src1, src2;
- uint32_t flags;
+ uint32_t flags = get_fcmp_flags(ctx, a->fcond >> 1);
void (*fn)(TCGv, TCGv_env, TCGv, TCGv, TCGv_i32);
+ if (flags == -1) {
+ generate_exception(ctx, EXCCODE_INE);
+ return true;
+ }
+
if (!avail_FP_DP(ctx)) {
return false;
}
@@ -63,8 +76,6 @@ static bool trans_fcmp_cond_d(DisasContext *ctx, arg_fcmp_cond_d *a)
src1 = get_fpr(ctx, a->fj);
src2 = get_fpr(ctx, a->fk);
fn = (a->fcond & 1 ? gen_helper_fcmp_s_d : gen_helper_fcmp_c_d);
- flags = get_fcmp_flags(a->fcond >> 1);
-
fn(var, tcg_env, src1, src2, tcg_constant_i32(flags));
tcg_gen_st8_tl(var, tcg_env, offsetof(CPULoongArchState, cf[a->cd]));
diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
index dff92772ad..d6f0560349 100644
--- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
@@ -4655,19 +4655,23 @@ TRANS(xvslti_du, LASX, do_xcmpi, MO_64, TCG_COND_LTU)
static bool do_vfcmp_cond_s(DisasContext *ctx, arg_vvv_fcond *a, uint32_t sz)
{
- uint32_t flags;
+ uint32_t flags = get_fcmp_flags(ctx, a->fcond >> 1);
void (*fn)(TCGv_env, TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32);
TCGv_i32 vd = tcg_constant_i32(a->vd);
TCGv_i32 vj = tcg_constant_i32(a->vj);
TCGv_i32 vk = tcg_constant_i32(a->vk);
TCGv_i32 oprsz = tcg_constant_i32(sz);
+ if(flags == -1){
+ generate_exception(ctx, EXCCODE_INE);
+ return true;
+ }
+
if (!check_vec(ctx, sz)) {
return true;
}
fn = (a->fcond & 1 ? gen_helper_vfcmp_s_s : gen_helper_vfcmp_c_s);
- flags = get_fcmp_flags(a->fcond >> 1);
fn(tcg_env, oprsz, vd, vj, vk, tcg_constant_i32(flags));
return true;
@@ -4675,19 +4679,23 @@ static bool do_vfcmp_cond_s(DisasContext *ctx, arg_vvv_fcond *a, uint32_t sz)
static bool do_vfcmp_cond_d(DisasContext *ctx, arg_vvv_fcond *a, uint32_t sz)
{
- uint32_t flags;
+ uint32_t flags = get_fcmp_flags(ctx, a->fcond >> 1);
void (*fn)(TCGv_env, TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32);
TCGv_i32 vd = tcg_constant_i32(a->vd);
TCGv_i32 vj = tcg_constant_i32(a->vj);
TCGv_i32 vk = tcg_constant_i32(a->vk);
TCGv_i32 oprsz = tcg_constant_i32(sz);
+ if (flags == -1) {
+ generate_exception(ctx, EXCCODE_INE);
+ return true;
+ }
+
if (!check_vec(ctx, sz)) {
return true;
}
fn = (a->fcond & 1 ? gen_helper_vfcmp_s_d : gen_helper_vfcmp_c_d);
- flags = get_fcmp_flags(a->fcond >> 1);
fn(tcg_env, oprsz, vd, vj, vk, tcg_constant_i32(flags));
return true;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 28/39] target/loongarch: fix vldi/xvldi raise wrong error
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (26 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 27/39] target/loongarch: add check for fcond Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 29/39] tcg: Fix constant propagation in tcg_reg_alloc_dup Michael Tokarev
` (11 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Song Gao, Bibo Mao, Richard Henderson,
Michael Tokarev
From: Song Gao <gaosong@loongson.cn>
on qemu we got an aborted error
**
ERROR:../target/loongarch/tcg/insn_trans/trans_vec.c.inc:3574:vldi_get_value: code should not be reached
Bail out! ERROR:../target/loongarch/tcg/insn_trans/trans_vec.c.inc:3574:vldi_get_value: code should not be reached
Aborted (core dumped)
but on 3A600/3A5000 we got a "Illegal instruction" error.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971
Fixes: 29bb5d727ff ("target/loongarch: Implement vldi")
Cc: qemu-stable@nongnu.org
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
(cherry picked from commit c2a2e1ad2a749caa864281b1d4dc3f16c3f344f6)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
index d6f0560349..78730029cb 100644
--- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
@@ -3465,7 +3465,7 @@ TRANS(xvmsknz_b, LASX, gen_xx, gen_helper_vmsknz_b)
static uint64_t vldi_get_value(DisasContext *ctx, uint32_t imm)
{
int mode;
- uint64_t data, t;
+ uint64_t data = 0, t;
/*
* imm bit [11:8] is mode, mode value is 0-12.
@@ -3570,17 +3570,26 @@ static uint64_t vldi_get_value(DisasContext *ctx, uint32_t imm)
}
break;
default:
- generate_exception(ctx, EXCCODE_INE);
g_assert_not_reached();
}
return data;
}
+static bool check_valid_vldi_mode(arg_vldi *a)
+{
+ return extract32(a->imm, 8, 4) <= 12;
+}
+
static bool gen_vldi(DisasContext *ctx, arg_vldi *a, uint32_t oprsz)
{
int sel, vece;
uint64_t value;
+ if (!check_valid_vldi_mode(a)) {
+ generate_exception(ctx, EXCCODE_INE);
+ return true;
+ }
+
if (!check_vec(ctx, oprsz)) {
return true;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 29/39] tcg: Fix constant propagation in tcg_reg_alloc_dup
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (27 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 28/39] target/loongarch: fix vldi/xvldi raise wrong error Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 30/39] target/arm: Make RETA[AB] UNDEF when pauth is not implemented Michael Tokarev
` (10 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
The scalar constant must be replicated for dup.
Cc: qemu-stable@nongnu.org
Fixes: bab1671f0fa ("tcg: Manually expand INDEX_op_dup_vec")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3002
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit 0d0fc3f4658937fb81fcc16a89738e83bd8d4795)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/tcg/tcg.c b/tcg/tcg.c
index dfd48b8264..b1a7465df2 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -4927,7 +4927,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op)
if (its->val_type == TEMP_VAL_CONST) {
/* Propagate constant via movi -> dupi. */
- tcg_target_ulong val = its->val;
+ tcg_target_ulong val = dup_const(vece, its->val);
if (IS_DEAD_ARG(1)) {
temp_dead(s, its);
}
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 30/39] target/arm: Make RETA[AB] UNDEF when pauth is not implemented
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (28 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 29/39] tcg: Fix constant propagation in tcg_reg_alloc_dup Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 31/39] target/arm: Correct KVM & HVF dtb_compatible value Michael Tokarev
` (9 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Solomon Tan, Alex Bennée, Richard Henderson,
Peter Maydell, Michael Tokarev
From: Solomon Tan <root@wjsota.com>
According to the Arm A-profile A64 Instruction Set Architecture,
RETA[AB] should be decoded as UNDEF if the pauth feature is not
implemented.
We got this right in the initial implementation, but accidentally
dropped the feature-check when we converted these insns to
decodetree.
Cc: qemu-stable@nongnu.org
Fixes: 0ebbe9021254f ("target/arm: Convert BRA[AB]Z, BLR[AB]Z, RETA[AB] to decodetree")
Signed-off-by: Solomon Tan <root@wjsota.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250616171549.59190-1-root@wjsota.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 9a3bf0e0ab628de7051b41a88c4628aa9e4d311b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 39014325df..f6e88eb5f7 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -1821,6 +1821,10 @@ static bool trans_RETA(DisasContext *s, arg_reta *a)
{
TCGv_i64 dst;
+ if (!dc_isar_feature(aa64_pauth, s)) {
+ return false;
+ }
+
dst = auth_branch_target(s, cpu_reg(s, 30), cpu_X[31], !a->m);
gen_a64_set_pc(s, dst);
s->base.is_jmp = DISAS_JUMP;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 31/39] target/arm: Correct KVM & HVF dtb_compatible value
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (29 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 30/39] target/arm: Make RETA[AB] UNDEF when pauth is not implemented Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 32/39] virtio-gpu: support context init multiple timeline Michael Tokarev
` (8 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Philippe Mathieu-Daudé, Richard Henderson,
Peter Maydell, Michael Tokarev
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Linux kernel knows how to parse "arm,armv8", not "arm,arm-v8".
See arch/arm64/boot/dts/foundation-v8.dts:
https://github.com/torvalds/linux/commit/90556ca1ebdd
Cc: qemu-stable@nongnu.org
Fixes: 26861c7ce06 ("target-arm: Add minimal KVM AArch64 support")
Fixes: 585df85efea ("hvf: arm: Implement -cpu host")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250623121845.7214-10-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit a412575837b6a46584fba891e3706e87bd09a3e6)
(Mjt: context fix in target/arm/kvm.c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 2439af63a0..01e26a9726 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -878,7 +878,7 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
hv_vcpu_exit_t *exit;
int i;
- ahcf->dtb_compatible = "arm,arm-v8";
+ ahcf->dtb_compatible = "arm,armv8";
ahcf->features = (1ULL << ARM_FEATURE_V8) |
(1ULL << ARM_FEATURE_NEON) |
(1ULL << ARM_FEATURE_AARCH64) |
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index da30bdbb23..e1b87116db 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -305,7 +305,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
}
ahcf->target = init.target;
- ahcf->dtb_compatible = "arm,arm-v8";
+ ahcf->dtb_compatible = "arm,armv8";
err = read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64pfr0,
ARM64_SYS_REG(3, 0, 0, 4, 0));
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 32/39] virtio-gpu: support context init multiple timeline
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (30 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 31/39] target/arm: Correct KVM & HVF dtb_compatible value Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 33/39] hw/s390x/ccw-device: Fix memory leak in loadparm setter Michael Tokarev
` (7 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Yiwei Zhang, Dmitry Osipenko, Alex Bennée,
Akihiko Odaki, Michael Tokarev
From: Yiwei Zhang <zzyiwei@gmail.com>
Venus and later native contexts have their own fence context along with
multiple timelines within. Fences wtih VIRTIO_GPU_FLAG_INFO_RING_IDX in
the flags must be dispatched to be created on the target context. Fence
signaling also has to be handled on the specific timeline within that
target context.
Before this change, venus fencing is completely broken if the host
driver doesn't support implicit fencing with external memory objects.
Frames can go backwards along with random artifacts on screen if the
host driver doesn't attach an implicit fence to the render target. The
symptom could be hidden by certain guest wsi backend that waits on a
venus native VkFence object for the actual payload with limited present
modes or under special configs. e.g. x11 mailbox or xwayland.
After this change, everything related to venus fencing starts making
sense. Confirmed this via guest and host side perfetto tracing.
Cc: qemu-stable@nongnu.org
Fixes: 94d0ea1c1928 ("virtio-gpu: Support Venus context")
Signed-off-by: Yiwei Zhang <zzyiwei@gmail.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Message-Id: <20250518152651.334115-1-zzyiwei@gmail.com>
[AJB: remove version history from commit message]
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Message-ID: <20250627112512.1880708-16-alex.bennee@linaro.org>
(cherry picked from commit 1fa2ffdbec55d84326e22f046bc3e26322836f5a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 145a0b3879..94ddc01f91 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -970,6 +970,15 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g,
}
trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type);
+#if VIRGL_VERSION_MAJOR >= 1
+ if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX) {
+ virgl_renderer_context_create_fence(cmd->cmd_hdr.ctx_id,
+ VIRGL_RENDERER_FENCE_FLAG_MERGEABLE,
+ cmd->cmd_hdr.ring_idx,
+ cmd->cmd_hdr.fence_id);
+ return;
+ }
+#endif
virgl_renderer_create_fence(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type);
}
@@ -983,6 +992,11 @@ static void virgl_write_fence(void *opaque, uint32_t fence)
* the guest can end up emitting fences out of order
* so we should check all fenced cmds not just the first one.
*/
+#if VIRGL_VERSION_MAJOR >= 1
+ if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX) {
+ continue;
+ }
+#endif
if (cmd->cmd_hdr.fence_id > fence) {
continue;
}
@@ -997,6 +1011,29 @@ static void virgl_write_fence(void *opaque, uint32_t fence)
}
}
+#if VIRGL_VERSION_MAJOR >= 1
+static void virgl_write_context_fence(void *opaque, uint32_t ctx_id,
+ uint32_t ring_idx, uint64_t fence_id) {
+ VirtIOGPU *g = opaque;
+ struct virtio_gpu_ctrl_command *cmd, *tmp;
+
+ QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) {
+ if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX &&
+ cmd->cmd_hdr.ctx_id == ctx_id && cmd->cmd_hdr.ring_idx == ring_idx &&
+ cmd->cmd_hdr.fence_id <= fence_id) {
+ trace_virtio_gpu_fence_resp(cmd->cmd_hdr.fence_id);
+ virtio_gpu_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA);
+ QTAILQ_REMOVE(&g->fenceq, cmd, next);
+ g_free(cmd);
+ g->inflight--;
+ if (virtio_gpu_stats_enabled(g->parent_obj.conf)) {
+ trace_virtio_gpu_dec_inflight_fences(g->inflight);
+ }
+ }
+ }
+}
+#endif
+
static virgl_renderer_gl_context
virgl_create_context(void *opaque, int scanout_idx,
struct virgl_renderer_gl_ctx_param *params)
@@ -1031,11 +1068,18 @@ static int virgl_make_context_current(void *opaque, int scanout_idx,
}
static struct virgl_renderer_callbacks virtio_gpu_3d_cbs = {
+#if VIRGL_VERSION_MAJOR >= 1
+ .version = 3,
+#else
.version = 1,
+#endif
.write_fence = virgl_write_fence,
.create_gl_context = virgl_create_context,
.destroy_gl_context = virgl_destroy_context,
.make_current = virgl_make_context_current,
+#if VIRGL_VERSION_MAJOR >= 1
+ .write_context_fence = virgl_write_context_fence,
+#endif
};
static void virtio_gpu_print_stats(void *opaque)
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 33/39] hw/s390x/ccw-device: Fix memory leak in loadparm setter
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (31 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 32/39] virtio-gpu: support context init multiple timeline Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 34/39] target/arm: Fix SME vs AdvSIMD exception priority Michael Tokarev
` (6 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, Kevin Wolf, Eric Farman, Halil Pasic, Thomas Huth,
Michael Tokarev
From: Kevin Wolf <kwolf@redhat.com>
Commit bdf12f2a fixed the setter for the "loadparm" machine property,
which gets a string from a visitor, passes it to s390_ipl_fmt_loadparm()
and then forgot to free it. It left another instance of the same problem
unfixed in the "loadparm" device property. Fix it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250625082751.24896-1-kwolf@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 78e3781541209b3dcd6f4bb66adf3a3e504b88a4)
(Mjt: bdf12f2a is 8efe1592 in stable-10.0 branch)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c
index 1ea9934f6c..a5ee9dc84d 100644
--- a/hw/s390x/ccw-device.c
+++ b/hw/s390x/ccw-device.c
@@ -57,7 +57,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor *v,
Error **errp)
{
CcwDevice *dev = CCW_DEVICE(obj);
- char *val;
+ g_autofree char *val = NULL;
int index;
index = object_property_get_int(obj, "bootindex", NULL);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 34/39] target/arm: Fix SME vs AdvSIMD exception priority
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (32 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 33/39] hw/s390x/ccw-device: Fix memory leak in loadparm setter Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 35/39] target/arm: Fix sve_access_check for SME Michael Tokarev
` (5 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Peter Maydell, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
We failed to raise an exception when
sme_excp_el == 0 and fp_excp_el == 1.
Cc: qemu-stable@nongnu.org
Fixes: 3d74825f4d6 ("target/arm: Add SME enablement checks")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250704142112.1018902-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit f9b0f69304071384b12912bf9dd78e9ffd261cec)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index f6e88eb5f7..aebf313e38 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -1499,7 +1499,8 @@ bool sme_enabled_check(DisasContext *s)
* to be zero when fp_excp_el has priority. This is because we need
* sme_excp_el by itself for cpregs access checks.
*/
- if (!s->fp_excp_el || s->sme_excp_el < s->fp_excp_el) {
+ if (s->sme_excp_el
+ && (!s->fp_excp_el || s->sme_excp_el <= s->fp_excp_el)) {
bool ret = sme_access_check(s);
s->fp_access_checked = (ret ? 1 : -1);
return ret;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 35/39] target/arm: Fix sve_access_check for SME
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (33 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 34/39] target/arm: Fix SME vs AdvSIMD exception priority Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 36/39] target/arm: Fix 128-bit element ZIP, UZP, TRN Michael Tokarev
` (4 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Peter Maydell, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
Do not assume SME implies SVE. Ensure that the non-streaming
check is present along the SME path, since it is not implied
by sme_*_enabled_check.
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250704142112.1018902-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit b4b2e070f41dd8774a70c6186141678558d79a38)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index aebf313e38..8d3a8d7a25 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -1392,11 +1392,8 @@ static bool fp_access_check_only(DisasContext *s)
return true;
}
-static bool fp_access_check(DisasContext *s)
+static bool nonstreaming_check(DisasContext *s)
{
- if (!fp_access_check_only(s)) {
- return false;
- }
if (s->sme_trap_nonstreaming && s->is_nonstreaming) {
gen_exception_insn(s, 0, EXCP_UDEF,
syn_smetrap(SME_ET_Streaming, false));
@@ -1405,6 +1402,11 @@ static bool fp_access_check(DisasContext *s)
return true;
}
+static bool fp_access_check(DisasContext *s)
+{
+ return fp_access_check_only(s) && nonstreaming_check(s);
+}
+
/*
* Return <0 for non-supported element sizes, with MO_16 controlled by
* FEAT_FP16; return 0 for fp disabled; otherwise return >0 for success.
@@ -1455,14 +1457,24 @@ static int fp_access_check_vector_hsd(DisasContext *s, bool is_q, MemOp esz)
*/
bool sve_access_check(DisasContext *s)
{
- if (s->pstate_sm || !dc_isar_feature(aa64_sve, s)) {
+ if (dc_isar_feature(aa64_sme, s)) {
bool ret;
- assert(dc_isar_feature(aa64_sme, s));
- ret = sme_sm_enabled_check(s);
+ if (s->pstate_sm) {
+ ret = sme_enabled_check(s);
+ } else if (dc_isar_feature(aa64_sve, s)) {
+ goto continue_sve;
+ } else {
+ ret = sme_sm_enabled_check(s);
+ }
+ if (ret) {
+ ret = nonstreaming_check(s);
+ }
s->sve_access_checked = (ret ? 1 : -1);
return ret;
}
+
+ continue_sve:
if (s->sve_excp_el) {
/* Assert that we only raise one exception per instruction. */
assert(!s->sve_access_checked);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 36/39] target/arm: Fix 128-bit element ZIP, UZP, TRN
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (34 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 35/39] target/arm: Fix sve_access_check for SME Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 37/39] target/arm: Fix PSEL size operands to tcg_gen_gvec_ands Michael Tokarev
` (3 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Peter Maydell, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
We missed the instructions UDEF when the vector size is too small.
We missed marking the instructions non-streaming with SME.
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250704142112.1018902-4-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit e6ffd009c7710a8cc98094897fa0af609c114683)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c
index d23be477b4..40d3a032d6 100644
--- a/target/arm/tcg/translate-sve.c
+++ b/target/arm/tcg/translate-sve.c
@@ -2352,6 +2352,23 @@ TRANS_FEAT(PUNPKHI, aa64_sve, do_perm_pred2, a, 1, gen_helper_sve_punpk_p)
*** SVE Permute - Interleaving Group
*/
+static bool do_interleave_q(DisasContext *s, gen_helper_gvec_3 *fn,
+ arg_rrr_esz *a, int data)
+{
+ if (sve_access_check(s)) {
+ unsigned vsz = vec_full_reg_size(s);
+ if (vsz < 32) {
+ unallocated_encoding(s);
+ } else {
+ tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd),
+ vec_full_reg_offset(s, a->rn),
+ vec_full_reg_offset(s, a->rm),
+ vsz, vsz, data, fn);
+ }
+ }
+ return true;
+}
+
static gen_helper_gvec_3 * const zip_fns[4] = {
gen_helper_sve_zip_b, gen_helper_sve_zip_h,
gen_helper_sve_zip_s, gen_helper_sve_zip_d,
@@ -2361,11 +2378,11 @@ TRANS_FEAT(ZIP1_z, aa64_sve, gen_gvec_ool_arg_zzz,
TRANS_FEAT(ZIP2_z, aa64_sve, gen_gvec_ool_arg_zzz,
zip_fns[a->esz], a, vec_full_reg_size(s) / 2)
-TRANS_FEAT(ZIP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
- gen_helper_sve2_zip_q, a, 0)
-TRANS_FEAT(ZIP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
- gen_helper_sve2_zip_q, a,
- QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2)
+TRANS_FEAT_NONSTREAMING(ZIP1_q, aa64_sve_f64mm, do_interleave_q,
+ gen_helper_sve2_zip_q, a, 0)
+TRANS_FEAT_NONSTREAMING(ZIP2_q, aa64_sve_f64mm, do_interleave_q,
+ gen_helper_sve2_zip_q, a,
+ QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2)
static gen_helper_gvec_3 * const uzp_fns[4] = {
gen_helper_sve_uzp_b, gen_helper_sve_uzp_h,
@@ -2377,10 +2394,10 @@ TRANS_FEAT(UZP1_z, aa64_sve, gen_gvec_ool_arg_zzz,
TRANS_FEAT(UZP2_z, aa64_sve, gen_gvec_ool_arg_zzz,
uzp_fns[a->esz], a, 1 << a->esz)
-TRANS_FEAT(UZP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
- gen_helper_sve2_uzp_q, a, 0)
-TRANS_FEAT(UZP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
- gen_helper_sve2_uzp_q, a, 16)
+TRANS_FEAT_NONSTREAMING(UZP1_q, aa64_sve_f64mm, do_interleave_q,
+ gen_helper_sve2_uzp_q, a, 0)
+TRANS_FEAT_NONSTREAMING(UZP2_q, aa64_sve_f64mm, do_interleave_q,
+ gen_helper_sve2_uzp_q, a, 16)
static gen_helper_gvec_3 * const trn_fns[4] = {
gen_helper_sve_trn_b, gen_helper_sve_trn_h,
@@ -2392,10 +2409,10 @@ TRANS_FEAT(TRN1_z, aa64_sve, gen_gvec_ool_arg_zzz,
TRANS_FEAT(TRN2_z, aa64_sve, gen_gvec_ool_arg_zzz,
trn_fns[a->esz], a, 1 << a->esz)
-TRANS_FEAT(TRN1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
- gen_helper_sve2_trn_q, a, 0)
-TRANS_FEAT(TRN2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
- gen_helper_sve2_trn_q, a, 16)
+TRANS_FEAT_NONSTREAMING(TRN1_q, aa64_sve_f64mm, do_interleave_q,
+ gen_helper_sve2_trn_q, a, 0)
+TRANS_FEAT_NONSTREAMING(TRN2_q, aa64_sve_f64mm, do_interleave_q,
+ gen_helper_sve2_trn_q, a, 16)
/*
*** SVE Permute Vector - Predicated Group
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 37/39] target/arm: Fix PSEL size operands to tcg_gen_gvec_ands
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (35 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 36/39] target/arm: Fix 128-bit element ZIP, UZP, TRN Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 38/39] target/arm: Fix f16_dotadd vs nan selection Michael Tokarev
` (2 subsequent siblings)
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Peter Maydell, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
Gvec only operates on size 8 and multiples of 16.
Predicates may be any multiple of 2.
Round up the size using the appropriate function.
Cc: qemu-stable@nongnu.org
Fixes: 598ab0b24c0 ("target/arm: Implement PSEL")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250704142112.1018902-8-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 3801c5b75ffc60957265513338e8fd5f8b6ce8a1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c
index 40d3a032d6..b6fa0b67b1 100644
--- a/target/arm/tcg/translate-sve.c
+++ b/target/arm/tcg/translate-sve.c
@@ -7282,6 +7282,7 @@ static bool trans_PSEL(DisasContext *s, arg_psel *a)
tcg_gen_neg_i64(tmp, tmp);
/* Apply to either copy the source, or write zeros. */
+ pl = size_for_gvec(pl);
tcg_gen_gvec_ands(MO_64, pred_full_reg_offset(s, a->pd),
pred_full_reg_offset(s, a->pn), tmp, pl, pl);
return true;
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 38/39] target/arm: Fix f16_dotadd vs nan selection
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (36 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 37/39] target/arm: Fix PSEL size operands to tcg_gen_gvec_ands Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 39/39] target/arm: Fix bfdotadd_ebf " Michael Tokarev
2025-07-11 21:51 ` [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Volker Rümelin
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Peter Maydell, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
Implement FPProcessNaNs4 within f16_dotadd, rather than
simply letting NaNs propagate through the function.
Cc: qemu-stable@nongnu.org
Fixes: 3916841ac75 ("target/arm: Implement FMOPA, FMOPS (widening)")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250704142112.1018902-9-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit cfc688c00ade84f6b32c7814b52c217f1d3b5eb1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/sme_helper.c b/target/arm/tcg/sme_helper.c
index dcc48e43db..a4992301b1 100644
--- a/target/arm/tcg/sme_helper.c
+++ b/target/arm/tcg/sme_helper.c
@@ -1005,25 +1005,55 @@ static float32 f16_dotadd(float32 sum, uint32_t e1, uint32_t e2,
* - we have pre-set-up copy of s_std which is set to round-to-odd,
* for the multiply (see below)
*/
- float64 e1r = float16_to_float64(e1 & 0xffff, true, s_f16);
- float64 e1c = float16_to_float64(e1 >> 16, true, s_f16);
- float64 e2r = float16_to_float64(e2 & 0xffff, true, s_f16);
- float64 e2c = float16_to_float64(e2 >> 16, true, s_f16);
- float64 t64;
+ float16 h1r = e1 & 0xffff;
+ float16 h1c = e1 >> 16;
+ float16 h2r = e2 & 0xffff;
+ float16 h2c = e2 >> 16;
float32 t32;
- /*
- * The ARM pseudocode function FPDot performs both multiplies
- * and the add with a single rounding operation. Emulate this
- * by performing the first multiply in round-to-odd, then doing
- * the second multiply as fused multiply-add, and rounding to
- * float32 all in one step.
- */
- t64 = float64_mul(e1r, e2r, s_odd);
- t64 = float64r32_muladd(e1c, e2c, t64, 0, s_std);
+ /* C.f. FPProcessNaNs4 */
+ if (float16_is_any_nan(h1r) || float16_is_any_nan(h1c) ||
+ float16_is_any_nan(h2r) || float16_is_any_nan(h2c)) {
+ float16 t16;
+
+ if (float16_is_signaling_nan(h1r, s_f16)) {
+ t16 = h1r;
+ } else if (float16_is_signaling_nan(h1c, s_f16)) {
+ t16 = h1c;
+ } else if (float16_is_signaling_nan(h2r, s_f16)) {
+ t16 = h2r;
+ } else if (float16_is_signaling_nan(h2c, s_f16)) {
+ t16 = h2c;
+ } else if (float16_is_any_nan(h1r)) {
+ t16 = h1r;
+ } else if (float16_is_any_nan(h1c)) {
+ t16 = h1c;
+ } else if (float16_is_any_nan(h2r)) {
+ t16 = h2r;
+ } else {
+ t16 = h2c;
+ }
+ t32 = float16_to_float32(t16, true, s_f16);
+ } else {
+ float64 e1r = float16_to_float64(h1r, true, s_f16);
+ float64 e1c = float16_to_float64(h1c, true, s_f16);
+ float64 e2r = float16_to_float64(h2r, true, s_f16);
+ float64 e2c = float16_to_float64(h2c, true, s_f16);
+ float64 t64;
- /* This conversion is exact, because we've already rounded. */
- t32 = float64_to_float32(t64, s_std);
+ /*
+ * The ARM pseudocode function FPDot performs both multiplies
+ * and the add with a single rounding operation. Emulate this
+ * by performing the first multiply in round-to-odd, then doing
+ * the second multiply as fused multiply-add, and rounding to
+ * float32 all in one step.
+ */
+ t64 = float64_mul(e1r, e2r, s_odd);
+ t64 = float64r32_muladd(e1c, e2c, t64, 0, s_std);
+
+ /* This conversion is exact, because we've already rounded. */
+ t32 = float64_to_float32(t64, s_std);
+ }
/* The final accumulation step is not fused. */
return float32_add(sum, t32, s_std);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Stable-10.0.3 39/39] target/arm: Fix bfdotadd_ebf vs nan selection
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (37 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 38/39] target/arm: Fix f16_dotadd vs nan selection Michael Tokarev
@ 2025-07-11 8:16 ` Michael Tokarev
2025-07-11 21:51 ` [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Volker Rümelin
39 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-11 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Richard Henderson, Peter Maydell, Michael Tokarev
From: Richard Henderson <richard.henderson@linaro.org>
Implement FPProcessNaNs4 within bfdotadd_ebf, rather than
simply letting NaNs propagate through the function.
Cc: qemu-stable@nongnu.org
Fixes: 0e1850182a1 ("target/arm: Implement FPCR.EBF=1 semantics for bfdotadd()")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20250704142112.1018902-10-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit bf020eaa6741711902a425016e2c7585f222562d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c
index 986eaf8ffa..3b7f308803 100644
--- a/target/arm/tcg/vec_helper.c
+++ b/target/arm/tcg/vec_helper.c
@@ -2989,31 +2989,62 @@ float32 bfdotadd(float32 sum, uint32_t e1, uint32_t e2, float_status *fpst)
float32 bfdotadd_ebf(float32 sum, uint32_t e1, uint32_t e2,
float_status *fpst, float_status *fpst_odd)
{
- /*
- * Compare f16_dotadd() in sme_helper.c, but here we have
- * bfloat16 inputs. In particular that means that we do not
- * want the FPCR.FZ16 flush semantics, so we use the normal
- * float_status for the input handling here.
- */
- float64 e1r = float32_to_float64(e1 << 16, fpst);
- float64 e1c = float32_to_float64(e1 & 0xffff0000u, fpst);
- float64 e2r = float32_to_float64(e2 << 16, fpst);
- float64 e2c = float32_to_float64(e2 & 0xffff0000u, fpst);
- float64 t64;
+ float32 s1r = e1 << 16;
+ float32 s1c = e1 & 0xffff0000u;
+ float32 s2r = e2 << 16;
+ float32 s2c = e2 & 0xffff0000u;
float32 t32;
- /*
- * The ARM pseudocode function FPDot performs both multiplies
- * and the add with a single rounding operation. Emulate this
- * by performing the first multiply in round-to-odd, then doing
- * the second multiply as fused multiply-add, and rounding to
- * float32 all in one step.
- */
- t64 = float64_mul(e1r, e2r, fpst_odd);
- t64 = float64r32_muladd(e1c, e2c, t64, 0, fpst);
+ /* C.f. FPProcessNaNs4 */
+ if (float32_is_any_nan(s1r) || float32_is_any_nan(s1c) ||
+ float32_is_any_nan(s2r) || float32_is_any_nan(s2c)) {
+ if (float32_is_signaling_nan(s1r, fpst)) {
+ t32 = s1r;
+ } else if (float32_is_signaling_nan(s1c, fpst)) {
+ t32 = s1c;
+ } else if (float32_is_signaling_nan(s2r, fpst)) {
+ t32 = s2r;
+ } else if (float32_is_signaling_nan(s2c, fpst)) {
+ t32 = s2c;
+ } else if (float32_is_any_nan(s1r)) {
+ t32 = s1r;
+ } else if (float32_is_any_nan(s1c)) {
+ t32 = s1c;
+ } else if (float32_is_any_nan(s2r)) {
+ t32 = s2r;
+ } else {
+ t32 = s2c;
+ }
+ /*
+ * FPConvertNaN(FPProcessNaN(t32)) will be done as part
+ * of the final addition below.
+ */
+ } else {
+ /*
+ * Compare f16_dotadd() in sme_helper.c, but here we have
+ * bfloat16 inputs. In particular that means that we do not
+ * want the FPCR.FZ16 flush semantics, so we use the normal
+ * float_status for the input handling here.
+ */
+ float64 e1r = float32_to_float64(s1r, fpst);
+ float64 e1c = float32_to_float64(s1c, fpst);
+ float64 e2r = float32_to_float64(s2r, fpst);
+ float64 e2c = float32_to_float64(s2c, fpst);
+ float64 t64;
- /* This conversion is exact, because we've already rounded. */
- t32 = float64_to_float32(t64, fpst);
+ /*
+ * The ARM pseudocode function FPDot performs both multiplies
+ * and the add with a single rounding operation. Emulate this
+ * by performing the first multiply in round-to-odd, then doing
+ * the second multiply as fused multiply-add, and rounding to
+ * float32 all in one step.
+ */
+ t64 = float64_mul(e1r, e2r, fpst_odd);
+ t64 = float64r32_muladd(e1c, e2c, t64, 0, fpst);
+
+ /* This conversion is exact, because we've already rounded. */
+ t32 = float64_to_float32(t64, fpst);
+ }
/* The final accumulation step is not fused. */
return float32_add(sum, t32, fpst);
--
2.47.2
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
` (38 preceding siblings ...)
2025-07-11 8:16 ` [Stable-10.0.3 39/39] target/arm: Fix bfdotadd_ebf " Michael Tokarev
@ 2025-07-11 21:51 ` Volker Rümelin
2025-07-12 8:22 ` Michael Tokarev
39 siblings, 1 reply; 42+ messages in thread
From: Volker Rümelin @ 2025-07-11 21:51 UTC (permalink / raw)
To: Michael Tokarev; +Cc: qemu-devel, qemu-stable
Am 11.07.25 um 10:15 schrieb Michael Tokarev:
> The following patches are queued for QEMU stable v10.0.3:
>
> https://gitlab.com/qemu-project/qemu/-/commits/staging-10.0
>
> Patch freeze is 2025-07-21, and the release is planned for 2025-07-23:
>
> https://wiki.qemu.org/Planning/10.0
>
> Please respond here or CC qemu-stable@nongnu.org on any additional patches
> you think should (or shouldn't) be included in the release.
Hi Michael,
I think commit 0f1d6606c2 ("target/i386: fix TB exit logic in
gen_movl_seg() when writing to SS") should be included. It fixes a
regression in stable-10.0.1.
The patches
08 7ed96710e82c Daniel P. Berrangé:
ui/vnc.c: replace big endian flag with byte order value
09 70097442853c Daniel P. Berrangé:
ui/vnc: take account of client byte order in pixman format
10 63d320909220 Daniel P. Berrangé:
ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats
introduce a regression. See the patch at
https://lore.kernel.org/qemu-devel/20250604162243.452791-2-berrange@redhat.com/.
This patch is correct but it's still missing in the QEMU master branch.
With best regards,
Volker
>
> The changes which are staging for inclusion, with the original commit hash
> from master branch, are given below the bottom line.
>
> Thanks!
>
> /mjt
>
> --------------------------------------
> 01 fb8e59abbe46 Jamin Lin:
> hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware
> hang
> 02 e6941ac10619 Jamin Lin:
> hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts
> 03 9498e2f7e1a2 Weifeng Liu:
> ui/gtk: Document scale and coordinate handling
> 04 3a6b314409b4 Weifeng Liu:
> ui/gtk: Use consistent naming for variables in different coordinates
> 05 a19665448156 Weifeng Liu:
> gtk/ui: Introduce helper gd_update_scale
> 06 8fb072472c38 Weifeng Liu:
> ui/gtk: Update scales in fixed-scale mode when rendering GL area
> 07 30aa105640b0 Weifeng Liu:
> ui/sdl: Consider scaling in mouse event handling
> 08 7ed96710e82c Daniel P. Berrangé:
> ui/vnc.c: replace big endian flag with byte order value
> 09 70097442853c Daniel P. Berrangé:
> ui/vnc: take account of client byte order in pixman format
> 10 63d320909220 Daniel P. Berrangé:
> ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats
> 11 e6bc01777e5a Guenter Roeck:
> hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info
> 12 a9403bfcd930 Huaitong Han:
> vhost: Don't set vring call if guest notifier is unused
> 13 0b006153b7ec Bernhard Beschow:
> hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine
> 14 31753d5a336f Sairaj Kodilkar:
> hw/i386/amd_iommu: Fix device setup failure when PT is on.
> 15 0f178860df34 Vasant Hegde:
> hw/i386/amd_iommu: Fix xtsup when vcpus < 255
> 16 5ddd6c8dc849 Volker Rümelin:
> audio: fix SIGSEGV in AUD_get_buffer_size_out()
> 17 ccb4fec0e5f2 Volker Rümelin:
> audio: fix size calculation in AUD_get_buffer_size_out()
> 18 d009f26a54f5 Volker Rümelin:
> hw/audio/asc: fix SIGSEGV in asc_realize()
> 19 0b901459a87a Xin Li (Intel):
> target/i386: Remove FRED dependency on WRMSRNS
> 20 2e887187454e Stefan Hajnoczi:
> iotests: fix 240
> 21 eef2dd03f948 Fiona Ebner:
> hw/core/qdev-properties-system: Add missing return in set_drive_helper()
> 22 9c55c03c05c1 Bibo Mao:
> hw/loongarch/virt: Fix big endian support with MCFG table
> 23 f5ec751ee70d Shameer Kolothum:
> hw/arm/virt: Check bypass iommu is not set for iommu-map DT property
> 24 e372214e663a Ethan Chen:
> qemu-options.hx: Fix reversed description of icount sleep behavior
> 25 cd38e638c43e Peter Maydell:
> hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions
> 26 5ad2b1f443a9 J. Neuschäfer:
> linux-user/arm: Fix return value of SYS_cacheflush
> 27 e7788da9860c Song Gao:
> target/loongarch: add check for fcond
> 28 c2a2e1ad2a74 Song Gao:
> target/loongarch: fix vldi/xvldi raise wrong error
> 29 0d0fc3f46589 Richard Henderson:
> tcg: Fix constant propagation in tcg_reg_alloc_dup
> 30 9a3bf0e0ab62 Solomon Tan:
> target/arm: Make RETA[AB] UNDEF when pauth is not implemented
> 31 a412575837b6 Philippe Mathieu-Daudé:
> target/arm: Correct KVM & HVF dtb_compatible value
> 32 1fa2ffdbec55 Yiwei Zhang:
> virtio-gpu: support context init multiple timeline
> 33 78e378154120 Kevin Wolf:
> hw/s390x/ccw-device: Fix memory leak in loadparm setter
> 34 f9b0f6930407 Richard Henderson:
> target/arm: Fix SME vs AdvSIMD exception priority
> 35 b4b2e070f41d Richard Henderson:
> target/arm: Fix sve_access_check for SME
> 36 e6ffd009c771 Richard Henderson:
> target/arm: Fix 128-bit element ZIP, UZP, TRN
> 37 3801c5b75ffc Richard Henderson:
> target/arm: Fix PSEL size operands to tcg_gen_gvec_ands
> 38 cfc688c00ade Richard Henderson:
> target/arm: Fix f16_dotadd vs nan selection
> 39 bf020eaa6741 Richard Henderson:
> target/arm: Fix bfdotadd_ebf vs nan selection
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21
2025-07-11 21:51 ` [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Volker Rümelin
@ 2025-07-12 8:22 ` Michael Tokarev
0 siblings, 0 replies; 42+ messages in thread
From: Michael Tokarev @ 2025-07-12 8:22 UTC (permalink / raw)
To: Volker Rümelin; +Cc: qemu-devel, qemu-stable
On 12.07.2025 00:51, Volker Rümelin wrote:
> Am 11.07.25 um 10:15 schrieb Michael Tokarev:
>> The following patches are queued for QEMU stable v10.0.3:
>>
>> https://gitlab.com/qemu-project/qemu/-/commits/staging-10.0
>>
>> Patch freeze is 2025-07-21, and the release is planned for 2025-07-23:
>>
>> https://wiki.qemu.org/Planning/10.0
>>
>> Please respond here or CC qemu-stable@nongnu.org on any additional patches
>> you think should (or shouldn't) be included in the release.
>
> Hi Michael,
>
> I think commit 0f1d6606c2 ("target/i386: fix TB exit logic in
> gen_movl_seg() when writing to SS") should be included. It fixes a
> regression in stable-10.0.1.
You're exactly right. I missed this one because it Fixes a commit
which is after 10.0.0 (e54ef98c8a), but it has also been picked
up for stable-10.0 (0f1d6606c2). Included now.
> The patches
>
> 08 7ed96710e82c Daniel P. Berrangé:
> ui/vnc.c: replace big endian flag with byte order value
> 09 70097442853c Daniel P. Berrangé:
> ui/vnc: take account of client byte order in pixman format
> 10 63d320909220 Daniel P. Berrangé:
> ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats
>
>
> introduce a regression. See the patch at
> https://lore.kernel.org/qemu-devel/20250604162243.452791-2-berrange@redhat.com/.
> This patch is correct but it's still missing in the QEMU master branch.
It should be included in 10.1 and in 10.0.3, it looks like. It also
looks like it's been forgotten. I'll ping it now.
Thank you very much for letting me know and for remembering all these
details.
/mjt
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2025-07-12 8:23 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 8:15 [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 01/39] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 02/39] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts Michael Tokarev
2025-07-11 8:15 ` [Stable-10.0.3 03/39] ui/gtk: Document scale and coordinate handling Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 04/39] ui/gtk: Use consistent naming for variables in different coordinates Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 05/39] gtk/ui: Introduce helper gd_update_scale Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 06/39] ui/gtk: Update scales in fixed-scale mode when rendering GL area Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 07/39] ui/sdl: Consider scaling in mouse event handling Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 08/39] ui/vnc.c: replace big endian flag with byte order value Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 09/39] ui/vnc: take account of client byte order in pixman format Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 10/39] ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 11/39] hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 12/39] vhost: Don't set vring call if guest notifier is unused Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 13/39] hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 14/39] hw/i386/amd_iommu: Fix device setup failure when PT is on Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 15/39] hw/i386/amd_iommu: Fix xtsup when vcpus < 255 Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 16/39] audio: fix SIGSEGV in AUD_get_buffer_size_out() Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 17/39] audio: fix size calculation " Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 18/39] hw/audio/asc: fix SIGSEGV in asc_realize() Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 19/39] target/i386: Remove FRED dependency on WRMSRNS Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 20/39] iotests: fix 240 Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 21/39] hw/core/qdev-properties-system: Add missing return in set_drive_helper() Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 22/39] hw/loongarch/virt: Fix big endian support with MCFG table Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 23/39] hw/arm/virt: Check bypass iommu is not set for iommu-map DT property Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 24/39] qemu-options.hx: Fix reversed description of icount sleep behavior Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 25/39] hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 26/39] linux-user/arm: Fix return value of SYS_cacheflush Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 27/39] target/loongarch: add check for fcond Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 28/39] target/loongarch: fix vldi/xvldi raise wrong error Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 29/39] tcg: Fix constant propagation in tcg_reg_alloc_dup Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 30/39] target/arm: Make RETA[AB] UNDEF when pauth is not implemented Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 31/39] target/arm: Correct KVM & HVF dtb_compatible value Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 32/39] virtio-gpu: support context init multiple timeline Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 33/39] hw/s390x/ccw-device: Fix memory leak in loadparm setter Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 34/39] target/arm: Fix SME vs AdvSIMD exception priority Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 35/39] target/arm: Fix sve_access_check for SME Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 36/39] target/arm: Fix 128-bit element ZIP, UZP, TRN Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 37/39] target/arm: Fix PSEL size operands to tcg_gen_gvec_ands Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 38/39] target/arm: Fix f16_dotadd vs nan selection Michael Tokarev
2025-07-11 8:16 ` [Stable-10.0.3 39/39] target/arm: Fix bfdotadd_ebf " Michael Tokarev
2025-07-11 21:51 ` [Stable-10.0.3 00/39] Patch Round-up for stable 10.0.3, freeze on 2025-07-21 Volker Rümelin
2025-07-12 8:22 ` 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).