Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp558291lqh; Tue, 7 May 2024 07:25:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXf2NhwRQ+3zowJcs/09bmBkra5ydfo9EhSQXVr2x6l6CSd27kpLoD2zb6PMFxhEZZlqXWdITe+k8LDZ0Qb0aaTSkIcp3IHFR1bZ/bq9A== X-Google-Smtp-Source: AGHT+IEV/HwYuH9cTK/Ocg3L7S9MNqm39U7nJF0riRawer8Ubsuzvl9733jKtj+Y2sdbj9mizQQh X-Received: by 2002:ac2:5932:0:b0:51f:2a80:a982 with SMTP id v18-20020ac25932000000b0051f2a80a982mr11768741lfi.47.1715091953822; Tue, 07 May 2024 07:25:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715091953; cv=pass; d=google.com; s=arc-20160816; b=Q2LzrGUMAt9U/VpLD3O3gtZYwZqEYTB6sujPzvbJO09Zy6egjWMb0gFtLYxIuALUMv pNcixan9G35oXqrIkFcMr/plBMuhwOAZHGDdYfOcAq5D4EeGj4gRtPLKT5/CzFwFaLME /Si4UPFAihXKFmWJ3NmGS51i3LIvFHfSueAn+Pe1H22K/DektvzKm0UebohvzlVMDdeC 3x+6kshB7bAT75bCsQoLPUZ7si5UO2FTuzl0X2NiX7lEmW21vJWAjDNMQAF3Ri/YkiRS G/2nsQ/s9Cg+8ibUfj6f2qwARSLLIRamdGi599ZbZE9GVu7v0Z67+x7A8sIXleUO2GU3 dv6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4/aU0aW4P/xogEYslFiA+5VYdh4zhSlVyJwOrbyhkv4=; fh=JbHLKe1TVVENYTZe7sXS6JBiyA7QQCXmoa2LEbzKhZI=; b=YhSQD/8aunsR9tlZ/gwP1xe8EBf37HNc6GqVOp8qnZOdOzVGcvGiHn7ACtG0b35xBq IioWvsrPUJkTuewIbSBW5QXFcA7c7RfCB1dn0iT3M33qBuWMKBqkba8heaumIq1BRmgR O6NqrRQN9j+VOOq/pPa6w/zS5aRK3yQFwkX38upniPbxn3iprrbfBZg7kps/6fOFCHl8 XmQYFo2ewAaZq/6H1C2iUDPM4ZfwF5yRwC2+ZvBhKuFsPmk/miXFJL8S47hduh3gxIhK kB6Gl8Q8I2jNWR6SH/fmkLTx4ZwkYcEoF0Kc2VTryjZvK+qjR8aW/3Suze4TRbCvg8/l zh/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AcItmTiQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171569-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ne33-20020a1709077ba100b00a59ee243b66si823969ejc.995.2024.05.07.07.25.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AcItmTiQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171569-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 604791F224C8 for ; Tue, 7 May 2024 14:25:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A259215EFB8; Tue, 7 May 2024 14:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AcItmTiQ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC6614EC64; Tue, 7 May 2024 14:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091943; cv=none; b=LIg7mwgItOvDYJL9wa85n0RzCehoXVx0QDDDBI/lKNKgxK2SrPB6PnTxgW3Zt6xyhUji7Chq3nF4qVnlrhhRXTIdAyawgBbGkOlOSGHXXIyqcVVkOlbPqnyy7B9fY5TmYC2RuWoAGnMPfnLMuEnb/UCNaFVvCuLbF+3KNNf06VU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091943; c=relaxed/simple; bh=9GyGNvIyzoWY1JFtW2MU5vln/b4bqKmVSdH38ZdCQHM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Ppirl2TICKR05Y3hyUstb91IpaVHdOY8XzjyaYGd0M+V9yzuMOD2qoJ2nEG79xAlSiJVaCPdDgchiRmTFAUvNXLahyTWZcLOcxbmjAjTbmwfxZ+Q7pZwVG1owaQRcn7VgPCg5MF/+dpjPyNcTNmcrxmH6X8TkT5zTTIQMD8WHRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AcItmTiQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E014C2BBFC; Tue, 7 May 2024 14:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715091943; bh=9GyGNvIyzoWY1JFtW2MU5vln/b4bqKmVSdH38ZdCQHM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AcItmTiQrgj+MChF27D/ngGnkr7R7X76s7Q6cFei4cRm9jH+TOAzC0uwUzBDWCfdO 0jPdE6pLVPlvcuGqP4IUs1u5pe/L8/CXU0SUOR1mYZUx+UaLdHxcNd1u/LklXA3QKM T0VdAdjlCZJCc/eEAvblsI+FZLdsMzgWYeD+EHyNCnnBg9YykwFYQ32GoSWL7IUVdk nyhoMdW2sns+MuBkDa9hNve47bL/l/uAD8WHTngEVdf2t7fwTW47tGclAynq+EMnsm MqUOBFsAnvWEh0O9xxpOxEu0rH3ApxWsQu+Tg0f7KAvrNseLx8hgi+vPheBYCcdmfy v+PuHHnvnje3Q== Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-51f1b378ca5so5460726e87.1; Tue, 07 May 2024 07:25:43 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXZ6ch5x3q+vzMDkCnTuQqAhbWLu/sottuWXXvHEC6JQyG5oi2kWkxmW7u4qWMLHu3mmPMDlCso7vAaf44Ev9IA45toEueYNZOIH4mZ X-Gm-Message-State: AOJu0YxX1y3sbdOH/9P8pRxrWP0Qucfv7CaCZfiiaDmDHQdgn1YDhnqX Ai9sdcTtNEumdxXECl0KX/UUsSO1HLmjn+5NcprgCekGLVWtZlvH4Kjsnk2judScNLpO4RcsuEs pqsv5vLsHjbwCeHkmHqnSmm227/k= X-Received: by 2002:ac2:4888:0:b0:51c:fd0a:7e37 with SMTP id x8-20020ac24888000000b0051cfd0a7e37mr10617488lfc.20.1715091942029; Tue, 07 May 2024 07:25:42 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240427153253.2809911-1-masahiroy@kernel.org> <20240427153253.2809911-2-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Tue, 7 May 2024 23:25:05 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] kbuild: add 'private' to target-specific variables To: Nicolas Schier Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 7, 2024 at 8:16=E2=80=AFPM Nicolas Schier w= rote: > > On Sun, Apr 28, 2024 at 12:32:53AM +0900, Masahiro Yamada wrote: > > Currently, Kbuild produces inconsistent results in some cases. > > > > You can do an interesting experiment using the --shuffle option, which > > is supported by GNU Make 4.4 or later. > > > > Set CONFIG_KVM_INTEL=3Dy and CONFIG_KVM_AMD=3Dm (or vice versa), and re= peat > > incremental builds w/wo --shuffle=3Dreverse. > > > > $ make > > [ snip ] > > CC arch/x86/kvm/kvm-asm-offsets.s > > > > $ make --shuffle=3Dreverse > > [ snip ] > > CC [M] arch/x86/kvm/kvm-asm-offsets.s > > > > $ make > > [ snip ] > > CC arch/x86/kvm/kvm-asm-offsets.s > > > > arch/x86/kvm/kvm-asm-offsets.s is rebuilt every time w/wo the [M] marke= r. > > > > arch/x86/kvm/kvm-asm-offsets.s is built as built-in when it is built as > > a prerequisite of arch/x86/kvm/kvm-intel.o, which is built-in. > > > > arch/x86/kvm/kvm-asm-offsets.s is built as modular when it is built as > > a prerequisite of arch/x86/kvm/kvm-amd.o, which is a module. > > > > Another odd example is single target builds. > > > > When CONFIG_LKDTM=3Dm, drivers/misc/lkdtm/rodata.o can be built as > > built-in or modular, depending on how it is built. > > > > $ make drivers/misc/lkdtm/lkdtm.o > > [ snip ] > > CC [M] drivers/misc/lkdtm/rodata.o > > > > $ make drivers/misc/lkdtm/rodata.o > > [ snip ] > > CC drivers/misc/lkdtm/rodata.o > > > > drivers/misc/lkdtm/rodata.o is built as modular when it is built as a > > prerequisite of another, but built as built-in when it is a final > > target. > > > > The same thing happens to drivers/memory/emif-asm-offsets.s when > > CONFIG_TI_EMIF_SRAM=3Dm. > > > > $ make drivers/memory/ti-emif-sram.o > > [ snip ] > > CC [M] drivers/memory/emif-asm-offsets.s > > > > $ make drivers/memory/emif-asm-offsets.s > > [ snip ] > > CC drivers/memory/emif-asm-offsets.s > > > > This is because the part-of-module=3Dy flag defined for the modules is > > inherited by its prerequisites. > > > > Target-specific variables are likely intended only for local use. > > This commit adds 'private' to them. > > > > Signed-off-by: Masahiro Yamada > > --- > > uh, thanks for fixing this! (And for the bug documentation, as always!) > > I have just one question below. > > > > > Makefile | 8 ++++---- > > scripts/Makefile.build | 6 +++--- > > 2 files changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index 62557fabfee5..25dcc7ead330 100644 > > --- a/Makefile > > +++ b/Makefile > [...] > > @@ -1500,7 +1500,7 @@ MRPROPER_FILES +=3D include/config include/genera= ted \ > > > > # clean - Delete most, but leave enough to build external modules > > # > > -clean: rm-files :=3D $(CLEAN_FILES) > > +clean: private rm-files :=3D $(CLEAN_FILES) > > Did you leave 'clean: rm-files :=3D $(KBUILD_EXTMOD)/...' for oot kmods > the way it is (w/o 'private') by intention? No. I missed to update this line. I will fix it up for consistency. Thanks. > > Even though I cannot think of a possible problem without the 'private', > I think it makes sense to change the line as well. > > W/ or w/o the 'clean'-update for oot kmods: > > Reviewed-by: Nicolas Schier > > Kind regards, > Nicolas --=20 Best Regards Masahiro Yamada