All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27  6:05 ` Jonathan Toppins
  0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Toppins @ 2018-02-27  6:05 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: jtoppins, astone, jcm, catalin.marinas, will.deacon,
	rafael.j.wysocki, mingo, prarit, james.morse, andriy.shevchenko,
	bhsharma, linux-kernel, rhkernel-list

This patch allows a user to configure ACPI to be preferred over
device-tree.

Currently for ACPI to be used a user either has to set acpi=on on the
kernel command line or make sure any device tree passed to the kernel
is empty. If the dtb passed to the kernel is non-empty then device-tree
will be chosen as the boot method of choice even if it is not correct.
To prevent this situation where a system is only intended to be booted
via ACPI a user can set this kernel configuration so it ignores
device-tree settings unless ACPI table checks fail.

Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
---

 arch/arm64/Kconfig       | 13 +++++++++++++
 arch/arm64/kernel/acpi.c |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7381eeb7ef8e..da8d9ab62825 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1170,6 +1170,19 @@ config ARM64_ACPI_PARKING_PROTOCOL
 	  protocol even if the corresponding data is present in the ACPI
 	  MADT table.
 
+config ARM64_PREFER_ACPI
+	bool "Prefer usage of ACPI boot tables over device-tree"
+	depends on ACPI
+	help
+	  Normally device-tree is preferred over ACPI on arm64 unless
+	  explicitly preferred via kernel command line, something like: acpi=on
+	  This configuration changes this default behaviour by pretending
+	  the user set acpi=on on the command line. This configuration still
+	  allows the user to turn acpi table parsing off via acpi=off. If
+	  for some reason the table checks fail the system will still fall
+	  back to using device-tree unless the user explicitly sets acpi=force
+	  on the command line.
+
 config CMDLINE
 	string "Default kernel command string"
 	default ""
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 7b09487ff8fb..315b001c45f1 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -44,7 +44,7 @@ int acpi_pci_disabled = 1;	/* skip ACPI PCI scan and IRQ initialization */
 EXPORT_SYMBOL(acpi_pci_disabled);
 
 static bool param_acpi_off __initdata;
-static bool param_acpi_on __initdata;
+static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI);
 static bool param_acpi_force __initdata;
 
 static int __init parse_acpi(char *arg)
-- 
2.13.6

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27  6:05 ` Jonathan Toppins
  0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Toppins @ 2018-02-27  6:05 UTC (permalink / raw)
  To: linux-arm-kernel

This patch allows a user to configure ACPI to be preferred over
device-tree.

Currently for ACPI to be used a user either has to set acpi=on on the
kernel command line or make sure any device tree passed to the kernel
is empty. If the dtb passed to the kernel is non-empty then device-tree
will be chosen as the boot method of choice even if it is not correct.
To prevent this situation where a system is only intended to be booted
via ACPI a user can set this kernel configuration so it ignores
device-tree settings unless ACPI table checks fail.

Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
---

 arch/arm64/Kconfig       | 13 +++++++++++++
 arch/arm64/kernel/acpi.c |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7381eeb7ef8e..da8d9ab62825 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1170,6 +1170,19 @@ config ARM64_ACPI_PARKING_PROTOCOL
 	  protocol even if the corresponding data is present in the ACPI
 	  MADT table.
 
+config ARM64_PREFER_ACPI
+	bool "Prefer usage of ACPI boot tables over device-tree"
+	depends on ACPI
+	help
+	  Normally device-tree is preferred over ACPI on arm64 unless
+	  explicitly preferred via kernel command line, something like: acpi=on
+	  This configuration changes this default behaviour by pretending
+	  the user set acpi=on on the command line. This configuration still
+	  allows the user to turn acpi table parsing off via acpi=off. If
+	  for some reason the table checks fail the system will still fall
+	  back to using device-tree unless the user explicitly sets acpi=force
+	  on the command line.
+
 config CMDLINE
 	string "Default kernel command string"
 	default ""
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 7b09487ff8fb..315b001c45f1 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -44,7 +44,7 @@ int acpi_pci_disabled = 1;	/* skip ACPI PCI scan and IRQ initialization */
 EXPORT_SYMBOL(acpi_pci_disabled);
 
 static bool param_acpi_off __initdata;
-static bool param_acpi_on __initdata;
+static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI);
 static bool param_acpi_force __initdata;
 
 static int __init parse_acpi(char *arg)
-- 
2.13.6

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27  6:05 ` Jonathan Toppins
@ 2018-02-27  7:22   ` Ard Biesheuvel
  -1 siblings, 0 replies; 24+ messages in thread
From: Ard Biesheuvel @ 2018-02-27  7:22 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: linux-arm-kernel, prarit, rhkernel-list, Jon Masters,
	Bhupesh Sharma, Rafael J. Wysocki, Will Deacon,
	Linux Kernel Mailing List, astone, James Morse, Catalin Marinas,
	Andy Shevchenko, Ingo Molnar

Hi Jonathan,

On 27 February 2018 at 06:05, Jonathan Toppins <jtoppins@redhat.com> wrote:
> This patch allows a user to configure ACPI to be preferred over
> device-tree.
>

This comes up once a year or so, and the consensus has been so far
that it is not up to the kernel to reason about whether DT or ACPI
should be preferred if both are supplied, Instead, it is up to the
firmware to ensure that only one of those is provided, and we added a
generic driver to EDK2 that implements this.

> Currently for ACPI to be used a user either has to set acpi=on on the
> kernel command line or make sure any device tree passed to the kernel
> is empty. If the dtb passed to the kernel is non-empty then device-tree
> will be chosen as the boot method of choice even if it is not correct.

Your firmware is terminally broken if it provides an incorrect DT, and
we should not be fixing it in the kernel.

> To prevent this situation where a system is only intended to be booted
> via ACPI a user can set this kernel configuration so it ignores
> device-tree settings unless ACPI table checks fail.
>

'only intended to be booted via ACPI' is a property of the system, not
of the OS. If you need this functionality for development, you can
append 'acpi=on' to the kernel command line via kconfig.


> Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
> ---
>
>  arch/arm64/Kconfig       | 13 +++++++++++++
>  arch/arm64/kernel/acpi.c |  2 +-
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 7381eeb7ef8e..da8d9ab62825 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1170,6 +1170,19 @@ config ARM64_ACPI_PARKING_PROTOCOL
>           protocol even if the corresponding data is present in the ACPI
>           MADT table.
>
> +config ARM64_PREFER_ACPI
> +       bool "Prefer usage of ACPI boot tables over device-tree"
> +       depends on ACPI
> +       help
> +         Normally device-tree is preferred over ACPI on arm64 unless
> +         explicitly preferred via kernel command line, something like: acpi=on
> +         This configuration changes this default behaviour by pretending
> +         the user set acpi=on on the command line. This configuration still
> +         allows the user to turn acpi table parsing off via acpi=off. If
> +         for some reason the table checks fail the system will still fall
> +         back to using device-tree unless the user explicitly sets acpi=force
> +         on the command line.
> +
>  config CMDLINE
>         string "Default kernel command string"
>         default ""
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 7b09487ff8fb..315b001c45f1 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -44,7 +44,7 @@ int acpi_pci_disabled = 1;    /* skip ACPI PCI scan and IRQ initialization */
>  EXPORT_SYMBOL(acpi_pci_disabled);
>
>  static bool param_acpi_off __initdata;
> -static bool param_acpi_on __initdata;
> +static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI);
>  static bool param_acpi_force __initdata;
>
>  static int __init parse_acpi(char *arg)
> --
> 2.13.6
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27  7:22   ` Ard Biesheuvel
  0 siblings, 0 replies; 24+ messages in thread
From: Ard Biesheuvel @ 2018-02-27  7:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jonathan,

On 27 February 2018 at 06:05, Jonathan Toppins <jtoppins@redhat.com> wrote:
> This patch allows a user to configure ACPI to be preferred over
> device-tree.
>

This comes up once a year or so, and the consensus has been so far
that it is not up to the kernel to reason about whether DT or ACPI
should be preferred if both are supplied, Instead, it is up to the
firmware to ensure that only one of those is provided, and we added a
generic driver to EDK2 that implements this.

> Currently for ACPI to be used a user either has to set acpi=on on the
> kernel command line or make sure any device tree passed to the kernel
> is empty. If the dtb passed to the kernel is non-empty then device-tree
> will be chosen as the boot method of choice even if it is not correct.

Your firmware is terminally broken if it provides an incorrect DT, and
we should not be fixing it in the kernel.

> To prevent this situation where a system is only intended to be booted
> via ACPI a user can set this kernel configuration so it ignores
> device-tree settings unless ACPI table checks fail.
>

'only intended to be booted via ACPI' is a property of the system, not
of the OS. If you need this functionality for development, you can
append 'acpi=on' to the kernel command line via kconfig.


> Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
> ---
>
>  arch/arm64/Kconfig       | 13 +++++++++++++
>  arch/arm64/kernel/acpi.c |  2 +-
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 7381eeb7ef8e..da8d9ab62825 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1170,6 +1170,19 @@ config ARM64_ACPI_PARKING_PROTOCOL
>           protocol even if the corresponding data is present in the ACPI
>           MADT table.
>
> +config ARM64_PREFER_ACPI
> +       bool "Prefer usage of ACPI boot tables over device-tree"
> +       depends on ACPI
> +       help
> +         Normally device-tree is preferred over ACPI on arm64 unless
> +         explicitly preferred via kernel command line, something like: acpi=on
> +         This configuration changes this default behaviour by pretending
> +         the user set acpi=on on the command line. This configuration still
> +         allows the user to turn acpi table parsing off via acpi=off. If
> +         for some reason the table checks fail the system will still fall
> +         back to using device-tree unless the user explicitly sets acpi=force
> +         on the command line.
> +
>  config CMDLINE
>         string "Default kernel command string"
>         default ""
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 7b09487ff8fb..315b001c45f1 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -44,7 +44,7 @@ int acpi_pci_disabled = 1;    /* skip ACPI PCI scan and IRQ initialization */
>  EXPORT_SYMBOL(acpi_pci_disabled);
>
>  static bool param_acpi_off __initdata;
> -static bool param_acpi_on __initdata;
> +static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI);
>  static bool param_acpi_force __initdata;
>
>  static int __init parse_acpi(char *arg)
> --
> 2.13.6
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27  6:05 ` Jonathan Toppins
@ 2018-02-27 12:40   ` Bhupesh Sharma
  -1 siblings, 0 replies; 24+ messages in thread
From: Bhupesh Sharma @ 2018-02-27 12:40 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: linux-arm-kernel, astone, Jonathan Masters, Catalin Marinas,
	Will Deacon, rafael.j.wysocki, Ingo Molnar, Prarit Bhargava,
	James Morse, andriy.shevchenko, linux-kernel

Hi,

On Tue, Feb 27, 2018 at 11:35 AM, Jonathan Toppins <jtoppins@redhat.com> wrote:
> This patch allows a user to configure ACPI to be preferred over
> device-tree.
>
> Currently for ACPI to be used a user either has to set acpi=on on the
> kernel command line or make sure any device tree passed to the kernel
> is empty. If the dtb passed to the kernel is non-empty then device-tree
> will be chosen as the boot method of choice even if it is not correct.

Hmm. Not sure if I correctly understand what you mean here by the term
'incorrect device tree'. Do you mean a corrupted device tree blob (but
normally we can catch those cases via the device tree header) or a
deliberate (or a broken) firmware attempt to pass an incorrect device
tree blob to the OS.

If its the later, I think the onus should be on the firmware (u-boot
or UEFI or others.. ) to fix the problems. I know we carry a lot of
fixes in the kernel for x86 firmware quirks but then we have several
broken x86 machines on which kernel has been running since several
years now.

IMO, if we have a known firmware quirk (to fix the broken DTB being
passed from the firmware), we can look at adding it in the early arm64
kernel code (similar to the quirk handling we do in the x86 early
kernel code for broken firmware), rather than forcing ACPI as the boot
method.

> To prevent this situation where a system is only intended to be booted
> via ACPI a user can set this kernel configuration so it ignores
> device-tree settings unless ACPI table checks fail.

Or, if decide to depreciate DTB as the boot method for such boards,
can we look at setting 'acpi=force' in the bootagrs always to make
sure that ACPI (and no fallback on DTB) is forced as the boot method
for such arm64 machines.

Regards,
Bhupesh

> Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
> ---
>
>  arch/arm64/Kconfig       | 13 +++++++++++++
>  arch/arm64/kernel/acpi.c |  2 +-
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 7381eeb7ef8e..da8d9ab62825 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1170,6 +1170,19 @@ config ARM64_ACPI_PARKING_PROTOCOL
>           protocol even if the corresponding data is present in the ACPI
>           MADT table.
>
> +config ARM64_PREFER_ACPI
> +       bool "Prefer usage of ACPI boot tables over device-tree"
> +       depends on ACPI
> +       help
> +         Normally device-tree is preferred over ACPI on arm64 unless
> +         explicitly preferred via kernel command line, something like: acpi=on
> +         This configuration changes this default behaviour by pretending
> +         the user set acpi=on on the command line. This configuration still
> +         allows the user to turn acpi table parsing off via acpi=off. If
> +         for some reason the table checks fail the system will still fall
> +         back to using device-tree unless the user explicitly sets acpi=force
> +         on the command line.
> +
>  config CMDLINE
>         string "Default kernel command string"
>         default ""
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 7b09487ff8fb..315b001c45f1 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -44,7 +44,7 @@ int acpi_pci_disabled = 1;    /* skip ACPI PCI scan and IRQ initialization */
>  EXPORT_SYMBOL(acpi_pci_disabled);
>
>  static bool param_acpi_off __initdata;
> -static bool param_acpi_on __initdata;
> +static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI);
>  static bool param_acpi_force __initdata;
>
>  static int __init parse_acpi(char *arg)
> --
> 2.13.6
>

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 12:40   ` Bhupesh Sharma
  0 siblings, 0 replies; 24+ messages in thread
From: Bhupesh Sharma @ 2018-02-27 12:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Feb 27, 2018 at 11:35 AM, Jonathan Toppins <jtoppins@redhat.com> wrote:
> This patch allows a user to configure ACPI to be preferred over
> device-tree.
>
> Currently for ACPI to be used a user either has to set acpi=on on the
> kernel command line or make sure any device tree passed to the kernel
> is empty. If the dtb passed to the kernel is non-empty then device-tree
> will be chosen as the boot method of choice even if it is not correct.

Hmm. Not sure if I correctly understand what you mean here by the term
'incorrect device tree'. Do you mean a corrupted device tree blob (but
normally we can catch those cases via the device tree header) or a
deliberate (or a broken) firmware attempt to pass an incorrect device
tree blob to the OS.

If its the later, I think the onus should be on the firmware (u-boot
or UEFI or others.. ) to fix the problems. I know we carry a lot of
fixes in the kernel for x86 firmware quirks but then we have several
broken x86 machines on which kernel has been running since several
years now.

IMO, if we have a known firmware quirk (to fix the broken DTB being
passed from the firmware), we can look at adding it in the early arm64
kernel code (similar to the quirk handling we do in the x86 early
kernel code for broken firmware), rather than forcing ACPI as the boot
method.

> To prevent this situation where a system is only intended to be booted
> via ACPI a user can set this kernel configuration so it ignores
> device-tree settings unless ACPI table checks fail.

Or, if decide to depreciate DTB as the boot method for such boards,
can we look at setting 'acpi=force' in the bootagrs always to make
sure that ACPI (and no fallback on DTB) is forced as the boot method
for such arm64 machines.

Regards,
Bhupesh

> Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
> ---
>
>  arch/arm64/Kconfig       | 13 +++++++++++++
>  arch/arm64/kernel/acpi.c |  2 +-
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 7381eeb7ef8e..da8d9ab62825 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1170,6 +1170,19 @@ config ARM64_ACPI_PARKING_PROTOCOL
>           protocol even if the corresponding data is present in the ACPI
>           MADT table.
>
> +config ARM64_PREFER_ACPI
> +       bool "Prefer usage of ACPI boot tables over device-tree"
> +       depends on ACPI
> +       help
> +         Normally device-tree is preferred over ACPI on arm64 unless
> +         explicitly preferred via kernel command line, something like: acpi=on
> +         This configuration changes this default behaviour by pretending
> +         the user set acpi=on on the command line. This configuration still
> +         allows the user to turn acpi table parsing off via acpi=off. If
> +         for some reason the table checks fail the system will still fall
> +         back to using device-tree unless the user explicitly sets acpi=force
> +         on the command line.
> +
>  config CMDLINE
>         string "Default kernel command string"
>         default ""
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 7b09487ff8fb..315b001c45f1 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -44,7 +44,7 @@ int acpi_pci_disabled = 1;    /* skip ACPI PCI scan and IRQ initialization */
>  EXPORT_SYMBOL(acpi_pci_disabled);
>
>  static bool param_acpi_off __initdata;
> -static bool param_acpi_on __initdata;
> +static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI);
>  static bool param_acpi_force __initdata;
>
>  static int __init parse_acpi(char *arg)
> --
> 2.13.6
>

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27  7:22   ` Ard Biesheuvel
@ 2018-02-27 14:28     ` Jonathan Toppins
  -1 siblings, 0 replies; 24+ messages in thread
From: Jonathan Toppins @ 2018-02-27 14:28 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: prarit, Jon Masters, Bhupesh Sharma, Rafael J. Wysocki,
	Will Deacon, Linux Kernel Mailing List, astone, James Morse,
	Catalin Marinas, Andy Shevchenko, Ingo Molnar, linux-arm-kernel

On 02/27/2018 02:22 AM, Ard Biesheuvel wrote:
> Hi Jonathan,
> 
> On 27 February 2018 at 06:05, Jonathan Toppins <jtoppins@redhat.com> wrote:
>> This patch allows a user to configure ACPI to be preferred over
>> device-tree.
>>
> 
> This comes up once a year or so, and the consensus has been so far
> that it is not up to the kernel to reason about whether DT or ACPI
> should be preferred if both are supplied, Instead, it is up to the
> firmware to ensure that only one of those is provided, and we added a
> generic driver to EDK2 that implements this.

I am assuming EDK2 is some sort of firmware code base, not that I have
ever heard of it before. This logic compared with the implementation in
the kernel seems divergent. The kernel is clearly making a choice about
which boot table (DT vs ACPI) to configure with. So to claim it is not
the kernel's job to reason about which to use is clearly incorrect. The
only thing this patch is doing is making it easier for distributions to
configure which preference the kernel has.

> 
>> Currently for ACPI to be used a user either has to set acpi=on on the
>> kernel command line or make sure any device tree passed to the kernel
>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>> will be chosen as the boot method of choice even if it is not correct.
> 
> Your firmware is terminally broken if it provides an incorrect DT, and
> we should not be fixing it in the kernel.

This logic would seem akin to me asking Bjorn to remove all PCI quirks
from the kernel, because the systems that use them are "terminally
broken" or "don't follow the standard". This doesn't seem like a valid
reason to deny a change that would allow the kernel to boot on more
hardware. Further it seems rather rigid to effectively say that we only
run on perfect firmware.

> 
>> To prevent this situation where a system is only intended to be booted
>> via ACPI a user can set this kernel configuration so it ignores
>> device-tree settings unless ACPI table checks fail.
>>
> 
> 'only intended to be booted via ACPI' is a property of the system, not
> of the OS. If you need this functionality for development, you can
> append 'acpi=on' to the kernel command line via kconfig.

