From patchwork Wed Nov 9 22:11:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 13038103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DE7AC4332F for ; Wed, 9 Nov 2022 22:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbiKIWLW (ORCPT ); Wed, 9 Nov 2022 17:11:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbiKIWLV (ORCPT ); Wed, 9 Nov 2022 17:11:21 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B1E303F7 for ; Wed, 9 Nov 2022 14:11:20 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id h9so28000258wrt.0 for ; Wed, 09 Nov 2022 14:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sJ3GKuVP0imx2POuBXkubXthFsDTUZ2cFaQOvp4RnX4=; b=8F6WoDkV30FemhBYOzo7/gw3yLnKcBlPDpi4cbnyhJkCjDl1OHXNEsIJfEOZjt0z6E kGCOjdGdNzYPQiMgn0DM2+3CS61G4LSzruznyEmDHiWHSmb8PJ6g1bcB6hX8R5WIZpdn /Gunw0Qd09fKmgQ7K8DWwVXcNOlk84THBdxrF1ubpWKUd6O3PdkB2j+a5YEWmOjmr3NX 0HRM8cvQWiilsDenpJraXTB3A5pOdw1CKxBgRhCsSpjnVsvdYAfpcFuSZPPPTBQ5EO+a 3deGsyMhlypOzCzIt/n1nXlJJugA0ZNKfVjK3oW0V4ojgqSv1NnREmeTbAs2s8O8JGNG WVRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sJ3GKuVP0imx2POuBXkubXthFsDTUZ2cFaQOvp4RnX4=; b=Anpr4zgKfovWAXwjCJYE6PijllHCwGsoVbezu3ZCUK0VBAUiAg4YiA1g9CRXivwym9 dpMzYNfnXVQIH8rLJvJBpuL9bT45B3KgWl8H/LoXz8/iT+JVS3n8Q/v3fhHKyFnlpnYu w65ZlZxal8rjpmegNtNG29OoBFRnymhg9OuBuSrjPIysXfrTmrlFj060eZ53bRIA45Me bFOKGqamMNyKjHRY9Po+ZUM9RDV41/8+JT53z+BSjwsS8lfKnFYIGqdpAhsoEtlRi2MK MdIJKtcwz9mnadcKbyLODF2v1JAXN3my/xmt7MrQs1uCJ/SGZa4MP2IwI1EO+JDQSP+y /CRQ== X-Gm-Message-State: ACrzQf2P2/eXPrpHmLArWX45Q4BqsuyFVjbuQh91/RhBlByLDSEhl77E XbK0ZD/xeCUJHXRs8b7xJ/pdmw== X-Google-Smtp-Source: AMsMyM5Ls91XrzX31Fh5/LlArYy6wfxqLqtNzvMjtExOap0AZndiItsV9y3Rf+Hx6UPliQgt6FqPMw== X-Received: by 2002:a5d:4441:0:b0:236:6c3e:efb4 with SMTP id x1-20020a5d4441000000b002366c3eefb4mr39347938wrr.539.1668031878566; Wed, 09 Nov 2022 14:11:18 -0800 (PST) Received: from localhost ([95.148.15.66]) by smtp.gmail.com with ESMTPSA id s25-20020adfa299000000b00236b2804d79sm14626583wra.2.2022.11.09.14.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 14:11:18 -0800 (PST) From: Punit Agrawal To: akpm@linux-foundation.org, shuah@kernel.org Cc: adobriyan@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, Punit Agrawal Subject: [PATCH v2 1/2] selftests: proc: Fix proc-empty-vm build error on non x86_64 Date: Wed, 9 Nov 2022 22:11:03 +0000 Message-Id: <20221109221104.1797802-1-punit.agrawal@bytedance.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The proc-empty-vm test is implemented for x86_64 and fails to build for other architectures. Rather then emitting a compiler error it would be preferable to only build the test on supported architectures. Mark proc-empty-vm as a test for x86_64 and customise the Makefile to build it only when building for this target architecture. Fixes: 5bc73bb3451b ("proc: test how it holds up with mapping'less process") Signed-off-by: Punit Agrawal --- v1 -> v2 * Fixed missing compilation on x86_64 Previous version * https://lore.kernel.org/all/20221109110621.1791999-1-punit.agrawal@bytedance.com/ tools/testing/selftests/proc/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile index cd95369254c0..743aaa0cdd52 100644 --- a/tools/testing/selftests/proc/Makefile +++ b/tools/testing/selftests/proc/Makefile @@ -1,14 +1,16 @@ # SPDX-License-Identifier: GPL-2.0-only + +# When ARCH not overridden for crosscompiling, lookup machine +ARCH ?= $(shell uname -m 2>/dev/null || echo not) + CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += -D_GNU_SOURCE LDFLAGS += -pthread -TEST_GEN_PROGS := TEST_GEN_PROGS += fd-001-lookup TEST_GEN_PROGS += fd-002-posix-eq TEST_GEN_PROGS += fd-003-kthread TEST_GEN_PROGS += proc-loadavg-001 -TEST_GEN_PROGS += proc-empty-vm TEST_GEN_PROGS += proc-pid-vm TEST_GEN_PROGS += proc-self-map-files-001 TEST_GEN_PROGS += proc-self-map-files-002 @@ -26,4 +28,8 @@ TEST_GEN_PROGS += thread-self TEST_GEN_PROGS += proc-multiple-procfs TEST_GEN_PROGS += proc-fsconfig-hidepid +TEST_GEN_PROGS_x86_64 += proc-empty-vm + +TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH)) + include ../lib.mk From patchwork Wed Nov 9 22:11:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 13038104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A1A2C433FE for ; Wed, 9 Nov 2022 22:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232047AbiKIWLY (ORCPT ); Wed, 9 Nov 2022 17:11:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231863AbiKIWLX (ORCPT ); Wed, 9 Nov 2022 17:11:23 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E7D31213 for ; Wed, 9 Nov 2022 14:11:21 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id t25-20020a1c7719000000b003cfa34ea516so3178980wmi.1 for ; Wed, 09 Nov 2022 14:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zjcx5nGJ4+e6voi0gTPzKp2DtAjaGHPzOo3aFzn/OZg=; b=P8/bnQTjV4nzCnwXorntM1WchaIivdzE2Yt/R7IiG7Ii2vT3PYvJc2avGc1K2y3O+u s0iNoA/aO1/YAFG4W/mqfXudotsG6MV49UwT8SEcx+9rx/sAJZojZH/AnvMi7C1s2ooR vJRuiOjcaHcxSr/SjDVnK1Nj26gR4nOJCHs+KBIUY4IpxIt7X3e/dcziuNJ3pg2i2651 4vh+fe12F9GQ5FvV6yMDjyiC3Pzv8l4Woi/JQNVuxGTX6z5uKb/+4DNXSRVPigX60efB 7aGEfW1PDuXw8ojKxTj8SwEhGyrWjARHK5sBmVhrw1xFbwqDXkRXA4I75qCfkIGrZMbt +lcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zjcx5nGJ4+e6voi0gTPzKp2DtAjaGHPzOo3aFzn/OZg=; b=pmCUzXQV8TDVvyOKE97V/4m3tOqHrcg8732XpCg7ssGzyY6heNaoKOiLJL915AlgpO T55l/2/df6AR3CVmCsT5r9lBaCva9GbYoPkACacMvit5phRKHJ4ldVoQA2F4uVkvh0s0 RTvdx4xMXk3WV9YuxGMC+ZIx8H8yq9mXYem1KZ5mg1qeRre/4zKF5gFUUks1/qu5Zhm5 u2ObdQycUpYSLi5FDLc/WiXws59F7WuRXdO/tzT5uwUUs/3G9EAo0gVzaMo/sbyQcul/ mLP7hCBrNDotRObg1zGpFgtweoaICCG3A5LM+We5XkVT28scJrUnLUo5JRDcpnuQKIjK E8Ng== X-Gm-Message-State: ACrzQf0w9q6U3BEAb/QR688mEyHhJE2U5K3Geu66P44TtkV0k73jM8fn Atm/n+SIKLQV/EpB73CrUb+TdQ== X-Google-Smtp-Source: AMsMyM7HW/8xiglV2nGZzAJasS+2C/g1HhdvY80U1kVvgsIaPUHX5JXuLGJXrDKB7IEWVOlP++hbaw== X-Received: by 2002:a7b:ca52:0:b0:3cf:5c22:cbee with SMTP id m18-20020a7bca52000000b003cf5c22cbeemr41336461wml.97.1668031879712; Wed, 09 Nov 2022 14:11:19 -0800 (PST) Received: from localhost ([95.148.15.66]) by smtp.gmail.com with ESMTPSA id bn23-20020a056000061700b002305cfb9f3dsm14292893wrb.89.2022.11.09.14.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 14:11:19 -0800 (PST) From: Punit Agrawal To: akpm@linux-foundation.org, shuah@kernel.org Cc: adobriyan@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, Punit Agrawal Subject: [PATCH v2 2/2] selftests: proc: Mark proc-pid-vm as x86_64 only Date: Wed, 9 Nov 2022 22:11:04 +0000 Message-Id: <20221109221104.1797802-2-punit.agrawal@bytedance.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221109221104.1797802-1-punit.agrawal@bytedance.com> References: <20221109221104.1797802-1-punit.agrawal@bytedance.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The proc-pid-vm test does not have support for architectures other than x86_64. Mark it as such in the Makefile and in the process remove the special casing in the test itself. Signed-off-by: Punit Agrawal --- tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/proc/proc-pid-vm.c | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile index 743aaa0cdd52..db953c014bf8 100644 --- a/tools/testing/selftests/proc/Makefile +++ b/tools/testing/selftests/proc/Makefile @@ -11,7 +11,6 @@ TEST_GEN_PROGS += fd-001-lookup TEST_GEN_PROGS += fd-002-posix-eq TEST_GEN_PROGS += fd-003-kthread TEST_GEN_PROGS += proc-loadavg-001 -TEST_GEN_PROGS += proc-pid-vm TEST_GEN_PROGS += proc-self-map-files-001 TEST_GEN_PROGS += proc-self-map-files-002 TEST_GEN_PROGS += proc-self-syscall @@ -29,6 +28,7 @@ TEST_GEN_PROGS += proc-multiple-procfs TEST_GEN_PROGS += proc-fsconfig-hidepid TEST_GEN_PROGS_x86_64 += proc-empty-vm +TEST_GEN_PROGS_x86_64 += proc-pid-vm TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH)) diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c index 69551bfa215c..6b0cb772b688 100644 --- a/tools/testing/selftests/proc/proc-pid-vm.c +++ b/tools/testing/selftests/proc/proc-pid-vm.c @@ -105,7 +105,6 @@ struct elf64_phdr { uint64_t p_align; }; -#ifdef __x86_64__ #define PAGE_SIZE 4096 #define VADDR (1UL << 32) #define MAPS_OFFSET 73 @@ -209,7 +208,6 @@ static int make_exe(const uint8_t *payload, size_t len) return fd1; } -#endif /* * 0: vsyscall VMA doesn't exist vsyscall=none @@ -225,7 +223,6 @@ static const char str_vsyscall_1[] = static const char str_vsyscall_2[] = "ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]\n"; -#ifdef __x86_64__ static void sigaction_SIGSEGV(int _, siginfo_t *__, void *___) { _exit(g_vsyscall); @@ -493,9 +490,3 @@ int main(void) return 0; } -#else -int main(void) -{ - return 4; -} -#endif