[PATCH v7 08/12] efi: export efi runtime memory mapping to sysfs

2013-12-20 Thread Dave Young
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directory /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap. Containin

[PATCH v7 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-17 Thread Dave Young
From: Dave Young Date: Tue, 26 Nov 2013 10:10:23 +0800 Subject: [PATCH 08/13] efi: export efi runtime memory mapping to sysfs kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass

Re: [PATCH v6 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-16 Thread Dave Young
On 12/16/13 at 03:09pm, Matt Fleming wrote: > On Mon, 16 Dec, at 05:30:29PM, Dave Young wrote: > > @@ -899,6 +928,11 @@ void __init efi_enter_virtual_mode(void) > > return; > > } > > > > +#ifdef CONFIG_EFI_RUNTIME_MAP > > + efi_runtime_map_setup(efi_runtime_map, nr_efi_runtime_m

Re: [PATCH v6 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-16 Thread Matt Fleming
On Mon, 16 Dec, at 05:30:29PM, Dave Young wrote: > @@ -899,6 +928,11 @@ void __init efi_enter_virtual_mode(void) > return; > } > > +#ifdef CONFIG_EFI_RUNTIME_MAP > + efi_runtime_map_setup(efi_runtime_map, nr_efi_runtime_map, > + boot_params.efi_in

[PATCH v6 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-16 Thread Dave Young
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directory /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap. Containin

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-15 Thread Dave Young
On 12/13/13 at 12:30pm, Matt Fleming wrote: > I agree with Borislav that this should be invoked from efisubsys_init(). > Also Dave, there's nothing inherently x86-specific about runtime-map.c - > we've been trying not to dump arch-specific code in > drivers/firmware/efi/. > > How about something l

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-15 Thread Dave Young
On 12/16/13 at 09:33am, Dave Young wrote: > On 12/13/13 at 12:30pm, Matt Fleming wrote: > > On Fri, 13 Dec, at 03:26:00PM, Dave Young wrote: > > > On 12/12/13 at 09:53pm, Borislav Petkov wrote: > > > > On Thu, Dec 12, 2013 at 10:36:17AM +0800, Dave Young wrote: > > > > > Sorry that I forgot to expl

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-15 Thread Dave Young
On 12/13/13 at 12:30pm, Matt Fleming wrote: > On Fri, 13 Dec, at 03:26:00PM, Dave Young wrote: > > On 12/12/13 at 09:53pm, Borislav Petkov wrote: > > > On Thu, Dec 12, 2013 at 10:36:17AM +0800, Dave Young wrote: > > > > Sorry that I forgot to explain this in changelog, should ask you before. > > >

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-13 Thread Matt Fleming
On Fri, 13 Dec, at 03:26:00PM, Dave Young wrote: > On 12/12/13 at 09:53pm, Borislav Petkov wrote: > > On Thu, Dec 12, 2013 at 10:36:17AM +0800, Dave Young wrote: > > > Sorry that I forgot to explain this in changelog, should ask you before. > > > > > > I did try moving it to efisubsys_init but it

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-13 Thread Dave Young
On 12/12/13 at 09:36pm, Borislav Petkov wrote: > On Thu, Dec 12, 2013 at 03:13:37PM +0800, Dave Young wrote: > > BTW, I will restructure the whole code when I move them to > > efi_kexec.c, so no worry about it? If you have strong opinion I can > > move them though. > > Well, if it were me, I'd do

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-12 Thread Dave Young
On 12/12/13 at 09:53pm, Borislav Petkov wrote: > On Thu, Dec 12, 2013 at 10:36:17AM +0800, Dave Young wrote: > > Sorry that I forgot to explain this in changelog, should ask you before. > > > > I did try moving it to efisubsys_init but it need add extern declaration > > So what? Add it. > > > fo

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-12 Thread Borislav Petkov
On Thu, Dec 12, 2013 at 10:36:17AM +0800, Dave Young wrote: > Sorry that I forgot to explain this in changelog, should ask you before. > > I did try moving it to efisubsys_init but it need add extern declaration So what? Add it. > for efi_runtime_map_init. Since link order will ensure it being c

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-12 Thread Borislav Petkov
On Thu, Dec 12, 2013 at 03:13:37PM +0800, Dave Young wrote: > BTW, I will restructure the whole code when I move them to > efi_kexec.c, so no worry about it? If you have strong opinion I can > move them though. Well, if it were me, I'd do it now so that it'll see more testing. Later, it will be on

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-11 Thread Dave Young
> > > > > and the EFI_BOOT* tests can be done in save_runtime_map and also the > > error handling can happen there. This way efi_map_regions() won't > > need to know about anything. This way, you can later move the whole > > save_runtime_map() function to efi-kexec.c just by taking it without any

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-11 Thread Dave Young
> > +++ b/Documentation/ABI/testing/sysfs-firmware-efi-runtime-map > > @@ -0,0 +1,36 @@ > > +What: /sys/firmware/efi/runtime-map/ > > +Date: December 2013 > > +Contact: Dave Young > > +Description: > > This could start at the same line as Description Ok. [snip] > > +

Re: [PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-11 Thread Borislav Petkov
On Mon, Dec 09, 2013 at 05:42:21PM +0800, Dave Young wrote: > kexec kernel will need exactly same mapping for > efi runtime memory ranges. Thus here export the > runtime ranges mapping to sysfs, kexec-tools > will assemble them and pass to 2nd kernel via > setup_data. > > Introducing a new directo

[PATCH v5 08/14] efi: export efi runtime memory mapping to sysfs

2013-12-09 Thread Dave Young
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directory /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap. Containin

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-08 Thread Dave Young
On 12/07/13 at 02:30pm, Borislav Petkov wrote: > On Sat, Dec 07, 2013 at 04:01:02AM -0500, Dave Young wrote: > > Hi, all > > > > Update my status: > > > > I have finished most of thecode related changes including the krealloc > > fixes (both for original code and my new code). And I'm slowly > >

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-07 Thread H. Peter Anvin
This is very good advice indeed. Borislav Petkov wrote: >On Sat, Dec 07, 2013 at 04:01:02AM -0500, Dave Young wrote: >> Hi, all >> >> Update my status: >> >> I have finished most of thecode related changes including the >krealloc >> fixes (both for original code and my new code). And I'm slowly

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-07 Thread Borislav Petkov
On Sat, Dec 07, 2013 at 04:01:02AM -0500, Dave Young wrote: > Hi, all > > Update my status: > > I have finished most of thecode related changes including the krealloc > fixes (both for original code and my new code). And I'm slowly > moving the kexec related stuff to efi_kexec.c, this involves >

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-07 Thread Dave Young
ission.com, h...@zytor.com, vgo...@redhat.com Sent: Monday, December 2, 2013 5:40:20 PM Subject: Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs On Mon, Dec 02, 2013 at 10:59:42AM +0800, Dave Young wrote: > They are only called if there's setup_data SETUP_EFI passed in.

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-02 Thread Borislav Petkov
On Mon, Dec 02, 2013 at 10:59:42AM +0800, Dave Young wrote: > They are only called if there's setup_data SETUP_EFI passed in. Yes, I > think only kexec need that part of code. But I hesitated to mess the > code with a lot of #if. Will think about it. Well, the accepted strategy with the efi code i

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-01 Thread Dave Young
On 11/29/13 at 12:50pm, Borislav Petkov wrote: > No need for the list - I actually meant you simply use a tmp pointer for > each krealloc invocation - just look around the tree for examples. > > Also think about what happens to the pointed-to memory when krealloc > returns NULL. Ok, thanks for th

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-12-01 Thread Dave Young
On 11/29/13 at 11:59am, Matt Fleming wrote: > On Fri, 29 Nov, at 12:50:29PM, Borislav Petkov wrote: > > > I did not add KEXEC because I thought it can be used for debugging > > > purpose. > > > > mfleming is thinking about it :) > > I finally finished my thought. The sysfs code should be automat

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-29 Thread Matt Fleming
On Fri, 29 Nov, at 12:50:29PM, Borislav Petkov wrote: > > I did not add KEXEC because I thought it can be used for debugging > > purpose. > > mfleming is thinking about it :) I finally finished my thought. The sysfs code should be automatically enabled only if CONFIG_KEXEC is enabled, and not on

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-29 Thread Borislav Petkov
On Fri, Nov 29, 2013 at 05:40:35PM +0800, Dave Young wrote: > Matt are suggesting to below one, is it ok to you? I'm fine with both. > > The efi runtime services can only be switched to virtual mode once > without rebooting. The kexec kernel must maintain the same physical > to virtual address mapp

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-29 Thread Dave Young
On 11/27/13 at 12:44pm, Borislav Petkov wrote: > On Tue, Nov 26, 2013 at 01:57:51PM +0800, Dave Young wrote: > > kexec kernel will need exactly same mapping for > > efi runtime memory ranges. Thus here export the > > runtime ranges mapping to sysfs, kexec-tools > > will assemble them and pass to 2n

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-27 Thread Borislav Petkov
On Tue, Nov 26, 2013 at 01:57:51PM +0800, Dave Young wrote: > kexec kernel will need exactly same mapping for > efi runtime memory ranges. Thus here export the > runtime ranges mapping to sysfs, kexec-tools > will assemble them and pass to 2nd kernel via > setup_data. > > Introducing a new directl

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-27 Thread Dave Young
On 11/27/13 at 11:07am, Dave Young wrote: > > > It will not work for efi 32bit. Only x86_64 currently. > > > > Actually, exporting the tables does work for 32-bit, right? It's just > > that kexec doesn't work for 32-bit EFI? > > It does not make sense to export them for 32-bit because we do not

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-26 Thread Dave Young
On 11/26/13 at 07:30pm, Matt Fleming wrote: > On Tue, 26 Nov, at 01:57:51PM, Dave Young wrote: > > kexec kernel will need exactly same mapping for > > efi runtime memory ranges. Thus here export the > > runtime ranges mapping to sysfs, kexec-tools > > will assemble them and pass to 2nd kernel via >

Re: [PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-26 Thread Matt Fleming
On Tue, 26 Nov, at 01:57:51PM, Dave Young wrote: > kexec kernel will need exactly same mapping for > efi runtime memory ranges. Thus here export the > runtime ranges mapping to sysfs, kexec-tools > will assemble them and pass to 2nd kernel via > setup_data. > > Introducing a new directly /sys/firm

[PATCH v4 06/12] efi: export efi runtime memory mapping to sysfs

2013-11-25 Thread Dave Young
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directly /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap. Containing

[patch 06/12 v4] efi: export efi runtime memory mapping to sysfs

2013-11-25 Thread dyoung
Hi, References: <20131125085630.417850...@dhcp-16-126.nay.redhat.com> Content-Disposition: inline; filename=06-export-efi-runtime-mapping.patch kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble

efi: export efi runtime memory mapping to sysfs

2013-11-25 Thread dyoung
kexec kernel will need exactly same mapping for efi runtime memory ranges. Thus here export the runtime ranges mapping to sysfs, kexec-tools will assemble them and pass to 2nd kernel via setup_data. Introducing a new directly /sys/firmware/efi/runtime-map Just like /sys/firmware/memmap. Containing