This is not for development this is for production rate shipping firmware.

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 14:28     ` Jonathan Toppins
  0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Toppins @ 2018-02-27 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/27/2018 02:22 AM, Ard Biesheuvel wrote:
> Hi Jonathan,
> 
> On 27 February 2018 at 06:05, Jonathan Toppins <jtoppins@redhat.com> wrote:
>> This patch allows a user to configure ACPI to be preferred over
>> device-tree.
>>
> 
> This comes up once a year or so, and the consensus has been so far
> that it is not up to the kernel to reason about whether DT or ACPI
> should be preferred if both are supplied, Instead, it is up to the
> firmware to ensure that only one of those is provided, and we added a
> generic driver to EDK2 that implements this.

I am assuming EDK2 is some sort of firmware code base, not that I have
ever heard of it before. This logic compared with the implementation in
the kernel seems divergent. The kernel is clearly making a choice about
which boot table (DT vs ACPI) to configure with. So to claim it is not
the kernel's job to reason about which to use is clearly incorrect. The
only thing this patch is doing is making it easier for distributions to
configure which preference the kernel has.

> 
>> Currently for ACPI to be used a user either has to set acpi=on on the
>> kernel command line or make sure any device tree passed to the kernel
>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>> will be chosen as the boot method of choice even if it is not correct.
> 
> Your firmware is terminally broken if it provides an incorrect DT, and
> we should not be fixing it in the kernel.

This logic would seem akin to me asking Bjorn to remove all PCI quirks
from the kernel, because the systems that use them are "terminally
broken" or "don't follow the standard". This doesn't seem like a valid
reason to deny a change that would allow the kernel to boot on more
hardware. Further it seems rather rigid to effectively say that we only
run on perfect firmware.

> 
>> To prevent this situation where a system is only intended to be booted
>> via ACPI a user can set this kernel configuration so it ignores
>> device-tree settings unless ACPI table checks fail.
>>
> 
> 'only intended to be booted via ACPI' is a property of the system, not
> of the OS. If you need this functionality for development, you can
> append 'acpi=on' to the kernel command line via kconfig.

This is not for development this is for production rate shipping firmware.

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27 12:40   ` Bhupesh Sharma
@ 2018-02-27 14:44     ` Jonathan Toppins
  -1 siblings, 0 replies; 24+ messages in thread
From: Jonathan Toppins @ 2018-02-27 14:44 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: linux-arm-kernel, astone, Jonathan Masters, Catalin Marinas,
	Will Deacon, rafael.j.wysocki, Ingo Molnar, Prarit Bhargava,
	James Morse, andriy.shevchenko, linux-kernel

On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
> Hi,
> 
> On Tue, Feb 27, 2018 at 11:35 AM, Jonathan Toppins <jtoppins@redhat.com> wrote:
>> This patch allows a user to configure ACPI to be preferred over
>> device-tree.
>>
>> Currently for ACPI to be used a user either has to set acpi=on on the
>> kernel command line or make sure any device tree passed to the kernel
>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>> will be chosen as the boot method of choice even if it is not correct.
> 
> Hmm. Not sure if I correctly understand what you mean here by the term
> 'incorrect device tree'. Do you mean a corrupted device tree blob (but
> normally we can catch those cases via the device tree header) or a
> deliberate (or a broken) firmware attempt to pass an incorrect device
> tree blob to the OS.

I mean a device tree that doesn't list all devices in the SOC. So it is
more incomplete than incorrect. It could also be incorrect in that it
doesn't list proper timings, memory/pci/etc.

> 
> If its the later, I think the onus should be on the firmware (u-boot
> or UEFI or others.. ) to fix the problems. I know we carry a lot of
> fixes in the kernel for x86 firmware quirks but then we have several
> broken x86 machines on which kernel has been running since several
> years now.
> 
> IMO, if we have a known firmware quirk (to fix the broken DTB being
> passed from the firmware), we can look at adding it in the early arm64
> kernel code (similar to the quirk handling we do in the x86 early
> kernel code for broken firmware), rather than forcing ACPI as the boot
> method.
> 
>> To prevent this situation where a system is only intended to be booted
>> via ACPI a user can set this kernel configuration so it ignores
>> device-tree settings unless ACPI table checks fail.
> 
> Or, if decide to depreciate DTB as the boot method for such boards,
> can we look at setting 'acpi=force' in the bootagrs always to make
> sure that ACPI (and no fallback on DTB) is forced as the boot method
> for such arm64 machines.

For arm64 DT is suppose to *not* be the preferred method, yet still DT
is preferred if the firmware provides both tables to the kernel. So it
seems reasonable to eventually have a default that effectively does
acpi=force for arm64. This patch was taking the halfway approach to just
have the kernel prefer acpi. I would prefer to just change to kernel
bool values instead of compiling in kernel command line args, as command
line args are usually left for the end user to play with.

-Jon

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 14:44     ` Jonathan Toppins
  0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Toppins @ 2018-02-27 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
> Hi,
> 
> On Tue, Feb 27, 2018 at 11:35 AM, Jonathan Toppins <jtoppins@redhat.com> wrote:
>> This patch allows a user to configure ACPI to be preferred over
>> device-tree.
>>
>> Currently for ACPI to be used a user either has to set acpi=on on the
>> kernel command line or make sure any device tree passed to the kernel
>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>> will be chosen as the boot method of choice even if it is not correct.
> 
> Hmm. Not sure if I correctly understand what you mean here by the term
> 'incorrect device tree'. Do you mean a corrupted device tree blob (but
> normally we can catch those cases via the device tree header) or a
> deliberate (or a broken) firmware attempt to pass an incorrect device
> tree blob to the OS.

I mean a device tree that doesn't list all devices in the SOC. So it is
more incomplete than incorrect. It could also be incorrect in that it
doesn't list proper timings, memory/pci/etc.

> 
> If its the later, I think the onus should be on the firmware (u-boot
> or UEFI or others.. ) to fix the problems. I know we carry a lot of
> fixes in the kernel for x86 firmware quirks but then we have several
> broken x86 machines on which kernel has been running since several
> years now.
> 
> IMO, if we have a known firmware quirk (to fix the broken DTB being
> passed from the firmware), we can look at adding it in the early arm64
> kernel code (similar to the quirk handling we do in the x86 early
> kernel code for broken firmware), rather than forcing ACPI as the boot
> method.
> 
>> To prevent this situation where a system is only intended to be booted
>> via ACPI a user can set this kernel configuration so it ignores
>> device-tree settings unless ACPI table checks fail.
> 
> Or, if decide to depreciate DTB as the boot method for such boards,
> can we look at setting 'acpi=force' in the bootagrs always to make
> sure that ACPI (and no fallback on DTB) is forced as the boot method
> for such arm64 machines.

For arm64 DT is suppose to *not* be the preferred method, yet still DT
is preferred if the firmware provides both tables to the kernel. So it
seems reasonable to eventually have a default that effectively does
acpi=force for arm64. This patch was taking the halfway approach to just
have the kernel prefer acpi. I would prefer to just change to kernel
bool values instead of compiling in kernel command line args, as command
line args are usually left for the end user to play with.

-Jon

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27 14:28     ` Jonathan Toppins
@ 2018-02-27 14:54       ` Ard Biesheuvel
  -1 siblings, 0 replies; 24+ messages in thread
From: Ard Biesheuvel @ 2018-02-27 14:54 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: prarit, Jon Masters, Bhupesh Sharma, Rafael J. Wysocki,
	Will Deacon, Linux Kernel Mailing List, astone, James Morse,
	Catalin Marinas, Andy Shevchenko, Ingo Molnar, linux-arm-kernel

