From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A00EC2D0CE for ; Tue, 21 Jan 2020 12:02:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 20B102253D for ; Tue, 21 Jan 2020 12:02:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="Hu1QEPDj"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="cz7NU88t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20B102253D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C6AC06B0006; Tue, 21 Jan 2020 07:02:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1A336B0007; Tue, 21 Jan 2020 07:02:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B09DC6B0008; Tue, 21 Jan 2020 07:02:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id 9A8106B0006 for ; Tue, 21 Jan 2020 07:02:56 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 4B8C42C81 for ; Tue, 21 Jan 2020 12:02:56 +0000 (UTC) X-FDA: 76401505152.19.rail41_19619d40b9334 X-HE-Tag: rail41_19619d40b9334 X-Filterd-Recvd-Size: 12952 Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90088.outbound.protection.outlook.com [40.107.9.88]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Jan 2020 12:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dhR/GsAHelNuqLxfcvIwjqAH8w16NadYjld4l9BFA4U=; b=Hu1QEPDjts9iUyWZhq/8w83BiPUxEL2F6+S6mu72QU5Sny7KlP5PlcPtF9JjiRxv4+/d1dPQBNGmqeOj0cJ2FdE6UJGRXkGqzyeCoPxrIFdOApDN7Itb2CxVB+3YcmM/lOhX9Az7vjbMwA2YnswYkK2b7XOvDhqRJ7GDXCgBiMM= Received: from VI1PR0802CA0037.eurprd08.prod.outlook.com (2603:10a6:800:a9::23) by PR2PR08MB4748.eurprd08.prod.outlook.com (2603:10a6:101:1f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.22; Tue, 21 Jan 2020 12:02:51 +0000 Received: from DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::209) by VI1PR0802CA0037.outlook.office365.com (2603:10a6:800:a9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20 via Frontend Transport; Tue, 21 Jan 2020 12:02:50 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; kvack.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;kvack.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT021.mail.protection.outlook.com (10.152.20.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23 via Frontend Transport; Tue, 21 Jan 2020 12:02:50 +0000 Received: ("Tessian outbound 4f3bc9719026:v40"); Tue, 21 Jan 2020 12:02:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f9ea57a3a814276a X-CR-MTA-TID: 64aa7808 Received: from 4a701ace8b15.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 50BB5AFF-1979-4477-A789-DDBE7B757623.1; Tue, 21 Jan 2020 12:02:45 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4a701ace8b15.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 21 Jan 2020 12:02:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZISvCu4JEoQZ45KcdLjQaCSpeN8kxyF6F/WVPLzLO8hpAKHvjYnhNknvmSYZgVsSAC+f6AcTUMtoCg+lD5989+BjYCe43zZKU4ZgCHC1yQ0lVniB8TB3UvJkiHywsL8NrmE02n6VdweX24jG7HDoVtlFdBu2unrK9Z75RjFBavMdBWxPfHiWRO+ZJVxbUTh0y3rh4gCtsaSmv3Ni3XBfw81E6dFtf/z/0y5dGyKC19qAqpfGJ02OmBs09NG9RVT26JCLIS6MLrYmx4ebkWDP5mCZsEwyAgo0Y5DEjN3FNcAcahOtFFieaje4BmojQuDLnAK0jZalEJ3RiRlHneKn+g== 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-SenderADCheck; bh=TqXDE1eW5PtBSR2KUk+XDmRDH2qjzhkghm+iDk26JNY=; b=XvJA/QcBzifrmmJrvVIzPcxP7kJNz8PWrEIZWJDc8cqweLYVIJ5GoiuwY104N+w/f6mZ97zCeuAM7bpemJnSup5arK2Jx0mpHF5VnlzLbD/svB32qSXHQtLlGTTTUR1yN4o15fHdev4kZvkxFvMl2Rn3gVXiUhmJaqbaA8Hlo4YyFNr2OYPafUeAwzgN6bIR5kUBp8J27CGupm4ja5CYrDLBoEHMIe+/mngfZx//hGE5yflEGPJJV8+fNjyYU/lLpB/qlYAqnNZlT3hgHYvN3S86IhPxHzA61jmEP9S03E8NMnAluT0W+BQPE9kVgxFW/dq/V0cW3MMNK5/hJg/lCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TqXDE1eW5PtBSR2KUk+XDmRDH2qjzhkghm+iDk26JNY=; b=cz7NU88t5XphSVyihIrOFFlU1XG+Av8GGGUwUDp05inEqr+5BPkBrVJxjN2M8uKOi4kHfBRWw1ka9WYduCMDvGKKvYI7aAUUvfr0pwCH8XafT7mPeiSjVTZ6bFbVRAXV2It/pIXxqo47F3on3Ajh9HoNBXeqK2MXZRyyPreGyrc= Received: from DB6PR08MB2791.eurprd08.prod.outlook.com (10.170.219.160) by DB6PR08MB2806.eurprd08.prod.outlook.com (10.175.234.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Tue, 21 Jan 2020 12:02:41 +0000 Received: from DB6PR08MB2791.eurprd08.prod.outlook.com ([fe80::c51d:bc86:7692:181]) by DB6PR08MB2791.eurprd08.prod.outlook.com ([fe80::c51d:bc86:7692:181%6]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 12:02:41 +0000 Received: from arrakis.emea.arm.com (217.140.106.50) by LO2P265CA0134.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20 via Frontend Transport; Tue, 21 Jan 2020 12:02:40 +0000 From: Catalin Marinas To: Anshuman Khandual CC: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "akpm@linux-foundation.org" , "will@kernel.org" , Mark Rutland , "david@redhat.com" , "cai@lca.pw" , "logang@deltatee.com" , "cpandya@codeaurora.org" , "arunks@codeaurora.org" , "dan.j.williams@intel.com" , "mgorman@techsingularity.net" , "osalvador@suse.de" , Ard Biesheuvel , Steve Capper , "broonie@kernel.org" , Valentin Schneider , Robin Murphy , Steven Price , Suzuki Poulose , "ira.weiny@intel.com" Subject: Re: [PATCH V12 1/2] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump Thread-Topic: [PATCH V12 1/2] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump Thread-Index: AQHVzDhxBbGg9NtlH0u/OUhHsvtVxKf1DOgA Date: Tue, 21 Jan 2020 12:02:41 +0000 Message-ID: <20200121120238.GC3113562@arrakis.emea.arm.com> References: <1579157135-10360-1-git-send-email-anshuman.khandual@arm.com> <1579157135-10360-2-git-send-email-anshuman.khandual@arm.com> In-Reply-To: <1579157135-10360-2-git-send-email-anshuman.khandual@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [217.140.106.50] x-clientproxiedby: LO2P265CA0134.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::26) To DB6PR08MB2791.eurprd08.prod.outlook.com (2603:10a6:6:17::32) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Catalin.Marinas@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4bb14467-71d1-459e-ffcb-08d79e69d6b7 X-MS-TrafficTypeDiagnostic: DB6PR08MB2806:|DB6PR08MB2806:|PR2PR08MB4748: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:10000; x-forefront-prvs: 0289B6431E X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(956004)(54906003)(2906002)(71200400001)(55016002)(186003)(16526019)(478600001)(26005)(316002)(7696005)(52116002)(4326008)(66446008)(44832011)(86362001)(8676002)(66556008)(7416002)(81166006)(66476007)(6862004)(66946007)(64756008)(81156014)(8936002)(33656002)(1076003)(6636002)(5660300002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR08MB2806;H:DB6PR08MB2791.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: mq8Q7/tmEBK4HQD8oQ4bG9ZupMVFijIa/XqI8LPmOFtelGt2DaZx29k+azWf4Fm6+qRN0dnBrEzoW+GOe+BiT1irtZKKPLzoShNkk2ez1mRYpY/9dsRWq+niLJqU1bIzCC/mpWwH1kCH1lNw/PdVX0XifPhoqVPoSQtcSCrGsgdNE2TtInAz9Z1Zwj0P1KFwBsm7tH6hUtWFUzgvbLBAZlNlDPoq1IubANkKYxGNgyzZNWp0VsywRV7baAAV2eGR0SY7kHC14tAsbFSIv9KsHFKDE8oTOS5SSOIcghTfuHy7xBK/bVT1bENlYBdb4aJxdl0zIDk99ZzODfK6Lmm4ReRX89uAKFND0qi2xt4+KJsALJMHeoGZevINSQ6gyo33ANnAmLntNiXte29G+Kw9O+GYN+xAjLOgY/OfyNAgUqeqtRrXEGmGAua4iCPNN8HY Content-Type: text/plain; charset="us-ascii" Content-ID: <69B17A45438A7B4DAEAFE6038470BFB9@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2806 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Catalin.Marinas@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(136003)(39860400002)(396003)(376002)(346002)(189003)(199004)(4326008)(26005)(5660300002)(86362001)(8936002)(26826003)(107886003)(478600001)(356004)(6862004)(54906003)(81156014)(33656002)(316002)(55016002)(81166006)(336012)(6636002)(8676002)(7696005)(1076003)(2906002)(16526019)(186003)(70586007)(70206006)(956004);DIR:OUT;SFP:1101;SCL:1;SRVR:PR2PR08MB4748;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:Pass;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 20543342-6879-4001-2ed0-08d79e69d0be X-Forefront-PRVS: 0289B6431E X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RlbxfUGwAX7f2tjY/58ZOWc/S4IWmJ9FQn9HR0r5Xoprou0pXbGln7PtLP8nsvbWj6rBiOmj9VCnTDhBZR2RjnyM4OqqrnS+3gZN55lbEMXmBc5926L2tYGvPc0pjvjO2zYiEjyfsW6q3wHq1L39vmCupU8lnNeMGugxptY5Wzi7OBUGCdTBJCBoAeZf/RYo9t1yxftn7dfiwmLSq1lo1Fq78gggA09VSsdhm/BQYrKgI3lj8U84x8GMLvdhLOFCagRXvlzK4OQ/4XM8mbhdS0aEwmpu+U6epRYFOrvVJnC9RQQXrvcLB1LXOYHjCp4uwKh93r6b0hH5AnDlXvlmKE4a7oknUUfafXEcSLAlhdFxZt/f3DVs2/vCgxmfmth+gSYaTbK0EWtrA1ax4cMwzzA1cHhxIA12CYD/yx3mA6aR13AYn4ifMNZ4GVpKFV2W X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2020 12:02:50.6811 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4bb14467-71d1-459e-ffcb-08d79e69d6b7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4748 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: On Thu, Jan 16, 2020 at 12:15:34PM +0530, Anshuman Khandual wrote: > The arm64 page table dump code can race with concurrent modification of t= he > kernel page tables. When a leaf entries are modified concurrently, the du= mp > code may log stale or inconsistent information for a VA range, but this i= s > otherwise not harmful. > > When intermediate levels of table are freed, the dump code will continue = to > use memory which has been freed and potentially reallocated for another > purpose. In such cases, the dump code may dereference bogus addresses, > leading to a number of potential problems. > > Intermediate levels of table may by freed during memory hot-remove, > which will be enabled by a subsequent patch. To avoid racing with > this, take the memory hotplug lock when walking the kernel page table. > > Acked-by: David Hildenbrand > Acked-by: Mark Rutland > Signed-off-by: Anshuman Khandual Acked-by: Catalin Marinas IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.