Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1464379

Re: [PATCH v2 2/2] kexec: Consider crashk_low_res in sanity_check_segment_list()

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Dave Young <dyoung@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] kexec: Consider crashk_low_res in sanity_check_segment_list()
Date Wed, 17 Aug 2016 09:30:02 +0200
Message-ID <s73su-6je-13@gated-at.bofh.it> (permalink)
References <s6Yj7-2C8-5@gated-at.bofh.it> <s6Yj7-2C8-7@gated-at.bofh.it>
X-Original-To Xunlei Pang <xlpang@redhat.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.6.2 (2016-07-01)
X-Scanned-By MIMEDefang 2.68 on 10.5.11.22
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Aug 2016 07:24:28 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 56
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, kexec@lists.infradead.org, akpm@linux-foundation.org, ebiederm@xmission.com, Vivek Goyal <vgoyal@redhat.com>, Baoquan He <bhe@redhat.com>
X-Original-Date Wed, 17 Aug 2016 15:24:20 +0800
X-Original-Message-ID <20160817072420.GD5498@dhcp-128-65.nay.redhat.com>
X-Original-References <1471398657-20237-1-git-send-email-xlpang@redhat.com> <1471398657-20237-2-git-send-email-xlpang@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1464379

Show key headers only | View raw


Hi, Xunlei,

On 08/17/16 at 09:50am, Xunlei Pang wrote:
> We have crashk_res only in most cases, but sometimes we have
> crashk_low_res.
> 
> For example, on 64-bit x86 systems, when "crashkernel=32M,high"
> combined with "crashkernel=128M,low" is used, so some segments
> may have the chance to be loaded into crashk_low_res area. We
> can't fail it as a memory violation in these cases.
> 
> Thus, we add the case to regard the segment as valid if it is
> within crashk_low_res.

crashkernel low is meant for swiotlb, it can be reserved automaticlly
in case there's only crashkernel high specified in cmdline, I'm not
sure it is useful to use crashk_res_low for other purpose and
likely kdump can fail in the case. 

I'm not sure it is really necessary to add this check now, we may
handle it only when there is an actual use case and bug report in
the future.

Thanks
Dave
> 
> Signed-off-by: Xunlei Pang <xlpang@redhat.com>
> ---
>  kernel/kexec_core.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 707d18e..9012a60 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -248,9 +248,14 @@ int sanity_check_segment_list(struct kimage *image)
>  			mstart = image->segment[i].mem;
>  			mend = mstart + image->segment[i].memsz - 1;
>  			/* Ensure we are within the crash kernel limits */
> -			if ((mstart < phys_to_boot_phys(crashk_res.start)) ||
> -			    (mend > phys_to_boot_phys(crashk_res.end)))
> -				return -EADDRNOTAVAIL;
> +			if ((mstart >= phys_to_boot_phys(crashk_res.start)) &&
> +			    (mend <= phys_to_boot_phys(crashk_res.end)))
> +				continue;
> +			if ((mstart >= phys_to_boot_phys(crashk_low_res.start)) &&
> +			    (mend <= phys_to_boot_phys(crashk_low_res.end)))
> +				continue;
> +
> +			return -EADDRNOTAVAIL;
>  		}
>  	}
>  
> -- 
> 1.8.3.1
> 

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/2] kexec: Introduce "/sys/kernel/kexec_crash_low_size" Xunlei Pang <xlpang@redhat.com> - 2016-08-17 04:00 +0200
  [PATCH v2 2/2] kexec: Consider crashk_low_res in sanity_check_segment_list() Xunlei Pang <xlpang@redhat.com> - 2016-08-17 04:00 +0200
    Re: [PATCH v2 2/2] kexec: Consider crashk_low_res in  sanity_check_segment_list() Dave Young <dyoung@redhat.com> - 2016-08-17 09:30 +0200
      Re: [PATCH v2 2/2] kexec: Consider crashk_low_res in  sanity_check_segment_list() Xunlei Pang <xpang@redhat.com> - 2016-08-17 09:50 +0200
  Re: [PATCH v2 1/2] kexec: Introduce  "/sys/kernel/kexec_crash_low_size" Dave Young <dyoung@redhat.com> - 2016-08-17 10:30 +0200
    Re: [PATCH v2 1/2] kexec: Introduce "/sys/kernel/kexec_crash_low_size" Yinghai Lu <yinghai@kernel.org> - 2016-08-24 03:20 +0200
      Re: [PATCH v2 1/2] kexec: Introduce  "/sys/kernel/kexec_crash_low_size" Dave Young <dyoung@redhat.com> - 2016-08-24 10:30 +0200
        Re: [PATCH v2 1/2] kexec: Introduce  "/sys/kernel/kexec_crash_low_size" Xunlei Pang <xpang@redhat.com> - 2016-08-24 13:50 +0200

csiph-web