From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796182083; b=e3FIJyCcLD0JCZhDXnkgYaOcXLRHWz2NaPOLZYZDINn3sBSME8OpV42WjYkXksNp9wx0 SSwbiDwt5gXVlHhlKHkfIFyVMNSP4CIOuBrmQ5Z8rXXtHlk3HdY6JV02FIslPTNUox5pI YfPeXL1FEMYjXVk+qSzsY3nfyB9fBGz4YzFSulKwrQsVRt8hapUy+Y4IIrfeGqJZXqrL8 Go84DI9nZijQNuwLPZQDvr1t17olNvGAGaEDnMhXIUWYrz0RyarmkDdGrFIsT8LcPaRZT tCSXCCqCHn4mN3c114+yYaR5MDqCG43JKrHX3PCKfbsbuYrtbW+i0GkfB7Zc+kF5c+A== 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-Forwarded-Encrypted: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=U1yhKQeuCHJaOo1ExyRj8CJa+frCkZrKR80OqlhlBZTZDX1hIxLVRhOy2hVmoZ9PgvEl pk3eCuAbBImW7BxocreAokD8XQ/bJmGtPuUhQzqZmxXCJ9GR3Ip4Wco+t7bni7TE6lQwP dvAGMz+sazbwCCsHa7esaz48idF1QqW9aEFhdNOqeiPPQ4pVc2BgKEq/VNA60fHgx3dYf gM94S3ONQJaO+b7na7D24IhOFubzJOlPtRAt4sfs2q/OUcp0PwagALrwP3J3sApHcrCKp 7VSeAW80aqU3RgwvPnq6sPFlfJUUeJsAgq3uFFUE16Da/Ylm2ak3R3I1M51Ou84lJhA== 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=QeUjrOEh; arc=none smtp.remote-ip=209.85.214.180 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 4D6B3606A31A for ; Wed, 2 Dec 2026 03:28:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4D6B3606A31A 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, unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=QeUjrOEh Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2f052ae3c86so68772915ad.1 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=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=QeUjrOEhNaywQCgcpoEA2q8g2a6bLyKJj6isnQ2X8lOPe72uujtn1dfkmhZdagrPI9 JFC1iF65xSv3keuyMlkMrNsBZ6EK3lu49U6aQDdfJEqejP+AMZPjpZcNkE1bOadM74aB 5RaV3opB1GzA5EHaMaZYqa1dSCd7QVuVplFf0uNgUYs6DRpWLbKQ8H2LLs+0jVmxPL1a WHcYoCKUekc5l6ADYEEjoApUknNStd45dXJmglcGNZaPexoaHTEB2SAAIwwQGJLUtc9R 26kI7RimbEErebMIrHkKzLw0ojT0etRUrb3lMeSMgJ4/GXirjTAZTycBROfIHX7zzSVc Y1pg== 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=tb1tV3Q1Ya6NJMOAvsSJS7M8EUUxnhIbegggqTdi8DDNB8SNsStuaDcz7dITVBZvLo Vu8CU9BAghBTl31D2+jIsz4ARP4Lz2Cfk0+LAi65zgbUlVSn8dHrcZoe+S/kH2MXO0BN QOUxXrFkJsb0M0Cf4RxPWGLmdvEqjtv83jn/YA4fd+fyxMQJDDgwnUoDmNTuiH8xQz5j G3g45wWB+N6icy5X5QDViHccYaYhKyUk3siMz2aXZQkKrVkuGFyDC6AO3E0zg4YPLP28 BDgOI5jAFOlwHgrPzPHteEmjQPBrspWn7WaU1ZHZML3etcgnYkNwqev9d5oiGPHU5KSx L4CQ== X-Forwarded-Encrypted: i=1; AL+hErE9TUge0Gd1nBB5mF2ypF+rnczUy55zpaCTTMxpAmbRT9YlA3g16WwGUQxroJT7c2I8N6LXHU4/kjSXq4s=@vger.kernel.org X-Gm-Message-State: APuU4Z+J91Oc6vX1+Ikfww14J3uTrDJabUkKxqQ9sQutZ8fedNesDerh tQKra+TbIRl2FzbwOypNki7Ewq7elvvGxjSBH6eIUuXf6ms7Aa/ZLNFg5KiSm7jJcns= X-Gm-Gg: AZFdTZd0oTVXSmcuvoklvWDFriiB3eo3s6Ro/PO3gksXHp/04wV2FZCn8aV5rjZoZdy E4HL5PEtSfUTOTJGEoBeTdEeBUJCmz0eHShdrmPehLPYpQj+e7v/Ur+8k7WESZMmDXDjPYp56+C r1qWxw2Afn0DwkSFnUMxJFUSOk+RUT/MHEayb2MGo/xoqmvrIqKbMLrzSPiCkELMRoCCGtUVAYm em98vBcx9xdS/Q8wV6uGga738aBp3ybE5qsyyQXF7FeKXca5NMr7DdTL7YZJifQNcojZAuMcd8e X9cQwwaWA5n4zAqnHSsHaM7ZVZ1mzvqoI7sl/0vTTDNELePa2EA5iM7BzwyR4D81szgOslU/MHO NBdXJ3LcoZ5rfbA1IgrjK231iY9uhGVfaoauNiHZLyeQn3WBIPUorWWSgKXXdhUWPIQGlrixLye fN2yWp+ihCvwQ6ngkoQFL32AeZnvU5VAP9zPMMkI7wTIi2cKxqV8SAti4mr3T7ESlFptAjZjwL6 Zdw0OmliWMB6a6NKYxnadjgeGgXymr0SaRnoiQOxOMq1tJoOzMrxSn9CAftcQB+AbGmZBjY3h9Q Xk1dRj1E2DQLn3fpeyQiILdU4Q== 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: linux-kernel@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 >