Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2551717pxj; Mon, 31 May 2021 05:15:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybyJHeiGK58vmRLkFX+ZdWLhfWRSTeBJTbAUyGfoI8EogCI9ZRqAynRWVUIzHn/5X4fji3 X-Received: by 2002:a02:83c2:: with SMTP id j2mr20429073jah.6.1622463308340; Mon, 31 May 2021 05:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622463308; cv=none; d=google.com; s=arc-20160816; b=0LI25/qItefOlLxX0787XnwHp59gYeU4/oA6CerS1xw+LJMuBqwtpqITH7mrqOpk6P o8dDCRwqVBSpp6FWVZsNfh9NKWoR7PxeSUHrCLhEjCGdULLdtCM4n9FcUAkUd4W/PJ1x W2s4ASB84EDRkpFVXpLtAC0k1mvW9tV6sDA7exFztEmXrlOL11PKwZSon0NkFNP4XPrP zvfUaWMaQSAIKL14+0TfxAPlhoVfh9KlT/pCow1WiERP2NmLP6IFYhXrwKx1ZEU4CmnZ RX5Vo1e1sAcRDiS6aCr6zW9LwhFLRSnrnMEDRCjzQJInsd1QhYZbMkfjNCDjarKLsCV1 8DhQ== 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=AE/NoDfksnJG2xX6YHW0t9iyyjyX3u3c62H04TKqHgM=; b=xlcapO+FPsn15CXMDXKOtiQXp8K0TDt75Hs4cRMGRdKf/JCHEMgeZzJtK81QeHfB4O nggWSv03YsgiWbQprA0nP4VbZ16uFatV5N5NXdDUv0pvW1MLQGFbFvGlwzwEc72IBaHD TXP2DI4fVVXyCuRZLBImXMPorUV8N1MZwhesx2zd8fvMfoCkWNnD0N3mPTW7YRlX1f1Q 39OoLR3FQYHsCeXwjHcLUzQt7S8YuIfSsBa2rid3gnoglYMCKFGd8eZjgrmxbO2DaZax eUniY7YZxlQLcuppa/duFnGiyu4qduEvJdE9pOTJtfQJNaPagWVnNH5alssASLRZi4wM g5cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FufOfm6J; 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 a23si13689016jap.18.2021.05.31.05.14.55; Mon, 31 May 2021 05:15:08 -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=FufOfm6J; 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 S231501AbhEaMPt (ORCPT + 99 others); Mon, 31 May 2021 08:15:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:35404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbhEaMPs (ORCPT ); Mon, 31 May 2021 08:15:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 816FA611CB; Mon, 31 May 2021 12:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622463248; bh=aJqByJbF/rFKmsSRS5lwvYsm0YCBd40N7Fa8DEM41g0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FufOfm6Jbh2nbcp+IzqxGu9pj+hjBulvwWfVDgda+qtyujG5ZEUZkl2z3RO/+2kkN 0hYlqJFDjmDbygmyvcjAk3QVQD4DyaQRaSQ7n3EIQcvQ0cLrXNB2GK1SUjFHO8RVHU 0d8amqxMT4YHHszA+3U1PAH2yqZHRKXHgpxm5fqYbv7DUNlg0ckCX+4z4akCfzqmBz qSUWtAiDqRiGsAAJLPBQbrXICcfr1NtW0sUYpsWrFWMDh0oO7wyMEsgWaLu4u2mz1n Dt48+lXPNsr56Y1KoeTU5+oGhJw6CyaSzDqo9A5I/Y2NwnSwKeBrZA5T7nGdbBva3B iFSzFQn/h+gVA== Date: Mon, 31 May 2021 15:13:58 +0300 From: Mike Rapoport To: lijiang Cc: Borislav Petkov , linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, kexec@lists.infradead.org, ardb@kernel.org, dvhart@infradead.org, andy@infradead.org, tglx@linutronix.de, Ingo Molnar , hpa@zytor.com, luto@amacapital.net, Baoquan He , Dave Young Subject: Re: [PATCH v2] x86/efi: unconditionally hold the whole low-1MB memory regions Message-ID: References: <20210531090023.16471-1-lijiang@redhat.com> 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 Mon, May 31, 2021 at 07:00:59PM +0800, lijiang wrote: > Thank you for the information, Boris and Mike. > > BTW: I just noticed that Mike's patch is incorrect, maybe it's a typo: > diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c > index 7850111008a8b..e262ca858787f 100644 > --- a/arch/x86/platform/efi/quirks.c > +++ b/arch/x86/platform/efi/quirks.c > @@ -450,6 +450,18 @@ void __init efi_free_boot_services(void) > size -= rm_size; > } > + /* > + * Don't free memory under 1M for two reasons: > + * - BIOS might clobber it > + * - Crash kernel needs it to be reserved > + */ > + if (start + size < SZ_1M) > + continue; > + if (start < SZ_1M) { > + size -= (start - SZ_1M); > ^^^^^^^^^^^^^^^^^^^^^^^^ > > It looks like: size -= (SZ_1M - start); Right, thanks! > + start = SZ_1M; > + } > + > memblock_free_late(start, size); > } > > Mike's patch link: > https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?h=x86/ > reservelow&id=479fb34676ac448529b605854cf48c007e796ccd -- Sincerely yours, Mike.