From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 03B0B440A36 for ; Wed, 12 Aug 2026 12:22:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786537329; cv=none; b=BxwUjPyS+65c2n34NPuNntPwiVH8kkqGiCMc0L26h+9abjgDkVESMi264ixIslcXNCNmpexWCNDy1I1V7koSZ5V/JJXVDlqcwTVSpW3QMcPx5Gg8cxc8Z1jEfWQBd7lI6HKyUtFf6HUn66s5Rh7zj3sSyXSYk6zpyJMaZL4xHfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786537329; c=relaxed/simple; bh=o3BrW0Pk3Yb3QqbEL5Wk6HQ84Zj7L0TGeiDG5ECjNWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kfjtOSrqMIAAb2Kjv4FlhER4ZmTRi1IDFrHABquAU6oh1aZy1Kfwy8pRwyBC8g7SIj02HdFt9Ih9H268B+3TIl83Teq1tCMQPbhrnA97KWBw1qk6GYvDaf94Voe+2ZL/79ldCOzapi7fAjd0ckpIhAhu0dG7sj2zbJ5sTBNUXqc= 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=ikuuhI+w; arc=none smtp.client-ip=209.85.128.52 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="ikuuhI+w" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4957eefd361so6558235e9.1 for ; Wed, 12 Aug 2026 05:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1786537326; x=1787142126; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EYskKRXMT/E1v5UdRHS7zk2d1epkZSuiJ8hCmRGEFMA=; b=ikuuhI+wj3oIUv+yA2hZ+FdTg9AkLT5tzZM20HdgR7snHAI9f6FokhjwBQo/R/R2dK ePedG2iEYD3apN3zIGrT1ndtHIzUpFc3XApZjPQp5XpolZY+iAFQlKVeLrGYUWI/4q1q GX/b9w/d34WkU8ebXXYcxkuQGVcL+pmwOu3kO3BUDlAZJlNuWIrCcihR59+yFkzcE31T 0Qc1itQwLyj4KAEznqPa7CXd2Z2yD7mEnwBfahVvYmjgyz3ZtQKvkvc4wNTiv9JNQJ/P dLJor423IRQCy65elsakqkP2y+PBejsG6YFtdD00n8b7MvCApCuYAjmJC/Of2mqpW010 Kvsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786537326; x=1787142126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=EYskKRXMT/E1v5UdRHS7zk2d1epkZSuiJ8hCmRGEFMA=; b=E/INSbgWlfJ7v77bxP6/Az+xCSfgxfqybCpnHDg7po0onKi7Fz2h0sGRcbBy71v0NM U+QQpzB/s0DYpOLpxMgcmX0lKY1pVhxfq4mTWbgQXJPZLyZTpQsv83Bhqknm70ZVdsS/ EYi9bJzx/2EEu8UXn+fgLwMgAtl65DIeY9H5Dx2Mb1LgMi/MZhdXZdA1vObMYG4NYDec ksykn5JwYH4p/7XbjquX1woQvN5+G9V4hf9OKFmVjtOHbJCVH4V9XplowLoGlR/vh0PM fR/Tt2VDXftwLWAKT3aTPUidCrdqHrgeX0iXuZ9N7d4ziQF64oK4Y7a3kIMvyAt19UCY UNmA== X-Gm-Message-State: AOJu0YwYQCnTxCJ7sYJ+PSwI9UNL2AWK6PTREHBphq2eKiBKkTVGII7k lePn6NKBepJggm3Q/O7StK8Reh2M+2z5VqAMpU0fJwN3Ane5alfiTlPAzOsULQ+W2xqnTY0B/E0 WmfD8+8z/87k4XcoScork9fSSywHfdFasWS4m+D0eeX4NU/Vk0NO7f6qtQaIhP5rey09M2xq3tI 0ia6uI6r1bgeOLG6p3/wP6JRq835eh+Whh4mZwPlDi/lpzJAAZjn83wl4= X-Gm-Gg: AR+sD13rl2MueJh5CdjI9+bkuHYl1QTBSyKAloPtBMqvFabZ6dZ/zsFLMxBSBYVlyqk SczIFsiOMhjeIyr4bgNR2D/ixgCJg8x3kNafvI598jdodj3mNsMDhiAo9x3QDWq9bcxYYA9T2NG TIlh7y7SZVLDPEJhp+uHvmZBz0h+45jnssCaO8pslfrZXxiwqZD7XkD1Vd2l5CDV9ZgNUmiz5Bg guDCjzvLKJbvkR2dTV0B5SVOfaFrnQpY13EybsYCTNa1Lx1NdoAdmFSZD7L47YDmbc/B23ErzRz Ek5b/PRn0nLOEE3Z+FUc6m5yDxJISjSiqvAAb40KAsxy+PkcN4QfL9Y2tkZQaDx4VkXYxqidads XA0MqqvaYlO5MHBk7Y3yIpHFwL7Gm0wRVCK4ZlseCPdakc/9WngsYj7wFrz3hc1wkyfPCWnSWc7 L9b/2cgTx2TSg8ssWQoB/2H6JhlMkrpq71IXXlGkbx5rYNQ01xBZZT1aWNirQk8U90jyMGxq856 Umzl7c1g2sV X-Received: by 2002:a05:600c:1f8f:b0:495:5fdf:2075 with SMTP id 5b1f17b1804b1-4997bf83d13mr43895935e9.0.1786537326046; Wed, 12 Aug 2026 05:22:06 -0700 (PDT) Received: from hsinchu16.internal.sifive.com ([210.176.154.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997aaa5d04sm65858905e9.2.2026.08.12.05.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 05:22:05 -0700 (PDT) From: Yu-Chien Peter Lin To: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, samuel.holland@sifive.com, dlan@kernel.org, dfustini@oss.tenstorrent.com, michal.simek@amd.com, junhui.liu@pigmoral.tech, darshan.prajapati@einfochips.com, akpm@linux-foundation.org, zhangchunyan@iscas.ac.cn, luxu.kernel@bytedance.com, pincheng.plct@isrc.iscas.ac.cn, nick.hu@sifive.com, jim.shu@sifive.com, zong.li@sifive.com, greentime.hu@sifive.com, robin.randhawa@sifive.com, scott@riscstar.com, dave.patel@riscstar.com, raymond.mao@riscstar.com, anup@brainfault.org, pawandeep.oza@oss.qualcomm.com, Yu-Chien Peter Lin Subject: [RFC PATCH v3 2/3] dt-bindings: riscv: Add Worlds per-hart properties Date: Wed, 12 Aug 2026 20:21:30 +0800 Message-ID: <20260812122131.1534906-3-peter.lin@sifive.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20260812122131.1534906-1-peter.lin@sifive.com> References: <20260812122131.1534906-1-peter.lin@sifive.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add per-hart DT properties for the RISC-V Worlds architecture: riscv,pmwid, riscv,pmwidlist, and riscv,pmlwidlist. These platform-defined values are primarily used by M-mode firmware to configure World ID CSRs and restrict WID usage across privilege levels. Also add schema validation rules to enforce valid property combinations based on the ISA extensions present. Signed-off-by: Yu-Chien Peter Lin --- Changes v2->v3: - Drop riscv,nworlds property - Drop 'required' check for riscv,pmwid --- .../devicetree/bindings/riscv/cpus.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index 5feeb2203050..326b68398b90 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -39,6 +39,26 @@ allOf: properties: thead,vlenb: false + - if: + properties: + riscv,isa-extensions: + not: + contains: + const: smwid + then: + properties: + riscv,pmwidlist: false + + - if: + properties: + riscv,isa-extensions: + not: + contains: + const: smlwid + then: + properties: + riscv,pmlwidlist: false + properties: compatible: oneOf: @@ -113,6 +133,30 @@ properties: description: The blocksize in bytes for the Zicboz cache operations. + riscv,pmlwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for S-mode and U-mode use on this + hart; each set bit N indicates WID N is available. Firmware may read + this to select platform authorized WIDs for lower-privilege modes. + + riscv,pmwid: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + M-mode World ID (WID) for this hart, M-mode firmware may read this + property to identify the WID for M-mode. For a Worlds-aware platform + without any Worlds ISA implemented, this is the WID for all privilege + modes. + minimum: 0 + maximum: 63 + + riscv,pmwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for M-mode use on this hart; each + set bit N indicates WID N is available. Firmware may read this to + select a platform authorized WID. + thead,vlenb: $ref: /schemas/types.yaml#/definitions/uint32 description: -- 2.43.7 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 B783DC5B572 for ; Wed, 12 Aug 2026 12:22:25 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SdeWUa/suOKaJYD4W0BDBxzcIbnYc7/2jxKPTTXb6tE=; b=s9DlE0VOlEmrIM slaQoW3ijoUn/fMM9RcNQ8T+agoZ0YTARg2QeKoTTTKDr0E4bou18AMkCtsGIQMPVKBl8LVXqfh/J wFFyTnJoJSA02fCfdq5iA8ptFNNYHCF7v2sUUc1hs2Vjz+z2jp+uk7ibxkYNrH3sud+UeLv0DQG2c G6HyPjAJQLmSBCS2+ZG0jd1XwVzg282sWvjQk8Mt4qbRuWxCu6JOTyrNK7zB6mbdsOyd/IQ57Py1u r65m6LD/JkKbn8kJLJ9/A91zXI2v2q0IzhkICeKt4mk+HZhM+n4zhRxC+//4B4K07RNH24ZnQIw24 JSctJcmW9bBJOBNa6emg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wu7yI-0000000GB1v-1lUs; Wed, 12 Aug 2026 12:22:14 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wu7yG-0000000GB15-2g28 for linux-riscv@lists.infradead.org; Wed, 12 Aug 2026 12:22:13 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4954f5e8020so4152585e9.2 for ; Wed, 12 Aug 2026 05:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1786537331; x=1787142131; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EYskKRXMT/E1v5UdRHS7zk2d1epkZSuiJ8hCmRGEFMA=; b=JJlZsQhNYW1UAgN1aFNtfQFJpVQwl4HhKf/xcAyjd9uR/FMG6DwSASmJh9mtkVT/B0 6+AuZnNC3YGeL2faOnatlzLqDYCwjpEqQz5zehllWt7KQiL4InhnyoUWHPPpiYK1nGZO 8d1oC0fvPBKf2PY290XfEh36WF22iZVAlVizDEpXCgUIekUzGFGmBGRO5SccgWQFQlmt 3FJEnj9dtd7Tbf4NF/CM5vRRvz1eZ+NsX5ulwr4d+CcLr5Jg/b6RR/d7EYUtuezVxQLE MqxxOoKQlqUYJIZH3ziUBe+mXH4ulQQ5Eh9UU9UvM+FE0TMJU++3kpTNmmN3qHJDuYYt 29sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786537331; x=1787142131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=EYskKRXMT/E1v5UdRHS7zk2d1epkZSuiJ8hCmRGEFMA=; b=ZgzJxZ7MI634SKW1A2wMMeO2vUUJf5Kpxd/yv21NMILZMVhDFEmKaQ4WNDQroVlCy+ pPWDEiPFUI4KZGzT+3UYm//HdijZKxH2ROyym0dEr2RRYuZo4UCHGZlOk9Ged25hn0EP XbeJlODg7cX/3+0Gb2oJANeHKDsPTGs0IBwYJHbRp8/LNelmGLSJz3+OOGRe8LTubhIC 0389JHgBFy7ZGnS440bUHDjZunqVwssoIDoLjxHJ8tp5qr3RzXXuonwGxJmsJQwXbf4q Ds/9xqq/QaQ/Lu6xVkKO+DaKt5REzv7RAxQ+j7y1Z/rRJfoinZLzsObu2rPxSVzXUJQn 9IXA== X-Forwarded-Encrypted: i=1; AHgh+RoyQKhqV4YpG7m6urL8mbBhChoKDjmZBneoMtMTyRr6PtAZYsEGqgKpSSVB1NlvctbVCFzl8PhlSzXkJQ==@lists.infradead.org X-Gm-Message-State: AOJu0Yx7m4XqPBvyNNHKQ48Sd4w8wvrO/f4oBJP/44xhNGRcJy2vK9Bo U/sRqWBKJQQx31A2PY3oWdTcyoEq7VxYsHQX0N5D+85dx4mj9+y2PxeJUi+4OkQhZS8= X-Gm-Gg: AR+sD11rIYxMv3yD9M6AvT8VZyJrBmc/2LLU37L7kb+dq7LQw6V4L0AAXveGVnpfc2s 3L7Hb42wKsEoZS21HBw5QMzWS/2kVb+dL1JCauZuaViNci8c36MuYxuuhy0PnhpgBuFoIvj8/Oe b5ZoULTHfR+UdYsKX61cQb/EI8dIkuT2GiF62l9G4TjMz9htweX3TzbKZ+OtZymbx5WvZ5Kkoj+ HOwnGwMx8EgMCPIiuvooDSnNgIGvANMyDOfXQs95HyYey7yMYmVF6aiJOUksEcnjUEviKv0QIgP BZJ2rvDpCJTSICF9sKcrGrMk4EgA+Qx1O/nhY78Gg+ZTnngOXrBQjUb6CwJRgoniFuRXFfzdw7s 8YJUq906uD464nn7jyI/FwPL0H15S5DId1vBbJlTJ+2y7Jy+L1iPlypmPZ/KEeQRj+8qJwuf3I9 oiZ4phazhV2zAHfjO/l7L+AVX17jXJJpL4g2M/ZrTYQV47MzfYKqA2i77Yiik4bTkPEgWkHIqvQ tr+BK1f59/2 X-Received: by 2002:a05:600c:1f8f:b0:495:5fdf:2075 with SMTP id 5b1f17b1804b1-4997bf83d13mr43895935e9.0.1786537326046; Wed, 12 Aug 2026 05:22:06 -0700 (PDT) Received: from hsinchu16.internal.sifive.com ([210.176.154.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997aaa5d04sm65858905e9.2.2026.08.12.05.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 05:22:05 -0700 (PDT) From: Yu-Chien Peter Lin To: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, samuel.holland@sifive.com, dlan@kernel.org, dfustini@oss.tenstorrent.com, michal.simek@amd.com, junhui.liu@pigmoral.tech, darshan.prajapati@einfochips.com, akpm@linux-foundation.org, zhangchunyan@iscas.ac.cn, luxu.kernel@bytedance.com, pincheng.plct@isrc.iscas.ac.cn, nick.hu@sifive.com, jim.shu@sifive.com, zong.li@sifive.com, greentime.hu@sifive.com, robin.randhawa@sifive.com, scott@riscstar.com, dave.patel@riscstar.com, raymond.mao@riscstar.com, anup@brainfault.org, pawandeep.oza@oss.qualcomm.com, Yu-Chien Peter Lin Subject: [RFC PATCH v3 2/3] dt-bindings: riscv: Add Worlds per-hart properties Date: Wed, 12 Aug 2026 20:21:30 +0800 Message-ID: <20260812122131.1534906-3-peter.lin@sifive.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20260812122131.1534906-1-peter.lin@sifive.com> References: <20260812122131.1534906-1-peter.lin@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260812_052212_715872_35A0D825 X-CRM114-Status: GOOD ( 10.16 ) 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 Add per-hart DT properties for the RISC-V Worlds architecture: riscv,pmwid, riscv,pmwidlist, and riscv,pmlwidlist. These platform-defined values are primarily used by M-mode firmware to configure World ID CSRs and restrict WID usage across privilege levels. Also add schema validation rules to enforce valid property combinations based on the ISA extensions present. Signed-off-by: Yu-Chien Peter Lin --- Changes v2->v3: - Drop riscv,nworlds property - Drop 'required' check for riscv,pmwid --- .../devicetree/bindings/riscv/cpus.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index 5feeb2203050..326b68398b90 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -39,6 +39,26 @@ allOf: properties: thead,vlenb: false + - if: + properties: + riscv,isa-extensions: + not: + contains: + const: smwid + then: + properties: + riscv,pmwidlist: false + + - if: + properties: + riscv,isa-extensions: + not: + contains: + const: smlwid + then: + properties: + riscv,pmlwidlist: false + properties: compatible: oneOf: @@ -113,6 +133,30 @@ properties: description: The blocksize in bytes for the Zicboz cache operations. + riscv,pmlwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for S-mode and U-mode use on this + hart; each set bit N indicates WID N is available. Firmware may read + this to select platform authorized WIDs for lower-privilege modes. + + riscv,pmwid: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + M-mode World ID (WID) for this hart, M-mode firmware may read this + property to identify the WID for M-mode. For a Worlds-aware platform + without any Worlds ISA implemented, this is the WID for all privilege + modes. + minimum: 0 + maximum: 63 + + riscv,pmwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for M-mode use on this hart; each + set bit N indicates WID N is available. Firmware may read this to + select a platform authorized WID. + thead,vlenb: $ref: /schemas/types.yaml#/definitions/uint32 description: -- 2.43.7 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv