From: Anton Johansson via <qemu-devel@nongnu.org>

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

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;
-- 
2.34.1


Reply via email to