public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/virt: use obj-y to descend into arch/x86/virt/
@ 2024-03-30  6:05 Masahiro Yamada
  2024-03-30  9:57 ` [tip: x86/urgent] x86/build: Use " tip-bot2 for Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2024-03-30  6:05 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Masahiro Yamada, H. Peter Anvin, linux-kernel

Commit c33621b4c5ad ("x86/virt/tdx: Wire up basic SEAMCALL functions")
introduced a new instance of core-y instead of the standardized obj-y
syntax.

X86 Makefiles descend into subdirectories of arch/x86/virt inconsistently;
into arch/x86/virt/ via core-y defined in arch/x86/Makefile, but into
arch/x86/virt/svm/ via obj-y defined in arch/x86/Kbuild.

This is problematic when you build a single object in parallel because
multiple threads attempt to build the same file.

  $ make -j$(nproc) arch/x86/virt/vmx/tdx/seamcall.o
    [ snip ]
    AS      arch/x86/virt/vmx/tdx/seamcall.o
    AS      arch/x86/virt/vmx/tdx/seamcall.o
  fixdep: error opening file: arch/x86/virt/vmx/tdx/.seamcall.o.d: No such file or directory
  make[4]: *** [scripts/Makefile.build:362: arch/x86/virt/vmx/tdx/seamcall.o] Error 2

Use the obj-y syntax, as it works correctly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/x86/Kbuild        | 2 +-
 arch/x86/Makefile      | 2 --
 arch/x86/virt/Makefile | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild
index 6a1f36df6a18..cf0ad89f5639 100644
--- a/arch/x86/Kbuild
+++ b/arch/x86/Kbuild
@@ -28,7 +28,7 @@ obj-y += net/
 
 obj-$(CONFIG_KEXEC_FILE) += purgatory/
 
-obj-y += virt/svm/
+obj-y += virt/
 
 # for cleaning
 subdir- += boot tools
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 662d9d4033e6..5ab93fcdd691 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -251,8 +251,6 @@ archheaders:
 
 libs-y  += arch/x86/lib/
 
-core-y += arch/x86/virt/
-
 # drivers-y are linked after core-y
 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
 drivers-$(CONFIG_PCI)            += arch/x86/pci/
diff --git a/arch/x86/virt/Makefile b/arch/x86/virt/Makefile
index 1e36502cd738..ea343fc392dc 100644
--- a/arch/x86/virt/Makefile
+++ b/arch/x86/virt/Makefile
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-y	+= vmx/
+obj-y	+= svm/ vmx/
-- 
2.40.1


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

* [tip: x86/urgent] x86/build: Use obj-y to descend into arch/x86/virt/
  2024-03-30  6:05 [PATCH] x86/virt: use obj-y to descend into arch/x86/virt/ Masahiro Yamada
@ 2024-03-30  9:57 ` tip-bot2 for Masahiro Yamada
  2024-04-02 12:02   ` Huang, Kai
  0 siblings, 1 reply; 3+ messages in thread
From: tip-bot2 for Masahiro Yamada @ 2024-03-30  9:57 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Masahiro Yamada, Ingo Molnar, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     3f1a9bc5d878004ed4bc3904e5cb9b7fb317fbe2
Gitweb:        https://git.kernel.org/tip/3f1a9bc5d878004ed4bc3904e5cb9b7fb317fbe2
Author:        Masahiro Yamada <masahiroy@kernel.org>
AuthorDate:    Sat, 30 Mar 2024 15:05:54 +09:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Sat, 30 Mar 2024 10:41:49 +01:00

x86/build: Use obj-y to descend into arch/x86/virt/

Commit c33621b4c5ad ("x86/virt/tdx: Wire up basic SEAMCALL functions")
introduced a new instance of core-y instead of the standardized obj-y
syntax.

X86 Makefiles descend into subdirectories of arch/x86/virt inconsistently;
into arch/x86/virt/ via core-y defined in arch/x86/Makefile, but into
arch/x86/virt/svm/ via obj-y defined in arch/x86/Kbuild.

This is problematic when you build a single object in parallel because
multiple threads attempt to build the same file.

  $ make -j$(nproc) arch/x86/virt/vmx/tdx/seamcall.o
    [ snip ]
    AS      arch/x86/virt/vmx/tdx/seamcall.o
    AS      arch/x86/virt/vmx/tdx/seamcall.o
  fixdep: error opening file: arch/x86/virt/vmx/tdx/.seamcall.o.d: No such file or directory
  make[4]: *** [scripts/Makefile.build:362: arch/x86/virt/vmx/tdx/seamcall.o] Error 2

Use the obj-y syntax, as it works correctly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240330060554.18524-1-masahiroy@kernel.org
---
 arch/x86/Kbuild        | 2 +-
 arch/x86/Makefile      | 2 --
 arch/x86/virt/Makefile | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild
index 6a1f36d..cf0ad89 100644
--- a/arch/x86/Kbuild
+++ b/arch/x86/Kbuild
@@ -28,7 +28,7 @@ obj-y += net/
 
 obj-$(CONFIG_KEXEC_FILE) += purgatory/
 
-obj-y += virt/svm/
+obj-y += virt/
 
 # for cleaning
 subdir- += boot tools
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 662d9d4..5ab93fc 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -251,8 +251,6 @@ archheaders:
 
 libs-y  += arch/x86/lib/
 
-core-y += arch/x86/virt/
-
 # drivers-y are linked after core-y
 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
 drivers-$(CONFIG_PCI)            += arch/x86/pci/
diff --git a/arch/x86/virt/Makefile b/arch/x86/virt/Makefile
index 1e36502..ea343fc 100644
--- a/arch/x86/virt/Makefile
+++ b/arch/x86/virt/Makefile
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-y	+= vmx/
+obj-y	+= svm/ vmx/

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

* Re: [tip: x86/urgent] x86/build: Use obj-y to descend into arch/x86/virt/
  2024-03-30  9:57 ` [tip: x86/urgent] x86/build: Use " tip-bot2 for Masahiro Yamada
