x86/vmx: Use hvm_{get,set}_segment_register() rather than vmx_{get,set}_segment_register()

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>
Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
Andrew Cooper committed 2016-12-02 17:23:02 +00:00
1 parent 29a57c9924
commit e4d0bc1e8b
3 files changed
+10 -12

No files matched your search

+7 -7
View File
@@ -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;
@@ -1444,19 +1444,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]);
}
@@ -3847,7 +3847,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);
@@ -3879,7 +3879,7 @@ out:
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);
+3 -3
View File
@@ -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 :
-2
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.