aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/Rules.mk
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-09-09 10:23:32 +0200
committerJan Beulich <jbeulich@suse.com>2013-09-09 10:23:32 +0200
commitcfd54835e6e8a28c743dc7d67c662d151ab4923a (patch)
tree6a6b59ceee96950731f928c70c81581d4b1bf54d /xen/arch/x86/Rules.mk
parentb0df10407df96fe25f3c1a2bffc4be0696d328b4 (diff)
downloadxen-cfd54835e6e8a28c743dc7d67c662d151ab4923a.tar.gz
xen-cfd54835e6e8a28c743dc7d67c662d151ab4923a.tar.bz2
xen-cfd54835e6e8a28c743dc7d67c662d151ab4923a.zip
VMX: use proper instruction mnemonics if assembler supports them
With the hex byte emission we were taking away a good part of flexibility from the compiler, as for simplicity reasons these were built using fixed operands. All half way modern build environments would allow using the mnemonics (but we can't disable the hex variants yet, since the binutils around at the time gcc 4.1 got released didn't support these yet). I didn't convert __vmread() yet because that would, just like for __vmread_safe(), imply converting to a macro so that the output operand can be the caller supplied variable rather than an intermediate one. As that would require touching all invocation points of __vmread() (of which there are quite a few), I'd first like to be certain the approach is acceptable; the main question being whether the now conditional code might be considered to cause future maintenance issues, and the second being that of parameter/argument ordering (here I made __vmread_safe() match __vmwrite(), but one could also take the position that read and write should use the inverse order of one another, in line with the actual instruction operands). Additionally I was quite puzzled to find that all the asm()-s involved here have memory clobbers - what are they needed for? Or can they be dropped at least in some cases? Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/arch/x86/Rules.mk')
-rw-r--r--xen/arch/x86/Rules.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 04c1a90477..eb11b5bffb 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -28,6 +28,8 @@ CFLAGS += -msoft-float
$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
$(call cc-option-add,CFLAGS,CC,-Wnested-externs)
+$(call as-insn-check,CFLAGS,CC,"vmcall",-DHAVE_GAS_VMX)
+$(call as-insn-check,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_GAS_EPT)
ifeq ($(supervisor_mode_kernel),y)
CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1