All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/setup: Explicitly include acpi.h
@ 2021-09-01  2:15 Nathan Chancellor
  2021-09-01  2:24 ` Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nathan Chancellor @ 2021-09-01  2:15 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: H. Peter Anvin, linux-kernel, Maurizio Lombardi, Mike Rapoport,
	Konrad Rzeszutek Wilk, Nathan Chancellor

After commit 342f43af70db ("iscsi_ibft: fix crash due to KASLR physical
memory remapping"), certain configurations show the following errors:

arch/x86/kernel/setup.c: In function ‘setup_arch’:
arch/x86/kernel/setup.c:916:13: error: implicit declaration of function ‘acpi_mps_check’ [-Werror=implicit-function-declaration]
  916 |         if (acpi_mps_check()) {
      |             ^~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1110:9: error: implicit declaration of function ‘acpi_table_upgrade’ [-Werror=implicit-function-declaration]
 1110 |         acpi_table_upgrade();
      |         ^~~~~~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1112:9: error: implicit declaration of function ‘acpi_boot_table_init’ [-Werror=implicit-function-declaration]
 1112 |         acpi_boot_table_init();
      |         ^~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1120:9: error: implicit declaration of function ‘early_acpi_boot_init’; did you mean ‘early_cpu_init’? [-Werror=implicit-function-declaration]
 1120 |         early_acpi_boot_init();
      |         ^~~~~~~~~~~~~~~~~~~~
      |         early_cpu_init
arch/x86/kernel/setup.c:1162:9: error: implicit declaration of function ‘acpi_boot_init’ [-Werror=implicit-function-declaration]
 1162 |         acpi_boot_init();
      |         ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors

acpi.h was being implicitly included from iscsi_ibft.h in these
configurations so the removal of that means these functions have no
definition or declaration. Add acpi.h explicitly so there is no more
error.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

* No fixes tag as I doubt the mentioned commit is the root cause.

* The configuration was WSL2's, I did not drill down exactly which set
  of configs triggers this but it is pretty obvious what is going on
  here.

 arch/x86/kernel/setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 63b20536c8d2..79f164141116 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -5,6 +5,7 @@
  * This file contains the setup_arch() code, which handles the architecture-dependent
  * parts of early kernel initialization.
  */
+#include <linux/acpi.h>
 #include <linux/console.h>
 #include <linux/crash_dump.h>
 #include <linux/dma-map-ops.h>

base-commit: 9e9fb7655ed585da8f468e29221f0ba194a5f613
-- 
2.33.0


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

* Re: [PATCH] x86/setup: Explicitly include acpi.h
  2021-09-01  2:15 [PATCH] x86/setup: Explicitly include acpi.h Nathan Chancellor
@ 2021-09-01  2:24 ` Nathan Chancellor
  2021-09-01  7:07 ` Matthieu Baerts
  2021-09-01 16:07 ` [PATCH v2] " Nathan Chancellor
  2 siblings, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2021-09-01  2:24 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: H. Peter Anvin, linux-kernel, Maurizio Lombardi, Mike Rapoport,
	Konrad Rzeszutek Wilk