On 27 February 2018 at 14:28, Jonathan Toppins <jtoppins@redhat.com> wrote:
> On 02/27/2018 02:22 AM, Ard Biesheuvel wrote:
>> Hi Jonathan,
>>
>> On 27 February 2018 at 06:05, Jonathan Toppins <jtoppins@redhat.com> wrote:
>>> This patch allows a user to configure ACPI to be preferred over
>>> device-tree.
>>>
>>
>> This comes up once a year or so, and the consensus has been so far
>> that it is not up to the kernel to reason about whether DT or ACPI
>> should be preferred if both are supplied, Instead, it is up to the
>> firmware to ensure that only one of those is provided, and we added a
>> generic driver to EDK2 that implements this.
>
> I am assuming EDK2 is some sort of firmware code base, not that I have
> ever heard of it before. This logic compared with the implementation in
> the kernel seems divergent. The kernel is clearly making a choice about
> which boot table (DT vs ACPI) to configure with. So to claim it is not
> the kernel's job to reason about which to use is clearly incorrect.

The arm64 ACPI kernel requires DT support to boot in the first place
(due to its dependency on UEFI), and DT support predates ACPI support
by a couple of years. So it is far from unreasonable that the default
assumption is DT.

> The
> only thing this patch is doing is making it easier for distributions to
> configure which preference the kernel has.
>

No, it does more than that:
- it doubles the size of your validation matrix, because now you will
have 'DT kernels' and 'ACPI kernels'
- it will remove the little incentive vendors have to get with the
program, adhere to the SBBR and ensure that the OS is not left to
choose between DT and ACPI.

>>
>>> Currently for ACPI to be used a user either has to set acpi=on on the
>>> kernel command line or make sure any device tree passed to the kernel
>>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>>> will be chosen as the boot method of choice even if it is not correct.
>>
>> Your firmware is terminally broken if it provides an incorrect DT, and
>> we should not be fixing it in the kernel.
>
> This logic would seem akin to me asking Bjorn to remove all PCI quirks
> from the kernel, because the systems that use them are "terminally
> broken" or "don't follow the standard".

Do you really think PCI quirks are there to work around software bugs?

> This doesn't seem like a valid
> reason to deny a change that would allow the kernel to boot on more
> hardware. Further it seems rather rigid to effectively say that we only
> run on perfect firmware.
>

Could you please try to respond to what is actually being said rather
than put words in my mouth?

Nobody is saying we only run on perfect firmware. I am saying it
should not be left to the OS to reason about which hardware
description it should use.

>>
>>> To prevent this situation where a system is only intended to be booted
>>> via ACPI a user can set this kernel configuration so it ignores
>>> device-tree settings unless ACPI table checks fail.
>>>
>>
>> 'only intended to be booted via ACPI' is a property of the system, not
>> of the OS. If you need this functionality for development, you can
>> append 'acpi=on' to the kernel command line via kconfig.
>
> This is not for development this is for production rate shipping firmware.

... that is unmaintained and exposes a broken DT alongside ACPI tables?

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 14:54       ` Ard Biesheuvel
  0 siblings, 0 replies; 24+ messages in thread
From: Ard Biesheuvel @ 2018-02-27 14:54 UTC (permalink / raw)
  To: linux-arm-kernel

On 27 February 2018 at 14:28, Jonathan Toppins <jtoppins@redhat.com> wrote:
> On 02/27/2018 02:22 AM, Ard Biesheuvel wrote:
>> Hi Jonathan,
>>
>> On 27 February 2018 at 06:05, Jonathan Toppins <jtoppins@redhat.com> wrote:
>>> This patch allows a user to configure ACPI to be preferred over
>>> device-tree.
>>>
>>
>> This comes up once a year or so, and the consensus has been so far
>> that it is not up to the kernel to reason about whether DT or ACPI
>> should be preferred if both are supplied, Instead, it is up to the
>> firmware to ensure that only one of those is provided, and we added a
>> generic driver to EDK2 that implements this.
>
> I am assuming EDK2 is some sort of firmware code base, not that I have
> ever heard of it before. This logic compared with the implementation in
> the kernel seems divergent. The kernel is clearly making a choice about
> which boot table (DT vs ACPI) to configure with. So to claim it is not
> the kernel's job to reason about which to use is clearly incorrect.

The arm64 ACPI kernel requires DT support to boot in the first place
(due to its dependency on UEFI), and DT support predates ACPI support
by a couple of years. So it is far from unreasonable that the default
assumption is DT.

> The
> only thing this patch is doing is making it easier for distributions to
> configure which preference the kernel has.
>

No, it does more than that:
- it doubles the size of your validation matrix, because now you will
have 'DT kernels' and 'ACPI kernels'
- it will remove the little incentive vendors have to get with the
program, adhere to the SBBR and ensure that the OS is not left to
choose between DT and ACPI.

>>
>>> Currently for ACPI to be used a user either has to set acpi=on on the
>>> kernel command line or make sure any device tree passed to the kernel
>>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>>> will be chosen as the boot method of choice even if it is not correct.
>>
>> Your firmware is terminally broken if it provides an incorrect DT, and
>> we should not be fixing it in the kernel.
>
> This logic would seem akin to me asking Bjorn to remove all PCI quirks
> from the kernel, because the systems that use them are "terminally
> broken" or "don't follow the standard".

Do you really think PCI quirks are there to work around software bugs?

> This doesn't seem like a valid
> reason to deny a change that would allow the kernel to boot on more
> hardware. Further it seems rather rigid to effectively say that we only
> run on perfect firmware.
>

Could you please try to respond to what is actually being said rather
than put words in my mouth?

Nobody is saying we only run on perfect firmware. I am saying it
should not be left to the OS to reason about which hardware
description it should use.

>>
>>> To prevent this situation where a system is only intended to be booted
>>> via ACPI a user can set this kernel configuration so it ignores
>>> device-tree settings unless ACPI table checks fail.
>>>
>>
>> 'only intended to be booted via ACPI' is a property of the system, not
>> of the OS. If you need this functionality for development, you can
>> append 'acpi=on' to the kernel command line via kconfig.
>
> This is not for development this is for production rate shipping firmware.

... that is unmaintained and exposes a broken DT alongside ACPI tables?

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27 14:28     ` Jonathan Toppins
@ 2018-02-27 14:55       ` Robin Murphy
  -1 siblings, 0 replies; 24+ messages in thread
From: Robin Murphy @ 2018-02-27 14:55 UTC (permalink / raw)
  To: jtoppins, Ard Biesheuvel
  Cc: prarit, Jon Masters, Bhupesh Sharma, Rafael J. Wysocki,
	Will Deacon, Linux Kernel Mailing List, astone, James Morse,
	Catalin Marinas, Andy Shevchenko, Ingo Molnar, linux-arm-kernel

On 27/02/18 14:28, Jonathan Toppins wrote:
>> 'only intended to be booted via ACPI' is a property of the system, not
>> of the OS. If you need this functionality for development, you can
>> append 'acpi=on' to the kernel command line via kconfig.
> 
> This is not for development this is for production rate shipping firmware.

Obvious question: if this is "production" firmware on systems which "do 
not support DT", what the hell is a non-trivial DT doing in there in the 
first place?

Robin.

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 14:55       ` Robin Murphy
  0 siblings, 0 replies; 24+ messages in thread
