public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
@ 2012-10-18  3:10 Dave Young
  2012-10-18 14:56 ` Khalid Aziz
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Young @ 2012-10-18  3:10 UTC (permalink / raw)
  To: horms, kexec, vgoyal, khalid.aziz


In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
the acpi root table physical address.

Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
If there's no such file or read fail the function will just do nothing.

Tested efi boot Fedora 17 on thinkpad T420.

Some background info for this issue:
http://lists.infradead.org/pipermail/kexec/2010-March/003889.html

[v1 -> v2]:
Address comments from Khalid and Simon
use fgets instead of read(2) to iterate the file
do not add 'noefi' because kexec does not construct EFI signature
in bootloader signature in boot_params, so kexec'd kernel will
disable EFI automatically even without noefi.

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 kexec/arch/i386/crashdump-x86.c |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

--- kexec-tools.orig/kexec/arch/i386/crashdump-x86.c
+++ kexec-tools/kexec/arch/i386/crashdump-x86.c
@@ -835,6 +835,40 @@ static int cmdline_add_memmap_acpi(char 
 	return 0;
 }
 
+/* Appends 'acpi_rsdp=' commandline for efi boot crash dump */
+static void cmdline_add_efi(char *cmdline)
+{
+	FILE *fp;
+	int cmdlen, len;
+	char line[MAX_LINE], *s;
+	const char *acpis = " acpi_rsdp=";
+
+	fp = fopen("/sys/firmware/efi/systab", "r");
+	if (!fp)
+		return;
+
+	while(fgets(line, sizeof(line), fp) != 0) {
+		/* ACPI20= always goes before ACPI= */
+		if ((strstr(line, "ACPI20=")) || (strstr(line, "ACPI="))) {
+		        line[strlen(line) - 1] = '\0';
+			s = strchr(line, '=');
+			s += 1;
+			len = strlen(s) + strlen(acpis);
+			cmdlen = strlen(cmdline) + len;
+			if (cmdlen > (COMMAND_LINE_SIZE - 1))
+				die("Command line overflow\n");
+			strcat(cmdline, acpis);
+			strcat(cmdline, s);
+			dbgprintf("Command line after adding efi\n");
+			dbgprintf("%s\n", cmdline);
+
+			break;
+		}
+	}
+
+	fclose(fp);
+}
+
 static void get_backup_area(struct kexec_info *info,
 				struct memory_range *range, int ranges)
 {
@@ -998,6 +1032,7 @@ int load_crashdump_segments(struct kexec
 	if (delete_memmap(memmap_p, elfcorehdr, memsz) < 0)
 		return -1;
 	cmdline_add_memmap(mod_cmdline, memmap_p);
+	cmdline_add_efi(mod_cmdline);
 	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
 
 	/* Inform second kernel about the presence of ACPI tables. */

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

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

* [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
@ 2012-10-18  3:16 Dave Young
  2012-10-18 21:20 ` Eric W. Biederman
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Young @ 2012-10-18  3:16 UTC (permalink / raw)
  To: horms, kexec, vgoyal, khalid


In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
the acpi root table physical address.

Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
If there's no such file or read fail the function will just do nothing.

Tested efi boot Fedora 17 on thinkpad T420.

Some background info for this issue:
http://lists.infradead.org/pipermail/kexec/2010-March/003889.html

[v1 -> v2]:
Address comments from Khalid and Simon
use fgets instead of read(2) to iterate the file
do not add 'noefi' because kexec does not construct EFI signature
in bootloader signature in boot_params, so kexec'd kernel will
disable EFI automatically even without noefi.

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 kexec/arch/i386/crashdump-x86.c |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

--- kexec-tools.orig/kexec/arch/i386/crashdump-x86.c
+++ kexec-tools/kexec/arch/i386/crashdump-x86.c
@@ -835,6 +835,40 @@ static int cmdline_add_memmap_acpi(char 
 	return 0;
 }
 
+/* Appends 'acpi_rsdp=' commandline for efi boot crash dump */
+static void cmdline_add_efi(char *cmdline)
+{
+	FILE *fp;
+	int cmdlen, len;
+	char line[MAX_LINE], *s;
+	const char *acpis = " acpi_rsdp=";
+
+	fp = fopen("/sys/firmware/efi/systab", "r");
+	if (!fp)
+		return;
+
+	while(fgets(line, sizeof(line), fp) != 0) {
+		/* ACPI20= always goes before ACPI= */
+		if ((strstr(line, "ACPI20=")) || (strstr(line, "ACPI="))) {
+		        line[strlen(line) - 1] = '\0';
+			s = strchr(line, '=');
+			s += 1;
+			len = strlen(s) + strlen(acpis);
+			cmdlen = strlen(cmdline) + len;
+			if (cmdlen > (COMMAND_LINE_SIZE - 1))
+				die("Command line overflow\n");
+			strcat(cmdline, acpis);
+			strcat(cmdline, s);
+			dbgprintf("Command line after adding efi\n");
+			dbgprintf("%s\n", cmdline);
+
+			break;
+		}
+	}
+
+	fclose(fp);
+}
+
 static void get_backup_area(struct kexec_info *info,
 				struct memory_range *range, int ranges)
 {
@@ -998,6 +1032,7 @@ int load_crashdump_segments(struct kexec
 	if (delete_memmap(memmap_p, elfcorehdr, memsz) < 0)
 		return -1;
 	cmdline_add_memmap(mod_cmdline, memmap_p);
+	cmdline_add_efi(mod_cmdline);
 	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
 
 	/* Inform second kernel about the presence of ACPI tables. */

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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-18  3:10 Dave Young
@ 2012-10-18 14:56 ` Khalid Aziz
  2012-10-18 19:11   ` Vivek Goyal
  0 siblings, 1 reply; 12+ messages in thread
From: Khalid Aziz @ 2012-10-18 14:56 UTC (permalink / raw)
  To: Dave Young; +Cc: khalid.aziz, horms, kexec, vgoyal

On Thu, 2012-10-18 at 11:10 +0800, Dave Young wrote:
> In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
> the acpi root table physical address.
> 
> Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
> If there's no such file or read fail the function will just do nothing.
> 
> Tested efi boot Fedora 17 on thinkpad T420.
> 
> Some background info for this issue:
> http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
> 
> [v1 -> v2]:
> Address comments from Khalid and Simon
> use fgets instead of read(2) to iterate the file
> do not add 'noefi' because kexec does not construct EFI signature
> in bootloader signature in boot_params, so kexec'd kernel will
> disable EFI automatically even without noefi.
> 
> Signed-off-by: Dave Young <dyoung@redhat.com>
> ---
>  kexec/arch/i386/crashdump-x86.c |   35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)


Looks good.

Reviewed-by: Khalid Aziz <khalid@gonehiking.org>




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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-18 14:56 ` Khalid Aziz
@ 2012-10-18 19:11   ` Vivek Goyal
  2012-10-18 19:22     ` Khalid Aziz
  0 siblings, 1 reply; 12+ messages in thread
From: Vivek Goyal @ 2012-10-18 19:11 UTC (permalink / raw)
  To: Khalid Aziz; +Cc: khalid.aziz, kexec, horms, Dave Young

On Thu, Oct 18, 2012 at 08:56:34AM -0600, Khalid Aziz wrote:
> On Thu, 2012-10-18 at 11:10 +0800, Dave Young wrote:
> > In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
> > the acpi root table physical address.
> > 
> > Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
> > If there's no such file or read fail the function will just do nothing.
> > 
> > Tested efi boot Fedora 17 on thinkpad T420.
> > 
> > Some background info for this issue:
> > http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
> > 
> > [v1 -> v2]:
> > Address comments from Khalid and Simon
> > use fgets instead of read(2) to iterate the file
> > do not add 'noefi' because kexec does not construct EFI signature
> > in bootloader signature in boot_params, so kexec'd kernel will
> > disable EFI automatically even without noefi.
> > 
> > Signed-off-by: Dave Young <dyoung@redhat.com>
> > ---
> >  kexec/arch/i386/crashdump-x86.c |   35 +++++++++++++++++++++++++++++++++++
> >  1 file changed, 35 insertions(+)
> 
> 
> Looks good.
> 
> Reviewed-by: Khalid Aziz <khalid@gonehiking.org>

Khalid/Dave,

Last time khalid mentioned that we are currently taking normal boot path
in second kernel and that's why things are working even without "noefi"?

If that's the case, then we don't need "acpi_rsdp" also? In normal boot
path we used to just pass acpi memmap ranges in e820 map and second
kernel could find those.

So now I am full confused that howcome we require acpi_rsdp but not
"noefi".

This UEFI thing is a mess. We need to sort it out. I am primarily
interested in making sure kdump works well with UEFI systems as more
and more systems are going to adopt UEFI. Also this UEFI secure boot
will make things very interesting. Now we can't trust the purgatory
code prepared in user space.

Thanks
Vivek

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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-18 19:11   ` Vivek Goyal
@ 2012-10-18 19:22     ` Khalid Aziz
  0 siblings, 0 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-10-18 19:22 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: kexec, horms, Dave Young

On Thu, 2012-10-18 at 15:11 -0400, Vivek Goyal wrote:
> On Thu, Oct 18, 2012 at 08:56:34AM -0600, Khalid Aziz wrote:
> > On Thu, 2012-10-18 at 11:10 +0800, Dave Young wrote:
> > > In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
> > > the acpi root table physical address.
> > > 
> > > Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
> > > If there's no such file or read fail the function will just do nothing.
> > > 
> > > Tested efi boot Fedora 17 on thinkpad T420.
> > > 
> > > Some background info for this issue:
> > > http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
> > > 
> > > [v1 -> v2]:
> > > Address comments from Khalid and Simon
> > > use fgets instead of read(2) to iterate the file
> > > do not add 'noefi' because kexec does not construct EFI signature
> > > in bootloader signature in boot_params, so kexec'd kernel will
> > > disable EFI automatically even without noefi.
> > > 
> > > Signed-off-by: Dave Young <dyoung@redhat.com>
> > > ---
> > >  kexec/arch/i386/crashdump-x86.c |   35 +++++++++++++++++++++++++++++++++++
> > >  1 file changed, 35 insertions(+)
> > 
> > 
> > Looks good.
> > 
> > Reviewed-by: Khalid Aziz <khalid@gonehiking.org>
> 
> Khalid/Dave,
> 
> Last time khalid mentioned that we are currently taking normal boot path
> in second kernel and that's why things are working even without "noefi"?
> 
> If that's the case, then we don't need "acpi_rsdp" also? In normal boot
> path we used to just pass acpi memmap ranges in e820 map and second
> kernel could find those.
> 
> So now I am full confused that howcome we require acpi_rsdp but not
> "noefi".
> 
> This UEFI thing is a mess. We need to sort it out. I am primarily
> interested in making sure kdump works well with UEFI systems as more
> and more systems are going to adopt UEFI. Also this UEFI secure boot
> will make things very interesting. Now we can't trust the purgatory
> code prepared in user space.
> 
> Thanks
> Vivek

Hi Vivek,

kdump works even without "noefi" because the kdump kernel automatically
boots up with EFI disabled as explained here -
<http://lists.infradead.org/pipermail/kexec/2012-September/006797.html>.
On a BIOS based or EFI based, but with CSM, systems, kdump kernel will
find RSDP by searching through Extended BIOS Data Area. I don't believe
EBDA exists on EFI systems without CSM, so kdump kernel will fail to
find RSDP. We will need to pass "acpi_rsdp=" for the benefit of those
systems, but those systems are also going to need fix in the bootloader
signature to boot kdump kernel in EFI mode.

Yes, UEFI is a mess :) It does need to be sorted out. SecureBoot makes
life even more difficult. Matthew Garret had earlier sent out patches to
support SecureBoot on Linux and one of the things those patches did was
to disable kexec completely. That is a drastic measure and ok as a short
term solution but we need to come up with something better. If
SecureBoot does not go away, we will have to do something in kexec-tools
or even kernel to validate kernel code being loaded for kexec/kdump and
the purgatory code as well. This will require interfacing with UEFI key
checking mechanism. That is going to be ugly.

Thanks,
Khalid


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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-18  3:16 [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting Dave Young
@ 2012-10-18 21:20 ` Eric W. Biederman
  2012-10-19  0:26   ` Simon Horman
  2012-10-19 14:53   ` Vivek Goyal
  0 siblings, 2 replies; 12+ messages in thread
From: Eric W. Biederman @ 2012-10-18 21:20 UTC (permalink / raw)
  To: Dave Young; +Cc: horms, kexec, vgoyal, khalid

Dave Young <dyoung@redhat.com> writes:

> In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
> the acpi root table physical address.
>
> Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
> If there's no such file or read fail the function will just do nothing.
>
> Tested efi boot Fedora 17 on thinkpad T420.
>
> Some background info for this issue:
> http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
>
> [v1 -> v2]:
> Address comments from Khalid and Simon
> use fgets instead of read(2) to iterate the file
> do not add 'noefi' because kexec does not construct EFI signature
> in bootloader signature in boot_params, so kexec'd kernel will
> disable EFI automatically even without noefi.

I don't have any problems with this patch.

I have a question.  In the case where this fails are we successfully
passing the ACPI sections in the e820 map?

If we are passing the acpi sections is that not enough for the kernel
to find the rdsp area?  I'm just a bit surprised we need this patch
is all.

Somehow it seems a bit ugly to pass information that could be conveyed
in the memory map on the command line.

But I am all in favor of doing what works.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

> Signed-off-by: Dave Young <dyoung@redhat.com>
> ---
>  kexec/arch/i386/crashdump-x86.c |   35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> --- kexec-tools.orig/kexec/arch/i386/crashdump-x86.c
> +++ kexec-tools/kexec/arch/i386/crashdump-x86.c
> @@ -835,6 +835,40 @@ static int cmdline_add_memmap_acpi(char 
>  	return 0;
>  }
>  
> +/* Appends 'acpi_rsdp=' commandline for efi boot crash dump */
> +static void cmdline_add_efi(char *cmdline)
> +{
> +	FILE *fp;
> +	int cmdlen, len;
> +	char line[MAX_LINE], *s;
> +	const char *acpis = " acpi_rsdp=";
> +
> +	fp = fopen("/sys/firmware/efi/systab", "r");
> +	if (!fp)
> +		return;
> +
> +	while(fgets(line, sizeof(line), fp) != 0) {
> +		/* ACPI20= always goes before ACPI= */
> +		if ((strstr(line, "ACPI20=")) || (strstr(line, "ACPI="))) {
> +		        line[strlen(line) - 1] = '\0';
> +			s = strchr(line, '=');
> +			s += 1;
> +			len = strlen(s) + strlen(acpis);
> +			cmdlen = strlen(cmdline) + len;
> +			if (cmdlen > (COMMAND_LINE_SIZE - 1))
> +				die("Command line overflow\n");
> +			strcat(cmdline, acpis);
> +			strcat(cmdline, s);
> +			dbgprintf("Command line after adding efi\n");
> +			dbgprintf("%s\n", cmdline);
> +
> +			break;
> +		}
> +	}
> +
> +	fclose(fp);
> +}
> +
>  static void get_backup_area(struct kexec_info *info,
>  				struct memory_range *range, int ranges)
>  {
> @@ -998,6 +1032,7 @@ int load_crashdump_segments(struct kexec
>  	if (delete_memmap(memmap_p, elfcorehdr, memsz) < 0)
>  		return -1;
>  	cmdline_add_memmap(mod_cmdline, memmap_p);
> +	cmdline_add_efi(mod_cmdline);
>  	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
>  
>  	/* Inform second kernel about the presence of ACPI tables. */
>
> _______________________________________________
> 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] 12+ messages in thread

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-18 21:20 ` Eric W. Biederman
@ 2012-10-19  0:26   ` Simon Horman
  2012-10-19 14:53   ` Vivek Goyal
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Horman @ 2012-10-19  0:26 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, Dave Young, vgoyal, khalid

On Thu, Oct 18, 2012 at 02:20:46PM -0700, Eric W. Biederman wrote:
> Dave Young <dyoung@redhat.com> writes:
> 
> > In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
> > the acpi root table physical address.
> >
> > Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
> > If there's no such file or read fail the function will just do nothing.
> >
> > Tested efi boot Fedora 17 on thinkpad T420.
> >
> > Some background info for this issue:
> > http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
> >
> > [v1 -> v2]:
> > Address comments from Khalid and Simon
> > use fgets instead of read(2) to iterate the file
> > do not add 'noefi' because kexec does not construct EFI signature
> > in bootloader signature in boot_params, so kexec'd kernel will
> > disable EFI automatically even without noefi.
> 
> I don't have any problems with this patch.
> 
> I have a question.  In the case where this fails are we successfully
> passing the ACPI sections in the e820 map?
> 
> If we are passing the acpi sections is that not enough for the kernel
> to find the rdsp area?  I'm just a bit surprised we need this patch
> is all.
> 
> Somehow it seems a bit ugly to pass information that could be conveyed
> in the memory map on the command line.
> 
> But I am all in favor of doing what works.
> 
> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

Thanks, I have applied this patch.

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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-18 21:20 ` Eric W. Biederman
  2012-10-19  0:26   ` Simon Horman
@ 2012-10-19 14:53   ` Vivek Goyal
  2012-10-19 20:09     ` Khalid Aziz
  2012-10-21  3:06     ` Eric W. Biederman
  1 sibling, 2 replies; 12+ messages in thread
From: Vivek Goyal @ 2012-10-19 14:53 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, horms, Dave Young, khalid

On Thu, Oct 18, 2012 at 02:20:46PM -0700, Eric W. Biederman wrote:
> Dave Young <dyoung@redhat.com> writes:
> 
> > In case efi booting, kdump need kernel parameter acpi_rsdp= to retrieve
> > the acpi root table physical address.
> >
> > Add a function cmdline_add_efi to get the address from /sys/firmware/efi/systab
> > If there's no such file or read fail the function will just do nothing.
> >
> > Tested efi boot Fedora 17 on thinkpad T420.
> >
> > Some background info for this issue:
> > http://lists.infradead.org/pipermail/kexec/2010-March/003889.html
> >
> > [v1 -> v2]:
> > Address comments from Khalid and Simon
> > use fgets instead of read(2) to iterate the file
> > do not add 'noefi' because kexec does not construct EFI signature
> > in bootloader signature in boot_params, so kexec'd kernel will
> > disable EFI automatically even without noefi.
> 
> I don't have any problems with this patch.
> 
> I have a question.  In the case where this fails are we successfully
> passing the ACPI sections in the e820 map?

For kdump we pass everything on commandline using memmap=. This also
includes passing ACPI regions. I don't think we exclude those memmap=
options for EFI.

Also I am wondering that for kdump case why are we passing new memory
map using command line which ultimately overides the e820 map we put
into bootparams.

It should make sense to just put modified map in e820 map in bootparam
and not append all these options on command line. Also simplifiying
the command line. 

This is orthogonal to question you asked but I think this is one
improvement we should do for kexec on panic code.

> 
> If we are passing the acpi sections is that not enough for the kernel
> to find the rdsp area?  I'm just a bit surprised we need this patch
> is all.
> 
> Somehow it seems a bit ugly to pass information that could be conveyed
> in the memory map on the command line.

I have no idea how UEFI case is working. Dave/Khalid might have more
details on this.

Thanks
Vivek

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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-19 14:53   ` Vivek Goyal
@ 2012-10-19 20:09     ` Khalid Aziz
  2012-10-21  3:06     ` Eric W. Biederman
  1 sibling, 0 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-10-19 20:09 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: Dave Young, horms, kexec, Eric W. Biederman

On Fri, 2012-10-19 at 10:53 -0400, Vivek Goyal wrote:
> On Thu, Oct 18, 2012 at 02:20:46PM -0700, Eric W. Biederman wrote:
> > 
> > If we are passing the acpi sections is that not enough for the kernel
> > to find the rdsp area?  I'm just a bit surprised we need this patch
> > is all.
> > 
> > Somehow it seems a bit ugly to pass information that could be conveyed
> > in the memory map on the command line.
> 
> I have no idea how UEFI case is working. Dave/Khalid might have more
> details on this.

On a UEFI machine with CSM, kernel finds RSDP in EBDA. On a UEFI machine
with no CSM, kernel fails to find RSDP and here is the message I see:

ACPI BIOS Bug: Error: A valid RSDP was not found (20120913/tbxfroot-219)


--
Khalid



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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-19 14:53   ` Vivek Goyal
  2012-10-19 20:09     ` Khalid Aziz
@ 2012-10-21  3:06     ` Eric W. Biederman
  2012-10-22 15:43       ` Vivek Goyal
  1 sibling, 1 reply; 12+ messages in thread
From: Eric W. Biederman @ 2012-10-21  3:06 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: kexec, horms, Dave Young, khalid

Vivek Goyal <vgoyal@redhat.com> writes:

> On Thu, Oct 18, 2012 at 02:20:46PM -0700, Eric W. Biederman wrote:
>> 
>> I have a question.  In the case where this fails are we successfully
>> passing the ACPI sections in the e820 map?
>
> For kdump we pass everything on commandline using memmap=. This also
> includes passing ACPI regions. I don't think we exclude those memmap=
> options for EFI.
>
> Also I am wondering that for kdump case why are we passing new memory
> map using command line which ultimately overides the e820 map we put
> into bootparams.
>
> It should make sense to just put modified map in e820 map in bootparam
> and not append all these options on command line. Also simplifiying
> the command line. 

As I recall we pass in the real memory map in e820 which allows for
/proc/oldmem and friends to work, and use the memory map to pass in
which information we really want to use.

Given that what we use for the old memory map is the ELF headers
passed from the crashed kernel there does seem to be room for cleanup
in that area.

> This is orthogonal to question you asked but I think this is one
> improvement we should do for kexec on panic code.

Certainly it is worth working on.

>> If we are passing the acpi sections is that not enough for the kernel
>> to find the rdsp area?  I'm just a bit surprised we need this patch
>> is all.
>> 
>> Somehow it seems a bit ugly to pass information that could be conveyed
>> in the memory map on the command line.
>
> I have no idea how UEFI case is working. Dave/Khalid might have more
> details on this.

It is the non-pure UEFI case where non-UEFI table scans work.

Of course it puzzles me why we can't find the table via scanning memory
when running in a pure UEFI environment.  Ah well that is a problem for
another day.

Eric


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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-21  3:06     ` Eric W. Biederman
@ 2012-10-22 15:43       ` Vivek Goyal
  2012-10-23 13:33         ` Khalid Aziz
  0 siblings, 1 reply; 12+ messages in thread
From: Vivek Goyal @ 2012-10-22 15:43 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, horms, Dave Young, khalid

On Sat, Oct 20, 2012 at 08:06:23PM -0700, Eric W. Biederman wrote:

[..]
> It is the non-pure UEFI case where non-UEFI table scans work.
> 
> Of course it puzzles me why we can't find the table via scanning memory
> when running in a pure UEFI environment.  Ah well that is a problem for
> another day.

I have the same question. Why can we find acpi tables by scaning in
non-uefi case and why same is not possible in case of UEFI.

Thanks
Vivek

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

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

* Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting
  2012-10-22 15:43       ` Vivek Goyal
@ 2012-10-23 13:33         ` Khalid Aziz
  0 siblings, 0 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-10-23 13:33 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: Dave Young, horms, kexec, Eric W. Biederman

On Mon, 2012-10-22 at 11:43 -0400, Vivek Goyal wrote:
> On Sat, Oct 20, 2012 at 08:06:23PM -0700, Eric W. Biederman wrote:
> 
> [..]
> > It is the non-pure UEFI case where non-UEFI table scans work.
> > 
> > Of course it puzzles me why we can't find the table via scanning memory
> > when running in a pure UEFI environment.  Ah well that is a problem for
> > another day.
> 
> I have the same question. Why can we find acpi tables by scaning in
> non-uefi case and why same is not possible in case of UEFI.

I had sent an explanation out on Friday but looks like my email got
stuck somewhere, and I don't see it on kexec list archive.

On a UEFI machine with CSM, kernel finds RSDP by searching through EBDA.
On a UEFI machine with no CSM, there is no EBDA I believe and kernel
fails to find RSDP. Here is the message I see on a UEFI machine with no
CSM:

ACPI BIOS Bug: Error: A valid RSDP was not found (20120913/tbxfroot-219)


--
Khalid




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

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

end of thread, other threads:[~2012-10-23 13:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18  3:16 [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting Dave Young
2012-10-18 21:20 ` Eric W. Biederman
2012-10-19  0:26   ` Simon Horman
2012-10-19 14:53   ` Vivek Goyal
2012-10-19 20:09     ` Khalid Aziz
2012-10-21  3:06     ` Eric W. Biederman
2012-10-22 15:43       ` Vivek Goyal
2012-10-23 13:33         ` Khalid Aziz
  -- strict thread matches above, loose matches on Subject: below --
2012-10-18  3:10 Dave Young
2012-10-18 14:56 ` Khalid Aziz
2012-10-18 19:11   ` Vivek Goyal
2012-10-18 19:22     ` Khalid Aziz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox