diff mbox series

[PULL,06/62] target/i386: set `CF_PCREL` in `x86_cpu_realizefn`

Message ID 20230301025643.1227244-7-richard.henderson@linaro.org
State Accepted
Commit 492f8b88aeffb36dbcd736f4e5add67ceda299c4
Headers show
Series [PULL,01/62] exec/helper-head: Include missing "fpu/softfloat-types.h" header | expand

Commit Message

Richard Henderson March 1, 2023, 2:55 a.m. UTC
From: Anton Johansson via <qemu-devel@nongnu.org>

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230227135202.9710-3-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/i386/cpu.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 4bad3d41d3..62755bf511 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6534,6 +6534,11 @@  static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
     static bool ht_warned;
     unsigned requested_lbr_fmt;
 
+    /* Use pc-relative instructions in system-mode */
+#ifndef CONFIG_USER_ONLY
+    cs->tcg_cflags |= CF_PCREL;
+#endif
+
     if (cpu->apic_id == UNASSIGNED_APIC_ID) {
         error_setg(errp, "apic-id property was not initialized properly");
         return;