From: joeyli <jlee@suse.com>
To: Randy Wright <rwright@hpe.com>
Cc: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>,
linux-efi@vger.kernel.org,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Takashi Iwai <tiwai@suse.de>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
Randy Wright <rwright@hpe.com>, Ingo Molnar <mingo@redhat.com>,
akpm@linux-foundation.org, Vivek Goyal <vgoyal@redhat.com>,
Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH] efi: Fix the size not consistent issue when unmapping memory map
Date: Mon, 16 Apr 2018 14:37:38 +0800 [thread overview]
Message-ID: <20180416063738.GH16023@linux-l9pv.suse> (raw)
In-Reply-To: <20180416030904.GB26685@dhcp-128-65.nay.redhat.com>
Hi Randy,
On Mon, Apr 16, 2018 at 11:09:04AM +0800, Dave Young wrote:
> On 04/16/18 at 10:57am, Dave Young wrote:
> > On 04/13/18 at 02:27pm, Lee, Chun-Yi wrote:
> > > When using kdump, SOMETIMES the "size not consistent" warning message
> > > shows up when the crash kernel boots with early_ioremap_debug parameter:
> > >
> > > WARNING: CPU: 0 PID: 0 at ../mm/early_ioremap.c:182 early_iounmap+0x4f/0x12c()
> > > early_iounmap(ffffffffff200180, 00000118) [0] size not consistent 00000120
> > >
[...snip]
> >
> > Good catch. The kexec code need to be fixed to use a separate buffer so
> > avoid the alignment like what kexec-tools did. I can submit a fix for
> > that.
>
> Can you try below code, see if it works?
>
Randy, do you want to try Dave's kexec patch on your environment? Please remove
my patch first.
Thanks a lot!
Joey Lee
>
> diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
> index 3182908b7e6c..eaee37c54b7b 100644
> --- a/arch/x86/kernel/kexec-bzimage64.c
> +++ b/arch/x86/kernel/kexec-bzimage64.c
> @@ -398,11 +398,10 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
> * little bit simple
> */
> efi_map_sz = efi_get_runtime_map_size();
> - efi_map_sz = ALIGN(efi_map_sz, 16);
> params_cmdline_sz = sizeof(struct boot_params) + cmdline_len +
> MAX_ELFCOREHDR_STR_LEN;
> params_cmdline_sz = ALIGN(params_cmdline_sz, 16);
> - kbuf.bufsz = params_cmdline_sz + efi_map_sz +
> + kbuf.bufsz = params_cmdline_sz + ALIGN(efi_map_sz, 16)+
> sizeof(struct setup_data) +
> sizeof(struct efi_setup_data);
>
> @@ -410,7 +409,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
> if (!params)
> return ERR_PTR(-ENOMEM);
> efi_map_offset = params_cmdline_sz;
> - efi_setup_data_offset = efi_map_offset + efi_map_sz;
> + efi_setup_data_offset = efi_map_offset + ALIGN(efi_map_sz, 16);
>
> /* Copy setup header onto bootparams. Documentation/x86/boot.txt */
> setup_header_size = 0x0202 + kernel[0x0201] - setup_hdr_offset;
next prev parent reply other threads:[~2018-04-16 6:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 6:27 [PATCH] efi: Fix the size not consistent issue when unmapping memory map Lee, Chun-Yi
2018-04-16 2:57 ` Dave Young
2018-04-16 3:09 ` Dave Young
2018-04-16 6:37 ` joeyli [this message]
2018-04-17 0:35 ` Randy Wright
2018-04-17 1:20 ` joeyli
2018-04-17 2:41 ` Dave Young
2018-04-17 20:34 ` Randy Wright
2018-04-16 6:34 ` joeyli
2018-05-02 6:17 Lee, Chun-Yi
2018-05-03 12:05 ` Ard Biesheuvel
2018-05-04 7:29 ` joeyli
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=20180416063738.GH16023@linux-l9pv.suse \
--to=jlee@suse.com \
--cc=akpm@linux-foundation.org \
--cc=ard.biesheuvel@linaro.org \
--cc=dyoung@redhat.com \
--cc=joeyli.kernel@gmail.com \
--cc=kexec@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rwright@hpe.com \
--cc=tiwai@suse.de \
--cc=vgoyal@redhat.com \
/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).