Received: by 10.192.165.156 with SMTP id m28csp329749imm; Mon, 16 Apr 2018 00:21:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48RcxSeq/97Xdtn+TKeA0ZQjL0jul8v9FB4PZPDAgGZyqX47CfzEw7LE7QmXwtFM6HmZG1i X-Received: by 2002:a17:902:7042:: with SMTP id h2-v6mr14453256plt.249.1523863262319; Mon, 16 Apr 2018 00:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523863262; cv=none; d=google.com; s=arc-20160816; b=S5uIIg07QTQ/6wEdc2tWsFugNA3p0TzVCk/CyQUf/r6VDTk1fymI5qguvBaVa3kre1 KJAN/tlsVT/S/WbrUZHvq5sNJ8+XVnN4tLE6w5hcN0n0ANimVW1BOTlLTZ3iu9xr7cMw BR++Nuoues0K6oWUy5ETZBPQph6PDpAvqTisV0O5cwmY6meZA5W7490HXiVAgkl/lR0+ 9t6HziVoj92HfBVSHJBVSMSmCYqS3PmnCsFpkp7h5WG8WV/eP1o6wntMvqXD8pNvEzUV +CmaOHr7B8LzDBM5ir0e/PWkjdH9lk4lbh/aQTRgxRAHraIYBovEDV+a3oUqafTuh6Ax 2sJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=LwndOgmuS7d4XDPlBdGN/rtZ1OcibyzXJ3UehWY82jw=; b=ayyRVA6xEZWl5PnfBHf97GExZ+6NclJ0Y/n1ITI4m0k3XjDg+KukvPYyN3npI5PPYn zOttWe79vbBwbLulCP+Wcz7N4ejIwmd4vJyDwLNMcr2RAC2GaDmMLwdRbuwrb8J31yJ0 1N7+xfQpGtqeQy2aAVYjTiasE8dWHPv0VJeoNIdEQ+cBE8pSnB+Un+2Yr5FqEF6iUOah ztbQJ3KxyeJwY9xvvBwF9H2TFYsLWrsMVjgAxTr30WeGrd0GD9GS1uLxKF/YYL+BevBv EkXIi7bGR+9hqrtZYv8aQVPIq9vU0gE9wfEMtS8gCd9UVhTtY2HhrKoS14zoIMP9HVEO +dXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l33-v6si10957903pld.100.2018.04.16.00.20.06; Mon, 16 Apr 2018 00:21:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751200AbeDPGhv (ORCPT + 99 others); Mon, 16 Apr 2018 02:37:51 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:43320 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeDPGhu (ORCPT ); Mon, 16 Apr 2018 02:37:50 -0400 Received: from linux-l9pv.suse (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 16 Apr 2018 08:37:44 +0200 Date: Mon, 16 Apr 2018 14:37:38 +0800 From: joeyli To: Randy Wright Cc: "Lee, Chun-Yi" , linux-efi@vger.kernel.org, Ard Biesheuvel , Takashi Iwai , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Randy Wright , Ingo Molnar , akpm@linux-foundation.org, Vivek Goyal , Dave Young Subject: Re: [PATCH] efi: Fix the size not consistent issue when unmapping memory map Message-ID: <20180416063738.GH16023@linux-l9pv.suse> References: <20180413062716.8040-1-jlee@suse.com> <20180416025734.GA26685@dhcp-128-65.nay.redhat.com> <20180416030904.GB26685@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180416030904.GB26685@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;