qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen)
@ 2025-10-18 19:06 Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 12/23] block/curl.c: Use explicit long constants in curl_easy_setopt calls Michael Tokarev
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Michael Tokarev

The following patches are queued for QEMU stable v10.1.2:

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

Patch freeze is 2025-10-18 (frozen), and the release is planned for 2025-10-20:

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

This release is supposed to go faster, because it contains two important
migration fixes.

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* 2e54e5fda779 Damien Bergamini:
   pcie_sriov: Fix broken MMIO accesses from SR-IOV VFs
02* 1c0f5142d921 ShengYi Hung:
   hid: fix incorrect return value for hid
03* f65918497cc6 nanliu:
   docs/devel: Correct uefi-vars-x64 device name
04* bab681f75204 Stefan Hajnoczi:
   pcie_sriov: make pcie_sriov_pf_exit() safe on non-SR-IOV devices
05* a23e719ca8e8 Peter Maydell:
   target/arm: Don't set HCR.RW for AArch32 only CPUs
06* c851052a77fd Jim Shu:
   target/riscv: Fix the mepc when sspopchk triggers the exception
07* 84c1605b7606 Jim Shu:
   target/riscv: Fix SSP CSR error handling in VU/VS mode
08* 0b16c7b6a854 Jim Shu:
   target/riscv: Fix ssamoswap error handling
09* 81d1885dcc44 Max Chou:
   target/riscv: rvv: Fix vslide1[up|down].vx unexpected result when XLEN=32 
   and SEW=64
10* e9efa4a77168 Paolo Bonzini:
   target/i386: add compatibility property for arch_capabilities
11* 6529f31e0dcc Hector Cao:
   target/i386: add compatibility property for pdcm feature
12 ed26056d90dd Richard W.M. Jones:
   block/curl.c: Use explicit long constants in curl_easy_setopt calls
13 df9a3372ddeb Mathias Krause:
   target/i386: Fix CR2 handling for non-canonical addresses
14 00001a22d183 Jon Kohler:
   i386/kvm: Expose ARCH_CAP_FB_CLEAR when invulnerable to MDS
15 df32e5c568c9 Paolo Bonzini:
   i386/cpu: Prevent delivering SIPI during SMM in TCG mode
16 cdba90ac1b0a YiFei Zhu:
   i386/tcg/smm_helper: Properly apply DR values on SMM entry / exit
17 5a2faa0a0a2c Thomas Ogrisegg:
   target/i386: fix x86_64 pushw op
18 0d22b621b796 Paolo Bonzini:
   target/i386: fix access to the T bit of the TSS
19 5142397c7933 Paolo Bonzini:
   async: access bottom half flags with qatomic_read
20 58aa1d08bbc4 Paolo Bonzini:
   target/i386: user: do not set up a valid LDT on reset
21 ec03dd972378 Richard Henderson:
   accel/tcg: Hoist first page lookup above pointer_wrap
22 cea82f8cdd07 Gabriel Brookman:
   target/hppa: correct size bit parity for fmpyadd
23 91fc6d8101de Philippe Mathieu-Daudé:
   linux-user/microblaze: Fix little-endianness binary

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


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

* [Stable-10.1.2 12/23] block/curl.c: Use explicit long constants in curl_easy_setopt calls
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 13/23] target/i386: Fix CR2 handling for non-canonical addresses Michael Tokarev
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Richard W.M. Jones, Chenxi Mao,
	Daniel P. Berrangé, Akihiko Odaki, Thomas Huth,
	Richard Henderson, Michael Tokarev

From: "Richard W.M. Jones" <rjones@redhat.com>

curl_easy_setopt takes a variable argument that depends on what
CURLOPT you are setting.  Some require a long constant.  Passing a
plain int constant is potentially wrong on some platforms.

With warnings enabled, multiple warnings like this were printed:

../block/curl.c: In function ‘curl_init_state’:
../block/curl.c:474:13: warning: call to ‘_curl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
  474 |             curl_easy_setopt(state->curl, CURLOPT_AUTOREFERER, 1) ||
      |             ^

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Chenxi Mao <maochenxi@bosc.ac.cn>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20251009141026.4042021-2-rjones@redhat.com>
(cherry picked from commit ed26056d90ddff21351f3efd2cb47fea4f0e1d45)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/block/curl.c b/block/curl.c
index 00b949ea45..1102a3aa2f 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -471,11 +471,11 @@ static int curl_init_state(BDRVCURLState *s, CURLState *state)
                              (void *)curl_read_cb) ||
             curl_easy_setopt(state->curl, CURLOPT_WRITEDATA, (void *)state) ||
             curl_easy_setopt(state->curl, CURLOPT_PRIVATE, (void *)state) ||
