Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp284175pxb; Thu, 21 Jan 2021 07:06:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlevIaq9jGYGEli4qZ85smcI9GkOR4Uby5P2H5JJ+dX0n/TZJy24sqdcwQ7SXT9Kr6pCxb X-Received: by 2002:a05:6402:27d1:: with SMTP id c17mr11567870ede.109.1611241602255; Thu, 21 Jan 2021 07:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611241602; cv=none; d=google.com; s=arc-20160816; b=goVoP+14Q8Pthzik7irOPsvxdlP1z7P9g43DTlrOMeqdD5NqFiMoYpDDXQun6Yr7Ls /dwkYPmU1DxUqnFZjL8ROvuUK5scKvrUyl+vRwboS6gck4Q5h9wdVVzWRVEucEu2YQ9B 9mQ0i2eymrsa3rqTlgtnSYaECF8uCWG1S72hYoyvZYcRY01uNyClMZWCEhq13X0VC0pM fD1l9nxVhHA0db6GpUGBeTBIn1/Ng8DQ2R9AFks3RZkTbz2HM22ornoDQi/RMFd1+lpT tZRZicR45Vh7XQAhQvGLZyUMGbMKdc9CRT1bpryWU1FDyVAcEkSLfNE+VhTT/eqNGFDi VNlA== 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=jvlCWjXWGIBQt4nxHNiZRsf/XdhFBhdMgqMBnmemIms=; b=0BqJS2DS6FZxyTfX8c+w5T7SaDV5r4azTRTNcIItQbkuHQ/Is1NtT5DXxu8MDs+b2q VJt3u7OIbgncG0eBUZrpY25FI4X7n/ZZWOp96MYk+ncm/AvRq4K76M8ln2enmO9nGclj fed9xuN27X2tMzFulZ86bKMJ0LI0ymWFAEytdNd2zxB8ZG9X340BU1kmiUdU2j790XU9 5vGTeTrhvfwZLgFIlPw8unljn/TkO/F4WLo+MH5aigF2IQn+8BTVAZ7XKtX1SERSjtIu ChBwvNyBzOVCDR40pGxrk946raIDYvqfddVpnXfucGqAYD8+L4tJoM18soH1dVOQ/Dqt mfVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Ew7NXBrB; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz8si1873450ejb.237.2021.01.21.07.06.13; Thu, 21 Jan 2021 07:06:42 -0800 (PST) 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=@alien8.de header.s=dkim header.b=Ew7NXBrB; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731975AbhAUPEX (ORCPT + 99 others); Thu, 21 Jan 2021 10:04:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731979AbhAUN0a (ORCPT ); Thu, 21 Jan 2021 08:26:30 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 681C0C0613D3 for ; Thu, 21 Jan 2021 05:25:50 -0800 (PST) Received: from zn.tnic (p200300ec2f157500c7fc2d457faa3c9f.dip0.t-ipconnect.de [IPv6:2003:ec:2f15:7500:c7fc:2d45:7faa:3c9f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 252EA1EC009F; Thu, 21 Jan 2021 14:25:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1611235548; h=from:from: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:in-reply-to:in-reply-to: references:references; bh=jvlCWjXWGIBQt4nxHNiZRsf/XdhFBhdMgqMBnmemIms=; b=Ew7NXBrBdyvaPSXS0e25IBDdoFacN8Idm78Ih7jYiAVHIgu4k7ymmZXdxvZskpTqfgvmDd yNZ4MPQ15wzFtdv9a01fUcvhrwl7CKW1uDFc09AvDceOcgcloTWTmIdAbPa0KN23CevO8+ OwqI4IviHp4mXz9xvvEKQJp8JKFdxdk= Date: Thu, 21 Jan 2021 14:25:42 +0100 From: Borislav Petkov To: Mike Rapoport Cc: Andrew Morton , Andrea Arcangeli , Baoquan He , David Hildenbrand , "H. Peter Anvin" , Ingo Molnar , Mel Gorman , Michal Hocko , Mike Rapoport , Qian Cai , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: Re: [PATCH v3 1/2] x86/setup: don't remove E820_TYPE_RAM for pfn 0 Message-ID: <20210121132542.GB32060@zn.tnic> References: <20210111194017.22696-1-rppt@kernel.org> <20210111194017.22696-2-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210111194017.22696-2-rppt@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021 at 09:40:16PM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > The first 4Kb of memory is a BIOS owned area and to avoid its allocation > for the kernel it was not listed in e820 tables as memory. As the result, > pfn 0 was never recognised by the generic memory management and it is not a > part of neither node 0 nor ZONE_DMA. > > If set_pfnblock_flags_mask() would be ever called for the pageblock > corresponding to the first 2Mbytes of memory, having pfn 0 outside of > ZONE_DMA would trigger > > VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page); > > Along with reserving the first 4Kb in e820 tables, several first pages are > reserved with memblock in several places during setup_arch(). These > reservations are enough to ensure the kernel does not touch the BIOS area > and it is not necessary to remove E820_TYPE_RAM for pfn 0. > > Remove the update of e820 table that changes the type of pfn 0 and move the > comment describing why it was done to trim_low_memory_range() that reserves > the beginning of the memory. > > Signed-off-by: Mike Rapoport > --- > arch/x86/kernel/setup.c | 20 +++++++++----------- > 1 file changed, 9 insertions(+), 11 deletions(-) FWIW, Acked-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette