Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1419006lqj; Tue, 4 Jun 2024 00:18:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUaSYr1umOvrWe2AX1rGeiOo+NV5Zs9blaRegUmy8ZchzN2CQ3DfsMXvj2poV+jD/Tyw1N7f9ux0wwj4Y/SP2l0d7JGzkZMFSzvLF9z5A== X-Google-Smtp-Source: AGHT+IET0IJ5XezoAmDGNeGGmohKaAL1qrJbJ5NE8HgrpmU90H/poOmbZk9Rm3hkn0uB+MtsxDDZ X-Received: by 2002:a50:9548:0:b0:578:6a0e:47f0 with SMTP id 4fb4d7f45d1cf-57a3639fff9mr7229686a12.11.1717485535765; Tue, 04 Jun 2024 00:18:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717485535; cv=pass; d=google.com; s=arc-20160816; b=hbmWN6Tuser7IyYA9XMXHnlLUIxuxCSHjTZZ2m5WwC+3z0DRiye9kN2rDpjiTTg9KZ C2oaJM4lwYP6RfL2eKGxGKZyZYhY1LEtk6Y37UmGtlxAcZL/gQhup2JdVx31VcB5qczG GrkWp41Lk2SZQxcIReLqhHLEqPXjYSMgMASb8uLe338ALwRolXT8CMzkUYdw4ygQx3qo rqTGM5CodqasQuK46O7Mwhn0w+9mfyUjtmgAhyEjl9FR37FjKU6qjkkO0S9TQsvozLCs n9P0N5PRZFooE3ErxM1QAfShQMwy0P0Kc/2alQGfFvKBWafwQZrdLZUa0DcFeBGzx+5w 39KQ== 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=IN4YotoHrJqUzJm3B5rfjHxZ9heuhTQwYjd8l3vWTCM=; fh=X0Knbq3W0rt3JEVad1fkTpaPfCRV5JtNe6YPeXD1FoM=; b=eyoZd2rI4z1DGMGLfUKkIf+QHxKnIldaaJu6YZmV3UV4GzCjzMN9OhE4H5EbOIhlp1 5MGjllWuu7jdM5xHsBJRJVdccww+CPOv17UueNIS+CjZiqsTKw4kKEKPPG8tuX25t1gX 7VGj2gZhpuS73uRxDjGKAeugj71e2udMXHf8ekMC/L41p/VVUMnmYdL+EteqHwWt/TNM 9t139eAWRxcgNPar3YhN5WZFMOAUiEKpEal0Nrr7zUczS2rpTb0aaqlBGs9Gr/GCLOA+ TWOroc//gr6m8YuC51FqK2+wPnF66hf7rHvtmYfyksH1jkeBBRLk8YQkc1k0V8sj5fou r0TQ==; 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=Dyl2wM9v; 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-200144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200144-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 4fb4d7f45d1cf-57a6af584ebsi1092716a12.45.2024.06.04.00.18.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 00:18:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200144-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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Dyl2wM9v; 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-200144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200144-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 3E67B1F211BE for ; Tue, 4 Jun 2024 07:18:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DD8E140E25; Tue, 4 Jun 2024 07:18:44 +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="Dyl2wM9v" Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 7B6A71384B3 for ; Tue, 4 Jun 2024 07:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717485523; cv=none; b=N9UxDebEqH1mV+ZGbO8gKr5nRmt4VsbyVs0w6jaa1XFZgcbudAFcOH7i+/rTjyHZZRL/oCQBwKdP4iOld1RBkRhFEd4Ml84IfDPL+PHbVN/Mu3ZullW+I4ndG3qKaWGYAZNadtg8jfI3D5sk+KXs+Dbi1OrRen4b1Elop4Ke+cc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717485523; c=relaxed/simple; bh=F95EGVVxTZzrtH/iZbq5IMEiCEI5HtwHeAy8QgjRypA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=d6ckWeI3b/qx6U/GxJhX/+mS+IZz2V/cThbmlpKjjxIXlVq0nyePher+cMqvcMTa0KDOFyfZtWTA1itrMEiadLV/ReSWxcLYhUo/+Nboi8suBsFaR+ZFG7IL1zZ/QJ4NiHTazUg9DESj1iylxwHhySwi+B1ohJ6l7zcCCKRiqLo= 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=Dyl2wM9v; arc=none smtp.client-ip=209.85.215.177 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-pg1-f177.google.com with SMTP id 41be03b00d2f7-6c94f2d0902so124102a12.3 for ; Tue, 04 Jun 2024 00:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1717485522; x=1718090322; 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=IN4YotoHrJqUzJm3B5rfjHxZ9heuhTQwYjd8l3vWTCM=; b=Dyl2wM9vO02Yk0ZK8NErPylRnM3dv/dvxs7yZTQ0j4jvUmSeFnr4AO6+Dkg9rl7xes 7UcmW/O7gvsOo8ZrGH3CiavUTxmxq6QoIzTBlBT/S1KIfyqS+WpbtgLOIjiHq75/Al7J 46QKWNDkn/+5ma+2BpeeoVtjW9IHl05JlGVhmU5gjhcZRqniJsXotcw8BKEwlumApz9g uX95udukO788Hw39wQGuvPapteMQjs+EGw0ItrvjxPe70qxh76PXSsV+U8tafEW7zsq5 19LXNgtYitHN4qqk0NST5ppsBN8v/m3mBB5I2/H2Hsc/r086a28YEuR2QgaenU9koxf5 nr4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717485522; x=1718090322; 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=IN4YotoHrJqUzJm3B5rfjHxZ9heuhTQwYjd8l3vWTCM=; b=P0rW717uqh2P7iv/yB83t3kw06nu4fHn8q2aDrtkHFTObxFDF9joJL0cpwI5YzF9tw 9w+YvqnP/KHySB9LrNldEJ+hktqcInqHiBnY6/oyrnFgZiVS/MuoUtb47+TJXE5rgIHX lDzsPYfGBpRrlkm7hFW15ZYP++HwbkEFKlOz97Qbk7iA5/42YQGq1d0lJIwKcDy84fm/ 8ZKXZzuhU/3UtBIMXY9ATPYbwKIdpquregkqRnPpMp84MVECj1unzaXYw3jyTOkuc1M3 74BJetq8dDLlUNelaSoStD/9bOPVyJw2DDl7Kvf1IPBin9o35afvRVSH4WgRNz7Y3Grw Htpw== X-Forwarded-Encrypted: i=1; AJvYcCU5b3kfOSVGIEp05sAeRz6169KPKZU8mIlvsJymwW0XukKe+GIkGzmOUrTK1yHnUWxRdSIdKZjSnW5gH6GdwBUoPtUSNDqYTjIlnS9q X-Gm-Message-State: AOJu0YyQXuHpMRkjzo07ScaroU6liR717E4OUtv31jocFzOtVKGV78Hw 3rrIKzxbqPPj8fRv/PlwLnG/VqpPbM4O9BKrlrlZtyvP26oqHuqaTMQwjpXtl5M= X-Received: by 2002:a05:6a21:33a1:b0:1b2:63c3:274c with SMTP id adf61e73a8af0-1b26f35e160mr12461974637.6.1717485521635; Tue, 04 Jun 2024 00:18:41 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:d768:c577:5bf0:47ab? ([2a01:e0a:999:a3a0:d768:c577:5bf0:47ab]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c1aa9dce87sm8984869a91.21.2024.06.04.00.18.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jun 2024 00:18:40 -0700 (PDT) Message-ID: <06d8ae43-4aad-4637-a33b-9bae91b23872@rivosinc.com> Date: Tue, 4 Jun 2024 09:18:25 +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 v5 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb To: Palmer Dabbelt Cc: Conor Dooley , corbet@lwn.net, Paul Walmsley , aou@eecs.berkeley.edu, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, anup@brainfault.org, shuah@kernel.org, atishp@atishpatra.org, 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: Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 30/05/2024 23:13, Palmer Dabbelt wrote: > On Wed, 22 May 2024 00:20:09 PDT (-0700), cleger@rivosinc.com wrote: >> >> >> On 21/05/2024 21:49, Conor Dooley wrote: >>> On Fri, May 17, 2024 at 04:52:48PM +0200, Clément Léger wrote: >>> >>>> +static int riscv_ext_zca_depends(const struct riscv_isa_ext_data >>>> *data, >>>> +                 const unsigned long *isa_bitmap) >>>> +{ >>>> +    return __riscv_isa_extension_available(isa_bitmap, >>>> RISCV_ISA_EXT_ZCA) ? 0 : -EPROBE_DEFER; >>>> +} >>>> +static int riscv_ext_zcd_validate(const struct riscv_isa_ext_data >>>> *data, >>>> +                  const unsigned long *isa_bitmap) >>>> +{ >>>> +    return __riscv_isa_extension_available(isa_bitmap, >>>> RISCV_ISA_EXT_ZCA) && >>>> +           __riscv_isa_extension_available(isa_bitmap, >>>> RISCV_ISA_EXT_d) ? 0 : -EPROBE_DEFER; >>>> +} >>> >>> Could you write the logic in these out normally please? I think they'd >>> be more understandable (particular this second one) broken down and with >>> early return. >> >> Yes sure. I'll probably make the same thing for zcf_validate as well as >> removing the #ifdef and using IS_ENABLED(): >> >> static int riscv_ext_zcf_validate(const struct riscv_isa_ext_data *data, >>                   const unsigned long *isa_bitmap) >> { >>     if (IS_ENABLED(CONFIG_64BIT)) >>         return -EINVAL; >> >>     if (__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZCA) && >>         __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_f)) >>            return 0; >> >>     return -EPROBE_DEFER; >> } > > Are you going to send a v6 (sorry if I missed it, I'm trying to untangle > all these ISA parsing patch sets). Yes, I was waiting for more feedback/Rb by it seems like I now have everything I need. I'll send that. Thanks, Clément > >> >>> >>> Otherwise, >>> Reviewed-by: Conor Dooley >>> >>> Cheers, >>> Conor.