From patchwork Sat Oct 5 05:01:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 13823101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD0ACCF8861 for ; Sat, 5 Oct 2024 05:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z4vQ/wHK+j/kiLmDR1amyCdiI1kzw4/23edhXgv3i5M=; b=KmXHvNLu6snGc21PEgGh00czfD l3m+4nh4ilcy9hIH/Ooktj4WRaCbjEq13X14YJv64a6gQKwB20e3uA3oOITqsIQxC1ENsYFx8WpNI 0/pBZOC4Uh4vnOn3quZLE/KmvqukkK0hSW+6DKCaKXC4/Uf9HaRh5lcRObxlRgq0tR9/ahWtteN9T IULdmHcTzzHpgQZTUXMFFNRDwGTxgIKe/1XmU7KTGSe/jd5fxNuzCbvgRJffM6/lZ3IpyG2+JADkM OAKqlS3kkoMf5SR+tTkJGuBrolN5NmVtGcfEdqGblRk99nvCb2KzHnKncIci+ncU89htMqxQVYFCJ Mi/XrJGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swx0o-0000000EmUR-3jcP; Sat, 05 Oct 2024 05:07:26 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swwy8-0000000EmCN-07R7 for linux-arm-kernel@lists.infradead.org; Sat, 05 Oct 2024 05:04:41 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2e07d85e956so2356025a91.3 for ; Fri, 04 Oct 2024 22:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728104679; x=1728709479; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z4vQ/wHK+j/kiLmDR1amyCdiI1kzw4/23edhXgv3i5M=; b=BmavryYppGW1FmCCkjojZwcYgEXQ3S43PZvkqX/Q7VZQmNQHHTMV0qqRX/2GMxyt5q DJ7p/g9GHoq+hAuD77up6MV/L47tAbGQdAXLs22jrQmTjZKdZGNZoFChu5Rs6cCXXFCH wBtIak7qsJXWQyAKYK1IA54HVnnClRanZMRHE2cdXqhp0rsxx2DRRRQBwVix0VxYi1Mx XMQJcK0nlfu0UPePu1HGtsX3jiuPd7WMRS0MzN6RWGZoI6X8JTtp+DsS5rYwei70Focz SE5l9wTclZ1ZYmscY+cWycs6Kgwqy9Ysq7WIbDLNQTMRhFXqS8QZh7p9f57PKiartp3K Jsjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728104679; x=1728709479; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z4vQ/wHK+j/kiLmDR1amyCdiI1kzw4/23edhXgv3i5M=; b=UZRH1SP2UHZ5Gihno5rpox/pDjqUS7pBE81gwoZbFbV2eLPtMTMB0vcEz5WCn9AZYk Shk43rq4XIUqTWnrnVxyTV10SFOWmgn0pv4rKqAvfDIC4YXgx3Nr4+UBs7jXtiRXswaI wiocYcqnEPy74I71xNuily/aEfsTXpzodTO7hJxdaWvb19J1HFK4/OtglBr00Cqvwruc 0DNdXerf7ziSyuTJuS2lEhz0Rs/G/NJSyjFBZfgnviqSHHCS4tvzI1gXeg2/QNiOitmd 9Z8NPH1ri2oGW3Oe9qeBfOWZ6xXcryTdU8YVaxjPJseI0mry1i9cbph13v0UKpiRwUQB BNJQ== X-Forwarded-Encrypted: i=1; AJvYcCX6SwGlgfDqOGrjdV8VjizSCtIGL07xZi5Up4c+Dkb/7v3ztLSNARatHB6INWtEgxgtATVS2v676e1ArxKaq2Qi@lists.infradead.org X-Gm-Message-State: AOJu0YyK+qRnR4uFv3HerT48Omgv2jJEvAUdSl1fbt1emtyjKKh16UPJ /hy8eDE6/4OdxHoXErPcXnCNWISNhbkOca63nOsrUGeW1wfMBTBD X-Google-Smtp-Source: AGHT+IE7UAQiHWty60M82Q5LlDvs1wEvJRo5PR3IumIPHipsvTER2MS5gD2zN0KTu2dnsqvsUQEUpg== X-Received: by 2002:a17:90b:4f87:b0:2db:df68:52ae with SMTP id 98e67ed59e1d1-2e1e621d0a6mr5411826a91.14.1728104678705; Fri, 04 Oct 2024 22:04:38 -0700 (PDT) Received: from celestia.turtle.lan ([2601:1c2:c184:dc00:ed3:4cda:b368:ce98]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e1e85db34fsm2625744a91.33.2024.10.04.22.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 22:04:37 -0700 (PDT) From: Sam Edwards X-Google-Original-From: Sam Edwards To: Florian Fainelli , =?utf-8?b?UmFmYcWCIE1p?= =?utf-8?b?xYJlY2tp?= , William Zhang , Anand Gore , Kursad Oney Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Broadcom internal kernel review list , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sam Edwards Subject: [PATCH v2 1/2] arm64: dts: broadcom: bcmbca: bcm4908: Reserve CFE stub area Date: Fri, 4 Oct 2024 22:01:54 -0700 Message-ID: <20241005050155.61103-2-CFSworks@gmail.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20241005050155.61103-1-CFSworks@gmail.com> References: <20241005050155.61103-1-CFSworks@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241004_220440_110253_AA1C8073 X-CRM114-Status: GOOD ( 14.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The CFE bootloader places a stub program in the first page of physical memory to hold the secondary CPUs until the boot CPU writes the release address, but does not splice a /reserved-memory node into the FDT to protect it. If Linux overwrites this program before execution reaches smp_prepare_cpus(), the secondary CPUs may become inaccessible. This is only a problem with CFE, and then only until the secondary CPUs are brought online. Ideally, there would be some hypothetical mechanism we could use to indicate that this area of memory is sensitive only during boot. But as there is none, and since it is such a small amount of memory, it is easiest to reserve it unconditionally. Therefore, add a /reserved-memory node to bcm4908.dtsi to protect the first 4KiB of physical memory. Signed-off-by: Sam Edwards --- arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi index 8b924812322c..c51b92387fad 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi @@ -68,6 +68,16 @@ l2: l2-cache0 { }; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + cfe-stub@0 { + reg = <0x0 0x0 0x0 0x1000>; + }; + }; + axi@81000000 { compatible = "simple-bus"; #address-cells = <1>;