From patchwork Tue Sep 29 03:43:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stian Halseth X-Patchwork-Id: 2313340 Return-Path: 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=JwMwoNtc; 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=m9p3=hv=vger.kernel.org=sparclinux+bounces-8133-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 4hvKFj2dxvz1y1S for ; Tue, 29 Sep 2026 23:46:00 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4hvKF7232Zz4w2b for ; Tue, 29 Sep 2026 23:45:31 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4hvKF71wd6z4wSn; Tue, 29 Sep 2026 23:45:31 +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=1790689531; cv=pass; b=osLmoYaa9Ve2M+NYfyW/eshLNA0f7pi5cNMn6fA9Onkq3WibMG+dFHM+hLfvjTU4fsK7kRC4kVSwjidel1agaUNM0fB2dUX5BVCfszgpQsFn9BV1/y7H7H+0Bpd+uj7CSwhginb8YChLnekKMokfN3/uYTruD2r5UKrsTRppDdn6cBnpd/0WS7qV7b8LNcV3oXRW36lPZcrqf8aFvdrRLW1ehIdSikGX/V0LWM0El0V1y33T9ptkkdgWBOHFGxVlBREHlwnejjI1mTaqUQNmdrI5Z2XmKihRdufETAt+yXhDAQsuvzyxJA95stMxyVZNedS2S/PR1IEdziVwj2sf3Q== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790689531; c=relaxed/relaxed; bh=CbHEMeGnBGEuY25BHoYPpmffIcMnF1AI43jCvvuHYJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d9UhR5ikqSU7/6KA51SeiWzY4kTiUGzdCWSzOcaeVj3s7XewHRYjfzFmJjwM4MsTVPfX+uReoghIenXmq6msmT5F/YzpwdHBmXnG63DeQzv33lOid0yhJYOaIwXMS4pqwIrUfAMww3Zy9CmyThGWTDHKZyy6OU/fYH1UqQGpVoGuF0i5QB20JPAM2w2rhTGJz0oqQWvLxtoOaEU6aNBMctNBaiXjdxlHFqUDLBA2nKcSlSka9qcmknbLSoKGtpUoyjcbRoQWMii5T5hWq6cJmajZ24ezVGki7qR0lidp5ljS3U0hdQCiUZIBGF//CCf0RPcvU+iL+0cMw1kwFXQ7QA== 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=JwMwoNtc; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8133-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=JwMwoNtc; 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-8133-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 4hvKF35LTbz4wKj for ; Tue, 29 Sep 2026 23:45:27 +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 15B9B2F0E3 for ; Tue, 29 Sep 2026 13:44:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C15952CCD2; Tue, 29 Sep 2026 13:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b="JwMwoNtc" 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 4A2695237AE; Tue, 29 Sep 2026 13:44:04 +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=1790689446; cv=none; b=BkqqTxVn98K7zLonEVlVKUOCwrqqLavyH720ckh6LKALYbEokT2KDEwqBKiQ62bD9L2q1IgBt3KqHI8RnBOWdDml0yH0XWAewEQIx/kwR1oEhpQFmYVafNNhB053RDtR0AYt0SeYhfZzSdm1DU19olyUmKL9Z6QAHfAfz4qe7os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790689446; c=relaxed/simple; bh=biTdxv5uh5RpdcHGsKu6LKXJxolTlezVqsYDj8JfbxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pCZTckIU0/oo0McLuFKl5axubUjQsIxtlJagcjly5mxlGz00Iooqb3oN/W+6ihwrJk26RkESXg7dHOHgIIdpeb620EJe1x9bV14+2YJkkhWrJ2pO257oExHyyB+RHUOWQemXSNYQGcmzK/WdXMOOjQ/0sEGNz1SW+Gihl6nPk7Y= 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=JwMwoNtc; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1790689442; 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=CbHEMeGnBGEuY25BHoYPpmffIcMnF1AI43jCvvuHYJM=; b=JwMwoNtcmum6rlA8ooQRDZhQk5QpWIGRxs3SQI8QY2WbM7Wm6Hzk09rmq1NklqmjD46Vbr HXHo5aL4Q0ekhRXNz++K83cuVxfN6cIS1DjJ0tlXFRRBJPDtRsah7yaVfLFsgLgOWzhPc3 SzUd9JWM4+ddIcbaGar6QxwzDWC2aO0= To: "David S . Miller" , Andreas Larsson Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Stian Halseth Subject: [PATCH 1/5] sparc64: Report unrecognised machine description hwcap-list entries Date: Tue, 29 Sep 2026 15:43:49 +0200 Message-ID: <20260929134353.3879030-2-stian@itx.no> In-Reply-To: <20260929134353.3879030-1-stian@itx.no> References: <20260929134353.3879030-1-stian@itx.no> 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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,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 mdesc_cpu_hwcap_list() matches each string in the cpu node's hwcap-list against hwcaps[] and crypto_hwcaps[]. A string that matches neither is skipped silently, so firmware can advertise a capability the kernel has no name for and nothing reports it. A SPARC T7-1 (M7) emits 28 entries, of which eight match nothing: vis3b pause-nsec mwait sparc5 cfr mont xmpmul xmont Print the ones that are not recognised. Signed-off-by: Stian Halseth --- arch/sparc/kernel/setup_64.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 63615f5c99b47..8ed65ad0e6081 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -488,20 +488,28 @@ static unsigned long __init mdesc_cpu_hwcap_list(void) while (len) { int i, plen; + bool known = false; for (i = 0; i < ARRAY_SIZE(hwcaps); i++) { unsigned long bit = 1UL << i; if (hwcaps[i] && !strcmp(prop, hwcaps[i])) { caps |= bit; + known = true; break; } } for (i = 0; i < ARRAY_SIZE(crypto_hwcaps); i++) { - if (!strcmp(prop, crypto_hwcaps[i])) + if (!strcmp(prop, crypto_hwcaps[i])) { caps |= HWCAP_SPARC_CRYPTO; + known = true; + } } + if (!known) + pr_info("CPU CAPS: unknown hwcap-list entry '%s'\n", + prop); + plen = strlen(prop) + 1; prop += plen; len -= plen; From patchwork Tue Sep 29 03:43:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stian Halseth X-Patchwork-Id: 2313343 Return-Path: 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=oIc1fdhg; 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=rovq=hv=vger.kernel.org=sparclinux+bounces-8132-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 4hvKFn4RPhz1y1S for ; Tue, 29 Sep 2026 23:46:05 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4hvKF725hbz4wSn for ; Tue, 29 Sep 2026 23:45:31 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4hvKF71yFlz4wKj; Tue, 29 Sep 2026 23:45:31 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=172.105.105.114 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790689531; cv=pass; b=EQ5AHjAsPv4BZUu+S5uGnmDcj4fdlUQazXS34FkRUBioAZ3QXWAhBhYkPkHrdm2vxD/gZvSzn+/g9b0xL6Nafrc/z407qY8aLVbzCcA5XeIQGAAsbbQmG/D7hP+hTsPe6N5+nT7cL0tqCZ1yCHteV3Y+DdhI+zaoEmBhHF9L+Meo36CTz9sXnF72wynYKpFmh907UFn4yL5GaSAZMWo6fTUR77lqIqwWJygH2DFIlfEA/xKJqBT61B4nhFsb4l6spIdD0XiO0ZGTYm07V+RdT9aSX1l3/+h6q4q/F+gb4v3hhrm/mDLrhINOaKjIRbn/i1J5zlLGTRs/PdgrDI8N5w== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790689531; c=relaxed/relaxed; bh=ZSHoR/nRUuVPLYyyleN3slwW8taNuQbKVWyFd4qCXmQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iF89EDcToN+MT4pCsMwAOiRn3xx342cPTw58nDzU0veWBtOCZWbin/XjqoFC1XOvC09QKGbmLZVvPF6qFUKP20xNz7nt9qDxGksxj1hIknr5FNJ9NlmgRUj0zMftfeRRuY1IJNulnBCB4LByGX6oDWBJ8zG4w+KZac9ekxYHV9Wqu0SFNLVMcAkGRvoMDTlzdvvH+VZ2SvIgfn01KH4K6hxikf1hsj5ORNwmO1Wl6KPwyKYBtVsCYPKkVPvgUuknTWwGEHwWQ5pS/GcV16lE4cHw0ujsxkz63oqHk6RNq/M3qDxwZFSAjyrQpmYToZGJDFnpg1XjBt2m2DOdex5Hvw== 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=oIc1fdhg; dkim-atps=neutral; spf=pass (client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8132-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=oIc1fdhg; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8132-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) (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 4hvKF10KCDz4w2b for ; Tue, 29 Sep 2026 23:45:25 +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 3909E2EF5E for ; Tue, 29 Sep 2026 13:44:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3105152CCC3; Tue, 29 Sep 2026 13:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b="oIc1fdhg" 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 4A0A550EBFE; Tue, 29 Sep 2026 13:44:04 +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=1790689446; cv=none; b=LEH7OJA1y/l1gdt0mzE4+qKnjxfchSiimxF9TxzyTPs4BGp6IEvx441BKrwzgB4kL2BryOi6vdw7SsmRTdf5cpbVCBFm7N5cchoUif+PWDMzzjpGpGlMYhmKxENTE4Dx4IitDxery4QD7GozSh4vjD3Ri6QEb5YnEab5iPXdKe0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790689446; c=relaxed/simple; bh=N3GKe8jMHvYD+swhXPAL1qad5N0QDrikHieoWGqYX34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EfBLoPAXihktKqrxx1yoK2/xLu7VLFQPKOa0EODiZQrbG7kWqaxSLQzP6A4rO1eKukJNiu7UMFkVEzbrxpzflnKjoFJoCy0Oxr5Ogs9/Q3FjWkm0DWel8vCgK+vV3JKa+r3DJ3T+zV58pPs4ULN42SC3mE0MqHW9X5uioS2c1rw= 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=oIc1fdhg; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1790689442; 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=ZSHoR/nRUuVPLYyyleN3slwW8taNuQbKVWyFd4qCXmQ=; b=oIc1fdhgtrX/PRAe9WH08JxQtvoRuFfxZVXvIrChDISzYgm5b+hw8nPK9fgrDWMIpSveLw km1G6QhX92C40DBwPlc7+Ey0j6frIHR0+XsH+pBfysrjKHG9hq8p28rzn/XeppgzIsfaeR Gvvgtcm9ZS2ugp8d1YogBgwQqOkPNXc= To: "David S . Miller" , Andreas Larsson Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Stian Halseth Subject: [PATCH 2/5] sparc64: Add the M7 capabilities carried in the hwcap-list Date: Tue, 29 Sep 2026 15:43:50 +0200 Message-ID: <20260929134353.3879030-3-stian@itx.no> In-Reply-To: <20260929134353.3879030-1-stian@itx.no> References: <20260929134353.3879030-1-stian@itx.no> 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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,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 A SPARC M7's machine description names four capabilities the kernel does not know, so they never reach AT_HWCAP: vis3b pause-nsec mwait sparc5 Add them. hwcaps[] is indexed by bit position and only ever appended to, so the four names take indices 28 to 31, in the order the machine description lists them. That fixes their bit values. Read from /dev/mdesc on a SPARC T7-1, where all 256 cpu nodes carry an identical hwcap-list. Closes: https://github.com/sparclinux/issues/issues/17 Signed-off-by: Stian Halseth --- arch/sparc/include/asm/elf_64.h | 8 ++++++++ arch/sparc/kernel/setup_64.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h index 694ed081cf8d9..714ca79c88d7e 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h @@ -99,6 +99,14 @@ #define HWCAP_SPARC_CRYPTO 0x04000000 /* CRYPTO insns available */ #define HWCAP_SPARC_ADI 0x08000000 /* ADI available */ +/* Linux has only AT_HWCAP, so these continue the single word. They are + * ABI: a bit once assigned cannot be moved. + */ +#define HWCAP_SPARC_VIS3B 0x10000000 /* VIS3B insns available */ +#define HWCAP_SPARC_PAUSE_NSEC 0x20000000 /* PAUSE has nanosecond granularity */ +#define HWCAP_SPARC_MWAIT 0x40000000 /* MWAIT available */ +#define HWCAP_SPARC_SPARC5 0x80000000 /* SPARC5 insns available */ + #define CORE_DUMP_USE_REGSET /* diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 8ed65ad0e6081..d819ce65d1d44 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -387,7 +387,7 @@ static const char *hwcaps[] = { "mul32", "div32", "fsmuld", "v8plus", "popc", "vis", "vis2", "ASIBlkInit", "fmaf", "vis3", "hpc", "random", "trans", "fjfmau", "ima", "cspare", "pause", "cbcond", NULL /*reserved for crypto */, - "adp", + "adp", "vis3b", "pause-nsec", "mwait", "sparc5", }; static const char *crypto_hwcaps[] = { From patchwork Tue Sep 29 03:43:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stian Halseth X-Patchwork-Id: 2313344 Return-Path: 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=M/BObsxp; 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=uo80=hv=vger.kernel.org=sparclinux+bounces-8135-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) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hvKGC1Nglz1y1S for ; Tue, 29 Sep 2026 23:46:27 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4hvKFd6PPVz4w2b for ; Tue, 29 Sep 2026 23:45:57 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4hvKFd6Lmrz4wKj; Tue, 29 Sep 2026 23:45:57 +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=1790689557; cv=pass; b=xL2076ReSX1eGumbR5Tri/KLBIvYhMUL93dn3ZE+ctXAk3E9xc0Kq4V3VBMwK6+YwMcvomYBeRXL8ohvwHD8+yf1qiwdxIBmMHmO4TJLPfr6eYUSKLS1CZEBAOINptV+A31gNCGlgxOVuR7RIsOT6MwWL9tqiGXEW1P3VJfJ5Ihbl2r74VZiUwlhvJRkIOD8XcPWrE4avQJligluD4yXGDvovCTQarUlMFtIm2DF22F9nXokUgKGrOgyJIHEP8whg0z1Z4bk3U7l2KGAOVi+6ombzmW4wiurgYSG0Xc0MONInWQG9FGuZhlsi6vAVPXB3QtT/UvwSBBF7FYFM3GfZA== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790689557; c=relaxed/relaxed; bh=dco2wntbp7gwZCwHul/J8+TIvApIUknJKKkQup4QQJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TJyycOT+/a6eXlQBmDRHiR1267KYAmbuxbicjQioWls0BWJTtzFrT2MZq50hwtrFPRZEmMgjUq/BF8BH5Z1YePpWFWr6lgekDXIWyDXBjLawiLFrQOZtO/ADvTYd5b5wXuZs9l6ZujyesTR5hwhi2nu2OODipFAvRo1ZRgg2oECYkxEEPesWgsqMvqUobUK3fgF4tAN4JumAvuAPgiObd3HF22cpXG9okUGZx9CaVupuOHAbNKNDrpJTgVKv4NY+PUNmBXNpEWsZjgLbcYviX3tY3ma9zggkdJXZDNEOBB5NsQ+Y1LvjrhTRyhwITJibzCeslEuEu72/gkTvNepplw== 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=M/BObsxp; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8135-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=M/BObsxp; 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-8135-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 4hvKFZ1rvDz4w2b for ; Tue, 29 Sep 2026 23:45:54 +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 7E10F3A383 for ; Tue, 29 Sep 2026 13:44:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31AA852CCFE; Tue, 29 Sep 2026 13:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b="M/BObsxp" 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 4A41B529414; Tue, 29 Sep 2026 13:44:04 +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=1790689447; cv=none; b=mt7ifZ3JQVTkNCv+CKbCYrbZ3NLl6DlM27aDu6FaRquHoVjQBs0BLub1KyvRR1l26AYhV/YizVVlOLmSr8V5UAo/NrAgzk9TdZHt8x9tCkGVuNFgOKcRzh0m5hE8dTV7SI5/XnuSfWg7K5Kj/ZdS1gK669flT8X7FSz216nAeIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790689447; c=relaxed/simple; bh=Fpn03qimaoke8YGvS4OLP3GU5bRQ4qiAf3HiLvseimQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TMHycAD6TWLJeJtvWsYpYUY/WHBL+s7sYypyxiCT0Y3CBmH/S0YPO7HF5UI94HFdYVkAHGbbYlasGsx+PHNeXwxlahI1z8K9wS0pdJgDKy3NdrUZjXWoaU8uPaGnyO7Y6GDTYVCpp++o7GA7phT9KFw+MkFMk042AwhjlVBvP6U= 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=M/BObsxp; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1790689442; 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=dco2wntbp7gwZCwHul/J8+TIvApIUknJKKkQup4QQJs=; b=M/BObsxp4FBnyYOcTucsftDcE0uvYsrxnFbcRgdxUa+gv9IzRY2hXf/11Nh7P2qsIXysC3 KMgcRiaiinOcT7Bvmd/UQ/fdIZG1WKhw9TiGVn1gc9tJ1UryMDE9yCDAxoUxmrDzZmU6GX uifUtX4DJXsZMXYVO1t4BXqClafxO6U= To: "David S . Miller" , Andreas Larsson Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Stian Halseth Subject: [PATCH 3/5] sparc64: Report the extended crypto capabilities Date: Tue, 29 Sep 2026 15:43:51 +0200 Message-ID: <20260929134353.3879030-4-stian@itx.no> In-Reply-To: <20260929134353.3879030-1-stian@itx.no> References: <20260929134353.3879030-1-stian@itx.no> 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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,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 crypto_hwcaps[] is indexed by CFR bit and stops at crc32c in bit 11. The loops in cpucap_info() and report_crypto_hwcaps() are bounded by the array, so a higher bit is read out of CFR and then discarded. A SPARC M7 sets CFR bits 12 to 14. Name them. T7-1 CFR 0x7ffb bits 0-14 except kasumi, so 12-14 are set T4-1 CFR 0x0fff bits 0-11, unchanged by this patch Signed-off-by: Stian Halseth --- arch/sparc/kernel/setup_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index d819ce65d1d44..71d30b3bf276f 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -393,6 +393,7 @@ static const char *hwcaps[] = { static const char *crypto_hwcaps[] = { "aes", "des", "kasumi", "camellia", "md5", "sha1", "sha256", "sha512", "mpmul", "montmul", "montsqr", "crc32c", + "xmpmul", "xmontmul", "xmontsqr", }; void cpucap_info(struct seq_file *m) From patchwork Tue Sep 29 03:43:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stian Halseth X-Patchwork-Id: 2313345 Return-Path: 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=EvejGk96; 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=2thc=hv=vger.kernel.org=sparclinux+bounces-8136-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) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hvKGH5rD4z1y1S for ; Tue, 29 Sep 2026 23:46:31 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4hvKFk3mR1z4w2b for ; Tue, 29 Sep 2026 23:46:02 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4hvKFk3j06z4wKj; Tue, 29 Sep 2026 23:46:02 +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=1790689562; cv=pass; b=FL16o8JuBVJuZX1XUS/tB6AEc0Bon9PILFeBbdiYX9C7mGLFqk3Hy0jawHy0ycZUrMY7U3G5RP/q9Cwr3ucp0Tt51HMPX3XPCV7g2Zikfh3SqmSw5cF+EvyIZiIFgqPvyjFC05ui7YeKZ8sG1cb5Na7GgJ2ADF6RCHt0dxK6coGl1qLLvoS2pvu15rtKu/ZIK2q65rW51ClAxSgIBD/14L7lHlIJIvBKEljR3JG4ke8FdCOy06f3tp/DEcVy1yZS7x9qLi3yurhTs11Z9VcIAoB6kQqsCRjQZhDsTdrawksWj2cgEcLkMZ7NzC9FRj0rMdiAew3/qdMR4bvvVSkcZg== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790689562; c=relaxed/relaxed; bh=adL1F/nYZDGIVACVvafixgvFG5DK1XHCfv0m2eLuaLs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nk+YVmgdCniLkEMdFEyEIZ8LOyz/WLFQCnc6k5m1CgqeuAPqA5y8z7V+Ag5oAEfhwrisT+PZ7+e9oTi57kT5g5sWdobMyoSnEhjU855Y3FXuHF9cRjhqGv2tlUYEfl3lLsKByhYW24rwxX/CNTFUmdj1c4YiuKT3HcLTUzLEIXxE29KTbZtXD+Ufbd8uNWkebDv/j6SuN9sZqwlC0lfNddWW96YVKnR4tzHbaQKJmY52q64BRe3CWtD1VUD6oKf9J5Mq0KczHf9ZqTMVFzx4ZSnwc8udBaYO8Rnk0tiFXy6SvB9AEwkRda3YNaXbPFDRVMXstuAgicR0lNebYAQ32g== 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=EvejGk96; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org; envelope-from=sparclinux+bounces-8136-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=EvejGk96; 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-8136-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 4hvKFg1DsVz4w2b for ; Tue, 29 Sep 2026 23:45:59 +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 85EB53A5A1 for ; Tue, 29 Sep 2026 13:44:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E80C52D2AF; Tue, 29 Sep 2026 13:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b="EvejGk96" 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 4A4DB52B1FB; Tue, 29 Sep 2026 13:44:04 +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=1790689447; cv=none; b=lzQ8Q7taOMt/2RgpmraEG6kXzWPBTDtxJH7tGZNf8bf0pgb0jVfZ4kbOzaB+hLpc7LOf6L9NC7UmUyQGVXAZ/atZpY8lkzqNwDca1M9pMVM92cSr/F8gVpSbhC06HZ6OBJQK6FKKPhcuXOhoUqqVMxZiuSbqgEFczneE2DtKIaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790689447; c=relaxed/simple; bh=qlyHS4iJQ7BrMrksXagii/UEoD+9i6v84/cW4b7sq6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RAEvAsosLNoFkDLk+WMhml3ED8vPvRkaxdtBhs+2aykcXMC+2ROWBImF3WEuBfakoVwacC45EmFT+DT+Jjc4y6S7+J1GRBN+xb88z0P+OvXqQA2Ei+00exLmz6TIuI8T2Cu1gCaf9TxkwzYYwNN1mvebYH+rfVjl4K92WipXF0E= 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=EvejGk96; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1790689442; 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=adL1F/nYZDGIVACVvafixgvFG5DK1XHCfv0m2eLuaLs=; b=EvejGk96PQKff5J9haLGYmCeXRKBRS+rlvDu59BKapjR6m2xawHu0uYLy//3y6zYLNw9yj vzt70mxdBDN5OvnLx1M/sxu6hAdtFMn1E0jHOcSFI+zz3gWLu8FM8xz3I9m86XdZUJ2hGx po3IQglgyiue/IvgYLr5xxKlSTMz+Q8= To: "David S . Miller" , Andreas Larsson Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Stian Halseth Subject: [PATCH 4/5] sparc64: Derive VA masking support from the machine description Date: Tue, 29 Sep 2026 15:43:52 +0200 Message-ID: <20260929134353.3879030-5-stian@itx.no> In-Reply-To: <20260929134353.3879030-1-stian@itx.no> References: <20260929134353.3879030-1-stian@itx.no> 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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,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 VA masking is not named in the cpu node's hwcap-list. The machine description carries va-mask-nz-mask instead, which is present and non-zero only on a chip that has the feature. A SPARC M7 reports 0x80808080. Read that property rather than matching on sun4v_chip_type, so the kernel does not have to carry a list of every chip that implements VA masking. hwcaps[] gains "vamask" as well, for firmware that does name it. The M7 does not. The bit lands at 32, so a 32-bit task cannot see it: compat_binfmt_elf.c narrows AT_HWCAP to Elf32_Addr. Signed-off-by: Stian Halseth --- arch/sparc/include/asm/elf_64.h | 1 + arch/sparc/kernel/setup_64.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h index 714ca79c88d7e..12832e1126d8a 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h @@ -106,6 +106,7 @@ #define HWCAP_SPARC_PAUSE_NSEC 0x20000000 /* PAUSE has nanosecond granularity */ #define HWCAP_SPARC_MWAIT 0x40000000 /* MWAIT available */ #define HWCAP_SPARC_SPARC5 0x80000000 /* SPARC5 insns available */ +#define HWCAP_SPARC_VAMASK 0x100000000UL /* VA masking available */ #define CORE_DUMP_USE_REGSET diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 71d30b3bf276f..6f3b1d56a8c79 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -387,7 +387,7 @@ static const char *hwcaps[] = { "mul32", "div32", "fsmuld", "v8plus", "popc", "vis", "vis2", "ASIBlkInit", "fmaf", "vis3", "hpc", "random", "trans", "fjfmau", "ima", "cspare", "pause", "cbcond", NULL /*reserved for crypto */, - "adp", "vis3b", "pause-nsec", "mwait", "sparc5", + "adp", "vis3b", "pause-nsec", "mwait", "sparc5", "vamask", }; static const char *crypto_hwcaps[] = { @@ -521,6 +521,33 @@ static unsigned long __init mdesc_cpu_hwcap_list(void) return caps; } +/* VA masking is not named in the hwcap-list. The cpu node describes it + * with va-mask-nz-mask instead, which is non-zero when the chip has it. + */ +static bool __init mdesc_cpu_has_vamask(void) +{ + struct mdesc_handle *hp; + const u64 *mask; + bool ret = false; + u64 pn; + + hp = mdesc_grab(); + if (!hp) + return false; + + pn = mdesc_node_by_name(hp, MDESC_NODE_NULL, "cpu"); + if (pn == MDESC_NODE_NULL) + goto out; + + mask = mdesc_get_property(hp, pn, "va-mask-nz-mask", NULL); + if (mask && *mask) + ret = true; + +out: + mdesc_release(hp); + return ret; +} + /* This yields a mask that user programs can use to figure out what * instruction set this cpu supports. */ @@ -598,6 +625,9 @@ static void __init init_sparc64_elf_hwcap(void) AV_SPARC_FMAF); } } + if (mdesc_cpu_has_vamask()) + cap |= HWCAP_SPARC_VAMASK; + sparc64_elf_hwcap = cap | mdesc_caps; report_hwcaps(sparc64_elf_hwcap); From patchwork Tue Sep 29 03:43:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stian Halseth X-Patchwork-Id: 2313341 Return-Path: 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=ncy7Xar9; 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=wyzc=hv=vger.kernel.org=sparclinux+bounces-8137-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 4hvKFl4KG1z1y1S for ; Tue, 29 Sep 2026 23:46: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 4hvKFB2B4Kz4wLR for ; Tue, 29 Sep 2026 23:45:34 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4hvKFB26XQz4w2b; Tue, 29 Sep 2026 23:45:34 +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=1790689534; cv=pass; b=sF6uPDOdFcu07TbuMBuiblKsZzhtldwmj3t3qVQdSce3iLspN0SC6clBGcnfUzIBE/Q3XbSUraTRdPuCrMwBEVAjCaUqgqJUSoAHROn3d50O9+8nm2KfYV5iOuDM1teAu2eeyscHgOX6ewbdjLlwoFqerdTjGCuDnv5GYJICRiEEeioriGdCUYW1iArI7kXttDUVuQj0db6TuTif0BN/MRsuicUcv+tPleOF47VuOH13jLxjUadYUoqWPF83+0Q8teOXTuLepMgwBKaiJi/kKfvcnGg3KErfDHyRQaeZJ1GFCbkMwUX26im+9EKucv6YdIF/S0HpH84n3lcXjln8qA== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790689534; c=relaxed/relaxed; bh=FmB7mYo730DHrgC/G0GPm86kcoZLRNt+jml80pgZmts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WmoyIZH8jjjK4pNSUZ3RKr66Ig4GeOt1949evcsBh526rKOm9ej1gm+uuxmAsnBkOmO0/GiK6MO68gjLX1lQa7fGzbjEEodipwKWCfnyNGtghfjX7M5QdfU8ULXYlBAZcuMvPkYP7wZxKiO1KJB+f+QuLvbdmqkljOBgJmD56+gK/DXm8A2McAbm4Jg1UOXGahdQ3J8OCk7Sm9pvZvmoL+7l+8LAwwpUi+QnPBYQy57K9ohuYkSajfzHQ07M3gJ/M4sCHYaW2tkOiZ+S005QR9obUoM6v2inlUFa1RjbRuX7ZXUc85SEx+MPeHw+z1nyoa78p8AR81Wl6BP2Kvttdw== 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=ncy7Xar9; dkim-atps=neutral; spf=pass (client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=sparclinux+bounces-8137-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=ncy7Xar9; 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-8137-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 4hvKF63cV1z4wSh for ; Tue, 29 Sep 2026 23:45:30 +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 4601360ACEF for ; Tue, 29 Sep 2026 13:44:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF52052F267; Tue, 29 Sep 2026 13:44:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=itx.no header.i=@itx.no header.b="ncy7Xar9" 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 5F57452CCE4; Tue, 29 Sep 2026 13:44:08 +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=1790689449; cv=none; b=BCjyRVIziEtgA4WBVSMEE+vW0QQFNOoIpWHE2dghaIkXkyrhhxOHIacs4H/jz3qXztBhfTGO3ntaX4OyXuWGhsZORGgGleR/hsT4GnIlf/MnYKf9nTXavo0/Ld5z6gS7QzHHGCP7MOIdswlqceNCBviAdSTq0NtiglWhflr4jrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790689449; c=relaxed/simple; bh=hIfRpnCqDW1vxGSO3OJHWVeR0uPAJLGj9eqpEYk0C8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ccXrJSnM7E3yXzYnntJ5nTqzHy2R8rRcXqiQ6YjQpRnrnjTQbcEiQgXdpi5nOsEPWEtoAHb3IOcy+6w7WYVI/buS8avRjAYyZVsBg6MD2PLG0yKLMN6XWclQgeBWvNMfaF/ej+ljlDfcOacEEGPMPBSenPKv9VAcXwuwgYRk6vI= 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=ncy7Xar9; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1790689442; 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=FmB7mYo730DHrgC/G0GPm86kcoZLRNt+jml80pgZmts=; b=ncy7Xar9G+UlwE6tqNYq8JKm4Dw+PeI5p4yZgkQH4+4tcXfZUqm0oJAah8y+xV/9DPWsz2 7sdNZvu5ub++J+csOTd6VWYaVHI38tvBuv9ol7V6UMdEL/QDCk/ivzHcsSqve0zONAfJc3 OiTPFo/gZxEsb6IALRCbIlBRCHRxNF4= To: "David S . Miller" , Andreas Larsson Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Stian Halseth Subject: [PATCH 5/5] sparc64: Match the machine description's combined crypto names Date: Tue, 29 Sep 2026 15:43:53 +0200 Message-ID: <20260929134353.3879030-6-stian@itx.no> In-Reply-To: <20260929134353.3879030-1-stian@itx.no> References: <20260929134353.3879030-1-stian@itx.no> 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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,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 crypto_hwcaps[] is indexed by CFR bit, and mdesc_cpu_hwcap_list() reuses it to match hwcap-list strings. Those are two different namespaces. CFR has a bit each for the Montgomery multiply and square, while the machine description names the pair with one string, so "mont" and "xmont" match nothing. Nothing breaks today: any recognised crypto name sets HWCAP_SPARC_CRYPTO, and a chip offering the Montgomery operations offers "aes" too. It is still wrong, since a machine description listing only the Montgomery names would leave HWCAP_SPARC_CRYPTO clear. Match them from a list of their own rather than adding them to crypto_hwcaps[], where they would claim a CFR bit that means something else. Signed-off-by: Stian Halseth --- arch/sparc/kernel/setup_64.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 6f3b1d56a8c79..a53fe2d1eabba 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -396,6 +396,14 @@ static const char *crypto_hwcaps[] = { "xmpmul", "xmontmul", "xmontsqr", }; +/* crypto_hwcaps[] is indexed by CFR bit. The machine description names + * the Montgomery operations with one string each where CFR splits them + * into a multiply and a square, so those names need a list of their own. + */ +static const char * const crypto_mdesc_hwcaps[] __initconst = { + "mont", "xmont", +}; + void cpucap_info(struct seq_file *m) { unsigned long caps = sparc64_elf_hwcap; @@ -506,6 +514,12 @@ static unsigned long __init mdesc_cpu_hwcap_list(void) known = true; } } + for (i = 0; i < ARRAY_SIZE(crypto_mdesc_hwcaps); i++) { + if (!strcmp(prop, crypto_mdesc_hwcaps[i])) { + caps |= HWCAP_SPARC_CRYPTO; + known = true; + } + } if (!known) pr_info("CPU CAPS: unknown hwcap-list entry '%s'\n",