All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] kdump: fix an error that can not parse the e820 reserved region
@ 2018-09-06  5:56 Lianbo Jiang
  2018-09-07  1:05 ` Dave Young
  0 siblings, 1 reply; 5+ messages in thread
From: Lianbo Jiang @ 2018-09-06  5:56 UTC (permalink / raw)
  To: kexec; +Cc: horms, dyoung

When kexec-tools load the kernel and initramfs for kdump, kexec-tools will
read /proc/iomem and recreate the e820 ranges for kdump kernel. But it fails
to parse the e820 reserved region, because the memcmp() is case sensitive
when comparing the string. In fact, it may be "Reserved" or "reserved" in
the /proc/iomem, so we have to fix these cases.

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
---
 kexec/arch/i386/crashdump-x86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 437e8a8..140f45b 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -289,6 +289,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
 			type = RANGE_PMEM;
 		} else if(memcmp(str,"reserved\n",9) == 0 ) {
 			type = RANGE_RESERVED;
+		} else if (memcmp(str, "Reserved\n", 9) == 0) {
+			type = RANGE_RESERVED;
 		} else if (memcmp(str, "GART\n", 5) == 0) {
 			gart_start = start;
 			gart_end = end;
-- 
2.17.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kdump: fix an error that can not parse the e820 reserved region
  2018-09-06  5:56 [PATCH v2] kdump: fix an error that can not parse the e820 reserved region Lianbo Jiang
@ 2018-09-07  1:05 ` Dave Young
  2018-10-02 12:02   ` Simon Horman
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Young @ 2018-09-07  1:05 UTC (permalink / raw)
  To: Lianbo Jiang; +Cc: horms, kexec

On 09/06/18 at 01:56pm, Lianbo Jiang wrote:
> When kexec-tools load the kernel and initramfs for kdump, kexec-tools will
> read /proc/iomem and recreate the e820 ranges for kdump kernel. But it fails
> to parse the e820 reserved region, because the memcmp() is case sensitive
> when comparing the string. In fact, it may be "Reserved" or "reserved" in
> the /proc/iomem, so we have to fix these cases.
> 
> Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
> ---
>  kexec/arch/i386/crashdump-x86.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 437e8a8..140f45b 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -289,6 +289,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
>  			type = RANGE_PMEM;
>  		} else if(memcmp(str,"reserved\n",9) == 0 ) {
>  			type = RANGE_RESERVED;
> +		} else if (memcmp(str, "Reserved\n", 9) == 0) {
> +			type = RANGE_RESERVED;
>  		} else if (memcmp(str, "GART\n", 5) == 0) {
>  			gart_start = start;
>  			gart_end = end;
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

Reviewed-by: Dave Young <dyoung@redhat.com>

Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kdump: fix an error that can not parse the e820 reserved region
  2018-09-07  1:05 ` Dave Young
@ 2018-10-02 12:02   ` Simon Horman
  2018-10-02 12:10     ` Dave Young
  2018-10-08  4:57     ` lijiang
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Horman @ 2018-10-02 12:02 UTC (permalink / raw)
  To: Dave Young; +Cc: kexec, Lianbo Jiang

On Fri, Sep 07, 2018 at 09:05:50AM +0800, Dave Young wrote:
> On 09/06/18 at 01:56pm, Lianbo Jiang wrote:
> > When kexec-tools load the kernel and initramfs for kdump, kexec-tools will
> > read /proc/iomem and recreate the e820 ranges for kdump kernel. But it fails
> > to parse the e820 reserved region, because the memcmp() is case sensitive
> > when comparing the string. In fact, it may be "Reserved" or "reserved" in
> > the /proc/iomem, so we have to fix these cases.
> > 
> > Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
> > ---
> >  kexec/arch/i386/crashdump-x86.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> > index 437e8a8..140f45b 100644
> > --- a/kexec/arch/i386/crashdump-x86.c
> > +++ b/kexec/arch/i386/crashdump-x86.c
> > @@ -289,6 +289,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
> >  			type = RANGE_PMEM;
> >  		} else if(memcmp(str,"reserved\n",9) == 0 ) {
> >  			type = RANGE_RESERVED;
> > +		} else if (memcmp(str, "Reserved\n", 9) == 0) {
> > +			type = RANGE_RESERVED;
> >  		} else if (memcmp(str, "GART\n", 5) == 0) {
> >  			gart_start = start;
> >  			gart_end = end;
> > -- 
> > 2.17.1
> > 
> > 
> > _______________________________________________
> > kexec mailing list
> > kexec@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec
> 
> Reviewed-by: Dave Young <dyoung@redhat.com>

Sorry for letting this slip through the cracks.
I've applied this now.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kdump: fix an error that can not parse the e820 reserved region
  2018-10-02 12:02   ` Simon Horman
