From patchwork Mon Mar 27 05:46:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bamvor Zhang Jian X-Patchwork-Id: 96025 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1074704qgd; Sun, 26 Mar 2017 22:52:39 -0700 (PDT) X-Received: by 10.84.217.142 with SMTP id p14mr21179001pli.164.1490593959418; Sun, 26 Mar 2017 22:52:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si11491564pgn.203.2017.03.26.22.52.39; Sun, 26 Mar 2017 22:52:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751536AbdC0Fwi (ORCPT + 18 others); Mon, 27 Mar 2017 01:52:38 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:36592 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbdC0Fwa (ORCPT ); Mon, 27 Mar 2017 01:52:30 -0400 Received: by mail-oi0-f53.google.com with SMTP id r203so17945214oib.3 for ; Sun, 26 Mar 2017 22:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NZys2y9xL0RkLOpJxGCyeYPU2434CGqa+L1oQ5Ile9g=; b=H1UjrS+KAED2EJ+nIvkMNqmPSeXG7n/Txcvv/lnW/3OR4lvkNfcGVBM3jyMWFFsEc5 J51xIBDWbaEMZ6CnWq3JGlHAp5mQzaYe7JkyN9HHfXOySUGAcDgstBQpnYlmKf1WnqE8 Obh1jEV3UeyL9RBFdLoZeTAVdbID9yF5Tcg0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NZys2y9xL0RkLOpJxGCyeYPU2434CGqa+L1oQ5Ile9g=; b=XQigYhK1sm/meRtaE+FR5Mn/AVWzFx01clc0GeeO0hX88Fre2zpHukTafSTye8+X9u KGWgPMb1ZEhNIqlzOvZ71e2g1FHm6VVki7HfaA4ukcUyXOnrXCqouJd9vCBNOcK02pAj FpxxpWYgSl/SKHF+Q0ZefZ9d1yMkRVlbo51cPMEzgWKawi7KbzqyRObFT752OMXy7Gh2 5K3KZMCJTG6fccAv9WQDRf4FEdLa16BcVXgWgVMBRl9PSFTRaeMmd40CIUOfM0GtinPL NQ+rI5EeKBWUIwznzOpDfLNnjp3XLZ9S6e7dSzLnO8B2FQfle/fQkCa/ETkyJHCWjZnG q5+w== X-Gm-Message-State: AFeK/H0Navy4ssghWNrERB0UQqQWBDZ2pHKCuRAxPSubzkVMD1uZMpbw3Cn5dyb0vsh1tFPN X-Received: by 10.202.85.213 with SMTP id j204mr5411063oib.11.1490593565057; Sun, 26 Mar 2017 22:46:05 -0700 (PDT) Received: from linux.members.linode.com (li918-191.members.linode.com. [45.56.68.191]) by smtp.gmail.com with ESMTPSA id r130sm4657602oif.20.2017.03.26.22.46.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Mar 2017 22:46:04 -0700 (PDT) From: Bamvor Jian Zhang To: luto@amacapital.net, shuahkh@osg.samsung.com Cc: mpe@ellerman.id.au, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@kernel.org, broonie@kernel.org, bamvor.zhangjian@huawei.com, bamvor.zhangjian@linaro.org Subject: [PATCH 1/2] selftests: fix the broken individual test for x86 Date: Mon, 27 Mar 2017 05:46:00 +0000 Message-Id: <20170327054601.22415-2-bamvor.zhangjian@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170327054601.22415-1-bamvor.zhangjian@linaro.org> References: <20170327054601.22415-1-bamvor.zhangjian@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski report that build individual testcase in x86 is broken: $ make -C tools/testing/selftests/x86 ldt_gdt_32 make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' make: *** No rule to make target 'ldt_gdt_32'. Stop. make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' This patch fix this issue by adding default OUTPUT and convert target in Makefile of x86. And also mention this use case in Documentation/kselftests.txt Reported-by: Andy Lutomirski Signed-off-by: Bamvor Jian Zhang --- Documentation/kselftest.txt | 6 ++++++ tools/testing/selftests/x86/Makefile | 23 ++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt index 5bd5903..3dfca71 100644 --- a/Documentation/kselftest.txt +++ b/Documentation/kselftest.txt @@ -43,6 +43,12 @@ See the top-level tools/testing/selftests/Makefile for the list of all possible targets. +Building individual test case of a subset +========================================= +You could build the individual test case in subset if subset supported: + $ make -C tools/testing/selftests/x86 ldt_gdt_32 + + Running the full range hotplug selftests ======================================== diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 38e0a9c..855a2a1 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -17,8 +17,8 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) -BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) -BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) +BINARIES_32_FULL_PATH := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) +BINARIES_64_FULL_PATH := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) CFLAGS := -O2 -g -std=gnu99 -pthread -Wall @@ -28,25 +28,29 @@ CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) ifeq ($(CAN_BUILD_I386),1) all: all_32 -TEST_PROGS += $(BINARIES_32) +TEST_PROGS += $(BINARIES_32_FULL_PATH) endif ifeq ($(CAN_BUILD_X86_64),1) all: all_64 -TEST_PROGS += $(BINARIES_64) +TEST_PROGS += $(BINARIES_64_FULL_PATH) endif -all_32: $(BINARIES_32) +all_32: $(BINARIES_32_FULL_PATH) -all_64: $(BINARIES_64) +all_64: $(BINARIES_64_FULL_PATH) clean: - $(RM) $(BINARIES_32) $(BINARIES_64) + $(RM) $(BINARIES_32_FULL_PATH) $(BINARIES_64_FULL_PATH) -$(BINARIES_32): $(OUTPUT)/%_32: %.c +$(BINARIES_32): %_32: $(OUTPUT)/%_32 + +$(BINARIES_64): %_64: $(OUTPUT)/%_64 + +$(BINARIES_32_FULL_PATH): $(OUTPUT)/%_32: %.c $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm -$(BINARIES_64): $(OUTPUT)/%_64: %.c +$(BINARIES_64_FULL_PATH): $(OUTPUT)/%_64: %.c $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl # x86_64 users should be encouraged to install 32-bit libraries @@ -77,3 +81,4 @@ $(OUTPUT)/test_syscall_vdso_32: thunks_32.S # state. $(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static $(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static +