-            curl_easy_setopt(state->curl, CURLOPT_AUTOREFERER, 1) ||
-            curl_easy_setopt(state->curl, CURLOPT_FOLLOWLOCATION, 1) ||
-            curl_easy_setopt(state->curl, CURLOPT_NOSIGNAL, 1) ||
+            curl_easy_setopt(state->curl, CURLOPT_AUTOREFERER, 1L) ||
+            curl_easy_setopt(state->curl, CURLOPT_FOLLOWLOCATION, 1L) ||
+            curl_easy_setopt(state->curl, CURLOPT_NOSIGNAL, 1L) ||
             curl_easy_setopt(state->curl, CURLOPT_ERRORBUFFER, state->errmsg) ||
-            curl_easy_setopt(state->curl, CURLOPT_FAILONERROR, 1)) {
+            curl_easy_setopt(state->curl, CURLOPT_FAILONERROR, 1L)) {
             goto err;
         }
         if (s->username) {
@@ -800,7 +800,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     s->accept_range = false;
-    if (curl_easy_setopt(state->curl, CURLOPT_NOBODY, 1) ||
+    if (curl_easy_setopt(state->curl, CURLOPT_NOBODY, 1L) ||
         curl_easy_setopt(state->curl, CURLOPT_HEADERFUNCTION, curl_header_cb) ||
         curl_easy_setopt(state->curl, CURLOPT_HEADERDATA, s)) {
         pstrcpy(state->errmsg, CURL_ERROR_SIZE,
diff --git a/contrib/elf2dmp/download.c b/contrib/elf2dmp/download.c
index 21306b3fd4..fa8da0f9a2 100644
--- a/contrib/elf2dmp/download.c
+++ b/contrib/elf2dmp/download.c
@@ -27,8 +27,8 @@ bool download_url(const char *name, const char *url)
     if (curl_easy_setopt(curl, CURLOPT_URL, url) != CURLE_OK
             || curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL) != CURLE_OK
             || curl_easy_setopt(curl, CURLOPT_WRITEDATA, file) != CURLE_OK
-            || curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) != CURLE_OK
-            || curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0) != CURLE_OK
+            || curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK
+            || curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L) != CURLE_OK
             || curl_easy_perform(curl) != CURLE_OK) {
         unlink(name);
         fclose(file);
-- 
2.47.3



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

* [Stable-10.1.2 13/23] target/i386: Fix CR2 handling for non-canonical addresses
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 12/23] block/curl.c: Use explicit long constants in curl_easy_setopt calls Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 14/23] i386/kvm: Expose ARCH_CAP_FB_CLEAR when invulnerable to MDS Michael Tokarev
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Mathias Krause, Paolo Bonzini, Michael Tokarev

From: Mathias Krause <minipli@grsecurity.net>

Commit 3563362ddfae ("target/i386: Introduce structures for mmu_translate")
accidentally modified CR2 for non-canonical address exceptions while these
should lead to a #GP / #SS instead -- without changing CR2.

Fix that.

A KUT test for this was submitted as [1].

[1] https://lore.kernel.org/kvm/20250612141637.131314-1-minipli@grsecurity.net/

Fixes: 3563362ddfae ("target/i386: Introduce structures for mmu_translate")
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20250612142155.132175-1-minipli@grsecurity.net
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit df9a3372ddebfcfc135861fa2d53cef6f98065f9)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/system/excp_helper.c b/target/i386/tcg/system/excp_helper.c
index 50040f6fca..f622b5d588 100644
--- a/target/i386/tcg/system/excp_helper.c
+++ b/target/i386/tcg/system/excp_helper.c
@@ -592,7 +592,8 @@ static bool get_physical_address(CPUX86State *env, vaddr addr,
                 if (sext != 0 && sext != -1) {
                     *err = (TranslateFault){
                         .exception_index = EXCP0D_GPF,
-                        .cr2 = addr,
+                        /* non-canonical #GP doesn't change CR2 */
+                        .cr2 = env->cr[2],
                     };
                     return false;
                 }
-- 
2.47.3



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

* [Stable-10.1.2 14/23] i386/kvm: Expose ARCH_CAP_FB_CLEAR when invulnerable to MDS
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 12/23] block/curl.c: Use explicit long constants in curl_easy_setopt calls Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 13/23] target/i386: Fix CR2 handling for non-canonical addresses Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 15/23] i386/cpu: Prevent delivering SIPI during SMM in TCG mode Michael Tokarev
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Jon Kohler, Pawan Gupta, Sean Christopherson,
	Paolo Bonzini, Michael Tokarev