@ 2018-10-02 12:10     ` Dave Young
  2018-10-08  4:57     ` lijiang
  1 sibling, 0 replies; 5+ messages in thread
From: Dave Young @ 2018-10-02 12:10 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec, Lianbo Jiang

On 10/02/18 at 02:02pm, Simon Horman wrote:
> On Fri, Sep 07, 2018 at 09:05:50AM +0800, Dave Young wrote:
> > On 09/06/18 at 01:56pm, Lianbo Jiang wrote:
> > > When kexec-tools load the kernel and initramfs for kdump, kexec-tools will
> > > read /proc/iomem and recreate the e820 ranges for kdump kernel. But it fails
> > > to parse the e820 reserved region, because the memcmp() is case sensitive
> > > when comparing the string. In fact, it may be "Reserved" or "reserved" in
> > > the /proc/iomem, so we have to fix these cases.
> > > 
> > > Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
> > > ---
> > >  kexec/arch/i386/crashdump-x86.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> > > index 437e8a8..140f45b 100644
> > > --- a/kexec/arch/i386/crashdump-x86.c
> > > +++ b/kexec/arch/i386/crashdump-x86.c
> > > @@ -289,6 +289,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
> > >  			type = RANGE_PMEM;
> > >  		} else if(memcmp(str,"reserved\n",9) == 0 ) {
> > >  			type = RANGE_RESERVED;
> > > +		} else if (memcmp(str, "Reserved\n", 9) == 0) {
> > > +			type = RANGE_RESERVED;
> > >  		} else if (memcmp(str, "GART\n", 5) == 0) {
> > >  			gart_start = start;
> > >  			gart_end = end;
> > > -- 
> > > 2.17.1
> > > 
> > > 
> > > _______________________________________________
> > > kexec mailing list
> > > kexec@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/kexec
> > 
> > Reviewed-by: Dave Young <dyoung@redhat.com>
> 
> Sorry for letting this slip through the cracks.
> I've applied this now.

Simon, thank you!

Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kdump: fix an error that can not parse the e820 reserved region
  2018-10-02 12:02   ` Simon Horman
  2018-10-02 12:10     ` Dave Young
@ 2018-10-08  4:57     ` lijiang
  1 sibling, 0 replies; 5+ messages in thread
From: lijiang @ 2018-10-08  4:57 UTC (permalink / raw)
  To: Simon Horman, Dave Young; +Cc: kexec

在 2018年10月02日 20:02, Simon Horman 写道:
> On Fri, Sep 07, 2018 at 09:05:50AM +0800, Dave Young wrote:
>> On 09/06/18 at 01:56pm, Lianbo Jiang wrote:
>>> When kexec-tools load the kernel and initramfs for kdump, kexec-tools will
>>> read /proc/iomem and recreate the e820 ranges for kdump kernel. But it fails
>>> to parse the e820 reserved region, because the memcmp() is case sensitive
>>> when comparing the string. In fact, it may be "Reserved" or "reserved" in
>>> the /proc/iomem, so we have to fix these cases.
>>>
>>> Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
>>> ---
>>>  kexec/arch/i386/crashdump-x86.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
>>> index 437e8a8..140f45b 100644
>>> --- a/kexec/arch/i386/crashdump-x86.c
>>> +++ b/kexec/arch/i386/crashdump-x86.c
>>> @@ -289,6 +289,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
>>>  			type = RANGE_PMEM;
>>>  		} else if(memcmp(str,"reserved\n",9) == 0 ) {
>>>  			type = RANGE_RESERVED;
>>> +		} else if (memcmp(str, "Reserved\n", 9) == 0) {
>>> +			type = RANGE_RESERVED;
>>>  		} else if (memcmp(str, "GART\n", 5) == 0) {
>>>  			gart_start = start;
>>>  			gart_end = end;
>>> -- 
>>> 2.17.1
>>>
>>>
>>> _______________________________________________
>>> kexec mailing list
>>> kexec@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/kexec
>>
>> Reviewed-by: Dave Young <dyoung@redhat.com>
> 
> Sorry for letting this slip through the cracks.
> I've applied this now.
> 

Thank you, Simon and Dave.
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-08  4:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  5:56 [PATCH v2] kdump: fix an error that can not parse the e820 reserved region Lianbo Jiang
2018-09-07  1:05 ` Dave Young
2018-10-02 12:02   ` Simon Horman
2018-10-02 12:10     ` Dave Young
2018-10-08  4:57     ` lijiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.