lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqLd1YezwczSsE7vFjxQ4C5VHQaG4nL3OTXA+QcXX+pxqw@mail.gmail.com>
Date: Mon, 4 Nov 2024 14:07:59 -0600
From: Rob Herring <robh@...nel.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>, 
	Saravana Kannan <saravanak@...gle.com>, Bjorn Helgaas <bhelgaas@...gle.com>, 
	Lizhi Hou <lizhi.hou@....com>, linux-kernel@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-pci@...r.kernel.org, 
	Allan Nielsen <allan.nielsen@...rochip.com>, Horatiu Vultur <horatiu.vultur@...rochip.com>, 
	Steen Hegelund <steen.hegelund@...rochip.com>, 
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH 5/6] of: Use the standards compliant default address cells
 value for x86

On Mon, Nov 4, 2024 at 11:20 AM Herve Codina <herve.codina@...tlin.com> wrote:
>
> The default address cells value is 1.
>
> According to the devicetree specification and the OpenFirmware standard
> (IEEE 1275-1994) this default value should be 2.
>
> The device tree compiler already use 2 as default value and the powerpc
> PROM code also use 2 as default value. Modern implementation should have
> the #address-cells property set and should not rely on this default
> value.

It's a mess.

Relying on defaults and inheriting from parent nodes in dtc has been a
warning as far back as I could trace (2005-2006).


> On x86, an empty root device-tree node is created but as the hardware
> is not described by a device-tree passed by the bootloader, this root
> device-tree remains empty and so the #address-cells default value is
> used.
>
> In preparation of the support for device-tree overlay on PCI devices
> feature on x86 (i.e. the creation of the PCI root bus device-tree node),
> this default value needs to be updated. Indeed, on x86_64, addresses are
> on 64bits and the upper part of an address is needed for correct address
> translations. On x86_32 having the default value updated does not lead
> to issues while the uppert part of a 64bits address is zero.
>
> Changing the default value for all architectures may break device-tree
> compatibility. Indeed, existing dts file without the #address-cells
> property set in the root node will not be compatible with this
> modification. Restrict the modification to the x86 architecture.
>
> Instead of having 1 for this default value, be consistent with standards
> and set the default address cells value to 2 in case of x86.

I prefer the default to just be wrong. My intention is to get rid of
the defaults (at least for all FDT, not OF) and walking up parent
nodes. My first step was to add warnings[1] and see who complained.

The base tree needs to be populated with #address-cells/#size-cells.
I'd be fine if we say those are always 2 to keep it simple.

Rob

[1] https://lore.kernel.org/all/20240530185049.2851617-1-robh@kernel.org/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