From patchwork Fri Feb 3 11:53:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9553933 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 0770060424 for ; Fri, 3 Feb 2017 11:55:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED7F528499 for ; Fri, 3 Feb 2017 11:55:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E298F284D5; Fri, 3 Feb 2017 11:55:50 +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 C4F182849D for ; Fri, 3 Feb 2017 11:55:49 +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 1cZcQb-0001zX-ME; Fri, 03 Feb 2017 11:53:21 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZcQZ-0001yl-VD for xen-devel@lists.xenproject.org; Fri, 03 Feb 2017 11:53:20 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 4E/A8-01684-F2F64985; Fri, 03 Feb 2017 11:53:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHSDva5e/pQ Ig7dfVSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozu631MBedlK9Zvu8jcwNgq1cXIySEh4C+x /OQTRhCbTUBZ4mdnLxuILSKgJ9F04DlYnFkgT+LxqlawuLCApcTHP+9ZQGwWARWJb7P+soPYv AIWEhdePmCFmCkvsavtIpjNCVS/99ttsBohoJpdXfuhbAWJjunHmCB6BSVOznzCArFLQuLgix fMExh5ZyFJzUKSWsDItIpRvTi1qCy1SNdML6koMz2jJDcxM0fX0MBYLze1uDgxPTUnMalYLzk /dxMjMHTqGRgYdzBeaXM+xCjJwaQkytucNiVCiC8pP6UyI7E4I76oNCe1+BCjDAeHkgSvWR5Q TrAoNT21Ii0zBxjEMGkJDh4lEV5pkDRvcUFibnFmOkTqFKMux6kbp18yCbHk5eelSonz5oAUC YAUZZTmwY2ARdQlRlkpYV5GBgYGIZ6C1KLczBJU+VeM4hyMSsK8MSBTeDLzSuA2vQI6ggnoiJ +PJ4EcUZKIkJJqYHzy7Efa1grfafcSJr0K3jbv8VP2iUH5G+S95a8WW57YtP4R50OTP4nxEmG yH5TdSu/LHZtSHvPw4CnN2mzJ0BV9bjVdSe+StsjrfV7wp99u77pDjWtrLGeoaR+5z9ZqeX5d w6+HvFkOPpJdu78xxVt+lVPeVbbeLnDHP43oG5XvVtfvM5meL6HEUpyRaKjFXFScCAD8xLLZo wIAAA== X-Env-Sender: prvs=200934ec6=wei.liu2@citrix.com X-Msg-Ref: server-4.tower-31.messagelabs.com!1486122795!25745807!3 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 47372 invoked from network); 3 Feb 2017 11:53:18 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 3 Feb 2017 11:53:18 -0000 X-IronPort-AV: E=Sophos;i="5.33,328,1477958400"; d="scan'208";a="412933655" From: Wei Liu To: Xen-devel Date: Fri, 3 Feb 2017 11:53:07 +0000 Message-ID: <20170203115314.19955-6-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170203115314.19955-1-wei.liu2@citrix.com> References: <20170203115314.19955-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH v4 05/12] 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 Reviewed-by: Jan Beulich --- Cc: Jan Beulich Cc: Andrew Cooper 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 #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);