Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp206840rdb; Tue, 19 Dec 2023 14:08:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+5JjM+1gk6mhA9QtJLSYQNLIhETt9ivSP8KUj/vsy1hbfLfpUaQi/3xyIfP3SonbM01Io X-Received: by 2002:a05:6214:29ee:b0:67f:2b0d:c62 with SMTP id jv14-20020a05621429ee00b0067f2b0d0c62mr9132163qvb.3.1703023696306; Tue, 19 Dec 2023 14:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703023696; cv=none; d=google.com; s=arc-20160816; b=KGb2cy7rxnTr5dQpCav5vgedi1OXsWndD02aV1n/CSnpgPg/zp8RAuexwpQTVm36q9 5o0sEbUrUREJ/0X62kjYrDAsyLM09g7VfsIl5NFQYhOCpMpAMTKK7E5nQQe+vi94dBsn SqDjQUWw+TUOvEXmCYWwl4ZPBPeltWl55Ai12cb9tcaRRQCv7mNqCtD/Qbej8/bIeIDy mcMCuBeQ8xw+nfSTM2PiXL8lEJHzw5CLCzXchWGYk3JzjogK/QfmFYC6p5Ces2gsP2Jd EdUi1SqvEGI5bNLgn92sy17xOCDx1TOLusFHXjFgrtyFIq/n8vGWNpB3/5/MlpSVkyXt uydg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=2LodeX8jHc6XXOsaG9CN1UVx/UnrNAhGUyR0Vn2QJw4=; fh=SqCnl6EpYeke3UsjAgsVdyJ3LjHFQSwkq1HmEohw1Y0=; b=pV9KSI6bGYENotj4VCCRgiNapap+MIpGNzNMQVWmG8Yg8TrlWcQOYmr+8JQsAKKHE5 Hlgq5bau9hwsBwvvP08/Np5JD9oMCFq2QLQLQMT5/78IKjR0+cNzwey6kr694Caiw7eI MIkJYpGJYcW3U2LNGMVYCRVTPJPfQsAYDJxkdD7R1g960UiILfNtkfcBfTbStKBA2m3S DjKnQVXNFmOJuf88Auc6Pc4U5kON3BaJFK5JOSzX374bR/jwhuaBrNfn3c6ZKbXoYsrN CnD+PndWqE97ufEdOORT2awmQIr6tUVOGcgVGvKLUxlvLulzbevEtJSWStgOmjE776WG iceg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FAPqsKcs; spf=pass (google.com: domain of linux-kernel+bounces-6008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u5-20020a0cee85000000b0067eaa4f4de7si25747002qvr.185.2023.12.19.14.08.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 14:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FAPqsKcs; spf=pass (google.com: domain of linux-kernel+bounces-6008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 03E9C1C25182 for ; Tue, 19 Dec 2023 22:08:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C1C24F5E3; Tue, 19 Dec 2023 22:03:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FAPqsKcs" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 49A043D0D9; Tue, 19 Dec 2023 22:03:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id CFD05C433AD; Tue, 19 Dec 2023 22:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703023395; bh=go2X7Puo/mSsLfh/2Z4SXudqW4mEkrXFh2pimTmpnJE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FAPqsKcsrSXE/WTx+4+Q1gqjBLjvCHkGHtHq1Lr5ObaTcJB0ipXQ9kKzsQgSv+/yK rlNuyD6HI/AGbZRDyqwc3Rz/q3tj4co904hiG3EYU2IzSfHplj+jtDVf5SNvM1m9QQ ouCIu4jGLv7vDxcDTBw60elbVe064DKoP6jKFeWbLCfPZJaZoytHqLadRtNQM8ebCx xtoBHIyZsVH7tEjhkPKxJcxv8eoAoIQGnlCPa6zZnzbj8LeSY5WfF71HLyf5Qmf7eD 6Kg4pLWSU4bdguN1Sr2O4Mw5fJuKzoly108Duct0AyQljW0siiyMypspqp5ZypzhHe SDet2HulNF2Qg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6285C41535; Tue, 19 Dec 2023 22:03:15 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Tue, 19 Dec 2023 23:03:12 +0100 Subject: [PATCH 07/27] sparc32: Drop run-time patching of ipi trap Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231219-sam-sparc32-sunset-v3-v1-7-64bb44b598c5@ravnborg.org> References: <20231219-sam-sparc32-sunset-v3-v1-0-64bb44b598c5@ravnborg.org> In-Reply-To: <20231219-sam-sparc32-sunset-v3-v1-0-64bb44b598c5@ravnborg.org> To: "David S. Miller" , Arnd Bergmann , Andreas Larsson Cc: Helge Deller , Alexander Viro , Greg Kroah-Hartman , Alan Stern , Jaroslav Kysela , Takashi Iwai , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1703023392; l=7101; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=tlF0Qzdtgp0HGemO/3+10iER+Qu3gIwXh+jWbYpA4f4=; =?utf-8?q?b=3DMyIGvjJP7bUD?= =?utf-8?q?rXZZtLLpa4qa5DIwBZGuMWmURrw3ibHK+n9qjHJyP0rgnw47bT+8q7WQAU6TRW7C?= pmUpczzCCQStma11zhOnkkUy9FOoVQbElF0QDaqLoLT5MnlqTAO9 X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: From: Sam Ravnborg There is no longer any need for the run-time patching of the ipi trap with the removal of sun4m and sun4d. Remove the patching and drop the ipi implementation for the two machines. The patch includes removal of patching from pcic as this was needed to fix the build. pcic will be removed in a later commit. Signed-off-by: Sam Ravnborg Cc: "David S. Miller" Cc: Arnd Bergmann Cc: Andreas Larsson --- arch/sparc/kernel/entry.S | 70 ++----------------------------------------- arch/sparc/kernel/kernel.h | 4 --- arch/sparc/kernel/leon_smp.c | 3 -- arch/sparc/kernel/pcic.c | 11 ------- arch/sparc/kernel/sun4d_smp.c | 3 -- arch/sparc/kernel/ttable_32.S | 9 +++--- 6 files changed, 7 insertions(+), 93 deletions(-) diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index c6a5cb949381..7cf148a996b9 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S @@ -174,32 +174,6 @@ maybe_smp4m_msg_check_resched: maybe_smp4m_msg_out: RESTORE_ALL - .align 4 - .globl linux_trap_ipi15_sun4m -linux_trap_ipi15_sun4m: - SAVE_ALL - sethi %hi(0x80000000), %o2 - GET_PROCESSOR4M_ID(o0) - sethi %hi(sun4m_irq_percpu), %l5 - or %l5, %lo(sun4m_irq_percpu), %o5 - sll %o0, 2, %o0 - ld [%o5 + %o0], %o5 - ld [%o5 + 0x00], %o3 ! sun4m_irq_percpu[cpu]->pending - andcc %o3, %o2, %g0 - be sun4m_nmi_error ! Must be an NMI async memory error - st %o2, [%o5 + 0x04] ! sun4m_irq_percpu[cpu]->clear=0x80000000 - WRITE_PAUSE - ld [%o5 + 0x00], %g0 ! sun4m_irq_percpu[cpu]->pending - WRITE_PAUSE - or %l0, PSR_PIL, %l4 - wr %l4, 0x0, %psr - WRITE_PAUSE - wr %l4, PSR_ET, %psr - WRITE_PAUSE - call smp4m_cross_call_irq - nop - b ret_trap_lockless_ipi - clr %l6 .globl smp4d_ticker /* SMP per-cpu ticker interrupts are handled specially. */ @@ -220,44 +194,6 @@ smp4d_ticker: WRITE_PAUSE RESTORE_ALL - .align 4 - .globl linux_trap_ipi15_sun4d -linux_trap_ipi15_sun4d: - SAVE_ALL - sethi %hi(CC_BASE), %o4 - sethi %hi(MXCC_ERR_ME|MXCC_ERR_PEW|MXCC_ERR_ASE|MXCC_ERR_PEE), %o2 - or %o4, (CC_EREG - CC_BASE), %o0 - ldda [%o0] ASI_M_MXCC, %o0 - andcc %o0, %o2, %g0 - bne 1f - sethi %hi(BB_STAT2), %o2 - lduba [%o2] ASI_M_CTL, %o2 - andcc %o2, BB_STAT2_MASK, %g0 - bne 2f - or %o4, (CC_ICLR - CC_BASE), %o0 - sethi %hi(1 << 15), %o1 - stha %o1, [%o0] ASI_M_MXCC /* Clear PIL 15 in MXCC's ICLR */ - or %l0, PSR_PIL, %l4 - wr %l4, 0x0, %psr - WRITE_PAUSE - wr %l4, PSR_ET, %psr - WRITE_PAUSE - call smp4d_cross_call_irq - nop - b ret_trap_lockless_ipi - clr %l6 - -1: /* MXCC error */ -2: /* BB error */ - /* Disable PIL 15 */ - set CC_IMSK, %l4 - lduha [%l4] ASI_M_MXCC, %l5 - sethi %hi(1 << 15), %l7 - or %l5, %l7, %l5 - stha %l5, [%l4] ASI_M_MXCC - /* FIXME */ -1: b,a 1b - .globl smpleon_ipi .extern leon_ipi_interrupt /* SMP per-cpu IPI interrupts are handled specially. */ @@ -618,11 +554,11 @@ sun4m_nmi_error: #ifndef CONFIG_SMP .align 4 - .globl linux_trap_ipi15_sun4m -linux_trap_ipi15_sun4m: + .globl linux_trap_ipi15_leon +linux_trap_ipi15_leon: SAVE_ALL - ba sun4m_nmi_error + ba sun4m_nmi_error nop #endif /* CONFIG_SMP */ diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h index c8ba3bc7e137..1d3980ac0658 100644 --- a/arch/sparc/kernel/kernel.h +++ b/arch/sparc/kernel/kernel.h @@ -134,10 +134,6 @@ void leonsmp_ipi_interrupt(void); void leon_cross_call_irq(void); /* head_32.S */ -extern unsigned int t_nmi[]; -extern unsigned int linux_trap_ipi15_sun4d[]; -extern unsigned int linux_trap_ipi15_sun4m[]; - extern struct tt_entry trapbase; extern struct tt_entry trapbase_cpu1; extern struct tt_entry trapbase_cpu2; diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 991e9ad3d3e8..42820c7422dd 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c @@ -463,8 +463,5 @@ static const struct sparc32_ipi_ops leon_ipi_ops = { void __init leon_init_smp(void) { - /* Patch ipi15 trap table */ - t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_leon - linux_trap_ipi15_sun4m); - sparc32_ipi_ops = &leon_ipi_ops; } diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 25fe0a061732..d952bcbbc395 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -354,17 +354,6 @@ int __init pcic_probe(void) prom_getstring(node, "name", namebuf, 63); namebuf[63] = 0; strcpy(pbm->prom_name, namebuf); - { - extern int pcic_nmi_trap_patch[4]; - - t_nmi[0] = pcic_nmi_trap_patch[0]; - t_nmi[1] = pcic_nmi_trap_patch[1]; - t_nmi[2] = pcic_nmi_trap_patch[2]; - t_nmi[3] = pcic_nmi_trap_patch[3]; - swift_flush_dcache(); - pcic_regs = pcic->pcic_regs; - } - prom_getstring(prom_root_node, "name", namebuf, 63); namebuf[63] = 0; { struct pcic_sn2list *p; diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 9a62a5cf3337..be5bcbee1af4 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c @@ -403,9 +403,6 @@ void __init sun4d_init_smp(void) { int i; - /* Patch ipi15 trap table */ - t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m); - sparc32_ipi_ops = &sun4d_ipi_ops; for (i = 0; i < NR_CPUS; i++) { diff --git a/arch/sparc/kernel/ttable_32.S b/arch/sparc/kernel/ttable_32.S index e79fd786fbbb..78bbf2548e1f 100644 --- a/arch/sparc/kernel/ttable_32.S +++ b/arch/sparc/kernel/ttable_32.S @@ -43,8 +43,7 @@ t_irq12:TRAP_ENTRY_INTERRUPT(12) /* IRQ Zilog serial chip */ t_irq13:TRAP_ENTRY_INTERRUPT(13) /* IRQ Audio Intr. */ t_irq14:TRAP_ENTRY_INTERRUPT(14) /* IRQ Timer #2 */ - .globl t_nmi -t_nmi: TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m) +t_nmi: TRAP_ENTRY(0x1f, linux_trap_ipi15_leon) t_racc: TRAP_ENTRY(0x20, do_reg_access) /* General Register Access Error */ t_iacce:BAD_TRAP(0x21) /* Instr Access Error */ @@ -146,7 +145,7 @@ trapbase_cpu1: TRAP_ENTRY_INTERRUPT(9) TRAP_ENTRY_INTERRUPT(10) TRAP_ENTRY_INTERRUPT(11) TRAP_ENTRY_INTERRUPT(12) TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14) - TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m) + TRAP_ENTRY(0x1f, linux_trap_ipi15_leon) TRAP_ENTRY(0x20, do_reg_access) BAD_TRAP(0x21) BAD_TRAP(0x22) @@ -245,7 +244,7 @@ trapbase_cpu2: TRAP_ENTRY_INTERRUPT(12) TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14) - TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m) + TRAP_ENTRY(0x1f, linux_trap_ipi15_leon) TRAP_ENTRY(0x20, do_reg_access) BAD_TRAP(0x21) BAD_TRAP(0x22) @@ -345,7 +344,7 @@ trapbase_cpu3: TRAP_ENTRY_INTERRUPT(12) TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14) - TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m) + TRAP_ENTRY(0x1f, linux_trap_ipi15_leon) TRAP_ENTRY(0x20, do_reg_access) BAD_TRAP(0x21) BAD_TRAP(0x22) -- 2.34.1