Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp381200pxb; Thu, 21 Oct 2021 01:08:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweYkUc5NJUtiH/ByC6azWAarrj1LREKv6rDwxVGSO8BT4lEM9OluFJBnjiBtBxiEsOYg6h X-Received: by 2002:a50:e1cf:: with SMTP id m15mr5636524edl.309.1634803718302; Thu, 21 Oct 2021 01:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634803718; cv=none; d=google.com; s=arc-20160816; b=Jdvnq2YQRJRJZIvZC5YTLaasm4w566wh39iR4GUIWQ3dDK0fgb62ClLB55CzdMHHED WX+kSbgzNYsKLJdVthnTh6nvoHe0gcndQyt/vodgGLTfYcMUMth+NlNYUHmZN6XIHc2B 4G6BNSbwMHs1F/ektoINhmyx7wx+WCPKK+vjQCr+VUAQyqQgy3q+Q9IDv4x18ppBxYzv 6m0QgBHzSOiZOPYp+rlSSZTt7lwIswHeXrQz/xtYE6GllHgkARWY0/4PPxRoBVfhyhl9 9IBrGJMvTMPZA8WGNNB0DrqUjHjEsLFLCwFNV8pNozB6jMF+P0F8HBF+clwE/aBjWmz1 fyBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=WVuVc/pTL60G1S+pyJWiP1YTmMHNb2+xE6ALYVAi/xw=; b=q69KNeAMOtDeW8G5sYkUvEU3UGTjKt/mcFREEUy8r+KZh4NCpmolm1Mfa+2jSEqHXD oV5MoiQ6kTCTFNhyStDEEshhxX63X2wsC8ac50gQqK3GRA8ZW098ckNFCfG++Frl260b yZvGrKYEbN559kpS0wATNtbBzJUx8oJRZ4B8v4EbIXnpkK3BklXxYu8gJtpNFAlr/G4t TcKbUEHHbpn2x2laLatjQVta0172MQ7fuTX0GDrRdtohHzuM6cbNYMWai+e2lTjqKHF9 IaRhlT11ULLfSKyeN/eg9jZAks8BXUjoVB+Mdr8CVh2+pFe3DZ+0waWWB2GmXRU8k0jr uMTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IEEro4gN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr23si8329180ejc.465.2021.10.21.01.08.14; Thu, 21 Oct 2021 01:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IEEro4gN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231428AbhJUIGb (ORCPT + 99 others); Thu, 21 Oct 2021 04:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231158AbhJUIG3 (ORCPT ); Thu, 21 Oct 2021 04:06:29 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68875C061749 for ; Thu, 21 Oct 2021 01:04:13 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id x27so832906lfu.5 for ; Thu, 21 Oct 2021 01:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WVuVc/pTL60G1S+pyJWiP1YTmMHNb2+xE6ALYVAi/xw=; b=IEEro4gNH3DIejCXpe0LTEo03FXaRhBYkaROjLXCHDflecMHf3lv+ZnmPuKnlnT5Fy je52KNQ/4D9i2+nXYvvuP+an1Pnlw7PxN4XUfbxmSd1diABe1aysqs6pFnLw0TQalFe6 Vb0q1sKA7Q/KMsvD+g9kIlKuxrBAdqSDmOUHhclAI52k5RjWxo1RpFfwMIVTAUG5Tqpv lmd65eKglHQZDWRKqtpnDYnUPHiF9jt7Oq67BAwl1HYkwfS4SSPZ0vYVIhqMHhCaMpm+ eoPoiDcs2osNu6vsHNgwY4FzxNKjBkhWPi/d8z/Q37rh46hLiVx/SqVJlpmWiMrVxDsb 0gyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WVuVc/pTL60G1S+pyJWiP1YTmMHNb2+xE6ALYVAi/xw=; b=qzihnj8qs4f7OI44/dQpFbn+gIuPvm0YT4ETNDrdnBQwHyIMiZQC3HNLKMKRMYSrmn acd7Nc7rEZXOKaZk783mk6TZHGeg/LG8FEMDudZYowQCa/foCmqykfngLFwCfLLmAtxK 00LZaXvU79t37Y03PCxYAvchcgwATDSi6nh/OBXLa+xLmpquEmy91C0+k55Fp0yiX9Ve 1qHtU6o5mypu0XmXIruCmx6y1Cjmq6lsUnLKZN7olF6Jk2r6n49wkuew4tVeS3iSY1OK voBvbvyRIIgyluz3Wb1Yj2pHaaVqJXrPOijuHzcX/3DLMKHpvwSOwCQ87LYr/IbDrZFW gjPw== X-Gm-Message-State: AOAM530mBb8GBe3npuxUoJt6K0S6zfNUAAsVs0fIHiuI/hBipCIeLWre 5W7g/QUIqjYYLI9ZPdtduIhDyOFUAbE48g== X-Received: by 2002:a05:6512:3055:: with SMTP id b21mr4173674lfb.316.1634803451737; Thu, 21 Oct 2021 01:04:11 -0700 (PDT) Received: from [192.168.1.102] (62-248-207-242.elisa-laajakaista.fi. [62.248.207.242]) by smtp.gmail.com with ESMTPSA id u25sm391601lfr.279.2021.10.21.01.04.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 01:04:11 -0700 (PDT) Subject: Re: [PATCH v2 2/2] memblock: exclude MEMBLOCK_NOMAP regions from kmemleak To: Mike Rapoport , linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Linus Torvalds , Mike Rapoport , Qian Cai , linux-kernel@vger.kernel.org References: <20211021070929.23272-1-rppt@kernel.org> <20211021070929.23272-3-rppt@kernel.org> From: Vladimir Zapolskiy Message-ID: <5fb2f209-e048-f6f9-4ad3-96645d23fce8@linaro.org> Date: Thu, 21 Oct 2021 11:03:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20211021070929.23272-3-rppt@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mike, On 10/21/21 10:09 AM, Mike Rapoport wrote: > From: Mike Rapoport > > Vladimir Zapolskiy reports: > > commit a7259df76702 ("memblock: make memblock_find_in_range method private") > invokes a kernel panic while running kmemleak on OF platforms with nomaped > regions: > > Unable to handle kernel paging request at virtual address fff000021e00000 > [...] > scan_block+0x64/0x170 > scan_gray_list+0xe8/0x17c > kmemleak_scan+0x270/0x514 > kmemleak_write+0x34c/0x4ac > > The memory allocated from memblock is registered with kmemleak, but if it > is marked MEMBLOCK_NOMAP it won't have linear map entries so an attempt to > scan such areas will fault. > > Ideally, memblock_mark_nomap() would inform kmemleak to ignore > MEMBLOCK_NOMAP memory, but it can be called before kmemleak interfaces > operating on physical addresses can use __va() conversion. > > Make sure that functions that mark allocated memory as MEMBLOCK_NOMAP take > care of informing kmemleak to ignore such memory. > > Link: https://lore.kernel.org/all/8ade5174-b143-d621-8c8e-dc6a1898c6fb@linaro.org > Link: https://lore.kernel.org/all/c30ff0a2-d196-c50d-22f0-bd50696b1205@quicinc.com > Fixes: a7259df76702 ("memblock: make memblock_find_in_range method private") > Reported-by: Vladimir Zapolskiy > Signed-off-by: Mike Rapoport this change variant also solves the reported problem, thank you. Tested-by: Vladimir Zapolskiy -- Best wishes, Vladimir