From: Jon Kohler <jon@nutanix.com>

Newer Intel hardware (Sapphire Rapids and higher) sets multiple MDS
immunity bits in MSR_IA32_ARCH_CAPABILITIES but lacks the hardware-level
MSR_ARCH_CAP_FB_CLEAR (bit 17):
    ARCH_CAP_MDS_NO
    ARCH_CAP_TAA_NO
    ARCH_CAP_PSDP_NO
    ARCH_CAP_FBSDP_NO
    ARCH_CAP_SBDR_SSDP_NO

This prevents VMs with fb-clear=on from migrating from older hardware
(Cascade Lake, Ice Lake) to newer hardware, limiting live migration
capabilities. Note fb-clear was first introduced in v8.1.0 [1].

Expose MSR_ARCH_CAP_FB_CLEAR for MDS-invulnerable systems to enable
seamless migration between hardware generations.

Note: There is no impact when a guest migrates to newer hardware as
the existing bit combinations already mark the host as MMIO-immune and
disable FB_CLEAR operations in the kernel (see Linux's
arch_cap_mmio_immune() and vmx_update_fb_clear_dis()). See kernel side
discussion for [2] for additional context.

[1] 22e1094ca82 ("target/i386: add support for FB_CLEAR feature")
[2] https://patchwork.kernel.org/project/kvm/patch/20250401044931.793203-1-jon@nutanix.com/

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251008202557.4141285-1-jon@nutanix.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 00001a22d183ce96c110690987bf9dd6a8548552)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 96035c27cd..7137b46be1 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -653,6 +653,23 @@ uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index)
         must_be_one = (uint32_t)value;
         can_be_one = (uint32_t)(value >> 32);
         return can_be_one & ~must_be_one;
+    case MSR_IA32_ARCH_CAPABILITIES:
+        /*
+         * Special handling for fb-clear bit in ARCH_CAPABILITIES MSR.
+         * KVM will only report the bit if it is enabled in the host,
+         * but, for live migration capability purposes, we want to
+         * expose the bit to the guest even if it is disabled in the
+         * host, as long as the host itself is not vulnerable to
+         * the issue that the fb-clear bit is meant to mitigate.
+         */
+        if ((value & MSR_ARCH_CAP_MDS_NO) &&
+            (value & MSR_ARCH_CAP_TAA_NO) &&
+            (value & MSR_ARCH_CAP_SBDR_SSDP_NO) &&
+            (value & MSR_ARCH_CAP_FBSDP_NO) &&
+            (value & MSR_ARCH_CAP_PSDP_NO)) {
+                value |= MSR_ARCH_CAP_FB_CLEAR;
+        }
+        return value;
 
     default:
         return value;
-- 
2.47.3



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

* [Stable-10.1.2 15/23] i386/cpu: Prevent delivering SIPI during SMM in TCG mode
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (2 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 14/23] i386/kvm: Expose ARCH_CAP_FB_CLEAR when invulnerable to MDS Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 16/23] i386/tcg/smm_helper: Properly apply DR values on SMM entry / exit Michael Tokarev
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, YiFei Zhu, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

[commit message by YiFei Zhu]

A malicious kernel may control the instruction pointer in SMM in a
multi-processor VM by sending a sequence of IPIs via APIC:

CPU0			CPU1
IPI(CPU1, MODE_INIT)
			x86_cpu_exec_reset()
			apic_init_reset()
			s->wait_for_sipi = true
IPI(CPU1, MODE_SMI)
			do_smm_enter()
			env->hflags |= HF_SMM_MASK;
IPI(CPU1, MODE_STARTUP, vector)
			do_cpu_sipi()
			apic_sipi()
			/* s->wait_for_sipi check passes */
			cpu_x86_load_seg_cache_sipi(vector)

A different sequence, SMI INIT SIPI, is also buggy in TCG because
INIT is not blocked or latched during SMM. However, it is not
vulnerable to an instruction pointer control in the same way because
x86_cpu_exec_reset clears env->hflags, exiting SMM.

