Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp171395lqp; Wed, 22 May 2024 00:20:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHvzbzPjAepyz+VKTzttgYLPuKbUda0i/8efEk3O0Y+aUhpsq6E4XStk2OPkb6WkuLlPsESfFLku5Sbg9bb+RdHejIFSDhR73GTbpoiQ== X-Google-Smtp-Source: AGHT+IFfu/vKCcgYf3yhTMgjRHQKVC/BN4SmfFpdEznaLsMvs+1/DyzQrQIdbhFok24CpOlDM2T4 X-Received: by 2002:a17:906:3daa:b0:a5a:8d07:6a00 with SMTP id a640c23a62f3a-a622814c36amr69669666b.64.1716362425120; Wed, 22 May 2024 00:20:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716362425; cv=pass; d=google.com; s=arc-20160816; b=hV5NPJlN8TxOuHaQdt70KMzWzVMkeURd1owbBPjmBcdJyPyE2n7os7D0O+kS3OJquq 4Wih39BugbjxYtcoEQrJ0V8D9U3OVCYv7uVK8+BL3Xn1bs0l1QvlbfiA7DUF8D2UgrR9 iq9Zg61pbC/RDtu+XcZiciyET9MTXwsExL5iXb87uqhi6q4yazHoFNao/xHRZOPDPaNl mAI4DmTaiDTwqJS0AS5xZ7WMKYNlRnqp+5X4RWHFPpH65Zs0hssLMVVEYJVE6LgZZS4u AgRReWdH4U+Ed36rLfSBz/pXXq0Qi9gjR5VE/ObdtP87rtb4qbjxrTBLMbI/QkS9wT+0 hrSg== 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=fMBhFPY2RLtVbP9uMG/kHTkoH5FQv+/qbKIQ531cWpY=; fh=s1t9UcSqaoZpaMCobtBED7agEGwsF5WMgYfeY+NPIew=; b=NB8w5AFBteVzRwaT6gPR4gJHnj9AZdOyvOVmW2XPkWNN9IQ19lCK/MwjUPYPIBlFZo /Vn7cinawu091QN8zudQpTBn34TtvapVG3azc0K4PM7YVSZ8wbUE7f+ecMlIfQ1JYmgT e9sFc3T3fuImtR2kGmRE+7mMBe0Nt1RPHIykdUMOu2oflOenfY4UneNhLVQxZNkGLotf RiUSBbaKvPs48T4rq8RQqG7a4bK2gnbfithVA6yNMBxpdvsQ21E0pG9H0wbL4njmBxwo +qC3Jzw/x3B2f3W2dPqYnZovrcdB1U31JLs60V9VLtCp74QF2ZaQzx/ufPR1lSEeCHwB BdGA==; 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=yxEbtQ3j; 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-185848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185848-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba38e4si1447688666b.505.2024.05.22.00.20.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 00:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=yxEbtQ3j; 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-185848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185848-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 D6CEB1F22640 for ; Wed, 22 May 2024 07:20:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 644257C6C9; Wed, 22 May 2024 07:20:15 +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="yxEbtQ3j" 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 D140A7CF34 for ; Wed, 22 May 2024 07:20:12 +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=1716362414; cv=none; b=hxIOqLlxN0C/T76JORAg8RP7AdSyLR0cYMzi8EcVZs33H7QbosMReaM0i4WTiIVouqC7SKpYm5sNQr4vL/Km/KveMRA8qGFAhYpuXrqlb32vCAgpPhRaTuujKzdTES7Bc3hB8Hd9Gjjwaza1XcUNX8LUHUTyYz325QW2NZe0Aok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716362414; c=relaxed/simple; bh=91UIMoBqJuIXzScrNoeDbzNCRnDbmKh3LQPWGD3QPxU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=m1JCwBeuS8TF+0vcDcSf7vl+yoVsjbLcLLACZpU99I4CWHkJl5DLGK58FiDbilYhF253OJwXOJch3Ww7V8Pft3OmWafkWWT7AHFKIVhFLPaFHdZktkNHltgAtCuLix827IY+QzWIMnH3HF89DzUd4Aa7vi8vp3zL7wXMnshsJu4= 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=yxEbtQ3j; 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-351c2c48effso99984f8f.3 for ; Wed, 22 May 2024 00:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1716362411; x=1716967211; 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=fMBhFPY2RLtVbP9uMG/kHTkoH5FQv+/qbKIQ531cWpY=; b=yxEbtQ3jBAiY1LpsMAoWuQU3Vaj6RXjkYDZGyBUphNOwgccUqyjFhXkjlwa8gp45eb 8o9QXJ8wqST8RsWfjHawpZ2QXwBcX6Bg4aVQrOYeUo5DAf37nwwhoW7t+R0P9NScrCFP hEwIygrBPCrpTwdtJQM9MsPOP3qfrawdiQBqCI0Bg0YOVPrBMsBPOqTfCpHpgO0ZCzIW XgrUrb8JYI7tmql124H9Ip53DhMDhck6W1wFnYqF8f25BmXEcEjMz828NPw5xIbuzvgn l1Iba4rfhlBwFdlG6hBBYLIymcTqItTO8L5RR3GHGzQw478K2W9t6+/q9Uba9ByS0Iil jW5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716362411; x=1716967211; 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=fMBhFPY2RLtVbP9uMG/kHTkoH5FQv+/qbKIQ531cWpY=; b=ZS5c0o8CTURWXBvFQ8/JWO27+Slt/Ou2x/fpjXfhFMtMlFRXvIkG1ZnTTpcSQQFcTa L1+4GprPsj/Yaah+D5R5cDLBC1zYbum0gH0gzvdkfR8EMT+uiEEsRQZRJ2DVJJerKzwi tO5g9suY3mBrUETviDm+klo17SIyUm0L/YNUZIhNHDSCWNzR+5NOrELlVQX291q/kCxz vMjcyS6Z79jOW6Ivl6wCYjS1aaTlt02YB2vY2H5/TFO7E3Ri0b/JNYQ/BILDWK0wXKm5 fT0NsAN47w4Hlg/BqSR4voKLgcdLIjPJVcc4c1LMOJD7AuOjWaoKFONmCcoY9vHYWpnU 3K3g== X-Forwarded-Encrypted: i=1; AJvYcCXxTad6+g0PNGdZ0z6xxrLss5eUGI9jI+4FSxQ0Jg//vpxljO89JomwhrqSc/jedMVRwAYXi4fCBmaBfqvYAUI/plH5ZNbRP7vssUrG X-Gm-Message-State: AOJu0YzzTbX+8f72q9Jh/ymBx9QpOPOYdl1rRfGkHqNYfAMfJc0MCSaj o6uyElnyRmMRDJ/OA+EfKJuZDqUy1yUHxwyLZe6SKOEAD7/21h7eWb276eCMUDg= X-Received: by 2002:adf:f5c3:0:b0:34e:bdf9:32ff with SMTP id ffacd0b85a97d-354d8c7c2a0mr765925f8f.1.1716362411076; Wed, 22 May 2024 00:20:11 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:2d44:5824:d42d:899? ([2a01:e0a:999:a3a0:2d44:5824:d42d:899]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502baad037sm33448437f8f.71.2024.05.22.00.20.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 May 2024 00:20:10 -0700 (PDT) Message-ID: Date: Wed, 22 May 2024 09:20:09 +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: 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: <20240517145302.971019-1-cleger@rivosinc.com> <20240517145302.971019-9-cleger@rivosinc.com> <20240521-spiny-undergrad-efa1a391ad3d@spud> Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: <20240521-spiny-undergrad-efa1a391ad3d@spud> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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; } > > Otherwise, > Reviewed-by: Conor Dooley > > Cheers, > Conor.