public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Jeffrey Hugo <jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Sameer Goel <sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Subject: Re: [PATCH] efi/libstub/arm*: Set default address and size cells values for an empty dtb
Date: Tue, 7 Feb 2017 18:15:54 +0000	[thread overview]
Message-ID: <20170207181554.GD26173@leverpostej> (raw)
In-Reply-To: <1486490390-25251-1-git-send-email-jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

Hi,

On Tue, Feb 07, 2017 at 10:59:50AM -0700, Jeffrey Hugo wrote:
> From: Sameer Goel <sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> 
> In cases where a device tree is not provided (ie ACPI based system), an
> empty fdt is generated by efistub.  Sets the address and size cell values
> in a generated fdt to support 64 bit addressing.
> 
> This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those
> utilities will read the address/size values from the fdt, and such values
> may exceed the range provided by the 32 bit default.

The description here doesn't state why this is a problem for ACPI.

What values are being read by the tools, and for what purpose?

Are they extracting data from the DTB, or is this part of inserting a
new property?

Why does this adversely affect ACPI?

> Change-Id: Ie7f3637e375bd6631c6bda1f7b3c9003765ff4a5

Please remove this kind of tags from upstream patches. It's irrelevant.

> Signed-off-by: Sameer Goel <sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Signed-off-by: Jeffrey Hugo <jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> ---
>  drivers/firmware/efi/libstub/fdt.c | 38 +++++++++++++++++++++++++++++++++++++-
>  1 file changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c
> index 921dfa0..def5c9c 100644
> --- a/drivers/firmware/efi/libstub/fdt.c
> +++ b/drivers/firmware/efi/libstub/fdt.c
> @@ -16,6 +16,34 @@
>  
>  #include "efistub.h"
>  
> +#define EFI_DT_ADDR_CELLS_DEFAULT 2
> +#define EFI_DT_SIZE_CELLS_DEFAULT 2
> +
> +static void fdt_update_cell_size(efi_system_table_t *sys_table, void *fdt)
> +{
> +	int offset;
> +	int status;
> +
> +	offset = fdt_path_offset(fdt, "/");
> +	/* Set the #address-cells and #size-cells values for an empty tree */
> +
> +	status = fdt_setprop_u32(fdt, offset, "#address-cells",
> +				 EFI_DT_ADDR_CELLS_DEFAULT);
> +	if (status) {
> +		pr_efi(sys_table,
> +		       "Failed to set #address-cells for empty dtb\n");
> +		return;
> +	}
> +
> +	status = fdt_setprop_u32(fdt, offset, "#size-cells",
> +				 EFI_DT_SIZE_CELLS_DEFAULT);
> +	if (status) {
> +		pr_efi(sys_table,
> +		       "Failed to set #size-cells for empty dtb\n");
> +		return;
> +	}
> +}

We don't seem to log anything for most other failures within
update_fdt() where this is called.

Are these really much more special?

>  static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
>  			       unsigned long orig_fdt_size,
>  			       void *fdt, int new_fdt_size, char *cmdline_ptr,
> @@ -44,8 +72,16 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
>  
>  	if (orig_fdt)
>  		status = fdt_open_into(orig_fdt, fdt, new_fdt_size);
> -	else
> +	else {

Nit: if one side of an if-else has braces, the other should too per the
usual kernel coding style.

Thanks,
Mark.

  parent reply	other threads:[~2017-02-07 18:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 17:59 [PATCH] efi/libstub/arm*: Set default address and size cells values for an empty dtb Jeffrey Hugo
     [not found] ` <1486490390-25251-1-git-send-email-jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-07 18:12   ` Ard Biesheuvel
2017-02-07 18:54     ` Jeffrey Hugo
     [not found]       ` <1f47fcdd-c5d8-4082-70a3-ca9b1746d7ca-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-07 19:01         ` Mark Rutland
2017-02-07 19:06           ` Mark Rutland
2017-02-07 19:07           ` Jeffrey Hugo
     [not found]             ` <c49cc64e-4ca1-8d82-5faf-74c0355c35ef-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-07 19:12               ` Ard Biesheuvel
2017-02-07 19:13               ` Mark Rutland
2017-02-07 19:29                 ` Jeffrey Hugo
2017-02-07 19:55                   ` Mark Rutland
2017-02-08  7:43                     ` AKASHI, Takahiro
     [not found]                       ` <20170208074301.GB18445-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-08 10:40                         ` Ard Biesheuvel
2017-02-09  8:27                           ` AKASHI, Takahiro
     [not found]                             ` <20170209082702.GC18445-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-13 20:55                               ` Timur Tabi
     [not found]                           ` <CAKv+Gu8OXn20JvtFkE_bS=cbWV3XZ5b7a+XaG7tvea+4BqrHfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-13 20:51                             ` Timur Tabi
2017-02-08 11:35                         ` Mark Rutland
2017-02-07 18:15   ` Mark Rutland [this message]
2017-02-07 18:41     ` Jeffrey Hugo
2017-02-07 19:24     ` Timur Tabi
2017-02-07 19:37       ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207181554.GD26173@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox