Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1892803lqp; Sat, 23 Mar 2024 13:38:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCondM7mDvHStF/QQ1a8gQODuA5394gBy7PTMO/Gu/19892WWmeQw6cmKgh6HeiKfwSXzl67vlFbgpwgDRhlSQ44pC1atyUSD1/1eKOg== X-Google-Smtp-Source: AGHT+IGBcCs4JrW2mo4ZpWCQXkxIPYP6WxKWv1v5PUY47cfAVI6ueya5Ie/rj+1temDu7cyu9JPk X-Received: by 2002:a05:6e02:1061:b0:368:80a6:4cad with SMTP id q1-20020a056e02106100b0036880a64cadmr1748632ilj.14.1711226279826; Sat, 23 Mar 2024 13:37:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711226279; cv=pass; d=google.com; s=arc-20160816; b=nNXMZsd63PhM2fsAJHdj5mctABcRMczQ6JOnvAOHT3N/xNhy7SoGMg+Dbo07KpAF6d x/AjY5lNAWfRviU20wbAy9hHu3oUJlyr1iHnsZysV19RczJ7+tMsNAWtj+G/zbs1Q7Ki JDCGjEJ2ztL12NaKjX/6w8ELixS6EX4100YjsSWf8Pv427lgci8ofLbw2UTgOLOcWv+z QKzLng+cbp/aQUYjDWSPDK/oKRZXNjz8thGMOchoe8bXw2HvT5i8oxUQcsxpVLioKuX8 jKjkK/qF5Zgc/SvtKReSLMikz/ihDSR/o68lVo6cMQI/o6EBXIPDVPjhtbaRbXkIMoFN RcAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=24wJWvfMNNR4rY9ZJ72kq+zMk5fkM7haArePsqOnmfc=; fh=C5kaENILvoIL5vHyYaBVbp/bzTf0O/lGPByqURkS5yU=; b=XkUQ0MptvyGYpOQVO4GQkPQw2hGOTV3Hl4U84JuISW73ocs+GwKCnGHVXXLzOGQznI MZ9jwoKnMAvNzrHSG2oKB099Wcox4UU0d3r+OLCibg1CQpD9N+cLDAnLnLbibIKp0SPy cosE2sXeWBiJMGSVcy415g8pLjpTKooyWx+87t2iBst1odma1YmX3mP+RrUx8neO3PGj wGwWnyS433j2EqQbCn3u4OphJQwfjrp74hAjlNDddk2XQaKvfg/hOrllO6ovB1J1VxtX 6PV/dyTNZL638WHXq8Qo+YAZLN4JQRhgKGjzhRXU4KJLOdPNMYEOv46uuqOlVs7D5f1M 7wsQ==; 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=d0QTy3pu; 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-112475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112475-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l68-20020a633e47000000b005dc071d13c7si4389268pga.273.2024.03.23.13.37.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 13:37:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=d0QTy3pu; 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-112475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112475-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E0589B21480 for ; Sat, 23 Mar 2024 20:37:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAE391DFD6; Sat, 23 Mar 2024 20:37:43 +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="d0QTy3pu" Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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 411D6211C for ; Sat, 23 Mar 2024 20:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711226262; cv=none; b=CtCBfEK0Dy6hDhgKq9DCnIfam6AnFWxLc2+zR2d0VOVCW4XUV9fZCJ/zdufoH/z7XXleLf21kZ1aQcVDxbuNDCdaP3+JXDEycwnRgXvmkStuSpPT+2wPrfzbWnr2sXLwuA9d006L57aNWqhH0esOMlye5mqa8yyBfe/DuszVEFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711226262; c=relaxed/simple; bh=F/YPXLz2Mwerh5c3sVMFT48r3GG2KwGnkstMSeaVehY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=o0TGtqs+9X9ZxbhhueVgfBtklWX7hpycRkHLLOJvcw1hWTQJn/O84M7k1XPl/5xwk6Xwjg7PDFTrJjRcGmBWqHLIXfpBR1ES2Jqs1pjRoz31bXOk3tQyH65zT3jueVIsEDEx7h/KN4KWTWN/muCY7DBrTf3JonzPS9/ZUJ6y6jM= 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=d0QTy3pu; arc=none smtp.client-ip=209.85.128.173 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-yw1-f173.google.com with SMTP id 00721157ae682-609ed7ca444so33007117b3.1 for ; Sat, 23 Mar 2024 13:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1711226260; x=1711831060; 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=24wJWvfMNNR4rY9ZJ72kq+zMk5fkM7haArePsqOnmfc=; b=d0QTy3pug2+hrioDXiuX4WEzadBLhhwfIxGhfWAd1QzalwL77nBJMa7cdsY5KDsDNC g3IvRgrBa02ajKtrtAX84rVgeCM1ykzF5Mj7/tHqQZy7cHjXQv0W1ZIsy3+68iR8ma3s /GRpE8/ImxQ93cdus+KQvvBgL3y+mo7QvMpc3hEHOylChtOUtYBQN0RapxF/+n9O/xfI oVVNIUGyAOBvcyirlkTqYPYtE5DiQ+OPALsXgcTgDqbyHARMPVcxiQXBx1eGazPxcdAp 9NrgwDf1Lq4ITB24Sr/9jJIv2tP3cHt/rrYOgXt8+58Hr8CPEfLtVvgdHpE2i1ms/0oF rsDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711226260; x=1711831060; 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=24wJWvfMNNR4rY9ZJ72kq+zMk5fkM7haArePsqOnmfc=; b=s3oe3nrzMxGI5l18stMu9fk8h8NQcpGw8b/zb7hbbJJ+yy6kwmvLqM94nrNlsRpPK4 pKCZ55A2O5jffFL8fDVxhJi+161RLPfInOXLP/55xlCRQgyGUo+NapI7nW4z2GWvxKz+ Nl7kX0K2PHvUN1uA4v3PlXLQweaL+qeyaG4SfGLnOMTgmWN6Ssiz+ZmIDIfPzDobpauf krRfYzu9DCLlR3eOWak90fGy9t7L5XxH83RxkX40ZVrbhhVA+H/2ru/Gm2FUIkPeNGox VhNOwpNj+u1L/K0y2Di2x6q9woPtQU76V1vuru0G4+V6lRb619DaCwlyPe9PqAIiwDrT hwuA== X-Forwarded-Encrypted: i=1; AJvYcCUNZbxSn0UhcCnFC1EvlAo9Pn2gNNt/RxFwem3t0FFeS0MUQNQCV1tToo4jTWUz5MLhVrOAQ+QWRHEgJ/j7uP5mU+wNzej12+YTRV9c X-Gm-Message-State: AOJu0YwdwdoXvGhHHrmYNgtvpqsNMf41k/NJ2mHNqX86DnpR/hCv5zK1 z08bcWLhaWP+FnqOnCmkBonMZfYgiL1AhHuv0q8RrNVI4EqILoyPe622//p+jtkPDmgmPOVcj/C B72DzIIujcZKMXKuhKhX3Jy/aEF0rbUWIXH0/wA== X-Received: by 2002:a0d:d981:0:b0:609:6eb0:4714 with SMTP id b123-20020a0dd981000000b006096eb04714mr2781546ywe.34.1711226259384; Sat, 23 Mar 2024 13:37:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240319215915.832127-1-samuel.holland@sifive.com> <20240319215915.832127-6-samuel.holland@sifive.com> <40ab1ce5-8700-4a63-b182-1e864f6c9225@sifive.com> <20240323-28943722feb57a41fb0ff488@orel> In-Reply-To: <20240323-28943722feb57a41fb0ff488@orel> From: Deepak Gupta Date: Sat, 23 Mar 2024 13:37:28 -0700 Message-ID: Subject: Re: [RISC-V] [tech-j-ext] [RFC PATCH 5/9] riscv: Split per-CPU and per-thread envcfg bits To: Andrew Jones Cc: Samuel Holland , Conor Dooley , Palmer Dabbelt , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Catalin Marinas , linux-kernel@vger.kernel.org, tech-j-ext@lists.risc-v.org, kasan-dev@googlegroups.com, Evgenii Stepanov , Krzysztof Kozlowski , Rob Herring , Guo Ren , Heiko Stuebner , Paul Walmsley Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Mar 23, 2024 at 2:35=E2=80=AFAM Andrew Jones wrote: > > On Fri, Mar 22, 2024 at 10:13:48AM -0700, Deepak Gupta wrote: > > > > Yeah I lean towards using alternatives directly. > > > > > > One thing to note here: we can't use alternatives directly if the beh= avior needs > > > to be different on different harts (i.e. a subset of harts implement = the envcfg > > > CSR). I think we need some policy about which ISA extensions are allo= wed to be > > > asymmetric across harts, or else we add too much complexity. > > > > As I've responded on the same thread . We are adding too much > > complexity by assuming > > that heterogeneous ISA exists (which it doesn't today). And even if it > > exists, it wouldn't work. > > Nobody wants to spend a lot of time figuring out which harts have > > which ISA and which > > packages are compiled with which ISA. Most of the end users do `sudo > > apt get install blah blah` > > And then expect it to just work. > > That will still work if the applications and libraries installed are > heterogeneous-platform aware, i.e. they do the figuring out which harts > have which extensions themselves. Applications/libraries should already > be probing for ISA extensions before using them. It's not a huge leap to > also check which harts support those extensions and then ensure affinity > is set appropriately. How ? It's a single image of a library that will be loaded in multiple address sp= aces. You expect all code pages to do COW for multiple address spaces or expect to have per task variables to choose different code paths in the library based on address space its running in ? On top of that, the library/application developer doesn't know how the end user is going to use them. End users (sysadmin, etc) just might use taskset to put affinity on tasks without being aware. I just don't see the motivation in an application developer/library developer to do something like this. No application/library developer has time for this. Putting a lot of burden on application developers is mostly a nuisance considering they don't have to think about these nuisance when they expect the same code to be deployed on non-riscv architectures. One good example of putting unnecessary burden on app/library developer is Intel SGX This is exactly the reason Intel SGX failed. Application developers don't have time to develop confidential compute version of the application for a specific CPU while on other CPUs carry a different version of application. But at the same time virtual machine confidential compute is better approach where all complicated decision making is delegated to operating system developer and application/library developers are empowered to only think about their stuff. > > > It doesn't work for other > > architectures and even when someone > > tried, they had to disable certain ISA features to make sure that all > > cores have the same ISA feature > > (search AVX12 Intel Alder Lake Disable). > > The RISC-V software ecosystem is still being developed. We have an > opportunity to drop assumptions made by other architectures. It doesn't mean that it should try to make the same mistakes which others have done. If there is a motivation and use case from end user perspective, please pro= vide. Otherwise no point doing something which is just a science thought exercise and no concrete use case. Please note that these arguments are against Heterogeneous ISA on cores. From power and efficiency perspective cores can still be heterogeneous. > > > As I said in a different reply, it's reasonable for Linux to not add the > complexity until a use case comes along that Linux would like to support, > but I think it would be premature for Linux to put a stake in the sand. > > So, how about we add code that confirms Zicboz is on all harts. If any > hart does not have it, then we complain loudly and disable it on all > the other harts. If it was just a hardware description bug, then it'll > get fixed. If there's actually a platform which doesn't have Zicboz > on all harts, then, when the issue is reported, we can decide to not > support it, support it with defconfig, or support it under a Kconfig > guard which must be enabled by the user. > > Thanks, > drew