Fixes: a9bad65d2c1f ("target-i386: wake up processors that receive an SMI")
Analyzed-by: YiFei Zhu <zhuyifei@google.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit df32e5c568c9cf68c15a9bbd98d0c3aff19eab63)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index bcb103560c..143d08f1aa 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -645,8 +645,6 @@ void apic_sipi(DeviceState *dev)
 {
     APICCommonState *s = APIC(dev);
 
-    cpu_reset_interrupt(CPU(s->cpu), CPU_INTERRUPT_SIPI);
-
     if (!s->wait_for_sipi)
         return;
     cpu_x86_load_seg_cache_sipi(s->cpu, s->sipi_vector);
diff --git a/target/i386/helper.c b/target/i386/helper.c
index e0aaed3c4c..693a95558f 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -619,6 +619,10 @@ void do_cpu_init(X86CPU *cpu)
 
 void do_cpu_sipi(X86CPU *cpu)
 {
+    CPUX86State *env = &cpu->env;
+    if (env->hflags & HF_SMM_MASK) {
+        return;
+    }
     apic_sipi(cpu->apic_state);
 }
 
diff --git a/target/i386/tcg/system/seg_helper.c b/target/i386/tcg/system/seg_helper.c
index d4ea890c12..e7d76e41d2 100644
--- a/target/i386/tcg/system/seg_helper.c
+++ b/target/i386/tcg/system/seg_helper.c
@@ -182,6 +182,7 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
         apic_poll_irq(cpu->apic_state);
         break;
     case CPU_INTERRUPT_SIPI:
+        cpu_reset_interrupt(cs, CPU_INTERRUPT_SIPI);
         do_cpu_sipi(cpu);
         break;
     case CPU_INTERRUPT_SMI:
-- 
2.47.3



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

* [Stable-10.1.2 16/23] i386/tcg/smm_helper: Properly apply DR values on SMM entry / exit
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (3 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 15/23] i386/cpu: Prevent delivering SIPI during SMM in TCG mode Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 17/23] target/i386: fix x86_64 pushw op Michael Tokarev
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, YiFei Zhu, unvariant.winter, Paolo Bonzini,
	Michael Tokarev

From: YiFei Zhu <zhuyifei@google.com>

do_smm_enter and helper_rsm sets the env->dr, but does not sync the
values with cpu_x86_update_dr7. A malicious kernel may control the
instruction pointer in SMM by setting a breakpoint on the SMI
entry point, and after do_smm_enter cpu->breakpoints contains the
stale breakpoint; and because IDT is not reloaded upon SMI entry,
the debug exception handler controlled by the malicious kernel
is invoked.

Fixes: 01df040b5247 ("x86: Debug register emulation (Jan Kiszka)")
Reported-by: unvariant.winter@gmail.com
Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Link: https://lore.kernel.org/r/2bacb9b24e9d337dbe48791aa25d349eb9c52c3a.1758794468.git.zhuyifei@google.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit cdba90ac1b0ac789b10c0b5f6ef7e9558237ec66)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/system/smm_helper.c b/target/i386/tcg/system/smm_helper.c
index 251eb7856c..fb028a8272 100644
--- a/target/i386/tcg/system/smm_helper.c
+++ b/target/i386/tcg/system/smm_helper.c
@@ -168,7 +168,7 @@ void do_smm_enter(X86CPU *cpu)
                        env->cr[0] & ~(CR0_PE_MASK | CR0_EM_MASK | CR0_TS_MASK |
                                       CR0_PG_MASK));
     cpu_x86_update_cr4(env, 0);
