From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796182083; b=VIzJ2S2cX6b1H9imLYEDakGhyOfQDNTLyqLEJHV3ycsWRAVzzbV6TcAOFOCga45S4tJM xgBaxI3CHU+uiqWZRq0XSRjyrLg5IQ+91bI+lnFQjpzu81KeZ5taEagh+EBkG2sjq6Z5P jXpUAe0DsYOcfrQj6jHuFWMEMwJWO1EzFdc+sklrR1VZXNujR0oY1SGpUgdmYM/nh6/Dz dn6y+ymEXPnTlFV4jw+VvYdW8eCWqHm/K9CPgx9pqP3sed/C1rBuRZd8p2p+1Uxnn0v6J A+mlpHkHoe97JUrFSoQ3hqaP2rAML7dVIaI/pw4VtXLSzSiqXK3mnf1ukVLBxdpC07w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796182083; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=Jqq8Q3Xxux8wWj8Fd9bl0a4Yyhv2jDxPGLAcxTr5dTw=; b=4lzGvSEYv//QJcU+V4doBKfrIEUXNM50QPLAptihv1NJ3zYpG/LOYxvEpXqbs9N1ykc8 57p7K7rmol8s/Hhgd8NxcGAMK7x9rnE7nPEtYJP0j8kZ7HiFLzrhdfKjk0s9TCeNd9he6 GW0GCqup7JqvQ/rIm0A1nqwOtGKMIlcXeFO5mdyJfkpdFZlLbKcoXyjiGGvR75VoXvjH4 MG0vPOMFDB99g/plvEzu4WvCRfhBIkVsKpYblvM/TPWzlm8TKZ0lZIsN9RcNBKLX+l25S /EE0ff0QMApNYXAbAehEUdvlZBzPLSn0sXHXSm8mPDu+LNCidzxPJqSkAn76+K6ccdA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=G7NUhniV; arc=none smtp.remote-ip=209.85.214.175 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68B5F606A322 for ; Wed, 2 Dec 2026 03:28:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68B5F606A322 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.a=rsa-sha256 header.s=google header.b=G7NUhniV Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2f05bc71e01so53558165ad.0 for ; Tue, 01 Dec 2026 19:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1796182083; x=1796786883; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Jqq8Q3Xxux8wWj8Fd9bl0a4Yyhv2jDxPGLAcxTr5dTw=; b=G7NUhniVrgWhqha9J+svKGEILwRVwOHJgRO0zMUymntDGTOCtJrevpPHxCqHa6cIYq yLwr+Z87gWjt+MWO03J9rGpZFiGSjuaFrAkbZOOHgjOTi20VbYvPk7l7XCIWJP8+SLIc P5f1SVX2HvqyIHky4Hwust5+S3RtzfBqKUGYwpP0TXQZNOinadbfzQtoCK1c0Mx7pbO2 FBxYJVRnVJyiczxV0+zKH9zG/szi4jWAh8cwtyZ9j7VuXXP1PUdbLE0gseMy7yvSTcpc dIgN0psZlyqaUrv8ib2TUFkaHG/DP2ecctqCqgdMVKhUrbd4BVdc03kOVdpFDjPzta4L kD4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796182083; x=1796786883; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Jqq8Q3Xxux8wWj8Fd9bl0a4Yyhv2jDxPGLAcxTr5dTw=; b=BrFb9Jo3Yx2EQ9dSj+pWLDtSLH+TVo8ufmCYX9GGYnguqm2CIQ1ihzMU1lbr5+QGjz wTzxKzQQMrYqbm06imidh+7EPq/zIFhFm22WUA51VTNGBQg27XH5U7cO8mU8irtm5d0H 65ZKeQe5SyGRlUiOMphMLuiiiz0tyNmcQdu5mcCbWU7SjnjshKAxtGxkD23MNzHzAaZQ haSdweDhxuqbdw6wS0YWWvknD65baQHp+aMcdygLQSaOBlcgbUJc/WTpfDV/rNgWVlDU 2rvYoiH3BgqZFD/QVcT/L5NJdkCLhZvfubUrib2kZ1+BCPTnlDglo2z2Res38rlzDhjF XGmQ== X-Gm-Message-State: APuU4Z8ucA2KsSrhp3REZ2wvDgEr/l/ae+2SEh2R1MxzZH1mTfACLnUQ +yaOWnwYJCcneEusRosBOFDpxebxph4teO2itrQkLF2eHeFqsxWIaBHK+s3im+Dansp8qlTTH4M DIETpvRdTWwTQYADpQ/4HLmErz2wat4EhgzEdaq7HTEwbp9kUyL+LQ6BzGGu8QjtgFRAs+qTFyN VKvdAAW/DHPKk9CPNNONTtyryElj14qV2hPKBJBYyYuAzXNY5cXQ== X-Gm-Gg: AZFdTZdQsVqX9HVeeRuJaVb3jdWIr9s5IjsCpVOwC+R0cNgxKVESBsQ8SWHHSHvtLHZ KxW+SneYqGYt5daZTG0PME2Y9gkmzqS1xMZeRd0aXfblAw15HHyrNzcfV4nkV5lQtEr0umM/daM TFND6RJziAia3z4uEOBMP6nnQ1nLlI8gNheTQ8w3+iZyrB2qSXUSdcMu1reZRxVHGEtoag1/ac0 m7JNzK8zbIZ58HbYnWh+/B2aILeAP/NcssfWrGPhdOBZcJEF6/6FmSGjLPpz7RqqRjxf/Yh395M scvA2W3leYYuL376W5fziZ0o0LjArQL8w73adNF8dydWwAyflKCcfqy9Wzegthh7duVcBRYCfkv rhSWFxgYyQG9kXyqs+13vix0RndF6CBS7X5FaKvi8/mnpaxL1rwLWVZtLmJ+8IBJ1CPkY6Gk95I dy7pVpqOY+MaMPKB4a9etVGjuuu7Btp5bUaoXKsMAEC4SKwf/rKspqMMm4lOdraPge42kgotcVa F+bGsFysWDbbuDbm4I2DYG+haiwEeHAtltChjvu5N8fd45wmPwiUIh7A9t1XDgMn4cRMgICVL8b Q5CRsZEnomnQccGBdUHIdvHoGw== X-Received: by 2002:a17:903:b4b:b0:2e2:d09f:d770 with SMTP id d9443c01a7336-2f03f18fcdbmr418854775ad.26.1796182082473; Tue, 01 Dec 2026 19:28:02 -0800 (PST) Received: from plin-1878 ([136.226.240.169]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0b58fce71sm139657385ad.45.2026.12.01.19.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 19:28:01 -0800 (PST) Date: Wed, 2 Dec 2026 11:27:53 +0800 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, raymond.mao@riscstar.com, anup@brainfault.org, pawandeep.oza@oss.qualcomm.com Subject: Re: [RFC PATCH v3 3/3] dt-bindings: access-controllers: Add SiFive WorldGuard Checker Message-ID: References: <20260812122131.1534906-1-peter.lin@sifive.com> <20260812122131.1534906-4-peter.lin@sifive.com> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260812122131.1534906-4-peter.lin@sifive.com> On Wed, Aug 12, 2026 at 08:21:31PM +0800, Yu-Chien Peter Lin wrote: > Add binding for the SiFive wgChecker, a programmable access controller > integrated in the interconnect fabric of RISC-V Worlds-capable SoCs. > > At this initial stage, the binding is designed for M-mode firmware > to configure wgChecker partitions during platform initialization. > Linux typically runs as an untrusted World and does not require a > wgChecker driver; instead, it operates within the constraints enforced > by firmware-configured partitions. > > wgChecker acts as an access-controllers provider, with consumers > (protected devices) referencing it via the standard access-controllers > phandle to declare their access requirements. > > Link: https://github.com/riscvarchive/security/blob/main/papers/worldguard%20proposal.pdf > Signed-off-by: Yu-Chien Peter Lin > --- > Changes v2->v3: > - Drop sifive,trustedwid property > - Reposition YAML file to bindings/access-controllers (Krzysztof) > - Fix compatible string (Krzysztof and Conor) > - Drop unneed description from stardard property (Krzysztof) > - Use consistent quotes (Krzysztof) > - Keep access controller provider node only (Krzysztof) > - Fix node name (Conor) > - Rename sifive,protected-region to sifive,wg-region > --- > .../access-controllers/sifive,wgchecker2.yaml | 178 ++++++++++++++++++ > 1 file changed, 178 insertions(+) > create mode 100644 Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml > > diff --git a/Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml b/Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml > new file mode 100644 > index 000000000000..23ff7d6ef08e > --- /dev/null > +++ b/Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml > @@ -0,0 +1,178 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright (C) 2026 SiFive, Inc. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/access-controllers/sifive,wgchecker2.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: SiFive WorldGuard Checker > + > +maintainers: > + - Yu-Chien Peter Lin > + > +description: | > + The RISC-V Worlds ISA extension defines World IDs (WIDs) as architectural > + identifiers that tag each system transaction with its originating context. > + System integrators assign WIDs to execution contexts such as privilege > + modes, trusted execution environments, or other isolation boundaries. > + > + The SiFive WorldGuard Checker is a hardware firewall positioned in the > + system interconnect fabric. It supports up to 32 WIDs and inspects every > + transaction, evaluating the WID against access control policies encoded > + in checker slots for each protected resource. Transactions from > + unauthorized WIDs are blocked and reported as bus errors, interrupts, or > + both. > + > + This enables spatial partitioning of memory regions and memory-mapped > + devices across execution contexts. Different address ranges can enforce > + distinct policies, allowing isolated workloads to coexist with > + hardware-enforced protection. > + > + The wgChecker acts as an access-controller provider as defined in the > + access-controllers framework. Protected devices are consumers that > + declare their access policy via the access-controllers property. > + > +allOf: > + - $ref: /schemas/access-controllers/access-controllers.yaml# > + > +properties: > + compatible: > + items: > + - enum: > + - qemu,wgchecker2 > + - const: sifive,wgchecker2 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + description: > + Interrupt line asserted when a WID access violation is detected and > + interrupt reporting is enabled in the slot configuration (IR or IW > + bits set). > + > + "#access-controller-cells": > + const: 1 > + description: | > + Specifies the partition identifier to reference a partition child > + node that defines the access control region, WID permissions, and > + access failure configuration. The special ID 0xFFFFFFFF indicates > + unprotected mode, granting unrestricted access to the device. "Unprotected" is misleading, since an access is only whitelisted by a partition. I will rephrase it in v4 to: The special ID 0xFFFFFFFF indicates that the consumer is not associated with any partition. No partition applies to it and no access is granted Regards, Peter Lin > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > +patternProperties: > + "^partition@[0-9a-f]+$": > + type: object > + additionalProperties: false > + > + properties: > + reg: > + maximum: 0xFFFFFFFE > + description: > + Partition identifier. Must be unique within the wgChecker node. > + The value 0xFFFFFFFF is reserved for unprotected mode and must > + not be used. > + > + sifive,wg-region: > + $ref: /schemas/types.yaml#/definitions/uint32-array > + description: > + Protected memory region encoded as a base address and size. > + items: > + - description: Upper 32 bits of the base address > + - description: Lower 32 bits of the base address > + - description: Upper 32 bits of the region size > + - description: Lower 32 bits of the region size > + > + sifive,slot-permissions: > + $ref: /schemas/types.yaml#/definitions/uint64 > + description: | > + 64-bit WID permission bitmap. Each WID N uses two consecutive bits: > + - bit[2*N] : Read permission for WID N > + - bit[2*N+1]: Write permission for WID N > + Set bits grant access. > + > + sifive,slot-config: > + $ref: /schemas/types.yaml#/definitions/uint32 > + maximum: 0x1F > + description: | > + Access failure configuration flags for this slot: > + bit[0] (ER): report read violations as bus errors > + bit[1] (EW): report write violations as bus errors > + bit[2] (IR): report read violations via interrupt > + bit[3] (IW): report write violations via interrupt > + bit[4] (L) : lock this slot against further modification > + Bits[5:31] are reserved and must be zero. > + > + required: > + - reg > + - sifive,wg-region > + - sifive,slot-permissions > + - sifive,slot-config > + > +required: > + - compatible > + - reg > + - "#address-cells" > + - "#size-cells" > + - "#access-controller-cells" > + > +additionalProperties: false > + > +examples: > + - | > + // Example 1: Peripheral device protection > + > + access-controller@c1000 { > + compatible = "qemu,wgchecker2", "sifive,wgchecker2"; > + reg = <0xc1000 0x1000>; > + #access-controller-cells = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + interrupts = <80 4>; > + > + partition@0 { > + reg = <0>; > + sifive,wg-region = <0x0 0x000c0000 0x0 0x00001000>; > + sifive,slot-permissions = <0x0 0x000000c3>; > + sifive,slot-config = <0x0f>; > + }; > + }; > + > + - | > + // Example 2: DRAM partitioning with multiple regions > + > + access-controller@40000000 { > + compatible = "qemu,wgchecker2", "sifive,wgchecker2"; > + reg = <0x40000000 0x1000>; > + #access-controller-cells = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + interrupts = <82 4>; > + > + partition@0 { > + reg = <0>; > + sifive,wg-region = <0x0 0x80000000 0x0 0x40000000>; > + sifive,slot-permissions = <0x0 0x000000cf>; > + sifive,slot-config = <0x0f>; > + }; > + > + partition@1 { > + reg = <1>; > + sifive,wg-region = <0x0 0xc0000000 0x0 0x01000000>; > + sifive,slot-permissions = <0x0 0x000000cc>; > + sifive,slot-config = <0x0f>; > + }; > + > + partition@2 { > + reg = <2>; > + sifive,wg-region = <0x0 0xc1000000 0x0 0x3f000000>; > + sifive,slot-permissions = <0x0 0x000000cf>; > + sifive,slot-config = <0x0f>; > + }; > + }; > -- > 2.43.7 > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C02A606A31A for ; Wed, 2 Dec 2026 03:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=JbMIv1//; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=DwY4yH8X 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:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=m4olPoZIp+PwjmImF+7+ywCVrV9gyZ0jbXrYjJWnqao=; b=JbMIv1//I2w6FOXeWhvxgq/Jjt bI6NFpuhYhwGZ4aZ9LXWgEBTES+RVkeKUDLE3VrEu7mn4JP86S2ehHwZv4FMT3iAb51R1Gi0u/pO9 mf5e9Wy4wNgNIT9x9FaMnBCb1k/KZs/97l7KkS5POHq/kaWq/0Geww79qoKgk1H29bt7k/8bP8ntE ZuIb5TlxAG526K5ie/k5rlLtciG2i1+tNJb9Nb+BVdXuDzpj9T5u7rrXJEu6G/cKtVmoADB6r2PZH rbb/r54MYoKdaCl1uKJS0HTWz893p97dVSmM6sfvA/cF2yUWk+3+bz/Be6zsp1Bux6EkK6yFRyFQa KwBsMifA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYb0o-0000000A68F-1xS0; Wed, 02 Dec 2026 03:28:06 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYb0l-0000000A67u-3DyN for linux-riscv@lists.infradead.org; Wed, 02 Dec 2026 03:28:05 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2f05bc71e01so53558135ad.0 for ; Tue, 01 Dec 2026 19:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1796182082; x=1796786882; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Jqq8Q3Xxux8wWj8Fd9bl0a4Yyhv2jDxPGLAcxTr5dTw=; b=DwY4yH8X9EePl8T72pKELDW979mPODMx+w0NqHd/QcffKbEzkDL0MI6pU80ybS3tAF 5Ef8Yo+RsjiYIxyW6T0bcI8V3Ws3sLuAp0p9Gj4au38bd8OVNqm5B4/qCgbUCo70Li9P WD7F5GX4QNs65Z/RyBCmwVJoUApJdayUcbYn8ZguGiUf366TGSe9pWGtnDqnVr7cNlu2 cnyT0sMhU4eOmJ5ARNmFTxm2Z2otiVZz2q4fDURur6wXb9pmmbt/6BhipgBNLf/WC82z gf0S6kvdmrKNcPm1ZT+/GzI00Y3AxYaWZ4PfkYnqLAQaPnXxHudLiziJPPP2zpQWK5c/ Uvmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796182082; x=1796786882; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Jqq8Q3Xxux8wWj8Fd9bl0a4Yyhv2jDxPGLAcxTr5dTw=; b=e2hihSsbX6JhGDIITKFlED20wh0rETfO7YWwl03b/3LTLt+wlc2/EW+qmPhnsBHUnC Ov+ZHrgfnGvXuV8uTGifmp5ukSuXrD4vyKO5ZHGoC2W7TDFqkzm2tdGwTMU/B274HRPg qFOlpLFGEiXkFVKKL4hZAQ3qKd6cCJZA2OoKTue/9896BvIbumxbSS/I3eChon8rDUch DbFOXwdJ1WIDdjq85F10hksNn5+8hBPrdLJX9kr6+GV9VGnM871jlncLZgB6yIiuBiOn IlHGQsNlhsGfYab0s6/TGqiiWwDx932focTVZGYsnfYbFD/fwQEoUfEPpzgryEBKpgK/ mNSw== X-Forwarded-Encrypted: i=1; AL+hErFZKaxaBOktWUB5PjEwMBQC8N2USOYRwdQG4rQJFXyPPcQsRcs3ITfYvw81x/OJNwWoU6/C0bIhruhaFA==@lists.infradead.org X-Gm-Message-State: APuU4Z+7Qd3rTCK6AG8lb0ENat/hIbHm5huAQqPnyj8KzIBfO1iNfy98 V9rSvDBpkVQfoRTL/6MSIOvxzrLEgaUmEW7m/SIHxUYUqJFupXpmxgzsRPtfh8XnazU= X-Gm-Gg: AZFdTZfF/FHmg/N9RBRyRBGfdOzyt08exvtPmj64Z5Sh/AomtuhvidtkydTHuMteu4f G7NMsn9t1BUACm7pM/nht0r8UjGm1ZYs562B9WahjqaI3i4O/sLsOCtj1nwPpFuO8Or/SJVnlpj PoPHGR0HGP8pD0bKIwHXZ+FhAjOiFa/Wq9qK7ptiEzjN2lMGtX8wstoIflpKzWafnWDDjM7pNaG sM8nqJS2mF5j7PaqkEDBn+JbD0Gv9hgv7feMzRbAjCRqwGWmEYGpLDCgws1pLXU1KmOqgTD73BR CVdRoHu2TTH7C0Uf7Bdyt1MV7I+IPqVXiHKayidDfhietJepYWagYBK1fCG0LPPHh9dNkAQo48M skU3bSwFiTJLDDPy26L7nhV2SjH/uegRJTyer2g127bSxYBsvx+XO2fP4YqfvxUvttInxzy+WhM 5m7WZzj9mQgFPIFA8VgQsG0f31OTMSkUWRZV6nW29nX39wM5yuyK1CcX6rGLt+Uw2OMv7FZLW0F 06FzDHC2PGf7niQ7zhp6AG+RTlOiR647t1drtO3uRkaWIThfCYLAelY65WBYwP7vJ32fJVIvCCj tsPtSWz9Oraq/JIlBKa7ltm5zw== X-Received: by 2002:a17:903:b4b:b0:2e2:d09f:d770 with SMTP id d9443c01a7336-2f03f18fcdbmr418854775ad.26.1796182082473; Tue, 01 Dec 2026 19:28:02 -0800 (PST) Received: from plin-1878 ([136.226.240.169]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0b58fce71sm139657385ad.45.2026.12.01.19.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 19:28:01 -0800 (PST) Date: Wed, 2 Dec 2026 11:27:53 +0800 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, raymond.mao@riscstar.com, anup@brainfault.org, pawandeep.oza@oss.qualcomm.com Subject: Re: [RFC PATCH v3 3/3] dt-bindings: access-controllers: Add SiFive WorldGuard Checker Message-ID: References: <20260812122131.1534906-1-peter.lin@sifive.com> <20260812122131.1534906-4-peter.lin@sifive.com> X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260812122131.1534906-4-peter.lin@sifive.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_192803_857811_29B528B3 X-CRM114-Status: GOOD ( 27.37 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Aug 12, 2026 at 08:21:31PM +0800, Yu-Chien Peter Lin wrote: > Add binding for the SiFive wgChecker, a programmable access controller > integrated in the interconnect fabric of RISC-V Worlds-capable SoCs. > > At this initial stage, the binding is designed for M-mode firmware > to configure wgChecker partitions during platform initialization. > Linux typically runs as an untrusted World and does not require a > wgChecker driver; instead, it operates within the constraints enforced > by firmware-configured partitions. > > wgChecker acts as an access-controllers provider, with consumers > (protected devices) referencing it via the standard access-controllers > phandle to declare their access requirements. > > Link: https://github.com/riscvarchive/security/blob/main/papers/worldguard%20proposal.pdf > Signed-off-by: Yu-Chien Peter Lin > --- > Changes v2->v3: > - Drop sifive,trustedwid property > - Reposition YAML file to bindings/access-controllers (Krzysztof) > - Fix compatible string (Krzysztof and Conor) > - Drop unneed description from stardard property (Krzysztof) > - Use consistent quotes (Krzysztof) > - Keep access controller provider node only (Krzysztof) > - Fix node name (Conor) > - Rename sifive,protected-region to sifive,wg-region > --- > .../access-controllers/sifive,wgchecker2.yaml | 178 ++++++++++++++++++ > 1 file changed, 178 insertions(+) > create mode 100644 Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml > > diff --git a/Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml b/Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml > new file mode 100644 > index 000000000000..23ff7d6ef08e > --- /dev/null > +++ b/Documentation/devicetree/bindings/access-controllers/sifive,wgchecker2.yaml > @@ -0,0 +1,178 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright (C) 2026 SiFive, Inc. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/access-controllers/sifive,wgchecker2.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: SiFive WorldGuard Checker > + > +maintainers: > + - Yu-Chien Peter Lin > + > +description: | > + The RISC-V Worlds ISA extension defines World IDs (WIDs) as architectural > + identifiers that tag each system transaction with its originating context. > + System integrators assign WIDs to execution contexts such as privilege > + modes, trusted execution environments, or other isolation boundaries. > + > + The SiFive WorldGuard Checker is a hardware firewall positioned in the > + system interconnect fabric. It supports up to 32 WIDs and inspects every > + transaction, evaluating the WID against access control policies encoded > + in checker slots for each protected resource. Transactions from > + unauthorized WIDs are blocked and reported as bus errors, interrupts, or > + both. > + > + This enables spatial partitioning of memory regions and memory-mapped > + devices across execution contexts. Different address ranges can enforce > + distinct policies, allowing isolated workloads to coexist with > + hardware-enforced protection. > + > + The wgChecker acts as an access-controller provider as defined in the > + access-controllers framework. Protected devices are consumers that > + declare their access policy via the access-controllers property. > + > +allOf: > + - $ref: /schemas/access-controllers/access-controllers.yaml# > + > +properties: > + compatible: > + items: > + - enum: > + - qemu,wgchecker2 > + - const: sifive,wgchecker2 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + description: > + Interrupt line asserted when a WID access violation is detected and > + interrupt reporting is enabled in the slot configuration (IR or IW > + bits set). > + > + "#access-controller-cells": > + const: 1 > + description: | > + Specifies the partition identifier to reference a partition child > + node that defines the access control region, WID permissions, and > + access failure configuration. The special ID 0xFFFFFFFF indicates > + unprotected mode, granting unrestricted access to the device. "Unprotected" is misleading, since an access is only whitelisted by a partition. I will rephrase it in v4 to: The special ID 0xFFFFFFFF indicates that the consumer is not associated with any partition. No partition applies to it and no access is granted Regards, Peter Lin > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > +patternProperties: > + "^partition@[0-9a-f]+$": > + type: object > + additionalProperties: false > + > + properties: > + reg: > + maximum: 0xFFFFFFFE > + description: > + Partition identifier. Must be unique within the wgChecker node. > + The value 0xFFFFFFFF is reserved for unprotected mode and must > + not be used. > + > + sifive,wg-region: > + $ref: /schemas/types.yaml#/definitions/uint32-array > + description: > + Protected memory region encoded as a base address and size. > + items: > + - description: Upper 32 bits of the base address > + - description: Lower 32 bits of the base address > + - description: Upper 32 bits of the region size > + - description: Lower 32 bits of the region size > + > + sifive,slot-permissions: > + $ref: /schemas/types.yaml#/definitions/uint64 > + description: | > + 64-bit WID permission bitmap. Each WID N uses two consecutive bits: > + - bit[2*N] : Read permission for WID N > + - bit[2*N+1]: Write permission for WID N > + Set bits grant access. > + > + sifive,slot-config: > + $ref: /schemas/types.yaml#/definitions/uint32 > + maximum: 0x1F > + description: | > + Access failure configuration flags for this slot: > + bit[0] (ER): report read violations as bus errors > + bit[1] (EW): report write violations as bus errors > + bit[2] (IR): report read violations via interrupt > + bit[3] (IW): report write violations via interrupt > + bit[4] (L) : lock this slot against further modification > + Bits[5:31] are reserved and must be zero. > + > + required: > + - reg > + - sifive,wg-region > + - sifive,slot-permissions > + - sifive,slot-config > + > +required: > + - compatible > + - reg > + - "#address-cells" > + - "#size-cells" > + - "#access-controller-cells" > + > +additionalProperties: false > + > +examples: > + - | > + // Example 1: Peripheral device protection > + > + access-controller@c1000 { > + compatible = "qemu,wgchecker2", "sifive,wgchecker2"; > + reg = <0xc1000 0x1000>; > + #access-controller-cells = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + interrupts = <80 4>; > + > + partition@0 { > + reg = <0>; > + sifive,wg-region = <0x0 0x000c0000 0x0 0x00001000>; > + sifive,slot-permissions = <0x0 0x000000c3>; > + sifive,slot-config = <0x0f>; > + }; > + }; > + > + - | > + // Example 2: DRAM partitioning with multiple regions > + > + access-controller@40000000 { > + compatible = "qemu,wgchecker2", "sifive,wgchecker2"; > + reg = <0x40000000 0x1000>; > + #access-controller-cells = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + interrupts = <82 4>; > + > + partition@0 { > + reg = <0>; > + sifive,wg-region = <0x0 0x80000000 0x0 0x40000000>; > + sifive,slot-permissions = <0x0 0x000000cf>; > + sifive,slot-config = <0x0f>; > + }; > + > + partition@1 { > + reg = <1>; > + sifive,wg-region = <0x0 0xc0000000 0x0 0x01000000>; > + sifive,slot-permissions = <0x0 0x000000cc>; > + sifive,slot-config = <0x0f>; > + }; > + > + partition@2 { > + reg = <2>; > + sifive,wg-region = <0x0 0xc1000000 0x0 0x3f000000>; > + sifive,slot-permissions = <0x0 0x000000cf>; > + sifive,slot-config = <0x0f>; > + }; > + }; > -- > 2.43.7 > _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv