Re: [PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-12-01 Thread Dave Young
On 11/29/13 at 05:47pm, Borislav Petkov wrote:
> On Fri, Nov 29, 2013 at 04:50:50PM +0800, Dave Young wrote:
> > It's for debugging purpose, I think it's helpful.
> 
> Why? The first kernel did dump it already.

As for the efi printk though 1st kernel already printed them out, but kexec 
kernel
context is diffrent from 1st kernel, it's a fresh reboot we do need reprint 
them.

I think kexec reboot is just like a normal reboot from user's point of view.

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-11-29 Thread Borislav Petkov
On Fri, Nov 29, 2013 at 04:50:50PM +0800, Dave Young wrote:
> It's for debugging purpose, I think it's helpful.

Why? The first kernel did dump it already.

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-11-29 Thread Dave Young
On 11/27/13 at 03:27pm, Borislav Petkov wrote:
> On Wed, Nov 27, 2013 at 10:27:01AM +, Matt Fleming wrote:
> > Heh, you can probably already guess what I'm going to say here...
> 
> I guessed :-)
> 
> > How about using a single function to dump the memory ranges irrespective
> > of whether the memory map comes from 'memmap' or 'esdata'? e.g.
> > something along the lines of,
> > 
> > if (esdata)
> > print_efi_memmap(esdata->map, nr_efi_runtime_map,
> >  sizeof(esdata->map[0]));
> > else
> > print_efi_memmap(memmap.map, memmap.nr_map,
> >  memmap.desc_size);
> 
> And while you're at it:
> 
> WARNING: quoted string split across lines
> #19: FILE: arch/x86/platform/efi/efi.c:443:
> +   pr_info("mem%02u: type=%u, attr=0x%llx, "
> +   "range=[0x%016llx-0x%016llx) (%lluMB)\n",

I see the warnings, because it's originally in print_efi_memmap so I just keep
new function same. Anyway after switching to use one function there will be
no such warning.

> 
> 
> Btw, do we really want to dump the same map again in the second kernel?

It's for debugging purpose, I think it's helpful.

Thanks for review
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-11-29 Thread Dave Young
On 11/27/13 at 10:27am, Matt Fleming wrote:
> On Tue, 26 Nov, at 01:57:53PM, Dave Young wrote:
> > For kexec/kdump kernel efi runtime mappings are saved, printing original 
> > whole
> > memmap ranges does not make sense anymore. So introduce a new function to 
> > only
> > print runtime maps in case kexec/kdump kernel is used.
> > 
> > Signed-off-by: Dave Young 
> > ---
> >  arch/x86/platform/efi/efi.c | 23 ++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
> > index fafeb40..c65b0b8 100644
> > --- a/arch/x86/platform/efi/efi.c
> > +++ b/arch/x86/platform/efi/efi.c
> > @@ -430,6 +430,24 @@ int __init efi_memblock_x86_reserve_range(void)
> > return 0;
> >  }
> >  
> > +/* for kexec kernel runtime maps are passed in setup_data */
> > +static void __init print_saved_runtime_map(void)
> > +{
> > +#ifdef EFI_DEBUG
> > +   int i;
> > +   efi_memory_desc_t *md;
> > +
> > +   for (i = 0; i < nr_efi_runtime_map; i++) {
> > +   md = esdata->map + i;
> > +   pr_info("mem%02u: type=%u, attr=0x%llx, "
> > +   "range=[0x%016llx-0x%016llx) (%lluMB)\n",
> > +   i, md->type, md->attribute, md->phys_addr,
> > +   md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
> > +   (md->num_pages >> (20 - EFI_PAGE_SHIFT)));
> > +   }
> > +#endif  /*  EFI_DEBUG  */
> > +}
> > +
> >  static void __init print_efi_memmap(void)
> >  {
> >  #ifdef EFI_DEBUG
> > @@ -782,7 +800,10 @@ void __init efi_init(void)
> > x86_platform.set_wallclock = efi_set_rtc_mmss;
> > }
> >  #endif
> > -   print_efi_memmap();
> > +   if (esdata)
> > +   print_saved_runtime_map();
> > +   else
> > +   print_efi_memmap();
> >  }
> 
> Heh, you can probably already guess what I'm going to say here...
> 
> How about using a single function to dump the memory ranges irrespective
> of whether the memory map comes from 'memmap' or 'esdata'? e.g.
> something along the lines of,
> 
>   if (esdata)
>   print_efi_memmap(esdata->map, nr_efi_runtime_map,
>sizeof(esdata->map[0]));
>   else
>   print_efi_memmap(memmap.map, memmap.nr_map,
>memmap.desc_size);
> 
> ?

Yes, looks better, will do

Thanks for review
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-11-27 Thread Borislav Petkov
On Wed, Nov 27, 2013 at 10:27:01AM +, Matt Fleming wrote:
> Heh, you can probably already guess what I'm going to say here...

