x86/emul: Drop segment_attributes_t
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Jun 2017 16:19:27 +0000 (17:19 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jul 2017 18:56:35 +0000 (19:56 +0100)
commit6c9abf0e8022807bb7d677570d0775659950ff1a
treebd36a2581bcddd8d8ede7526971056e4fef39e09
parent43dceb97eb3e45957c5a2e8a1ec874b9eb1ee941
x86/emul: Drop segment_attributes_t

The amount of namespace resolution is unnecessarily large, as all code deals
in terms of struct segment_register.  This removes the attr.fields part of all
references, and alters attr.bytes to just attr.

Three areas of code using initialisers for segment_register are tweaked to
compile with older versions of GCC.  arch_set_info_hvm_guest() has its SEG()
macros altered to use plain comma-based initialisation, while
{rm,vm86}_{cs,ds}_attr are simplified to plain numbers which matches their
description in the manuals.

No functional change.  (For some reason, the old {rm,vm86}_{cs,ds}_attr causes
GCC to create variable in .rodata, whereas the new code uses immediate
operands.  As a result, vmx_{get,set}_segment_register() are slightly
shorter.)

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
16 files changed:
tools/fuzz/x86_instruction_emulator/fuzz-emul.c
tools/tests/x86_emulator/test_x86_emulator.c
xen/arch/x86/cpu/vpmu.c
xen/arch/x86/hvm/domain.c
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/svmdebug.c
xen/arch/x86/hvm/svm/vmcb.c
xen/arch/x86/hvm/vmx/realmode.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/vm_event.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h