From 492f8b88aeffb36dbcd736f4e5add67ceda299c4 Mon Sep 17 00:00:00 2001 From: Anton Johansson Date: Mon, 27 Feb 2023 14:51:37 +0100 Subject: target/i386: set `CF_PCREL` in `x86_cpu_realizefn` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anton Johansson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230227135202.9710-3-anjo@rev.ng> Signed-off-by: Richard Henderson --- target/i386/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'target/i386') diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4bad3d4..62755bf 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; -- cgit v1.1