Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp220213rdb; Mon, 22 Jan 2024 01:45:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqvX3zYjUb1wJ6/cYPqO4Lrg0XEBV8m+XFkVXT1s9pr+WEPfyfBDpvWj2nDYBvrCfdneBb X-Received: by 2002:a05:6358:6e87:b0:176:5158:8a27 with SMTP id q7-20020a0563586e8700b0017651588a27mr997867rwm.24.1705916747411; Mon, 22 Jan 2024 01:45:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705916747; cv=pass; d=google.com; s=arc-20160816; b=Z24D8w0DkJ5w4NfR6iCui46W4/aR7gEOWJ3rc3Vm/VPPU2RnHKC36SfBvyiUe/Sghf fUNDllN78017f+kHlz6ji1gSDftADLbsi4Pm7ldHJ+xKb2tyRQCwOEwwnpeBwe+4aIp8 6jP0pEmyflUQwUA/Jkm2TQTmaq2A0iZAOM/xR8hrjN+/lSbVEZ2xlVV7NWQ7JuJWmMWY xD5o2SNcTgk/ixBovF9+/L7DI1beq+Nff/Eoqe26yLp7HVW2DTAu4MZXwSoc+DhxC4LU S9QxD93X1lEL6yTS3lSZQNqnjFcLosoKy9RyEVmtwHpGdfPC4bbZBNb4l5Cm2Ur2Pe7r by1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4m7WpdlteKSJTO8jDyumpCa3DsnZGG6S3Wf2+oYAvXQ=; fh=vOmVVPFw/Gtaeq/zVpE4KKs7VZDYydrmyLLfYW8KXYQ=; b=e4LCk8r616k3GvxG9NcHvvk1qi/DdM9rZKJNC7l/kR6EryOXUFXFCaluuOsBMaatMv /uq+YA3kT3ur1MZTpt6c9Fv7/3AE1LerMWAtSAjkZXOrSnMxocb5lr3/9gIncqKfHOja erdJLhDg7a17ygxZjjw7MC+psaZCl4CtMhaHLvYscgBWAo8o0RgzzwjGZVIByUA8PXR0 RbM2+Gooq3/diEeSwVLHK4PvLisaOqeY1oJwAJODUHA+L4YqhvMgtDSYYadeTnxYhC1G uzyPEKEuPBvOnBKrIIPIXmbUeA7orBePoaJymUjAyZLHchn/oWo5Q4qSGktD1jEcCcYh z46A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iFGBX0Od; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-32650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i124-20020a636d82000000b005cfc912e46dsi2228830pgc.721.2024.01.22.01.45.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 01:45:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iFGBX0Od; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-32650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 648E4288B9E for ; Mon, 22 Jan 2024 09:45:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83B3D39AFB; Mon, 22 Jan 2024 09:45:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iFGBX0Od" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F035639AE3; Mon, 22 Jan 2024 09:45:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705916720; cv=none; b=aqEDBIAqemISEtAEBOkHhsmnunC0JfJKWX+qTsTXwvMnopCuqG5iPyYzJkYE5vmQsZdFRClAbnjKayFBBk5uPnBGIHC4QTjAGWnIOl4/oKcALyVxvzbQr5Kq9LnXIUO/ktqjwFR55H9eR0gXEuW7UtY2UowJNATnVwXCcsRZABI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705916720; c=relaxed/simple; bh=lqenUsxnlYiKlH3WvazTEAbGzWcHa9q1eM9R45SW/XE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gxq0OzAoC/z0nhcDotR1v29d44v5otaSp6kxMPN94X0/QqUs35gXuZzHcMVVu/Vde08ORSqNLF22LfMg1UMQPXIGUBu0VrZRHPMSzc0Bc4S0yHR4cZixj9wLwSnLgjNBN7d7i/rpQLMWmZu4lZ+//F7sk1rI6liYskyDWb0yxyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iFGBX0Od; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705916719; x=1737452719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lqenUsxnlYiKlH3WvazTEAbGzWcHa9q1eM9R45SW/XE=; b=iFGBX0OdPIqTSq0EcEbtH7HbytxjYOjvVRCA727rFtMzge9DyUVosYY/ BSj318BtwRcYH1XzeLpUAuO/KN4U/hAyTsxniCyhtwFSR+BI8537SOpBy MPtVXpa6u+lEYS/ecsz6Xg/fdePWZrFghBRRi/WCGII26VoTQ81zbf8mn AcIsV7I65hBecI2IDUjyKuitMawnbf4utI86a7tQuPLUDuI93CeE0tbLq nLQOlybfJnUjM0GSJVMjX4rRq8hq3ZEZAAS9USglzQz7ieXBVCmUQDC86 QBkodO0RNuWUf3gehDpclfB7I23xfnMedDBFJ+J/Up87kpjBqx+2mhtZ+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10960"; a="22641522" X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="22641522" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 01:45:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10960"; a="778535272" X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="778535272" Received: from haibo-optiplex-7090.sh.intel.com ([10.239.159.132]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 01:45:07 -0800 From: Haibo Xu To: Cc: xiaobo55x@gmail.com, ajones@ventanamicro.com, Paolo Bonzini , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Anup Patel , Atish Patra , Guo Ren , Conor Dooley , Mayuresh Chitale , wchen , Greentime Hu , Haibo Xu , Jisheng Zhang , Minda Chen , Samuel Holland , Sean Christopherson , Like Xu , Peter Xu , Vipin Sharma , Aaron Lewis , Thomas Huth , Maciej Wieczor-Retman , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org Subject: [PATCH v5 01/12] selftests/kvm: Fix issues with $(SPLIT_TESTS) Date: Mon, 22 Jan 2024 17:58:31 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Paolo Bonzini The introduction of $(SPLIT_TESTS) also introduced a warning when building selftests on architectures that include get-reg-lists: make: Entering directory '/root/kvm/tools/testing/selftests/kvm' Makefile:272: warning: overriding recipe for target '/root/kvm/tools/testing/selftests/kvm/get-reg-list' Makefile:267: warning: ignoring old recipe for target '/root/kvm/tools/testing/selftests/kvm/get-reg-list' make: Leaving directory '/root/kvm/tools/testing/selftests/kvm' In addition, the rule for $(SPLIT_TESTS_TARGETS) includes _all_ the $(SPLIT_TESTS_OBJS), which only works because there is just one. So fix both by adjusting the rules: - remove $(SPLIT_TESTS_TARGETS) from the $(TEST_GEN_PROGS) rules, and rename it to $(SPLIT_TEST_GEN_PROGS) - fix $(SPLIT_TESTS_OBJS) so that it plays well with $(OUTPUT), rename it to $(SPLIT_TEST_GEN_OBJ), and list the object file explicitly in the $(SPLIT_TEST_GEN_PROGS) link rule Fixes: 17da79e009c3 ("KVM: arm64: selftests: Split get-reg-list test code", 2023-08-09) Signed-off-by: Paolo Bonzini Tested-by: Andrew Jones --- tools/testing/selftests/kvm/Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 3e0c36b8ddd5..c5e9abb185b6 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -257,32 +257,36 @@ LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C)) LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S)) LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING)) LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ) -SPLIT_TESTS_TARGETS := $(patsubst %, $(OUTPUT)/%, $(SPLIT_TESTS)) -SPLIT_TESTS_OBJS := $(patsubst %, $(ARCH_DIR)/%.o, $(SPLIT_TESTS)) +SPLIT_TEST_GEN_PROGS := $(patsubst %, $(OUTPUT)/%, $(SPLIT_TESTS)) +SPLIT_TEST_GEN_OBJ := $(patsubst %, $(OUTPUT)/$(ARCH_DIR)/%.o, $(SPLIT_TESTS)) TEST_GEN_OBJ = $(patsubst %, %.o, $(TEST_GEN_PROGS)) TEST_GEN_OBJ += $(patsubst %, %.o, $(TEST_GEN_PROGS_EXTENDED)) TEST_DEP_FILES = $(patsubst %.o, %.d, $(TEST_GEN_OBJ)) TEST_DEP_FILES += $(patsubst %.o, %.d, $(LIBKVM_OBJS)) -TEST_DEP_FILES += $(patsubst %.o, %.d, $(SPLIT_TESTS_OBJS)) +TEST_DEP_FILES += $(patsubst %.o, %.d, $(SPLIT_TEST_GEN_OBJ)) -include $(TEST_DEP_FILES) -$(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): %: %.o +x := $(shell mkdir -p $(sort $(OUTPUT)/$(ARCH_DIR) $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ)))) + +$(filter-out $(SPLIT_TEST_GEN_PROGS), $(TEST_GEN_PROGS)) \ +$(TEST_GEN_PROGS_EXTENDED): %: %.o $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $< $(LIBKVM_OBJS) $(LDLIBS) -o $@ $(TEST_GEN_OBJ): $(OUTPUT)/%.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ -$(SPLIT_TESTS_TARGETS): %: %.o $(SPLIT_TESTS_OBJS) +$(SPLIT_TEST_GEN_PROGS): $(OUTPUT)/%: $(OUTPUT)/%.o $(OUTPUT)/$(ARCH_DIR)/%.o $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ +$(SPLIT_TEST_GEN_OBJ): $(OUTPUT)/$(ARCH_DIR)/%.o: $(ARCH_DIR)/%.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ EXTRA_CLEAN += $(GEN_HDRS) \ $(LIBKVM_OBJS) \ - $(SPLIT_TESTS_OBJS) \ + $(SPLIT_TEST_GEN_OBJ) \ $(TEST_DEP_FILES) \ $(TEST_GEN_OBJ) \ cscope.* -x := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ)))) $(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c $(GEN_HDRS) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ @@ -296,7 +300,7 @@ $(LIBKVM_STRING_OBJ): $(OUTPUT)/%.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -ffreestanding $< -o $@ x := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS)))) -$(SPLIT_TESTS_OBJS): $(GEN_HDRS) +$(SPLIT_TEST_GEN_OBJ): $(GEN_HDRS) $(TEST_GEN_PROGS): $(LIBKVM_OBJS) $(TEST_GEN_PROGS_EXTENDED): $(LIBKVM_OBJS) $(TEST_GEN_OBJ): $(GEN_HDRS) -- 2.34.1