Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp297256lqk; Sat, 9 Mar 2024 10:21:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWV3M2g1OUYZfrI8O8eqpeZ42VCcgCg5V5pvZGn4r0jRjoeqZzM49NNTvgl9vTaQk/1ACRFDMp4TO6/RzzgOkr6itUHYgN4av5wp20bow== X-Google-Smtp-Source: AGHT+IHi1zBVL1mg6RYF5PP+u2uZzm5kJxy4bZZFkgl2GEgklAxId0gorC3oofCjoapLDU7nMfAa X-Received: by 2002:a17:903:2409:b0:1dc:c59d:5dde with SMTP id e9-20020a170903240900b001dcc59d5ddemr3660990plo.59.1710008488253; Sat, 09 Mar 2024 10:21:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710008488; cv=pass; d=google.com; s=arc-20160816; b=mUP061TKBfTbSpt9/rCuASfY5R/x8JTPpMaeH7qyaQIjFsGna1v19vFUEpdRiSWOgC BBvtVgNv01xWFHuJ/ReNf8GQnz9RrbzEIx6ta6OTimWpF31F+caWjADOYaIkxRsFs63T eMq72AhgalphvxJat0EXunTkBNeFrWNAeilqsZPv9x+cyNOp70YBMlJ4e1etBpV4oOhE prF9XzwSBJEnw4v2owRYihacj1/FB9daZoAOWiMStzT62bNJx7JuM+xdiqApDC/YazEu 36jnWjbXdVmYDLARHPpbz4V96MXb/jrBPmjpVQIN1Stuk7rBlXZg6nzjewJykmkxoIXA 4pRg== ARC-Message-Signature: i=2; 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=52nhLet6qw1rFK/k1PzoAe9vPginv+Diof2Y0Ti8bgQ=; fh=SaCKpm3xykZypka9yeSnW1lA8kCGqHGDhgsETBWijhw=; b=T+Gn4b1QZeqfs9wr0oVvw0uCq7rdv4cA2yOHyu+9de0EgSV6J0dzhW6DCyTXyn/Vyb JKnQFurEnaeaLTNx6s1r4kNP15gh5zx2EpkbuJEAGCWIEGMY14jRPXKjE2gAsV8JMn2B 6N+sYyz429Vhf+L+293s0aicj9fWVCuKB4WEFWCmfvuJz4Vs077R6bljOB4sTAxJCQYm 3b5D33ZbWNMb/MlIDDnsLVsTDhNhBscSzhSUvMbPviMaruR6sics/OkOU37auEla7iSg DdRmSUu37Djoj39soJpY7QKNmVY+qm5Zl37tWJ+PvAlsuLQ+BvWnYcGYsw6v7Jjx8LY7 LdbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ohxGrzV8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97993-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t20-20020a170902d29400b001dcfadc1cffsi1677856plc.392.2024.03.09.10.21.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 10:21:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ohxGrzV8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97993-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E87B4281477 for ; Sat, 9 Mar 2024 18:21:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 163A3605CA; Sat, 9 Mar 2024 18:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ohxGrzV8" 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 CE215495CB; Sat, 9 Mar 2024 18:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710008149; cv=none; b=B/420UwsdcWlqGo6ih1UcP7E/78uemuZPMKMTJ/gW2stREeDlLVmUwDhOEKKQnQq0ITwxBDHt1WIfpkXBJimtIS8ANwmm4xtpVAAp8X8wVLh7Pn0yXO0knuD0vpf2p7rpWAidHqijlzwkhcnuHDonm4AsH4eToarLnbzw4ZyQxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710008149; c=relaxed/simple; bh=gN/Ux84r26F4SIDmLoJJKxRQzomkv5eOdwj3wuiudB0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SRSLNlzqn53c1HxDpFxgdclsA4GtIShrq6zP0zVvDSMPa7BvpeSfgL3rgRgJjH+ztKJsBlE51C6KYy2vJVKhNR5FWnWiX1RZM7j8yw2ETliP8DQ+VKk0eaaS4rvVXUqderu5aOk/W7d5Bg2Ty/itE8mAYxDC3Vkmq8y+FI0n3nU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ohxGrzV8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id A9CBEC41613; Sat, 9 Mar 2024 18:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710008149; bh=gN/Ux84r26F4SIDmLoJJKxRQzomkv5eOdwj3wuiudB0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ohxGrzV8A8ttDa+X45jbG6/LLg3B/15gZawQKrWsWsKw6ZYTUtDVzxd7yRquRrroT FTImCR63ODZ/19tcyby6EEwbIkqAhB9Vo/+K8klH+KMEM7bjE/DcYU4A1f+b2lzdsH lY+/bjJmCRQdoJDwsDA4Gy38sz4WoBxLdrnK9CRzefjd8aqmNYBvAmIQSZHPX73WZ0 Ck5jSytkASf/qmZ0NlyHNBCsaAEYcbGD3OgOClfY10TReQAYPBzd9jj5iUgf32AhC5 iLB6SvUCETWm5ydZiW4NsMbbmWJ/rE3G10RvVq79jOPUxmlxiA11ItKWDlax9mIyke jyrRUCmMQjgmw== 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 983DDC54E64; Sat, 9 Mar 2024 18:15:49 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 09 Mar 2024 19:15:38 +0100 Subject: [PATCH v2 17/28] sparc32: Drop run-time cpuid patching 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: <20240309-sunset-v2-17-f09912574d2c@ravnborg.org> References: <20240309-sunset-v2-0-f09912574d2c@ravnborg.org> In-Reply-To: <20240309-sunset-v2-0-f09912574d2c@ravnborg.org> To: "David S. Miller" , Arnd Bergmann , Andreas Larsson Cc: Helge Deller , Randy Dunlap , John Paul Adrian Glaubitz , Mark Cave-Ayland , Kjetil Oftedal , Thomas Zimmermann , 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=1710008145; l=3320; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=WR8i3LCeKk7owTDWXkof95pLgCJqOcU2bM6i301Ih2U=; =?utf-8?q?b=3DVjlQ98TX1IGm?= =?utf-8?q?687O50jMVaij7sN1LUtJUqv1Eywc/sYeED2dOJcakgTZ+E+KOnHFZ2Rko3l1qDQN?= PQqmaoJ9BDRqL2xIwfwVqMl5df8diD7bJ7hbGduAjzZw7rQ64ZMH 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 The CPU is always leon, so the run-time cpuid patching is no longer required. Signed-off-by: Sam Ravnborg Reported-by: Andreas Larsson Cc: "David S. Miller" Cc: Arnd Bergmann Cc: Andreas Larsson --- arch/sparc/include/asm/winmacro.h | 12 ------------ arch/sparc/kernel/entry.S | 13 ------------- arch/sparc/kernel/setup_32.c | 31 ------------------------------- 3 files changed, 56 deletions(-) diff --git a/arch/sparc/include/asm/winmacro.h b/arch/sparc/include/asm/winmacro.h index b6e911f5d93c..16144900bd6c 100644 --- a/arch/sparc/include/asm/winmacro.h +++ b/arch/sparc/include/asm/winmacro.h @@ -105,21 +105,9 @@ #ifdef CONFIG_SMP #define LOAD_CURRENT(dest_reg, idreg) \ -661: rd %tbr, %idreg; \ - srl %idreg, 10, %idreg; \ - and %idreg, 0xc, %idreg; \ - .section .cpuid_patch, "ax"; \ - /* Instruction location. */ \ - .word 661b; \ - /* SUN4D implementation. */ \ - lda [%g0] ASI_M_VIKING_TMP1, %idreg; \ - sll %idreg, 2, %idreg; \ - nop; \ - /* LEON implementation. */ \ rd %asr17, %idreg; \ srl %idreg, 0x1c, %idreg; \ sll %idreg, 0x02, %idreg; \ - .previous; \ sethi %hi(current_set), %dest_reg; \ or %dest_reg, %lo(current_set), %dest_reg;\ ld [%idreg + %dest_reg], %dest_reg; diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index 0f2417ee3f95..f158cbca3e62 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S @@ -984,21 +984,8 @@ flushw_all: #ifdef CONFIG_SMP ENTRY(hard_smp_processor_id) -661: rd %tbr, %g1 - srl %g1, 12, %o0 - and %o0, 3, %o0 - .section .cpuid_patch, "ax" - /* Instruction location. */ - .word 661b - /* SUN4D implementation. */ - lda [%g0] ASI_M_VIKING_TMP1, %o0 - nop - nop - /* LEON implementation. */ rd %asr17, %o0 srl %o0, 0x1c, %o0 - nop - .previous retl nop ENDPROC(hard_smp_processor_id) diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 0f38d72aae2d..af5f143ed882 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -178,34 +178,6 @@ extern int root_mountflags; char reboot_command[COMMAND_LINE_SIZE]; -struct cpuid_patch_entry { - unsigned int addr; - unsigned int sun4d[3]; - unsigned int leon[3]; -}; -extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end; - -static void __init per_cpu_patch(void) -{ - struct cpuid_patch_entry *p; - - p = &__cpuid_patch; - while (p < &__cpuid_patch_end) { - unsigned long addr = p->addr; - unsigned int *insns; - - insns = &p->leon[0]; - *(unsigned int *) (addr + 0) = insns[0]; - flushi(addr + 0); - *(unsigned int *) (addr + 4) = insns[1]; - flushi(addr + 4); - *(unsigned int *) (addr + 8) = insns[2]; - flushi(addr + 8); - - p++; - } -} - static __init void leon_patch(void) { /* Default instruction is leon - no patching */ @@ -271,9 +243,6 @@ void __init setup_arch(char **cmdline_p) (*(linux_dbvec->teach_debugger))(); } - /* Run-time patch instructions to match the cpu model */ - per_cpu_patch(); - paging_init(); smp_setup_cpu_possible_map(); -- 2.34.1