From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 569F2D1D483 for ; Thu, 8 Jan 2026 19:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OPh21DV+qXhfoeopAmhqTDyly3rRzBrx9dUy2qs2Atc=; b=22qu2+0JeSkSZ1 UbW2vNrI+tzeZi6kHHL+MoKPSXd1E1nYsluRKutEX1OGKuNp2YemJfxmYdjabkWbDCM0bZ5qEN4op Asw4/kSoWUiEjgm9Pa1sbLu9seDWPJPZxYAHNA3jASvfcOgXuhG2G76KJndNcL3ShTQjjqLSdWAey LBp7KhYzA1fUPHhbpBMKD+53e1OcCpY9rvTrr2GoujxVsAKwYJtv7T7DZbqXeNTNPQO0625dD0Ip9 BtVU7v1hRUbkMePrxd8TOx+JUAbnYKV1bfOdweUSknQAUCgcHAxyVp4ZTAcVWRIm/wfKJIWYgjbCf IEdHxZpOiid9VU3Bd0Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vdvxH-00000000mI6-3Af9; Thu, 08 Jan 2026 19:45:59 +0000 Received: from mail-oa1-x42.google.com ([2001:4860:4864:20::42]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vdvxE-00000000mHM-3m48 for linux-riscv@lists.infradead.org; Thu, 08 Jan 2026 19:45:58 +0000 Received: by mail-oa1-x42.google.com with SMTP id 586e51a60fabf-3f13043e2fdso1405758fac.1 for ; Thu, 08 Jan 2026 11:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1767901556; x=1768506356; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=n0eSk+8SweBNRYF6OiM3wD68xD/JtKcShoUz7XdjZrA=; b=KU7LuuiyDZZagQV1+tfbuG4wClBbT0uQRYNpjF/0/4RUD0ikiHeMqKvbGXeVfN8coT x5M1klX4JeIsGUSypfxnadU+txp1pRqvtxY4+3V+rQvYof4624evqiw2kSoNgXu41Ln1 u5iTrjlh7zobqp99AQfx44LeE58OCo04OIyJzhkAtT74WeA7qVTb+WHW+oTUDhXXSPjP B0DftLq96QhQJ/+jj2j8BkOfp1rhSqAy95Wjj3vpqlJI1Txmpxt/oZ/B2AaDuyklFZgV ogml/YA4C16BOACsHKhASdYbqh5OBSSqa7YP+y1HRm7bMSlaDSm6oXXjZStCpmLbGLP0 mAtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767901556; x=1768506356; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n0eSk+8SweBNRYF6OiM3wD68xD/JtKcShoUz7XdjZrA=; b=wMo8QNr5cWw2mB+z/qyBksOO+YEZuFX5EfavXzJ48wkQ2hDNmVoPIdAqoeTdQnSCSo XAtr0Y1AUQHfCTz/iJ7CuOdl04yZsM3wcpRvYRYcGqV2FTvQFykn/vxgIZJ0bav0NNXP GTZMyWRu+kEWbaCY4reu/O2YhdX9YTlWQy68V5vlPmwt+zSNXo3Pv8vsRfsH6UvIf/oW NnEaCmjoBJ/imZNIQkMAEpqKMkltYVH+00hhTnYdJGD4/z2ST7bTbbfuoFq7HNG8FEWR TzROo2CKh30iTxLYW1SQtZAxEZGfSF5G7slyhvs5ViyN4LHlsqNTg83s746lPBJFWlGB zhxg== X-Forwarded-Encrypted: i=1; AJvYcCWgmF17UlC31WwZcEnRtpqVQEU3VOMu9ooLhnhY4iB99vj1fMuJp2ehgJRWVW31oOxHNSJutI6D+thYfw==@lists.infradead.org X-Gm-Message-State: AOJu0YzqwOUzOG7qgXTb7t1HZC0JbGb/vgBr91yCWA/GpDTeeY/ft6H1 cyT4XJycLI3N+cI9zQ+Tbu15ROwL0Eu23PnEyVEehciltKxwtVugxIVFnxHOKNlRQ9E= X-Gm-Gg: AY/fxX7jVUNvGJrjbWYR+Lc/j9FqH5vodbFYiNkHPM5e0f5n6pY2TKhTjs8IMOsAJAo 2C/gMYcLuqlKhiwxEbG0k954zfuW43CVjM5nLAoKDJ1MjiPajCKteC/HxP0NYr8bQDn9hBaz6Oa Sf/jwpsCobKG2ZeILF31FFKYfM/vXiQI/+WKY/t0opoI0Ux98CwM9RoLD59exniC6UV2Ct42XM6 TcdQ6TYBuUVh2+Ipdc6BJOHOhUn3rOetJOcme/v3nigGJNMxujF9lCrV7novvONtXBz17n/VM+D RKaiwe2vWZPKa74ba47Tn9ZGpb5S1zZZsfX9BbELUcIWL3M3tBpywXy0jISWLRdYqPMTxjJ62rr fe7NpmW3t7C8opxYvPHcI4qcTaU3nfSPVNabsuHHe+UfrsprFQDZ+Yl2lHtKb3M5B9xYTnjHNfB 1n/Arrb8EsCEfZmygjWsLVvvzeaI8= X-Google-Smtp-Source: AGHT+IEnGj7j78QZ6mRN19R9+RwSyzrulyek7pG3baJMhDCtKMbdCTrHEffeVpATRadsKRk6i4mUUw== X-Received: by 2002:a05:6870:b3e9:b0:3d4:5a8:38ff with SMTP id 586e51a60fabf-3ffc09e5050mr3655803fac.18.1767901555789; Thu, 08 Jan 2026 11:45:55 -0800 (PST) Received: from [100.64.0.1] ([170.85.11.86]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-3ffa507235fsm5688464fac.13.2026.01.08.11.45.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jan 2026 11:45:55 -0800 (PST) Message-ID: <4ebbe14b-2579-4ba6-808d-d50c24641d04@sifive.com> Date: Thu, 8 Jan 2026 13:45:52 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description To: Conor Dooley , Heinrich Schuchardt Cc: Rob Herring , Alex Elder , Guodong Xu , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Daniel Lezcano , Thomas Gleixner , Anup Patel , Greg Kroah-Hartman , Jiri Slaby , Lubomir Rintel , Yangyu Chen , Paul Walmsley , Kevin Meng Zhang , Andrew Jones , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, spacemit@lists.linux.dev, linux-serial@vger.kernel.org References: <20251222-k3-basic-dt-v2-0-3af3f3cd0f8a@riscstar.com> <20251222-k3-basic-dt-v2-11-3af3f3cd0f8a@riscstar.com> <20251230021306.GA3094273-robh@kernel.org> <80e18a32-543a-48f5-81f2-4fa64cb8bf8c@riscstar.com> <20251230-budding-dimple-c34636b0ca4d@spud> <05B0AE03-E7B1-4DCD-88D0-DCB9053F30BA@gmx.de> <20251231-grew-abrasion-dc1a9d34e632@spud> From: Samuel Holland Content-Language: en-US In-Reply-To: <20251231-grew-abrasion-dc1a9d34e632@spud> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260108_114556_955860_8A5D2874 X-CRM114-Status: GOOD ( 25.47 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi all, (Also replied to the v1 thread: https://lore.kernel.org/linux-riscv/9504b2f6-12f5-46c2-ac74-826dba3fb530@sifive.com/) On 2025-12-31 6:08 PM, Conor Dooley wrote: >> Should supm be handled in the same way? Add it to the device-tree of >> RVA23U64 devices. If a kernel does not support pointer masking in user >> space, hide the extension in cpufeature.c. > > Perhaps. > Samuel opted not to add supm to dt when he introduced the other relevant > extensions, so the rationale from him would be helpful but I'd like to > get more opinions on how to deal with supm specifically. supm doesn't > really describe hardware capability, since the privilege specific > instructions are what does that, which makes me question if it should be > in dt at all. On the other hand, it could be argued that supm describes > a combination of hardware capability at the dt consumer's privilege level > and is valid on that basis. Some wording like Zkr will probably be needed, > specifically mentioning that having supm in the dt means that corresponding > version sxnpm for the privilege level that the devicetree is provided to > is supported. Supm describes a combination of the hardware capability (Smnpm or Ssnpm), the consumer's privilege level (U), and the software at the next higher privilege level (M or S). If the DT is targeting U-mode, then I can see a case for adding Supm to the DT either at runtime or based on the known capabilities of the next-higher-privilege-mode software. So it could make sense to add a binding for Supm. But we still shouldn't add Supm to this particular DT, because 1) this DT is not targeting U-mode, and 2) this DT is not bound to a particular version of S-mode software. > Either way, we are going to need something in cpufeature.c to imply > supm so that it appears to userspace if the privilege specific extension > is detected and supm is enabled in the kernel. The kernel already does > the implication internally it just isn't reported as an extension to > userspace IIRC. > If we permit supm in dt, we're also going to have to turn supm off if > the Kconfig option is disabled, but that's relatively little effort > since it mostly (or maybe entirely) reuses code from implying supm. It's currently exposed to hwprobe() but not in /proc/cpuinfo. This was based on my understanding that hwprobe() was the right way to check for availability of extensions. I'm okay with adding it to /proc/cpuinfo if there's value in doing so, but I would recommend that the extension in cpufeature.c is _not_ parsed from the DT and only enabled synthetically. Regards, Samuel _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f68.google.com (mail-oa1-f68.google.com [209.85.160.68]) (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 ED43628852E for ; Thu, 8 Jan 2026 19:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767901558; cv=none; b=T/uwPpTVec6dgaQM93A7OtzrTanW/ZkArfUqDccn9PKw3tfnzm0utjkCeWcf4rofF8FhO8x2PRaFVGmW1aWeIb9dLTHZp25TTnB4oWzlGmVPI4o8OCg+N1KfL8R53uoOqMyu/f9Kn/VD060uraRDp23oCnU6y4LYWJ1romVlik0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767901558; c=relaxed/simple; bh=RFSoiJgF2IhE1d/U2C8Dz/1A18MDcqAJmwzPHJkEPn0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=i7ch5QWVQwNKP2ZrGTgptNC4BTr+IuGMXqtODz7RRsqGvUGCeE4uaASepRnyDpOVEUTNJiFNDIP/sW7JE73aHz+D0QO8nY5Ls4OaVKIak95SYd/I8WJD2Px+GV4Ry6n277J7u8IpHZnaQ7DKJIC9RGmtJSCwioYBkcuYZDWCW9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=Ct+HIpIR; arc=none smtp.client-ip=209.85.160.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="Ct+HIpIR" Received: by mail-oa1-f68.google.com with SMTP id 586e51a60fabf-3ec6c10a295so1560220fac.0 for ; Thu, 08 Jan 2026 11:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1767901556; x=1768506356; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=n0eSk+8SweBNRYF6OiM3wD68xD/JtKcShoUz7XdjZrA=; b=Ct+HIpIRy0AwEX7ZUxfaaVuJarIl/e3esaYx0kCp6sPDc74QMjmC/8FyYU5wsRv16c r7SUur9BJzR0B6CJRJC1Iru3x4S616yASEesOklUJTYqfwWeWNoXDfsh75y6up4feP4r SxezrFStgkJyYPsTEbdqR5tvSLDBTSI/2zj7m9dDpV26G3YsW0z7tUaXsSkpjwznl/PY knKlxLBoqiPJd5bfp1kovhDo5W2cqkijy2ob4oxMbHz0YtwR8iCCdM74zxNz7G9qGdl0 5Hv6owq1jPWQEL5JFqQ6D/oNpnvUh9PgrK0BkKstggQBuwmOnQFwSs98/qBuq9d5G6Z3 iXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767901556; x=1768506356; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n0eSk+8SweBNRYF6OiM3wD68xD/JtKcShoUz7XdjZrA=; b=oKqcrC2RStW/HlorT2FL494dmAZKv60IQrPkdoELl5tgZFprU/rhEmdqkcMBAIjmT6 Jsfabc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EffeVpATRadsKRk6i4mUUw== X-Received: by 2002:a05:6870:b3e9:b0:3d4:5a8:38ff with SMTP id 586e51a60fabf-3ffc09e5050mr3655803fac.18.1767901555789; Thu, 08 Jan 2026 11:45:55 -0800 (PST) Received: from [100.64.0.1] ([170.85.11.86]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-3ffa507235fsm5688464fac.13.2026.01.08.11.45.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jan 2026 11:45:55 -0800 (PST) Message-ID: <4ebbe14b-2579-4ba6-808d-d50c24641d04@sifive.com> Date: Thu, 8 Jan 2026 13:45:52 -0600 Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description To: Conor Dooley , Heinrich Schuchardt Cc: Rob Herring , Alex Elder , Guodong Xu , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Daniel Lezcano , Thomas Gleixner , Anup Patel , Greg Kroah-Hartman , Jiri Slaby , Lubomir Rintel , Yangyu Chen , Paul Walmsley , Kevin Meng Zhang , Andrew Jones , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, spacemit@lists.linux.dev, linux-serial@vger.kernel.org References: <20251222-k3-basic-dt-v2-0-3af3f3cd0f8a@riscstar.com> <20251222-k3-basic-dt-v2-11-3af3f3cd0f8a@riscstar.com> <20251230021306.GA3094273-robh@kernel.org> <80e18a32-543a-48f5-81f2-4fa64cb8bf8c@riscstar.com> <20251230-budding-dimple-c34636b0ca4d@spud> <05B0AE03-E7B1-4DCD-88D0-DCB9053F30BA@gmx.de> <20251231-grew-abrasion-dc1a9d34e632@spud> From: Samuel Holland Content-Language: en-US In-Reply-To: <20251231-grew-abrasion-dc1a9d34e632@spud> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi all, (Also replied to the v1 thread: https://lore.kernel.org/linux-riscv/9504b2f6-12f5-46c2-ac74-826dba3fb530@sifive.com/) On 2025-12-31 6:08 PM, Conor Dooley wrote: >> Should supm be handled in the same way? Add it to the device-tree of >> RVA23U64 devices. If a kernel does not support pointer masking in user >> space, hide the extension in cpufeature.c. > > Perhaps. > Samuel opted not to add supm to dt when he introduced the other relevant > extensions, so the rationale from him would be helpful but I'd like to > get more opinions on how to deal with supm specifically. supm doesn't > really describe hardware capability, since the privilege specific > instructions are what does that, which makes me question if it should be > in dt at all. On the other hand, it could be argued that supm describes > a combination of hardware capability at the dt consumer's privilege level > and is valid on that basis. Some wording like Zkr will probably be needed, > specifically mentioning that having supm in the dt means that corresponding > version sxnpm for the privilege level that the devicetree is provided to > is supported. Supm describes a combination of the hardware capability (Smnpm or Ssnpm), the consumer's privilege level (U), and the software at the next higher privilege level (M or S). If the DT is targeting U-mode, then I can see a case for adding Supm to the DT either at runtime or based on the known capabilities of the next-higher-privilege-mode software. So it could make sense to add a binding for Supm. But we still shouldn't add Supm to this particular DT, because 1) this DT is not targeting U-mode, and 2) this DT is not bound to a particular version of S-mode software. > Either way, we are going to need something in cpufeature.c to imply > supm so that it appears to userspace if the privilege specific extension > is detected and supm is enabled in the kernel. The kernel already does > the implication internally it just isn't reported as an extension to > userspace IIRC. > If we permit supm in dt, we're also going to have to turn supm off if > the Kconfig option is disabled, but that's relatively little effort > since it mostly (or maybe entirely) reuses code from implying supm. It's currently exposed to hwprobe() but not in /proc/cpuinfo. This was based on my understanding that hwprobe() was the right way to check for availability of extensions. I'm okay with adding it to /proc/cpuinfo if there's value in doing so, but I would recommend that the extension in cpufeature.c is _not_ parsed from the DT and only enabled synthetically. Regards, Samuel