From: Jaume Marti Farriol <jaume.martif@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Jaume Marti Farriol" <jaume.martif@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Vadim Rozenfeld" <vrozenfe@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Laszlo Ersek" <lersek@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH v3 1/3] target-i386: x87 exception pointers using TCG.
Date: Sun, 7 Sep 2014 00:31:58 +0200 [thread overview]
Message-ID: <1410042720-17750-2-git-send-email-jaume.martif@gmail.com> (raw)
In-Reply-To: <1410042720-17750-1-git-send-email-jaume.martif@gmail.com>
This adds new fields in the CPUX86State struct to store the x87
exception pointers.
Also it adds a new enum type that encodes the operand size and the
processor operating mode (protected and real mode).
Signed-off-by: jaume.martif@gmail.com
---
target-i386/cpu.h | 23 +++++++++++++++++++++--
target-i386/machine.c | 2 +-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 3460b12..a749c43 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -690,6 +690,24 @@ typedef enum {
CC_OP_NB,
} CCOp;
+typedef enum {
+ B8 = 0,
+ B16 = 1,
+ B32 = 2,
+ B64 = 3,
+ BSIZE = 3, /* Mask for the above. */
+
+ RM = 4,
+ PM = 8,
+
+ PM32 = PM | B32,
+ PM16 = PM | B16,
+ RM32 = RM | B32,
+ RM16 = RM | B16,
+} OMode;
+
+#define TO_OMODE(bsize, is_pm) ((bsize & BSIZE) | (1 << (is_pm ? 3 : 2)))
+
typedef struct SegmentCache {
uint32_t selector;
target_ulong base;
@@ -821,10 +839,11 @@ typedef struct CPUX86State {
uint16_t fpuc;
uint8_t fptags[8]; /* 0 = valid, 1 = empty */
FPReg fpregs[8];
- /* KVM-only so far */
- uint16_t fpop;
+ uint32_t fpop;
uint64_t fpip;
uint64_t fpdp;
+ uint32_t fpcs;
+ uint32_t fpds;
/* emulator internal variables */
float_status fp_status;
diff --git a/target-i386/machine.c b/target-i386/machine.c
index fb89065..0557100 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -397,7 +397,7 @@ static const VMStateDescription vmstate_fpop_ip_dp = {
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
- VMSTATE_UINT16(env.fpop, X86CPU),
+ VMSTATE_UINT32(env.fpop, X86CPU),
VMSTATE_UINT64(env.fpip, X86CPU),
VMSTATE_UINT64(env.fpdp, X86CPU),
VMSTATE_END_OF_LIST()
--
2.1.0
next prev parent reply other threads:[~2014-09-06 22:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-06 22:31 [Qemu-devel] [PATCH v3 0/3] target-i386: x87 exception pointers using TCG Jaume Marti Farriol
2014-09-06 22:31 ` Jaume Marti Farriol [this message]
2014-09-06 22:31 ` [Qemu-devel] [PATCH v3 2/3] " Jaume Marti Farriol
2014-09-06 23:01 ` Jaume Martí
2014-09-06 22:32 ` [Qemu-devel] [PATCH v3 3/3] " Jaume Marti Farriol
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=1410042720-17750-2-git-send-email-jaume.martif@gmail.com \
--to=jaume.martif@gmail.com \
--cc=afaerber@suse.de \
--cc=lersek@redhat.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vrozenfe@redhat.com \
/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).