]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
*: Remove __i386__ tests
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 18 Dec 2025 03:21:44 +0000 (14:21 +1100)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 16 Jan 2026 23:45:39 +0000 (10:45 +1100)
Remove instances of __i386__, except from tests and imported headers.

Drop a block containing sanity check and fprintf error message for
i386-on-i386 or x86_64-on-x86_64 emulation.  If we really want
something like this, we would do it via some form of compile-time check.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
13 files changed:
accel/kvm/kvm-all.c
configure
disas/disas-host.c
hw/display/xenfb.c
include/qemu/atomic.h
include/qemu/cacheflush.h
include/qemu/osdep.h
include/qemu/processor.h
include/qemu/timer.h
linux-user/syscall.c
target/i386/cpu.c
tcg/tci/tcg-target-mo.h
util/cacheflush.c

index f85eb42d78b8489da88393bcd1f3486b65e381af..8301a512e7fed220b1a73407f5dee2517b76f3fe 100644 (file)
@@ -61,7 +61,7 @@
 #include <sys/eventfd.h>
 #endif
 
-#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__)
 # define KVM_HAVE_MCE_INJECTION 1
 #endif
 
index 0742f1212de4953d2504375eb9b9bb45772d64aa..de0f3a8ebe516eea9507a5e34a19526362ed1cb8 100755 (executable)
--- a/configure
+++ b/configure
@@ -382,8 +382,6 @@ fi
 if test ! -z "$cpu" ; then
   # command line argument
   :
-elif check_define __i386__ ; then
-  cpu="i386"
 elif check_define __x86_64__ ; then
   if check_define __ILP32__ ; then
     cpu="x32"
index 88e7d8800c42eacccc734939fac5da736999d3cb..7cf432938e0b499973b410d7c0fe15cb93f7b8b3 100644 (file)
@@ -44,12 +44,6 @@ static void initialize_debug_host(CPUDebug *s)
 #endif
 #if defined(CONFIG_TCG_INTERPRETER)
     s->info.print_insn = print_insn_tci;
-#elif defined(__i386__)
-    s->info.mach = bfd_mach_i386_i386;
-    s->info.cap_arch = CS_ARCH_X86;
-    s->info.cap_mode = CS_MODE_32;
-    s->info.cap_insn_unit = 1;
-    s->info.cap_insn_split = 8;
 #elif defined(__x86_64__)
     s->info.mach = bfd_mach_x86_64;
     s->info.cap_arch = CS_ARCH_X86;
index 164fd0b248571ea394ae3c97a9eec8d6c8278236..ba886a940ee3d39831716f6d0aa438318e73b627 100644 (file)
@@ -459,10 +459,7 @@ static int xenfb_map_fb(struct XenFB *xenfb)
          */
         uint32_t *ptr32 = NULL;
         uint32_t *ptr64 = NULL;
-#if defined(__i386__)
-        ptr32 = (void*)page->pd;
-        ptr64 = ((void*)page->pd) + 4;
-#elif defined(__x86_64__)
+#if defined(__x86_64__)
         ptr32 = ((void*)page->pd) - 4;
         ptr64 = (void*)page->pd;
 #endif
@@ -480,11 +477,6 @@ static int xenfb_map_fb(struct XenFB *xenfb)
         /* 64bit dom0, 32bit domU */
         mode = 32;
         pd   = ((void*)page->pd) - 4;
-#elif defined(__i386__)
-    } else if (strcmp(protocol, XEN_IO_PROTO_ABI_X86_64) == 0) {
-        /* 32bit dom0, 64bit domU */
-        mode = 64;
-        pd   = ((void*)page->pd) + 4;
 #endif
     }
 
index f80cba24cf7804f9b1eaebab8c906edb0bcfdd78..c39dc99f2f014ce23bef24d8c8a400b325a1091f 100644 (file)
  * the same semantics.
  */
 #if !defined(QEMU_SANITIZE_THREAD) && \
-    (defined(__i386__) || defined(__x86_64__) || defined(__s390x__))
+    (defined(__x86_64__) || defined(__s390x__))
 # define smp_mb__before_rmw() signal_barrier()
 # define smp_mb__after_rmw() signal_barrier()
 #else
  */
 
 #if !defined(QEMU_SANITIZE_THREAD) && \
-    (defined(__i386__) || defined(__x86_64__) || defined(__s390x__))
+    (defined(__x86_64__) || defined(__s390x__))
 # define qatomic_set_mb(ptr, i) \
     ({ (void)qatomic_xchg(ptr, i); smp_mb__after_rmw(); })
 #else
