From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 960BC158D94 for ; Thu, 11 Jul 2024 10:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720694102; cv=none; b=c9/7P3ocXzGkUJeLiCsRZy3WSuBhQG8cEkyWNh5dA9l3wr/K+f7uxvjnohuo3BRvcsKEaZm1L3iAOjqrSJb5sGqJHhm3arm1nslvcZsQ56ZxZVquiHKjRRn6aiwGlSlyaZ3+sZ8Dkr/wK7aDpF6s8822+VyNi1csAC3SbjKLKbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720694102; c=relaxed/simple; bh=azTey6Mbe5LDqWSTEruz0j0tEwPtlNQpE18cgLltbe0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=X3OGwys3hW7JC9Nnl9AXiwzOQIWd07vTnbF1+IabQ732oJaoJlofwdDvfSc6XRSLvYBJxMZwqChZvpXNoeDyAOqJy/Wx4AZkZLPMKSLVy5RWKgnKDj64r79a0DPrZykH7fC7Tn8fealss+0qynIjoh0QBt5SkwWZpltNCVtKrq4= 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=LGsxiFLG; arc=none smtp.client-ip=209.85.167.175 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="LGsxiFLG" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3cabac56b38so460345b6e.3 for ; Thu, 11 Jul 2024 03:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1720694099; x=1721298899; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=81XIkWS3ndQ7+PCCdHsExXmF1eARnUo6Gh7sCw+xD4Y=; b=LGsxiFLGgctkcNa4uIYDdYdHDygJkyF6j1TZqjgI4gHz06/fyoJSAZoPB6ZlFFx0kd VjZSnUt9cKEfBSxvYZyGVnP96WTtU8NA7imxRcwnGO9jiRK+pg0wP6+t1YPsxMbi++OE m0zL7q5JwMCBT2ZNh5gR3p+JgQZayfjAJ+mRj2YRucc5/adO6bmsfn8wDwsQOyBx0LuC hfXQW5rdiyj6lV/rIo0ynjHLlITt/YZ9GpW3QsmRm1n6d2BMql6V4YBNuh6MJyOtoe59 o6HSNbABbAId8FajB06EVDjhs5H7SBhsyFiGgtF733/qMTRkoaGwo+5v7snEu3mG1fPc a2mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720694099; x=1721298899; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=81XIkWS3ndQ7+PCCdHsExXmF1eARnUo6Gh7sCw+xD4Y=; b=lKd/3ZMfI4dPuQqAW2PPzPRaK9z3QCzWp2PQtZgb3WFPPYGbR1Ndg0cq7LRShbywJB 6zPAHUBmcwMw8X+nS8U5IIQgzPpqJXRdjKGgQGV9VaUvkW0OhzJcIjr7CxWfIeQtxeUw kBjF9xwHMER8oklUqkXkBmkjIgGQ85c/V8IIt+dEZoin6OUXPn+L27P3kX6if6l16cTM W5btK+Xac5L2ToPpRWeHUrIDZTNt/5TMDhVSFHS920tj5fTcqzoKr8zrXnqrb2FysBGc AcGCzA9wnJv7Wr7/qFf73cg2rOQvkZpcIpPJBuH1kyC7wexQo/w2gNITdh0D03qG4Ay2 s1tg== X-Forwarded-Encrypted: i=1; AJvYcCW6DkqPHcTz95vsDR3GACpL8Z8uhKLCJuK54lYMy0SQR2exf4P85KEqRS45f7uozA4pS1L7YPN/nE3X3go6xkEVQAympYZWys1NBqht X-Gm-Message-State: AOJu0YwaZDJfbElfPKEUDzgoFiJZUhMIGb8b161ar8i4/Zy7gviHanfk 9fx46HKWBBjMYTNAyFRTyAM80blYGjaw40fVmFDhk/JAnxn0cJ54aA/5dCdXsP/JmSS96xW/7XJ Y1JpPKp1V6YrFwLVwzemnnA2d7ZAVf0M6kd0n+/vfYinkXi/rkFA= X-Google-Smtp-Source: AGHT+IFJB5x3pYSD0y4Q5r4wWK4Y3rLRAWXELD1JUSAm8Ow50OC5okYZ99DPR11L57LtC71EXPAYdgoDHtJYINBxm0g= X-Received: by 2002:a05:6808:308d:b0:3d9:2415:da77 with SMTP id 5614622812f47-3d93c073d69mr9586482b6e.25.1720694099522; Thu, 11 Jul 2024 03:34:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240628093711.11716-1-yongxuan.wang@sifive.com> <20240628093711.11716-3-yongxuan.wang@sifive.com> <20240628-clamp-vineyard-c7cdd40a6d50@spud> <402C3422-0248-4C0F-991E-C0C4BBB0FA72@jrtc27.com> <20240630-caboose-diameter-7e73bf86da49@spud> In-Reply-To: <20240630-caboose-diameter-7e73bf86da49@spud> From: Yong-Xuan Wang Date: Thu, 11 Jul 2024 18:34:49 +0800 Message-ID: Subject: Re: [PATCH v6 2/4] dt-bindings: riscv: Add Svade and Svadu Entries To: Conor Dooley Cc: Jessica Clarke , LKML , linux-riscv , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, Greentime Hu , Vincent Chen , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Conor and Jessica, On Sun, Jun 30, 2024 at 10:09=E2=80=AFPM Conor Dooley wr= ote: > > On Sat, Jun 29, 2024 at 02:09:34PM +0100, Jessica Clarke wrote: > > On 28 Jun 2024, at 17:19, Conor Dooley wrote: > > > > > > On Fri, Jun 28, 2024 at 05:37:06PM +0800, Yong-Xuan Wang wrote: > > >> Add entries for the Svade and Svadu extensions to the riscv,isa-exte= nsions > > >> property. > > >> > > >> Signed-off-by: Yong-Xuan Wang > > >> --- > > >> .../devicetree/bindings/riscv/extensions.yaml | 28 +++++++++++++++++= ++ > > >> 1 file changed, 28 insertions(+) > > >> > > >> diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml= b/Documentation/devicetree/bindings/riscv/extensions.yaml > > >> index 468c646247aa..c3d053ce7783 100644 > > >> --- a/Documentation/devicetree/bindings/riscv/extensions.yaml > > >> +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml > > >> @@ -153,6 +153,34 @@ properties: > > >> ratified at commit 3f9ed34 ("Add ability to manually tri= gger > > >> workflow. (#2)") of riscv-time-compare. > > >> > > >> + - const: svade > > >> + description: | > > >> + The standard Svade supervisor-level extension for SW-ma= naged PTE A/D > > >> + bit updates as ratified in the 20240213 version of the = privileged > > >> + ISA specification. > > >> + > > >> + Both Svade and Svadu extensions control the hardware be= havior when > > >> + the PTE A/D bits need to be set. The default behavior f= or the four > > >> + possible combinations of these extensions in the device= tree are: > > >> + 1) Neither Svade nor Svadu present in DT =3D> > > > > > >> It is technically > > >> + unknown whether the platform uses Svade or Svadu. Su= pervisor may > > >> + assume Svade to be present and enabled or it can dis= cover based > > >> + on mvendorid, marchid, and mimpid. > > > > > > I would just write "for backwards compatibility, if neither Svade nor > > > Svadu appear in the devicetree the supervisor may assume Svade to be > > > present and enabled". If there are systems that this behaviour causes > > > problems for, we can deal with them iff they appear. I don't think > > > looking at m*id would be sufficient here anyway, since the firmware c= an > > > have an impact. I'd just drop that part entirely. > > > > Older QEMU falls into that category, as do Bluespec=E2=80=99s soft-core= s (which > > ours are derived from at Cambridge). I feel that, in reality, one > > should be prepared to handle both trapping and atomic updates if > > writing an OS that aims to support case 1. > > I guess that is actually what we should put in then, to use an > approximation of your wording, something like > Neither Svade nor Svadu present in DT =3D> Supervisor software sh= ould be > prepared to handle either hardware updating of the PTE A/D bits o= r page > faults when they need updated > ? Thank you! I will update in the next version. Regards, Yong-Xuan