]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/i386: Fixed size of constant for Windows
authorLara Lazier <laramglazier@gmail.com>
Thu, 12 Aug 2021 11:10:56 +0000 (13:10 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Aug 2021 12:31:49 +0000 (14:31 +0200)
~0UL has 64 bits on Linux and 32 bits on Windows.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/512
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210812111056.26926-1-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/sysemu/misc_helper.c
target/i386/tcg/sysemu/svm_helper.c

index d347af2a99b1dcb3f5675193b0258cece8bfe3d3..e7a2ebde813d1631954efbd7c2d4cc91072b7505 100644 (file)
@@ -97,7 +97,7 @@ void helper_write_crN(CPUX86State *env, int reg, target_ulong t0)
         break;
     case 3:
         if ((env->efer & MSR_EFER_LMA) &&
-                (t0 & ((~0UL) << env_archcpu(env)->phys_bits))) {
+                (t0 & ((~0ULL) << env_archcpu(env)->phys_bits))) {
             cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
         }
         if (!(env->efer & MSR_EFER_LMA)) {
index e151104b4eaf708cb5a3b24f2330def1f218a190..0d549b3d6c3bbb0748da47adb1f59ee9c7cff9cc 100644 (file)
@@ -264,7 +264,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
     }
     new_cr3 = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, save.cr3));
     if ((env->efer & MSR_EFER_LMA) &&
-            (new_cr3 & ((~0UL) << cpu->phys_bits))) {
+            (new_cr3 & ((~0ULL) << cpu->phys_bits))) {
         cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
     }
     new_cr4 = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, save.cr4));