From: Robin Murphy @ 2018-02-27 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 27/02/18 14:28, Jonathan Toppins wrote:
>> 'only intended to be booted via ACPI' is a property of the system, not
>> of the OS. If you need this functionality for development, you can
>> append 'acpi=on' to the kernel command line via kconfig.
> 
> This is not for development this is for production rate shipping firmware.

Obvious question: if this is "production" firmware on systems which "do 
not support DT", what the hell is a non-trivial DT doing in there in the 
first place?

Robin.

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27 14:44     ` Jonathan Toppins
@ 2018-02-27 17:05       ` Mark Rutland
  -1 siblings, 0 replies; 24+ messages in thread
From: Mark Rutland @ 2018-02-27 17:05 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: Bhupesh Sharma, Prarit Bhargava, Jonathan Masters,
	rafael.j.wysocki, Will Deacon, linux-kernel, astone, James Morse,
	Catalin Marinas, andriy.shevchenko, Ingo Molnar,
	linux-arm-kernel

On Tue, Feb 27, 2018 at 09:44:09AM -0500, Jonathan Toppins wrote:
> For arm64 DT is suppose to *not* be the preferred method, 

This has never been the upstream position.

DT has been the default since day one, and changing this would be a
regression, as has been stated several times in the past.

If *the system vendor* intends that the system only uses ACPI, they
would not provide a DT.

If *you* prefer to use ACPI, feel free to alter your kernel command
line.

Thanks,
Mark.

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 17:05       ` Mark Rutland
  0 siblings, 0 replies; 24+ messages in thread
From: Mark Rutland @ 2018-02-27 17:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 27, 2018 at 09:44:09AM -0500, Jonathan Toppins wrote:
> For arm64 DT is suppose to *not* be the preferred method, 

This has never been the upstream position.

DT has been the default since day one, and changing this would be a
regression, as has been stated several times in the past.

If *the system vendor* intends that the system only uses ACPI, they
would not provide a DT.

If *you* prefer to use ACPI, feel free to alter your kernel command
line.

Thanks,
Mark.

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27 14:44     ` Jonathan Toppins
@ 2018-02-27 18:59       ` Bhupesh Sharma
  -1 siblings, 0 replies; 24+ messages in thread
From: Bhupesh Sharma @ 2018-02-27 18:59 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: linux-arm-kernel, astone, Jonathan Masters, Catalin Marinas,
	Will Deacon, rafael.j.wysocki, Ingo Molnar, Prarit Bhargava,
	James Morse, andriy.shevchenko, linux-kernel

On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com> wrote:
> On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
>> Hi,
>>
>> On Tue, Feb 27, 2018 at 11:35 AM, Jonathan Toppins <jtoppins@redhat.com> wrote:
>>> This patch allows a user to configure ACPI to be preferred over
>>> device-tree.
>>>
>>> Currently for ACPI to be used a user either has to set acpi=on on the
>>> kernel command line or make sure any device tree passed to the kernel
>>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>>> will be chosen as the boot method of choice even if it is not correct.
>>
>> Hmm. Not sure if I correctly understand what you mean here by the term
>> 'incorrect device tree'. Do you mean a corrupted device tree blob (but
>> normally we can catch those cases via the device tree header) or a
>> deliberate (or a broken) firmware attempt to pass an incorrect device
>> tree blob to the OS.
>
> I mean a device tree that doesn't list all devices in the SOC. So it is
> more incomplete than incorrect. It could also be incorrect in that it
> doesn't list proper timings, memory/pci/etc.
>
>>
>> If its the later, I think the onus should be on the firmware (u-boot
>> or UEFI or others.. ) to fix the problems. I know we carry a lot of
>> fixes in the kernel for x86 firmware quirks but then we have several
>> broken x86 machines on which kernel has been running since several
>> years now.
>>
>> IMO, if we have a known firmware quirk (to fix the broken DTB being
>> passed from the firmware), we can look at adding it in the early arm64
>> kernel code (similar to the quirk handling we do in the x86 early
>> kernel code for broken firmware), rather than forcing ACPI as the boot
>> method.
>>
>>> To prevent this situation where a system is only intended to be booted
>>> via ACPI a user can set this kernel configuration so it ignores
>>> device-tree settings unless ACPI table checks fail.
>>
>> Or, if decide to depreciate DTB as the boot method for such boards,
>> can we look at setting 'acpi=force' in the bootagrs always to make
>> sure that ACPI (and no fallback on DTB) is forced as the boot method
>> for such arm64 machines.
>
> For arm64 DT is suppose to *not* be the preferred method, yet still DT
> is preferred if the firmware provides both tables to the kernel.

That is true mainly for arm64 systems which are compliant to SBSA/SBBR
specifications and are mainly targeted for server markets.

However several arm64 products in embedded applications are still not
SBSA/SBBR compliant (and I have worked on a couple of such
implementations earlier) and still use bootloaders like u-boot (and
also closed-source implementations) which have no support for ACPI
currently and still rely on a DT to pass the system hardware
information to the kernel.

So far only open source implementation of a ACPI compliant firmware is
EDK2/UEFI which supports ACPI as the preferred boot method and I am
not sure if all u-boot/in-house firmware implementations are planned
to be ported over to EDK2/UEFI for embedded applications.

Even if they do, it would be safe to assume that to maintain backward
compatibility they will still look to support boot via DT as the
default boot method rather than ACPI.

Regards,
Bhupesh

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-27 18:59       ` Bhupesh Sharma
  0 siblings, 0 replies; 24+ messages in thread
