From patchwork Thu Oct 21 07:09:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12574045 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70BDDC433EF for ; Thu, 21 Oct 2021 07:09:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 21C21606A5 for ; Thu, 21 Oct 2021 07:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 21C21606A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9F03A6B0071; Thu, 21 Oct 2021 03:09:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 978C86B0072; Thu, 21 Oct 2021 03:09:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8409A6B0073; Thu, 21 Oct 2021 03:09:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id 70D856B0071 for ; Thu, 21 Oct 2021 03:09:37 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 13E652D4C1 for ; Thu, 21 Oct 2021 07:09:37 +0000 (UTC) X-FDA: 78719569194.22.0886C0A Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf21.hostedemail.com (Postfix) with ESMTP id B6B19D0425FE for ; Thu, 21 Oct 2021 07:09:34 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F44860F5D; Thu, 21 Oct 2021 07:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634800175; bh=WahHG7+6RXOXTd5cHlv0M9Y1+G6DfOieSCDRmVXCyIA=; h=From:To:Cc:Subject:Date:From; b=eWjBh8zUKltk76y12P+nyZzRYcc2fXKUPWlEGeKgYOTEVt4+MoEIHF+U2iVQaIzHR 50pirqvzlxGXVd2AMVKlqtysTKIAiMyhZQMwJT3daXJCVO1V3mWeIX+uizz4LOLLBB 33Zcm6ZBapVUIXSTR0e1E1WeZMO92Bkvgm7FzR9MH+DYQKpay61IG86B9zcBbRi2BX nP3R8CLHklQlRpzSirmFUR/s3vsJegvgj6N+6ePrajIG0KI3fvwWhUmxtQSnu+nf1f 8wcNgVsfRg6k1T+r2LK0yP0H/CqaC8kwgg43ONV5vtkYrrezlsshMU7SNpwAsyhW17 360T2dUhi7jPg== From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Linus Torvalds , Mike Rapoport , Mike Rapoport , Qian Cai , Vladimir Zapolskiy , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] memblock: exclude MEMBLOCK_NOMAP regions from kmemleak Date: Thu, 21 Oct 2021 10:09:27 +0300 Message-Id: <20211021070929.23272-1-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B6B19D0425FE X-Stat-Signature: ozgkndr1ezpztewu496wtsqtw3osqfa5 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eWjBh8zU; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1634800174-361570 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: From: Mike Rapoport Hi, This is take 2 to fix interaction between MEMBLOCK_NOMAP and kmemleak. The previous version caused boot failures Qian Cai reported here: https://lore.kernel.org/all/c30ff0a2-d196-c50d-22f0-bd50696b1205@quicinc.com The failures happened because calling kmemleak_free_part_phys() (or any kmemleak phys APIs for that matter) too early means it cannot use __va() on arm64. This late in the cycle I can only think of reverting kmemleak wavier from memblock_mark_nomap() and putting it in the only two callers that set MEMBLOCK_NOMAP to an allocated chunk rather than marking NOMAP "unusable" memory reported by firmware. The first patch here is the revert of v1 and the second patch is actual v2 implementation. Vladimir and Qian, I'd appreciate if you could verify that v2 works for you. v2: * move kmemleak waiver from memblock_mark_nomap() to callers that need it * use kmemleak_ignore_phys() rather than kmemleak_free_part_phys() as Catalin suggested. v1: https://lore.kernel.org/all/20211013054756.12177-1-rppt@kernel.org Mike Rapoport (2): Revert "memblock: exclude NOMAP regions from kmemleak" memblock: exclude MEMBLOCK_NOMAP regions from kmemleak drivers/acpi/tables.c | 3 +++ drivers/of/of_reserved_mem.c | 2 ++ mm/memblock.c | 10 ++++------ 3 files changed, 9 insertions(+), 6 deletions(-) base-commit: 519d81956ee277b4419c723adfb154603c2565ba