Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp1311873rba; Fri, 22 Mar 2024 10:04:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVK4QggXenFX4pcbk4/Zz8MlkAtSF8CGQsoRqObA9exKb6L2eZwPO0OCLhZksBan4+njcFi2up2E2EWCmrqUBKCCQYbGwP0pavB6W6NhA== X-Google-Smtp-Source: AGHT+IFqZHSokQf85vV59113J1cU38BXVzf290Wv0QpFAg55eLhsZ/0e+yATBNVAd1LgzRUJmTQK X-Received: by 2002:a17:903:22cb:b0:1e0:157a:8470 with SMTP id y11-20020a17090322cb00b001e0157a8470mr440350plg.12.1711127039915; Fri, 22 Mar 2024 10:03:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711127039; cv=pass; d=google.com; s=arc-20160816; b=q6Q+uVzmVS0T+tGg6fpTgpdIXcZNjNs35U5jqRYWJXCGi31uktFowE4Nc0Zh7YDhS0 fvdl4CrQVFuto5f/EwQHaQKnZZogA7OAwjozI8TBSV8xkjRpZGPLvR5k2f/8hcp1JDGX f9Re+1u0m34gd1LLD/7JBI5Qs093svVA45UZG8Vs9rPOzL7Nsz9r8e7TVEzgJZU57DdY Ed7Av8SBNoeZQT2nnI4+LWn9hsuW01+GrZ/MXsEjxpdacAZbzpGLNQjlJfeNLljiW3l6 nMVDP1pd1m6vNRIiPcho8Dhclq48Slr1g80cbqf0HeSa3Qmtx/XEehhNmKGPSzLOjY0E lQmQ== 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=y51uEGJ03D6pw21uRms6OLbBjZsNY8YSRn9RWNKVb+8=; fh=GOWIXMHzxm7tfkYco55/Vmln2qPXQklYBt9NDPitclU=; b=BuXsS+LOVqme8LWUk0uGOaq8orkd4mSsuElu0CKM/yXC5iQybwMD7eohNqcX+YkKLE MDSqu+DB1RPfSigPIaEuhZQTho6+2tnoBHlltteFsL6LXN9aXvaZ4Pe98tBmaIIgF5Xs Q4U2D4KjmbRxPCtG1EycbRUd6kvl2Lgeo/THAT1u7MjCFFMhjromRKpnZ6+DvaoW3at+ kptB3mns7accFjm7VNLVSrfs3FW94sakLrtforCD6yeZaPO9Jg6nVUGd5neJrnp30ECm suUhvgONpdRhwao2ftzkqCyP0cuEe3ARyOf8JdBvNRhvN/88hBnbf4P8KW9ZDI4GSnIG +PKw==; 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=gt7Zs7LI; 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-111818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111818-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t8-20020a17090340c800b001e012417887si2340502pld.283.2024.03.22.10.03.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 10:03:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=gt7Zs7LI; 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-111818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111818-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BB4C42873FB for ; Fri, 22 Mar 2024 16:54:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B71FC5F87D; Fri, 22 Mar 2024 16:53:01 +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="gt7Zs7LI" Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 AC0AC605A8 for ; Fri, 22 Mar 2024 16:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711126380; cv=none; b=sXMT14f7iC7W/susKgAyvPhoHxAiCNUQ7QIj/Ua5LqVj/2fxaJ16vQXm2YozbuYPOxEl6SzeSfGw1+BNuboygSxoD3eeIKY0+3I0hJixpnrYnBlEVENeYFPoBHzcBc0PiY1E4j3u4ae4qfCMbzi2Bs83nWkM/w5i+RdUh4AvE54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711126380; c=relaxed/simple; bh=ugO3VCcCbFXqa0j0ulFrbXaGajsAP4EqVB7of7qqfPs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NKw3lH3nkKYurBELdBqmA4VbFIx8lw7kQHR06kpqVW9yEh6OZAMuO8JN2PyLOUVaDEwfHnnxMBm/cGYm//8Xrg2ivIgTW4fALBtpfrNOCxTsGieNxXe+xdM/o9bblCBhFH69JKJOhPfzg8vRcy9QV5fSHADWs+VIsre/EmveksU= 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=gt7Zs7LI; arc=none smtp.client-ip=209.85.128.172 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-f172.google.com with SMTP id 00721157ae682-60a068e26d8so26378817b3.3 for ; Fri, 22 Mar 2024 09:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1711126377; x=1711731177; 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=y51uEGJ03D6pw21uRms6OLbBjZsNY8YSRn9RWNKVb+8=; b=gt7Zs7LIEjkrCuFLBHQq+9o8bSsfH1Ov05v4LPLE48/hUiYYODfkVGVUaYhBcFjHJ+ 0X6i9UOEdDeICZydK840q2xp/F+AB3VW4Zmf8NTkSmYOqZ8T/ovN5fZ44dw1oM6+AUoI zXET6j7bNXPdROlqyKcR7OPsdT3j0Qc9vLS+nXD/1vw8jT6QeBkKH2a44Daox+SH4ep+ MNNd4bpmivvUdP4WFv3LEq0wp6aIP8Gb6qRxiDSzwvjpFfhou84x3tnZYo7AwL7XpK+L vOnuj6//8GRCtfQzE7llvlSmRkXL+DQasnbiIQY43gK+e3C8sZNrW6HvLBgRs4onCSwl doYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711126377; x=1711731177; 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=y51uEGJ03D6pw21uRms6OLbBjZsNY8YSRn9RWNKVb+8=; b=qTkXlwJ1RzQMAylc2aRY0UK9aer5Bd5q/isBWQd7TKiU5SyE5OuVLp2lvwo07Ux3qe LfOx9G8RDQfOXATE9yP77Wxvpgi+Ifncwr1MPG2PLE/neuHXcZxswqcpQOw/sWtee2zE F4oEKMuOfxN4Pj/9Agt5V/UDuCCFK+5exdRpmk2ext7PvJUD2ecqb2tZBhCpgmPOgrf/ +xN9ltLrdx3zCOfoOW2z1yt6HZLUljcqG6aeHMJVVQcrCWp1fYIZT9QlyXTz0vDlDTzt jBym+7F6Bo1ME1nPADt66h11x7OP9iLujBzFG5oQy1ZzwS9BXSnMW4PqmFIVRlF0gjTf Ju3g== X-Forwarded-Encrypted: i=1; AJvYcCX9UpJqQ5uWM1NPWWtg196gI82ZGo40SYeAFbI5rAnfQpZlcIx5QNVaN1j12cbTwIZyD1lbtXzonkuyJ7d5ngrlE8E67iZg8KxTnn4w X-Gm-Message-State: AOJu0Yxl/dYngzFOtBIVX6AGqmBzrzZuIs2VNEKBdgQLYZxg+De/rA/S IZ+Hz9IVen1vDLnZAtmw+iJrI5jUKTXCL7j3t1sY2VLmcr3dMkm79NVLv9StFUgm+oZ/5gtb5LC WNOEER+nnzrlx6s9STFGQXud8sLe4mae0i3kjwg== X-Received: by 2002:a81:710a:0:b0:60f:d6fc:74f3 with SMTP id m10-20020a81710a000000b0060fd6fc74f3mr228823ywc.7.1711126377529; Fri, 22 Mar 2024 09:52:57 -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> <20240322-3c32873c4021477383a15f7d@orel> In-Reply-To: <20240322-3c32873c4021477383a15f7d@orel> From: Deepak Gupta Date: Fri, 22 Mar 2024 09:52:48 -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 , 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, Conor Dooley , 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 Fri, Mar 22, 2024 at 1:09=E2=80=AFAM Andrew Jones wrote: > > On Tue, Mar 19, 2024 at 09:39:52PM -0700, Deepak Gupta wrote: > ... > > I am not sure of the practicality of this heterogeneity for Zicboz and > > for that matter any of the upcoming > > features that'll be enabled via senvcfg (control flow integrity, > > pointer masking, etc). > > > > As an example if cache zeroing instructions are used by app binary, I > > expect it to be used in following > > manner > > > > - Explicitly inserting cbo.zero by application developer > > - Some compiler flag which ensures that structures larger than cache > > line gets zeroed by cbo.zero > > > > In either of the cases, the developer is not expecting to target it to > > a specific hart on SoC and instead expect it to work. > > There might be libraries (installed via sudo apt get) with cache zero > > support in them which may run in different address spaces. > > Should the library be aware of the CPU on which it's running. Now > > whoever is running these binaries should be aware which CPUs > > they get assigned to in order to avoid faults? > > > > That seems excessive, doesn't it? > > > > It might be safe to assume extensions like Zicboz will be on all harts if > any, but I wouldn't expect all extensions in the future to be present on > all available harts. For example, some Arm big.LITTLE boards only have > virt extensions on big CPUs. When a VMM wants to launch a guest it must > be aware of which CPUs it will use for the VCPU threads. For riscv, we > have the which-cpus variant of the hwprobe syscall to try and make this > type of thing easier to manage, but I agree it will still be a pain for > software since it will need to make that query and then set its affinity, > which is something it hasn't needed to do before. > Sure, the future may be a world where heterogeneous ISA is a thing. But that's not the present. Let's not try to build for something which doesn't exist. It has been (heterogeneous ISA) tried earlier many times and mostly have fallen flat (remember on Intel alder lake, Intel had to ship a ucode patch = to disable AVX512 exactly for same reason) https://www.anandtech.com/show/17047/the-intel-12th-gen-core-i912900k-revie= w-hybrid-performance-brings-hybrid-complexity/2 As and when ISA features get enabled, they get compiled into libraries/bina= ries and end user many times use things like `taskset` to set affinity without even realizing there is some weirdness going on under the hood. For majority of use cases -- heterogeneous ISA doesn't make sense. Sure if someone is willing to build a custom SoC with heterogeneous ISA for their strict usecase, they control their software and hardware and thus they can do that. But littering linux kernel to support wierd usecases and putting a burden of that on majority of usecases and software is not wise. If something like this has to be done, I expect first that it doesn't force end users to learn about ISA differences between harts on their system and then figure out which installed packages have which ISA features compiled in. This is like walking on eggshells from the end user perspective. Sure, end user can be extremely intelligent / smart and figure it all out but that population is rare and that rare population can develop their custom kernel and libc patches to do something like this. This is a good science project to support heterogeneous ISA but practically not viable unless there is a high level end user use case. > Thanks, > drew