Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1261082lqe; Mon, 8 Apr 2024 04:04:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3OvaD0q0APdcgew2hkXONTaAQWdJrIDkjA2O2dGvvFtxu0JEccpsmfCjLmuhTvdbMilXT0tE9yYbBqibFmZdyd0VDCoGTUkMmlAe3hg== X-Google-Smtp-Source: AGHT+IHOet4LsiBPAc+HOqJNVk4QNhss28RIiBHg5pum8yLqZIcLVcgE1bgsk2A6Bss8gbhgrmJ/ X-Received: by 2002:a50:bac4:0:b0:56c:1696:58a8 with SMTP id x62-20020a50bac4000000b0056c169658a8mr7064895ede.0.1712574254811; Mon, 08 Apr 2024 04:04:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712574254; cv=pass; d=google.com; s=arc-20160816; b=hfjeVmVDbeFoWN6PwG43smaZODsT/v54pC7CJmlwMoRRqjGGV0zd8Jrf5WZtFwP0wT kKqCuE4YhB/rgWjVoTlLbtoZCwpmHIzePh2Ol3XuJDf2ov6e9h6/P+p9cJdKeA/l7eak Z7fccswMcMUiJcuYjQO8MHR07TS+btvVw8l3D7W+uvudjaV3PRyPAvY/2A4OvN4Sf2bL M9pHNgGTUWCtVcYUNk/jJlQ6uqL+kGAd+MM9/2pwXegCS1BCyzUYinq1dXv53018MY4B y2Flqb6LQYItUhBkZqbgG3kxxvbw4EEyRAOkqOxoHOaDay6S1z+GGUwHAKv4GuYWV9dl 7anA== 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=4g1Fe38jasdHywEL2euSnsmLnhOpgJ82XZytSUr/W9Q=; fh=HjoMvyqUVjoGktygMNlULIrUBZBXr6nBFiFu9vOeA1o=; b=gCjiJ+KlBPzPXbC6LYcKN6tP4Y766pfB6G9oWuln7rhDY62P7Vzxof13nGMmoCm668 /9H+TG4dUxgKA0E1IoQkoPHIGkdH7vO1dAXJY9DR9ApwUFFFaOMzF8yFcYp6mRY2y9pf PZT1HuPCMHVwLbSYex6gZ0dTKQc8UZjoeIniceSjwg9ELS1Ges2CJ35pr1hfWRSMnOXv iFLuLuYLbUbKjLnQLcKk2k3DpMwb5DToaXsBpf8P6coh0O+zcax48P124qFqLcg/vj2J 7dzsWLTm0mszly19ya7qtOuul0OdEsjaOsxpGew78PIUr/3u/COzdmx1ghFM2TofenVU fQUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QUnnJn8p; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-135245-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135245-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 15-20020a508e4f000000b0056e332f32casi3255605edx.540.2024.04.08.04.04.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 04:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135245-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QUnnJn8p; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-135245-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135245-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5891A1F225BD for ; Mon, 8 Apr 2024 11:04:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB01F65190; Mon, 8 Apr 2024 11:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="QUnnJn8p" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 2A91A6168C for ; Mon, 8 Apr 2024 11:03:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712574239; cv=none; b=E2+WnnihnagSWozEqQFlpEkUHFV8ckvRgZazxO2yJ2kJLZJa3ginAJhx6z5qq5FPXUQVgq3doL2LpAtyso6iJhYnQWmSMQtjtGwDzt1cgrfRoBMggbVN3wEak601GeUJWXu8Ayr4kwsJa4Bg1zD/X8VE5bqXxufpatRW4eBTFpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712574239; c=relaxed/simple; bh=wkKRyt/Vw/5zc5dlJy0JHXCMpR/2OfytD1MG2A8RMO8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WAIBQ2viy8Hh97QeTUdNdKV2+wVeUle9BRAseiLL7arM6WbwL+4UeQTX1ZecxWBmtX9xzQzijXkP0X3lK7WjV8M4DEOCAn0q3w38Ga45nwvSvaQpHw44M0OvR/gDVmthO0qX5pWRyg+ensQMzKaDQU9xJ9oTINGKOb3vfVlsWIE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=QUnnJn8p; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a51d83fafa8so85406566b.0 for ; Mon, 08 Apr 2024 04:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1712574236; x=1713179036; 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=4g1Fe38jasdHywEL2euSnsmLnhOpgJ82XZytSUr/W9Q=; b=QUnnJn8pEBYu+zh4J/NCAw2trUTPY4j7dqg1dvLrnb7kRyq47WMMmXmsPGkDqeCqam 5qSVvM/tQNajw1Tbw2wJ3UXlD30gyrnfkchtL3WmvUS9z1oAWL48DGwoIW0GG284ZFzF 2nn6O9pXtb2isRu1dwwWA7md9vFurJiOfbQHT87T/K4yFdO/WSPp/Ma7LFomKR0piXNa YMKyTmZhMaD7vxSqW3eBqJzaYu6AeglocNS+UxJ+NxfsNJzcPdGTCDBkN8/JlFbZtkif Err7zcMtdQTnJCj8fmn1PT+otC5l8H2OoxV5lto8v3CQLmNvp/0KbpCw0eil8FHz6w/N m1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712574236; x=1713179036; 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=4g1Fe38jasdHywEL2euSnsmLnhOpgJ82XZytSUr/W9Q=; b=rlPEBdfT5MoslS5ZWnpuGpeTaytS9qJAdgRsNNbF+XCI1STT3+2vqJnj0r3D8KM4LE qjQxXNEGvVniB7zxySUPHx3HNW4IroZGxHdcOO7euT6tMQxoOgVB1TgZGCaIn3ELc+IZ uGkYI/Ri5/Ed8wEwOgsRDC1dPilp9jchc/bqcO3iIox28h1DIaZXaCuiUNWWh8mJGZZF 8D8sN69h/PTMtsxZD0gSnEmvMreITc/g81HN2ncLRoCa/RaHqJUq/93kmGsiJ+0eQeUk UA/ZT+V8+aexp5B9ZvAteG+cF8mYheDoGr6oU8Id5EFWC+RcZ9cdDBVOPjHlKkBIW99d /CrQ== X-Forwarded-Encrypted: i=1; AJvYcCVa6Oqfzaqcxhzxu3wgIhEmopKAw5sJq6nvFrErA736Hurdfc1zNTGonZrZgW08+oGF5wFD2x6ZvGCkNf91qKXmsoepVSJv7T9d6MlQ X-Gm-Message-State: AOJu0YzglJj8N27YtS3sm2Q7JdehkcK9BYEWdwthHYCEbkLiDeilTzNn S8py1K09/wqFhDCBfdX2cidRRS5NdoxPZEGW40iv25KDcj9lBfuFE2wfpMVJCeA= X-Received: by 2002:a17:906:31d4:b0:a46:da28:992e with SMTP id f20-20020a17090631d400b00a46da28992emr5801257ejf.71.1712574236283; Mon, 08 Apr 2024 04:03:56 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id b15-20020a170906d10f00b00a4df4243473sm4279042ejz.4.2024.04.08.04.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 04:03:55 -0700 (PDT) Date: Mon, 8 Apr 2024 13:03:54 +0200 From: Andrew Jones To: =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= Cc: Deepak Gupta , 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 Subject: Re: [PATCH 0/5] Add parsing for Zimop ISA extension Message-ID: <20240408-6c93f3f50b55234f3825ca33@orel> References: <20240404103254.1752834-1-cleger@rivosinc.com> <20240405-091c6c174f023d74b434059d@orel> 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 Mon, Apr 08, 2024 at 10:01:12AM +0200, Clément Léger wrote: > > > 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. OK. It's only one more extension out of dozens, so I won't complain more, but I was thinking that binaries that use particular extensions would check for those particular extensions (step 2), rather than Zimop. Thanks, drew > > > > > 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