From: Bhupesh Sharma @ 2018-02-27 18:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com> wrote:
> On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
>> Hi,
>>
>> On Tue, Feb 27, 2018 at 11:35 AM, Jonathan Toppins <jtoppins@redhat.com> wrote:
>>> This patch allows a user to configure ACPI to be preferred over
>>> device-tree.
>>>
>>> Currently for ACPI to be used a user either has to set acpi=on on the
>>> kernel command line or make sure any device tree passed to the kernel
>>> is empty. If the dtb passed to the kernel is non-empty then device-tree
>>> will be chosen as the boot method of choice even if it is not correct.
>>
>> Hmm. Not sure if I correctly understand what you mean here by the term
>> 'incorrect device tree'. Do you mean a corrupted device tree blob (but
>> normally we can catch those cases via the device tree header) or a
>> deliberate (or a broken) firmware attempt to pass an incorrect device
>> tree blob to the OS.
>
> I mean a device tree that doesn't list all devices in the SOC. So it is
> more incomplete than incorrect. It could also be incorrect in that it
> doesn't list proper timings, memory/pci/etc.
>
>>
>> If its the later, I think the onus should be on the firmware (u-boot
>> or UEFI or others.. ) to fix the problems. I know we carry a lot of
>> fixes in the kernel for x86 firmware quirks but then we have several
>> broken x86 machines on which kernel has been running since several
>> years now.
>>
>> IMO, if we have a known firmware quirk (to fix the broken DTB being
>> passed from the firmware), we can look at adding it in the early arm64
>> kernel code (similar to the quirk handling we do in the x86 early
>> kernel code for broken firmware), rather than forcing ACPI as the boot
>> method.
>>
>>> To prevent this situation where a system is only intended to be booted
>>> via ACPI a user can set this kernel configuration so it ignores
>>> device-tree settings unless ACPI table checks fail.
>>
>> Or, if decide to depreciate DTB as the boot method for such boards,
>> can we look at setting 'acpi=force' in the bootagrs always to make
>> sure that ACPI (and no fallback on DTB) is forced as the boot method
>> for such arm64 machines.
>
> For arm64 DT is suppose to *not* be the preferred method, yet still DT
> is preferred if the firmware provides both tables to the kernel.

That is true mainly for arm64 systems which are compliant to SBSA/SBBR
specifications and are mainly targeted for server markets.

However several arm64 products in embedded applications are still not
SBSA/SBBR compliant (and I have worked on a couple of such
implementations earlier) and still use bootloaders like u-boot (and
also closed-source implementations) which have no support for ACPI
currently and still rely on a DT to pass the system hardware
information to the kernel.

So far only open source implementation of a ACPI compliant firmware is
EDK2/UEFI which supports ACPI as the preferred boot method and I am
not sure if all u-boot/in-house firmware implementations are planned
to be ported over to EDK2/UEFI for embedded applications.

Even if they do, it would be safe to assume that to maintain backward
compatibility they will still look to support boot via DT as the
default boot method rather than ACPI.

Regards,
Bhupesh

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-27 18:59       ` Bhupesh Sharma
@ 2018-02-28 10:07         ` Andy Shevchenko
  -1 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2018-02-28 10:07 UTC (permalink / raw)
  To: Bhupesh Sharma, Jonathan Toppins
  Cc: linux-arm-kernel, astone, Jonathan Masters, Catalin Marinas,
	Will Deacon, rafael.j.wysocki, Ingo Molnar, Prarit Bhargava,
	James Morse, linux-kernel

On Wed, 2018-02-28 at 00:29 +0530, Bhupesh Sharma wrote:
> On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com
> > wrote:
> > On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
> > > 

> > For arm64 DT is suppose to *not* be the preferred method, yet still
> > DT
> > is preferred if the firmware provides both tables to the kernel.

> However several arm64 products in embedded applications are still not
> SBSA/SBBR compliant (and I have worked on a couple of such
> implementations earlier) and still use bootloaders like u-boot (and
> also closed-source implementations) which have no support for ACPI
> currently and still rely on a DT to pass the system hardware
> information to the kernel.

> So far only open source implementation of a ACPI compliant firmware is
> EDK2/UEFI which supports ACPI as the preferred boot method

You mean for non-x86?

>  and I am
> not sure if all u-boot/in-house firmware implementations are planned
> to be ported over to EDK2/UEFI for embedded applications.

Why do you need that? ACPI (if you are talking about ACPI only, w/o EFI)
is supported in U-Boot for few x86 SoCs/platforms. Moreover, one of them
had never been shipped with ACPI/EFI complaint services in firmware and
ACPI layer is purely done in U-Boot.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-28 10:07         ` Andy Shevchenko
  0 siblings, 0 replies; 24+ messages in thread
From: Andy Shevchenko @ 2018-02-28 10:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2018-02-28 at 00:29 +0530, Bhupesh Sharma wrote:
> On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com
> > wrote:
> > On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
> > > 

> > For arm64 DT is suppose to *not* be the preferred method, yet still
> > DT
> > is preferred if the firmware provides both tables to the kernel.

> However several arm64 products in embedded applications are still not
> SBSA/SBBR compliant (and I have worked on a couple of such
> implementations earlier) and still use bootloaders like u-boot (and
> also closed-source implementations) which have no support for ACPI
> currently and still rely on a DT to pass the system hardware
> information to the kernel.

> So far only open source implementation of a ACPI compliant firmware is
> EDK2/UEFI which supports ACPI as the preferred boot method

You mean for non-x86?

>  and I am
> not sure if all u-boot/in-house firmware implementations are planned
> to be ported over to EDK2/UEFI for embedded applications.

Why do you need that? ACPI (if you are talking about ACPI only, w/o EFI)
is supported in U-Boot for few x86 SoCs/platforms. Moreover, one of them
had never been shipped with ACPI/EFI complaint services in firmware and
ACPI layer is purely done in U-Boot.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-28 10:07         ` Andy Shevchenko
@ 2018-02-28 10:10           ` Rafael J. Wysocki
  -1 siblings, 0 replies; 24+ messages in thread
From: Rafael J. Wysocki @ 2018-02-28 10:10 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bhupesh Sharma, Jonathan Toppins, linux-arm-kernel, astone,
	Jonathan Masters, Catalin Marinas, Will Deacon, Ingo Molnar,
	Prarit Bhargava, James Morse, linux-kernel

On 2/28/2018 11:07 AM, Andy Shevchenko wrote:
> On Wed, 2018-02-28 at 00:29 +0530, Bhupesh Sharma wrote:
>> On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com
>>> wrote:
>>> On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
>>> For arm64 DT is suppose to *not* be the preferred method, yet still
>>> DT
>>> is preferred if the firmware provides both tables to the kernel.
>> However several arm64 products in embedded applications are still not
>> SBSA/SBBR compliant (and I have worked on a couple of such
>> implementations earlier) and still use bootloaders like u-boot (and
>> also closed-source implementations) which have no support for ACPI
>> currently and still rely on a DT to pass the system hardware
>> information to the kernel.
>> So far only open source implementation of a ACPI compliant firmware is
>> EDK2/UEFI which supports ACPI as the preferred boot method
> You mean for non-x86?
>
>>   and I am
>> not sure if all u-boot/in-house firmware implementations are planned
>> to be ported over to EDK2/UEFI for embedded applications.
> Why do you need that? ACPI (if you are talking about ACPI only, w/o EFI)
> is supported in U-Boot for few x86 SoCs/platforms. Moreover, one of them
> had never been shipped with ACPI/EFI complaint services in firmware and
> ACPI layer is purely done in U-Boot.
>
Right, let alone Chromebooks. :-)

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-28 10:10           ` Rafael J. Wysocki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafael J. Wysocki @ 2018-02-28 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 2/28/2018 11:07 AM, Andy Shevchenko wrote:
> On Wed, 2018-02-28 at 00:29 +0530, Bhupesh Sharma wrote:
>> On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com
>>> wrote:
>>> On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
>>> For arm64 DT is suppose to *not* be the preferred method, yet still
>>> DT
>>> is preferred if the firmware provides both tables to the kernel.
>> However several arm64 products in embedded applications are still not
>> SBSA/SBBR compliant (and I have worked on a couple of such
>> implementations earlier) and still use bootloaders like u-boot (and
>> also closed-source implementations) which have no support for ACPI
>> currently and still rely on a DT to pass the system hardware
>> information to the kernel.
>> So far only open source implementation of a ACPI compliant firmware is
>> EDK2/UEFI which supports ACPI as the preferred boot method
> You mean for non-x86?
>
>>   and I am
>> not sure if all u-boot/in-house firmware implementations are planned
>> to be ported over to EDK2/UEFI for embedded applications.
> Why do you need that? ACPI (if you are talking about ACPI only, w/o EFI)
> is supported in U-Boot for few x86 SoCs/platforms. Moreover, one of them
> had never been shipped with ACPI/EFI complaint services in firmware and
> ACPI layer is purely done in U-Boot.
>
Right, let alone Chromebooks. :-)

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

