All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: [PATCH 07/15] x86/vmx: Use hvm_{get, set}_segment_register() rather than vmx_{get, set}_segment_register()
Date: Wed, 23 Nov 2016 15:38:50 +0000	[thread overview]
Message-ID: <1479915538-15282-8-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1479915538-15282-1-git-send-email-andrew.cooper3@citrix.com>

No functional change at this point, but this is a prerequisite for forthcoming
functional changes.

Make vmx_get_segment_register() private to vmx.c like all the other Vendor
get/set functions.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
CC: Jun Nakajima <jun.nakajima@intel.com>
CC: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        | 14 +++++++-------
 xen/arch/x86/hvm/vmx/vvmx.c       |  6 +++---
 xen/include/asm-x86/hvm/vmx/vmx.h |  2 --
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index eb7c902..29c6088 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -940,8 +940,8 @@ static void vmx_ctxt_switch_to(struct vcpu *v)
         .fields = { .type = 0xb, .s = 0, .dpl = 0, .p = 1, .avl = 0,    \
                     .l = 0, .db = 0, .g = 0, .pad = 0 } }).bytes)
 
-void vmx_get_segment_register(struct vcpu *v, enum x86_segment seg,
-                              struct segment_register *reg)
+static void vmx_get_segment_register(struct vcpu *v, enum x86_segment seg,
+                                     struct segment_register *reg)
 {
     unsigned long attr = 0, sel = 0, limit;
 
@@ -1504,19 +1504,19 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
              * Need to read them all either way, as realmode reads can update
              * the saved values we'll use when returning to prot mode. */
             for ( s = 0; s < ARRAY_SIZE(reg); s++ )
-                vmx_get_segment_register(v, s, &reg[s]);
+                hvm_get_segment_register(v, s, &reg[s]);
             v->arch.hvm_vmx.vmx_realmode = realmode;
             
             if ( realmode )
             {
                 for ( s = 0; s < ARRAY_SIZE(reg); s++ )
-                    vmx_set_segment_register(v, s, &reg[s]);
+                    hvm_set_segment_register(v, s, &reg[s]);
             }
             else 
             {
                 for ( s = 0; s < ARRAY_SIZE(reg); s++ )
                     if ( !(v->arch.hvm_vmx.vm86_segment_mask & (1<<s)) )
-                        vmx_set_segment_register(
+                        hvm_set_segment_register(
                             v, s, &v->arch.hvm_vmx.vm86_saved_seg[s]);
             }
 
@@ -3907,7 +3907,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             gdprintk(XENLOG_WARNING, "Bad vmexit (reason %#lx)\n",
                      exit_reason);
 
-            vmx_get_segment_register(v, x86_seg_ss, &ss);
+            hvm_get_segment_register(v, x86_seg_ss, &ss);
             if ( ss.attr.fields.dpl )
                 hvm_inject_hw_exception(TRAP_invalid_op,
                                         X86_EVENT_NO_EC);
@@ -3939,7 +3939,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
         gprintk(XENLOG_WARNING, "Bad rIP %lx for mode %u\n", regs->rip, mode);
 
-        vmx_get_segment_register(v, x86_seg_ss, &ss);
+        hvm_get_segment_register(v, x86_seg_ss, &ss);
         if ( ss.attr.fields.dpl )
         {
             __vmread(VM_ENTRY_INTR_INFO, &intr_info);
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index efaf54c..bcc4a97 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -360,7 +360,7 @@ static int vmx_inst_check_privilege(struct cpu_user_regs *regs, int vmxop_check)
     else if ( !vcpu_2_nvmx(v).vmxon_region_pa )
         goto invalid_op;
 
-    vmx_get_segment_register(v, x86_seg_cs, &cs);
+    hvm_get_segment_register(v, x86_seg_cs, &cs);
 
     if ( (regs->eflags & X86_EFLAGS_VM) ||
          (hvm_long_mode_enabled(v) && cs.attr.fields.l == 0) )
@@ -419,13 +419,13 @@ static int decode_vmx_inst(struct cpu_user_regs *regs,
 
         if ( hvm_long_mode_enabled(v) )
         {
-            vmx_get_segment_register(v, x86_seg_cs, &seg);
+            hvm_get_segment_register(v, x86_seg_cs, &seg);
             mode_64bit = seg.attr.fields.l;
         }
 
         if ( info.fields.segment > VMX_SREG_GS )
             goto gp_fault;
-        vmx_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
+        hvm_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
         seg_base = seg.base;
 
         base = info.fields.base_reg_invalid ? 0 :
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 4cdd9b1..0e5902d 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -550,8 +550,6 @@ static inline int __vmxon(u64 addr)
     return rc;
 }
 
-void vmx_get_segment_register(struct vcpu *, enum x86_segment,
-                              struct segment_register *);
 void vmx_inject_extint(int trap, uint8_t source);
 void vmx_inject_nmi(void);
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-11-23 15:38 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 15:38 [PATCH for-4.9 00/15] XSA-191 followup Andrew Cooper
2016-11-23 15:38 ` [PATCH 01/15] x86/hvm: Rename hvm_emulate_init() and hvm_emulate_prepare() for clarity Andrew Cooper
2016-11-23 15:49   ` Paul Durrant
2016-11-23 15:53   ` Wei Liu
2016-11-23 16:40   ` Jan Beulich
2016-11-23 16:41   ` Boris Ostrovsky
2016-11-23 16:41     ` Andrew Cooper
2016-11-24  6:16   ` Tian, Kevin
2016-11-23 15:38 ` [PATCH 02/15] x86/emul: Simplfy emulation state setup Andrew Cooper
2016-11-23 15:58   ` Paul Durrant
2016-11-23 16:01     ` Andrew Cooper
2016-11-23 16:03       ` Paul Durrant
2016-11-23 16:07   ` Tim Deegan
2016-11-24 13:44   ` Jan Beulich
2016-11-24 13:59     ` Andrew Cooper
2016-11-24 14:18       ` Jan Beulich
2016-11-23 15:38 ` [PATCH 03/15] x86/emul: Rename hvm_trap to x86_event and move it into the emulation infrastructure Andrew Cooper
2016-11-23 16:12   ` Paul Durrant
2016-11-23 16:22     ` Andrew Cooper
2016-11-23 16:59   ` Boris Ostrovsky
2016-11-24  6:17   ` Tian, Kevin
2016-11-24 13:56   ` Jan Beulich
2016-11-24 14:42     ` Andrew Cooper
2016-11-24 14:57       ` Jan Beulich
2016-11-23 15:38 ` [PATCH 04/15] x86/emul: Rename HVM_DELIVER_NO_ERROR_CODE to X86_EVENT_NO_EC Andrew Cooper
2016-11-23 16:20   ` Paul Durrant
2016-11-23 17:05   ` Boris Ostrovsky
2016-11-24  6:18   ` Tian, Kevin
2016-11-24 14:18   ` Jan Beulich
2016-11-23 15:38 ` [PATCH 05/15] x86/emul: Remove opencoded exception generation Andrew Cooper
2016-11-24 14:31   ` Jan Beulich
2016-11-24 16:24     ` Andrew Cooper
2016-11-24 16:31       ` Jan Beulich
2016-11-24 17:04         ` Andrew Cooper
2016-11-23 15:38 ` [PATCH 06/15] x86/emul: Rework emulator event injection Andrew Cooper
2016-11-23 16:19   ` Tim Deegan
2016-11-23 16:33     ` Jan Beulich
2016-11-23 16:43       ` Tim Deegan
2016-11-23 16:38     ` Andrew Cooper
2016-11-23 17:56   ` Boris Ostrovsky
2016-11-24  6:20   ` Tian, Kevin
2016-11-24 14:53   ` Jan Beulich
2016-11-24 17:00     ` Andrew Cooper
2016-11-24 17:08       ` Jan Beulich
2016-11-24 17:19         ` Andrew Cooper
2016-11-24 17:30           ` Tim Deegan
2016-11-24 17:37             ` Andrew Cooper
2016-11-25  7:25               ` Jan Beulich
2016-11-25  9:41                 ` Tim Deegan
2016-11-25  7:42           ` Jan Beulich
2016-11-23 15:38 ` Andrew Cooper [this message]
2016-11-24  6:20   ` [PATCH 07/15] x86/vmx: Use hvm_{get, set}_segment_register() rather than vmx_{get, set}_segment_register() Tian, Kevin
2016-11-23 15:38 ` [PATCH 08/15] x86/hvm: Reposition the modification of raw segment data from the VMCB/VMCS Andrew Cooper
2016-11-23 19:01   ` Boris Ostrovsky
2016-11-23 19:28     ` Andrew Cooper
2016-11-23 19:41       ` Boris Ostrovsky
2016-11-23 19:58         ` Andrew Cooper
2016-11-24  6:24   ` Tian, Kevin
2016-11-24 15:25   ` Jan Beulich
2016-11-24 17:22     ` Andrew Cooper
2016-11-25  7:45       ` Jan Beulich
2016-11-23 15:38 ` [PATCH 09/15] x86/emul: Avoid raising faults behind the emulators back Andrew Cooper
2016-11-23 16:31   ` Tim Deegan
2016-11-23 16:40     ` Andrew Cooper
2016-11-23 16:50       ` Tim Deegan
2016-11-23 16:58         ` Andrew Cooper
2016-11-24 10:43           ` Jan Beulich
2016-11-24 10:46             ` Andrew Cooper
2016-11-24 11:24               ` Jan Beulich
2016-11-23 15:38 ` [PATCH 10/15] x86/hvm: Extend the hvm_copy_*() API with a pagefault_info pointer Andrew Cooper
2016-11-23 16:32   ` Tim Deegan
2016-11-23 16:36   ` Paul Durrant
2016-11-24  6:25   ` Tian, Kevin
2016-11-23 15:38 ` [PATCH 11/15] x86/hvm: Reimplement hvm_copy_*_nofault() in terms of no pagefault_info Andrew Cooper
2016-11-23 16:35   ` Tim Deegan
2016-11-23 16:38     ` Andrew Cooper
2016-11-23 16:40     ` Tim Deegan
2016-11-23 15:38 ` [PATCH 12/15] x86/hvm: Rename hvm_copy_*_guest_virt() to hvm_copy_*_guest_linear() Andrew Cooper
2016-11-23 16:35   ` Tim Deegan
2016-11-24  6:26   ` Tian, Kevin
2016-11-24 15:41   ` Jan Beulich
2016-11-23 15:38 ` [PATCH 13/15] x86/hvm: Avoid __hvm_copy() raising #PF behind the emulators back Andrew Cooper
2016-11-23 16:18   ` Andrew Cooper
2016-11-23 16:39   ` Tim Deegan
2016-11-23 17:06     ` Andrew Cooper
2016-11-23 15:38 ` [PATCH 14/15] x86/hvm: Prepare to allow use of system segments for memory references Andrew Cooper
2016-11-23 16:42   ` Paul Durrant
2016-11-24 15:48   ` Jan Beulich
2016-11-23 15:38 ` [PATCH 15/15] x86/hvm: Use system-segment relative memory accesses Andrew Cooper
2016-11-24 16:01   ` Jan Beulich
2016-11-24 16:03     ` Andrew Cooper

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=1479915538-15282-8-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xen.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.