target/i386: Check for USER_ONLY definition instead of SOFTMMU one
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 4 Oct 2023 08:22:39 +0000 (10:22 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 7 Oct 2023 17:02:33 +0000 (19:02 +0200)
Since we *might* have user emulation with softmmu,
replace the system emulation check by !user emulation one.

(target/ was cleaned from invalid CONFIG_SOFTMMU uses at
commit cab35c73be, but these files were merged few days
after, thus missed the cleanup.)

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231004082239.27251-1-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c
target/i386/tcg/misc_helper.c
target/i386/tcg/translate.c

index ac0ae502f5d8292497122488cdac25bcc014d5af..cec5d2b7b65e8ab90c68f9867d4aa5f56705fe24 100644 (file)
@@ -719,7 +719,7 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
           CPUID_7_0_EBX_HLE
           CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM */
 
-#if defined CONFIG_SOFTMMU || defined CONFIG_LINUX
+#if !defined CONFIG_USER_ONLY || defined CONFIG_LINUX
 #define TCG_7_0_ECX_RDPID CPUID_7_0_ECX_RDPID
 #else
 #define TCG_7_0_ECX_RDPID 0
index 868f36ab7f55cf6b29e76bdb31161cc6f1f4fe98..babff061864f27e7a7dd35e95bc81412e1704e90 100644 (file)
@@ -134,7 +134,7 @@ void helper_wrpkru(CPUX86State *env, uint32_t ecx, uint64_t val)
 
 target_ulong HELPER(rdpid)(CPUX86State *env)
 {
-#if defined CONFIG_SOFTMMU
+#if !defined CONFIG_USER_ONLY
     return env->tsc_aux;
 #elif defined CONFIG_LINUX && defined CONFIG_GETCPU
     unsigned cpu, node;
index 4f1287311d903fe3baaf28b17d88f09060cdca92..d2061ec44a0ac44eec613fcadd864a4c5b07c748 100644 (file)
@@ -178,10 +178,10 @@ typedef struct DisasContext {
 #else
 #define CODE64(S) (((S)->flags & HF_CS64_MASK) != 0)
 #endif
-#if defined(CONFIG_SOFTMMU) && !defined(TARGET_X86_64)
-#define LMA(S)    false
-#else
+#if defined(CONFIG_USER_ONLY) || defined(TARGET_X86_64)
 #define LMA(S)    (((S)->flags & HF_LMA_MASK) != 0)
+#else
+#define LMA(S)    false
 #endif
 
 #ifdef TARGET_X86_64