From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>, Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v4 05/12] x86emul/test: use x86-vendors.h
Date: Fri, 3 Feb 2017 11:53:07 +0000 [thread overview]
Message-ID: <20170203115314.19955-6-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170203115314.19955-1-wei.liu2@citrix.com>
No functional change.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
V4: introduce x86.h macro
V3: link asm-x86 to working directory
---
tools/fuzz/x86_instruction_emulator/Makefile | 12 ++++++++----
tools/tests/x86_emulator/Makefile | 12 ++++++++----
tools/tests/x86_emulator/x86_emulate.h | 7 ++-----
3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile
index fbfbd4673f..84be31cc26 100644
--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -11,16 +11,20 @@ endif
x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h:
[ -L x86_emulate ] || ln -sf $(XEN_ROOT)/xen/arch/x86/x86_emulate .
+asm/x86-vendors.h:
+ [ -L asm ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 asm
+
x86_emulate.c x86_emulate.h: %:
[ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$*
-CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
+CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -I.
x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h
+x86.h := asm/x86-vendors.h
-x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h)
+x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h) $(x86.h)
-x86-insn-emulator-fuzzer.o: $(x86_emulate.h)
+x86-insn-emulator-fuzzer.o: $(x86_emulate.h) $(x86.h)
x86-insn-emulator.a: x86_emulate.o
$(AR) rc $@ $^
@@ -33,7 +37,7 @@ all: x86-instruction-emulator-fuzzer-all
.PHONY: distclean
distclean: clean
- rm -f x86_emulate x86_emulate.c x86_emulate.h
+ rm -f x86_emulate x86_emulate.c x86_emulate.h asm
.PHONY: clean
clean:
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index b489959d1d..4ba623936f 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -32,7 +32,7 @@ $(TARGET): x86_emulate.o test_x86_emulator.o
.PHONY: clean
clean:
- rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate
+ rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate asm
.PHONY: distclean
distclean: clean
@@ -43,12 +43,16 @@ install:
x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h:
[ -L x86_emulate ] || ln -sf $(XEN_ROOT)/xen/arch/x86/x86_emulate .
-HOSTCFLAGS += $(CFLAGS_xeninclude)
+asm/x86-vendors.h:
+ [ -L asm ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 asm
+
+HOSTCFLAGS += $(CFLAGS_xeninclude) -I.
x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h
+x86.h := asm/x86-vendors.h
-x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h)
+x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h) $(x86.h)
$(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -c -g -o $@ $<
-test_x86_emulator.o: test_x86_emulator.c blowfish.h $(x86_emulate.h)
+test_x86_emulator.o: test_x86_emulator.c blowfish.h $(x86_emulate.h) $(x86.h)
$(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
diff --git a/tools/tests/x86_emulator/x86_emulate.h b/tools/tests/x86_emulator/x86_emulate.h
index 3a6badee46..db287004e6 100644
--- a/tools/tests/x86_emulator/x86_emulate.h
+++ b/tools/tests/x86_emulator/x86_emulate.h
@@ -6,6 +6,8 @@
#include <string.h>
#include <xen/xen.h>
+#include <asm/x86-vendors.h>
+
#define BUG() abort()
#define ASSERT assert
#define ASSERT_UNREACHABLE() assert(!__LINE__)
@@ -38,11 +40,6 @@
#define is_canonical_address(x) (((int64_t)(x) >> 47) == ((int64_t)(x) >> 63))
-/* There's no strict need for these to be in sync with processor.h. */
-#define X86_VENDOR_INTEL 0
-#define X86_VENDOR_AMD 2
-#define X86_VENDOR_UNKNOWN 0xff
-
#define MMAP_SZ 16384
bool emul_test_make_stack_executable(void);
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-03 11:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 11:53 [PATCH v4 00/12] fuzz: update x86emul fuzzer Wei Liu
2017-02-03 11:53 ` [PATCH v4 01/12] x86emul/test: add missing dependency for x86_emulate.o Wei Liu
2017-02-03 12:11 ` Wei Liu
2017-02-03 13:38 ` Jan Beulich
2017-02-03 11:53 ` [PATCH v4 02/12] fuzz/x86emul: use macro to reduce repetition in Makefile Wei Liu
2017-02-03 13:41 ` Jan Beulich
2017-02-03 11:53 ` [PATCH v4 03/12] x86: extract macros to x86-defns.h Wei Liu
2017-02-03 11:53 ` [PATCH v4 04/12] x86: extract vendor numeric id to x86-vendors.h Wei Liu
2017-02-03 11:53 ` Wei Liu [this message]
2017-02-03 13:45 ` [PATCH v4 05/12] x86emul/test: use x86-vendors.h Jan Beulich
2017-02-03 11:53 ` [PATCH v4 06/12] x86emul: use eflags definitions in x86-defns.h Wei Liu
2017-02-03 11:53 ` [PATCH v4 07/12] x86emul: use msr definitions in msr-index.h Wei Liu
2017-02-03 11:53 ` [PATCH v4 08/12] x86: add UMIP CR4 bit Wei Liu
2017-02-03 11:53 ` [PATCH v4 09/12] x86emul: use CR definitions in x86-defns.h Wei Liu
2017-02-03 11:53 ` [PATCH v4 10/12] fuzz/x86emul: update fuzzer Wei Liu
2017-02-06 8:17 ` Jan Beulich
2017-02-03 11:53 ` [PATCH v4 11/12] fuzz/x86emul: print out minimal input size Wei Liu
2017-02-03 11:53 ` [PATCH v4 12/12] fuzz: update README.afl example Wei Liu
2017-02-06 10:29 ` [PATCH v4 00/12] fuzz: update x86emul fuzzer Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170203115314.19955-6-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).