Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5087327iog; Wed, 22 Jun 2022 11:40:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMKhqHNGGF2hBm9bDWwWvdqw8/AAbb2Tbjx7cVq9OtFjRtIFir0imEDfzYh+PlSHlVI9Uj X-Received: by 2002:a17:906:9b92:b0:722:f705:759d with SMTP id dd18-20020a1709069b9200b00722f705759dmr3263359ejc.745.1655923256678; Wed, 22 Jun 2022 11:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655923256; cv=none; d=google.com; s=arc-20160816; b=b205CsqVo97B+6j4gJsBW/bk1xYwij1kSrpTUi2rhpoU5CbxCzD/3eA29kqbhQki9t GFklTU3VCD791gY3XMrN1RKyGLi5ib1QNpZhQY+o2ai6OU/QmzmXeilJhkNFBe8sc9eY TncXcfsR/Zf/P2dAILt230VOBpa+rF9/hT20EpPkLrv4eTyxtuZRGYcRDjOWdMWmxIRs AEFkX2dW/Abd4EVLYPEpS7JNExIr3aC0mQdCWqP3unU7UZ2C3CS3dpZeCs2XoOQny0cC 1k0PNefZd0ARvCiLUDJRQ1ayNDMOV1pOiaTezAKAx+lEQYA4B9wYZd8YWF4lcrSkKYrN OQXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:mime-version:user-agent:date :message-id:subject:from:cc:to:dkim-signature; bh=zUajASBiQjHAZhnPOiOhijZT69w/khebQsFCRqwrBWg=; b=jfhBoUmOPC5kYi7qG6+GRzkMZ0r1DeSFhXT7wx2yiCi61ntNHBp5BEjOtHCaZxs2aY HdV3wLqhTnWsGVo1IyDTITmR4l64+iuu7vltworjiHdlbK4uY48dPhIuhFVwQ2IWshqp vDEjs5V5IG+hFJd6WZr2uIlolUe9G10V2gpGtkLc+tSWKGBcPYjQDgYd7+BH4vkAw6If 4ZqJMRYKEFXcQZFRSiMQCfUzF0BhmlU1KdeOon7f7fMy8wSIOxvRK0N5BAYIQUfLjpr4 rnpiu5RGDs6v77zy7nZ6N142GKi7vk9msZa7STvAcs9xco8/dGpawR+Rjlwu2ZDZJF9n HVsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=dyCCzi1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp7-20020a1709071b0700b0070ed13d358fsi5468384ejc.194.2022.06.22.11.40.30; Wed, 22 Jun 2022 11:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=dyCCzi1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376671AbiFVR7F (ORCPT + 99 others); Wed, 22 Jun 2022 13:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376786AbiFVR6c (ORCPT ); Wed, 22 Jun 2022 13:58:32 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F9F2656D for ; Wed, 22 Jun 2022 10:58:30 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-101d2e81bceso14611116fac.0 for ; Wed, 22 Jun 2022 10:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language; bh=zUajASBiQjHAZhnPOiOhijZT69w/khebQsFCRqwrBWg=; b=dyCCzi1meBRMQu6ugcIRNgKFAUqiyWIwMRcVvFBCJ8C9U0Ih1bjpQz1f8setXQieRN DI6LZYshkQ6PKYaavyfMtwa1rUjXyXyPOHuUDKDic/F/B07IE+juuttK4eXNefNbPSna Ojpy5EBs87pUa/uKWlrwQV5036etVMQlBON6w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language; bh=zUajASBiQjHAZhnPOiOhijZT69w/khebQsFCRqwrBWg=; b=iiPMKs9iqWmCDLbisxnbzmWu9AQj5PaINmaASAWbynPZ/7+oRRir5q0+Zn9TdLqVKU CfcE2nI1L6vMsDvdcY1vGeqVrLd5h1YxKjF2eJnkhhJJU/zPdZPzylxPHKzdO+B1mCL0 tQBSniQXwrYS0E9D+xpmwsBPUe0ERn5f2M6XZslgxaMqs/1TaxIF0gLgvdGXIk4rB2eC 5947QfjyCsvePKpSTHSEsBuFWoVO1SijixZH5iamKk+TCeXcxWQt4YOUAzKFKaDH1Z4V 1DQnYAYjn+89NxgxJGQxOwZMw9sgOLSWfO6sFtx54wK13OLTEdLhhkuByD7d+X/3VMHi R9JA== X-Gm-Message-State: AJIora8a665Y4EnlXQd7FBgTKEoUyteAYjKRIZfNt6Z6/EgKv/ba9Hwo 2YbP8IecnzoY/Fe+Q+UssYmIwyY3oTH8Sw== X-Received: by 2002:a05:6870:78f:b0:f2:c91f:1b0a with SMTP id en15-20020a056870078f00b000f2c91f1b0amr25471335oab.299.1655920709264; Wed, 22 Jun 2022 10:58:29 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id bi6-20020a056808188600b0032e442f6a72sm11631440oib.40.2022.06.22.10.58.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 10:58:28 -0700 (PDT) To: Linus Torvalds Cc: Shuah Khan , Andrew Morton , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org From: Shuah Khan Subject: [GIT PULL] Kselftest fixes update for Linux 5.19-rc4 Message-ID: <477c2f03-a733-cd05-2551-759de9273cff@linuxfoundation.org> Date: Wed, 22 Jun 2022 11:58:27 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2F3D1A702E73BF4F538B8002" Content-Language: en-US X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------2F3D1A702E73BF4F538B8002 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi Linus, Please pull the following Kselftest fixes update for Linux 5.19-rc4 This Kselftest fixes update for Linux 5.19-rc4 consists of compile time fixes and run-time resources leaks. -- Fix clang cross compilation -- Fix resource leak when return error -- fix compile error for dma_map_benchmark -- Fix regression - make use of GUP_TEST_FILE macro diff is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit f2906aa863381afb0015a9eb7fefad885d4e5a56: Linux 5.19-rc1 (2022-06-05 17:18:54 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-fixes-5.19-rc4 for you to fetch changes up to 9b4d5c01eb234f66a15a746b1c73e10209edb199: selftests: make use of GUP_TEST_FILE macro (2022-06-16 17:05:50 -0600) ---------------------------------------------------------------- linux-kselftest-fixes-5.19-rc4 This Kselftest fixes update for Linux 5.19-rc4 consists of compile time fixes and run-time resources leaks. -- Fix clang cross compilation -- Fix resource leak when return error -- fix compile error for dma_map_benchmark -- Fix regression - make use of GUP_TEST_FILE macro ---------------------------------------------------------------- Ding Xiang (1): selftests: vm: Fix resource leak when return error Joel Savitz (1): selftests: make use of GUP_TEST_FILE macro Mark Brown (1): selftests: Fix clang cross compilation Yu Liao (1): selftests dma: fix compile error for dma_map_benchmark tools/testing/selftests/dma/Makefile | 1 + tools/testing/selftests/dma/dma_map_benchmark.c | 2 +- tools/testing/selftests/lib.mk | 25 +++++++++++++++++++++++-- tools/testing/selftests/vm/gup_test.c | 4 ++-- tools/testing/selftests/vm/ksm_tests.c | 2 ++ 5 files changed, 29 insertions(+), 5 deletions(-) ---------------------------------------------------------------- --------------2F3D1A702E73BF4F538B8002 Content-Type: text/x-patch; charset=UTF-8; name="linux-kselftest-fixes-5.19-rc4.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="linux-kselftest-fixes-5.19-rc4.diff" diff --git a/tools/testing/selftests/dma/Makefile b/tools/testing/selftests/dma/Makefile index aa8e8b5b3864..cd8c5ece1cba 100644 --- a/tools/testing/selftests/dma/Makefile +++ b/tools/testing/selftests/dma/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../../include/ TEST_GEN_PROGS := dma_map_benchmark diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools/testing/selftests/dma/dma_map_benchmark.c index c3b3c09e995e..5c997f17fcbd 100644 --- a/tools/testing/selftests/dma/dma_map_benchmark.c +++ b/tools/testing/selftests/dma/dma_map_benchmark.c @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #define NSEC_PER_MSEC 1000000L diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 2a2d240cdc1b..1a5cc3cd97ec 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -7,10 +7,31 @@ else ifneq ($(filter -%,$(LLVM)),) LLVM_SUFFIX := $(LLVM) endif -CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX) +CLANG_TARGET_FLAGS_arm := arm-linux-gnueabi +CLANG_TARGET_FLAGS_arm64 := aarch64-linux-gnu +CLANG_TARGET_FLAGS_hexagon := hexagon-linux-musl +CLANG_TARGET_FLAGS_m68k := m68k-linux-gnu +CLANG_TARGET_FLAGS_mips := mipsel-linux-gnu +CLANG_TARGET_FLAGS_powerpc := powerpc64le-linux-gnu +CLANG_TARGET_FLAGS_riscv := riscv64-linux-gnu +CLANG_TARGET_FLAGS_s390 := s390x-linux-gnu +CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu +CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(ARCH)) + +ifeq ($(CROSS_COMPILE),) +ifeq ($(CLANG_TARGET_FLAGS),) +$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk +else +CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS) +endif # CLANG_TARGET_FLAGS +else +CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) +endif # CROSS_COMPILE + +CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX) $(CLANG_FLAGS) -fintegrated-as else CC := $(CROSS_COMPILE)gcc -endif +endif # LLVM ifeq (0,$(MAKELEVEL)) ifeq ($(OUTPUT),) diff --git a/tools/testing/selftests/vm/gup_test.c b/tools/testing/selftests/vm/gup_test.c index 6bb36ca71cb5..a309876d832f 100644 --- a/tools/testing/selftests/vm/gup_test.c +++ b/tools/testing/selftests/vm/gup_test.c @@ -209,7 +209,7 @@ int main(int argc, char **argv) if (write) gup.gup_flags |= FOLL_WRITE; - gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR); + gup_fd = open(GUP_TEST_FILE, O_RDWR); if (gup_fd == -1) { switch (errno) { case EACCES: @@ -224,7 +224,7 @@ int main(int argc, char **argv) printf("check if CONFIG_GUP_TEST is enabled in kernel config\n"); break; default: - perror("failed to open /sys/kernel/debug/gup_test"); + perror("failed to open " GUP_TEST_FILE); break; } exit(KSFT_SKIP); diff --git a/tools/testing/selftests/vm/ksm_tests.c b/tools/testing/selftests/vm/ksm_tests.c index 2fcf24312da8..f5e4e0bbd081 100644 --- a/tools/testing/selftests/vm/ksm_tests.c +++ b/tools/testing/selftests/vm/ksm_tests.c @@ -54,6 +54,7 @@ static int ksm_write_sysfs(const char *file_path, unsigned long val) } if (fprintf(f, "%lu", val) < 0) { perror("fprintf"); + fclose(f); return 1; } fclose(f); @@ -72,6 +73,7 @@ static int ksm_read_sysfs(const char *file_path, unsigned long *val) } if (fscanf(f, "%lu", val) != 1) { perror("fscanf"); + fclose(f); return 1; } fclose(f); --------------2F3D1A702E73BF4F538B8002--