From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Volker Rümelin" <vr_qemu@t-online.de>,
"Lara Lazier" <laramglazier@gmail.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PULL 1/3] target/i386: Fixed size of constant for Windows
Date: Fri, 13 Aug 2021 15:37:14 +0200 [thread overview]
Message-ID: <20210813133716.289058-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20210813133716.289058-1-pbonzini@redhat.com>
From: Lara Lazier <laramglazier@gmail.com>
~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 | 2 +-
target/i386/tcg/sysemu/svm_helper.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/i386/tcg/sysemu/misc_helper.c b/target/i386/tcg/sysemu/misc_helper.c
index d347af2a99..e7a2ebde81 100644
--- a/target/i386/tcg/sysemu/misc_helper.c
+++ b/target/i386/tcg/sysemu/misc_helper.c
@@ -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)) {
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index e151104b4e..0d549b3d6c 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -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));
--
2.31.1
next prev parent reply other threads:[~2021-08-13 13:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 13:37 [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Paolo Bonzini
2021-08-13 13:37 ` Paolo Bonzini [this message]
2021-08-13 13:37 ` [PULL 2/3] hw/core: Add missing return on error Paolo Bonzini
2021-08-13 13:37 ` [PULL 3/3] hw/core: fix error checking in smp_parse Paolo Bonzini
2021-08-15 10:13 ` [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210813133716.289058-2-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=f4bug@amsat.org \
--cc=laramglazier@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=vr_qemu@t-online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).