From patchwork Mon Sep 28 10:06:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Lindholm X-Patchwork-Id: 2312848 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=dPlDZWmN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=150.107.74.76; helo=mail.ozlabs.org; envelope-from=srs0=c21y=hu=vger.kernel.org=sparclinux+bounces-8118-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4htsp32L1wz1xxW for ; Tue, 29 Sep 2026 06:08:58 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4htsnV0N1Mz4wSh for ; Tue, 29 Sep 2026 06:08:30 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4htsnV0Fpwz4wSq; Tue, 29 Sep 2026 06:08:30 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=172.232.135.74 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790626110; cv=pass; b=vrSIl3KRYqw0qZcwxJjKXZvwnNnmlLku6unQrTRKvxcqkRR38ligHZ1Jv/juUs2I3n0jfQQyy0o3EQ2emetIiB9FBYf4DcYu+MI8eDlICQFId6KFNwk49ZtbN1/vD9SVgaZE9ocYTfQjJcfIIdySaLLHvVURu5FnkpNSDLyGBukrvdTpcgLJDBvEdKv6MlBBtw9GiF/A2NHWL5QczUb8Rabiig0sFmu5Kc3nmWymzbXe+96y/Elc07yka1+CVLg2f/xBFCCvG7fErZnC8APmd2e9zDHbrAmxt6vETuUhNm2f5ldlZ7V8qBAXo8Ur9XW9W3esG7LlN6XjS5uICxNBLA== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790626110; c=relaxed/relaxed; bh=CtakEnWLArPo5Q59HM8M0ssZyLg6kVbX40sG8XoXT0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VgtKwhOBArxaXF+vClERYSck6uP/cACeN/1kfeOFabtsMlo+ecakQquek33qbJqKCqA84wjxG1ECinVg/z3J+X2vq7KmczcUI352xMgjZJqt1vE5tiLE1v4Bw+GL7YxjV2VUQrIW5F49j6vW0P+XSsCRdZS74z7qPhXO2RrkWr30CyLnrIwd7+0mn/GRduTqhuOP7vg147WmzReTxg45rZg6+I4LrTAZZtsv+tJ5PBzVU/tvIGodYMPS8bRIlfk/WBQUPW6ItB9ORmHG09UyN4Fqh0+45BtSwVnf2nz/w6qsewNK1muhTP6JDrDBMJ+YqU57YSmshWr8qmb0F3LXVw== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=dPlDZWmN; dkim-atps=neutral; spf=pass (client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=sparclinux+bounces-8118-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=dPlDZWmN; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=sparclinux+bounces-8118-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4htsnQ3bxmz4wSh for ; Tue, 29 Sep 2026 06:08:26 +1000 (AEST) Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 0699E605AA8 for ; Mon, 28 Sep 2026 20:08:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E77E84F7994; Mon, 28 Sep 2026 20:08:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dPlDZWmN" X-Original-To: sparclinux@vger.kernel.org Received: from mail-ej2-f41.google.com (mail-ej2-f41.google.com [74.125.228.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8E5C4F5DF4 for ; Mon, 28 Sep 2026 20:08:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790626128; cv=none; b=agEE81HCACLcGVM118m4+Lcj1u9Ict27DP5MKYTwxr16KH0BZVtcTpZhSfDg2jmHGmrXwNXy+lGS49ZpSTpCgsAL6kX72MEhOq9fjaP/oYWAkC5iYyd5ewJ/CK6wjx/O34wBtWN++GbyFNWsLXw5QuuJKHk15N9QjSOjNaynBxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790626128; c=relaxed/simple; bh=KbFTqf0Stipa6Z0Bf79nWzA2T/N8nR0vSGeB4CqZjYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uc4b8PSvsn0yksN0nhKEj0CTK1+GbUu7K067iRumCYyUN/I/2IiHHVJccTcZfTuHaenyOExT3fSIJAiFTSf8QEE3WcQmnxsxW4r6U+dXeFo0JeXyprDyATJ9q0hkHMa5a119psjDwLIkDex28V5BvpsVeFinItwNzy1tYQxaTvw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dPlDZWmN; arc=none smtp.client-ip=74.125.228.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej2-f41.google.com with SMTP id a640c23a62f3a-c2df698f77cso3902766b.1 for ; Mon, 28 Sep 2026 13:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790626125; x=1791230925; darn=vger.kernel.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:content-type; bh=CtakEnWLArPo5Q59HM8M0ssZyLg6kVbX40sG8XoXT0s=; b=dPlDZWmN54mISqwprU6ivV+m6IM8HfS0HaAHfJQ1JIWc9NeZ11rsjQ6/3rd9PuJMRN l8jXha1T7I2OhDifAF/w/BA5kXDCsLX8merYYtgroLpB7TzRTrDPAtyLqR8KGLVnxZZ0 H3VBDxzUmLYghMxQxQ9thd10pTWiV2upPL7qNqG18qt7nUSkG4WcSG8BuoPWK6JUcFnh Kbgrq8HMtB1o7klkC1uHCojzQoRCBprJhThCyMOuPCKbaDCHz8IYv1x/sWWlxQ9eVf+E E0QDAAU6oo6gKyYWrNsixGWxJeYyj5m+RRz5rHudzaYl47EMckcdgcQKRtLq+3RoRNT1 UDqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790626125; x=1791230925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CtakEnWLArPo5Q59HM8M0ssZyLg6kVbX40sG8XoXT0s=; b=ok4O0ph+8HhvAOPAsPiA2ib8Bj+palyMbEC+CMwmHdtzrYBlDOgj2jMLScMzPBDjxX BrhA/ymj0IVxHVC0/TLkUqSVWJoTZ+dG/Zg+7Kjh4WBejl5wuaFHGWK46qficvGOeBQB /yKCO97T+x5H4IsFBxqr5blIaQjwDc+3NVLZhN/ZqRbPJG7swKdSEINL8fJwXEy+uqqX LaqOjsNHfEQRm1VdWDU0/DvUJMiXudFN2LWpDyxYQkkPx5EtJzJe9e9eJk4ecDKRet/B bIE9ef7Nso37/n0GAymcqGEBDkdFpbfn/ipWCvnLOmRgUcJe3fncPJKerHZ7f8s1tkUc 52XA== X-Forwarded-Encrypted: i=1; AKwUvBwI8WCxt77PUTkMri7FoanjlfyTEElu3sDeQj6hegNaDasZBYXIy0V7HiIrw234irNaKLUYsZoeJCpI@vger.kernel.org X-Gm-Message-State: AFuF++nYR3FfaxFfDqupx7lHNgZJLRuCj6tcEahLGIz5vo+q6tVauGcW zx92meajIS4UMEy7WQM92PPpFawi79b9LBYOn0Lk+FU9PYECam5E6vlw X-Gm-Gg: AYBFou0LUHiMWaHYnpjN6wVaJgj92NAXaDEcgW3zjSYFHLd1E7nizU6xkqr7xsgX5sf 6uEECE/o6cvUZKvma+LP6j8lMCHcu4Taa2bdunJV0Dn+w/7bJall6tF8GV7Nsk9QWkTl2RSnLyb wJSSvNfv9yXXMQ1sKB7UgR1nDHaq8dsmcp0XBw9GE6OsNCUG4TIHPtpTugquwNkK0B6bDUHoYfh 7FYQ8Rt6RowQnuBa69M1A5mIyswdRvps0EWZn1l0BQeHcvJXbVoe4jhEzHpYPMqA8EYmoUy0cz2 l0+9t4EOTg0uGqJRxti3ARSOAMCXXVj882gGe5mpJfMNK8BRmpc/MfjF/VzD+j6dsxiIyMvtals FRE/Bg0/2fcFR4jFjO9KB9HREEyxZt1lMA43j1w7TSaY+SkqJPCU5/gqz04vccodc1VY/l8QB87 ywkVcjr/2IGUzcBns9pKGft/2xPoVkqVV6+PkZMb9eNHSM5EytrvLyKfGfmTKSxbgHkZSp4zUtp uaNkk4orHQJeCMmX69ReHYGaiSatyPpqR+PSfvM X-Received: by 2002:a17:907:7ba5:b0:c25:8c05:902f with SMTP id a640c23a62f3a-c2ac230affbmr1172846066b.13.1790626125092; Mon, 28 Sep 2026 13:08:45 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2ae76abc3asm509778166b.37.2026.09.28.13.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2026 13:08:44 -0700 (PDT) From: Magnus Lindholm To: davem@davemloft.net, andreas@gaisler.com Cc: linmag7@gmail.com, sam@ravnborg.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] sparc32: honour phys_base in the viking cache flush routines Date: Mon, 28 Sep 2026 22:06:22 +0200 Message-ID: <55357ed4f6270c81595a018af2fbe391d8b912ab.1790548064.git.linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org viking_flush_page() and viking_mxcc_flush_page() derive the physical address of the page they are asked to flush by subtracting PAGE_OFFSET from the kernel virtual address: sethi %hi(PAGE_OFFSET), %g2 sub %o0, %g2, %g3 That is only the physical address when phys_base is zero. The C side spells the same conversion __pa(), which adds phys_base, and every caller passes a kernel virtual address expecting exactly that. With a kernel loaded away from the start of RAM the two disagree by phys_base. viking_flush_page() then compares cache tags against the wrong page and flushes nothing, and viking_mxcc_flush_page() streams a page that is phys_base lower than the one it was given, so the intended lines stay dirty in the cache while unrelated ones are pushed out. The visible effect is that anything relying on a flush to make memory visible to another bus master silently keeps working from stale data. On a SPARCstation 20 this shows up as every SCSI transfer failing with a DMA error: iommu_flush_iotlb() cannot get the IOPTEs out to RAM, so the IOMMU walks stale entries and the ESP DMA faults. Add phys_base, so these agree with __pa() again. No change when phys_base is zero, which is why this went unnoticed. Reviewed-by: Sam Ravnborg Signed-off-by: Magnus Lindholm Message-ID: <20260928002035.1-2-linmag7@gmail.com> --- arch/sparc/mm/viking.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/sparc/mm/viking.S b/arch/sparc/mm/viking.S index 48f062de7a7f..8b4e251bbba2 100644 --- a/arch/sparc/mm/viking.S +++ b/arch/sparc/mm/viking.S @@ -38,6 +38,9 @@ sun4dsmp_flush_tlb_spin: viking_flush_page: sethi %hi(PAGE_OFFSET), %g2 sub %o0, %g2, %g3 + sethi %hi(phys_base), %g2 + ld [%g2 + %lo(phys_base)], %g2 + add %g3, %g2, %g3 ! + phys_base = physical address srl %g3, 12, %g1 ! ppage >> 12 clr %o1 ! set counter, 0 - 127 @@ -91,6 +94,9 @@ viking_flush_page: viking_mxcc_flush_page: sethi %hi(PAGE_OFFSET), %g2 sub %o0, %g2, %g3 + sethi %hi(phys_base), %g2 + ld [%g2 + %lo(phys_base)], %g2 + add %g3, %g2, %g3 ! + phys_base = physical address sub %g3, -PAGE_SIZE, %g3 ! ppage + PAGE_SIZE sethi %hi(MXCC_SRCSTREAM), %o3 ! assume %hi(MXCC_SRCSTREAM) == %hi(MXCC_DESTSTREAM) mov 0x10, %g2 ! set cacheable bit From patchwork Mon Sep 28 10:06:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Lindholm X-Patchwork-Id: 2312850 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=pgQgfz1C; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=150.107.74.76; helo=mail.ozlabs.org; envelope-from=srs0=oqmp=hu=vger.kernel.org=sparclinux+bounces-8119-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4htsp52n9hz1y1x for ; Tue, 29 Sep 2026 06:09:01 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4htsnX5sqSz4wSh for ; Tue, 29 Sep 2026 06:08:32 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4htsnX5qbRz4w9d; Tue, 29 Sep 2026 06:08:32 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=172.232.135.74 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790626112; cv=pass; b=RFLUavubd+rehLXITC7+Ft7VCgoYNu7YeNhyODCzsnLnWXdBxIAmNquj9LRwLH641cGAG45yWm6RYOHx6w2hHz+slR+HA8lh2Koy4FfncBb34UoYRFdd8nvepZPO9GROZP0iPe4oxBi8+H0vGDVt9It56R7XxG+WobblGctvsmCl9FFl1qtMntqDjiOGy66kArMuXAjVgGTL5U+lEesxKBwfmw3dbe4lZIDSdKY9hAWyef82Rf3SE8/SgqeIlHTb/MAsRgzN2AsFH8gpu2G04eIllET5E+4HqwSsE2MJl5qFxWrQ+WxX5T1MX7daKOPVBDUDuVhRN8vlIGT0AkHs3Q== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790626112; c=relaxed/relaxed; bh=ZmSflQBXftp4HXe4zrTMF1QW5LZc3st1xkIXknkEjYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fiQPu3yn3x4c/r3qQed50giUTUjf4+46snm6PBRBp5wDgBCMfXalz4i4FzvO0n7z1LFYzr2+bdPVN1Dz1a9t1IEOFnKJiL0IBa63zaUaa3m3r1f993KNqmYGpvl4vcP+7ftPsZW5spQS6PshkzVhNwdYIfa72tTqARnKOPTteONpOcD7vR/MemHSN6Qdk5qoysMHsHSVkASHWx/0vZY2oI4gJBMCerr9mNzBIXSvdO63Ipd0oRdfgw1cNW/UZbFv6gjdK6/z4rae0DmGXZiiFDN5GikuTF64anbsQjE45qGD09Zy5HrPzdzc8l7gU5ftrbvZtX71xsAz8huxbTMf8w== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=pgQgfz1C; dkim-atps=neutral; spf=pass (client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=sparclinux+bounces-8119-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=pgQgfz1C; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=sparclinux+bounces-8119-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4htsnT0mqGz4wSp for ; Tue, 29 Sep 2026 06:08:29 +1000 (AEST) Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 41F16605BAF for ; Mon, 28 Sep 2026 20:08:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB1804F85BD; Mon, 28 Sep 2026 20:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pgQgfz1C" X-Original-To: sparclinux@vger.kernel.org Received: from mail-ej2-f42.google.com (mail-ej2-f42.google.com [74.125.228.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D15754F5E1F for ; Mon, 28 Sep 2026 20:08:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790626129; cv=none; b=J6lp2gJiAc+h4rSyCGDl5/wbBwEfNfdyrer16hAYFgmC1UGxbVlt6TpNA4OWVbGtPBl4MoVzl1cjvv5d9CvDxZaxt36ZtkbY2Z2CRCS7ycabBHNC/kWJZMp33pp1oc128jV8B6J+nNYDDr6Orv/G+wSvcOYm8CZJmd0+nFHKU3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790626129; c=relaxed/simple; bh=d2MUplHsS8U4FJAMDoym0CNaIjbOWLHpN+BVoJXXMdE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rEHdZ/h4Kfbdpo0O0N6e25jOvS7I04FacwQ7LEr3x7Tly1OYCbUr/OnSk/ONlMd8PzAMoWHC0sSx0xvr7ObssjEMaXeFs3DqqjCaOadIMt82wiNaxSzVYcMFF1o8mtnOmgedksJaDU9skW5tBAi14uQgorJihohSDn3th4hzdLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pgQgfz1C; arc=none smtp.client-ip=74.125.228.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej2-f42.google.com with SMTP id a640c23a62f3a-c2da4eea067so282748666b.3 for ; Mon, 28 Sep 2026 13:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790626126; x=1791230926; darn=vger.kernel.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:content-type; bh=ZmSflQBXftp4HXe4zrTMF1QW5LZc3st1xkIXknkEjYs=; b=pgQgfz1CGdfgc5nOYb0VXubQ35hGbzuEGpEbcKvrjScIOHRHpLn67jGjoHIkJl3pP7 LHqzNqG+DGuNUvTMqrjYNrEeT79QOG17nz1uqRK/6rHtf51ihXWt06gXPjQ5V/f9uAE3 bo6H7yJopSGCtA6as4mXuEghPR6mowA09xYCiJO0pEUVZQbKeptpSOVgwbC3r5sI+4gy 7pQKdZW6mKeWvZPfMacJHwRLF/8qnYtpLCvCoKd1Lgq5dBSs3F9t9vkZgwUoNw14jE2K BfVc6tJQJFgsI31k4sVhFyzUAjTNHb0futW7TAWn4OlhPXn1t5ThWEL/5SEcciDj8JBC F5Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790626126; x=1791230926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ZmSflQBXftp4HXe4zrTMF1QW5LZc3st1xkIXknkEjYs=; b=vXDzd4S0auyiRRWh2MVNuPKLe/D3d3vW0NROzM9BxAc26I1O8t0xqz6nAzCMAM+enq epTTKz5YAVPN+vlvE6JyNC8VYsYwosVS7HTe9+9faIH2AwPTlRQXOyOVETAj1uJafnt/ CFSK8R47QJq0/xQa0Km0KXlOU2ynsgxSm033jxMI6xgxQxPxEB4RE5eYFPOZvt3aH3XO 6hVKzKGY8K6asGlELsN8j2d6qZiOktg6lh3iZtcjgHtIqsE/h9wgbRawAP1P4rFQ3k4D SvrvUmsKAm2TxjsjHAUmIWcXiGx6pqLu2GgrVbG0oQ17Zysh5JqAjo42vhix8BCYSwnz tqnw== X-Forwarded-Encrypted: i=1; AKwUvBy4Mmu4xyYJRSRRr+84EkpV/Tv+cnsm1F8+peMqIHRTeVYhpdrKjNDpLnLARyKkxauKg16xVJtHc55I@vger.kernel.org X-Gm-Message-State: AFq9FYKzrn+Xq1IHFSbgOzCEkuWNT1w7V9gvTZP1wYkewrU54Hr5M8aJ B93QSXqwbX0hQwl1kKg+2A+k0dwGhXDT18eX1SxoMdzHPM44al30IzGZ X-Gm-Gg: AYBFou2aOBu1WN2brvbRlTV0sTWgQSEUBnIid/xlJeeHDpOlrxCt1sbxbqTHzRzrpQo 8oPq8cyvdUNLXl8b2OENQm/EQP/fQj+6n0LsW21Nh/rbjvRQA1Blg7WWa0f+G3mONJnE7Fa5A6l FPCW+8TiikFeM+vQCX8mmdfhDxvMj/0Ttds/UuNtVXBmtYoVYla43xkfp5ndDwK2qVn4xBEL4Bx 6hGRGypIPP/yZsqmFaXS2G88hGFeMblp4qTMzqWC6DoGfcMkPQKbPU3Hrgzr/LndGMVFJOpY9AI lizuGeOdL3AQTySrmyl9cl1nMS3DdQS8yWogjmNnZQkQHJRULruxWfGbEqYXm3d6VOk+TVDiRgw 6JBC8iRxIb3W54ddOVbsFfzivpWIjmDvcNT+8grDXoPxCJwcKBbLsEBj6VrYn8RGbsT08UonRik NYOh112H3kqVRWbffJQMEbMSKTpMjxzlqXg7BM1MWM0XQkPg9qnJ1/8qMYSyeUnitss5KMkhdjs Dl3SLQ8ca4l79kASobp/qoutYlBPBq5XIOLjhFn X-Received: by 2002:a17:907:9487:b0:c25:cb7a:12d6 with SMTP id a640c23a62f3a-c2ac528c69amr987383166b.14.1790626125962; Mon, 28 Sep 2026 13:08:45 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2ae76abc3asm509778166b.37.2026.09.28.13.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2026 13:08:45 -0700 (PDT) From: Magnus Lindholm To: davem@davemloft.net, andreas@gaisler.com Cc: linmag7@gmail.com, sam@ravnborg.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] sparc32: derive phys_base from the PAGE_OFFSET mapping Date: Mon, 28 Sep 2026 22:06:23 +0200 Message-ID: <9c8c84ffde99dbf747922ef93c1a73438c846e08.1790548064.git.linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org setup_arch() computes phys_base as the base of the lowest sp_banks[] entry, that is, where RAM starts, and assumes the kernel image was loaded there. That holds for the traditional boot path, where SILO places the image at physical 0x4000 and PAGE_OFFSET is mapped to physical 0. It stops holding once the image no longer fits there. SILO loads a kernel between physical 0x4000 and its own text at 0x280000, a window of 2605056 bytes; a current sparc32 kernel is roughly twice that. The loader must then place the image elsewhere in physical memory and map PAGE_OFFSET to it, at which point phys_base describes where RAM begins rather than what PAGE_OFFSET maps to, and the two disagree. phys_base is the offset __pa() and __va() are defined in terms of, so once it is wrong every early translation is wrong by the difference, including the physical addresses written into page table descriptors. The tablewalker then follows pointers into pages that hold nothing while the same tables read back correctly through the nocache view. The failure surfaces as a hang right after the context table pointer is installed and the TLB flushed, with nothing on the console to explain it, since the PROM mappings the early console depends on have become just as unreachable. Ask the MMU what PAGE_OFFSET actually translates to and adopt that. __get_phys() already implements this probe for sun4m and sun4d and returns zero elsewhere. Restrict the probe and diagnostic to these supported platforms so that LEON does not report a bogus kernel address. No new low level MMU access is introduced. Memory below the kernel cannot be reached through the linear map, which runs upward from PAGE_OFFSET, so drop the banks that fall below it rather than leave entries that __va() would translate to below PAGE_OFFSET. With this a 6MB kernel loaded at physical 0x03000000 boots on sun4m: the context table lands at its true physical address, srmmu_inherit_prom_mappings() preserves the PROM console mappings, and srmmu.c needs no change at all, since map_kernel() already handles a non-zero phys_base via do_large_mapping(). The cost is the RAM below the load address the loader chose. SILO's memory_find() picks 48MB on machines with 64MB or more. Reviewed-by: Sam Ravnborg Signed-off-by: Magnus Lindholm Message-ID: <20260928002035.1-3-linmag7@gmail.com> --- arch/sparc/kernel/setup_32.c | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 1b0db16cd37b..6d7d6fb5c49d 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -254,6 +254,30 @@ static __init void leon_patch(void) struct tt_entry *sparc_ttable; +/* Drop RAM below the kernel; the linear map runs upward from phys_base + * and cannot reach it. + */ +static void __init trim_sp_banks_below(unsigned long base) +{ + int i, j = 0; + + for (i = 0; sp_banks[i].num_bytes != 0; i++) { + unsigned long start = sp_banks[i].base_addr; + unsigned long end = start + sp_banks[i].num_bytes; + + if (end <= base) + continue; /* wholly below - drop it */ + if (start < base) + start = base; /* straddles - trim the front */ + + sp_banks[j].base_addr = start; + sp_banks[j].num_bytes = end - start; + j++; + } + sp_banks[j].base_addr = 0; + sp_banks[j].num_bytes = 0; +} + /* Called from head_32.S - before we have setup anything * in the kernel. Be very careful with what you do here. */ @@ -332,6 +356,22 @@ void __init setup_arch(char **cmdline_p) if (highest_paddr < top) highest_paddr = top; } + + /* phys_base must describe what PAGE_OFFSET maps to, not where RAM starts. */ + if (sparc_cpu_model == sun4m || sparc_cpu_model == sun4d) { + unsigned long real_base = __get_phys(PAGE_OFFSET); + + prom_printf("phys_base: RAM starts at 0x%lx, kernel is at 0x%lx\n", + phys_base, real_base); + + if (real_base && real_base != phys_base) { + phys_base = real_base; + trim_sp_banks_below(phys_base); + prom_printf("phys_base: adopted 0x%lx, RAM below it dropped\n", + phys_base); + } + } + pfn_base = phys_base >> PAGE_SHIFT; if (!root_flags) From patchwork Mon Sep 28 10:06:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Lindholm X-Patchwork-Id: 2312851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=RqoUdbVo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=gi/a=hu=vger.kernel.org=sparclinux+bounces-8120-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4htspT3XLMz1xxW for ; Tue, 29 Sep 2026 06:09:21 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4htsnw6yLdz4w9d for ; Tue, 29 Sep 2026 06:08:52 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4htsnw6vzbz4wSh; Tue, 29 Sep 2026 06:08:52 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip="2600:3c04:e001:36c::12fc:5321" arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790626132; cv=pass; b=GvFeT8nHQdESuAOf0VPCdVBP3U6kI+u6u/JGp0JU20drnBWCx+IGAGPQicSS1hUvf+prg/q9KkD4PJYuJyTr9prykfrNaiPRfVRO6uCcFtRupT5wH+RnTQ6yRmSZGeT0ufX3T6i4Z0yqKpqSjCX/L5L9OD+3IOeXG/EnqU/z3qIoxqLDT4B73QKzrfaZa5ArAitavua5YTEtHOrS2s8MukXQ8/PRJ3PIyy7HPcBmiZS3s/6SZzrcB48U6W5W2IS729i77uRXKyJfuJHUIDMLG5RUu4IYnm2qrSCbmT7JlAjmBhZlrSkL5ExqHg6UwLxUc75gIYzeCpwO9PLw+VAA6w== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790626132; c=relaxed/relaxed; bh=CE3tEgZ4a44KtqLZ+CTK+zzBvwh13usPnMe5fmHTEY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qb6wDPHOEweYI5J5jvZtP3fY2oGvot7aH51cvTzJjDsZrB+gDBSQOB45zPWY6mp1IDy5JobLzW427MXNazOCyIWv6bC5v1iCfXEkOWALJXNTrAdm0b1MFt1/0DaRzQ57deAE4ymrbuNiUOzx6kl2KBLRWcNAggBcHql89qGpjbZMTFKQNJ/VEFiWJ6X5h9pet7YmFsZ0/hmW2OoOd0vTfTUkoCHeTSKnvqIJVZkHQFOQ9K3UK0A/weM5QMAdi+anyH/166kJi5tkDfmDQCHOZ6ABNyijVm/MixQQ5GQrcfsVg0gIpVHEGT/UtqC7avCDqOsg5o9inmcCcdRbRhWSvA== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=RqoUdbVo; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8120-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=RqoUdbVo; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8120-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from tor.lore.kernel.org (tor.lore.kernel.org [IPv6:2600:3c04:e001:36c::12fc:5321]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4htsns5JRZz4w9d for ; Tue, 29 Sep 2026 06:08:49 +1000 (AEST) Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 728ED355D3 for ; Mon, 28 Sep 2026 20:08:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A108B4F93CF; Mon, 28 Sep 2026 20:08:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RqoUdbVo" X-Original-To: sparclinux@vger.kernel.org Received: from mail-ej2-f43.google.com (mail-ej2-f43.google.com [74.125.228.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C80D73D649C for ; Mon, 28 Sep 2026 20:08:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790626130; cv=none; b=FbJrj4So8FHiGa8a2QqEnS8b4RGiSpbqcPVf7UYA6L7wq3Rc5FO7F8UfBgK2WVqS5z1e4+9KLWcWyEFVOD5juj3643gY4CTxy93jaosUxcuzcfHLL+yoCRdCfHCWZolaSL8RQKANCDLeGoX2CDRRKH9pgCSKH571WN1xPjc+HEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790626130; c=relaxed/simple; bh=AzdGodhxKE7DykxVHyS0xooKhsrpCAjLMp0Dm5wVvZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gJkk/amIv34mgD5PQ3IxbMdepR/dQt8WuYM5nGbkbafL4pMgflTJii5QXlULI9eDmZ+fJI39QOpSzbrLbTKVQUy/KwnLb6NYNQ1oI/9YMGz2GIvpxivJovQtTZzhXLV3nl6F6jzTJm/kRaDpOFo20fm1uoLELNEtLRw3gwAoi6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RqoUdbVo; arc=none smtp.client-ip=74.125.228.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej2-f43.google.com with SMTP id a640c23a62f3a-c2af3a4f193so373251466b.3 for ; Mon, 28 Sep 2026 13:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790626127; x=1791230927; darn=vger.kernel.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:content-type; bh=CE3tEgZ4a44KtqLZ+CTK+zzBvwh13usPnMe5fmHTEY0=; b=RqoUdbVo0WMwpRDmK1sdxvJydGhZJijtpBo/xOFGBn2FJj8VoPxhcVYHZ0H5e0QRJS z5Vv4V9czbSK52bApuVIfJhd3w5JGkE97qH9TKgptHRJQHJ09Gja+XKRCCgRcNDAfsnJ lfY7jEBY1yZtopfhlcb+aexUzPjFHn4GJ6t/TsHI5KnYvGdaZd2U/6dBc65Jd/B52ReF qcAOMOPsQLM9y76c4aVuYnTz4DA/DbOUPXjshVXGkHAVayLrRxyKYJwWU01I0K8/+KfX 2iybwoOtYE3i+jRKmqji6uUDQclchT6kN02DCGkctTAwnwe4G2Kuacsi2nzyK+lcTdfj Jm1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790626127; x=1791230927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CE3tEgZ4a44KtqLZ+CTK+zzBvwh13usPnMe5fmHTEY0=; b=0uAeDwLaKrDPCNTxbCQOoqpTBVNzjffsuRl44eM5ssPNXOIcStJVZH0RIecBO88xXt VI00grgc4kZzuZL/ugGtd+TYyGFRnycMGkf5Re1w8PaRBY6JI6hp8CTvWa8HtKyb2L2m 0Qo0ZxHoK+dEapRx5Jdi57lBtT5elDUXI0oTul8vyzW09pvDXBPpw/72N2FxhkfJlxQb kMsP12a/WoqSOnACcgA8oQ3EZyFCid/0xsxAIbewXVDbP/9inj1SdKSwrBkfvqu4qdP1 HMOoaW10+d0zOhVHfADPt5XOkfHa4nMJ7VKh/c91iJvc2xRJWfNCKx2sXqo0BZ3uUcla 418Q== X-Forwarded-Encrypted: i=1; AKwUvBwZKanuyvO64oDrRDPUKDfCOv3+yRZhogHfU5I/FXqbX5ij9zU4PjZhzYgDk2HdAf/Uf4ICkMk836Mw@vger.kernel.org X-Gm-Message-State: AFuF++nsLlCu9srhNZLvX2IzPNzoXKDC5eCiCF8hW4XL7Npo/n0lczY8 AM8QcWcjlZCoknZomcDbXXl24aJPUnkomls+WKpe2rdc58FqsZSNivLy X-Gm-Gg: AYBFou0bqSq9TZiZcENtBEWPsRExlZ6gpHojOtsla1ft7Zw3XYztKrJa71VFeSTCzvl BxQQ/bwWsaBS5XU5GRsBalN4Du+zO8Hw85phmrhvXCfBUbUdTUptxG4sdcFeGesCQjg0m/YHYFm nNsdE5yZRD3xwHSzWu4zrc1oxlg0ER9BQNXDIVgFOZRMmiWCHCB23NjBdB0V3FGPkfFI+LVyB3A awg6q0Pbvg05XYfCmfI0BybkkcacRLT2Pq4R+qerZ89w+2tWdV+vyk2Fz4xKqaksTmqb+Tpy79A oMskh55wWR7DkMyd0sR4vnkOiAdAHc7DGYtgkQbtdAY8C365dslv1FjLDwHxt+0jTpLYJvVLy3b 2tdlc7l3QbVvj7enTFX3Oc3zoYAvndx9MeoTNEsNLzZXyPZkiyuWL7eLiuSYx779ZgCihza+1Q2 NhyMvUDQ/ZRJLtm5yOlf30Ebo0TZtSa4NithzeuXxaGgJX7nZ/BCHc6jdjfRTbcyEG/YDMCoRDn tuaQsTbe+IRlcBH7likRRcxNyjYD+LqFloAOgavk9rqwDDHMqwN X-Received: by 2002:a17:907:1888:b0:c29:286e:2e3e with SMTP id a640c23a62f3a-c2ac25ef36fmr1148656566b.38.1790626126915; Mon, 28 Sep 2026 13:08:46 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2ae76abc3asm509778166b.37.2026.09.28.13.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2026 13:08:46 -0700 (PDT) From: Magnus Lindholm To: davem@davemloft.net, andreas@gaisler.com Cc: linmag7@gmail.com, sam@ravnborg.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] sparc32: advertise relocatable kernel with HdrS 0x0300 Date: Mon, 28 Sep 2026 22:06:24 +0200 Message-ID: <2ed67cfac2dd3847de19eeba566254593a661e93.1790548064.git.linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org HdrS version 0x0300 tells the boot loader that the kernel supports being located somewhere other than physical 0x4000, which is where SILO places the image on the traditional path. Anything older is copied back down there, and refused outright when it no longer fits. sparc32 could not make that claim before, because setup_arch() took phys_base from the lowest memory bank rather than from what PAGE_OFFSET maps to. It can now, so say so. Reviewed-by: Sam Ravnborg Signed-off-by: Magnus Lindholm Message-ID: <20260928002035.1-4-linmag7@gmail.com> --- arch/sparc/kernel/head_32.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S index 8c320fa25a67..11a1746829a4 100644 --- a/arch/sparc/kernel/head_32.S +++ b/arch/sparc/kernel/head_32.S @@ -69,7 +69,7 @@ sun4e_notsup: */ .ascii "HdrS" .word LINUX_VERSION_CODE - .half 0x0203 /* HdrS version */ + .half 0x0300 /* HdrS version */ root_flags: .half 1 root_dev: