Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp276639lqg; Thu, 11 Apr 2024 02:28:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaZ2O0nt4ow1EaaqurcGbt9o8fI73sOVAG1EyyLIOy/SDOhwEE+SK1Hg+cJ5k7gMGwv0R363CjtPOgXZEkWRpmVyr5+kYd4q7WuCSrFg== X-Google-Smtp-Source: AGHT+IHMDPEfyZnUvCxYdDDmvFq0wdMENGm/HYcQ5tZz6EudWl0ZSg/gN+gsHhi6qyJ/HkMvvw0m X-Received: by 2002:a05:6358:6c11:b0:186:12cb:d1a8 with SMTP id s17-20020a0563586c1100b0018612cbd1a8mr5700218rwh.25.1712827733572; Thu, 11 Apr 2024 02:28:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712827733; cv=pass; d=google.com; s=arc-20160816; b=jTZQi988mJmnk+mz7qQmzW8MP8j9jP0QhUI37SHeNqR6Egv8+E95uH1SATs8kdG5pS FJlwFS91PyqoKdafFOcLyie3nyo/T7fCoy6LhLcmQ7N5U4dANpmqPHI5NAwTcI5WpefY D6pBNI2Ljdhf8QV9ZVNsXB42SwZZT525gntG0WOnp4NBUO6nHC4juTjdlIZvQV9sAoOp Qw+u8/5qDklGqMQe3rFGsFuJemynVyLet6VDeprEF7mNMFI2WpqY8E2dMk7MgE7GRnhh XUDdGZgoUO6KqPv1K+rDDe1FggdYwhFU1mm1yBXn5vSAfbJ3C9gow9hDjL4qLE9GAa6D QzCQ== 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=yOkU8Fav8POJ1zZSx8brCh9PpnPTKPCkgjyKz/gc6Gs=; fh=BO6WaIpoo3MLOGi2EUTGNAsJXQlgPpL5inMTudRZpAQ=; b=m9jAbJe+oTrjwAgm/W/DU/7e6asLLNfaaDCoKbZXHfpjvF+pguMWesq7jvixz4oiLN wI4iGROMNCiRiStwuGczm0zGK14VljWVZEwMqizNXOQLegk47H4ODreet1RiLS+dVdTM t1op2w+7XUIs9qqe21TKibu2GU4UgJ7Oh1FVjzNvIIqfJqtxjFP0NOZPbD70Vz2oxp/U 8qwZjN6IvVfegjgbsnjoE/q5fyl0ALFVqIhQDu1+JONzFaKu/GStrjNIldphbSXMsXg5 wJPwk2WmjheMxzNPmu9zKSjGzZ5IxAyWTD3zIkv+rg1kCDZiVKACMIiz3jsy/g7z2s+p zdlg==; 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=KOH5ePm2; 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-140140-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140140-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 bx30-20020a056a02051e00b005dc4b7ae767si1014982pgb.459.2024.04.11.02.28.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 02:28:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140140-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=KOH5ePm2; 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-140140-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140140-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 EA96CB2260F for ; Thu, 11 Apr 2024 09:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C45E6143C74; Thu, 11 Apr 2024 09:08:31 +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="KOH5ePm2" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 B72F914263A for ; Thu, 11 Apr 2024 09:08:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712826510; cv=none; b=rpIl67eo0OBpdqxEukmySf8pmNpn7un9MMqCbi1g7TKEl+BgHQ1jCXbLs13l4oEqVQGnmfibjmAHP85c3kxxZwynpxV3SwkAku3D46XJKaHJGcoavtJ01DOYVnOiDFLxnqOmKSqIyBZoBcpafH8ngg3ofyQk6uGEEf2vUKGTl0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712826510; c=relaxed/simple; bh=BlEZ46Xi64DHUb7bmQfCkb+sHF8Swwq9Kc4UCAqyG34=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ECe1JVaZ2QQHDdgxzs8foIX+9D57hwtnJnlW7bAZeZ1bic2Gr4282VI0BSkizYlT6n6BIQB9KS+0Pu/e67VLPwc1y6ywUlbmHVmVELAyBnpa6GVBJi7IeRSURdmGStS9JgABE2cFFw+2AR6NrCpK8n4b1u7fWTGp99FtuCZmeag= 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=KOH5ePm2; arc=none smtp.client-ip=209.85.221.52 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-wr1-f52.google.com with SMTP id ffacd0b85a97d-343c8d7064aso1432912f8f.0 for ; Thu, 11 Apr 2024 02:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712826506; x=1713431306; 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=yOkU8Fav8POJ1zZSx8brCh9PpnPTKPCkgjyKz/gc6Gs=; b=KOH5ePm26P+hBCUla6fsZpCGeXtfdBjR/zwnosu5hu2Rric7ccCMt/D/5AL+Ww9yQ/ 3HxJmYw+t7FXVDsT0w2oeaMUvlzgTzJFCadUPGesNYjNGi2y3MINsvArUjwcolUsx99a o3ocQkFiAxkg0G3LZDl16FOJkOFfbnty8H3PyGAKt6oGtHHAa99XKa+WQflnXx7myuBG GhdQBFza+l77EG7GX4JxKr+BaTbamDKoAmPq40ZPQHuj/WeYWZHIETeuS2gNKeTtDpmg X6YCwg56dNv2VJB7aywJICsTyMUWxmvez/si876Zke6MHPjCtCSBYeuY7gLsUYKoGF92 D0aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712826506; x=1713431306; 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=yOkU8Fav8POJ1zZSx8brCh9PpnPTKPCkgjyKz/gc6Gs=; b=S8OQZo5z9cLodqKy3vcsG1HIyD2+eXcj3aon4bqpKlPeSKi3UNqNBq1UE1cEDhmAFD qkH0Ht++uVdL20nroEnt80xEjGlUxDlG4w1fLUfFoaLb357udt9U7+bYsrdkDVY551ij 8i3U8LtamESu9YNG0HfAO1hyroTxQspS8MwTPjmdZ8xkNRqhL9ISRGfkUVqg4GRnK9Uq ZMj+78H52/DxMN4OKOSkqLORwWmBZDYxJGTf/GYpdK0sLH+jeqHq7vXed90BUvlhJlG6 T4xqflHEqQ3ciHYWLXc96+sK/17motFfntX/LZjM68+pXEyjNKB0GfcMr3aobef4y7pa EBAA== X-Forwarded-Encrypted: i=1; AJvYcCVcNJwIajFHym6ZGZ0zULdHYTAKplyiAi4TZRf/J10fqdUtWpIP8uNc5YiYKnClKgX+scSSXx/C2FwVHRAF1nwDThWXxLW6vYHzgTDT X-Gm-Message-State: AOJu0YxwpoZfkAv7Wy4K6hxlYFK25DrHabO8m1t74FcFENPRbZQVNkQf eivm20FQsDLZI2g7WFuh5mh8g1E4c5UP8axyfhl88FUzxS1TZGgU9vlEZGU4ogY= X-Received: by 2002:a05:600c:1c01:b0:416:5339:d114 with SMTP id j1-20020a05600c1c0100b004165339d114mr3502727wms.1.1712826506067; Thu, 11 Apr 2024 02:08:26 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:3624:d9b3:4998:d76b? ([2a01:e0a:999:a3a0:3624:d9b3:4998:d76b]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c351000b00414688af147sm4896372wmq.20.2024.04.11.02.08.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 02:08:22 -0700 (PDT) Message-ID: Date: Thu, 11 Apr 2024 11:08:21 +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 07/10] riscv: add ISA extension parsing for Zcmop To: Conor Dooley Cc: Deepak Gupta , Conor Dooley , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , 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: <20240410091106.749233-1-cleger@rivosinc.com> <20240410091106.749233-8-cleger@rivosinc.com> <20240410-jawless-cavalry-a3eaf9c562a4@spud> <20240410-judgingly-appease-5df493852b70@spud> <1287e6e9-cb8e-4a78-9195-ce29f1c4bace@rivosinc.com> <20240411-superglue-errant-b32e5118695f@wendy> Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: <20240411-superglue-errant-b32e5118695f@wendy> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/04/2024 11:03, Conor Dooley wrote: > On Thu, Apr 11, 2024 at 09:25:06AM +0200, Clément Léger wrote: >> >> >> On 11/04/2024 00:32, Deepak Gupta wrote: >>> On Wed, Apr 10, 2024 at 11:27:16PM +0100, Conor Dooley wrote: >>>> On Wed, Apr 10, 2024 at 11:16:11PM +0100, Conor Dooley wrote: >>>>> On Wed, Apr 10, 2024 at 02:32:41PM -0700, Deepak Gupta wrote: >>>>>> On Wed, Apr 10, 2024 at 11:11:00AM +0200, Clément Léger wrote: >>>>>>> Add parsing for Zcmop ISA extension which was ratified in commit >>>>>>> b854a709c00 ("Zcmop is ratified/1.0") of the riscv-isa-manual. >>>>>>> >>>>>>> Signed-off-by: Clément Léger >>>>>>> --- >>>>>>> arch/riscv/include/asm/hwcap.h | 1 + >>>>>>> arch/riscv/kernel/cpufeature.c | 1 + >>>>>>> 2 files changed, 2 insertions(+) >>>>>>> >>>>>>> diff --git a/arch/riscv/include/asm/hwcap.h >>>>> b/arch/riscv/include/asm/hwcap.h >>>>>>> index b7551bad341b..cff7660de268 100644 >>>>>>> --- a/arch/riscv/include/asm/hwcap.h >>>>>>> +++ b/arch/riscv/include/asm/hwcap.h >>>>>>> @@ -86,6 +86,7 @@ >>>>>>> #define RISCV_ISA_EXT_ZCB        77 >>>>>>> #define RISCV_ISA_EXT_ZCD        78 >>>>>>> #define RISCV_ISA_EXT_ZCF        79 >>>>>>> +#define RISCV_ISA_EXT_ZCMOP        80 >>>>>>> >>>>>>> #define RISCV_ISA_EXT_XLINUXENVCFG    127 >>>>>>> >>>>>>> diff --git a/arch/riscv/kernel/cpufeature.c >>>>> b/arch/riscv/kernel/cpufeature.c >>>>>>> index 09dee071274d..f1450cd7231e 100644 >>>>>>> --- a/arch/riscv/kernel/cpufeature.c >>>>>>> +++ b/arch/riscv/kernel/cpufeature.c >>>>>>> @@ -265,6 +265,7 @@ const struct riscv_isa_ext_data >>>>> riscv_isa_ext[] = { >>>>>>>      __RISCV_ISA_EXT_DATA(zcb, RISCV_ISA_EXT_ZCB), >>>>>>>      __RISCV_ISA_EXT_DATA(zcd, RISCV_ISA_EXT_ZCD), >>>>>>>      __RISCV_ISA_EXT_DATA(zcf, RISCV_ISA_EXT_ZCF), >>>>>>> +    __RISCV_ISA_EXT_DATA(zcmop, RISCV_ISA_EXT_ZCMOP), >>>>>> >>>>>> As per spec zcmop is dependent on zca. So perhaps below ? >>>>>> >>>>>> __RISCV_ISA_EXT_SUPERSET(zicboz, RISCV_ISA_EXT_ZCMOP, >>>>> RISCV_ISA_EXT_ZCA) >>>>> >>>>> What's zicboz got to do with it, copy-pasto I guess? >>> >>> Yes, copy-pasta :-) >>> >>>>> If we're gonna imply stuff like this though I think we need some >>>>> comments explaining why it's okay. >>>> >>>> Also, I'm inclined to call that out specifically in the binding, I've >>>> not yet checked if dependencies actually work for elements of a string >>>> array like the do for individual properties. I'll todo list that.. >>> >>> Earlier examples of specifying dependency on envcfg actually had functional >>> use case. >>> So you are right, I am not sure if its actually needed in this >>> particular case. >> >> I actually saw that and think about addressing it but AFAICT, this >> should be handled by the machine firmware passing the isa string to the >> kernel (ie, it should be valid). In the case of QEMU, it takes care of >> setting the extension that are required by this extension itself. >> >> If we consider to have potentially broken isa string (ie extensions >> dependencies not correctly handled), then we'll need some way to >> validate this within the kernel. > > No, the DT passed to the kernel should be correct and we by and large we > should not have to do validation of it. What I meant above was writing > the binding so that something invalid will not pass dtbs_check. Acked, I was mainly answering Deepak question about dependencies wrt to using __RISCV_ISA_EXT_SUPERSET() which does not seems to be relevant since we expect a correct isa string to be passed. But as you stated, DT validation clearly make sense. I think a lot of extensions strings would benefit such support (All the Zv* depends on V, etc). Clément