]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/i386: Drop physical address range checks
authorAnton Johansson <anjo@rev.ng>
Tue, 9 Dec 2025 13:56:04 +0000 (14:56 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 25 Feb 2026 22:46:04 +0000 (23:46 +0100)
Since TARGET_PHYS_ADDR_SPACE_BITS is now fixed to 64 bits for all
targets we can remove range checks on cpu->phys_bits and
TCG_PHYS_ADDR_BITS.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-ID: <20260218-phys_addr-v6-3-a603bf363218@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
target/i386/cpu.c
target/i386/kvm/kvm.c
target/i386/tcg/helper-tcg.h

index eaa01438c1b95a57124c3ed7e3d1da9de131c78f..9b9ed2d1e38ebf2e01e094a0f8c2d5c9b4471e01 100644 (file)
@@ -9941,12 +9941,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
      * accel-specific code in cpu_exec_realizefn.
      */
     if (env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) {
-        if (cpu->phys_bits &&
-            (cpu->phys_bits > TARGET_PHYS_ADDR_SPACE_BITS ||
-            cpu->phys_bits < 32)) {
-            error_setg(errp, "phys-bits should be between 32 and %u "
-                             " (but is %u)",
-                             TARGET_PHYS_ADDR_SPACE_BITS, cpu->phys_bits);
+        if (cpu->phys_bits && cpu->phys_bits < 32) {
+            error_setg(errp, "phys-bits should be at least 32"
+                             " (but is %u)", cpu->phys_bits);
             return;
         }
         /*
index 9f1a4d4cbb26d9e5688c9018b038f0c3b7c89b0e..3b66ec8c42b224739d8a129c35f4966548b2f17b 100644 (file)
@@ -4983,8 +4983,7 @@ static int kvm_get_msrs(X86CPU *cpu)
      */
 
     if (cpu->fill_mtrr_mask) {
-        QEMU_BUILD_BUG_ON(TARGET_PHYS_ADDR_SPACE_BITS > 52);
-        assert(cpu->phys_bits <= TARGET_PHYS_ADDR_SPACE_BITS);
+        assert(cpu->phys_bits <= 52);
         mtrr_top_bits = MAKE_64BIT_MASK(cpu->phys_bits, 52 - cpu->phys_bits);
     } else {
         mtrr_top_bits = 0;
index e41cbda407aefaa355f9e4bf39d3bb871519e1d3..f4b2ff740d54935bebb0c4e9115aad94708c67a3 100644 (file)
@@ -31,8 +31,6 @@
 # define TCG_PHYS_ADDR_BITS 36
 #endif
 
-QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS);
-
 /**
  * x86_cpu_do_interrupt:
  * @cpu: vCPU the interrupt is to be handled by.