I guessed :-)

> How about using a single function to dump the memory ranges irrespective
> of whether the memory map comes from 'memmap' or 'esdata'? e.g.
> something along the lines of,
> 
>   if (esdata)
>   print_efi_memmap(esdata->map, nr_efi_runtime_map,
>sizeof(esdata->map[0]));
>   else
>   print_efi_memmap(memmap.map, memmap.nr_map,
>memmap.desc_size);

And while you're at it:

WARNING: quoted string split across lines
#19: FILE: arch/x86/platform/efi/efi.c:443:
+   pr_info("mem%02u: type=%u, attr=0x%llx, "
+   "range=[0x%016llx-0x%016llx) (%lluMB)\n",


Btw, do we really want to dump the same map again in the second kernel?

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-11-27 Thread Matt Fleming
On Tue, 26 Nov, at 01:57:53PM, Dave Young wrote:
> For kexec/kdump kernel efi runtime mappings are saved, printing original whole
> memmap ranges does not make sense anymore. So introduce a new function to only
> print runtime maps in case kexec/kdump kernel is used.
> 
> Signed-off-by: Dave Young 
> ---
>  arch/x86/platform/efi/efi.c | 23 ++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
> index fafeb40..c65b0b8 100644
> --- a/arch/x86/platform/efi/efi.c
> +++ b/arch/x86/platform/efi/efi.c
> @@ -430,6 +430,24 @@ int __init efi_memblock_x86_reserve_range(void)
>   return 0;
>  }
>  
> +/* for kexec kernel runtime maps are passed in setup_data */
> +static void __init print_saved_runtime_map(void)
> +{
> +#ifdef EFI_DEBUG
> + int i;
> + efi_memory_desc_t *md;
> +
> + for (i = 0; i < nr_efi_runtime_map; i++) {
> + md = esdata->map + i;
> + pr_info("mem%02u: type=%u, attr=0x%llx, "
> + "range=[0x%016llx-0x%016llx) (%lluMB)\n",
> + i, md->type, md->attribute, md->phys_addr,
> + md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
> + (md->num_pages >> (20 - EFI_PAGE_SHIFT)));
> + }
> +#endif  /*  EFI_DEBUG  */
> +}
> +
>  static void __init print_efi_memmap(void)
>  {
>  #ifdef EFI_DEBUG
> @@ -782,7 +800,10 @@ void __init efi_init(void)
>   x86_platform.set_wallclock = efi_set_rtc_mmss;
>   }
>  #endif
> - print_efi_memmap();
> + if (esdata)
> + print_saved_runtime_map();
> + else
> + print_efi_memmap();
>  }

Heh, you can probably already guess what I'm going to say here...

How about using a single function to dump the memory ranges irrespective
of whether the memory map comes from 'memmap' or 'esdata'? e.g.
something along the lines of,

if (esdata)
print_efi_memmap(esdata->map, nr_efi_runtime_map,
 sizeof(esdata->map[0]));
else
print_efi_memmap(memmap.map, memmap.nr_map,
 memmap.desc_size);

?

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 08/12] efi: only print saved efi runtime maps instead of all memmap ranges for kexec

2013-11-25 Thread Dave Young
For kexec/kdump kernel efi runtime mappings are saved, printing original whole
memmap ranges does not make sense anymore. So introduce a new function to only
print runtime maps in case kexec/kdump kernel is used.

Signed-off-by: Dave Young 
---
 arch/x86/platform/efi/efi.c | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index fafeb40..c65b0b8 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -430,6 +430,24 @@ int __init efi_memblock_x86_reserve_range(void)
return 0;
 }
 
+/* for kexec kernel runtime maps are passed in setup_data */
+static void __init print_saved_runtime_map(void)
+{
+#ifdef EFI_DEBUG
+   int i;
+   efi_memory_desc_t *md;
+
+   for (i = 0; i < nr_efi_runtime_map; i++) {
+   md = esdata->map + i;
+   pr_info("mem%02u: type=%u, attr=0x%llx, "
+   "range=[0x%016llx-0x%016llx) (%lluMB)\n",
+   i, md->type, md->attribute, md->phys_addr,
+   md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
+   (md->num_pages >> (20 - EFI_PAGE_SHIFT)));
+   }
+#endif  /*  EFI_DEBUG  */
+}
+
 static void __init print_efi_memmap(void)
 {
 #ifdef EFI_DEBUG
@@ -782,7 +800,10 @@ void __init efi_init(void)
x86_platform.set_wallclock = efi_set_rtc_mmss;
}
 #endif
-   print_efi_memmap();
+   if (esdata)
+   print_saved_runtime_map();
+   else
+   print_efi_memmap();
 }
 
 void __init efi_late_init(void)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/