From patchwork Tue Aug 8 12:43:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Jain X-Patchwork-Id: 13346024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893D0C001DB for ; Tue, 8 Aug 2023 12:44:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23CF66B0071; Tue, 8 Aug 2023 08:44:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EDB48D0002; Tue, 8 Aug 2023 08:44:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08D448D0001; Tue, 8 Aug 2023 08:44:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EB2BE6B0071 for ; Tue, 8 Aug 2023 08:44:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9B93A120C65 for ; Tue, 8 Aug 2023 12:44:25 +0000 (UTC) X-FDA: 81100905690.08.D764856 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2082.outbound.protection.outlook.com [40.107.244.82]) by imf18.hostedemail.com (Postfix) with ESMTP id 858A41C0002 for ; Tue, 8 Aug 2023 12:44:22 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=49MsYnqQ; spf=pass (imf18.hostedemail.com: domain of Ayush.Jain3@amd.com designates 40.107.244.82 as permitted sender) smtp.mailfrom=Ayush.Jain3@amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691498662; a=rsa-sha256; cv=pass; b=Z2tMhwqECkstZh0JkxPkuaSY+oWrAYZIIOETx/xAjtmnvuvqCfRViTRXyjxCOlRkPzg/Nd GtatmHIB6n5aAg3hqcSAPw+kK712JHBF655guQJQGiQcbvB7mFddSSugdkeFeqdY8TZGCa ddtKekghiEK+4AX3NvYQoLdBLMwXh7s= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=49MsYnqQ; spf=pass (imf18.hostedemail.com: domain of Ayush.Jain3@amd.com designates 40.107.244.82 as permitted sender) smtp.mailfrom=Ayush.Jain3@amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=amd.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691498662; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=mMx2KKiT3dSFcHX+bBVRXfXt2+3wZCMeid04NohlcJA=; b=roNUq19MS1ousjl5cQtICwH6SoZSfmJ7jLh8cst5v19rgB4XZN5P3sRnGvYIlv5t4wD2jn LwoSPAvVbx+b1n+EpGAZ8mKNQ5/jlTJ/Yx/H0JJTg3klQYqGoPpqCQCa9ngahL6d6hRXjk C1TZ+JzSBWCC8vIAGK9Mq9nz5koH9oU= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItcnI5DBTAPB8VAZis/ehmQ4ZwwlzoSJujEs9ZTiFXCNWMzgGE1II46Qe8LAcgj+9T8jHXzN2paOBmvpGzj0SBwzERRn1ZWKdMTfnh4tFtN6oF8yHmo3bqKg5+jVx+5ncmm7SoaBSVvQjGCtg9UUZ7vVIoUkhiqXV81gU+MK+yuUoS2cJA4Jgb/nJma76EzC/v024ismbLOs493iLeSTvesrlibvsxqL0TXAOHkKiXDI7toyDXX//EyX5XuHnPaGObXEGdJtpkv+bwYfHC9N0iumwaq8FpuQjurMrU387SgfOhVQJXEV4f3qn3a8s7rODhRWPhwQzY9EFr5hu39THw== 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=mMx2KKiT3dSFcHX+bBVRXfXt2+3wZCMeid04NohlcJA=; b=TN1T+TJSEQAFN+eke79AaaQEoMsz8cB5N99ZIaBxFhRjqrBEhDNW8tWon8W8uaGO6tw6BsuAMhGpoiqqLeY0u2//zcnir4qP9FJ453MiisewJb0n95Ei/9D60O3HoNtYrnmo1GzAHOzFYQ+X762P+MiUVQjfqbwL4B1PV9zkqBCE50LkYbBXEyFU+KlBgACDkpZnR2Q68a9IQINY24Yc9lRfFOnMLVLOaqOhS0aQ6P/6ArkfpJsdkkOHL/bO9+PxCx94cA2Mhn45UUfTGhnhJj5WTKF7y8idMsxEbixAWrYxJrqiIW/5VQichoMCiojBddOpv8i7LEwsMT5v4NZQhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mMx2KKiT3dSFcHX+bBVRXfXt2+3wZCMeid04NohlcJA=; b=49MsYnqQlvKiY4md7dku7Bv1MnQGd7FhlAGXXPje8yRVT5VFSbuYqOk1x/6aKiJzQsEllIvSvfiF/haWq/7qS6byUgnaTsY6btrMItfvTzPZRIJL/8+YjUF34E6q5zBVcdqt9ajPzXyc/RjJLTzkwO4jadwHosfZp2856QBvVvk= Received: from DS7PR05CA0081.namprd05.prod.outlook.com (2603:10b6:8:57::6) by BY5PR12MB4196.namprd12.prod.outlook.com (2603:10b6:a03:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Tue, 8 Aug 2023 12:44:18 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::a4) by DS7PR05CA0081.outlook.office365.com (2603:10b6:8:57::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.17 via Frontend Transport; Tue, 8 Aug 2023 12:44:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6678.16 via Frontend Transport; Tue, 8 Aug 2023 12:44:18 +0000 Received: from ethanol6a67host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 07:44:16 -0500 From: Ayush Jain To: , , CC: , , , , , , Ayush Jain , Raghavendra K T Subject: [PATCH] selftests/mm: FOLL_LONGTERM need to be updated to 0x100 Date: Tue, 8 Aug 2023 07:43:47 -0500 Message-ID: <20230808124347.79163-1-ayush.jain3@amd.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT049:EE_|BY5PR12MB4196:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f9cbc63-0bf1-401d-37b5-08db980d2e59 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AvEKkzZ44mhvYlxRfXcMiVGbhduYrQEQUzW+TtnYVMY6wUZHLVnYCDBnh20oLfkGYVPjOWFkfo7vlsmScPByPqC+Xb/IYuc71KemLtbnyA/moQwO23ToM/8vagUvEQSFBwOYOetxgSRJBIqzRI9Gy0M4B2rCPLYFPA9A8/6QV2RdI5470hBOhI6YwpJVS7fFc2w8PpaKpQS3GOJDrGpf9fccZYh9qUyeyVYVqiH9nFM0AD8gjsgJlcVBLPHZtVn/vE24oxuu2QeHJw66yGeJCLVICC2xs3l94QoZSUBnTNTLX89fVJ5MwUyf4KPMDqPIsPDJwhCIjyWikE/NwxLr6+nvqwfUVxYQwK/osobko0VmSw8R4RSMJl9HVG++36fAc8FJ/NfHJMUypaB2r8m9N4Jk+bqZ9frTZCjWj2wZokQE7V5u7OZiKMZm8hNntBw/FdoMTWCSP6mOa9FGxNAHs67aLbnMxx7RHzay5xGW9zcNCjJKU2JYbd8oWZG2NUsf1L7oPYubt7jp8FzSX8ZtDXC/SScSsKBu6dXOGfeGgJ5QCjcGuaG7Nx08fUFDM8I5uLUU/MHnP5K4wDZyYpHwRtvwOFZ4Hw8aWEw3sBeLDxHY0gFwddRgfMqgiU6XxRNwcONoNr76zfnBOYyKcCD4rivOjSXQu67XgmMYiNrhkBtOmI6KtnA5E6GbX7PPyv5Q4asb2lru/coWDDcB9qLByAoboILziJrakFbJcRpcFebiv3FebYtKemKFv/B36ZhzPk9vKBUhM9BfUljN1eTTbQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(39860400002)(396003)(82310400008)(186006)(1800799003)(451199021)(46966006)(36840700001)(40470700004)(426003)(1076003)(26005)(15650500001)(8936002)(2906002)(5660300002)(83380400001)(8676002)(36860700001)(47076005)(41300700001)(16526019)(40460700003)(2616005)(40480700001)(336012)(81166007)(316002)(478600001)(7696005)(356005)(54906003)(70206006)(70586007)(110136005)(82740400003)(6666004)(86362001)(4326008)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 12:44:18.1871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f9cbc63-0bf1-401d-37b5-08db980d2e59 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4196 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 858A41C0002 X-Stat-Signature: cmty3py9hta3bkbw7su7r8zpe7x5yw1t X-Rspam-User: X-HE-Tag: 1691498662-999451 X-HE-Meta: U2FsdGVkX1+ZnXWe5a6YUl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v1l9MHDkrTb0MQrt0uNlfNvN2WN7TdtM2/+gHUMYp691PJXEs6DTcUPCgnp6Q56K1j7Y51yrZvjcq3UXfSVw+tR8Kb86lK9Oywwqusnxy5dYlqmVMp8rhEx2SirVr0OAWWH6jBfJYSL4zb76u5+H/8pujG8dlYGs7REhbB+rwsyZkWgJVSJ6FV4q+pFLLmNM8o/D2IXwOLu2ceLrtxh4bWXusJLRXkU3jpuTtxD32Nk5Jma02DGnCj1Ll X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: After commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h") FOLL_LONGTERM flag value got updated from 0x10000 to 0x100 at include/linux/mm_types.h. As hmm.hmm_device_private.hmm_gup_test uses FOLL_LONGTERM Updating same here as well. Before this change test goes in an infinite assert loop in hmm.hmm_device_private.hmm_gup_test ========================================================== RUN hmm.hmm_device_private.hmm_gup_test ... hmm-tests.c:1962:hmm_gup_test:Expected HMM_DMIRROR_PROT_WRITE.. ..(2) == m[2] (34) hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0) hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0) ... ========================================================== Call Trace: ? sched_clock+0xd/0x20 ? __lock_acquire.constprop.0+0x120/0x6c0 ? ktime_get+0x2c/0xd0 ? sched_clock+0xd/0x20 ? local_clock+0x12/0xd0 ? lock_release+0x26e/0x3b0 pin_user_pages_fast+0x4c/0x70 gup_test_ioctl+0x4ff/0xbb0 ? gup_test_ioctl+0x68c/0xbb0 __x64_sys_ioctl+0x99/0xd0 do_syscall_64+0x60/0x90 ? syscall_exit_to_user_mode+0x2a/0x50 ? do_syscall_64+0x6d/0x90 ? syscall_exit_to_user_mode+0x2a/0x50 ? do_syscall_64+0x6d/0x90 ? irqentry_exit_to_user_mode+0xd/0x20 ? irqentry_exit+0x3f/0x50 ? exc_page_fault+0x96/0x200 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f6aaa31aaff After this change test is able to pass successfully. Signed-off-by: Ayush Jain Reviewed-by: Raghavendra K T Reviewed-by: John Hubbard Acked-by: David Hildenbrand --- tools/testing/selftests/mm/hmm-tests.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c index 4adaad1b822f..20294553a5dd 100644 --- a/tools/testing/selftests/mm/hmm-tests.c +++ b/tools/testing/selftests/mm/hmm-tests.c @@ -57,9 +57,14 @@ enum { #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) /* Just the flags we need, copied from mm.h: */ + +#ifndef FOLL_WRITE #define FOLL_WRITE 0x01 /* check pte is writable */ -#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite */ +#endif +#ifndef FOLL_LONGTERM +#define FOLL_LONGTERM 0x100 /* mapping lifetime is indefinite */ +#endif FIXTURE(hmm) { int fd;