From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 2/3] target/i386: fail if toggling LA57 in 64-bit mode
Date: Thu, 18 Mar 2021 11:00:21 -0400 [thread overview]
Message-ID: <20210318150022.1824646-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20210318150022.1824646-1-pbonzini@redhat.com>
This fixes kvm-unit-tests access.flat with -cpu qemu64,la57.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/misc_helper.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c
index 90b87fdef0..a25428c36e 100644
--- a/target/i386/tcg/misc_helper.c
+++ b/target/i386/tcg/misc_helper.c
@@ -167,6 +167,10 @@ void helper_write_crN(CPUX86State *env, int reg, target_ulong t0)
cpu_x86_update_cr3(env, t0);
break;
case 4:
+ if (((t0 ^ env->cr[4]) & CR4_LA57_MASK) &&
+ (env->hflags & HF_CS64_MASK)) {
+ raise_exception_ra(env, EXCP0D_GPF, GETPC());
+ }
cpu_x86_update_cr4(env, t0);
break;
case 8:
--
2.26.2
next prev parent reply other threads:[~2021-03-18 15:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 15:00 [PATCH 0/3] target/i386: kvm-unit-tests fixes related to page table lookup Paolo Bonzini
2021-03-18 15:00 ` [PATCH 1/3] target/i386: allow modifying TCG phys-addr-bits Paolo Bonzini
2021-03-18 15:00 ` Paolo Bonzini [this message]
2021-03-18 15:00 ` [PATCH 3/3] target/i386: svm: do not discard high 32 bits of EXITINFO1 Paolo Bonzini
2021-03-18 15:12 ` [PATCH 0/3] target/i386: kvm-unit-tests fixes related to page table lookup no-reply
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=20210318150022.1824646-3-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).