* Re: [PATCH] arm64/acpi: make ACPI boot preference configurable
  2018-02-28 10:07         ` Andy Shevchenko
@ 2018-02-28 10:32           ` Bhupesh Sharma
  -1 siblings, 0 replies; 24+ messages in thread
From: Bhupesh Sharma @ 2018-02-28 10:32 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Toppins, linux-arm-kernel, Al Stone, Jonathan Masters,
	Catalin Marinas, Will Deacon, rafael.j.wysocki, Ingo Molnar,
	Prarit Bhargava, James Morse, linux-kernel

On Wed, Feb 28, 2018 at 3:37 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Wed, 2018-02-28 at 00:29 +0530, Bhupesh Sharma wrote:
>> On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com
>> > wrote:
>> > On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
>> > >
>
>> > For arm64 DT is suppose to *not* be the preferred method, yet still
>> > DT
>> > is preferred if the firmware provides both tables to the kernel.
>
>> However several arm64 products in embedded applications are still not
>> SBSA/SBBR compliant (and I have worked on a couple of such
>> implementations earlier) and still use bootloaders like u-boot (and
>> also closed-source implementations) which have no support for ACPI
>> currently and still rely on a DT to pass the system hardware
>> information to the kernel.
>
>> So far only open source implementation of a ACPI compliant firmware is
>> EDK2/UEFI which supports ACPI as the preferred boot method
>
> You mean for non-x86?

Yes the patch in discussion is for arm64. So my comments above are in
context to arm64.

>>  and I am
>> not sure if all u-boot/in-house firmware implementations are planned
>> to be ported over to EDK2/UEFI for embedded applications.
>
> Why do you need that? ACPI (if you are talking about ACPI only, w/o EFI)
> is supported in U-Boot for few x86 SoCs/platforms. Moreover, one of them
> had never been shipped with ACPI/EFI complaint services in firmware and
> ACPI layer is purely done in U-Boot.

AFAIK upstream arm64 u-boot doesn't support ACPI boot method for
armv8/arm64 yet.

Regards,
Bhupesh

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

* [PATCH] arm64/acpi: make ACPI boot preference configurable
@ 2018-02-28 10:32           ` Bhupesh Sharma
  0 siblings, 0 replies; 24+ messages in thread
From: Bhupesh Sharma @ 2018-02-28 10:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 28, 2018 at 3:37 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Wed, 2018-02-28 at 00:29 +0530, Bhupesh Sharma wrote:
>> On Tue, Feb 27, 2018 at 8:14 PM, Jonathan Toppins <jtoppins@redhat.com
>> > wrote:
>> > On 02/27/2018 07:40 AM, Bhupesh Sharma wrote:
>> > >
>
>> > For arm64 DT is suppose to *not* be the preferred method, yet still
>> > DT
>> > is preferred if the firmware provides both tables to the kernel.
>
>> However several arm64 products in embedded applications are still not
>> SBSA/SBBR compliant (and I have worked on a couple of such
>> implementations earlier) and still use bootloaders like u-boot (and
>> also closed-source implementations) which have no support for ACPI
>> currently and still rely on a DT to pass the system hardware
>> information to the kernel.
>
>> So far only open source implementation of a ACPI compliant firmware is
>> EDK2/UEFI which supports ACPI as the preferred boot method
>
> You mean for non-x86?

Yes the patch in discussion is for arm64. So my comments above are in
context to arm64.

>>  and I am
>> not sure if all u-boot/in-house firmware implementations are planned
>> to be ported over to EDK2/UEFI for embedded applications.
>
> Why do you need that? ACPI (if you are talking about ACPI only, w/o EFI)
> is supported in U-Boot for few x86 SoCs/platforms. Moreover, one of them
> had never been shipped with ACPI/EFI complaint services in firmware and
> ACPI layer is purely done in U-Boot.

AFAIK upstream arm64 u-boot doesn't support ACPI boot method for
armv8/arm64 yet.

Regards,
Bhupesh

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

end of thread, other threads:[~2018-02-28 10:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27  6:05 [PATCH] arm64/acpi: make ACPI boot preference configurable Jonathan Toppins
2018-02-27  6:05 ` Jonathan Toppins
2018-02-27  7:22 ` Ard Biesheuvel
2018-02-27  7:22   ` Ard Biesheuvel
2018-02-27 14:28   ` Jonathan Toppins
2018-02-27 14:28     ` Jonathan Toppins
2018-02-27 14:54     ` Ard Biesheuvel
2018-02-27 14:54       ` Ard Biesheuvel
2018-02-27 14:55     ` Robin Murphy
2018-02-27 14:55       ` Robin Murphy
2018-02-27 12:40 ` Bhupesh Sharma
2018-02-27 12:40   ` Bhupesh Sharma
2018-02-27 14:44   ` Jonathan Toppins
2018-02-27 14:44     ` Jonathan Toppins
2018-02-27 17:05     ` Mark Rutland
2018-02-27 17:05       ` Mark Rutland
2018-02-27 18:59     ` Bhupesh Sharma
2018-02-27 18:59       ` Bhupesh Sharma
2018-02-28 10:07       ` Andy Shevchenko
2018-02-28 10:07         ` Andy Shevchenko
2018-02-28 10:10         ` Rafael J. Wysocki
2018-02-28 10:10           ` Rafael J. Wysocki
2018-02-28 10:32         ` Bhupesh Sharma
2018-02-28 10:32           ` Bhupesh Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.