Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4435801pxt; Wed, 11 Aug 2021 06:08:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw27y8wY29UVGmrvZiQN5FuzrqE6qClWY1mhak9bs7oFhC72bBw56OyDtzCPwNaRXJ5J7Qn X-Received: by 2002:a05:6402:202:: with SMTP id t2mr11328496edv.116.1628687313559; Wed, 11 Aug 2021 06:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628687313; cv=none; d=google.com; s=arc-20160816; b=MOb54KiNOXOy77JWfuMWzDXmCahRdn9Nfg75mLwpPTV8BQaqKjouRV0/gIdenOJqOh uohZ1YLO4edyMFtZTdXZJJZbpJOjX3uWpe1v5M4ZiyrAEHFWmzRu5nvFslY5wu6413n3 +7D+5I5NXx9QWKhaHRnqJRIPmV0oLEZ13Ex4Qr21Qh4yGzpgNFVQvpW9eqfZR1PGtOIQ hxjw6deIFnMVcPhYUhFtk4g1G7czyl3fkxiRq/UhFhIaOBmyGtKsiuh/9nI+p8F5USjK ZUoorM6o9e95vrXJQ1fsGCDYhzdA5pLSQXUNCWyC2+kfm1+0ZKE7EDFHmuk5X4+S5MWf 98Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FpGxGOSNc4uc9L1UcwRdgu1DrgwsZI4V7cfr8fZ7QFY=; b=M5VZNfwuWWssU/891aPyqhC7ke66SpNMdzWOkRIWbn5MJsq/xZyqPdFMIrKGDABsiH BZ/x+bRfjKmSW6cdpybkifGJJRz5e14KcOGlWDhzKZMigFpfD2bHQfKoTO2yyUhV1yPl 6iwOta5qNhDDJcjaXwoYIQwILxdenLpO12Y+S/j9gUISqMxmCH/mykVGBM8htmdtgkx9 /M16zUqXAYdZidTe0X4jHi90zINOsspiGqKHwyVyy612qfHPIZQd12tkmZNUs5LTMoJs WbfVOSiWvEKNgDRl2sg86XSuCge61E6z2kG8N/3C72XAn4feIIYmLmTBKX2zUD/K3nwV CUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MQAisoLx; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk43si5769646ejc.325.2021.08.11.06.08.07; Wed, 11 Aug 2021 06:08:33 -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=@kernel.org header.s=k20201202 header.b=MQAisoLx; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbhHKNHF (ORCPT + 99 others); Wed, 11 Aug 2021 09:07:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:59036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhHKNHF (ORCPT ); Wed, 11 Aug 2021 09:07:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 51BCE60C3E; Wed, 11 Aug 2021 13:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628687201; bh=fUdCaZhvGvtDwxEeWOdI/KcN6FC3y269PQqOnHZl3TY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MQAisoLx/fo1hl4kc2JFXTkyx9v7c/vCodrtecfFN4CAB93vjWPyhEmwDRUt8M7Mc pmCeLqpZXP8x5T+uvbEs8ivM79gqkLYSQ9EOhdXFrUu0CJpJQEkvofeqsiJ1mXFFGz u2g4TzL5u1cJPFFggsbGEZAhJtw6/xhrwWdL0N8bNu7CP7v7QguarFud0otPoIFFS1 rnnguFpt8Z9jXHCcswcXDTp3olUB2fjCdpgmGrjg97G8t+Arwv2u5EDl7OMB6JuDvK ThwCsvaOOqkz61YxXi2ibIV+FlJzlNdKKei6k/AldAGf4xSZzbX4ST4mlOhP9CH4n0 xRvfZAuFbY+hw== Date: Wed, 11 Aug 2021 16:06:36 +0300 From: Mike Rapoport To: Geert Uytterhoeven Cc: Andrew Morton , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memblock: Check memory add/cap ordering Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 10:55:18AM +0200, Geert Uytterhoeven wrote: > For memblock_cap_memory_range() to work properly, it should be called > after memory is detected and added to memblock with memblock_add() or > memblock_add_node(). If memblock_cap_memory_range() would be called > before memory is registered, we may silently corrupt memory later > because the crash kernel will see all memory as available. > > Print a warning and bail out if ordering is not satisfied. > > Suggested-by: Mike Rapoport > Signed-off-by: Geert Uytterhoeven Applied for 5.15, Thanks! -- Sincerely yours, Mike.