mbox series

[0/2] efi/fdt: set #address-cells/#size-cells on empty tree

Message ID 20180611162459.9178-1-leif.lindholm@linaro.org
Headers show
Series efi/fdt: set #address-cells/#size-cells on empty tree | expand

Message

Leif Lindholm June 11, 2018, 4:24 p.m. UTC
Set #address-cells and #size-cells properties (to 2) for ARM*/UEFI
systems when creating an empty DT at boot time. This resolves an issue
seen in the wild with kexec on certain 64-bit ARM systems.

First part is moving out the prop_entry_size macro from lib/fdt.c
and make it available in <grub/fdt.h> (with the required name
change).

Second part is adding the two properties to the empty tree.

Leif Lindholm (2):
  fdt: move prop_entry_size to fdt.h
  efi/fdt: set address/size cells to 2 for empty tree

 grub-core/lib/fdt.c        | 25 ++++++++++---------------
 grub-core/loader/efi/fdt.c | 18 ++++++++++++++++--
 include/grub/fdt.h         |  5 +++++
 3 files changed, 31 insertions(+), 17 deletions(-)

-- 
2.11.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Comments

Daniel Kiper June 14, 2018, 1:38 p.m. UTC | #1
On Mon, Jun 11, 2018 at 05:24:57PM +0100, Leif Lindholm wrote:
> Set #address-cells and #size-cells properties (to 2) for ARM*/UEFI

> systems when creating an empty DT at boot time. This resolves an issue

> seen in the wild with kexec on certain 64-bit ARM systems.

>

> First part is moving out the prop_entry_size macro from lib/fdt.c

> and make it available in <grub/fdt.h> (with the required name

> change).

>

> Second part is adding the two properties to the empty tree.


In general LGTM. Though I would prefer "?" instead of "if" in patch #2.
Or at least drop curly braces. Anyway, if you are OK with proposed
changes I can incorporate them before push.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Leif Lindholm June 14, 2018, 3:37 p.m. UTC | #2
On Thu, Jun 14, 2018 at 03:38:13PM +0200, Daniel Kiper wrote:
> On Mon, Jun 11, 2018 at 05:24:57PM +0100, Leif Lindholm wrote:

> > Set #address-cells and #size-cells properties (to 2) for ARM*/UEFI

> > systems when creating an empty DT at boot time. This resolves an issue

> > seen in the wild with kexec on certain 64-bit ARM systems.

> >

> > First part is moving out the prop_entry_size macro from lib/fdt.c

> > and make it available in <grub/fdt.h> (with the required name

> > change).

> >

> > Second part is adding the two properties to the empty tree.

> 

> In general LGTM. Though I would prefer "?" instead of "if" in patch #2.

> Or at least drop curly braces. Anyway, if you are OK with proposed

> changes I can incorporate them before push.


I thought the added additional bits made the ternary a bit painful,
but I'd be happy for you to get rid of the braces (TianoCore coding
style is making me use those more heavily :)

/
    Leif


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Daniel Kiper June 15, 2018, 9:49 a.m. UTC | #3
On Thu, Jun 14, 2018 at 04:37:34PM +0100, Leif Lindholm wrote:
> On Thu, Jun 14, 2018 at 03:38:13PM +0200, Daniel Kiper wrote:

> > On Mon, Jun 11, 2018 at 05:24:57PM +0100, Leif Lindholm wrote:

> > > Set #address-cells and #size-cells properties (to 2) for ARM*/UEFI

> > > systems when creating an empty DT at boot time. This resolves an issue

> > > seen in the wild with kexec on certain 64-bit ARM systems.

> > >

> > > First part is moving out the prop_entry_size macro from lib/fdt.c

> > > and make it available in <grub/fdt.h> (with the required name

> > > change).

> > >

> > > Second part is adding the two properties to the empty tree.

> >

> > In general LGTM. Though I would prefer "?" instead of "if" in patch #2.

> > Or at least drop curly braces. Anyway, if you are OK with proposed

> > changes I can incorporate them before push.

>

> I thought the added additional bits made the ternary a bit painful,

> but I'd be happy for you to get rid of the braces (TianoCore coding


Granted! I will drop the braces.

> style is making me use those more heavily :)


:-)))

If there are no objections I apply the patches in a week or so.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel