From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] target/i386: check intercept for XSETBV
Date: Fri, 13 Oct 2023 11:10:49 +0200 [thread overview]
Message-ID: <20231013091049.538945-1-pbonzini@redhat.com> (raw)
Note that this intercept is special; it is checked before the #GP
exception.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/svm.h | 1 +
target/i386/tcg/translate.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/target/i386/svm.h b/target/i386/svm.h
index f9a785489d8..1bd78447306 100644
--- a/target/i386/svm.h
+++ b/target/i386/svm.h
@@ -132,6 +132,7 @@
/* only included in documentation, maybe wrong */
#define SVM_EXIT_MONITOR 0x08a
#define SVM_EXIT_MWAIT 0x08b
+#define SVM_EXIT_XSETBV 0x08d
#define SVM_EXIT_NPF 0x400
#define SVM_EXIT_ERR -1
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index d2061ec44a0..4f6f9fa7e52 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -5916,6 +5916,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
| PREFIX_REPZ | PREFIX_REPNZ))) {
goto illegal_op;
}
+ gen_svm_check_intercept(s, SVM_EXIT_XSETBV);
if (!check_cpl0(s)) {
break;
}
--
2.41.0
reply other threads:[~2023-10-13 9:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20231013091049.538945-1-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).