On Tue, Aug 31, 2021 at 07:15:11PM -0700, Nathan Chancellor wrote:
> After commit 342f43af70db ("iscsi_ibft: fix crash due to KASLR physical
> memory remapping"), certain configurations show the following errors:
> 
> arch/x86/kernel/setup.c: In function ‘setup_arch’:
> arch/x86/kernel/setup.c:916:13: error: implicit declaration of function ‘acpi_mps_check’ [-Werror=implicit-function-declaration]
>   916 |         if (acpi_mps_check()) {
>       |             ^~~~~~~~~~~~~~
> arch/x86/kernel/setup.c:1110:9: error: implicit declaration of function ‘acpi_table_upgrade’ [-Werror=implicit-function-declaration]
>  1110 |         acpi_table_upgrade();
>       |         ^~~~~~~~~~~~~~~~~~
> arch/x86/kernel/setup.c:1112:9: error: implicit declaration of function ‘acpi_boot_table_init’ [-Werror=implicit-function-declaration]
>  1112 |         acpi_boot_table_init();
>       |         ^~~~~~~~~~~~~~~~~~~~
> arch/x86/kernel/setup.c:1120:9: error: implicit declaration of function ‘early_acpi_boot_init’; did you mean ‘early_cpu_init’? [-Werror=implicit-function-declaration]
>  1120 |         early_acpi_boot_init();
>       |         ^~~~~~~~~~~~~~~~~~~~
>       |         early_cpu_init
> arch/x86/kernel/setup.c:1162:9: error: implicit declaration of function ‘acpi_boot_init’ [-Werror=implicit-function-declaration]
>  1162 |         acpi_boot_init();
>       |         ^~~~~~~~~~~~~~
> cc1: some warnings being treated as errors
> 
> acpi.h was being implicitly included from iscsi_ibft.h in these
> configurations so the removal of that means these functions have no
> definition or declaration. Add acpi.h explicitly so there is no more
> error.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> * No fixes tag as I doubt the mentioned commit is the root cause.
> 
> * The configuration was WSL2's, I did not drill down exactly which set
>   of configs triggers this but it is pretty obvious what is going on
>   here.

Actually, it reproduces with x86_64_defconfig so the configuration is
irrelevant. It looks like commit 12609013c43a ("x86/setup: Clean up the
header portion of setup.c") removed acpi.h, presumably because
iscsi_ibft.h included it but AFAIK, the kernel's policy has always been
to expliciltly include headers that are needed, rather than relying on
them being implicitly included.

If people care, I can resent with a fixes tag and calling out
x86_64_defconfig instead of the vague "certain configurations" but I do
not have a strong opinion personally.

>  arch/x86/kernel/setup.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 63b20536c8d2..79f164141116 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -5,6 +5,7 @@
>   * This file contains the setup_arch() code, which handles the architecture-dependent
>   * parts of early kernel initialization.
>   */
> +#include <linux/acpi.h>
>  #include <linux/console.h>
>  #include <linux/crash_dump.h>
>  #include <linux/dma-map-ops.h>
> 
> base-commit: 9e9fb7655ed585da8f468e29221f0ba194a5f613
> -- 
> 2.33.0
> 

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

* Re: [PATCH] x86/setup: Explicitly include acpi.h
  2021-09-01  2:15 [PATCH] x86/setup: Explicitly include acpi.h Nathan Chancellor
  2021-09-01  2:24 ` Nathan Chancellor
@ 2021-09-01  7:07 ` Matthieu Baerts
  2021-09-01 16:07 ` [PATCH v2] " Nathan Chancellor
  2 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2021-09-01  7:07 UTC (permalink / raw)
  To: Nathan Chancellor, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: H. Peter Anvin, linux-kernel, Maurizio Lombardi, Mike Rapoport,
	Konrad Rzeszutek Wilk

Hi Nathan,

On 01/09/2021 04:15, Nathan Chancellor wrote:
> After commit 342f43af70db ("iscsi_ibft: fix crash due to KASLR physical
> memory remapping"), certain configurations show the following errors:

Thank you for the patch!

It fixes the same issue on my side using a configuration based on
x86_64_defconfig with a few extras on the Networking side only. My CI
also noticed it was failing with a config based on tinyconfig.

Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

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

* [PATCH v2] x86/setup: Explicitly include acpi.h
  2021-09-01  2:15 [PATCH] x86/setup: Explicitly include acpi.h Nathan Chancellor
  2021-09-01  2:24 ` Nathan Chancellor
  2021-09-01  7:07 ` Matthieu Baerts
@ 2021-09-01 16:07 ` Nathan Chancellor
  2021-09-01 17:12   ` Linus Torvalds
  2 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2021-09-01 16:07 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, linux-kernel, Maurizio Lombardi, Mike Rapoport,
	Konrad Rzeszutek Wilk, Christoph Hellwig, Nathan Chancellor,
	Matthieu Baerts

After commit 342f43af70db ("iscsi_ibft: fix crash due to KASLR physical
memory remapping") x86_64_defconfig shows the following errors:

arch/x86/kernel/setup.c: In function ‘setup_arch’:
arch/x86/kernel/setup.c:916:13: error: implicit declaration of function ‘acpi_mps_check’ [-Werror=implicit-function-declaration]
  916 |         if (acpi_mps_check()) {
      |             ^~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1110:9: error: implicit declaration of function ‘acpi_table_upgrade’ [-Werror=implicit-function-declaration]
 1110 |         acpi_table_upgrade();
      |         ^~~~~~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1112:9: error: implicit declaration of function ‘acpi_boot_table_init’ [-Werror=implicit-function-declaration]
 1112 |         acpi_boot_table_init();
      |         ^~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/setup.c:1120:9: error: implicit declaration of function ‘early_acpi_boot_init’; did you mean ‘early_cpu_init’? [-Werror=implicit-function-declaration]
 1120 |         early_acpi_boot_init();
      |         ^~~~~~~~~~~~~~~~~~~~
      |         early_cpu_init
arch/x86/kernel/setup.c:1162:9: error: implicit declaration of function ‘acpi_boot_init’ [-Werror=implicit-function-declaration]
 1162 |         acpi_boot_init();
      |         ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors

acpi.h was being implicitly included from iscsi_ibft.h in this
configuration so the removal of that header means these functions have
no definition or declaration. Add acpi.h explicitly so there is no more
error.

Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

Linus, would you mind taking this directly? Boris indicated here he was
okay with that:

https://lore.kernel.org/r/YS8stOCBCdfZ+J0Y@zn.tnic/

v1 -> v2:

* "certain configurations" -> "x86_64_defconfig", be definitive.

* Add Matthieu's tested-by.

 arch/x86/kernel/setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 63b20536c8d2..79f164141116 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -5,6 +5,7 @@
  * This file contains the setup_arch() code, which handles the architecture-dependent
  * parts of early kernel initialization.
  */
+#include <linux/acpi.h>
 #include <linux/console.h>
 #include <linux/crash_dump.h>
 #include <linux/dma-map-ops.h>

base-commit: 9e9fb7655ed585da8f468e29221f0ba194a5f613
-- 
2.33.0


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

* Re: [PATCH v2] x86/setup: Explicitly include acpi.h
  2021-09-01 16:07 ` [PATCH v2] " Nathan Chancellor
@ 2021-09-01 17:12   ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2021-09-01 17:12 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	the arch/x86 maintainers, H. Peter Anvin,
	Linux Kernel Mailing List, Maurizio Lombardi, Mike Rapoport,
	Konrad Rzeszutek Wilk, Christoph Hellwig, Matthieu Baerts

On Wed, Sep 1, 2021 at 9:09 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> After commit 342f43af70db ("iscsi_ibft: fix crash due to KASLR physical
> memory remapping") x86_64_defconfig shows the following errors:

Strange. I wonder why I didn't see that - not even in my smaller config builds.

> acpi.h was being implicitly included from iscsi_ibft.h in this
> configuration so the removal of that header means these functions have
> no definition or declaration. Add acpi.h explicitly so there is no more
> error.

The patch is clearly ok, I wonder what way _my_ config included acpi.h
ended up coming in..

[ Goes off and looks. Oh, because I got it from <linux/tboot.h> and
had CONFIG_INTEL_TXT enabled. ]

> Linus, would you mind taking this directly?

Will do.

           Linus

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

end of thread, other threads:[~2021-09-01 17:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  2:15 [PATCH] x86/setup: Explicitly include acpi.h Nathan Chancellor
2021-09-01  2:24 ` Nathan Chancellor
2021-09-01  7:07 ` Matthieu Baerts
2021-09-01 16:07 ` [PATCH v2] " Nathan Chancellor
2021-09-01 17:12   ` Linus Torvalds

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.