aboutsummaryrefslogtreecommitdiff
path: root/target/i386
diff options
context:
space:
mode:
authorAnton Johansson <anjo@rev.ng>2023-02-27 14:51:37 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-03-01 07:31:27 -1000
commit492f8b88aeffb36dbcd736f4e5add67ceda299c4 (patch)
treeb31b73f6b1a91dd701b0ce58649ce74d3b86df86 /target/i386
parent5b6dfc6c9b56372b674ceeabde26f1260c663645 (diff)
target/i386: set `CF_PCREL` in `x86_cpu_realizefn`
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>
Diffstat (limited to 'target/i386')
-rw-r--r--target/i386/cpu.c5
1 files changed, 5 insertions, 0 deletions
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;