Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp702611rdf; Tue, 21 Nov 2023 14:11:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAjG7kd/VPZgsujYd2lMS1t8B7arkuEiBzU173kXqz/hU+qsQdpifSIZCA0nQTDLm0f/ra X-Received: by 2002:a05:6a00:10d1:b0:6c3:6148:570f with SMTP id d17-20020a056a0010d100b006c36148570fmr553777pfu.33.1700604672245; Tue, 21 Nov 2023 14:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700604672; cv=none; d=google.com; s=arc-20160816; b=yjgryhCwPiPCSvYzw3ta50KTAmUt7Nr35KuvRce8I4y2ohYmLWKzfvzaMrPlwUORN8 doMYj+MHZe/h0xwhTSdA6L/OXMbZADJLlU8eE/ICcKPENZ0XcbDCX1mtqP02QqG/lh2C JJJM0A8jLSslc9+Ge6asoUCayiM72z+isHfgeHdJdRWqAUBsTppokNfVEZYdVqCQCbao KJe42EzXKDuXbY6dqr3r+QIg8ardWg7QBjHZTg1gFXhAJ2LocVLPwozvG2SOQaALTOaM CCI5A+U+MCE4IgJD0WrZ00iAmS5gBKp9S+qw097KUpfqhkjkYuTmU4vZwMS8ebu+Paz9 UI3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bUrfVcVa3Jy5893jk/rq26iu6NlKWecKE/WOuTvkwso=; fh=mDuPYo+yHcrIKW2OBAByLNgzhXp03Qs/fCXSN+hez34=; b=Ex7jTm2G0kVFwoNZv300MpoqlpKLAHKlcKg7LHC3/e2O8R500bSwaW1SdtreyEtpT7 /k7i9Z3r/TM+K6YEXUHpcs4uZ5RMuPn4pJthrooYx87um6V9nNoY3HvWZVNdGVpQDc6v 7qDrsTSyBGoDjZQFqeiMYJN5Nm7RQ9y7An+YihnhOkKKzLc0CTTWwBEj6AmnDidK07/k UWXIG6Zad85UbaSaXOq8yUhEHyonr6QhnKZyxsj/WCe9+stpP9e3YpMEK/fmr92rIXI6 f34BFJp8Ejm/QneAj7H5tOyAabB4c9Gch9iOvGIKbThW//035ooIA+fYoKwItTplvcCt +h+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c93VEcJb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id o1-20020a63fb01000000b0055b640a6b3csi11546798pgh.884.2023.11.21.14.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 14:11:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c93VEcJb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 161AE8023180; Tue, 21 Nov 2023 14:11:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbjKUWK6 (ORCPT + 99 others); Tue, 21 Nov 2023 17:10:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjKUWK4 (ORCPT ); Tue, 21 Nov 2023 17:10:56 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63445113 for ; Tue, 21 Nov 2023 14:10:52 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c503da4fd6so76963751fa.1 for ; Tue, 21 Nov 2023 14:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700604650; x=1701209450; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bUrfVcVa3Jy5893jk/rq26iu6NlKWecKE/WOuTvkwso=; b=c93VEcJbj8ALkjb2camdiWx87HKu8PXqnNxpT8VvLWvcLTzyOMsvRA6ttq/42gj/lc KvPzOFfS0mcSdR8yQjtZEYFb9TWrF3pbdhe6mcJ1kKeaUno+qWh/3jzaUXoRkwmK42eq vNejBlPPTx2wF873z0Rcj7cKz6eU2aKgXRTxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700604650; x=1701209450; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bUrfVcVa3Jy5893jk/rq26iu6NlKWecKE/WOuTvkwso=; b=As7+QVKdhb4nQ6zbXXWmKbVD0IUtcXVGJBGG/T5l14+muEqunYrH9tUnOSQsyIvkWJ jZ4jLAgyb0qqIWfLzZAm4C5oln2QJ/RcTG/60JQy03rgCgAS6rDw/GDsXUphKloyB7Pm YNRDCm6rm8t2uCzaGQDVQ4g5hnOfYG3cRp3yO+1as+Cq9NbUkUIY69taRUNtEQTbyF14 7I+3gJUbBXQH3GN/P3ZsQj9Yg24unI7PVCiDULDP7kgcS8sibIJhcEWSxXgZXfPWA44z 0baB66kDM9vxCQQbb10EXpfnXH3d1tGRdvLUJQsKlruNkIeqp0TBCv8+omquCWmYP7VE 4L5w== X-Gm-Message-State: AOJu0YxNfuEvyOyGI5s1wTRNIu4lauGDMiPAzSGikZbqVMO86cwu++zP QCBmT+EKHB/C0Zri8wCmJSILCNtViXjr/MTvgdKgag== X-Received: by 2002:ac2:5e81:0:b0:509:8f57:8e2 with SMTP id b1-20020ac25e81000000b005098f5708e2mr89904lfq.29.1700604650301; Tue, 21 Nov 2023 14:10:50 -0800 (PST) MIME-Version: 1.0 References: <20231119053234.2367621-1-masahiroy@kernel.org> In-Reply-To: <20231119053234.2367621-1-masahiroy@kernel.org> From: Simon Glass Date: Tue, 21 Nov 2023 15:10:38 -0700 Message-ID: Subject: Re: [PATCH] arm64: add dependency between vmlinuz.efi and Image To: Masahiro Yamada Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 14:11:06 -0800 (PST) On Sat, 18 Nov 2023 at 22:32, Masahiro Yamada wrote: > > A common issue in Makefile is a race in parallel building. > > You need to be careful to prevent multiple threads from writing to the > same file simultaneously. > > Commit 3939f3345050 ("ARM: 8418/1: add boot image dependencies to not > generate invalid images") addressed such a bad scenario. > > A similar symptom occurs with the following command: > > $ make -j$(nproc) ARCH=arm64 Image vmlinuz.efi > [ snip ] > SORTTAB vmlinux > OBJCOPY arch/arm64/boot/Image > OBJCOPY arch/arm64/boot/Image > AS arch/arm64/boot/zboot-header.o > PAD arch/arm64/boot/vmlinux.bin > GZIP arch/arm64/boot/vmlinuz > OBJCOPY arch/arm64/boot/vmlinuz.o > LD arch/arm64/boot/vmlinuz.efi.elf > OBJCOPY arch/arm64/boot/vmlinuz.efi > > The log "OBJCOPY arch/arm64/boot/Image" is displayed twice. > > It indicates that two threads simultaneously enter arch/arm64/boot/ > and write to arch/arm64/boot/Image. > > It occasionally leads to a build failure: > > $ make -j$(nproc) ARCH=arm64 Image vmlinuz.efi > [ snip ] > SORTTAB vmlinux > OBJCOPY arch/arm64/boot/Image > PAD arch/arm64/boot/vmlinux.bin > truncate: Invalid number: 'arch/arm64/boot/vmlinux.bin' > make[2]: *** [drivers/firmware/efi/libstub/Makefile.zboot:13: > arch/arm64/boot/vmlinux.bin] Error 1 > make[2]: *** Deleting file 'arch/arm64/boot/vmlinux.bin' > make[1]: *** [arch/arm64/Makefile:163: vmlinuz.efi] Error 2 > make[1]: *** Waiting for unfinished jobs.... > make: *** [Makefile:234: __sub-make] Error 2 > > vmlinuz.efi depends on Image, but such a dependency is not specified > in arch/arm64/Makefile. > > Signed-off-by: Masahiro Yamada > --- > > arch/arm64/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: SImon Glass