Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1189118lqe; Mon, 8 Apr 2024 01:01:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1IR3c1qR7PpWVyE55q4tOG9JsFbc0W66E3hGNBP6PMEwDUxSuqaV+gi8/lGY2xExlgUg7N4if0VNRWgL61/SfVuTpcYNYBeQ181Y5mw== X-Google-Smtp-Source: AGHT+IEQboirZ1YbamZ6WHLOTI5Ffh9mP1rpF7Wgp1viozF6TmhfDiZ5y+wz0N4OHjS8JyxrTAq5 X-Received: by 2002:a05:6214:21af:b0:699:2dc0:8561 with SMTP id t15-20020a05621421af00b006992dc08561mr13887530qvc.20.1712563289477; Mon, 08 Apr 2024 01:01:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712563289; cv=pass; d=google.com; s=arc-20160816; b=UZkpDH9eWw4tNEZkHorOyQhVGc5ImEB/bBvLoT+hinoF/U+9AS8xqNORZteg7+/zWE HvSTQiJkeo5s0zZZ691nrPXP8RQyPeOnzEcZyJpBvpi4jr/SYVySTNKSbHn98mU++Bp/ UFRcASwnF+GXaAMOhsurmjiPpVEkEbh8mesLdamp8LUTEgrDq/aOgVWH1Vp7hLKjCOGG nGVZoTGPwcdnYb9OUxb4INgWQV/VLRa8/cjoiGmPNOwdfgxpSnol4CpSZl5ry8EUZCSq F/8WgdfFkPlvmpmB341gePlfF5VAuJMdlGb1fXjcFBz+G83k76USLPjWJ/vp40cJ12qn B5BA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=nEXus2Ynno1AeuPQLNpTk8iPF9Mbvy8RxA45xKLQHC0=; fh=k8P71FLc+tNoZUhqoDgfm05HDYc6GyrcjT04h/8d5kE=; b=YKsq81qHjyCPZv5SQgdaX6DmNmzDEtZCeiwy8oLr0V37fQZaZpjagytamIRPDWCylP yAKiMxVJbfwzU5AEK6jLtTAPXvl6tAcF9DeYQWO1gQIl81/jMFO7WOXjDq75ei100UKj QfYECn7rCjqB8cainqqIbkdIRmqJCOPoAbkFH0U6EfXC03RlGl+Srk76aAjHUxJkCHZh lWo4tY91eGxRcpxAwwoevlQwPxJVYuxkA76sAK0KIxdsX8/MMC/TSHVZ7fEjzCnzl4W4 BEBlWBCsBkFapY2QhWi6kBQGYrwXLxkInh2AAuXZ/PMve+caCKoaYFMSh5LlBxs3igG8 /JFQ==; 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=Bip6JL3E; 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-134985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134985-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q11-20020a0ce9cb000000b006968566f8a2si7756024qvo.542.2024.04.08.01.01.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 01:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Bip6JL3E; 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-134985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134985-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 0144E1C21E5B for ; Mon, 8 Apr 2024 08:01:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11B712D03B; Mon, 8 Apr 2024 08:01:19 +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="Bip6JL3E" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 769612C859 for ; Mon, 8 Apr 2024 08:01:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712563278; cv=none; b=dIr2ZoT9R5zzXQRYnnj5DPc93u+WV+NvOSfRiGvtQ3ovtgDAYWnUtb5LEKPPA7Jfk14VSrs1DAW7sW0NRgGG+aFTc5akr/Z3OKlTtjWd9LZhUYqaDEIQwhuYKRAOwJO8r8Tts2KxsVU6/DmE35kpCk7fmBCAfTDGiuzcev41qfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712563278; c=relaxed/simple; bh=oFtZMMMzF5IIyBLE1OofkhOkb8Z20H1FcMxpZ0BjJv8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Pb9EJQISVq2HJu7p+MPWjkXiY+F9pWBeAQNllNsVAVZDlcKlWhQ0s7SRd6pzCWyuH04mnATMv84SrJ2v+b03+aiPYo+aKQR0vDVwPJNNd6qFUPBZKtg8fMmDWgYcdSmraEU5Ppu0SL5RSiOTHHYzyPXISvx9Aok3cf5eKOj8lY0= 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=Bip6JL3E; arc=none smtp.client-ip=209.85.128.47 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-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4167082dabdso1127755e9.0 for ; Mon, 08 Apr 2024 01:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712563275; x=1713168075; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nEXus2Ynno1AeuPQLNpTk8iPF9Mbvy8RxA45xKLQHC0=; b=Bip6JL3E5DmYfcHSQhhsjkUrX2FhlhScGfa3gp3f7UXkyJ6GwmgIrMmBAkeJwGHzZT 4bYXkqgmjaKO2CxXaUgbKsBJpBzduYctad1Y7wq9sNGEzKrHH3oA9s/RMJMiwo+0XeaJ UOB2hjcxyvBBe98dnlClXCpESUeIFaKrnEgSKcASp/7AbGNKuA7oHeGvsgQFFPC4y/M0 iZdDt9refM7EPnt1/ks0Gl+5WTG0+y86cYwKTKVE+RzDUgCG4HeQfoh+3fSdg5niiuhX qyb7qhc0Z/R5gaOIRI96amQkpLa3wponaInlsOcdTbNzd4lq92F4WQ8CUEkTcJEkhXwK 0nGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712563275; x=1713168075; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nEXus2Ynno1AeuPQLNpTk8iPF9Mbvy8RxA45xKLQHC0=; b=EAKJCChVprFe4wo0jWTI0KKPxh2gXdGaMWIgMjIZ7U/XzgiC2/8cFmm4RSsKHB6e/O CFF4Mgufor3mmcljj7kV7iIKMBZ4SLCdvAFwAOzBs7fqTOQ1KVmZTdp7opn9XqNeDEDn GGxE6lfn705MdI1xIY5x6WY6CqKhCQvHKnfSFjE0jYOGwfGtnPPfEroO5tEjLkiL+yl9 HhImo5R+Um5Q/6I2OXzCW75qx9iqbiSxvTCE8I59wlYWQohZULXhuqYXxbDnmou/JVq0 tInFkH1eMA2PFuSqeB0MdZGlbHc78/7/bGnJruNkNXx/Q7cEvHQu/HVglZeTGr081qyW OQDg== X-Forwarded-Encrypted: i=1; AJvYcCUlGnmyLg8FZ3U/GXJWg+Y40uVM8u3sy3sQEM6HC0u6pT9MArmiAJaA6fAwt8ZCbCMww0iFZI6H5iJmwQrJ9oavaKLkAI6APjtO80ta X-Gm-Message-State: AOJu0YyQZyk2gnuxw9tj9ahjwAUszhyb2bzGFGTgFbvtAIdWWuh8QXQd hT3d5lZgw+DoH6+7gn+ixSuS8YP68q+6afiCxqMr5kyT6HqD2sGQ3ZFQysFzJk8= X-Received: by 2002:a05:600c:3b96:b0:416:7b2c:df09 with SMTP id n22-20020a05600c3b9600b004167b2cdf09mr834824wms.1.1712563274884; Mon, 08 Apr 2024 01:01:14 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:6327:edd6:6580:3ead? ([2a01:e0a:999:a3a0:6327:edd6:6580:3ead]) by smtp.gmail.com with ESMTPSA id n32-20020a05600c3ba000b00415612e29a1sm12515475wms.30.2024.04.08.01.01.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Apr 2024 01:01:13 -0700 (PDT) Message-ID: Date: Mon, 8 Apr 2024 10:01:12 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/5] Add parsing for Zimop ISA extension To: Deepak Gupta , Andrew Jones Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan , Atish Patra , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org References: <20240404103254.1752834-1-cleger@rivosinc.com> <20240405-091c6c174f023d74b434059d@orel> Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 05/04/2024 19:33, Deepak Gupta wrote: > On Fri, Apr 5, 2024 at 8:26 AM Andrew Jones wrote: >> >> On Thu, Apr 04, 2024 at 12:32:46PM +0200, Clément Léger wrote: >>> The Zimop ISA extension was ratified recently. This series adds support >>> for parsing it from riscv,isa, hwprobe export and kvm support for >>> Guest/VM. >> >> I'm not sure we need this. Zimop by itself isn't useful, so I don't know >> if we need to advertise it at all. When an extension comes along that >> redefines some MOPs, then we'll advertise that extension, but the fact >> Zimop is used for that extension is really just an implementation detail. > > Only situation I see this can be useful is this:-- > > An implementer, implemented Zimops in CPU solely for the purpose that they can > run mainline distro & packages on their hardware and don't want to leverage any > feature which are built on top of Zimop. Yes, the rationale was that some binaries using extensions that overload MOPs could still be run. With Zimop exposed, the loader could determine if the binary can be executed without potentially crashing. We could also let the program run anyway but the execution could potentially crash unexpectedly, which IMHO is not really good for the user experience nor for debugging. I already think that the segfaults which happens when executing binaries that need some missing extension are not so easy to debug, so better add more guards. > > As an example zicfilp and zicfiss are dependent on zimops. glibc can > do following > > 1) check elf header if binary was compiled with zicfiss and zicfilp, > if yes goto step 2, else goto step 6. > 2) check if zicfiss/zicfilp is available in hw via hwprobe, if yes > goto step 5. else goto step 3 > 3) check if zimop is available via hwprobe, if yes goto step 6, else goto step 4 I think you meant step 5 rather than step 6. Clément > 4) This binary won't be able to run successfully on this platform, > issue exit syscall. <-- termination > 5) issue prctl to enable shadow stack and landing pad for current task > <-- enable feature > 6) let the binary run <-- let the binary run because no harm can be done