From patchwork Tue Jun 6 07:16:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3205364vqr; Tue, 6 Jun 2023 00:22:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56VAiC/PUzqqO1YBaoAUVzH3dUszoEWHZAeNJNKnrytusVm1wQMYqkjn5DfWxtX2MU6Bjg X-Received: by 2002:ac8:590d:0:b0:3ef:5981:2e96 with SMTP id 13-20020ac8590d000000b003ef59812e96mr1409397qty.4.1686036139760; Tue, 06 Jun 2023 00:22:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686036139; cv=pass; d=google.com; s=arc-20160816; b=Fe99dlk99KJiINUUu3JipBUKrWMxwAr2c5HPMbUiSd/DCPENNjp37bPJLsc5Y1EBlM qq6dpvlKG0m7SsVROOhfNLokv0NR43T/9RFNXYT6tHrvbd1SLyGCHjiffQzfYDei1AU+ 6nVtqi2I0zdkozhwuivp9sVSdaMlCxNVJmK3AOkluggBFdKpWOpGclEekvlR01qpSsGW Ggvnry8lfLok61jdb9W6XP/7d98S6mqa5oD/E1qYJoxM/V7d26RYOAAfz0+Awi9D/qxg nUDdmPV0YS1DiUSazkLotW0jM1Q82WdnXv6XTUZ9piFg7JAz0ghbtTBg1g0w/Exxvj9H UdHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iP9o5A+zo7bJweh4Rc7yXQPSG4GKmkDno5NX83EjreQ=; b=IRhqpcYPSvkme7rXlaqSWT8zaZbFHDRT/RFuoRtdmJwpNepG2ZaDtgC4cF+BQSwZir Bp30cbjP4bk1FyeV776SD6BArRsWmPL9pMTOoRiS+ks5j5NnFymrg39jmqzllbawoamB cbrUskuXiZpBg22wGWikYRHPaSh2h6Id9xkcrhTzFj5OuQUbGOhtBIElN953NMQtj3kA z0/d9PAoXOhM/Z2+FQ+uEmzwVCpLPUjhUQgaWNo04aGD7nUPU+zWFU72v995E8XCZkuv /J0jpRc0LpHg6YZf7lqtl4eu2IJF9rVIDoMaHT8u4D+kQf/W/nW1PtVYGJTd5sWE+YvM 65hw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=gbKCs76r; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a0562140da200b005dda9d0227fsi5738714qvh.596.2023.06.06.00.22.05; Tue, 06 Jun 2023 00:22:19 -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=@Nvidia.com header.s=selector2 header.b=gbKCs76r; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232798AbjFFHRl (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjFFHR0 (ORCPT ); Tue, 6 Jun 2023 03:17:26 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C786E1AD; Tue, 6 Jun 2023 00:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jxb4OK+blPOmfCbfbFwS7RtwdO42XYZpU5ZSW/ULzSlDNLDhFNiKBGo4v09jVDQPB2CYJYYISek9YrkqX+IrwTrFvqdj2/AmJ+u6hKRLFOKoXYk5ZkxxNBzzzxyHl6Tp366Hqc1kHXri6Zh5TsZEGE+CPzXpyZ7IPCxaZUlNyl+s0QaIfhMIZkTku9TSqinCW0uAFPo9lbCI8jJC0J3J/etSaHDtYeBs7/5z0uxgsXfY8/wyxYL8/Yam1jrvXnT5fr6lgnkoxEUM2xHjK1Z1/vdSJsEhWOA7gPUsPwM8jzQsfnqA8LNdkIGLIOOLc2cUQlOgHBsE3vb9i0Ep9va+Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iP9o5A+zo7bJweh4Rc7yXQPSG4GKmkDno5NX83EjreQ=; b=L8F4h4luMVb7aHHGY/TakNjh6bV1spHTg7Sh3v9JKC3637admAXedzvu5lSfhZQsZXezDHASjO6g+8zxIZo+E94C0rFzZYPSRZ1jP4ii25xaIFp+QMOGCP8CvHEJpJbI/CrggwZOxMxHbIICt8i1ze/rWozz4zmhieTEd1hVXZKjKH7Uo3h2cstif3hk/FmHY0m86OLNGdk0Z/zoNbpVtIj3I6SnjgjkBjDQBwnMLn1nZrpQVmwdXhy1gPhq+XPVxqk9VpeLa2SDeNi3v/b2pcyooYUeOo7t0Oy+Cu2SGNV2Yf2wcKhZVt6Joxzc7Trv0pQQ7X6erk6IiFZtGbYo1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iP9o5A+zo7bJweh4Rc7yXQPSG4GKmkDno5NX83EjreQ=; b=gbKCs76rxbUz403CqK2c52BEcRCpPw3+jUixDiwSPG4FhHSPzD/T9iZLM5ANBfJdg1cWqZY5zmKdI1/EsTY+A/77v5segMma29qvOtr64q0HN3jhpe8Nx9NzbBfGy2vv7oiLuHMNjLzRBQ0EcAqbJZmQUsA22qXk4ZtBpUu7jlAsdUqAbnuscPVxMBLD4CeeYGSwoG2fVTr3XEOYS2IRPPWyDlAfiE2PoKoxWRLRCfRihU/+zW15YynvkInoMlyftFqUHBbo+BiejnLQLlD7FNZGJuWIjsyABknUgbphy9qz7wz05SfieU/NXrjYJR5v+spTCIXWWjERhBdDF2F5vA== Received: from DS7PR03CA0296.namprd03.prod.outlook.com (2603:10b6:5:3ad::31) by BY5PR12MB4997.namprd12.prod.outlook.com (2603:10b6:a03:1d6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 6 Jun 2023 07:17:22 +0000 Received: from DM6NAM11FT086.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ad:cafe::60) by DS7PR03CA0296.outlook.office365.com (2603:10b6:5:3ad::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT086.mail.protection.outlook.com (10.13.173.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:22 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:08 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:08 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:08 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 01/11] selftests/mm: fix uffd-stress unused function warning Date: Tue, 6 Jun 2023 00:16:27 -0700 Message-ID: <20230606071637.267103-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT086:EE_|BY5PR12MB4997:EE_ X-MS-Office365-Filtering-Correlation-Id: a31904b5-6bb3-484f-a921-08db665e124f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r8WLAVKrtcMWNwSm3gAk54ZpLalVo5DloersbxMkOh24+6SyeyJHVF2piXYfMwp+NlHC0cjge1UlGT/zSedJu6i19FxYVvVbnSsW8rr6kcZxAiROKBBpxUGqo1JKODHHH8Zm9aH6hvmTHHS5JCwpTNnnwd/be5DvbzPGRp6z1Ujx8Q450wCOO4QdErNxf+t4SWZIfUk54/bzo8SsB1vtqlgTPg1MopW4ruI0vG5lJAdq7koxysc7KxaUrHi/d/6/IcWWuoYrIz1p2Kl9+qhHURZe60crOPmh45n7l4vPLtJlS0rodUz75WkWMW4eu91+9IsXOHrtTWNXBolpc9btOapuHsFP/iwRX5FTLhi2NxDuUwlMnqiYpN252cvAAIPdexl3ZFY1vHmWwWWqbWLKyU+lRbNYmfXdRj8LT7CPha2jw+2xq3UIWRcPqXiKqAZnn6kj37DcQP8lydmQ8Cu51eORwAutLjXmXu4mGRi7rBaCUxQcRMjY2JsoCeehX84gwW9ujGhKVYL1IrergrRPFlic7IeXQbFLDHobmkchIl4nadT2da3zjqCbR2M6CvtkZDd1oAtpE9/NfGcTHit7EGoX9dsM2ejTnqkYqHWfHr6EiNbS8WwSnJ6gJFnFbpzDMZ0zKqydqDjOyB4W/Kli5IxNz22LrSSICMUUx9atlprBHg740F+S9woiLrvWneDqd4EXSC43zhtXF5xq0k7Yl+iKnG8E7+KKEQALBWiKpLyfDy+Z1DlJyVf5y+FrWiR/ X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(40480700001)(54906003)(70586007)(478600001)(82740400003)(356005)(6916009)(8676002)(8936002)(41300700001)(4326008)(316002)(70206006)(2616005)(186003)(426003)(336012)(36860700001)(83380400001)(47076005)(7696005)(40460700003)(6666004)(1076003)(26005)(7636003)(107886003)(86362001)(5660300002)(4744005)(2906002)(82310400005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:22.1820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a31904b5-6bb3-484f-a921-08db665e124f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT086.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4997 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767937031147310507?= X-GMAIL-MSGID: =?utf-8?q?1767937031147310507?= uffd_minor_feature() was unused. Remove it in order to fix the associated clang build warning. Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-stress.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index f1ad9eef1c3a..995ff13e74c7 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -88,16 +88,6 @@ static void uffd_stats_reset(struct uffd_args *args, unsigned long n_cpus) } } -static inline uint64_t uffd_minor_feature(void) -{ - if (test_type == TEST_HUGETLB && map_shared) - return UFFD_FEATURE_MINOR_HUGETLBFS; - else if (test_type == TEST_SHMEM) - return UFFD_FEATURE_MINOR_SHMEM; - else - return 0; -} - static void *locking_thread(void *arg) { unsigned long cpu = (unsigned long) arg; From patchwork Tue Jun 6 07:16:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3204338vqr; Tue, 6 Jun 2023 00:19:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52OXWKeeO3KHnYu2htx10XzZSm/OnfV+WwUpgxrG74ZA/7g0w8+1diuRSyqyegVd7ZxjRv X-Received: by 2002:a05:6214:c21:b0:61b:5afc:d4be with SMTP id a1-20020a0562140c2100b0061b5afcd4bemr1230596qvd.7.1686035993698; Tue, 06 Jun 2023 00:19:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686035993; cv=pass; d=google.com; s=arc-20160816; b=vN0A+XReD2mDgmZcgTpoB0pMWuMzmWl9t78FAcbn6TUdu1vUSz2W8Wr1r4H9xRV7ZC d+FkKSdjykCZkJyAvC/GpMCJRJABHf/gJ2D5SspQzr+07rLNLm0DNiXQXpRF1l4E4wHi GIv7EUBz3sBAeI9+3plMT4fMXMEzdgbiBHDNns78xhaQqhAn59sjycszUM05W+Qiw7Ue HPV3h2wI0v4Az3TLRvooscpbay+7rBy41CuSX/MHO505uL2mRY4iryhLZhY4fr7qz+TX bZ2tJzolif68cTrbaFmf4xNP0Q8lauMeM7EQRwX/tjbcmtwpeP6KV8yLAR+cmnQLXsDW NAOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Oomk2fy3Qd8IWmlp1U9Cr+uW/RGziNlTD8zYdFVYMMA=; b=Pxa6+dPS3Q1095AbAEbyokq7JUgM5SI+RS6DXgJznHsJZIJZLmInDeJCjtmejlraHg fIqd8MdIwjKg+7yKr7EXWLsN17ymuAGvTxY9I1+1QhaHLY0ty4y+bQ9gW3ktVTQ3zR5q 2s637LQNUGQv8eV3K1K1xwonRoFBvzO2AnOEbWTF8fldpz9m3TXZSJhzrWYGKi1gizgM 9Hks/w9LumvRXJRK4nxHJ1UFVOWHYaz6Aov5huPx/OMlgASfZ6KeYsbRepTgU5xkHH4j hBDcUgJZZ6bH0+WGgQQH3zWP8vK1V5yWd0XeNQhWkzIM8sJtyZKUj87iqi9SzSDPFSkm V7Mw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Ze04XqAw; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a0562140da200b005dda9d0227fsi5738714qvh.596.2023.06.06.00.19.39; Tue, 06 Jun 2023 00:19:53 -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=@Nvidia.com header.s=selector2 header.b=Ze04XqAw; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235305AbjFFHRa (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbjFFHRZ (ORCPT ); Tue, 6 Jun 2023 03:17:25 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2063.outbound.protection.outlook.com [40.107.96.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0A01F7; Tue, 6 Jun 2023 00:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j61+e5z8XhSvb86Pb6/ZS/u+i72hc/l4keiNP1wo+j7D4ttiBIYibMYdfChf0KgYSGsIV6F+6ZcmQF6wldWpfwYfa1t7Cv7chvUxYN966yxm4PteKGR5uHGc3/oHhQcPO+WxNITnSOvc2mPXXZHL7U6JTnXjXIH4m0dd9pXR3zPKnbbz0YozVM4qzl/+k7xRLDtVmfq6zT7NyMeEZswWgnVLRQJqy8rSsl27FNLEwKCeILdtlrgalhkA5A5spUQaoyrYLC+gNhE5289ZlK0PqKaMc3Cn86lxrIB7KRU6v3Ip7emnyqXRDcDymnPnYgDftXJiHlHFXY7S5wBkt3rHOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Oomk2fy3Qd8IWmlp1U9Cr+uW/RGziNlTD8zYdFVYMMA=; b=aGqs2kVLge+C7sTZ6ErEWATw6v62ag7K644y/NnzGwj1tEI/TUWabJeZX4EfAkzQNuRXT2SBjJWXVDmzQ8F1RQDUmj1hrJxZ6siEGY53iEyBa5IT2zyBVaiDY36c1Ea4RQl+heoU+B5n5AI3XfuRmLwDuWyFBisuIhHTIwKaxAR0CaPY1oWU4LXylfnNfgIq5Rim7R7t781B18z5dyfPgkdqO+CFUu42oNamcimEnbrHwnSvMEped0+HetsowwzOD6V7bNADwjpfYMC0au18rvWfrTXSfLXUSpoP3CvZlr9q//sWcGUgAUl7UkvRwsGI01V3YFx7wRbmAw7A852iOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oomk2fy3Qd8IWmlp1U9Cr+uW/RGziNlTD8zYdFVYMMA=; b=Ze04XqAwyyefbOQdLS2a/cErELDu0dyXO/JDMG3PY5ONuz3OafovhpM1Vm1MHizELnzQs6lZEDvrRMUTwas281IZi3c+pzLI/s7EcVj4UO4imJR8ASc+TbiFjZcrgTj0s9v/9zKfdSsKMxydAHYdokyhDx5ax4MPnT7eW31G6OP8VBDDVO6dQgiXHTeMhJlhanQTJCLfuFGbrxrmB4xKE2sLPSnXYURWdAMxdpQue9GdFN/dcYNY0jx63JsRluHdWyhoiiCbYJLz9Ha/xj/A/VnFwXOCnUDcjwefYd34y41gGy6RaYzS7wWpbnp3+vv1ofYP9we/0g9F+qA6YAmdRw== Received: from BL1PR13CA0402.namprd13.prod.outlook.com (2603:10b6:208:2c2::17) by DM6PR12MB4877.namprd12.prod.outlook.com (2603:10b6:5:1bb::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:21 +0000 Received: from BL02EPF000145BB.namprd05.prod.outlook.com (2603:10b6:208:2c2:cafe::b6) by BL1PR13CA0402.outlook.office365.com (2603:10b6:208:2c2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Tue, 6 Jun 2023 07:17:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF000145BB.mail.protection.outlook.com (10.167.241.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.13 via Frontend Transport; Tue, 6 Jun 2023 07:17:20 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:09 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:08 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:08 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 02/11] selftests/mm: fix unused variable warnings in hugetlb-madvise.c, migration.c Date: Tue, 6 Jun 2023 00:16:28 -0700 Message-ID: <20230606071637.267103-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145BB:EE_|DM6PR12MB4877:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ddaaa03-832e-4960-58b1-08db665e1157 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xmsKfaV+Y9szZUbOLZz/nYJQ5ryVYu3989jC4EVu3MAXqDRqSRoZeotMfNffL2FceTjsGRiZj3rOt1cdxALUiE7XfVc3kIMalNK+z2anDlGJfG20eRAGJM50QMmoxNYomAhfLdiMqc9u5gnKwrNcqr/rFx1uMAyd1nY/yMKr8soUG2S6FZamAZhJNJLN4Vma91pbW89kwUvfItk52W0lVCMHcwmgGkoAneVqIi9a2IHEi8ezr6Vmsf+1Qg/hk+NUbaJ2R1Kx1NHbgutUfXdRP3TD2oPnaMpNY+NzHtykwfM2W5xjerS+e38ZkhNPzK+vc/abCVAZf3QLrvH1Yo57LBkuDGcQOawlrvkxaSn0qhJbXWz/CbPUTVvmuE2wU0P6B3mrNT2pdosQ71kb+I92H7ysmgx2/eUzjCywbKtXDLnD9dYPAhJl75xT5UfTEDW0CevAoXQv9C/jaBkKye3JaZFL88sqrahCZnCp6SXv5vLLmuOOkasW3XG5JQj7hjJv8Tqv11wwBVpIhFoFjkPiaT9qTOOy0l0V1oWuet8iUcXHIe7XjvigldV33GVDEGykwqNhRAgTIgLz2qI7zYTFzv4dunniqQs21zwLFbz9Nt6tBlGASkgy/vE+4MF18yUu1y+kcmOdSiOMHcmSmjupEIAnmNKjQL7404448TgKjZR6OwfLrEMrN+yVceP4i4t9US79AW0Hdl2Tw75sl6uT04uE5tXfMmHLGiK2mjlp9OhQNAR+bAZWX3osPTcjIORV X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199021)(40470700004)(46966006)(36840700001)(107886003)(1076003)(186003)(26005)(2616005)(426003)(336012)(83380400001)(47076005)(36756003)(6666004)(36860700001)(54906003)(82310400005)(7696005)(2906002)(8676002)(8936002)(82740400003)(40480700001)(478600001)(40460700003)(6916009)(5660300002)(86362001)(4326008)(7636003)(41300700001)(316002)(356005)(70586007)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:20.4921 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ddaaa03-832e-4960-58b1-08db665e1157 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145BB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4877 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767936878226150881?= X-GMAIL-MSGID: =?utf-8?q?1767936878226150881?= Dummy variables are required in order to make these two (similar) routines work, so in both cases, declare the variables as volatile in order to avoid the clang compiler warning. Furthermore, in order to ensure that each test actually does what is intended, add an asm volatile invocation (thanks to David Hildenbrand for the suggestion), with a clarifying comment so that it survives future maintenance. Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-madvise.c | 8 ++++++-- tools/testing/selftests/mm/migration.c | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c index 28426e30d9bc..d55322df4b73 100644 --- a/tools/testing/selftests/mm/hugetlb-madvise.c +++ b/tools/testing/selftests/mm/hugetlb-madvise.c @@ -65,11 +65,15 @@ void write_fault_pages(void *addr, unsigned long nr_pages) void read_fault_pages(void *addr, unsigned long nr_pages) { - unsigned long dummy = 0; + volatile unsigned long dummy = 0; unsigned long i; - for (i = 0; i < nr_pages; i++) + for (i = 0; i < nr_pages; i++) { dummy += *((unsigned long *)(addr + (i * huge_page_size))); + + /* Prevent the compiler from optimizing out the entire loop: */ + asm volatile("" : "+r" (dummy)); + } } int main(int argc, char **argv) diff --git a/tools/testing/selftests/mm/migration.c b/tools/testing/selftests/mm/migration.c index 1cec8425e3ca..379581567f27 100644 --- a/tools/testing/selftests/mm/migration.c +++ b/tools/testing/selftests/mm/migration.c @@ -95,12 +95,15 @@ int migrate(uint64_t *ptr, int n1, int n2) void *access_mem(void *ptr) { - uint64_t y = 0; + volatile uint64_t y = 0; volatile uint64_t *x = ptr; while (1) { pthread_testcancel(); y += *x; + + /* Prevent the compiler from optimizing out the writes to y: */ + asm volatile("" : "+r" (y)); } return NULL; From patchwork Tue Jun 6 07:16:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103611 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3213935vqr; Tue, 6 Jun 2023 00:42:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mdXkf/2Idk81REbLI4Vz7tNWcTScDNych6RD3G0T1smfixzdi2ruUBVPMtzUPmx/xaLZj X-Received: by 2002:aca:6547:0:b0:398:48dc:5f9f with SMTP id j7-20020aca6547000000b0039848dc5f9fmr935633oiw.8.1686037358566; Tue, 06 Jun 2023 00:42:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686037358; cv=pass; d=google.com; s=arc-20160816; b=ZuV/ZEyPpTP3ktf9poNfCwC5nKtI+/7XsuawwzQMtulORiT3HJs7HjpQZ+8U/b7Dgt tUVcUjrM4oL6GReOPwh9gCXaZOLGx8wGhQYrmECr6QeAeedjhHX3O463bTO9OlSr5cFv YwG8+UGF/i61aZsbbhEb6XImVAiNK/NUB7sRhOG9rU5cpX+lb4WlP2PLOUonUWtCvJoF sJvpnrbutyCx83Gv8/+JxBW3w+Vob8zycdQKdNHGwgX8riE+oueYoiaxCaDyNK0zljkf 5sQr7BeLFncr1U2t1L676t9T8ecpE5h+3iywlFEzbEvmUqqnYd8duhIArIx4O4/kapoK aD+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R/GcSFki6gkb8xdTqFtxT9LuvcMcqdER4egYKBl3qMs=; b=hgogTQC0tYJ2SshojKyph/Wv7oBCxMhc9gONIvO37PdfXweFen41JeBtlKhK9NS7Xx q8si4hMC7McSiC8SXqGNcKiCbp+cnE4duQYs3/d0eW6bsz6d0tLon/tI1swW84k1DZ78 GzwBvuNUDy7m2qrcZFskpDfjta8G0x/u2x+IJ7Wju8qtyx0QcWA+6FT5usxNDnbj98Z1 28gUgigLcmd+AMvcGzPwJ81I9g2olUeBkDozan0pc5hv+FXtTWLr+EtWpySwSdt0Yegw rwI0GLfwQTSKIb8eFcMfJ/oJ2niFBpDN1PA+2IHM+BScfAaE3/yC10dMPk049FQ9Sfb/ cZjw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Hi+nV0ob; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020aa79d03000000b006513fe5673csi6527032pfp.169.2023.06.06.00.42.25; Tue, 06 Jun 2023 00:42:38 -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=@Nvidia.com header.s=selector2 header.b=Hi+nV0ob; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236056AbjFFHRi (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234251AbjFFHR0 (ORCPT ); Tue, 6 Jun 2023 03:17:26 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03117E40; Tue, 6 Jun 2023 00:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEXPRkzoIgjMzndqE1RUdfl2XnWEZqAjORlniVPU869eqFXj4kUzllquY/EfQ1OVtUWIW5buxT1BV0m0ViirL2Wn6m6XAY6cUTWseq7DEr8KOBxnAjuM+v0Gda20M9FH5tszuzu1FmNr7UJXpfhR7G2icJH43wx+zKWGS058e4ssUwd9HOnq+5JKYtQpNxEQYYeknTV1xqphABBQiKQ50NS06ojEh0bCCre28Aich1dj6vYE14U+s/Ei3faUoJctQrw0mcHnDpHL59boRJorAzG2cq2Ehq9r6NYh/JR5ui6RSCIbcrF6+8GlxmvBCujPmLcFJxiwrZXlYqEZ8nNFyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R/GcSFki6gkb8xdTqFtxT9LuvcMcqdER4egYKBl3qMs=; b=O54/TtuCLmvck9N6s1wKQT8k+Yl2Vh9ZCgR4kGa1tQDhzUHomLiNzUo/B0VJ13gyU3z6kGPabYr5shG4zgZIZMksyXhnp1H4zMUXd2djHX9o8EPLGO1SyulmijMxcnSNsfx/ci8N+a+P3dBhgJ1fGBtgC/SjAtukLSK7rdYgz+Dz6zaIHt4eot0UIJzc5k+3n1nP0G/7svW9aVie7WpX48FbisevmRVPtQfNh6cFFEdDg4QignmV22w4JED6/VLXfvu3Ou6pEfP5AegL9aCLynai3+7rG7ivqqbh8gadxLbPqavwdp2pAPNlgJRB+C/MxpsfeC3vyPFVWJAh8HC2DA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R/GcSFki6gkb8xdTqFtxT9LuvcMcqdER4egYKBl3qMs=; b=Hi+nV0obGlmHQFbDWCV9hcFJ/8lvPTd8gxq4mxIKJHEyWeVOKDiSQY82AQgqJqm7RQ6dKvjy0ZOJ7N9Y/YQzfZICz/1Ymd2boHtaUaeU3zSCicKZDU28TDPR0Cnxl4/bDpSEd+DV3c7Vx36ABBkHtF/LpLg4IVTTGL0EjR1Av+G9GSTF4QRe6XaHHhV0bxTXfsuHxST0JOG7Gdz6LlYFv3Vy6QLSppS0ZerxVDiA1OCUvFFf1Ng0PWT8O0yCtv8lcwcKeYiilINkVPid8/2+/07/PeCOYOmZQ5cCVLvrj11zmRtTF94YR8WoplWe31Le2zGvB1Km+sQeubm/Nej+cg== Received: from DS7PR03CA0275.namprd03.prod.outlook.com (2603:10b6:5:3ad::10) by IA1PR12MB7567.namprd12.prod.outlook.com (2603:10b6:208:42d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:23 +0000 Received: from DM6NAM11FT086.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ad:cafe::ca) by DS7PR03CA0275.outlook.office365.com (2603:10b6:5:3ad::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT086.mail.protection.outlook.com (10.13.173.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:22 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:09 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:09 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:09 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 03/11] selftests/mm: fix "warning: expression which evaluates to zero..." in mlock2-tests.c Date: Tue, 6 Jun 2023 00:16:29 -0700 Message-ID: <20230606071637.267103-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT086:EE_|IA1PR12MB7567:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e8f41c8-e515-4892-ca0d-08db665e12b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wyMDwNmntgWoMJ5IwDjBrm5greNtHe+auxXOO3XhLmG7XX/UDDofLluMBXhWUCF/cmSc30oAG4Vr42qwJZO+sbnKXYAklTDXPMKUn3rx2X9kZfZ18hkoGysQIdoMNjQTz4/Xt2jLEz1H83AyWfJyWDB4VlqTBBElZZbLQjqMQE1r2tAgjRepHATcK1x0hzF/7V+ifze4RSHNad7r7JIBqBullWBzZ+o5Gn37WAfC8ZRuPtNegIH2oQGvd7+IYUgGC5V5j0qy+CfSkNvDog3cAkc6OAGB555zwZqRxH1MukhmWwQfItbsHduXND7zmU4xeeY7gbjfyE8g6yZCg/yyhWXkAWbJfN67oNvvNi5fU1uu3UPNyjP3M1n83VKaqqOH19mXY6uM9K83C7dE0u0lKcHsqUcMmo9/WmfgNZ+rF5OpkEO1xfgkYz3eHzb1GRN8NzHO73Lh+/kUCcMvPNHB21tF7TZwaiR6fvuhMTMTu7n/HObHhS2Uk+O1Sa6wtwNk64H752H1kM06kmRmgsFqFx6/sVZSBbTzBwgHjmzxzDIGbVhM8mkS+dAlVU1COpdydGca7uFO/qbhOkjmZvyGjskENdtGX6djwxjD8/bYpGH6QZ5OQuW7o6Y8i/lx9F/AGLpDpJSLfpm2lgN+gkAGEwJoDZKfNEZHwIg20kcN3uQUj2kg++1Yk9Nf2W0MkpwQaGxOsX2lndX+5fcP4A2VyPNaAYMzEhRIml/pWsdSsUeoMfsrSR1XDIgs5vCSbDsF X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(26005)(1076003)(40460700003)(107886003)(40480700001)(36860700001)(36756003)(47076005)(83380400001)(426003)(336012)(86362001)(82310400005)(356005)(2616005)(7636003)(186003)(82740400003)(8936002)(41300700001)(54906003)(2906002)(478600001)(70586007)(70206006)(8676002)(6916009)(4744005)(4326008)(316002)(5660300002)(7696005)(6666004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:22.8226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e8f41c8-e515-4892-ca0d-08db665e12b3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT086.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7567 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767938309151007365?= X-GMAIL-MSGID: =?utf-8?q?1767938309151007365?= The stop variable is a char*, and the code was assigning a char value to it. This was generating a warning when compiling with clang. However, as both David and Peter pointed out, stop is not even used after the problematic assignment to a char type. So just delete that line entirely. Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mlock2-tests.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c index 11b2301f3aa3..80cddc0de206 100644 --- a/tools/testing/selftests/mm/mlock2-tests.c +++ b/tools/testing/selftests/mm/mlock2-tests.c @@ -50,7 +50,6 @@ static int get_vm_area(unsigned long addr, struct vm_boundaries *area) printf("cannot parse /proc/self/maps\n"); goto out; } - stop = '\0'; sscanf(line, "%lx", &start); sscanf(end_addr, "%lx", &end); From patchwork Tue Jun 6 07:16:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103593 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3204248vqr; Tue, 6 Jun 2023 00:19:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6h2ZTWyq14XcAWihQHCFlfBoTuS5THPVjojfvfNc9wnj0ILV6KF1sHlKGxztBMAmAM7ft1 X-Received: by 2002:a05:6870:c785:b0:195:fbd7:a999 with SMTP id dy5-20020a056870c78500b00195fbd7a999mr1541655oab.59.1686035980699; Tue, 06 Jun 2023 00:19:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686035980; cv=pass; d=google.com; s=arc-20160816; b=O3ujjZfqycZuanvqrG+eNcdFjHSDbntXMEdFE1skMueLmJ2ni3DjghSe/d4O6P+zsE sDgfyrqCcrDrLwaBflKwYKte3HdKqEsTGQtClo1fgHlAXoylhsZPh0e2q/rIv1QSta62 yfVRUnwnqsBJLYBsUPgYOo6PsYjYbI+0r9nwfu2nWjl/TzgpWQ5pfkuu998jQmBTA7NR CofWBsmLgwx8aJP/41U4rBFBwpQn0HhIUNB/ci4DQPHm3mThrgK8y7jWMICV7cHZ+A4e Ba9IHnIJKKZQSLZ5Kj7IJkboGeTSGuGwPSt3CbdekYNDeZB8xogeBl9MUzIZROieYFnR K3tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cvdHBj5yApv+3mwcH6LWSMXJlHljQnJdtS4CV2ZOt8I=; b=IQTGT/l9qQrOoS8sNYx1mQSIfWf+yP12FgTbIlNdwl6MnvukBSUSl+NtwibSbCxBUu vgYpjhArQDciEb/fcZ/Zndiy0uMfZKCKauqDIuD4USrK8q/lNp//ZWd+aFi15kMIkohy dl91ZEjKsURYiZ0LLIzptQFhKdLSFh/fUAKdMhPiW95ZhzuueIcnPRsJRX5qUURhndit eknJ0MJHEf+qQZ/TYrIQ2mVChzzRcpg3eyVJvIvMqxHy8PHtLFcKY8bATqD6B/ZAl/Qx R9wS89EROQQ+kWh0ST4Ai/YlrX9eBOcDoYy7RI8CaBQsdZFyRGQR3aaqcx+j/P1stuCO jV7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=hnOtLnQI; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a170902ed4200b001aadba392c1si6615602plb.464.2023.06.06.00.19.28; Tue, 06 Jun 2023 00:19:40 -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=@Nvidia.com header.s=selector2 header.b=hnOtLnQI; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234654AbjFFHR2 (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232402AbjFFHRZ (ORCPT ); Tue, 6 Jun 2023 03:17:25 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C59B109; Tue, 6 Jun 2023 00:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SKCZpwPZn23qi/s//HrklUidi1cZTg+OFkOTTb6LLuNjErtxW09Q8rwbsLq6opHL7SDr266v+BpzJeTRp5iX4/lo6441Nc38GPSRS0FKYWIR0B6JXSnxhcL6FtfSepErTzWbOkf3RfawIllKqXRTNJULh23HJqR6pAMkrkHVONJrkJ8Ome9RHu1VG6NOggFgUTVHuGQpwOWhNSAvgnVw5fHQaRgDJRZgEDuJhIjlGip+NuERnINk+siIDs7VT/Pt0v3sjBKAMDGj/NRzmBr1T6gPhu5QI9M1DU15RUCyIcgRshZM9n18lubdZvL1HJdIIZv5xK6DzcdwPqfv6pp/Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cvdHBj5yApv+3mwcH6LWSMXJlHljQnJdtS4CV2ZOt8I=; b=cZjPNHv3lFsL80EkUAoVmgtV9Y1ajms0ffTe/M7tRc3CqusyPIAWgfMR/YN9nYu5eFqXZzuPk5zEyHpT5gX5AuxgZpI05Wp/Qf/RDa2GVXm5TUmKMdpplKVynpWKgp4zEx6Thub6Yc6EqFwXUCG1t/o0HARpupRpTIpBjDJUoQB3B/73F+v0qlhHxl/S4mVhlfsvAiMObufKlIYh6NSbGTJ/n1EYZFkhk4lFwbZEOx+lN5HrVtYmCogoSPU4TfYst0+FPOQXtpzHsJV/84jF7zli/DTS3IKZE9ofmm1A+EpPcm1NocLc0GxxD6a5yMRFhNYqmlsIAvL7LR7UwY8bTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cvdHBj5yApv+3mwcH6LWSMXJlHljQnJdtS4CV2ZOt8I=; b=hnOtLnQIeaBIonQjlIzuBxnpVe/Mj5harWLyrSeykRmLLQcA+b8fyuvpBU30IW7k7b4huCaOFjndaDY0+HUEpt3rHVBNSN4ikjAIz14AfQEXZCKL4xVzuHb5BtyGTHLZTRTDKs3ymrMEWApL8LrpJ0UKsyIyAxdoPE5DlgNcAsHDiGOoQe1yC/AYcvBAA6ayZBU+15Wdt/Zu0l8TeGfCvmxNx5C8eufdeNdXpZe5sgWy1gGhly6I8PrMDuNE0yOEtNdxTnTx+7fykL/hr0+hBGO6weSX0VipNfOSqlv2ng2HcvpdNmaSw1+Y2MSJMS1bfQLXUGEn6B8s+fSzms2MaA== Received: from BL1PR13CA0400.namprd13.prod.outlook.com (2603:10b6:208:2c2::15) by DM6PR12MB4340.namprd12.prod.outlook.com (2603:10b6:5:2a8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 6 Jun 2023 07:17:21 +0000 Received: from BL02EPF000145BB.namprd05.prod.outlook.com (2603:10b6:208:2c2:cafe::fd) by BL1PR13CA0400.outlook.office365.com (2603:10b6:208:2c2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Tue, 6 Jun 2023 07:17:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF000145BB.mail.protection.outlook.com (10.167.241.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.13 via Frontend Transport; Tue, 6 Jun 2023 07:17:21 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:10 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:09 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:09 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 04/11] selftests/mm: fix invocation of tests that are run via shell scripts Date: Tue, 6 Jun 2023 00:16:30 -0700 Message-ID: <20230606071637.267103-5-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145BB:EE_|DM6PR12MB4340:EE_ X-MS-Office365-Filtering-Correlation-Id: 555001b6-8227-4b16-534e-08db665e11d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tOxXSSCYbKiZAW8KhYwA//tOeeLektX4TyG4wkJRRv63fRRRNez/Kr0IWnUKT7BNwCP+PZ+bRfJyJ5wdEmQLS4YnhG6zJuhLLlK0rLdGZx5IAuI2jxuuO7g78qmPc5ZwaX4b3xxVHzeiarI77YScpsfP5ytdg8h7GfK01k9IbYS1d2SnRk3bAPhaowpHCa/Mj7tpC7YSN2g8eIFVb4E8srzEMd0wTSGXqLMpylHuoPVjXa/9Hcra8P90Pz9yziWdmkF5AQ/vUHmUNUtYsWP/qTpfoQRhP/CpsHOcYFog8X8APG7Lo9tBhkx2ER475JvcAywq7PTY399PIHMiEBRHrMV1ORij7KKYKfdi7CKF+Oc5n6PAGN37Vc7PSsmhtEcd+kfMwO67XrpTS2l00SR/H8T9wWx8dhpSRIcA/3z6B3pQc6X6QxPpoXoOXDyFLJvaW/5dh6inaK6ploMWuG6DAY7uQglcT+3XmoLGfBj4a2n1RBD726FfyJRguRYNlCUk0BVm5q8gvu5VHBbLc5z1sJYUJNa87mxkMF8YtEETATIKgbqsb/iEaRF39unYwe8RWiSN6BNDZsIPcb4zdeT8j27tIODkT3ahWoA3Z6KcUbIfcmBRfZv47T7eBpLdxECg7wcaKi03nhDi8NlzBUcbjh/QM+/AYMDxSIFAYLtQ9AMo/v9OwHpiw7bftd/wA8zC382vn5bIyYtTYnVXMQ8QVMM1JGMeub/ogvtC2213ICFIOdtQAmaiLVrw5y63gaNl X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(26005)(82740400003)(70206006)(70586007)(356005)(7636003)(6916009)(4326008)(7696005)(336012)(47076005)(36860700001)(83380400001)(82310400005)(478600001)(426003)(2616005)(6666004)(36756003)(2906002)(40460700003)(1076003)(41300700001)(40480700001)(8676002)(316002)(54906003)(8936002)(86362001)(5660300002)(186003)(107886003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:21.3046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 555001b6-8227-4b16-534e-08db665e11d3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145BB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4340 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767936864334294084?= X-GMAIL-MSGID: =?utf-8?q?1767936864334294084?= We cannot depend upon git to reliably retain the executable bit on shell scripts, or so I was told several years ago while working on this same run_vmtests.sh script. And sure enough, things such as test_hmm.sh are lately failing to run, due to lacking execute permissions. Fix this by explicitly adding "bash" to each of the shell script invocations. Leave fixing the overall approach to another day. Acked-by: David Hildenbrand Cc: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/run_vmtests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 4893eb60d96d..8f81432e4bac 100644 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -242,18 +242,18 @@ if [ $VADDR64 -ne 0 ]; then if [ "$ARCH" == "$ARCH_ARM64" ]; then echo 6 > /proc/sys/vm/nr_hugepages fi - CATEGORY="hugevm" run_test ./va_high_addr_switch.sh + CATEGORY="hugevm" run_test bash ./va_high_addr_switch.sh if [ "$ARCH" == "$ARCH_ARM64" ]; then echo $prev_nr_hugepages > /proc/sys/vm/nr_hugepages fi fi # VADDR64 # vmalloc stability smoke test -CATEGORY="vmalloc" run_test ./test_vmalloc.sh smoke +CATEGORY="vmalloc" run_test bash ./test_vmalloc.sh smoke CATEGORY="mremap" run_test ./mremap_dontunmap -CATEGORY="hmm" run_test ./test_hmm.sh smoke +CATEGORY="hmm" run_test bash ./test_hmm.sh smoke # MADV_POPULATE_READ and MADV_POPULATE_WRITE tests CATEGORY="madv_populate" run_test ./madv_populate From patchwork Tue Jun 6 07:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3205415vqr; Tue, 6 Jun 2023 00:22:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7c2fPyv1JVYPKNlrAwqvN+QS1t0OH+53wRiBWKT36NrpxwN13Cizlb+zj+JObqGKJMuO9h X-Received: by 2002:a05:6214:f07:b0:5ef:8c79:fe88 with SMTP id gw7-20020a0562140f0700b005ef8c79fe88mr1596764qvb.2.1686036145509; Tue, 06 Jun 2023 00:22:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686036145; cv=pass; d=google.com; s=arc-20160816; b=p8gTcawtWp5RPnfzWYb4ygq2U3SMwh5HTHaL2XFk8soW1iHW5rdABKdBZpVCvKRCk9 XkPo5ipHfQKjgx1vyyNA9CGxlh31k/HI6VDwtUyma8AGT5gdzmW0lnKy89kFE8w9gP8+ gYo/Ub8f+fmiaRPDXwpggLEKrOe8V67tDZ7YltshmepBSSi4QQTtJsPUO4WC68Ynzd2l I0YuUyjM6/ZwgY4aQ2ARcZ5tz7PJyRbwV4k05Qm8AVZGl18lYN43H7ZVLO794USJo/bq rN/6WgHh6HsOthooH/7h19woiIXj2EXyJVQBN6R3yvQuocZhob56Ico9jwlf7qK3S1B9 N/Kg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IWs0ZFZtf9AA0eJlvMtGJJaItuLyGSP7UduhhCtkPQI=; b=Kypf61KJWWubpj4uRNRWIuiLZ/kTV/FbWIgJ62m35s7ijvRuQ0Lej1g+C87IpU6cHw Vd3CyxJnezQ9e9DAqp+dMdTVjs6BNl5yrCgJ9AzEiVmmwJGB4VjUDT15J34O1ofGPm4F lJ2MI10ZNseJAtUBBdcq4Nen2R2AHn/7jZmn+qnXFHtx0bSYj0r6uV0Mn7poFT2/TSOS BVcuEP58ehenR+R3BjScYYE2UBRanr5QkFSgkQoUag6ZJ/EjD7koOXWqUVRPyOZkCWhF 1zEfCQnpEfk7yh//bi5MV2P5MRSoNZvUb4abjUNapGIM/4DBr3W8yKTthyo8zouGKTcl rggA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=FrW8qq3i; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a056214062200b00623821414cesi5747413qvx.284.2023.06.06.00.22.11; Tue, 06 Jun 2023 00:22:25 -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=@Nvidia.com header.s=selector2 header.b=FrW8qq3i; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235798AbjFFHRt (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234565AbjFFHR1 (ORCPT ); Tue, 6 Jun 2023 03:17:27 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0B8FF3; Tue, 6 Jun 2023 00:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fTzKPtksKGppwYgNWWe1FnduuQ0yXglnqHnyT3qE4dn1WY+ZTubxBcP3CHQnITDpbME5WH30ulZgFLSfuGQIdgr/WVWxCWvZRtroqnOQiQCS/Y91s0wnPIZ+a38LMXgsOvSvmvYL+4bv4PBgfTBSg66PCYIeAKNM5Yu7CWeZeOqET13quCMSpq82RhZJyekY+zdMvFT8aXd1GiSi0TH0bTKbJ+rTD+iZZekvhdo2Ot0DVQCYrvMiU4LfLD3uT26VAA3NCwFEQfhzd+fwVyQ7S8szw+x1mEeb6BwLhzRzToQDZYL2mgtx9ftUx5hGm7ZCf8tue79EQ5ixl/mVXdQO/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IWs0ZFZtf9AA0eJlvMtGJJaItuLyGSP7UduhhCtkPQI=; b=d4pQJfcB9EZrz/3udttBRs0BF/oiiT324V01U14USktRmcCSk38wYbTzMmyeGU1ilO0mX7s7J53F/7/IJxZMYr3/eenowtCBSgMBRHlU7LIEzXFR9KWTeaGmgYf6CGF33g6oZGgQ+R/FiHJv9tR8RFKF+3jEX+y0+4k3bUI2F0Df8zzmW9qlMWc15NqNmMPSIINQjoFlKpoeZGvJHqQwfIMnlyeTBbYG1HlBFG305vUZvFpGA5EOpLLcjaD3WJSFzKxk60kjRgHZtQ4SvlYf8hJ508uU8nQXz25YyXji71n3wnerNeEbYrNceuJdGeyoJvXax2b6V/d9UIZVW2g86w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IWs0ZFZtf9AA0eJlvMtGJJaItuLyGSP7UduhhCtkPQI=; b=FrW8qq3iIniRhOKjcrMk+tI9RGdFsQuV9jHdARaFNWwo9wZ/EJ7BvyuyWCKCwYL4hff2JLyo9B2RZ7h+Txiflt3FA/W3Ru6yg+RtXPSFc2LOHZy4eJWdUv6jxiuCjdMJaJ5NZ4ScNUuTMV+iFhlBDx9F4kHLzbkKNC4UO3yfBfqleI2chzAyBbdk/jvNebgEl7czaEX5utv8UVj/hN3SLBza2PtUPbzWoygCaZWRMfuxvswaipFvsPP9DGq7Uu+59r5iadLnlgNTYr8eX3PkzP2q20yCz/kpQuwy3Zk6sZL2I4VXpzqC/llXRGbSEu4M1alYLt43K+5c/XWMDT4RYg== Received: from DM6PR06CA0020.namprd06.prod.outlook.com (2603:10b6:5:120::33) by SA3PR12MB9160.namprd12.prod.outlook.com (2603:10b6:806:399::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:23 +0000 Received: from DM6NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::b) by DM6PR06CA0020.outlook.office365.com (2603:10b6:5:120::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT047.mail.protection.outlook.com (10.13.172.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:23 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:10 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:10 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:09 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 05/11] selftests/mm: .gitignore: add mkdirty, va_high_addr_switch Date: Tue, 6 Jun 2023 00:16:31 -0700 Message-ID: <20230606071637.267103-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT047:EE_|SA3PR12MB9160:EE_ X-MS-Office365-Filtering-Correlation-Id: abbf8a5a-5236-4074-5695-08db665e12e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7I+GSKEN71Z+WjprJLpX5AT6QOgRc9tEb+m3Jh2/YvridkV0KJH+oN3dxX8mWSEdL+XiCD81a6YTBk8jsLaASgOfJRh0YphOxGrfvrX4tcnEc0pQpK2CiozxaPB0eE+onZ9oVKcYpaaTto7pvTX/u7dh/CI57D7OPagcuQOsk+fJ+lsRqAMtYrXmvDU2WtWkn5M7IiPz17UySWU2wKKiiWl7WPXGPd2eDuSF7dgh+LsNJSpfhfeE+EVt9mu0E8Nw1H6qfj3XZp1ZakUKvNhodCgVXRc+G4cunVnfZSuSkK9hZOoGLg3FgYIdKrWdyE1jRphSvZ472okpOVUeIPH1ARfIxheOprWXI8SgunEQu+xXInuiZS3laKPNxUTEb3GL2TU7CSu0K4gGQFkzv9wzU5dGXNqKftpoakp5RCEft9MYvUsTlwn9L6N6mDahljObAnzfvtLKsVPMgH/raj0Et1zGoSA6OnnSXn3snbNd5iENJj7mCS/mSzzUArYndNq8HN4Bip95U/c6MHFvmDuHm0T4UKhsyWIJOQ1BFpl4seN2Ey5fkmFEuo8qoK/K+FigGOerucipMS6dtF99VnFiNvrNxpRb5hot+ZdfaxoVrmThBGJh+G7eTCQm+Dcknk/wO59YLBjxf6eAVI7A8RE11C2XSo1Flt3O5+Va9ukRg1WziyirZoctvXefFwvICMfmRRyQLy+tNj8S1wrlCf4SgURycBKhCnOHqA96cSc3Vq33xAt4H0C3x06G9nqd7514 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199021)(40470700004)(46966006)(36840700001)(107886003)(1076003)(186003)(26005)(2616005)(426003)(336012)(47076005)(36756003)(6666004)(36860700001)(54906003)(82310400005)(7696005)(4744005)(2906002)(8676002)(8936002)(82740400003)(40480700001)(478600001)(40460700003)(6916009)(5660300002)(86362001)(4326008)(7636003)(41300700001)(316002)(70586007)(356005)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:23.1695 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: abbf8a5a-5236-4074-5695-08db665e12e6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9160 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767937037286206434?= X-GMAIL-MSGID: =?utf-8?q?1767937037286206434?= These new build products were left out of .gitignore, so add them now. Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore index 8917455f4f51..ab215303d8e9 100644 --- a/tools/testing/selftests/mm/.gitignore +++ b/tools/testing/selftests/mm/.gitignore @@ -39,3 +39,5 @@ local_config.h local_config.mk ksm_functional_tests mdwe_test +mkdirty +va_high_addr_switch \ No newline at end of file From patchwork Tue Jun 6 07:16:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103599 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3206698vqr; Tue, 6 Jun 2023 00:25:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6a4oUoaNmV/ro4rBn3ibDvlZ8Ayu1kxJepXXJmCN7JCVYeasshpbvv9SbHCRXix3XDio3a X-Received: by 2002:a05:6a00:984:b0:640:defd:a6d5 with SMTP id u4-20020a056a00098400b00640defda6d5mr773989pfg.12.1686036330448; Tue, 06 Jun 2023 00:25:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686036330; cv=pass; d=google.com; s=arc-20160816; b=Lqt2smWKN/nqFPCCj+fxcF11goKjBqxrgaO3OGjzqCWabn8ODkWc9an+oz/AuIUUTA mWSrN/P7/mIAyjRJRVRgHlD4ThGVM4SATWrq8AOjKUd2lYtJUHopHQ1y1/AyaifN8DxN p5XF5vuDIy7pQixGrGnXNt03gUEmpIAbPRbOsN/9aSpnESk3sJxNrcRHRf19z1kQHWqi HNYEK+trluoXYX5wg3aOmSciDrPxSm7K8LjGhVb2JkVSqJWibquKGh7uc0M9JWUT+dVp AxU+GxNOg6PUMumTyIGqRS2ioWf6thIQ0jIce7qkh+oPnH/NiNZxzzd79vfPRphJtvAw +dAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MOpTW35hPW9iKOEt96WhLvNwMqiGhAYImrqLsr3Vsz0=; b=gO4Niwu9mViujFVE2rT7XU5nGGXrnzpgRsxmGKbMvCReGTzbkY4LuMKgDCryNAafNy fc45kF+JWJ4oLBbnEEXNoKyS5lhFOH7eJwpeewiSjarrAtNoT9PWy4Jp/Gq2zwjTdaBx dUBChGuiT4zPJAjxe4JF6l/nLKXcFPjtbAHuoLv8g4Z58XKInZP503YDtxIOT10/0m4C +zbnXZMaEUjjaPCEjYgAbgfbnUGVUt76SAtXh5PT3Mv1+ryqBgS0OYNGDeRZjrwQ56IX ag7jJ8sNKdrIc9FBVXuozf5r5YO09XmKAmCFb8UhIgihnnhENmEpNy8SHjd1atEoxXnL pDzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Cs3xjVBj; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020aa79a41000000b0065b34dd28c4si2840570pfj.330.2023.06.06.00.25.17; Tue, 06 Jun 2023 00:25:30 -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=@Nvidia.com header.s=selector2 header.b=Cs3xjVBj; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236014AbjFFHRp (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234581AbjFFHR1 (ORCPT ); Tue, 6 Jun 2023 03:17:27 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20616.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::616]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ECEE109; Tue, 6 Jun 2023 00:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JLzHpO/KXQOAkH4m0DUEyVWY884g1hehCucOwsW4gQLKd1TrKX1TzwQMkIU5Rcwbk3fmjVo1n8PWsbg5mT8vyxSJ0HjFDxfhs2iG7LOS0/ukDlZfP1soyOeVk9vJ43if+KBo7zWxuej/V/lUMjKNvlfCLhzJKdbPhUKP8CJzobN6uUvsZpYV6bjtLZbZz5Aull/hedpLQNGoWwPGCb5kPNFjoatbk8FGylHw/mNVss9jsj51qdDF7ubqtWlVnvpb3zlG8llD7gpRJOwEYtqlriR/f4xPFcD8mrJSUJ/Gwtsefb2Sp0dzZEmkNAx8wZYHNdHitvRK6koj98b3he4Ilg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MOpTW35hPW9iKOEt96WhLvNwMqiGhAYImrqLsr3Vsz0=; b=GIFcumYKROG5l85+lZaLd1PeTULqcs5ZstCyHrNlw/13MOCxEwH3kxKMuJvNYspuNEwuWIpfIo7fAu7G+zPJCVw1iIzCRSHKsfchtYzs6EpJ+S7uaK6JjYAqBeECN5d7REcLniJosvBFVb4lvkVWPS/CYnV4i/70nPo7G6NPGdzBfw+F4mST3HSBtDaDBsvMzwqTyeVBY77Fy57Ty7rdkN3NUqS4T4vJOQ6Q/Az7me4MzS9puxHHio7+KoyK6KTQGCPx6ultGWGIgVS4MbvGoczX9X87uOGgoM8fQ65VpO4p444yWm7l2EjdgGbvHSKnrI7vBRU8nO30XpkSdV7Lyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MOpTW35hPW9iKOEt96WhLvNwMqiGhAYImrqLsr3Vsz0=; b=Cs3xjVBjMmPXKiGLvPsh82s1bxhDN7I+k1gUClbRmrPKFtiLSTgv+/Hn+vEF+hgOKubmKrJp8ss5sR/B73C8X1qXOrLpnv3FM+U2LfXiLbWsscKRjBm20WpEMG/Ag/JoHVgel3HfBAqRsxZ9k3y1CXKz1H9HwO8z1L9WhO+rCFz4pRR4OUfr0QPuMpk5swbYH/BAri98zXConkg8Be8dSYAfzwr2bTeMopJ8aFJIk+ex9fqFe3bqFhDa9tptkviz7pmkKIiMVyztGJsnGNbdyDxfki8e+CRuHfMTT0PZ6VDJcTiEkqRRqGzoPvU1KOQZ9JSij75OepNMLlIt1zqgdw== Received: from BN9PR03CA0685.namprd03.prod.outlook.com (2603:10b6:408:10e::30) by SA1PR12MB5614.namprd12.prod.outlook.com (2603:10b6:806:228::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:23 +0000 Received: from BL02EPF000145B9.namprd05.prod.outlook.com (2603:10b6:408:10e:cafe::a8) by BN9PR03CA0685.outlook.office365.com (2603:10b6:408:10e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF000145B9.mail.protection.outlook.com (10.167.241.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.13 via Frontend Transport; Tue, 6 Jun 2023 07:17:22 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:10 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:10 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:10 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 06/11] selftests/mm: fix two -Wformat-security warnings in uffd builds Date: Tue, 6 Jun 2023 00:16:32 -0700 Message-ID: <20230606071637.267103-7-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145B9:EE_|SA1PR12MB5614:EE_ X-MS-Office365-Filtering-Correlation-Id: 08de86af-7f0e-47fa-dd20-08db665e12c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QvkjZ2c9IwzdJR78K2sjoTyO6arPk17BGxnWAkDm4+oEKD9TigllXXB/EIULxdNFm4RncZV5vH2TPVRlDzLGfAOb1dmzBMhVt3j2f2qzKY6PVnBW8tHqN93DyBcqaQVLz7wNRfHD7tJ0HU2Cts1exe6+DO8dPhj614BUTS+e49ERhXpvMgNxWFb5YFKrPHE/ZaqSUtTcCVw2UuteGYofliUAPD6ko+orjjiXzenHmEG0IP+u6aWA2OvbarLCFglFQ5nhi71Oe3IAXG7maRKDik/84K+PcHiPuq2U4/h4sX48oTWZJ7RWLunwbtyByxlLy6qimvyGSnUWa4UxzZ0ERHsSYcrg4ymuQ5gLbb8tQP98vygTpMGNuCyT4OfkOogW1e/z498wKGac1tEdf3hiPQMeBJ2i4F/4AVJok9j/u2h7MKZ8fHYZirkrmgq2UJYs3WeVmQKN7m4Hx8IBntoGXU/P+2v82YfdYb3tb1lx9WoK5DeoeO90k5XVz3Ba2538uWG39Twm3drLdJO1YEYa1mcVhOsdGmaHDN6IuGHXtzCUrVdecULDXdl9QYNCF3V4+J0FDOP5T4DZcN6+1MwDNncXfONyIvIQDqt1BB81omK4HC7VPh9Ca3qSfqxJjY/Nu/nbYZ9SpwjAN4JRPyWY0glVNxV2oWuj+HnprkOLri8tN8kKOxZjt9iUz4akXbsB+xBPpINXhIqBp4iCtdf1bf76aqmiupk7z2MC6EdDUZX0y6nVPc3DkTXYr87WgKcP X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199021)(36840700001)(46966006)(40470700004)(40460700003)(426003)(336012)(2906002)(47076005)(83380400001)(2616005)(36756003)(82310400005)(86362001)(356005)(82740400003)(7636003)(36860700001)(40480700001)(7696005)(41300700001)(316002)(6666004)(5660300002)(107886003)(8936002)(8676002)(54906003)(478600001)(70206006)(4326008)(70586007)(26005)(1076003)(15650500001)(6916009)(186003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:22.9007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08de86af-7f0e-47fa-dd20-08db665e12c6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145B9.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5614 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767937231202351981?= X-GMAIL-MSGID: =?utf-8?q?1767937231202351981?= The uffd tests generate two compile time warnings from clang's -Wformat-security setting. These trigger at the call sites for uffd_test_start() and uffd_test_skip(). 1) Fix the uffd_test_start() issue by removing the intermediate test_name variable (thanks to David Hildenbrand for showing how to do this). 2) Fix the uffd_test_skip() issue by observing that there is no need for a macro and a variable args approach, because all callers of uffd_test_skip() pass in a simple char* string, without any format specifiers. So just change uffd_test_skip() into a regular C function. Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-unit-tests.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index 269c86768a02..04d91f144d1c 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -109,12 +109,11 @@ static void uffd_test_pass(void) ksft_inc_fail_cnt(); \ } while (0) -#define uffd_test_skip(...) do { \ - printf("skipped [reason: "); \ - printf(__VA_ARGS__); \ - printf("]\n"); \ - ksft_inc_xskip_cnt(); \ - } while (0) +static void uffd_test_skip(const char *message) +{ + printf("skipped [reason: %s]\n", message); + ksft_inc_xskip_cnt(); +} /* * Returns 1 if specific userfaultfd supported, 0 otherwise. Note, we'll @@ -1149,7 +1148,6 @@ int main(int argc, char *argv[]) uffd_test_case_t *test; mem_type_t *mem_type; uffd_test_args_t args; - char test_name[128]; const char *errmsg; int has_uffd, opt; int i, j; @@ -1192,10 +1190,8 @@ int main(int argc, char *argv[]) mem_type = &mem_types[j]; if (!(test->mem_targets & mem_type->mem_flag)) continue; - snprintf(test_name, sizeof(test_name), - "%s on %s", test->name, mem_type->name); - uffd_test_start(test_name); + uffd_test_start("%s on %s", test->name, mem_type->name); if (!uffd_feature_supported(test)) { uffd_test_skip("feature missing"); continue; From patchwork Tue Jun 6 07:16:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103610 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3213897vqr; Tue, 6 Jun 2023 00:42:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7zsIvYF9ddQVbZnGZqppbpd+HYaCauvWx2KifYoNI2eV2+kPIgJTpN33FRZHNCYQ69UrNu X-Received: by 2002:a25:b903:0:b0:bac:a1c1:d77b with SMTP id x3-20020a25b903000000b00baca1c1d77bmr1239028ybj.45.1686037353569; Tue, 06 Jun 2023 00:42:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686037353; cv=pass; d=google.com; s=arc-20160816; b=zxjYVvgD1QGRHVBt0l2fFo1eTGiyI9G06++vZWxNRhv7fLeyx98ocrEFLMSv1vrSiA kc0qlC5Lo/gVcKppUiEC4IC2kaIkXqjgN3PpEKhDCtpZzOKEzxKAVb7s8lXDIteTlee2 Eu7Ad7xPtuX5wI/A+pydAvJzNMIOge3NctHplFiGBZjACvt17Gu8nKdEGLYwcfgo1B+t Iud9O+Bg+kLx+lmKNLh9vqwFUyGjTk7fD3m/DfOgdXJ25+rHtq5mM4mW7P9f3MhqgB1Z mtdHcSUE/DwesYloLQZ3bHOXnDFJADN4hLFdAGDn6t792U3IbnLIjSiQFN3F8+mc5X0U 77ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NAgHsicGbXE7/y+61Ec/TG4fp5QK6NCUPay76C4Qy/s=; b=d2OuQO7DQkfhS6Bu2CytgAZ+SxrkWV0PpSR8un8Ah5nh7t/WJP0A7W4B7t2MsMRgWX yyDr4njsCWvybX0LflksIGYSYnsJwrR9aYj7/SYMZ3NkFxsVwqxqPuUsCS9BOqbnxrvU oA17pNghMWnaU9YNlM78J15WlbCXo2XBNrYvS0RxLE6oSCqnVBCIuaf++AW/9uK9rMCb PBDKkdqZey22lNL3U4BeqctxZneDmIiYrb+9dYC2YNCSSQyAIO3gi8qY1eilhOkbZzLX 9zVhkSCVO+wD93UOdNcsvgn294I4xWXkxLiGlk1zvtehwYte8IfoPMqn8NCIku7AcGaZ +1Gw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=EeVZOxCm; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a17090341d000b001b23d4573b4si191664ple.4.2023.06.06.00.42.21; Tue, 06 Jun 2023 00:42:33 -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=@Nvidia.com header.s=selector2 header.b=EeVZOxCm; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236184AbjFFHSK (ORCPT + 99 others); Tue, 6 Jun 2023 03:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235189AbjFFHRa (ORCPT ); Tue, 6 Jun 2023 03:17:30 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2054.outbound.protection.outlook.com [40.107.93.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3002A1AD; Tue, 6 Jun 2023 00:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EtD5DMcRtax3IhhQMIiE+vjeICL1EGPrTF6//Ttjq+NjVcqCvGP5DvjDXlk1pgUlgmpzhEYGqTTcjdlco2fQaE++QPgSuHAMlM91cKauLkEbvc1hhnXyzGk7wGUap6MxfAZduCopL2OGc4hY2Yj867oXaLFuRRGkk2lXJtZ03VtiXorUAVzwfkMWHTOcGCqmVwWrw/tHHXb16w0x8GPnGVTwjYBR5Xqqn3VWcE6B8049AVf8DqtaI8POBvk5H7JV5Wx7WTRAOk5TMU70PCm+OP4NUZ8R2RX6ApUXpWlhcC065c5hjbBJLhcmu3IjvvlxsBgib6jQgoWpp4IvWZpVug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NAgHsicGbXE7/y+61Ec/TG4fp5QK6NCUPay76C4Qy/s=; b=OoAqg5tguFZ1vwtXW8FuZaE2JlIvRPT1vpl0EzfNtqkyx3yyxoEvBZZB/RYYtLzaUuA914TSGVc1k/A191Xa5qPVX0Zn3Q/PfG6oRCcvgX2cG+hKaGxARt3w5oCQWaYFqVbNCZ38yVTk35/u5umynqTbFFXUzYl63ej2kxEPcz1YaYUps5isAVI4Uqa1f1l8y83mN0/0/6uUu3w9a82CwfALELyiK5CmbHMQqID0Xo82/YmOYwZI8ITyl1VX8iR34W/txL2qoDwVzr5paYqWsokvYvHjslKXvhi3IfFFaBoB6tDTSx7TnUX7nH6YWX7eXt9anoEmIdU5wFmBzrMi/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NAgHsicGbXE7/y+61Ec/TG4fp5QK6NCUPay76C4Qy/s=; b=EeVZOxCmS8sCB9O2Pdq8KGt2pnC9CWFWrapoL4tF3K44KB4t1FvaCS+9H/id1MA9hkbYUX3sajszSdoRRqYmnQmJN24V9zI3PZKrS3oUuPZ9oO+mlsvyEeO9ExSKajaNHMaAtjKihFQbOJ7gl55HrfPLzRe+Fu+0zWSl2iCXHN10pX0oQt+bsYHsRmStF/mkCgdmVjxrzANQuh+9aKcbLJte1wfzxHCbgNy8UqVFoBwNzXxLztEigeCKAw5hlVkegso2z8EfmY4CPg2aoVnT6lzfxijMZuzb81/dhqa7YT5oCvL5ogBXZwvyQrWMJKFy/YysSzLd++0HQVjggtc0pA== Received: from DM6PR06CA0022.namprd06.prod.outlook.com (2603:10b6:5:120::35) by SJ2PR12MB8884.namprd12.prod.outlook.com (2603:10b6:a03:547::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:24 +0000 Received: from DM6NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::11) by DM6PR06CA0022.outlook.office365.com (2603:10b6:5:120::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT047.mail.protection.outlook.com (10.13.172.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:23 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:11 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:10 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:10 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 07/11] selftests/mm: fix a "possibly uninitialized" warning in pkey-x86.h Date: Tue, 6 Jun 2023 00:16:33 -0700 Message-ID: <20230606071637.267103-8-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT047:EE_|SJ2PR12MB8884:EE_ X-MS-Office365-Filtering-Correlation-Id: 87ba35a6-be00-4893-8c59-08db665e133e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qct1Q3zBkNF5cbSrqByrHcstcilf9UxsoJTgPw+u31leZzzB3/6kvsfFfRK9Rx5KOh63TvqNOcKvdQGCptalV8oDsUaURjr17phQcW4DzAP+k0oG6vKlVC+ekVobFgeik0YLDY0v/LUIDdjbumEgVLEK/PF40ss/sKmSo6QnrRWiEakQ0L5PF8iFiljulJnxWPa19jS9wB2PPUljWDT7wIpoGCu3g1vi8EMJg3N9EAD0WmnEb0hbuhV6MjPAG08GAmPKRLK/D4uNsqMuuSCEWJ1pcaDS3nVvi4VJ3n1L3Xre+iyOcdUkyweryQSSvG9+eJwcoudhbFolb7G6ACOoTvzQ1d9FDeZXGF/5hwXtt0OttvStUrUr9BdsubWNVdWRF+NlLZFqHaBy/4ExSLAeCfT7FLw98IVdRnOzbIJxaVPAbZJT8qRC2ZiHLSCUpC48/ENcxNBKyu+gI0mK1BLlXBomfSmy/K+6+QDS/Mj/bpOmhOYxg9LbLPIq2CepMRdbISBPn35yhQUkxOQvZpNJ4gHRDdgrAOVEnJZQ4/Ppn31gdXoa7+4YujMQiUIjqHLzqHNvbDNS4V6cG03udjjvQV/feMV6kEbuNjfOKRylBn84tOF/Jk2OAoATjNwYcoYU392ovx31jkpi22k+qp/5cGH5iuyqUtfAGXjm4DFBzqMJvKFcz2/gWv2pCNMFNQJGcwjGS3yvN3zUFxqk02w70XwjsYUHXDe+lVGHdkRYfnJpX+VsZLNKI7pAdlVt7Om7 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199021)(40470700004)(46966006)(36840700001)(82310400005)(47076005)(83380400001)(336012)(426003)(54906003)(478600001)(40480700001)(82740400003)(8676002)(8936002)(316002)(70206006)(70586007)(4326008)(356005)(7636003)(5660300002)(6916009)(40460700003)(41300700001)(86362001)(36756003)(6666004)(4744005)(2906002)(7696005)(36860700001)(107886003)(186003)(1076003)(26005)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:23.7319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87ba35a6-be00-4893-8c59-08db665e133e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8884 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767938304072819060?= X-GMAIL-MSGID: =?utf-8?q?1767938304072819060?= This fixes a real bug, too, because xstate_size() was assuming that the stack variable xstate_size was initialized to zero. That's not guaranteed nor even especially likely. Reviewed-by: David Hildenbrand Cc: Peter Xu Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pkey-x86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/pkey-x86.h b/tools/testing/selftests/mm/pkey-x86.h index 72c14cd3ddc7..e32ae8a1cd99 100644 --- a/tools/testing/selftests/mm/pkey-x86.h +++ b/tools/testing/selftests/mm/pkey-x86.h @@ -132,7 +132,7 @@ int pkey_reg_xstate_offset(void) unsigned int ecx; unsigned int edx; int xstate_offset; - int xstate_size; + int xstate_size = 0; unsigned long XSTATE_CPUID = 0xd; int leaf; From patchwork Tue Jun 6 07:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3213877vqr; Tue, 6 Jun 2023 00:42:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ez0X/PXLzW/hyZBDLWNTNC/GUUAuzI9o1UO97QuxRlVPGj4CeZkCvwktubc8GAD9sfxLg X-Received: by 2002:a9d:6746:0:b0:6b2:8f77:1423 with SMTP id w6-20020a9d6746000000b006b28f771423mr1401593otm.25.1686037351300; Tue, 06 Jun 2023 00:42:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686037351; cv=pass; d=google.com; s=arc-20160816; b=d812Py/JoXvMvg2vTk4lzBPPjB6nXL8JoOBL4Q0wqBcfIvz49EEoOwpdH6pUobxqdH 5yjQXOst7tnAVMoTvoreF4pDkGMTzJsqm19VWb0uD6M7A4NFBYocBvte9BJUyfkQZgWq PNkZa7H4F/STR07JFKhe5HUgx+BoQCmu4mDrlAEu22yZLNBh8Ea0g4GOIQGS33BEBlno /kl9uDayLkC2TVrYyEuizPm9IPfvfB+0G6SE5z5QH5uwL8pYed+/IrT/DEZ7Vp/5rC3C rGbPJMeSOPWpbhtb8k8eS2Jg+qEI7I34UvNSLamP5gsvTB5D+fz1K4V58WglTLJAg8E9 yT/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r7qWJ0iKcBH5AScsmOvvAEPpASsgJNPE7K/FjHHYXLU=; b=0iQbt3MTLa0M+ym8k7SCpQCU4fC1BC1k++hWPg1RCmGIsTqGhpq7rkCaiwKhaM3I89 V/LVSpdUakcKmyUTLVFhdhMJ2Wg0MTKxrRkSPG80m1gZltJq0BD1sD006QTVLHfNbbNl FeO8q2Yc3mhlSu8LmbTbVrGlVq61sLL6gD69JlTcqa7VK/cWtoKvUo8c/3IqNfJObhn/ Z0N4XTfZxifOJ2IaUool1Im+0AjyT2IXUyuac9f+saMnq4yApsu4c2QKFlaRC3dH8vNw JhgvwMn0vw2OMKDQFgyXZljF/gtl0X5S8DCwZyJgG6sz1TqL5b8bLOaBsh4u8GJGjyY0 xU1w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=jI5PQzww; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020aa79601000000b006536902d31fsi6649404pfg.185.2023.06.06.00.42.18; Tue, 06 Jun 2023 00:42:31 -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=@Nvidia.com header.s=selector2 header.b=jI5PQzww; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236142AbjFFHR4 (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234796AbjFFHR3 (ORCPT ); Tue, 6 Jun 2023 03:17:29 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2062.outbound.protection.outlook.com [40.107.223.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E50F118; Tue, 6 Jun 2023 00:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j2+CmJOknzOVObATngbCndj5iKnYErmTawNWfqhtSn6UXR0xtVj6v6/27vDdUVRAyerww5C5IIBBgCA5QsgY6lNcMdIRATW1vthSDHrRgY4zDN7Fa9tXXXcxmfvRAOk4LlP144MTFP9bHookg017VUw5tndB9+en0f0l10E+0OgCDrOPhGrJkOM4GUiJSX7h03Gw8YJZHCAKjHQqDoxKg2ygp8yKt+t5BKQYKnPNuQKxkRhgLhK758FjSevlKc1J69ZeB4VWzlEdYkuFrAjrcOxJ8kbWw4v5G/7UFnh1ZthqfODYmqZRtAvYvoyckh5TZLbS4QoLhAhNZV4UR8xeEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r7qWJ0iKcBH5AScsmOvvAEPpASsgJNPE7K/FjHHYXLU=; b=iC0EQvt+uC/D4dgHBveGWXP3WZMd6ueA2+hWS+Gguiv7sqSIHoFES0GqHPniw1yq4wzSTTxMgn5ry+yLenFNOm11ADBEZWiCVVDcmcJ9mZ1CrEeyZti4w3hKDjPpMdN23A+5fD/zcsqndoIC/bGDLftyT4QdZ63T4BHzZIi1xpJ0vkh3JXzZrRRBqUP068qU+cuDv/9cUXXqcQpvzbLX2pF1MFnK84j26Dc+pgRaXucz8xqN2LMblX78ncO5rn8oCENHVVwI4jxWA5ROMXRLopweWc/TADdW83Hzg1VDEFRNAbDg6/3MHwQGUWWFBrxsOy/sBkynZ9Dzw5BNK9xibg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r7qWJ0iKcBH5AScsmOvvAEPpASsgJNPE7K/FjHHYXLU=; b=jI5PQzww6bCAvu45bK6aiQuKfHqGm/DsQJ0YelBM0ekYCsleZAlUG0cnHtUdYAwa2YqkiWeO6QgvOtwKSWLmKRFTgQyLKMWi7ZoNGSM9kh8ludXQ3nZy7me5Il4H8GWaqpV2riffj8oVro5KITO6d7XftR6v+bcMSkRZRjeWCLlo2NuTDzxk4gV1J+o16FZkrQ9kDDRRMc2fbJ727O4275bpQu8Ys66mNtl+NoY5o8F7AqLs+/hmgQH8yquBGaXmcgaQ54Z6k06zv3QEUEaxCGEdFUVsmze0+znvny4IQgE/L4Xkt3hJfoqrzu584dC9nG9TXGps+iD/XchDeDY0eg== Received: from DS7PR03CA0156.namprd03.prod.outlook.com (2603:10b6:5:3b2::11) by CY5PR12MB9054.namprd12.prod.outlook.com (2603:10b6:930:36::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 6 Jun 2023 07:17:24 +0000 Received: from DM6NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b2:cafe::51) by DS7PR03CA0156.outlook.office365.com (2603:10b6:5:3b2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT015.mail.protection.outlook.com (10.13.172.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:24 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:11 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:11 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:11 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard , "Muhammad Usama Anjum" Subject: [PATCH v3 08/11] selftests/mm: fix build failures due to missing MADV_COLLAPSE Date: Tue, 6 Jun 2023 00:16:34 -0700 Message-ID: <20230606071637.267103-9-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT015:EE_|CY5PR12MB9054:EE_ X-MS-Office365-Filtering-Correlation-Id: c254bc15-b3ae-4900-90c5-08db665e1392 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YJA1BoOtz50E7jA7krOEBGGJ8vpO0oO9I069MuRt8i/FQL9yUg04697EN3M8YVLpRCAOU3R/Z6JJ4+4FsVvLWT1m7yTEtry1V5JHVY0ogIp8m00Qo5qxNy1FWGGZe7AAhcoVdOnCRToY/C6oeADVJ3E4iTolbZ3mg69UczU2QZDU6QYMXMnOfvmFmDQlIG/JBpuVdannau89tYcxVz/Q/J77+HMhHPSImi/WggiHdXZytLEFLis35vM/7+8Ztc2pOJiCb8+QylP2z2xPJqiUg/VLR8HIj+ChhaJFrQCDnBt1xTMOQ/S5DGQRckXCFBVMSTho5XjizWqYxG8I0zOgvHuwOYkUKrTl8R2nQRV06Xw2wm868bNdKdArg9agz/VYirUsBcFDVfQXZ/GhKoE188wd8eRtgSJnQ5N5gj5jtz/8Kl59xcNcfBDDlJrJgN755yFK4ooMaB1EALny4KbU+yzqY/8oZsTLJErFBFSl13NWJLj7lekzh0B0JZkHVlOY+SL4WZpgKoOSeflzSWMqK6D5hGsOhQ/qQddzr6O99ctquFcJmcAdzcYqnzHyiSXiNr0zg7DYPmqVUROOkkv+7slEFOI0UJYBNCqSvOzg6xG2b949H/NfzyjhUbfxAOFBFHnZXLryJZKZl5V8X7TbWzq+ln55+5YCisaHjc4FOP6dkq+PU5XLfJ3jBI98yzYA0w8XjS4+yaFy3iyx6Ag7vWw6PMy1sRdI5pQD69keI1RFY1CnQ8pSGZo+DE6/UOiq X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199021)(40470700004)(36840700001)(46966006)(83380400001)(40460700003)(47076005)(426003)(336012)(2906002)(2616005)(36756003)(86362001)(82310400005)(356005)(7636003)(82740400003)(36860700001)(40480700001)(316002)(41300700001)(6666004)(5660300002)(8676002)(8936002)(7696005)(478600001)(54906003)(6916009)(70586007)(70206006)(4326008)(26005)(1076003)(186003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:24.3138 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c254bc15-b3ae-4900-90c5-08db665e1392 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB9054 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767938301385205973?= X-GMAIL-MSGID: =?utf-8?q?1767938301385205973?= MADV_PAGEOUT, MADV_POPULATE_READ, MADV_COLLAPSE are conditionally defined as necessary. However, that was being done in .c files, and a new build failure came up that would have been automatically avoided had these been in a common header file. So consolidate and move them all to vm_util.h, which fixes the build failure. An alternative approach from Muhammad Usama Anjum was: rely on "make headers" being required, and include asm-generic/mman-common.h. This works in the sense that it builds, but it still generates warnings about duplicate MADV_* symbols, and the goal here is to get a fully clean (no warnings) build here. Reviewed-by: David Hildenbrand Cc: Peter Xu Cc: Muhammad Usama Anjum Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/cow.c | 7 ------- tools/testing/selftests/mm/khugepaged.c | 10 ---------- tools/testing/selftests/mm/vm_util.h | 10 ++++++++++ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index dc9d6fe86028..8882b05ec9c8 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -30,13 +30,6 @@ #include "../kselftest.h" #include "vm_util.h" -#ifndef MADV_PAGEOUT -#define MADV_PAGEOUT 21 -#endif -#ifndef MADV_COLLAPSE -#define MADV_COLLAPSE 25 -#endif - static size_t pagesize; static int pagemap_fd; static size_t thpsize; diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 97adc0f34f9c..e88ee039d0eb 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -22,16 +22,6 @@ #include "vm_util.h" -#ifndef MADV_PAGEOUT -#define MADV_PAGEOUT 21 -#endif -#ifndef MADV_POPULATE_READ -#define MADV_POPULATE_READ 22 -#endif -#ifndef MADV_COLLAPSE -#define MADV_COLLAPSE 25 -#endif - #define BASE_ADDR ((void *)(1UL << 30)) static unsigned long hpage_pmd_size; static unsigned long page_size; diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index b950bd16083a..07f39ed2efba 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -63,3 +63,13 @@ int uffd_register_with_ioctls(int uffd, void *addr, uint64_t len, #define PAGEMAP_PRESENT(ent) (((ent) & (1ull << 63)) != 0) #define PAGEMAP_PFN(ent) ((ent) & ((1ull << 55) - 1)) + +#ifndef MADV_PAGEOUT +#define MADV_PAGEOUT 21 +#endif +#ifndef MADV_POPULATE_READ +#define MADV_POPULATE_READ 22 +#endif +#ifndef MADV_COLLAPSE +#define MADV_COLLAPSE 25 +#endif From patchwork Tue Jun 6 07:16:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3212318vqr; Tue, 6 Jun 2023 00:38:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Nbcc3SUrx69xhu1I7qb5c49f8ZKkkRYXbvZcUFLmoNon/45YQBUp8DcsahwCW82KRROTR X-Received: by 2002:ac8:590d:0:b0:3f6:b934:b0a2 with SMTP id 13-20020ac8590d000000b003f6b934b0a2mr1469053qty.5.1686037110363; Tue, 06 Jun 2023 00:38:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686037110; cv=pass; d=google.com; s=arc-20160816; b=wd+AoZldBFAry/G88CJqWsCFFzcWU8sHPO/x2tMw1D/DQ8HzQ52WlW4lXEgEnTevKd quazGc3jZqSyoSSs1OAaVsabMA/Sc4cGGIm+bRhT2ezlMZL6hMRcg+t7ps+FaTLJV6wm 6TGarD+yprSf6p4U1PokD4VrfgIFDss16MMsSy7SyHN0onz+xK8lMBu5QZ5oYMcCXEGs Om0FFE6mugGDt2jDpm9uqhKXeeRZaglyYdCiZxxjKlhXEe8MzqzjNVqeOADYGS+Z0hd/ UAxs8kik8suYqfAtGDEciPZSVvK/ReswmcVC1VYItRzcji+pxstQyz8SLrX2oBHX7OfN DeBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xYlalBEAxIzJMtKb5NGYNsMnsUemOvRTiXi3Wz6Od68=; b=pZG4a3NEkrBHPjOLtLk8ncHBdY8/BzLjqP+qIn0VaV7djQPNcLzuahtWtd62uDitdC 0rpex9b0idzQsLUeKstTvBl5C1aA2ABHxEC3nSpZOV1k1ADWx5yRmIc086xfNeDX0MvO 0x9IynN6zQZ1C3SvrOZBKLbXjyoT7xv6SGrTeAXC2c0n4lr6d7G6ch1O7LuAC5iv9stg 1pybbrHJm/tV7rQ7p9RoyuQXu1Alf+PMnTNx3c3o6MUPYoplwR+RB2n8EPdkQCNeh01u 1n5qOrQjVbdCAaz2PJu+IKq51nvnqT1tpFkEMX9M834cUlVs3Bj5ej86BGvBravRWrrs l8vA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=gxmuprP+; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a05622a061100b003f7514036absi4168560qta.236.2023.06.06.00.38.15; Tue, 06 Jun 2023 00:38:30 -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=@Nvidia.com header.s=selector2 header.b=gxmuprP+; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235646AbjFFHSC (ORCPT + 99 others); Tue, 6 Jun 2023 03:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234051AbjFFHRa (ORCPT ); Tue, 6 Jun 2023 03:17:30 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2069.outbound.protection.outlook.com [40.107.92.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81CF8F3; Tue, 6 Jun 2023 00:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R+kkFvaQQfAfFnjmU9QBjUlKnxH4PmVLtwABKvTJWWVjqSqfrpD01q6ejcQUo6UXWnvbX5WiRGvBDOJw2E0h9qOhZ/9LtIDFj68sIpDBbp4k0xQeU25Yizf9qZ7BJm7XeI/ljfWoJazx2K45wN9nfK6jmvdNK25GOmhtYxofRNrFj7Tns3Dweoln3uGO1RU2yOCrmDgWjzjjvixwdJ8cNl1db38gaHIg5WcEOcH8l3yaQ+XNV0Hj4iXULHNCfyFQ6AijmLiFOMn2XVrJEueO21JXSJ3J8pPMfhjFv6ZyTax7d0eZH3K6ZqeA+pzx51rB+B/ReV/YpfS3qBhwHrOD+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xYlalBEAxIzJMtKb5NGYNsMnsUemOvRTiXi3Wz6Od68=; b=PY2YKo+KGI7sDMXo/CM+jUAYd3FhVB9zzsO1+I55er6DlwNWqXF4+9iuVJ7fZzEDNs/LSlhZGE3eKpUliDufIn3p377KQmWwnqa+Z6BiVbTJ3uN+QnQO0uEbsNTAoDGftOFC2xy05ynky14b2b3Vvq+qHSo4n8S88UcRb9LBu3LoAw+J3LOLR+Whc/JR0uNilkn7y75zuj1yR2hs/WVWWD3bIWLf/ITdH9Ht0bncYUHbPtSBK26B7Qa1OuZZDzDqfI+tJmaQzBOzVCMFB5VBqbTAPG6vCBpW2VnR2dsiUBvmkObs9VUM4+ps5GQBzLyxtGatbHezBfOI4bcxuVC6Uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xYlalBEAxIzJMtKb5NGYNsMnsUemOvRTiXi3Wz6Od68=; b=gxmuprP+hNR854TUEcopS/Zs6vkoR5wPAfC7GFrw2t4YQbcVgjvufEZxabPgZr3aokifyAVKTMS+V2ZtwkuQBibgm2KueXfTsVmdSN5k4ixBJnB2dggQPFtp34Xv/QlOKR11HmCHs+0nohNWCUUphFuUDaHrHzTJT8eUPOzmrzycOyCQPiPpN4ZIYlLbaeXjkzui/saK4mzxtJJ8ZWMUMU0Nfg07eYGhCSKzpjTxCEMFZjAOZQOos85javSt81oWvaqZkKcZJxG9P4+4bBbZrsDyKC/4EU8yw9Bvoo5PIhTPX3xT5cPidPYVtZ77nnGG15kysVdSVzOj3hR7GxSTKw== Received: from BL1PR13CA0392.namprd13.prod.outlook.com (2603:10b6:208:2c2::7) by SA1PR12MB6896.namprd12.prod.outlook.com (2603:10b6:806:24f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.31; Tue, 6 Jun 2023 07:17:25 +0000 Received: from BL02EPF000145BB.namprd05.prod.outlook.com (2603:10b6:208:2c2:cafe::32) by BL1PR13CA0392.outlook.office365.com (2603:10b6:208:2c2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Tue, 6 Jun 2023 07:17:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF000145BB.mail.protection.outlook.com (10.167.241.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.13 via Frontend Transport; Tue, 6 Jun 2023 07:17:24 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:12 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:11 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:11 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard Subject: [PATCH v3 09/11] selftests/mm: move certain uffd*() routines from vm_util.c to uffd-common.c Date: Tue, 6 Jun 2023 00:16:35 -0700 Message-ID: <20230606071637.267103-10-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000145BB:EE_|SA1PR12MB6896:EE_ X-MS-Office365-Filtering-Correlation-Id: d6cc912f-6d42-4481-133b-08db665e13fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jn3hwNpDKfecigcUffYa/EsiW/gU4RqXOC7H1z3rOLhM0KNDzQuKB7R0aghLmIQDQU0P6X86dE3NxqvkADIBvItGfzkjNZhfFufs57B3QgjjJKlOoNUyA/PtWxlCcFH+wIicwJoLRUbEUX+x1ZU87FclWl4G2WsZ1+wX1sMMuRQzwwS7AgxozAlsk0k9saCnP6JH52LfdMEh+W06UaI4nsVYuDMkDSHXJBf7ropF7Qd/ED3oqnvFHHQJdhz4x/kB2SNXnrlismsnKV9jXY3FM+faczNBK/EYPEeUlfGayXvzpawNfaJ6eMcTzQKFdvOSehh8kBUlEFTrgliJhcxP6lyRccg2UG5LvgRF25S6JeK8JuK5AG5vSTb64pZ8PNWNMHAuzsbIE3I1lYHJbMJVpqIhKwSGEdrqhAX8lPI4CBecV5AirUdch9HPL73m107LnNqeQ3wruKhEy8irZTn58vU+PhkDqOXOE+3+otp23cKClGgXuobXBwKt7bFVDuF5VKsE5xa3UDXfVb0zBCqUt6+vSRFsLZk9jwRMgHUsEsEGriqiZ8WjGKVFWNn+44Iwf/lU2qmCbtHf7bX+uYG1l5EtlfzU+6uXcpmu4vI87shO1oU/rSEVfn06lUG0JAhLYd8dnXHF7/AeP7LC0P5OQwMLqY5PZ5kypEjrk24Bk3DlY+PlzBwWZ+/3ShbFhGmFRIeIXkzn61jcAAd18oXkgur71hATsN/dyhfbpsqwfMvkfKszgL1WQmA5Yny8Xy4G X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(39860400002)(346002)(451199021)(40470700004)(46966006)(36840700001)(86362001)(6916009)(2906002)(5660300002)(41300700001)(4326008)(70206006)(70586007)(82740400003)(54906003)(356005)(8936002)(8676002)(82310400005)(7636003)(316002)(478600001)(36860700001)(6666004)(40460700003)(7696005)(186003)(1076003)(336012)(83380400001)(36756003)(426003)(107886003)(40480700001)(47076005)(2616005)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:24.9140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6cc912f-6d42-4481-133b-08db665e13fa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145BB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6896 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767938049010010059?= X-GMAIL-MSGID: =?utf-8?q?1767938049010010059?= There are only three uffd*() routines that are used outside of the uffd selftests. Leave these in vm_util.c, where they are available to any mm selftest program: uffd_register() uffd_unregister() uffd_register_with_ioctls(). A few other uffd*() routines, however, are only used by the uffd-focused tests found in uffd-stress.c and uffd-unit-tests.c. Move those routines into uffd-common.c. Cc: Peter Xu Acked-by: David Hildenbrand Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-common.c | 59 ++++++++++++++++++++++++ tools/testing/selftests/mm/uffd-common.h | 5 ++ tools/testing/selftests/mm/vm_util.c | 59 ------------------------ tools/testing/selftests/mm/vm_util.h | 4 -- 4 files changed, 64 insertions(+), 63 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c index 61c6250adf93..ba20d7504022 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -616,3 +616,62 @@ int copy_page(int ufd, unsigned long offset, bool wp) { return __copy_page(ufd, offset, false, wp); } + +int uffd_open_dev(unsigned int flags) +{ + int fd, uffd; + + fd = open("/dev/userfaultfd", O_RDWR | O_CLOEXEC); + if (fd < 0) + return fd; + uffd = ioctl(fd, USERFAULTFD_IOC_NEW, flags); + close(fd); + + return uffd; +} + +int uffd_open_sys(unsigned int flags) +{ +#ifdef __NR_userfaultfd + return syscall(__NR_userfaultfd, flags); +#else + return -1; +#endif +} + +int uffd_open(unsigned int flags) +{ + int uffd = uffd_open_sys(flags); + + if (uffd < 0) + uffd = uffd_open_dev(flags); + + return uffd; +} + +int uffd_get_features(uint64_t *features) +{ + struct uffdio_api uffdio_api = { .api = UFFD_API, .features = 0 }; + /* + * This should by default work in most kernels; the feature list + * will be the same no matter what we pass in here. + */ + int fd = uffd_open(UFFD_USER_MODE_ONLY); + + if (fd < 0) + /* Maybe the kernel is older than user-only mode? */ + fd = uffd_open(0); + + if (fd < 0) + return fd; + + if (ioctl(fd, UFFDIO_API, &uffdio_api)) { + close(fd); + return -errno; + } + + *features = uffdio_api.features; + close(fd); + + return 0; +} diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selftests/mm/uffd-common.h index 6068f2346b86..197f5262fe0d 100644 --- a/tools/testing/selftests/mm/uffd-common.h +++ b/tools/testing/selftests/mm/uffd-common.h @@ -110,6 +110,11 @@ int __copy_page(int ufd, unsigned long offset, bool retry, bool wp); int copy_page(int ufd, unsigned long offset, bool wp); void *uffd_poll_thread(void *arg); +int uffd_open_dev(unsigned int flags); +int uffd_open_sys(unsigned int flags); +int uffd_open(unsigned int flags); +int uffd_get_features(uint64_t *features); + #define TEST_ANON 1 #define TEST_HUGETLB 2 #define TEST_SHMEM 3 diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 9b06a5034808..681277615839 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -242,62 +242,3 @@ int uffd_unregister(int uffd, void *addr, uint64_t len) return ret; } - -int uffd_open_dev(unsigned int flags) -{ - int fd, uffd; - - fd = open("/dev/userfaultfd", O_RDWR | O_CLOEXEC); - if (fd < 0) - return fd; - uffd = ioctl(fd, USERFAULTFD_IOC_NEW, flags); - close(fd); - - return uffd; -} - -int uffd_open_sys(unsigned int flags) -{ -#ifdef __NR_userfaultfd - return syscall(__NR_userfaultfd, flags); -#else - return -1; -#endif -} - -int uffd_open(unsigned int flags) -{ - int uffd = uffd_open_sys(flags); - - if (uffd < 0) - uffd = uffd_open_dev(flags); - - return uffd; -} - -int uffd_get_features(uint64_t *features) -{ - struct uffdio_api uffdio_api = { .api = UFFD_API, .features = 0 }; - /* - * This should by default work in most kernels; the feature list - * will be the same no matter what we pass in here. - */ - int fd = uffd_open(UFFD_USER_MODE_ONLY); - - if (fd < 0) - /* Maybe the kernel is older than user-only mode? */ - fd = uffd_open(0); - - if (fd < 0) - return fd; - - if (ioctl(fd, UFFDIO_API, &uffdio_api)) { - close(fd); - return -errno; - } - - *features = uffdio_api.features; - close(fd); - - return 0; -} diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 07f39ed2efba..c2d4ff798b91 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -48,10 +48,6 @@ unsigned long default_huge_page_size(void); int uffd_register(int uffd, void *addr, uint64_t len, bool miss, bool wp, bool minor); int uffd_unregister(int uffd, void *addr, uint64_t len); -int uffd_open_dev(unsigned int flags); -int uffd_open_sys(unsigned int flags); -int uffd_open(unsigned int flags); -int uffd_get_features(uint64_t *features); int uffd_register_with_ioctls(int uffd, void *addr, uint64_t len, bool miss, bool wp, bool minor, uint64_t *ioctls); From patchwork Tue Jun 6 07:16:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103603 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3209899vqr; Tue, 6 Jun 2023 00:32:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ypPYr5ROXCWr0KArWaHK3bJ4R2jJLZ5hNmgH0ro6RkiS803ufsqlrxmUZ2huP7YvRe9bJ X-Received: by 2002:a17:90a:1fcb:b0:256:b952:5937 with SMTP id z11-20020a17090a1fcb00b00256b9525937mr1134783pjz.13.1686036761603; Tue, 06 Jun 2023 00:32:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686036761; cv=pass; d=google.com; s=arc-20160816; b=DRWkfSeLH5/kVKMjO+W3BpJwAotI2o8GyGsCVVjXgoiB8p41Zj6qMR0YKgZtcK6VdK 25iMyMhE9HFjj2N3PCntspjydizxgWpouBMNdZgkXh7iBvglG6CZ9XiovHsOMl5hKL3B wHqoIFaluCLZImpik26o1WqKmraiJuI7xf3TlY8DCVS9Smt+GIRxczaZwenS+YlP6D6i uPeZHmLGpZfycXPL7U5sVMPeBzarN96+4scXLoz5D+oYSVKlzeFq98ebju+30bSHZIHj hTAxjixAb/4p57zEvhao0oEoWmqWMaqOari0Ui9UrBBoFoh+oThRAdNCzOleDEktNlYS jMsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s37KNW0wVfL7/v6s3m7Yfh9HIX4qq3S5lut13aXDTUs=; b=zUqUW0uO+VZJkulZQXHeODiM4lC3EOSS6QqZPE14QRWo4nB9zDQssZ2/pPYqp0zAaw zcbRYA2HLGPkxelzv6COdYNsVEl+WZlHw51aUnB6CLnilfucbuARYkGZUJKU63P8vF7s SyKuYiBJ6fCT8Q/5aQJSaxzR0bV/m7Xrcm1caW/+tHgwgPVK5hbDtes3mA7TQUubDTcS cqm613uHcKZl/kgMV/2n+TmtvxKbEwFhYTx+CR7IycgX+ph+1XWWC8aHEVCUXBp4JRSy g9HtUVA1qnjIjbk6mnvLxqznP8bcinbru54CjQQmgF4MSBHjzOTGMm2Ggj3a/HjLcQNs NFmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=YdsB19oe; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br11-20020a17090b0f0b00b00256615e8d90si8593915pjb.49.2023.06.06.00.32.29; Tue, 06 Jun 2023 00:32:41 -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=@Nvidia.com header.s=selector2 header.b=YdsB19oe; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234856AbjFFHRx (ORCPT + 99 others); Tue, 6 Jun 2023 03:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234649AbjFFHR2 (ORCPT ); Tue, 6 Jun 2023 03:17:28 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2067.outbound.protection.outlook.com [40.107.94.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113AEEC; Tue, 6 Jun 2023 00:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D962y20PT32aMdprELt2ow7HJAgfMXzWFbDpA8O7M3E/7oByDbBdOBB3nQ6e+htwdtmgnIF3mLwShXf9oI7S4V0euNge85NPKwDBpK/6d9PiPRRAuVIfg//ItkgbLnSIwnI2bfnY951485Izuh1iYI4zjLKr+b9d/4+Lc3DNcepK2MDHwhzNieDvDeArXg3M0TfJchCZQfCMSQKM2Stz2JVx9a83K0Yfi+2HORTo2C1waNs6ohPraaR/GCg7trT6I3EpTXwwuBIfxhsEps90RQPV7Psf0j0WpgSv0GgRbKSlZz3DF6uSDA8BdUYWj8m7+3Q11zQGdYJj4xcWPOmGkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s37KNW0wVfL7/v6s3m7Yfh9HIX4qq3S5lut13aXDTUs=; b=Xm8MvdsZYy2QsVdpo8q0e1f5VrNywBufgI4WG2GA9LSx2ZbcjU32LXk4q01RNe/4g7J0Nx5YFfaPUAjcoydpNU2SVsFYNveiGglXN88rAMMVw/KExKap9sEN6cskA4mSuD5NjGhT6cg24ks+yi2H88rIZRuiWkBYch7bqR/UqyL30X+2tCwMNkDlIGgfuEfX5PVXLybw0vmuI9C4Ou4gheBkM2fJyQ4hXJuQR4JSVlXb8zYBpo6Sxi80si0FYs463VYQ63DVZ0L5ALsvw7SbtxLuJZrjEnzxa3s8g0uGWzIvcqeutHyPJxVN9Qcfx/X/tJod3zsj92kYC42h8Cd+eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s37KNW0wVfL7/v6s3m7Yfh9HIX4qq3S5lut13aXDTUs=; b=YdsB19oeka8jAA189tXmvZoljsDDhB5pM3RmfZl7KDbwm02ySwlatVqT/h2VSTOudMsYQXjOCXRMHxjoqSgc+eBI+POb7DhWg8GWbY/P1xMviWAhqoCeQywd3lSgH75m00Wf46kM75VE/1J6Ja1fu1I8kc4qOXY3CCdrwDn4xog+qYgGPorEzWDul6qunWRp6FCO5cYp7sZcMWN9ln+d1Aatw1C1XqzYRyX5Au7qAyhkYeYi7/LjMI12DKdybCmA8qo0Vcu0O7J5nyQuBS6Ujbqg0CaHuTuUOQuWriWWAJCxzECjcTHYla+V+AafSnSaldSEjhhaZlLxweymfcrqmg== Received: from DS7PR03CA0164.namprd03.prod.outlook.com (2603:10b6:5:3b2::19) by DS7PR12MB6311.namprd12.prod.outlook.com (2603:10b6:8:94::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 6 Jun 2023 07:17:25 +0000 Received: from DM6NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b2:cafe::db) by DS7PR03CA0164.outlook.office365.com (2603:10b6:5:3b2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT015.mail.protection.outlook.com (10.13.172.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:24 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:12 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:12 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:12 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard , "Muhammad Usama Anjum" , Jonathan Corbet , Subject: [PATCH v3 10/11] Documentation: kselftest: "make headers" is a prerequisite Date: Tue, 6 Jun 2023 00:16:36 -0700 Message-ID: <20230606071637.267103-11-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT015:EE_|DS7PR12MB6311:EE_ X-MS-Office365-Filtering-Correlation-Id: eb452bca-fef0-490e-ed66-08db665e13f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RPSHPyE5Is7JD0oVWeORYtMfsvUKWXu6xjBuKruTsMoRUFfjrf3qwjNJsaxyLj5Y1fgmaKSS3hUidz9BqLvXC5FYRKwk9DXWkaAWpyvUG82cjcByvGeEPosUqxnh5e4jaZw/BOgbdJKIuH4cnyk7sqyhPgVUsUaSyCnwJpqyL1JtSfK957yXOAIWIQ/quN5z/53GwU4TL3WqtWOpFXoAifFg1Mdgu6Ztya6SRa12AXFxljQQvYWrqmRS0sfWxg0SZH4pfuY2aMutwNa593wATZdnJS4C/RmNPFCgUV39BP477gDruf1NtrZEvuw/BLiIc2CgMnEbQLDNDYpqJ47+QS/Qf9Q+u0czVvV0IFAibJwcBkIrU336R/h6M56+47B5Lx5WybIGQqzTredzEZgHlDNfVQHlB2N9CHPP6r65UOdi3rA1EcsnDRXp0A0GiHYxBeMuQlWAH6fw8yZ4BIAQbWhEkSxh854SuJSaTo1jp7Qj6X8GdD03DNaJQF0WyF/uiQeDjrZxp51sR1TTHlW00wSlmQb46c5gz6r+VM1CId50arUdzKtmm2PfIINHEowtZVA1rTS9+eT8jAEPZqN1zL9EadBOrJeHKkH0zzXiAcS0JWPCpsvqGjUmDHu4o98FAUc8ce5Du/OkprdCqzRnLKR2mdn4JORrYlJIktq6A6SyGuqmbOCld5c6uIJ0NvWxRKkq/Z6gD+MzokyYWAF9GUmW/FIcM4BKr9qQMK2nB4pGhyJycL4LOKG3emiIxvFbT9OV2/SKEZ+xPtL0EDW7iHdORTkVWjtnCsM1qtD3KXk= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(54906003)(40460700003)(40480700001)(478600001)(6916009)(8936002)(8676002)(7416002)(2906002)(36756003)(86362001)(5660300002)(82310400005)(4326008)(316002)(70206006)(70586007)(7636003)(356005)(82740400003)(1076003)(2616005)(41300700001)(26005)(47076005)(36860700001)(83380400001)(186003)(966005)(7696005)(6666004)(336012)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:24.9232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb452bca-fef0-490e-ed66-08db665e13f1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6311 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767937683115555293?= X-GMAIL-MSGID: =?utf-8?q?1767937683115555293?= As per a discussion with Muhammad Usama Anjum [1], the following is how one is supposed to build selftests: make headers && make -C tools/testing/selftests/mm However, that's not yet documented anywhere. So add it to Documentation/dev-tools/kselftest.rst . [1] https://lore.kernel.org/all/bf910fa5-0c96-3707-cce4-5bcc656b6274@collabora.com/ Cc: Peter Xu Cc: Muhammad Usama Anjum Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Reviewed-by: David Hildenbrand Signed-off-by: John Hubbard Reviewed-by: Muhammad Usama Anjum --- Documentation/dev-tools/kselftest.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst index 12b575b76b20..6e35d042199c 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -36,6 +36,7 @@ Running the selftests (hotplug tests are run in limited mode) To build the tests:: + $ make headers $ make -C tools/testing/selftests To run the tests:: From patchwork Tue Jun 6 07:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 103608 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3213872vqr; Tue, 6 Jun 2023 00:42:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67Nod6NjzW+gSKITXSWOIrTo1/uTvdqquuT7WfWxl+0/Ehi8YOAcLtTGaNVxrUEjt1Zmwi X-Received: by 2002:a05:6870:b285:b0:19a:1331:9d4d with SMTP id c5-20020a056870b28500b0019a13319d4dmr1530340oao.23.1686037350346; Tue, 06 Jun 2023 00:42:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686037350; cv=pass; d=google.com; s=arc-20160816; b=s+siKD0Tvsx6h/G1+iAGz16ofDgy1BWFNonBAB3wbwQab2X6A5g1Beo4MjaB69Tw3L kvWp6eNlVjFmUG1xz1rbfCSp7dk+hreU2jeuUut2c5u+v/m4s4g+abY45nxSKkNYdlI5 x5Ezsks2Sj5/0Slx9h0wwND+bmNz3f2bHHJF/BLfpEisV30nnhNqjPjzY64W67Pavq4R UqvGm7vU/YHSOHPFMp0OH1ilwhmBV/VbaYnESyXokDrokuiYk55rEzmJ/dmjkUbNzDHL wDHgYvBnEZP7AuE+wPJ4JF9DexDa+aRyd1ngdjAXIXjmOe8FYKmFkzN/V30a4RKnZq/h TWDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4Fine+ULcirLmEqNWkiHf+fbRUQNrgpAQqF8Q8I9Jv8=; b=hiiZtTOeG3vuPWrW0YMhuissdVBFchLjVAurihwZyOG9909o+eBH9lkHSLM2xkbOaz hJRrNjFHlrcbNsTP3pk6Zcm8q2uQ/RFDJUHWcfL+Ba3vrJY1M9wgKO4FU6aFkJITfTma fv8+irofm2H3kVDuxKk1YIpX2/YV3SQXnmbySG3xKQIxzuQgC9frx12atEvEEYxZnS4F eB1MMqjCsgDwmsP1XgAQoJY7MK4xKnwsoM/IPXYK1YgF5h3cUl0IP5SELUnrY9X63yQM Z5lQzMSBTtRxgyKSvK24jei35CogSHyTAgM6PzMfgEw1rwI0X5gsOPAo3YlEU8jNGLeI F4AA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=btuvmAMY; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m65-20020a633f44000000b00502f4be647fsi7006711pga.641.2023.06.06.00.42.16; Tue, 06 Jun 2023 00:42:30 -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=@Nvidia.com header.s=selector2 header.b=btuvmAMY; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236165AbjFFHSG (ORCPT + 99 others); Tue, 6 Jun 2023 03:18:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235069AbjFFHRa (ORCPT ); Tue, 6 Jun 2023 03:17:30 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C448FF7; Tue, 6 Jun 2023 00:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJooluIYCXO7Bo4oxRmnm+GE/+bdE/UI1gt/CmdnnvMrBX0JsqYKBWYF60hKDg9SUBYK1RDw3lfUzoxa6DT6Nxx4B4WMBV7+9Yv5pGCRbNts4Komh8dkw5gl2veFrVBneR1HYX3Y6dwGDOdK85VdIxWW0YbdO68+lmHjZ1uatf/6YTW5WludfTyA/N3FYuKjhtPFHXwG8raXVVraynSGOkRlHDUUsEeRSYgCJDDe1eKptB8jWYEix64DLfBsRBQLZYathBmFr0nWDtrARJO9ldOSGUN7LXbu30E5lCtztrdKR42rWpgrEzCldIBGMbNtIl4WSk6LbRwjRDx2nesqbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4Fine+ULcirLmEqNWkiHf+fbRUQNrgpAQqF8Q8I9Jv8=; b=EEnTF4VoOkwRqJnksL6DXhjUeRtUi46wf/CqhXZ57IwCWPqgoqKovyJzzKgmXazjL/YUbp6J5qp56AAulDq7dN9G5lwP66asBPjdFsYzvImNbA8cHqSv0aOEdlW+zJgaNtC76vAiKGFLi7izQ8UMHdzu6GkyonSZ+ytbE15ULPTEREFbDbG3pIzvTxRnSTtxGuiOODqk36HnZBAPXzzYtIb4IShg74hCzMvRo5QlObK8MuyeqkMP9GzBH3BQfpo+UHz8GbuMXAoUGOiYDsYTDRl+xYbu2FLUcp5ZcPYUkZiC+a1gobpeL8yoZd8T+DlJBHuPvt0k2rl7Rb7DqfFHTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4Fine+ULcirLmEqNWkiHf+fbRUQNrgpAQqF8Q8I9Jv8=; b=btuvmAMYyzE27ABu7VBwlvAcjEci5vRX18QHREurNcFKmdPNUJtoqvLPH7Qr0qriZG8Bd0KJRYZd5wsIC5oUNI+ahY9cgMOvxHaQK0RgkczQFMgMJuqZF0AjFU2M/9fvRYG2YfJci/3oiE5TwVy72u9VKEbFYkiwfRlK6IMBsfgsEhcgbg61sTSpECqlwvzd/raMzw0GenEVcO8pyCGX6exsbzuvSZTcrwAps3Frxy58hYJZG2R4TZQ7sUCSUJW1rZ7vcFfak4fAawhAq34SndraL1KBO03Lh7sOTEFpOu/LxGogBpHakT96hSxYE+RIbswVG1c7/wPA7HKW/cOM0g== Received: from DS7PR03CA0284.namprd03.prod.outlook.com (2603:10b6:5:3ad::19) by PH7PR12MB5830.namprd12.prod.outlook.com (2603:10b6:510:1d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:26 +0000 Received: from DM6NAM11FT086.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ad:cafe::da) by DS7PR03CA0284.outlook.office365.com (2603:10b6:5:3ad::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT086.mail.protection.outlook.com (10.13.173.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:26 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:13 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:12 -0700 Received: from sandstorm.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:12 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Nathan Chancellor , , , LKML , John Hubbard , "Muhammad Usama Anjum" , Jonathan Corbet , Subject: [PATCH v3 11/11] selftests: error out if kernel header files are not yet built Date: Tue, 6 Jun 2023 00:16:37 -0700 Message-ID: <20230606071637.267103-12-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071637.267103-1-jhubbard@nvidia.com> References: <20230606071637.267103-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT086:EE_|PH7PR12MB5830:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ee2a593-f893-404f-6ef1-08db665e14a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D6JyrV7UKBSncKCDQBDtupx10E0cen55WxHrGHi1nSH0HXH1Sg17VGW7XRQvJhO49sgPrX5cgXy3yK/rtw90NG9gScesFqMLSV1t4Cjl/SfLJhFRtrs1AJjuDXtqQXLNXEEBWwbus2XCzOSpVQ62eFjccCm8mJl4VG8ddsPoebDb3kWvrFtC7e6540rEvNshxVUBkGXC4KiombXlO2QkvftKNtuFsxzcqNKSbsU6Q8Y+xIHEzBCKDFCD9WL0kUvFjX8x7QK85ZpyCAOl6gvmIoYcWhgCwO9bzoEbvPjGHW8PjPsgffdEKguA0iX1A7cW61ANo0vWhguxJ5ibwGilo1oM6OE82Kjmh/buiiizjjj6idBDD+Nt7bpJ3DuCIRci14K+WQ5krZEm3votMvzu0eKGCQ/G2jPeaqX+goSWz7UV6TpCTwbFDLONi+rIt93g2brxk2KyrYfQrYsx6WM7jqvEb9DdYSLzZVMVcSEive/SQxdGHIGgl4RYgFGyrOlWhrBcOzVKaRQVWo7SlFB0DowwPyk/23tygD/S1rq7/cVLPIlmTaLwxmAIveQXPj8yCSyvUSh6kB386wP03hQGT9Zd2/wcD8ls6bSgRotOPYzv3gov/NjtdbvSYaMedLkkIdCBGDHOtD5n2HCsA6ckYbhaUJkmBegdu+D3L+O/DWPQjwv2CQ2nO7ou0htHizgMPnCP5eLJzGDKk6umHgthTJ/8jgvz7SLXi2u4GQ0nBNmWu3WCYVqh72G+HO/CSNgvcBmMlKBSPUyxZFUagD2aLg== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199021)(46966006)(36840700001)(40470700004)(47076005)(83380400001)(966005)(336012)(426003)(40480700001)(54906003)(82740400003)(4326008)(478600001)(8676002)(8936002)(70586007)(70206006)(356005)(7636003)(316002)(40460700003)(5660300002)(41300700001)(6916009)(86362001)(6666004)(36756003)(7696005)(2906002)(82310400005)(36860700001)(7416002)(186003)(26005)(1076003)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:26.1192 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ee2a593-f893-404f-6ef1-08db665e14a8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT086.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5830 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767938300473279951?= X-GMAIL-MSGID: =?utf-8?q?1767938300473279951?= As per a discussion with Muhammad Usama Anjum [1], the following is how one is supposed to build selftests: make headers && make -C tools/testing/selftests/mm Change the selftest build system's lib.mk to fail out with a helpful message if that prerequisite "make headers" has not been done yet. [1] https://lore.kernel.org/all/bf910fa5-0c96-3707-cce4-5bcc656b6274@collabora.com/ Cc: David Hildenbrand Cc: Peter Xu Cc: Muhammad Usama Anjum Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: John Hubbard Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum --- tools/testing/selftests/lib.mk | 36 +++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 05400462c779..b8ea03b9a015 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -44,10 +44,22 @@ endif selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) top_srcdir = $(selfdir)/../../.. -ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +ifneq ($(KBUILD_OUTPUT),) + # Make's built-in functions such as $(abspath ...), $(realpath ...) cannot + # expand a shell special character '~'. We use a somewhat tedious way here. + abs_objtree := $(shell cd $(top_srcdir) && mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && pwd) + $(if $(abs_objtree),, \ + $(error failed to create output directory "$(KBUILD_OUTPUT)")) + # $(realpath ...) resolves symlinks + abs_objtree := $(realpath $(abs_objtree)) + KHDR_DIR := ${abs_objtree}/usr/include +else + abs_srctree := $(shell cd $(top_srcdir) && pwd) + KHDR_DIR := ${abs_srctree}/usr/include endif +KHDR_INCLUDES := -isystem $(KHDR_DIR) + # The following are built by lib.mk common compile rules. # TEST_CUSTOM_PROGS should be used by tests that require # custom build rule and prevent common build rule use. @@ -58,7 +70,25 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) -all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) +all: kernel_header_files $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) \ + $(TEST_GEN_FILES) + +kernel_header_files: + @ls $(KHDR_DIR)/linux/*.h >/dev/null 2>/dev/null; \ + if [ $$? -ne 0 ]; then \ + RED='\033[1;31m'; \ + NOCOLOR='\033[0m'; \ + echo; \ + echo -e "$${RED}error$${NOCOLOR}: missing kernel header files."; \ + echo "Please run this and try again:"; \ + echo; \ + echo " cd $(top_srcdir)"; \ + echo " make headers"; \ + echo; \ + exit 1; \ + fi + +.PHONY: kernel_header_files define RUN_TESTS BASE_DIR="$(selfdir)"; \