linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: lijiang <lijiang@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>,
	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 <mingo@redhat.com>,
	hpa@zytor.com, luto@amacapital.net, Baoquan He <bhe@redhat.com>,
	Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH v2] x86/efi: unconditionally hold the whole low-1MB memory regions
Date: Mon, 31 May 2021 15:13:58 +0300	[thread overview]
Message-ID: <YLTTBpX13mWCysWx@kernel.org> (raw)
In-Reply-To: <CANU+ZyeFxeGXhxDx_ojB_hmiD-b8aTkqJcmc4fBHAS39vS7ZiQ@mail.gmail.com>

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.

  parent reply	other threads:[~2021-05-31 12:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  9:00 [PATCH v2] x86/efi: unconditionally hold the whole low-1MB memory regions Lianbo Jiang
2021-05-31  9:08 ` Borislav Petkov
2021-05-31  9:58   ` Mike Rapoport
2021-05-31 10:52     ` Borislav Petkov
     [not found]       ` <CANU+ZyeFxeGXhxDx_ojB_hmiD-b8aTkqJcmc4fBHAS39vS7ZiQ@mail.gmail.com>
2021-05-31 12:13         ` Mike Rapoport [this message]
2021-05-31 12:15       ` Mike Rapoport
2021-05-31 14:26         ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLTTBpX13mWCysWx@kernel.org \
    --to=rppt@kernel.org \
    --cc=andy@infradead.org \
    --cc=ardb@kernel.org \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dvhart@infradead.org \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=lijiang@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).