Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp320346lqo; Wed, 15 May 2024 16:08:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/HCXgH7ofOcqbNnVVMop/rlA2C1+xsDH6jGqDIrZyG8QNTVlFxEISDxPTFiUEsG7sojYIeKii0j3v47zll6vfnekiCfbZHiKJlPeCBw== X-Google-Smtp-Source: AGHT+IF3/nMzmpCL0UDTgsrRbNL02kJc+VOd05K8yQBimejFho4AAwJUd9VCyIdfM5erslOKJ+bF X-Received: by 2002:ac8:7e83:0:b0:43a:f0a3:815 with SMTP id d75a77b69052e-43dfdb807ebmr208192961cf.42.1715814510765; Wed, 15 May 2024 16:08:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715814510; cv=pass; d=google.com; s=arc-20160816; b=p09KXiu8NP1rLtcDPM6fs6TAg1uI8Ae58g2Vv0YOMr8ZHjIGYdn6Ur/wI8lKI+BXFz JFOJyw8GcoWI5XHiXwvFK+6kNXQp6d6mVY1XBqiGlp8LOOQyF4jTKPR9fXcKLk3sS9ld gcdsFGhej7afU/MFP/t04MnxKmOZCJI69R8J/kQCZxpI+fkQyQN2AmCQMKkSkP0OTPcN h61Z+T4ou9V44tIkLpBClzhvL09GCi0ah9xtyNNK7ncJUoSLW3ljutlDRAEL9s3Fvpn0 aI+psxQzyJklMU4aPB6M/507H/iKASxx5foWd6Jme7ClkgoMPnmgK3AioOL/xsvuNuzE 9++w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ke/O00Y/Kjm74N+9XrjAq0nbRjFhCTAJyeNXJqA3ng8=; fh=A6JTFBY4Vh5dCqIEhKyCGQ+GMH6sfQ+FGu7G9zpoxcg=; b=pFCeXLGXRJjsJs2wAvWwXWwmL7pxyVNCwi77jZAGfcVzBMDAOsdzycz8j/Cs4nlxV4 6ttjspGGlqxjQrzQwj7Nux16CV/zXUtVMZMMi4JoxahC4kcIZP+laP1eBxoXo0bESURC 48w2nC/10XnQm7vs08D07dZpIp0UlNdE0PvcgIkKgMQCjWvhPQoRnf5ON3Hd/KvaI0+S eo39rHbuT+Uy2ywXEzl7fX7ukZhtu85kxSZjiJjlE7AIuLeRD2If4xfx9YuQwpFzEkEx uG0GJeJ7JY3ieH5Cbim7Di1hCz6Z6/SKg9F56tu6LdJoP0+tsVAlcZqaimUeUAhRBgt+ Xfog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=pN4tAHtK; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-180464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180464-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a1258si151289761cf.50.2024.05.15.16.08.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 16:08:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=pN4tAHtK; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-180464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180464-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7D7E71C21019 for ; Wed, 15 May 2024 23:08:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D483D482E2; Wed, 15 May 2024 23:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="pN4tAHtK" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 6F2F240861 for ; Wed, 15 May 2024 23:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715814503; cv=none; b=sfgr1EHcXO7bvLXbiZ2iSW/6cgx7iRPqNfhnZ+Lzr8ZVBgoD0piVjFjOqAmWGW3HcjYP7JHD04DLdps3hsra748Xo/AyBrBtXVL3tdeFaH8dixz/HaG1Ygn6o0MFf/ZRUdUSzSYE6e9YCmxcdYq2NvUUSfQSnAqU2Tg1Ok+Pz5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715814503; c=relaxed/simple; bh=xDFUM0sIcSy0DOZxqgnugThNR7lVLaZaiQ6S4YAD66o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SvWAj8fN0QQJMycAB/O2TlXAmuwymp6s5oEz9PG4hoCu3cUCZQ+7dT/t1dTJmzF8Kug7Xp2geATLNvpwaBvJMFTasIYcziUD9t72fDBsHgcgrDQFvkIXyJZv5rhEQBG5XK3De/yROtiNxCF15tlB69YS4351FpAvqmOpYD6j9wo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=pN4tAHtK; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6f4e59081e6so4424691b3a.3 for ; Wed, 15 May 2024 16:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715814500; x=1716419300; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ke/O00Y/Kjm74N+9XrjAq0nbRjFhCTAJyeNXJqA3ng8=; b=pN4tAHtKTaowkNW2IzLKHu4stbPP7AQZH/b7bNMltUj3UtSXCXZLWMX0ijcWoKuLcB A4BEbPvv0nQz3nyC2zDC/D95hpMPexMv/Jds+flu28etBUMMM+JR5A8v6GmUcrASKPbV Ywaz2tLHRbhitzcZw2eUWNt53bH/XeujPTNnfn1tgxx3+eJcKvAlv2EkYg98eUmp7GsR INq4mpkHMvKhwwe0+AcvmU71Kme76jj1RbaTtPwNYRBFkalZ7ENbV/ijiPUBHfwcJhPN GmkukInO/L4yISvaoWg4DrtavzhHBHuXI+8R54HLHHo+chD0JWeV8LFDyfaEHVs/79fi jmjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715814500; x=1716419300; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ke/O00Y/Kjm74N+9XrjAq0nbRjFhCTAJyeNXJqA3ng8=; b=XuWwBibiFbnht7s93kFmsjwBmoPaIyZuaXucqVHBajmi1hm8bX9p6/dABjv/iJqNJG fbDRAxUUJyPDoAKcXJxABBs/Ym0yKudgmEPJcATYZ61sGQHZUClbA7rGAgpMPMRD3bPl aR9AIRKgmGu+bDpHkJ4dI76yAb9jJVETBOJm5VxuRogrIGDYmLGr7RbPeTWHEWEaYXin KPCrBE5GPQFjBNzyZIuOK2Z0LAV+19CX9cNIw0ndfZW4m1LyQmE9vjSVVk/rrpiyT9Fz MU4YhvahaSJuFt3Pp0jRLsM/EvTXCB69cADMNaxWkVbkU0CYvHMGWfLAafXWtEx2tW5q NvYA== X-Forwarded-Encrypted: i=1; AJvYcCUDrxJCbuSFnyWG4/k8KvO5xvDyfs4p9fYgUpKLr8WnSHC0gPq7cKBb57qsAFLXcbFJzY/NULhBKi6UK0C8p8sgqs7tQ9kPxGIouIxR X-Gm-Message-State: AOJu0Yx3vtlrZsHEX9Cay/F5tPDbdOXo3j8vlXuPnoJTqL5QgIF/yVfv DOrX//YNMOfZIF1mIp2E+quH5kHrQlyQ+cJmPjLxsAhy5K1aPwgFNKNGD7Og4hk= X-Received: by 2002:a05:6a00:174c:b0:6e7:b3c4:43a4 with SMTP id d2e1a72fcca58-6f4e035d2e8mr22362801b3a.25.1715814500626; Wed, 15 May 2024 16:08:20 -0700 (PDT) Received: from ghost ([2601:647:5700:6860:144c:7973:ee0f:85cd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2b2f9eesm11664479b3a.212.2024.05.15.16.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 16:08:19 -0700 (PDT) Date: Wed, 15 May 2024 16:08:17 -0700 From: Charlie Jenkins To: Jessica Clarke Cc: Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Palmer Dabbelt , linux-riscv , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Conor Dooley Subject: Re: [PATCH 0/2] riscv: Allow vlenb to be probed from DT Message-ID: References: <20240515-add_vlenb_to_dt-v1-0-4ebd7cba0aa1@rivosinc.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, May 15, 2024 at 11:25:16PM +0100, Jessica Clarke wrote: > On 15 May 2024, at 22:50, Charlie Jenkins wrote: > > > > The kernel currently requires all harts to have the same value in the > > vlenb csr that is present when a hart supports vector. In order to read > > this csr, the kernel needs to boot the hart. Adding vlenb to the DT will > > allow the kernel to detect the inconsistency early and not waste time > > trying to boot harts that it doesn't support. > > That doesn’t seem sufficient justification to me. If it can be read > from the hardware, why should we have to put it in the FDT? The whole > point of the FDT is to communicate the hardware configuration that > isn’t otherwise discoverable. Yes you are correct in that vlenb is discoverable on any conforming chip. However, the motivation here is for making decisions about how to boot a hart before it is booted. By placing it in the device tree, we are able to disable vector before the chip is booted instead of trying to boot the chip with vector enabled only to disable it later. In both cases when there is different vlenb on different harts, all harts still boot and the outcome is that vector is disabled. The difference is that with the DT entry, no vector setup code needs to be ran on a booting hart when the outcome will be that vector is not enabled. > > As for T-HEAD stuff, if they need it they can have a custom property. > Though naively I’d assume there’s a way to avoid it still... T-Head does not expose vlenb on all of their chips so I do not know of any other way of getting the vlenb without having it be provided in a DT. That was the motivation for this patch in the first place, but making this available to all vendors allows optimizations to happen during boot. - Charlie > > Jess >