-    env->dr[7] = 0x00000400;
+    helper_set_dr(env, 7, 0x00000400);
 
     cpu_x86_load_seg_cache(env, R_CS, (env->smbase >> 4) & 0xffff, env->smbase,
                            0xffffffff,
@@ -233,8 +233,8 @@ void helper_rsm(CPUX86State *env)
     env->eip = x86_ldq_phys(cs, sm_state + 0x7f78);
     cpu_load_eflags(env, x86_ldl_phys(cs, sm_state + 0x7f70),
                     ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
-    env->dr[6] = x86_ldl_phys(cs, sm_state + 0x7f68);
-    env->dr[7] = x86_ldl_phys(cs, sm_state + 0x7f60);
+    helper_set_dr(env, 6, x86_ldl_phys(cs, sm_state + 0x7f68));
+    helper_set_dr(env, 7, x86_ldl_phys(cs, sm_state + 0x7f60));
 
     cpu_x86_update_cr4(env, x86_ldl_phys(cs, sm_state + 0x7f48));
     cpu_x86_update_cr3(env, x86_ldq_phys(cs, sm_state + 0x7f50));
@@ -268,8 +268,8 @@ void helper_rsm(CPUX86State *env)
     env->regs[R_EDX] = x86_ldl_phys(cs, sm_state + 0x7fd8);
     env->regs[R_ECX] = x86_ldl_phys(cs, sm_state + 0x7fd4);
     env->regs[R_EAX] = x86_ldl_phys(cs, sm_state + 0x7fd0);
-    env->dr[6] = x86_ldl_phys(cs, sm_state + 0x7fcc);
-    env->dr[7] = x86_ldl_phys(cs, sm_state + 0x7fc8);
+    helper_set_dr(env, 6, x86_ldl_phys(cs, sm_state + 0x7fcc));
+    helper_set_dr(env, 7, x86_ldl_phys(cs, sm_state + 0x7fc8));
 
     env->tr.selector = x86_ldl_phys(cs, sm_state + 0x7fc4) & 0xffff;
     env->tr.base = x86_ldl_phys(cs, sm_state + 0x7f64);
-- 
2.47.3



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

* [Stable-10.1.2 17/23] target/i386: fix x86_64 pushw op
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (4 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 16/23] i386/tcg/smm_helper: Properly apply DR values on SMM entry / exit Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 18/23] target/i386: fix access to the T bit of the TSS Michael Tokarev
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Thomas Ogrisegg, Paolo Bonzini, Michael Tokarev

From: Thomas Ogrisegg <tom-bugs-qemu@fnord.at>

For x86_64 a 16 bit push op (pushw) of a memory address would generate
a 64 bit store on the stack instead of a 16 bit store.

For example:
        pushw (%rax)

behaves like
        pushq (%rax)

which is incorrect.

This patch fixes that.

Signed-off-by: Thomas Ogrisegg <tom-bugs-qemu@fnord.at>
Link: https://lore.kernel.org/r/20250715210307.GA1115@x1.fnord.at
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 5a2faa0a0a2cbdad4a108a0e122b0e51b9bc94fd)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
index 51038657f0..a50f57dbaa 100644
--- a/target/i386/tcg/decode-new.c.inc
+++ b/target/i386/tcg/decode-new.c.inc
@@ -1541,7 +1541,7 @@ static void decode_group4_5(DisasContext *s, CPUX86State *env, X86OpEntry *entry
         [0x0b] = X86_OP_ENTRYr(CALLF_m, M,p),
         [0x0c] = X86_OP_ENTRYr(JMP_m,   E,f64,                         zextT0),
         [0x0d] = X86_OP_ENTRYr(JMPF_m,  M,p),
-        [0x0e] = X86_OP_ENTRYr(PUSH,    E,f64),
+        [0x0e] = X86_OP_ENTRYr(PUSH,    E,d64),
     };
 
     int w = (*b & 1);
-- 
2.47.3



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

* [Stable-10.1.2 18/23] target/i386: fix access to the T bit of the TSS
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (5 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 17/23] target/i386: fix x86_64 pushw op Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 19/23] async: access bottom half flags with qatomic_read Michael Tokarev
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Thomas Huth, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

The T bit is bit 0 of the 16-bit word at offset 100 of the TSS.  However,
accessing it with a 32-bit word is not really correct, because bytes
102-103 contain the I/O map base address (relative to the base of the
TSS) and bits 1-15 are reserved.  In particular, any task switch to a TSS that
has a nonzero I/O map base address is broken.

This fixes the eventinj and taskswitch tests in kvm-unit-tests.

Cc: qemu-stable@nongnu.org
Fixes: ad441b8b791 ("target/i386: implement TSS trap bit", 2025-05-12)
Reported-by: Thomas Huth <thuth@redhat.com>
Closes: https://gitlab.com/qemu-project/qemu/-/issues/3101
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 0d22b621b7969eefde3535a0805977a334936fd7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c
index 071f3fbd83..f49fe851cd 100644
--- a/target/i386/tcg/seg_helper.c
+++ b/target/i386/tcg/seg_helper.c
@@ -456,7 +456,7 @@ static void switch_tss_ra(CPUX86State *env, int tss_selector,
             new_segs[i] = access_ldw(&new, tss_base + (0x48 + i * 4));
         }
         new_ldt = access_ldw(&new, tss_base + 0x60);
-        new_trap = access_ldl(&new, tss_base + 0x64);
+        new_trap = access_ldw(&new, tss_base + 0x64) & 1;
     } else {
         /* 16 bit */
         new_cr3 = 0;
-- 
2.47.3



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

* [Stable-10.1.2 19/23] async: access bottom half flags with qatomic_read
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (6 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 18/23] target/i386: fix access to the T bit of the TSS Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 20/23] target/i386: user: do not set up a valid LDT on reset Michael Tokarev
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

Running test-aio-multithread under TSAN reveals data races on bh->flags.
Because bottom halves may be scheduled or canceled asynchronously,
without taking a lock, adjust aio_compute_bh_timeout() and aio_ctx_check()
to use a relaxed read to access the flags.

Use an acquire load to ensure that anything that was written prior to
qemu_bh_schedule() is visible.

