* [PATCH] x86/vvmx: Drop sreg_to_index[]
@ 2017-01-03 11:58 Andrew Cooper
2017-01-03 12:21 ` Jan Beulich
2017-01-05 2:48 ` Tian, Kevin
0 siblings, 2 replies; 3+ messages in thread
From: Andrew Cooper @ 2017-01-03 11:58 UTC (permalink / raw)
To: Xen-devel; +Cc: Andrew Cooper, Kevin Tian, Jun Nakajima, Jan Beulich
Since c/s 0888d36b "x86/emul: Correct the decoding of SReg3 operands",
x86_seg_* have followed hardware encodings, meaning that this translation
table is now an identiy transform.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Jun Nakajima <jun.nakajima@intel.com>
CC: Kevin Tian <kevin.tian@intel.com>
---
xen/arch/x86/hvm/vmx/vvmx.c | 15 +++------------
xen/include/asm-x86/hvm/vmx/vvmx.h | 9 ---------
2 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index d53c576..35e7825 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -191,15 +191,6 @@ bool_t nvmx_ept_enabled(struct vcpu *v)
return !!(nvmx->ept.enabled);
}
-static const enum x86_segment sreg_to_index[] = {
- [VMX_SREG_ES] = x86_seg_es,
- [VMX_SREG_CS] = x86_seg_cs,
- [VMX_SREG_SS] = x86_seg_ss,
- [VMX_SREG_DS] = x86_seg_ds,
- [VMX_SREG_FS] = x86_seg_fs,
- [VMX_SREG_GS] = x86_seg_gs,
-};
-
struct vmx_inst_decoded {
#define VMX_INST_MEMREG_TYPE_MEMORY 0
#define VMX_INST_MEMREG_TYPE_REG 1
@@ -418,9 +409,9 @@ static int decode_vmx_inst(struct cpu_user_regs *regs,
decode->type = VMX_INST_MEMREG_TYPE_MEMORY;
- if ( info.fields.segment > VMX_SREG_GS )
+ if ( info.fields.segment > x86_seg_gs )
goto gp_fault;
- hvm_get_segment_register(v, sreg_to_index[info.fields.segment], &seg);
+ hvm_get_segment_register(v, info.fields.segment, &seg);
seg_base = seg.base;
base = info.fields.base_reg_invalid ? 0 :
@@ -436,7 +427,7 @@ static int decode_vmx_inst(struct cpu_user_regs *regs,
size = 1 << (info.fields.addr_size + 1);
offset = base + index * scale + disp;
- base = !mode_64bit || info.fields.segment >= VMX_SREG_FS ?
+ base = !mode_64bit || info.fields.segment >= x86_seg_fs ?
seg_base + offset : offset;
if ( offset + size - 1 < offset ||
(mode_64bit ?
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index af7702b..242e524 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -87,15 +87,6 @@ enum vmx_regs_enc {
VMX_REG_R15,
};
-enum vmx_sregs_enc {
- VMX_SREG_ES,
- VMX_SREG_CS,
- VMX_SREG_SS,
- VMX_SREG_DS,
- VMX_SREG_FS,
- VMX_SREG_GS,
-};
-
union vmx_inst_info {
struct {
unsigned int scaling :2; /* bit 0-1 */
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/vvmx: Drop sreg_to_index[]
2017-01-03 11:58 [PATCH] x86/vvmx: Drop sreg_to_index[] Andrew Cooper
@ 2017-01-03 12:21 ` Jan Beulich
2017-01-05 2:48 ` Tian, Kevin
1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2017-01-03 12:21 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Kevin Tian, Jun Nakajima, Xen-devel
>>> On 03.01.17 at 12:58, <andrew.cooper3@citrix.com> wrote:
> Since c/s 0888d36b "x86/emul: Correct the decoding of SReg3 operands",
> x86_seg_* have followed hardware encodings, meaning that this translation
> table is now an identiy transform.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/vvmx: Drop sreg_to_index[]
2017-01-03 11:58 [PATCH] x86/vvmx: Drop sreg_to_index[] Andrew Cooper
2017-01-03 12:21 ` Jan Beulich
@ 2017-01-05 2:48 ` Tian, Kevin
1 sibling, 0 replies; 3+ messages in thread
From: Tian, Kevin @ 2017-01-05 2:48 UTC (permalink / raw)
To: Andrew Cooper, Xen-devel; +Cc: Nakajima, Jun, Jan Beulich
> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Sent: Tuesday, January 03, 2017 7:59 PM
>
> Since c/s 0888d36b "x86/emul: Correct the decoding of SReg3 operands",
> x86_seg_* have followed hardware encodings, meaning that this translation
> table is now an identiy transform.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-05 2:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 11:58 [PATCH] x86/vvmx: Drop sreg_to_index[] Andrew Cooper
2017-01-03 12:21 ` Jan Beulich
2017-01-05 2:48 ` Tian, Kevin
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.