From patchwork Wed Feb 1 12:02:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9549457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29549604A7 for ; Wed, 1 Feb 2017 12:04:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B84628420 for ; Wed, 1 Feb 2017 12:04:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0751C2842C; Wed, 1 Feb 2017 12:04:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A0CE028420 for ; Wed, 1 Feb 2017 12:04:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYtcb-0007nu-Ub; Wed, 01 Feb 2017 12:02:45 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYtcZ-0007mU-V2 for xen-devel@lists.xenproject.org; Wed, 01 Feb 2017 12:02:44 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id F4/02-11476-36EC1985; Wed, 01 Feb 2017 12:02:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrrBXjfp3MQ IgzcfzC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy90/tZC95LVDx/4djA+Fi0i5GTQ0LAX+L+ rD+MIDabgLLEz85eNhBbREBPounAc7A4s0CexONVrWBxYQFLie3ru5lBbBYBFYkH1+eydDFyc PAKWEjcbBCAGCkvsavtIiuIzQlS/vUDG0iJEFDJnqPVIGEhAQWJjunHmEBsXgFBiZMzn7BAbJ KQOPjiBfMERt5ZSFKzkKQWMDKtYtQoTi0qSy3SNTLXSyrKTM8oyU3MzNE1NDDTy00tLk5MT81 JTCrWS87P3cQIDBsGINjBuHht4CFGSQ4mJVHe9I4JEUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQk eO3OTowQEixKTU+tSMvMAQYwTFqCg0dJhDccJM1bXJCYW5yZDpE6xajLcerG6ZdMQix5+XmpU uK8X88AFQmAFGWU5sGNgEXTJUZZKWFeRqCjhHgKUotyM0tQ5V8xinMwKgnzpoKs4snMK4Hb9A roCCagI9xf9YEcUZKIkJJqYPT2fLJ6857Ti3h+bMl4dUJ/ufbiTbfVA74uvSNoftF+V1WbPPM 9NjNR6dj6Qq81Qhc6bJa3ptrl1WS2TJh04b2qnq/YqdVvb8+ZFWpxsdFHf272j2jt6xHXHsTN ejXZh/F50bqEpo8Xr7jN/2WYW7z8ttUuZ62f/VsnbHq596mpokNY7J1U+1YlluKMREMt5qLiR ABoYvMRoQIAAA== X-Env-Sender: prvs=198298339=wei.liu2@citrix.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1485950560!84988272!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18485 invoked from network); 1 Feb 2017 12:02:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 1 Feb 2017 12:02:42 -0000 X-IronPort-AV: E=Sophos;i="5.33,320,1477958400"; d="scan'208";a="412319323" From: Wei Liu To: Xen-devel Date: Wed, 1 Feb 2017 12:02:32 +0000 Message-ID: <20170201120239.13993-5-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170201120239.13993-1-wei.liu2@citrix.com> References: <20170201120239.13993-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH v3 04/11] x86emul/test: use x86-vendors.h X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP No functional change. Signed-off-by: Wei Liu --- Cc: Jan Beulich Cc: Andrew Cooper V3: link asm-x86 to working directory --- tools/fuzz/x86_instruction_emulator/Makefile | 9 +++++++-- tools/tests/x86_emulator/Makefile | 9 +++++++-- tools/tests/x86_emulator/x86_emulate.h | 7 ++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile index f2bb12e871..d5c5bba0b0 100644 --- a/tools/fuzz/x86_instruction_emulator/Makefile +++ b/tools/fuzz/x86_instruction_emulator/Makefile @@ -11,10 +11,15 @@ 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: asm/x86-vendors.h x86_emulate.o: x86_emulate.c x86_emulate.h x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h @@ -31,7 +36,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 883daf30a3..bd1c4d664e 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,7 +43,12 @@ 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 + +x86_emulate.h: asm/x86-vendors.h + +HOSTCFLAGS += $(CFLAGS_xeninclude) -I. x86_emulate.o: x86_emulate.c x86_emulate.h x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h $(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -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 #include +#include + #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);