| Message ID | 20260828123707.1852437-3-stian@itx.no |
|---|---|
| State | New |
| Headers | show
Return-Path: <SRS0=hWYS=GV=vger.kernel.org=sparclinux+bounces-7302-patchwork-incoming=ozlabs.org@ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=itx.no header.i=@itx.no header.a=rsa-sha256 header.s=mx.itx.no header.b=mZpfusV7; 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=hwys=gv=vger.kernel.org=sparclinux+bounces-7302-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 4hWdG41W7Rz1xvq for <incoming@patchwork.ozlabs.org>; Fri, 28 Aug 2026 22:38:03 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4hWdFy32Q5z4w1Z for <incoming@patchwork.ozlabs.org>; Fri, 28 Aug 2026 22:37:58 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4hWdFy2k5xz4w2D; Fri, 28 Aug 2026 22:37:58 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1787920678; cv=pass; b=xS6tdsOR6P7ABt5Xqc34JTV+/4XAABXUk0ZxQmjxYaVw+WG4tZXnl2Co7BAslhQ+aDxEbZNFfjgRO/2wGMyHVeLoWpRt+fC0dK5vtcVezx0gKoq8SMi9vUHZmV9TDME/kRxPUZ3C3zs7Cxt9zyRO55L69Ku4icnwcr9Tc0I4120NSuRDKPg1DQqAb7A6rId9nPkG58QhRIUPRpevyjQBeC4a/j0ryog/6JIJOsHwfklQrnm5i2VRwi1O+qcpjhBLpnNMJLU48z8YQNcHgKsVr+YMyYfW3D6HDaWGOBnJMYu8xjBP5hjYdF4Rsb/1Slqd7J27xiGd3Zn5XJCB7cdDCg== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1787920678; c=relaxed/relaxed; bh=FJQFyAYzT5dGvrkkw8+IS0Bzc2SUTqTRZYJ2UjPIrIw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f+hovWhuqFLbZgrw5tDZutGhI4snyQSpGb9bID02irfAznuHp+DEGTbHk0SDbDWTc7RCtZHxeDTzp4UqvXAm5+ZMqkX4L+vL/7MgGOzGqC6pDIaJ3w0Qk2jmU8ViCiO9Sb8AaBlNwkXVbcUpL+2HvK58YAcVnDhdvyqx6pp44YxOfQbmiI0q6u9IAoLdYsszSnvo/IwUVE92E877cbMmxXMK7mZv28AldypdyoIZOoYlvPCsqLR3rBdZulEQPwqdtHQNja0h80MomanawAx43O/aNp0nub0C/FPkXrwfNwE9kBfHSClvVfZqMeZyM8rq8eY5/i3cFgrG7eeN05f4FQ== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=itx.no; dkim=pass (1024-bit key; secure) header.d=itx.no header.i=@itx.no header.a=rsa-sha256 header.s=mx.itx.no header.b=mZpfusV7; dkim-atps=neutral; spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=sparclinux+bounces-7302-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=itx.no Authentication-Results: gandalf.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=itx.no header.i=@itx.no header.a=rsa-sha256 header.s=mx.itx.no header.b=mZpfusV7; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=sparclinux+bounces-7302-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4hWdFr597hz4w1Z for <patchwork-incoming@ozlabs.org>; Fri, 28 Aug 2026 22:37:52 +1000 (AEST) Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 14E0F3021B03 for <patchwork-incoming@ozlabs.org>; Fri, 28 Aug 2026 12:37:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA677448B98; Fri, 28 Aug 2026 12:37:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b="mZpfusV7" X-Original-To: sparclinux@vger.kernel.org Received: from mx.itxnorge.no (itx-kvm-14.itxnorge.no [91.189.121.228]) (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 159283CFF61; Fri, 28 Aug 2026 12:37:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.189.121.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787920668; cv=none; b=GbuvDV9anGkTKG8G3nMX4xtlfPAyZTB0p9g2veWmBxtdt/VbsKwdi0Nb/08oXM+q6eH8Yvit813qpsArBRfgmzDXDcR9i324Is4TdPgM2y+VyKMjozmWBQmsnsma2EjjF8CwcrTrug/h2N8PsaLPmms4YBECFrGEYt9NRyFcjqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787920668; c=relaxed/simple; bh=/TNDYjWRFTHxSjGVI7JxoVWwxY5soUI17LJH6Ud5Eek=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I1HcqMseVMDHFHKTUAY6AmsutRjQnHOCVct3DNi3V3q+MTae08qvoSm/UB3E+BmmXTfsnFif1Nfuax0SJmnKF/cYQKZ8ATmYPy8IPDfdf6Uj//bfOUBBXSGMc6/sXjfl6NVXrk7wzmAnIBPVctgvIgeTOoJP5+nty7domavVvo8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=itx.no; spf=pass smtp.mailfrom=itx.no; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b=mZpfusV7; arc=none smtp.client-ip=91.189.121.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=itx.no Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=itx.no From: Stian Halseth <stian@itx.no> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1787920659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FJQFyAYzT5dGvrkkw8+IS0Bzc2SUTqTRZYJ2UjPIrIw=; b=mZpfusV7fTbaVe4L6gugSwZW/NoBOdVM18XCDpdeDCmHG6NX7TR8fWkpOnTp8ZWLY1rv3x psKCV23XOG06nbioBmkAvWY0IxRzG8NwQm+nb71q60jRqpR1Tz/kL4XfIrZnMt8ATSpwJD sPJWL+ShnMMPtsZ1xJZx+++Yz0IiEWM= To: davem@davemloft.net, Andreas Larsson <andreas@gaisler.com> Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, glaubitz@physik.fu-berlin.de, Stian Halseth <stian@itx.no> Subject: [PATCH 2/3] sparc64: use the fault address for si_addr on window fixup faults Date: Fri, 28 Aug 2026 14:37:06 +0200 Message-ID: <20260828123707.1852437-3-stian@itx.no> In-Reply-To: <20260828123707.1852437-1-stian@itx.no> References: <20260828123707.1852437-1-stian@itx.no> Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: <sparclinux.vger.kernel.org> List-Subscribe: <mailto:sparclinux+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:sparclinux+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 |
| Series |
sparc64: fix a window fill fixup lockup and two fault bugs
|
expand
|
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c index e326caf708c6..c37b24f757f4 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c @@ -165,6 +165,15 @@ static void do_fault_siginfo(int code, int sig, struct pt_regs *regs, if (fault_code & FAULT_CODE_ITLB) { addr = regs->tpc; + } else if (fault_code & FAULT_CODE_WINFIXUP) { + /* The fault came from a register window spill or fill, so + * the instruction at regs->tpc is the one being resumed, + * not the access that faulted. Decoding it would fabricate + * an address out of unrelated register contents; the fault + * time provided address is the real one, even if it only + * has page granularity. + */ + addr = fault_addr; } else { /* If we were able to probe the faulting instruction, use it * to compute a precise fault address. Otherwise use the fault
do_fault_siginfo() prefers an address decoded from the instruction at regs->tpc whenever one could be probed, falling back to the fault time address only when it could not. That premise does not hold for a fault taken during a register window spill or fill. There the instruction at regs->tpc is the one being resumed, not the access that faulted, so compute_effective_address() fabricates an address out of unrelated register contents. In one capture it decoded a branch and reported the value it found in %g5 as si_addr. Use the fault time address for FAULT_CODE_WINFIXUP. It may only have page granularity, but it is the address that actually faulted. Fixes: 70ffc6ebaead ("sparc64: Fix top-level fault handling bugs.") Link: https://github.com/sparclinux/issues/issues/87 Signed-off-by: Stian Halseth <stian@itx.no> --- arch/sparc/mm/fault_64.c | 9 +++++++++ 1 file changed, 9 insertions(+)