From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 EADA2428820 for ; Tue, 11 Aug 2026 09:41:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786441295; cv=none; b=WkpFVZkyRixWyM4pJbBT2VybjOE+bHiEBtedBK2d2unJUFKCVazMPEgC92iBQybEUc45h9kdp2ZVIXkepSMT9jgsZGavgYdsLi9FVgjF2J3ZwBaxl1sLIt+9FuPs/KUpuizoM3snvUVbZukDT1Qi50cgZVJ9WGYWZjlrjIGJKBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786441295; c=relaxed/simple; bh=8gTERy3ZC9SNhuNVJ+JX9P5zo7akI/6Sne0QYTTsk4s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JgS4STDS9HeWPUPYfTRDnNXfqamPd/5UwGVp1elX684Oh/NbAiB6JIscZNWzv5fh2UNujny3wZlFXHvRy08waUlB36ofR0augj0J16MvXxdFQPPuyMZy4qGIo+cRIsW7FAZiumnGQdNbpgUw6C3UZCrwx6mE4GyS6tomLhANTls= 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=b3Px12R9; arc=none smtp.client-ip=209.85.210.169 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="b3Px12R9" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-84e507b079dso1714450b3a.0 for ; Tue, 11 Aug 2026 02:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1786441293; x=1787046093; 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=JpC58LrDcTGTf2uV72KqZqamgkq1gihslLDaf+pUTdY=; b=b3Px12R93Nod8EGg4JDwi/kzGyxa+u/dnS2dCZojTvvmTFYNSEkKCRjhRF1R64erYp JOIKO14r1aKS2yvlC9XR/NPqQKs/LLqgNeTW4y6mWsKrLOtgvvLcsc0KCHi0kHVSfrH4 QfFa3ZQ5eAsGCNwC/ZRdY+J5aYPKA4Gb9EoKtApKXpZuuks+iZUt2QvIZbfObSJiGVVK FPUNtRgORnwOX0MofdvC+JhqzzacV19VLDtA1kXOPyzUm48oVIj1nIuAKkv0K1r1hZeo 8pI6bsV1WPAl9/6bG+N/z4upLokHYp2cXkwxs3t3Il+rvWjm9YMVFPqXngh8UIxbPH0z GnSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786441293; x=1787046093; 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=JpC58LrDcTGTf2uV72KqZqamgkq1gihslLDaf+pUTdY=; b=Rk92jtdNaUQLtYdpZIzAMHeUR423xbAfxIMFK2+vKibdiQ8d/SgE9Pk9sPDrx0krt+ oxa1FNYhJ7bSq7AZyK1/flNC1ruxeJRLuqrSbUrBlWb62p19VkC5Ad5jX/qsBf2P1RQB gH29d3rFEp060NOZZNjCOu2HbAQxX5LunXL5ni+CdCfpqbkeTnzLTv+rYF9/n8u/zyGm iujsXNJfKVpQ7bo7Ry1c6uSJmq8PRaFrErrgdj3J6FHJRY7l86JQCLK30udqlEeWB7Tn lVaRibA5Yo6Gyh0KM5E3cIHy1yMQRNOdzshDOl0hbi80COdQmrgtT75faN12ZUBzBX2p tN0A== X-Forwarded-Encrypted: i=1; AHgh+Rp2ymkHtF/RRpU8FgASB6yGnlUXGxKJ1k/RlhK8mMoch1vbAU91t6GfIzOAhJ3tgchQw8tytMm7zu6k66A=@vger.kernel.org X-Gm-Message-State: AOJu0Ywi2T8nq/v6jd0ez7TOrcoRWsp+KYAGath0mmDZIRfhlCqWGRS9 kAO7mKF4/q08NHDIj/H5gH56R1gOZ8kTXnLNbUUBfyGH4uZGwfdAuL0GgDx1yakwOKQ= X-Gm-Gg: AR+sD13iggA4Ujz1xeQ8ZS/46XEGzEh9fRnhGImMA8RgjEG24RM1C8JVMm+lYrV/9Ij Nx+SttxvW4NBR1khP+yvMGDnRY62iF9IWSfSPpQQUjvaOF+S6mTO08mvX1hAquz0NMW/DR+Zarm s/mSpyUI3e/CHjguydAhX851UMTogaBkubCBlWtISMlMPlZv5J+abJekkcnyU4PERff7noXghWY X3SfMYww3u9JfZyASHfRf4Ox18AOsn3XThXBKesWOnYn1kdxua7hzatyY5tS7anZUSI5Z9v593u Znxe/vN6WNKWdmwXAqci03tjiBXE5QPwJKMV23NT3UmTYrMJNrjxA0KmwBgR9pyffzVhW14HTmN 0fYn/VV9QrG+sae0Plt/H6zpmBDtl6u8xNA27WSIccCXUmDAAGfnnq2kCr8c2WxKw0NktPCbdJk g+u4azFspVBHAE13O/quWnaTsJ4XWjYQwQoGNo1anvgtivdtwN0Ur17e4+Dro= X-Received: by 2002:a05:6a00:368f:b0:845:d6a5:716b with SMTP id d2e1a72fcca58-84fa883fb23mr1845215b3a.23.1786441293155; Tue, 11 Aug 2026 02:41:33 -0700 (PDT) Received: from plin-1878 ([136.226.240.195]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbed8bb9569sm637314a12.3.2026.08.11.02.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 02:41:32 -0700 (PDT) Date: Tue, 11 Aug 2026 17:41:22 +0800 From: Yu-Chien Peter Lin To: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, 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, guodong@riscstar.com, 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 Subject: Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker Message-ID: References: <20260729163908.249838-1-peter.lin@sifive.com> <20260729163908.249838-4-peter.lin@sifive.com> <20260730-towering-modest-horse-ccbdcc@quoll> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260730-towering-modest-horse-ccbdcc@quoll> Hi Krzysztof, On Thu, Jul 30, 2026 at 09:35:02AM +0200, Krzysztof Kozlowski wrote: > On Thu, Jul 30, 2026 at 12:39:08AM +0800, Yu-Chien Peter Lin wrote: > > Add YAML binding schema for the SiFive wgChecker, a programmable > > There is no "YAML" binding schema. > > > access controller integrated in the interconnect fabric of RISC-V > > Worlds-capable SoCs. > > > > wgChecker enforces World ID (WID) based access control on downstream > > bus transactions. Each checker slot encodes a 2-bit permission field > > per WID (read/write), enabling fine-grained memory partitioning and > > device isolation between execution contexts. Violations are reported > > via bus errors, interrupts, or both, selectable and lockable per slot. > > > > The binding registers wgChecker as an access-controllers provider. > > Consumers (i.e. its protected device) reference it via the standard > > access-controllers phandle to declare their access requirements. > > > > Also document the sifive,trustedwid property for the /cpus node, > > identifying the privileged WID authorized to configure all checkers > > on the platform. > > > > Link: https://github.com/riscvarchive/security/blob/main/papers/worldguard%20proposal.pdf > > Signed-off-by: Yu-Chien Peter Lin > > Reviewed-by: Zong Li > > Reviewed-by: Jim Shu > > What exactly these reviews pointed out? > > > --- > > .../devicetree/bindings/riscv/worlds.yaml | 9 + > > .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ > > 2 files changed, 365 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml > > > > diff --git a/Documentation/devicetree/bindings/riscv/worlds.yaml b/Documentation/devicetree/bindings/riscv/worlds.yaml > > index cc8b3747591e..c39a06c2dd8d 100644 > > --- a/Documentation/devicetree/bindings/riscv/worlds.yaml > > +++ b/Documentation/devicetree/bindings/riscv/worlds.yaml > > @@ -34,6 +34,14 @@ properties: > > minimum: 2 > > maximum: 64 > > > > + sifive,trustedwid: > > No, for the same reasons. > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + maximum: 31 > > + description: | > > + The World ID (WID) designated as the trusted WID for this platform. > > + Transactions tagged with this WID are authorized to access and configure > > + WorldGuard blocks, including wgCheckers and wgMarkers. > > + > > additionalProperties: true > > > > examples: > > @@ -44,6 +52,7 @@ examples: > > #size-cells = <0>; > > timebase-frequency = <1000000>; > > riscv,nworlds = <4>; > > + sifive,trustedwid = <3>; > > > > cpu@0 { > > device_type = "cpu"; > > diff --git a/Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml b/Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml > > new file mode 100644 > > index 000000000000..c025a4765cb3 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml > > No, you do not get per vendor directory. NAK. > > Do you see Qcom? Or TI? Or NXP? > > Place it in appropriate directory matching the hardware. Will fix, thanks. > > > > @@ -0,0 +1,356 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +# Copyright (C) 2026 SiFive, Inc. > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/sifive/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 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. The hardware > > + supports up to 32 World IDs. > > + > > + The World ID authorized to configure WorldGuard blocks is specified by the > > + sifive,trustedwid property in the /cpus node. > > + > > +allOf: > > + - $ref: /schemas/access-controllers/access-controllers.yaml# > > + > > +properties: > > + compatible: > > + oneOf: > > + - items: > > + - const: qemu,wgchecker2 > > + - const: sifive,wgchecker2 > > + - const: sifive,wgchecker2 > > You need soc specific compatibles. > > I do not believe the two review tags did any actual real review. They > would tell you to read writing bindings document, wouldn't they? My bad, will do. > > > + > > + reg: > > + maxItems: 1 > > + description: > > + Base address and size of the wgChecker memory-mapped I/O registers. > > Again, standard comment. Why do you need description? Sure, will drop. > > > + > > + 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. > > + > > + '#address-cells': > > Use consistent quotes. Sure. > > > + 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,protected-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,protected-region > > + - sifive,slot-permissions > > + - sifive,slot-config > > + > > +required: > > + - compatible > > + - reg > > + - '#address-cells' > > + - '#size-cells' > > + - '#access-controller-cells' > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + #include > > + > > + // Example 1: Peripheral device protection > > + > > + cpus { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + timebase-frequency = <1000000>; > > + riscv,nworlds = <4>; > > + sifive,trustedwid = <3>; > > + > > + cpu@0 { > > + device_type = "cpu"; > > + reg = <0>; > > + compatible = "riscv"; > > + riscv,isa-base = "rv64i"; > > + riscv,isa-extensions = "i", "m", "a", "c", "smlwid"; > > + riscv,pmwid = <3>; > > + > > + cpu_intc0: interrupt-controller { > > + #interrupt-cells = <1>; > > + compatible = "riscv,cpu-intc"; > > + interrupt-controller; > > + }; > > + }; > > + }; > > + > > + soc { > > + #address-cells = <2>; > > + #size-cells = <2>; > > + > > + uart: uart@1c1000 { > > + compatible = "ns16550a"; > > + reg = <0x0 0x001c1000 0x0 0x1000>; > > + reg-names = "control"; > > + interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; > > + access-controllers = <&wgchecker0 0>; > > + }; > > None of these are relevant. Drop all of the nodes. > > Please read carefully writing bindings and DTS101 slides before posting > next version. Sure, thanks for the tutorial, that's very helpful. Best regards, Peter Lin > > Best regards, > Krzysztof >