From nobody Mon Sep 28 22:28:29 2026 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 E2D1F3264DA for ; Sun, 16 Aug 2026 07:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786866809; cv=none; b=qMJsVaXeYeTpWGgA18rafaPJ02VMbZlF1R6IJpFIby1WCVAL8+1b2mYv9oyQ/EukVxlgf39zx240KKBAEl+6oknbDIpEypqJtDRBIx4InA6HnMR7UdgxYfdAqY+gRbmQZPDPcHU7XkQJIDpgdr6Ax/92S7D4quiQyxRi829OGwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786866809; c=relaxed/simple; bh=qeTfM1VkMk0+4bmCCogGKKwXhXDMIKGOfZW8zAb4pmY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IhstOr1QdMc9MRgGJzrO5+kxVy2LXTKYfN5xk/68VX64R1mFcqxxhbdQw5ADHrNimEcIvfxvEDuXcNpDQdpLO0kKK8+9uaqEj+6JRRh5DgdIUlDzxzIElPdfxY0xM1nTrQKSVLkKahPbneLXntFzQsrLRBCqOPFYG9gD1zHigOY= 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=IFO6jydn; arc=none smtp.client-ip=209.85.167.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IFO6jydn" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5b2b92065ffso2219405e87.1 for ; Sun, 16 Aug 2026 00:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786866806; x=1787471606; 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=rgiclpiITCoA8RFUuKs2akILXvflZWj5Tf2R9RMw6kg=; b=IFO6jydnJMkaXbP7dWfMZNEg0fudx7/gXJaKdpSuLK5Hof1p1PcnFFkT4CyX7zOEFv Zrob8xrw69WBmpRGwH4PaaBx0/yryHdd5bYueWsngMse2Eb9b7BWUZg8Y4C/kdgfTh2l q67/tVrV1juyl9eYKRgLvpHnQJgjrujDSAA7PI2Lhk7cC34d2C3f6zXFtt9CdqHB0BkA seHhL4NLjQ4+vtv0aSVIaS1fQfy77ynbnoI2BMdVTuktexQvC7yVPeEE+ov2HvVziAqk o52C/gpeG61R1LqP+7RJFFMCGPbV4pWlhJhLL27h4KuXrtRukg8hBZjtmVcXXce55EeU Olww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786866806; x=1787471606; 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=rgiclpiITCoA8RFUuKs2akILXvflZWj5Tf2R9RMw6kg=; b=mxhiyp2x/VqOBFEnXRdS9Yqrd+skRk4VsrHKLf80DbD0cAeLoc7fA2MxW685xuSxnM e9g6FxlMbkMloRSypbFUPmrHT1GfBfATUwvhkRhifR0KcAIckaCkosVTSsNpbLVVYEX7 Ak/HImx/4/HHHu27nBhHt+GfIaD5pv1YQZ46x1CljpWyHrJwFmo9/tVZN2HHF0Vv/5zc lIGtw7HSDLcG+pux+jGnvwruU5UGT1wTKjsh0bv7cW9R19pZ8+xpaXLO/2xPD6nQA+Cb DgjlPsSU4J2/Bnk6Na0/j70lMa1Btqbfhou2du5M5Ut1D3VjIJe8Fq3dydYmppBiq1MX GWUA== X-Forwarded-Encrypted: i=1; AHgh+RrRZG3+mENjBXnVOthRO49uB5ygu1OuqCyOH+UDpNWnlBZbZdWyq8k97AmeYaNDEotyacGlDuGC6NAc63g=@vger.kernel.org X-Gm-Message-State: AOJu0YyaGGfgOQz+dbGFL7ibzxzx5NHTffQ8lx39J0JLT5vG59YaBvbI OTpuzTDYKi2KaqLJxIPT7sjKqfr06io3UxNzmuoNm9P7phASorV0beYV X-Gm-Gg: AR+sD11fIHcOfjM2Kkr1GY41f16yBX17E9xbIXfMwjC13F0jnr/MevsYGQ2PLgYPP7o 8/m/Hc85aJ/o9R9n1SczXM8LVg24H6bKZKPcr5JMUz0Lqurm5nLoH4K7ziGb2OQ8dS3gv34JWTT cm/yVdM5RPaDdGv1i4D7yM1YtWZroZFYMZ6OTQVYMcMS6K/awB+BJlr+zx+xVVeRHBpe9HB7C3N /6d/vqCC0vygHxVZGYO8Ws0csMFQezZ41h746KK4Qt8DvmnekwsPp8EhSu/HUi8O4HgztIB+TiV atq+CJU/+8lp83ZB+jk8mXav0rqjLvLSGpI35ZR2n3VYKV9CVwzZmYnn30BC2yV7PVFrSpvH+qW Vub5F/1fVP+6fKEXtMQnMlYpuIBHnqcBiXJqAQwtPNID+LkJLLC46/wGn0PsdFGi6VspdAY08Z1 +w48DDc2zMuF4CpZwBBt06csQNPA4o1Mm5Dbj6L/uRLEZXYvyvJZMDLlmLR2ib6hT5tG1V+hIeG vbbdZ55NIRhezpyy6Vmvks/JiNl8PXCp7+buYTMTQ== X-Received: by 2002:a05:6512:ac4:b0:5b0:1ae2:8b7a with SMTP id 2adb3069b0e04-5b45918c5c5mr2824941e87.45.1786866805942; Sun, 16 Aug 2026 00:53:25 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b458b9a8d4sm1631136e87.15.2026.08.16.00.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2026 00:53:25 -0700 (PDT) From: Magnus Lindholm To: davem@davemloft.net, andreas@gaisler.com Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Magnus Lindholm , Sam Ravnborg Subject: [PATCH v2 1/3] sparc32: honour phys_base in the viking cache flush routines Date: Sun, 16 Aug 2026 09:50:15 +0200 Message-ID: <20260816075141.3489194-2-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260816075141.3489194-1-linmag7@gmail.com> References: <20260816075141.3489194-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Magnus Lindholm Reviewed-by: Sam Ravnborg --- 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 =3D physical address srl %g3, 12, %g1 ! ppage >> 12 =20 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 =3D physical address sub %g3, -PAGE_SIZE, %g3 ! ppage + PAGE_SIZE sethi %hi(MXCC_SRCSTREAM), %o3 ! assume %hi(MXCC_SRCSTREAM) =3D=3D %hi(MX= CC_DESTSTREAM) mov 0x10, %g2 ! set cacheable bit --=20 2.43.0 From nobody Mon Sep 28 22:28:29 2026 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 A4911381EB9 for ; Sun, 16 Aug 2026 07:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786866811; cv=none; b=aGL+/NiusgzzLeTQ/PPQGNBDghppSa5wmqqVFyLuUR3Ot9qgTsJ8/VteKnbP7ZOza7RNZKph4zA6699/eD86B2cGB1iynLeP6mRcI+3pfI/fovQdytWQ545Ad3UWwatok5ceQekEDgHQs61aFqeR39GtQ2d5vDKckitGLI+IV60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786866811; c=relaxed/simple; bh=1/oOxcyYW0GuGrXLQoA79vT3BU2mfelT/BQaPar8lxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V8EVBmZcKbdU9kLx4jGdYKHLFSN/f34OnIns4mVyTIV5xaljkzdKf0jdaJcWOvD8qQk+bQJtzVSq0Cc192VoSMfoS1LunXRpyTXDtAw2/9g49OcpeL4EyMY307XplkxkCPRG4YkLMvtd5W2Oo+UpxirhoXlhEzF9Bni/Dj7g9B0= 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=KTJH3Wr5; arc=none smtp.client-ip=209.85.167.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KTJH3Wr5" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5b01146b205so1760360e87.2 for ; Sun, 16 Aug 2026 00:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786866807; x=1787471607; 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=fTQFv3T7H3qQ3wtluPXd1EgweBdV/cuTg0pb3r4AAz4=; b=KTJH3Wr5Qd5LcjnACuLHlHFwqiyXKLuCAjHigB2g68u8k18lZDr/Gy20OGOOp8Uqa2 M1WZlqLkX4aFImU3PrmE59ZQPaDR4xpRtqXHcX7EQXmyRKfymBznQZRv4DPvxF+xOh5/ h+goHlhOfszqmW5IjH/3rCzehwtKybpeYhsewxStGgk01XxGhRh/EWX7e7Y7T21X1UyL OHx4YQPoSqZAnjF8wf3bUej/zVUhT9z98WDHyMvISyFayOJnuu5J4joH5bG7L7ajB/X1 oikKlWB65jcjdZfOVvGm8X9R586C9vWgTO+A2ysoj0uCJUOQVNDPlLJXKGyKrJhk4Yar 64Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786866807; x=1787471607; 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=fTQFv3T7H3qQ3wtluPXd1EgweBdV/cuTg0pb3r4AAz4=; b=VohnuOmEKiq4ccYRf6KDMnqmZ3BFGEQnhEUAjDhxcdoDj+INWiK9wzkgMcQSQu6HCD BoUWpPErIDCUKYqvpuavoWpKCSLscx1vBzg+dFa3M6Q0M67JO4krsmvS+HCAGLP7UGe8 zGZkG3ShK9LKTzaJ4ydulnohQCulAPOJ/tZhRoA3W3rV2E2OD9nnxTsw9N72CD2z8ZGE EXLg9jVfEpJT4IOYmv+7iF/01tEsm8E74Bj8+yxiZnUx2CgCL8g2W1DvDnlr9yq3Ykyd Tt9ysuFz+Z1TCCiPARoAiYCjXWuQC1o/yCcIyAubCDGxMxVUTBJNiWnookEYTUpOnnmc pGzA== X-Forwarded-Encrypted: i=1; AHgh+RrFcLx/iQ08YmrciBOwU2Qf/nYnCn1MA7fbkePy4aefYLE3Bh2K/ZCAuVp+E6/+fynIf2Fzojn3IpEFe8A=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3ZhVF/twrFw2VS9taEWetin10DgCOX0D2UzzA2+UPaE1wAst6 XrkZRwMEiwOlY3E7pxCRHuKxCMTw+cTPzHrvcK0l4MNFJZlFkYQeK5rf X-Gm-Gg: AR+sD131ypmm4QyObjSDgI5wvzHXVIfGThIPcjTIlkQtBQtMvTZZLwkG5K37jxiuUJK GDcxM2fVCPyLPVcuXsP187gLGjAgzAoQQjHI82mTQPjNiF7rdxG911g8c4JURVNVxnNXidUwoAf FptS3p65cc1We0gJKTFjofPya7ZNAuwlvI8F3gMg6TLWwavxIgtXeXch9dY5/1VhT0D2dHKYwhY x79w5y+dTAKMphFfOe/xlHIj1Q9UpVQeA7FzG+xUQtR83mh6ZtHVE3QjeVnEChV6e5vMRNl4ZaF qfRG052xBtAihXQ1UFBzrFz9fJSRULkQRH4F5O5Lu2YcfXGZnJmIBIqFRAsGWszRdDXoqyCCmLK nHJ23m8YmBxsropYOldD3FxZfcKR2x7e4nCpgpmT9+CZE0Usnu+0CI/gzll9Jo20auAQCIqFbo6 J2nNFKF6l1RObb0yEl4sP+Ffb4RBRHMBuQNbsDvi/ONAF7bjmzzPaDDziHnHCSOy8F7YeYnOMTh kfHR/MLyLp2cusOZ07ByZs9tx2AekQ= X-Received: by 2002:a05:6512:3d25:b0:5ae:c563:f611 with SMTP id 2adb3069b0e04-5b459186181mr2802436e87.36.1786866807302; Sun, 16 Aug 2026 00:53:27 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b458b9a8d4sm1631136e87.15.2026.08.16.00.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2026 00:53:26 -0700 (PDT) From: Magnus Lindholm To: davem@davemloft.net, andreas@gaisler.com Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Magnus Lindholm Subject: [PATCH v2 2/3] sparc32: derive phys_base from the PAGE_OFFSET mapping Date: Sun, 16 Aug 2026 09:50:16 +0200 Message-ID: <20260816075141.3489194-3-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260816075141.3489194-1-linmag7@gmail.com> References: <20260816075141.3489194-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, so no new low level MMU access is introduced and machines without an SRMMU are unaffected. 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. Signed-off-by: Magnus Lindholm Reviewed-by: Sam Ravnborg --- 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..34e8f7c87685 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) =20 struct tt_entry *sparc_ttable; =20 +/* 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 =3D 0; + + for (i =3D 0; sp_banks[i].num_bytes !=3D 0; i++) { + unsigned long start =3D sp_banks[i].base_addr; + unsigned long end =3D start + sp_banks[i].num_bytes; + + if (end <=3D base) + continue; /* wholly below - drop it */ + if (start < base) + start =3D base; /* straddles - trim the front */ + + sp_banks[j].base_addr =3D start; + sp_banks[j].num_bytes =3D end - start; + j++; + } + sp_banks[j].base_addr =3D 0; + sp_banks[j].num_bytes =3D 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 =3D top; } + + /* phys_base must describe what PAGE_OFFSET maps to, not where RAM starts= . */ + { + unsigned long real_base =3D __get_phys(PAGE_OFFSET); + + prom_printf("phys_base: RAM starts 0x%lx, kernel is at 0x%lx\n", + phys_base, real_base); + + if (real_base && real_base !=3D phys_base) { + phys_base =3D real_base; + trim_sp_banks_below(phys_base); + prom_printf("phys_base: adopted 0x%lx, RAM below it dropped\n", + phys_base); + } + } + pfn_base =3D phys_base >> PAGE_SHIFT; =20 if (!root_flags) --=20 2.43.0 From nobody Mon Sep 28 22:28:29 2026 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 4C8AC387345 for ; Sun, 16 Aug 2026 07:53:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786866811; cv=none; b=JlOgNO1UjNZ0o4sXv3GX3EZd/1Y5kTaF8Y7DH+w7jymvCLUVHtj37e74A5vgXR/KdVxbLfyACjFjWVulrkyOU0rshLlrzDP9yn5/PDIvI7tp7gYWZYDezxG1/OFXOHwB7vRJSDWrXISQl784Co4F1n5r5PdMsCQhuduMhrhv1tQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786866811; c=relaxed/simple; bh=0TcYhUzI4IMVkqeFHXfxvRTGCNZfF/6uhQKiYamoYlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jXGSZILGGMFPSfb2tnRm6X9ycMUaF/OGk7n2mJcxzs3JHuhfEEXqD96unp5YB8JI+HCBOr8DONodtZ1KoDMrP5BAkUzXXUZ7edAWs4tzWtHDWPcm8/7qegrC31i7ZcviKlb7k2YdSX2dSYeJu8nZ3msltN71BELFKrwNuh2q5AY= 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=V2ge4uB9; arc=none smtp.client-ip=209.85.167.45 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V2ge4uB9" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5b457a0b4e5so2439117e87.1 for ; Sun, 16 Aug 2026 00:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786866808; x=1787471608; 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=wAFXU8BCP3FG3ExmAfyGZH7qD9NR4+adUEltJcyXz8o=; b=V2ge4uB9anlTABLL7sgqpp6THBrMwGW945ngfZcOyvLfSvV3ZniwzhVFnzDRjcTdXA cp4dDbwNPVwzLDIW30EOLM8+gUUPSShPvmkZyeYR++a1dWTjohlrPgqZBa0kLuvTTDpu CGf3YOR7Z6rT/MZYzElm5AxT7PNFFIlxxse35B5npcwPWB5JN5NqIarNwsr6kH5ugLWN HzZSmF2Wf4CYHlLH2ec7x3IIGigqZqjzuan4DBOhK8QL1tOTtAQMyq3aXwyYM9JMYa5M 4FmKRwGo5FHandAa4VtTTK/wfGdMNNkmaB4S+juR0QE5qIaYhi2rrrMMuTQXU3oAhhVF Hq1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786866808; x=1787471608; 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=wAFXU8BCP3FG3ExmAfyGZH7qD9NR4+adUEltJcyXz8o=; b=r4ECTtWfP4eTYYmJbYsdj1ORnYBsriMN6rd5ZGbvZ/9hf0lJcWya2wMzufIyaDFOz7 2ndRsOU0frEsdqiG7ZQWl4+QzqsO5KYLjCGBzQ8YDMNR1FqxGiehAKOGg1lbivRJEiCh rcOj8GQSbsOuuLxCS1XuY49isR9znneKoTGck0rBdA3yBD3ZjlOeRgIOJrLLy2u14Ra0 DCJaaNC+6/TQIXS+Q+UsGFsbInaV0Joqaf3WA+90ZS8V0eIMjZBuwJCqXSv8nKJZ2LvT f6PyduLGI554rB/08KJnbFx5E5f4nz84fo5UukjAq0vKY0/gYk6BlawpANKop5ZHkI7T +Rqg== X-Forwarded-Encrypted: i=1; AHgh+Ro9ZbRdrhWMfYQnWQ4/9TUwvcvAo5BBzWELYlFn7NQoegk4xII+2i1kTZ1lHpj9MDTro97JLyFWvK3y1dY=@vger.kernel.org X-Gm-Message-State: AOJu0YxpTVaLtFQehM69qDEW8U85qP14JGkVGKJA5zNyZxRmbonVxpO1 5o3L+KlVBCWUQIKZWq2paHOQVDh65bYk6LtWwTZbicGXFGGD51w+E0n9 X-Gm-Gg: AR+sD10tcD/rC2nj/L5YH+OCpHdUTwMFNF1vCSVFxRGk2RNjHNKNQ39WgDLWYC/o+9f Xfz0YfLxFSLnX3/7t2guhKi2yTA60LbFZEkg7TpWnvhUqpuHSQVE0xcrcmfZDctYAJvH/6n20Pz Fm0TdArXd79giHOyfDvc/c1Dil3IQFFKlqhXAuNOO94AvpWZW5OFIau0AZuFOt4JpbUvko2p5Vl rHNSyvwyTceQUkFmlnlFSbQk6m6lpFGWk+qsqCuaskctPOzdA/iW7+xM5Y8/YDtEAa9/DxXrsjk MBYsPJD5/yOBQDQnmnrJaxaa5NXPRuFyHwDY5MiBRqXMyJ0/r5DZLUVjgBXEDeAFRu6YD2oQIUn xvdZ+vB2rcrs1RAUZCW2teq58+fZf3C0SvqfJViTjL/n391b6aADre4xuKEGoaCQ9pU63sfNL+A rprXRN0NnhnSX2Ua03BuAT058AbB1oGvT6H8pUG1dFfLxHlyEdpLwjOddzJrBIjNo7HKA2Ek40Q nZScw4gNzkZhyl3ukQueaVvpVsuROU= X-Received: by 2002:a05:6512:8394:b0:5b0:c95:cdb9 with SMTP id 2adb3069b0e04-5b4591733e2mr1842974e87.23.1786866808267; Sun, 16 Aug 2026 00:53:28 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b458b9a8d4sm1631136e87.15.2026.08.16.00.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2026 00:53:27 -0700 (PDT) From: Magnus Lindholm To: davem@davemloft.net, andreas@gaisler.com Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Magnus Lindholm , Sam Ravnborg Subject: [PATCH v2 3/3] sparc32: advertise relocatable kernel with HdrS 0x0300 Date: Sun, 16 Aug 2026 09:50:17 +0200 Message-ID: <20260816075141.3489194-4-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260816075141.3489194-1-linmag7@gmail.com> References: <20260816075141.3489194-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Magnus Lindholm Reviewed-by: Sam Ravnborg --- 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: --=20 2.43.0