Closes: https://gitlab.com/qemu-project/qemu/-/issues/2749
Closes: https://gitlab.com/qemu-project/qemu/-/issues/851
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 5142397c79330aab9bef3230991c8ac0c251110f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/util/async.c b/util/async.c
index 2719c629ae..a736d2cd0d 100644
--- a/util/async.c
+++ b/util/async.c
@@ -256,8 +256,9 @@ static int64_t aio_compute_bh_timeout(BHList *head, int timeout)
     QEMUBH *bh;
 
     QSLIST_FOREACH_RCU(bh, head, next) {
-        if ((bh->flags & (BH_SCHEDULED | BH_DELETED)) == BH_SCHEDULED) {
-            if (bh->flags & BH_IDLE) {
+        int flags = qatomic_load_acquire(&bh->flags);
+        if ((flags & (BH_SCHEDULED | BH_DELETED)) == BH_SCHEDULED) {
+            if (flags & BH_IDLE) {
                 /* idle bottom halves will be polled at least
                  * every 10ms */
                 timeout = 10000000;
@@ -335,14 +336,16 @@ aio_ctx_check(GSource *source)
     aio_notify_accept(ctx);
 
     QSLIST_FOREACH_RCU(bh, &ctx->bh_list, next) {
-        if ((bh->flags & (BH_SCHEDULED | BH_DELETED)) == BH_SCHEDULED) {
+        int flags = qatomic_load_acquire(&bh->flags);
+        if ((flags & (BH_SCHEDULED | BH_DELETED)) == BH_SCHEDULED) {
             return true;
         }
     }
 
     QSIMPLEQ_FOREACH(s, &ctx->bh_slice_list, next) {
         QSLIST_FOREACH_RCU(bh, &s->bh_list, next) {
-            if ((bh->flags & (BH_SCHEDULED | BH_DELETED)) == BH_SCHEDULED) {
+            int flags = qatomic_load_acquire(&bh->flags);
+            if ((flags & (BH_SCHEDULED | BH_DELETED)) == BH_SCHEDULED) {
                 return true;
             }
         }
-- 
2.47.3



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

* [Stable-10.1.2 20/23] target/i386: user: do not set up a valid LDT on reset
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (7 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 19/23] async: access bottom half flags with qatomic_read Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 21/23] accel/tcg: Hoist first page lookup above pointer_wrap Michael Tokarev
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

In user-mode emulation, QEMU uses the default setting of the LDT base
and limit, which places it at the bottom 64K of virtual address space.
However, by default there is no LDT at all in Linux processes, and
therefore the limit should be 0.

This is visible as a NULL pointer dereference in LSL and LAR instructions
when they try to read the LDT at an unmapped address.

Resolves: #1376
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 58aa1d08bbc406ba3982f32ffb1bef0ff4f8f369)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index ab18de894e..25bbbf70cc 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -8632,7 +8632,11 @@ static void x86_cpu_reset_hold(Object *obj, ResetType type)
 
     env->idt.limit = 0xffff;
     env->gdt.limit = 0xffff;
+#if defined(CONFIG_USER_ONLY)
+    env->ldt.limit = 0;
+#else
     env->ldt.limit = 0xffff;
+#endif
     env->ldt.flags = DESC_P_MASK | (2 << DESC_TYPE_SHIFT);
     env->tr.limit = 0xffff;
     env->tr.flags = DESC_P_MASK | (11 << DESC_TYPE_SHIFT);
-- 
2.47.3



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

* [Stable-10.1.2 21/23] accel/tcg: Hoist first page lookup above pointer_wrap
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (8 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 20/23] target/i386: user: do not set up a valid LDT on reset Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 22/23] target/hppa: correct size bit parity for fmpyadd Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 23/23] linux-user/microblaze: Fix little-endianness binary Michael Tokarev
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Richard Henderson, Philippe Mathieu-Daudé,
	Michael Tokarev

From: Richard Henderson <richard.henderson@linaro.org>

For strict alignment targets we registered cpu_pointer_wrap_notreached,
but generic code used it before recognizing the alignment exception.
Hoist the first page lookup, so that the alignment exception happens first.

Cc: qemu-stable@nongnu.org
Buglink: https://bugs.debian.org/1112285
Fixes: a4027ed7d4be ("target: Use cpu_pointer_wrap_notreached for strict align targets")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit ec03dd9723781c7e9d4b4f70c7f54d12da9459d5)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 87e14bde4f..b063a572e7 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1744,6 +1744,7 @@ static bool mmu_lookup(CPUState *cpu, vaddr addr, MemOpIdx oi,
                        uintptr_t ra, MMUAccessType type, MMULookupLocals *l)
 {
     bool crosspage;
+    vaddr last;
     int flags;
 
     l->memop = get_memop(oi);
@@ -1753,13 +1754,15 @@ static bool mmu_lookup(CPUState *cpu, vaddr addr, MemOpIdx oi,
 
     l->page[0].addr = addr;
     l->page[0].size = memop_size(l->memop);
-    l->page[1].addr = (addr + l->page[0].size - 1) & TARGET_PAGE_MASK;
+    l->page[1].addr = 0;
     l->page[1].size = 0;
-    crosspage = (addr ^ l->page[1].addr) & TARGET_PAGE_MASK;
 
-    if (likely(!crosspage)) {
-        mmu_lookup1(cpu, &l->page[0], l->memop, l->mmu_idx, type, ra);
+    /* Lookup and recognize exceptions from the first page. */
+    mmu_lookup1(cpu, &l->page[0], l->memop, l->mmu_idx, type, ra);
 
+    last = addr + l->page[0].size - 1;
+    crosspage = (addr ^ last) & TARGET_PAGE_MASK;
+    if (likely(!crosspage)) {
         flags = l->page[0].flags;
         if (unlikely(flags & (TLB_WATCHPOINT | TLB_NOTDIRTY))) {
             mmu_watch_or_dirty(cpu, &l->page[0], type, ra);
@@ -1769,18 +1772,18 @@ static bool mmu_lookup(CPUState *cpu, vaddr addr, MemOpIdx oi,
         }
     } else {
         /* Finish compute of page crossing. */
-        int size0 = l->page[1].addr - addr;
+        vaddr addr1 = last & TARGET_PAGE_MASK;
+        int size0 = addr1 - addr;
         l->page[1].size = l->page[0].size - size0;
         l->page[0].size = size0;
-
         l->page[1].addr = cpu->cc->tcg_ops->pointer_wrap(cpu, l->mmu_idx,
-                                                         l->page[1].addr, addr);
+                                                         addr1, addr);
 
         /*
-         * Lookup both pages, recognizing exceptions from either.  If the
-         * second lookup potentially resized, refresh first CPUTLBEntryFull.
+         * Lookup and recognize exceptions from the second page.
+         * If the lookup potentially resized the table, refresh the
+         * first CPUTLBEntryFull pointer.
          */
-        mmu_lookup1(cpu, &l->page[0], l->memop, l->mmu_idx, type, ra);
         if (mmu_lookup1(cpu, &l->page[1], 0, l->mmu_idx, type, ra)) {
             uintptr_t index = tlb_index(cpu, l->mmu_idx, addr);
             l->page[0].full = &cpu->neg.tlb.d[l->mmu_idx].fulltlb[index];
-- 
2.47.3



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

* [Stable-10.1.2 22/23] target/hppa: correct size bit parity for fmpyadd
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (9 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 21/23] accel/tcg: Hoist first page lookup above pointer_wrap Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  2025-10-18 19:06 ` [Stable-10.1.2 23/23] linux-user/microblaze: Fix little-endianness binary Michael Tokarev
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Gabriel Brookman, Andreas Hüttel,
	Richard Henderson, Helge Deller, Philippe Mathieu-Daudé,
	Michael Tokarev

From: Gabriel Brookman <brookmangabriel@gmail.com>

For the fmpyadd instruction on the hppa architecture, there is a bit
used to specify whether the instruction is operating on a 32 bit or
64 bit floating point register. For most instructions, such a bit is 0
when operating on the smaller register and 1 when operating on the
larger register. However, according to page 6-57 of the PA-RISC 1.1
Architecture and Instruction Set Reference Manual, this convention is
reversed for the fmpyadd instruction specifically, meaning the bit is
1 for operations on 32 bit registers and 0 for 64 bit registers. See
also page 6-18 (fig. 6-8) and 6-19 (table 6-16), where the f field
for FMPYADD and FMPYSUB is documented. Previously, QEMU decoded this
operation as operating on the other size of register, leading to bugs
when translating the fmpyadd instruction. This patch fixes that issue.

Reported-by: Andreas Hüttel <andreas.huettel@ur.de>
Signed-off-by: Gabriel Brookman <brookmangabriel@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3096
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-ID: <20251009-hppa-correct-fmpyadd-size-bit-decoding-v1-1-f63bb6c3290c@gmail.com>
[PMD: Add documentation refs mentioned by Andreas K. Huettel]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit cea82f8cdd07697a48ae1c4e026707463f432a45)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode
index 4eaac750ea..13c6a55bf2 100644
--- a/target/hppa/insns.decode
+++ b/target/hppa/insns.decode
@@ -365,10 +365,10 @@ fstd            011100 ..... ..... .. ............1.    @ldstim11
 &mpyadd         rm1 rm2 ta ra tm
 @mpyadd         ...... rm1:5 rm2:5 ta:5 ra:5 . tm:5     &mpyadd
 
-fmpyadd_f       000110 ..... ..... ..... ..... 0 .....  @mpyadd
-fmpyadd_d       000110 ..... ..... ..... ..... 1 .....  @mpyadd
-fmpysub_f       100110 ..... ..... ..... ..... 0 .....  @mpyadd
-fmpysub_d       100110 ..... ..... ..... ..... 1 .....  @mpyadd
+fmpyadd_f       000110 ..... ..... ..... ..... 1 .....  @mpyadd
+fmpyadd_d       000110 ..... ..... ..... ..... 0 .....  @mpyadd
+fmpysub_f       100110 ..... ..... ..... ..... 1 .....  @mpyadd
+fmpysub_d       100110 ..... ..... ..... ..... 0 .....  @mpyadd
 
 ####
 # Conditional Branches
-- 
2.47.3



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

* [Stable-10.1.2 23/23] linux-user/microblaze: Fix little-endianness binary
  2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
                   ` (10 preceding siblings ...)
  2025-10-18 19:06 ` [Stable-10.1.2 22/23] target/hppa: correct size bit parity for fmpyadd Michael Tokarev
@ 2025-10-18 19:06 ` Michael Tokarev
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2025-10-18 19:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-stable, Philippe Mathieu-Daudé, Edgar E. Iglesias,
	Edgar E. Iglesias, Michael Tokarev

From: Philippe Mathieu-Daudé <philmd@linaro.org>

MicroBlaze CPU model has a "little-endian" property, pointing to
the @endi internal field. Commit c36ec3a9655 ("hw/microblaze:
Explicit CPU endianness") took care of having all MicroBlaze
boards with an explicit default endianness, so later commit
415aae543ed ("target/microblaze: Consider endianness while
translating code") could infer the endianness at runtime from
the @endi field, and not a compile time via the TARGET_BIG_ENDIAN
definition. Doing so, we forgot to make the endianness explicit
on user emulation, so there all CPUs are started with the default
"little-endian=off" value, leading to breaking support for little
endian binaries:

  $ readelf -h ./hello-world-mbel
  ELF Header:
    Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
    Class:                             ELF32
    Data:                              2's complement, little endian

  $ qemu-microblazeel ./hello-world-mbel
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  Segmentation fault (core dumped)

Fix by restoring the previous behavior of starting with the
builtin endianness of the binary:

  $ qemu-microblazeel ./hello-world-mbel
  Hello World

Cc: qemu-stable@nongnu.org
Fixes: 415aae543ed ("target/microblaze: Consider endianness while translating code")
Reported-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Message-Id: <20251006173350.17455-1-philmd@linaro.org>
(cherry picked from commit 91fc6d8101de97c588e0a4263cf4f6148b3e702a)
(Mjt: adapt for missing v10.1.0-38-gaf880af8d4
 "linux-user: Move get_elf_cpu_model to target/elfload.c")
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/linux-user/microblaze/target_elf.h b/linux-user/microblaze/target_elf.h
index 8a8f1debff..cab4c9187c 100644
--- a/linux-user/microblaze/target_elf.h
+++ b/linux-user/microblaze/target_elf.h
@@ -9,6 +9,7 @@
 #define MICROBLAZE_TARGET_ELF_H
 static inline const char *cpu_get_model(uint32_t eflags)
 {
-    return "any";
+    return TARGET_BIG_ENDIAN ? "any,little-endian=off"
+                             : "any,little-endian=on";
 }
 #endif
-- 
2.47.3



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

end of thread, other threads:[~2025-10-18 19:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18 19:06 [Stable-10.1.2 v2 00/23] Patch Round-up for stable 10.1.2, freeze on 2025-10-18 (frozen) Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 12/23] block/curl.c: Use explicit long constants in curl_easy_setopt calls Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 13/23] target/i386: Fix CR2 handling for non-canonical addresses Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 14/23] i386/kvm: Expose ARCH_CAP_FB_CLEAR when invulnerable to MDS Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 15/23] i386/cpu: Prevent delivering SIPI during SMM in TCG mode Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 16/23] i386/tcg/smm_helper: Properly apply DR values on SMM entry / exit Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 17/23] target/i386: fix x86_64 pushw op Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 18/23] target/i386: fix access to the T bit of the TSS Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 19/23] async: access bottom half flags with qatomic_read Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 20/23] target/i386: user: do not set up a valid LDT on reset Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 21/23] accel/tcg: Hoist first page lookup above pointer_wrap Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 22/23] target/hppa: correct size bit parity for fmpyadd Michael Tokarev
2025-10-18 19:06 ` [Stable-10.1.2 23/23] linux-user/microblaze: Fix little-endianness binary 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).