index 76eb55d818db908a4fa267c5e09c54937f449552..8c64b878145856293c962dd8d25500cba59d7c91 100644 (file)
@@ -19,7 +19,7 @@
  * mappings of the same physical page(s).
  */
 
-#if defined(__i386__) || defined(__x86_64__) || defined(__s390__)
+#if defined(__x86_64__) || defined(__s390__)
 
 static inline void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len)
 {
index 4cdeda0b9c65dab9c3e261902dd114a465764199..b384b5b506b9f15d1b69dee0412fbc9ede8073d3 100644 (file)
@@ -637,9 +637,7 @@ bool qemu_has_ofd_lock(void);
 
 bool qemu_has_direct_io(void);
 
-#if defined(__HAIKU__) && defined(__i386__)
-#define FMT_pid "%ld"
-#elif defined(WIN64)
+#ifdef WIN64
 #define FMT_pid "%" PRId64
 #else
 #define FMT_pid "%d"
index 9f0dcdf28f465cb120c9aff027883d4673e5044b..95b3262f8b162648628057f06c91b8694423bd52 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef QEMU_PROCESSOR_H
 #define QEMU_PROCESSOR_H
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__x86_64__)
 # define cpu_relax() asm volatile("rep; nop" ::: "memory")
 
 #elif defined(__aarch64__)
index 8b561cd6960bf0fdf5d3a31dd2364db4a1aeb30d..7c18da165258ef56817a688eb6c6ac53507234ce 100644 (file)
@@ -866,15 +866,6 @@ static inline int64_t cpu_get_host_ticks(void)
     return retval;
 }
 
-#elif defined(__i386__)
-
-static inline int64_t cpu_get_host_ticks(void)
-{
-    int64_t val;
-    asm volatile ("rdtsc" : "=A" (val));
-    return val;
-}
-
 #elif defined(__x86_64__)
 
 static inline int64_t cpu_get_host_ticks(void)
index 67ad681098d9960c3aae9ecc68316811044d664a..3601715769090a0655b135e3cdf0811d1a0f29a3 100644 (file)
@@ -7452,15 +7452,6 @@ void syscall_init(void)
                               ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) |
                 (size << TARGET_IOC_SIZESHIFT);
         }
-
-        /* automatic consistency check if same arch */
-#if (defined(__i386__) && defined(TARGET_I386) && defined(TARGET_ABI32)) || \
-    (defined(__x86_64__) && defined(TARGET_X86_64))
-        if (unlikely(ie->target_cmd != ie->host_cmd)) {
-            fprintf(stderr, "ERROR: ioctl(%s): target=0x%x host=0x%x\n",
-                    ie->name, ie->target_cmd, ie->host_cmd);
-        }
-#endif
         ie++;
     }
 }
index 37803cd72490d91b75bfec5799e099ac0a15f0ac..0b8cca7cecf1906ea5ed890f91a76d5d4b0ed87c 100644 (file)
@@ -2251,16 +2251,6 @@ void host_cpuid(uint32_t function, uint32_t count,
                  : "=a"(vec[0]), "=b"(vec[1]),
                    "=c"(vec[2]), "=d"(vec[3])
                  : "0"(function), "c"(count) : "cc");
-#elif defined(__i386__)
-    asm volatile("pusha \n\t"
-                 "cpuid \n\t"
-                 "mov %%eax, 0(%2) \n\t"
-                 "mov %%ebx, 4(%2) \n\t"
-                 "mov %%ecx, 8(%2) \n\t"
-                 "mov %%edx, 12(%2) \n\t"
-                 "popa"
-                 : : "a"(function), "c"(count), "S"(vec)
-                 : "memory", "cc");
 #else
     abort();
 #endif
index 779872e39a014ede685f1faebd5a18dc4073cf8f..b5b389dafce49923c105349b27e0b63f090333b4 100644 (file)
@@ -8,7 +8,7 @@
 #define TCG_TARGET_MO_H
 
 /*
- * We could notice __i386__ or __s390x__ and reduce the barriers depending
+ * We could notice __x86_64__ or __s390x__ and reduce the barriers depending
  * on the host.  But if you want performance, you use the normal backend.
  * We prefer consistency across hosts on this.
  */
index 69c9614e2c9bb952bedc987f179f1d22b0e99854..99221a409ff0d5a11c2067f6a4c9536e7a402a88 100644 (file)
@@ -225,7 +225,7 @@ static void __attribute__((constructor)) init_cache_info(void)
  * Architecture (+ OS) specific cache flushing mechanisms.
  */
 
-#if defined(__i386__) || defined(__x86_64__) || defined(__s390__)
+#if defined(__x86_64__) || defined(__s390__)
 
 /* Caches are coherent and do not require flushing; symbol inline. */