Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp236509lqg; Thu, 11 Apr 2024 00:44:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTSIUHROdwzEvPgLoyUxxAASuaiHJBkdny2/4m7h+tqC+zqmVoZXic4iWwHL33UAr4G7zur2fjcwSAPh6zHIemuyuAjbhSfAvBGGgkTw== X-Google-Smtp-Source: AGHT+IGmC5ruj8k0goYLtB2aMT3lP5MUdk+hv9crWmcoSJfMYyl1VRkVo8WCKxCn1mqZf6elkXEr X-Received: by 2002:a05:6358:b5d5:b0:17b:f637:7bb with SMTP id wb21-20020a056358b5d500b0017bf63707bbmr4011796rwc.30.1712821444598; Thu, 11 Apr 2024 00:44:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712821444; cv=pass; d=google.com; s=arc-20160816; b=UfrM6UrkW3BocmH2XiF0GO5/0mSPQRFDfBG/V5xOn8ADmjgWObeM74+sPmomiArjPs j4pfwaYDwZ/xedopWbT4ZVw9L90uXgf8lCISnO4Z7Zz0Rq6bYeLWBiRD/xQQFZOFxUrm tCYoaKPBWe/l1VBYX7O4bddPjo43WjYXPg3iOpNX7pb/xtySvARHb3wuanbnXyHx6jzj b3PKx3RZkBaHYpFRoDOLCKa72HdOHLCB5dhxizRyUWcNi+JuyOkvPsj4k+/JYV6maOQB 251Oc3IrSuEuHNmtr7VcA1ohxQwQKSU3QMc/SZ3Yp8LLjz7aBTv7/W5eCyQqj1fI0xR0 cWFg== 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=JrjK0EsdKVt9QT2OnXkSvn4/gsAT0jsR16VIcuO+mkY=; fh=zpz1FyDaOVl0RWvgaKF4VI5MLTUFnQnC0zHX6wYytVM=; b=w/g0AJnKxDYBDNXMCC1r0XAarhkXFaPoEYFaQiCeV8NVdTqYQyK7x1CPUYAKGmCgOJ NWt0VjkvURPtS+vROxc0s6L1usgWtvBMWC6hXnKM0TH6VxU99XBC/Di85whlRzYk7dIs TKo7iE6VDUlYuTx0On4IvAGQzMSTIv/1LsGLKPHSBTcUwuN+em+Sal8ay/+fnmtMuU9v Drdq0DXH3MNVtKIVP4gqt2j8lghe9Xp8HqXVpi7CGKGSbz08FJVH0/OGbEzp5rf7vX8P GUK6TzT1PxLw6Ue8P8+WZNrwHX/3d/Iqe+JSPDTq6xpM3mnnPPt1tVrC55Dls+itriiJ Itkg==; 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=kj+VHARA; 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-139962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139962-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q6-20020a656a86000000b005dc41265c15si791210pgu.658.2024.04.11.00.44.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 00:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=kj+VHARA; 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-139962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139962-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 EE97AB264C5 for ; Thu, 11 Apr 2024 07:25:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B1A413E038; Thu, 11 Apr 2024 07:25:12 +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="kj+VHARA" Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 7610313DBB1 for ; Thu, 11 Apr 2024 07:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712820311; cv=none; b=DVBX+OCLa2XX+JURAZEG5e4DAEvGOueGkIpxIGvCCEt1/lK7XTq0z8pelPNRDchmAzdsCFL+w4CYL3ZDq8DrVhsZUevSXdjuCtXX1NxgdUEqDYYKHC0faUOlZu78pAT7cU8evmnQ7alW5uZI15KjKW0iSI9JOWZVp65H2pf2hao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712820311; c=relaxed/simple; bh=pJ8R9jxOZjfn6ejs9V833kwm1L/LeDLWxab3d8yLYsw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Kg3h+XAn8PYgmf8RcPfetzIa/J7TtIZODlZHAFUxCF98gR9wuTjqocJuVxPLKR4C799a8OiaQgC886dDHhL2mzAnu5PU3LQVtd7pSTQA36TiI8toI5TYhDUCwCsDsPwMYukjOna4DLHhlrW6x1RG9WJqws6v589fDbs4SiDK/g8= 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=kj+VHARA; arc=none smtp.client-ip=209.85.221.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-wr1-f47.google.com with SMTP id ffacd0b85a97d-346a5dea2f4so162591f8f.1 for ; Thu, 11 Apr 2024 00:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712820308; x=1713425108; 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=JrjK0EsdKVt9QT2OnXkSvn4/gsAT0jsR16VIcuO+mkY=; b=kj+VHARA3JQNk+YG+fgc9qULTOdLzWbfJbtJZZwhgHMAhvAhu1c4jKEao99NPKQgoe MGZUvDaQnpZqmcMB+9ofvCsvK5QJjKbwyZsv7QjvkrDKyc2eg9DHHo4oYwGmdh2Xf6MP V+hW7jO374WlUnh/qa9xx/rUWLGzjQM4uyFaadb3sm60lJ1dfyEcoL+CuIQDbObSggii IZxRVBmbnJ/0IkAUiH3rLQNJA+qPmcpIeMGtjLlls5DYhFc9OP4rWbQN/kw7h2XDG3Ux 9HZpl+vbKADGael0/TXsO3yBRy7GsRqEbSQRwcIHDI9TT9VAA1r7vcIm9B8smLnTmzv8 fCaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712820308; x=1713425108; 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=JrjK0EsdKVt9QT2OnXkSvn4/gsAT0jsR16VIcuO+mkY=; b=EHrr+M/5/I84NY1zBSuBKDxIe+7wN+iGVj2is2/nuVJO7PiZ568brmU6Xj384jHnAE 7e8/4ZFphLe2lmt5uKTkAVNQ6DDw20rZ3hr8VSYcC9WPsFIcwd3hEZ+CYwqoOoGyRlia q8uwFhNA/OAbzDyuMDbvpVJ4NE3av877GC5fGZ4x7xiksiE56+rP5f4/e0wCEEjQiLN+ 6+PxodGJaByXoZBtX1+AcHroikaTmQVAhXwMelTq7SNa61Zc0kQAJLDWKnsnB0Ec19uK LrsLRKmt/6m66yy4Qz7hmfMjf7JouSbW2HKf/Vd+h8ue0M88ng1+st6FBKLuq/xyOcZq f5ng== X-Forwarded-Encrypted: i=1; AJvYcCUNsI+VR0Q2U6zznTgVAJjsFD/cpGfXPEWMonI4U6AwtyMq2zKYbPU1d16R919KKrccIJAy0eFLFiztBbZnEMENStOPjtf0yLld50zb X-Gm-Message-State: AOJu0YzJ1iePgENW/UyKcNCtK7MsYM9Zw2jzeGJkRjvuNO6zhh5j46vy x4OQSASiLF2wJ3vs6wKc5qZuOK8meiGqKF0dG2qftsRdmQXOYk6LeMnAIUevrHE= X-Received: by 2002:a5d:4150:0:b0:346:4945:8851 with SMTP id c16-20020a5d4150000000b0034649458851mr3608971wrq.0.1712820307707; Thu, 11 Apr 2024 00:25:07 -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 b10-20020a056000054a00b00341b7d5054bsm1083326wrf.72.2024.04.11.00.25.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 00:25:07 -0700 (PDT) Message-ID: <1287e6e9-cb8e-4a78-9195-ce29f1c4bace@rivosinc.com> Date: Thu, 11 Apr 2024 09:25:06 +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: Deepak Gupta , Conor Dooley Cc: 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> Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Clément > > And yes definitley, dependency should be mentioned in binding. > >