@ 2024-04-02 12:02   ` Huang, Kai
  0 siblings, 0 replies; 3+ messages in thread
From: Huang, Kai @ 2024-04-02 12:02 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org
  Cc: masahiroy@kernel.org, mingo@kernel.org, x86@kernel.org

On Sat, 2024-03-30 at 09:57 +0000, tip-bot2 for Masahiro Yamada wrote:
> The following commit has been merged into the x86/urgent branch of tip:
> 
> Commit-ID:     3f1a9bc5d878004ed4bc3904e5cb9b7fb317fbe2
> Gitweb:        https://git.kernel.org/tip/3f1a9bc5d878004ed4bc3904e5cb9b7fb317fbe2
> Author:        Masahiro Yamada <masahiroy@kernel.org>
> AuthorDate:    Sat, 30 Mar 2024 15:05:54 +09:00
> Committer:     Ingo Molnar <mingo@kernel.org>
> CommitterDate: Sat, 30 Mar 2024 10:41:49 +01:00
> 
> x86/build: Use obj-y to descend into arch/x86/virt/
> 
> Commit c33621b4c5ad ("x86/virt/tdx: Wire up basic SEAMCALL functions")
> introduced a new instance of core-y instead of the standardized obj-y
> syntax.
> 
> X86 Makefiles descend into subdirectories of arch/x86/virt inconsistently;
> into arch/x86/virt/ via core-y defined in arch/x86/Makefile, but into
> arch/x86/virt/svm/ via obj-y defined in arch/x86/Kbuild.
> 
> This is problematic when you build a single object in parallel because
> multiple threads attempt to build the same file.
> 
>   $ make -j$(nproc) arch/x86/virt/vmx/tdx/seamcall.o
>     [ snip ]
>     AS      arch/x86/virt/vmx/tdx/seamcall.o
>     AS      arch/x86/virt/vmx/tdx/seamcall.o
>   fixdep: error opening file: arch/x86/virt/vmx/tdx/.seamcall.o.d: No such file or directory
>   make[4]: *** [scripts/Makefile.build:362: arch/x86/virt/vmx/tdx/seamcall.o] Error 2
> 
> Use the obj-y syntax, as it works correctly.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Link: https://lore.kernel.org/r/20240330060554.18524-1-masahiroy@kernel.org

Thanks.  Should this be included into stable kernel?

As stated in the changelog, the problem starts to exist since commit

  c33621b4c5ad ("x86/virt/tdx: Wire up basic SEAMCALL functions")

> ---
>  arch/x86/Kbuild        | 2 +-
>  arch/x86/Makefile      | 2 --
>  arch/x86/virt/Makefile | 2 +-
>  3 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild
> index 6a1f36d..cf0ad89 100644
> --- a/arch/x86/Kbuild
> +++ b/arch/x86/Kbuild
> @@ -28,7 +28,7 @@ obj-y += net/
>  
>  obj-$(CONFIG_KEXEC_FILE) += purgatory/
>  
> -obj-y += virt/svm/
> +obj-y += virt/
>  
>  # for cleaning
>  subdir- += boot tools
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 662d9d4..5ab93fc 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -251,8 +251,6 @@ archheaders:
>  
>  libs-y  += arch/x86/lib/
>  
> -core-y += arch/x86/virt/
> -
>  # drivers-y are linked after core-y
>  drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
>  drivers-$(CONFIG_PCI)            += arch/x86/pci/
> diff --git a/arch/x86/virt/Makefile b/arch/x86/virt/Makefile
> index 1e36502..ea343fc 100644
> --- a/arch/x86/virt/Makefile
> +++ b/arch/x86/virt/Makefile
> @@ -1,2 +1,2 @@
>  # SPDX-License-Identifier: GPL-2.0-only
> -obj-y	+= vmx/
> +obj-y	+= svm/ vmx/
> 



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

end of thread, other threads:[~2024-04-02 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-30  6:05 [PATCH] x86/virt: use obj-y to descend into arch/x86/virt/ Masahiro Yamada
2024-03-30  9:57 ` [tip: x86/urgent] x86/build: Use " tip-bot2 for Masahiro Yamada
2024-04-02 12:02   ` Huang, Kai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox