From patchwork Fri Aug 9 15:40:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11086779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA5F41395 for ; Fri, 9 Aug 2019 15:42:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C779A1FFBD for ; Fri, 9 Aug 2019 15:42:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBA0B1FFEB; Fri, 9 Aug 2019 15:42:12 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5A2A81FFBD for ; Fri, 9 Aug 2019 15:42:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hw70G-0007eC-SF; Fri, 09 Aug 2019 15:40:28 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hw70G-0007dV-3l for xen-devel@lists.xenproject.org; Fri, 09 Aug 2019 15:40:28 +0000 X-Inumbo-ID: 01610662-babc-11e9-8980-bc764e045a96 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 01610662-babc-11e9-8980-bc764e045a96; Fri, 09 Aug 2019 15:40:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9691AAD23; Fri, 9 Aug 2019 15:40:24 +0000 (UTC) To: "xen-devel@lists.xenproject.org" From: Jan Beulich Message-ID: Date: Fri, 9 Aug 2019 17:40:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Language: en-US Subject: [Xen-devel] [PATCH v3] x86emul: fix test harness and fuzzer build dependencies X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Wilk , George Dunlap , Andrew Cooper , Tim Deegan , Julien Grall , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit fd35f32b4b ("tools/x86emul: Use struct cpuid_policy in the userspace test harnesses") didn't account for the dependencies of cpuid-autogen.h to potentially change between incremental builds. In particular the harness has a "run" goal which is supposed to be usable independently of the rest of the tools sub-tree building, and both the harness and the fuzzer code are also supposed to be buildable independently. Therefore a re-build of the generated header needs to be triggered first, which is achieved by introducing a new top-level target pattern (for just the "run" part for now). Finally cpuid.o did not have any dependencies added for it. Signed-off-by: Jan Beulich --- TBD: Something similar would be nice for building both tools/tests/*/ and tools/fuzz/*/, but I'm uncertain whether respective top level targets build-tests-% and build-fuzz-% would be welcome. --- v3: Introduce top level run-tests-% target. v2.1: Split controversial parts from (hopefully) non-controversial ones. v2: Guard $(MAKE) invocations by $(MAKELEVEL) checks. --- a/Makefile +++ b/Makefile @@ -80,6 +80,9 @@ build-docs: test: $(MAKE) -C tools/python test +run-tests-%: build-tools-public-headers tools/tests/%/ + $(MAKE) -C tools/tests/$* run + # For most targets here, # make COMPONENT-TARGET # is implemented, more or less, by --- a/tools/fuzz/x86_instruction_emulator/Makefile +++ b/tools/fuzz/x86_instruction_emulator/Makefile @@ -26,13 +26,15 @@ GCOV_FLAGS := --coverage $(CC) -c $(CFLAGS) $(GCOV_FLAGS) $< -o $@ x86.h := $(addprefix $(XEN_ROOT)/tools/include/xen/asm/,\ - x86-vendors.h x86-defns.h msr-index.h) + x86-vendors.h x86-defns.h msr-index.h) \ + $(addprefix $(XEN_ROOT)/tools/include/xen/lib/x86/, \ + cpuid.h cpuid-autogen.h) x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h $(x86.h) # x86-emulate.c will be implicit for both x86-emulate.o x86-emulate-cov.o: x86_emulate/x86_emulate.c $(x86_emulate.h) -fuzz-emul.o fuzz-emulate-cov.o wrappers.o: $(x86_emulate.h) +fuzz-emul.o fuzz-emulate-cov.o cpuid.o wrappers.o: $(x86_emulate.h) x86-insn-fuzzer.a: fuzz-emul.o x86-emulate.o cpuid.o $(AR) rc $@ $^ --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -280,10 +280,12 @@ $(call cc-option-add,HOSTCFLAGS-x86_64,H HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH)) x86.h := $(addprefix $(XEN_ROOT)/tools/include/xen/asm/,\ - x86-vendors.h x86-defns.h msr-index.h) + x86-vendors.h x86-defns.h msr-index.h) \ + $(addprefix $(XEN_ROOT)/tools/include/xen/lib/x86/, \ + cpuid.h cpuid-autogen.h) x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h $(x86.h) -x86-emulate.o test_x86_emulator.o evex-disp8.o wrappers.o: %.o: %.c $(x86_emulate.h) +x86-emulate.o cpuid.o test_x86_emulator.o evex-disp8.o wrappers.o: %.o: %.c $(x86_emulate.h) $(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $< x86-emulate.o: x86_emulate/x86_emulate.c