All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Andres Gomez Del Real <sergio.g.delreal@gmail.com>
To: qemu-devel@nongnu.org
Cc: Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>
Subject: [Qemu-devel] [PATCH 04/14] hvf: add fields to CPUState and CPUX86State; add definitions
Date: Sun, 27 Aug 2017 20:56:44 -0500	[thread overview]
Message-ID: <20170828015654.2530-5-Sergio.G.DelReal@gmail.com> (raw)
In-Reply-To: <20170828015654.2530-1-Sergio.G.DelReal@gmail.com>

This commit adds some fields specific to hvf in CPUState and
CPUX86State. It also adds some handy #defines.

Signed-off-by: Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>
---
 include/qom/cpu.h |  8 ++++++++
 target/i386/cpu.h | 23 +++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 25eefea7ab..c46eb61240 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -407,6 +407,14 @@ struct CPUState {
      * unnecessary flushes.
      */
     uint16_t pending_tlb_flush;
+
+    // HVF
+    bool hvf_vcpu_dirty;
+    uint64_t hvf_fd; // fd of vcpu created by HVF
+    // Supporting data structures for VMCS capabilities
+    // and x86 emulation state
+    struct hvf_vcpu_caps* hvf_caps;
+    struct hvf_x86_state* hvf_x86;
 };
 
 QTAILQ_HEAD(CPUTailQ, CPUState);
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 051867399b..7d90f08b98 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -82,15 +82,19 @@
 #define R_GS 5
 
 /* segment descriptor fields */
+#define DESC_G_SHIFT    23
 #define DESC_G_MASK     (1 << 23)
 #define DESC_B_SHIFT    22
 #define DESC_B_MASK     (1 << DESC_B_SHIFT)
 #define DESC_L_SHIFT    21 /* x86_64 only : 64 bit code segment */
 #define DESC_L_MASK     (1 << DESC_L_SHIFT)
+#define DESC_AVL_SHIFT  20
 #define DESC_AVL_MASK   (1 << 20)
+#define DESC_P_SHIFT    15
 #define DESC_P_MASK     (1 << 15)
 #define DESC_DPL_SHIFT  13
 #define DESC_DPL_MASK   (3 << DESC_DPL_SHIFT)
+#define DESC_S_SHIFT    12
 #define DESC_S_MASK     (1 << 12)
 #define DESC_TYPE_SHIFT 8
 #define DESC_TYPE_MASK  (15 << DESC_TYPE_SHIFT)
@@ -631,6 +635,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_EBX_AVX512BW (1U << 30) /* AVX-512 Byte and Word Instructions */
 #define CPUID_7_0_EBX_AVX512VL (1U << 31) /* AVX-512 Vector Length Extensions */
 
+#define CPUID_7_0_ECX_AVX512BMI (1U << 1)
 #define CPUID_7_0_ECX_VBMI     (1U << 1)  /* AVX-512 Vector Byte Manipulation Instrs */
 #define CPUID_7_0_ECX_UMIP     (1U << 2)
 #define CPUID_7_0_ECX_PKU      (1U << 3)
@@ -806,6 +811,20 @@ typedef struct SegmentCache {
         float64  _d_##n[(bits)/64]; \
     }
 
+typedef union {
+    uint8_t _b[16];
+    uint16_t _w[8];
+    uint32_t _l[4];
+    uint64_t _q[2];
+} XMMReg;
+
+typedef union {
+    uint8_t _b[32];
+    uint16_t _w[16];
+    uint32_t _l[8];
+    uint64_t _q[4];
+} YMMReg;
+
 typedef MMREG_UNION(ZMMReg, 512) ZMMReg;
 typedef MMREG_UNION(MMXReg, 64)  MMXReg;
 
@@ -1041,7 +1060,11 @@ typedef struct CPUX86State {
     ZMMReg xmm_t0;
     MMXReg mmx_t0;
 
+    XMMReg ymmh_regs[CPU_NB_REGS];
+
     uint64_t opmask_regs[NB_OPMASK_REGS];
+    YMMReg zmmh_regs[CPU_NB_REGS];
+    ZMMReg hi16_zmm_regs[CPU_NB_REGS];
 
     /* sysenter registers */
     uint32_t sysenter_cs;
-- 
2.14.1

  parent reply	other threads:[~2017-08-28  1:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  1:56 [Qemu-devel] [PATCH 00/14] add support for Hypervisor.framework in QEMU Sergio Andres Gomez Del Real
2017-08-28  1:56 ` [Qemu-devel] [PATCH 01/14] hvf: add support for Hypervisor.framework in the configure script Sergio Andres Gomez Del Real
2017-08-29  9:00   ` Stefan Hajnoczi
2017-08-28  1:56 ` [Qemu-devel] [PATCH 02/14] hvf: add code base from Google's QEMU repository Sergio Andres Gomez Del Real
2017-08-29  9:12   ` Stefan Hajnoczi
2017-08-29 11:22   ` Daniel P. Berrange
2017-08-28  1:56 ` [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf code in cpus.c Sergio Andres Gomez Del Real
2017-08-29  9:19   ` Stefan Hajnoczi
2017-08-28  1:56 ` Sergio Andres Gomez Del Real [this message]
2017-08-29  9:31   ` [Qemu-devel] [PATCH 04/14] hvf: add fields to CPUState and CPUX86State; add definitions Stefan Hajnoczi
2017-08-28  1:56 ` [Qemu-devel] [PATCH 05/14] hvf: use new helper functions for put/get xsave Sergio Andres Gomez Del Real
2017-08-28  1:56 ` [Qemu-devel] [PATCH 06/14] hvf: add compilation rules to Makefile.objs Sergio Andres Gomez Del Real
2017-08-29  9:34   ` Stefan Hajnoczi
2017-08-28  1:56 ` [Qemu-devel] [PATCH 07/14] hvf: run hvf code through checkpatch.pl and fix style issues Sergio Andres Gomez Del Real
2017-08-29  9:35   ` Stefan Hajnoczi
2017-08-28  1:56 ` [Qemu-devel] [PATCH 08/14] apic: add function to apic that will be used by hvf Sergio Andres Gomez Del Real
2017-08-29  9:36   ` Stefan Hajnoczi
2017-08-28  1:56 ` [Qemu-devel] [PATCH 09/14] hvf: implement hvf_get_supported_cpuid Sergio Andres Gomez Del Real
2017-08-28  1:56 ` [Qemu-devel] [PATCH 10/14] hvf: refactor cpuid code Sergio Andres Gomez Del Real
2017-08-29  9:44   ` Stefan Hajnoczi
2017-08-28  1:56 ` [Qemu-devel] [PATCH 11/14] hvf: implement vga dirty page tracking Sergio Andres Gomez Del Real
2017-08-28  1:56 ` [Qemu-devel] [PATCH 12/14] hvf: move fields from CPUState to CPUX86State Sergio Andres Gomez Del Real
2017-08-28  1:56 ` [Qemu-devel] [PATCH 13/14] hvf: refactor event injection code for hvf Sergio Andres Gomez Del Real
2017-08-28  1:56 ` [Qemu-devel] [PATCH 14/14] hvf: inject General Protection Fault when vmexit through vmcall Sergio Andres Gomez Del Real
2017-08-28  7:24 ` [Qemu-devel] [PATCH 00/14] add support for Hypervisor.framework in QEMU no-reply
2017-08-29  9:51 ` Stefan Hajnoczi
2017-08-29  9:53 ` Stefan Hajnoczi

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=20170828015654.2530-5-Sergio.G.DelReal@gmail.com \
    --to=sergio.g.delreal@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.