]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86emul: also allow running the 32-bit harness on a 64-bit distro
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Nov 2018 14:07:09 +0000 (15:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Nov 2018 14:07:09 +0000 (15:07 +0100)
In order to be able to verify the 32-bit variant builds and runs,
introduce a respective target (and the necessary other adjustments).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
.gitignore
tools/tests/x86_emulator/32/Makefile [new file with mode: 0644]
tools/tests/x86_emulator/Makefile

index ab53fc42e2e562ebdc129bf5aaa3f90c9e96da0f..f11e61321a19a3b18eea2e7c7913d749d410d389 100644 (file)
@@ -240,6 +240,7 @@ tools/security/xensec_tool
 tools/tests/depriv/depriv-fd-checker
 tools/tests/x86_emulator/*.bin
 tools/tests/x86_emulator/*.tmp
+tools/tests/x86_emulator/32/x86_emulate
 tools/tests/x86_emulator/3dnow*.[ch]
 tools/tests/x86_emulator/asm
 tools/tests/x86_emulator/avx*.[ch]
diff --git a/tools/tests/x86_emulator/32/Makefile b/tools/tests/x86_emulator/32/Makefile
new file mode 100644 (file)
index 0000000..b61a644
--- /dev/null
@@ -0,0 +1,5 @@
+override XEN_COMPILE_ARCH := x86_32
+XEN_ROOT = $(CURDIR)/../../../..
+vpath %.c ..
+vpath %.h ..
+include ../Makefile
index 3c711c6c09e7e919236214d213596696ff0cbf3a..84e3484a8d2dfb43b07e24e4e0143fd236d1dadc 100644 (file)
@@ -1,5 +1,5 @@
 
-XEN_ROOT=$(CURDIR)/../../..
+XEN_ROOT ?= $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 TARGET := test_x86_emulator
@@ -23,6 +23,12 @@ TESTCASES := blowfish $(SIMD) $(FMA) $(SG)
 
 OPMASK := avx512f avx512dq avx512bw
 
+ifeq ($(origin XEN_COMPILE_ARCH),override)
+
+HOSTCFLAGS += -m32
+
+else
+
 blowfish-cflags := ""
 blowfish-cflags-x86_32 := "-mno-accumulate-outgoing-args -Dstatic="
 
@@ -144,6 +150,8 @@ $(addsuffix .h,$(SIMD) $(FMA) $(SG)): simd.h
 
 xop.h: simd-fma.c
 
+endif # 32-bit override
+
 $(TARGET): x86-emulate.o cpuid.o test_x86_emulator.o evex-disp8.o wrappers.o
        $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
 
@@ -158,6 +166,16 @@ distclean: clean
 .PHONY: install uninstall
 install uninstall:
 
+.PHONY: run32 clean32
+ifeq ($(XEN_TARGET_ARCH),x86_64)
+run32: $(addsuffix .h,$(TESTCASES)) $(addsuffix -opmask.h,$(OPMASK))
+run32 clean32: %32:
+       $(MAKE) -C 32 $*
+clean: clean32
+else
+run32 clean32: %32: %
+endif
+
 x86_emulate:
        [ -L $@ ] || ln -sf $(XEN_ROOT)/xen/arch/x86/$@