Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp664014lqs; Fri, 14 Jun 2024 01:41:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVj4Vf7akCkQXaQcHBFPtpuwC49Gt+TXapjuVIf+tC/6hVIVlJ6kwpiW+kNsG5g//u12L3Y/RqNVLis3esW6K2DYnIjS6OvEeQqM8KgQg== X-Google-Smtp-Source: AGHT+IHne6wnUsOzDRIxHb1iTDV+YlQ9h6ZG6MMubf6BP5oSY8p678WImR7F8SvqOBQUgDILI7FO X-Received: by 2002:a17:907:1c1d:b0:a6f:576e:4d32 with SMTP id a640c23a62f3a-a6f60cf4310mr176565966b.4.1718354490212; Fri, 14 Jun 2024 01:41:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718354490; cv=pass; d=google.com; s=arc-20160816; b=sBYjjpXycx5E25UCr3JZfSoBhyH5NJ9TeG5VHxqWZOQ+oCCo8spSW82pkO0vUtLQUs wjvNDsm30B2lGLZ6b1L+ItWFrOmUsvtX5R0iMa6xDb8/BkuOiSXLsN/boB1snNHAlkAX KqwDpi9Zy6GyY2dHVVGXEj1vm8VDN01YTw/tneNhLcOTQLHDxCVUZ1RdZYxqpvfLSrCP KhPNBmeLaDfuXQ3cYu/qEiokOElHceMyurcSIfe7JCmJIkb4wCSgAW7/fmfqgg88YuFq nTpMEVi4bQKuso5LuQR/Kgq1pDoCOMXKplcOn2QCjEbjxzLqMX6l3MN1ceoQ0oqp9NNS dhSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xjebZ4n+cKjhrecBFav62ztqz32Naa8WzZb/KpyLefg=; fh=sLh1CGcWzbiP5LK2GU1f2rdMR1WRRjhKapWSpixyjGM=; b=kPio0j6/yrmy+gZP0jxo9XMh1NGAyk7o9vP2SAdDxVNO93F8lSujdScKWhX9koB3SZ gAulUgz4j48NyFbuY5oFL1tevsRUjzFeUT6vmVvDT9/nllH9tl80EHru2OWv5VqNe7VG UO4zG/F/vZ3CTxS0x03AH6nGtg87PmRslqU5DaiSHZkeGnVSPhWI368pTM75q/nj8my/ scj4sTHfTbh95zr6L+9McCo78HTx86i+pWwBuXFxnOQZu4CQiDZA1vW5M70d86qBZql1 Af1GYslUAIdbd5edJ3HuQkP8YuKVndM7HxdQPvbGHogQNHEeMfh+TrXBOR4CMVtuxJ/u Ojwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ulel9lx9; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-214571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56dd5e8dsi151293166b.400.2024.06.14.01.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 01:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214571-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=@microchip.com header.s=mchp header.b=ulel9lx9; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-214571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com 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 BD5D11F2142B for ; Fri, 14 Jun 2024 08:41:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1ABCA190485; Fri, 14 Jun 2024 08:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ulel9lx9" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B61E4186E57; Fri, 14 Jun 2024 08:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718354479; cv=none; b=EM7TzQZa/djP1lDqCjQZ8UzsmoKkWIPoLiWwiCeu97Y9ZNSI66aTHM8HHBU/zYlgy2QAw0YPQJbzzCS/V1GAYwfEmz+u9E/KJNgmkCrJiHbGRrPjH0SK94/N/4JSO1CAcmynLmlLxN2FuhA5pSLO+5Jz35m5Hpx8+SHmzd5aMUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718354479; c=relaxed/simple; bh=ZDOfCAptFctnoa5A1SoVoCGucPsxFM9g5sCeJUxH9HE=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BiS5lH532MKzZa4LWhfyYl3ftlVx4nsjx1ZRfjU3FN1HujRWX7KN0VpP7P6KScUsMhPLJzecbujrQd6WbPQeEBYE6gNmPJLRN6NHW7XPD78Nsbreao3mzy059Gy+4UxEdDcpyv8yVxthrLL9+FVPf/GrkFXCECcpxvvYtyjU67Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=ulel9lx9; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1718354474; x=1749890474; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZDOfCAptFctnoa5A1SoVoCGucPsxFM9g5sCeJUxH9HE=; b=ulel9lx9wnq5xL2xLIq/k/nJviVGsyRvZi0ToURNM/IKjr9ifOtqeTfE XWWwIVzkBYMlQlzo8cxPU49PEvryaP44kxg6qwJPJjNYlu2RsvydKkguJ YTcRCJAWWnc/jwG2F4orJk2E9a89MMl/+1cq5rnoCm4nf5FIlbLEefa4a 50RmUC3xeJhusZDrCFbdod6TQ81q7P0nEGwU4WI496jKO2SXreeem2WFZ wdxlc3FpXNexDYz7yF0eQ87adtQAtjJ0vCg86N6DjmXjzIDqgoROvKQvi Ja/1EM3ujQVyjNY5aYyrT+60E4YntBLGXEg0yU8j53Znx4vka6h+IGR4T g==; X-CSE-ConnectionGUID: 4NPx0QlnRdWIkhBEFQ6o0w== X-CSE-MsgGUID: Ak2QJkQ1QT2Hb92DGF/MQA== X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="asc'?scan'208";a="28160744" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Jun 2024 01:41:13 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 14 Jun 2024 01:40:52 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 14 Jun 2024 01:40:46 -0700 Date: Fri, 14 Jun 2024 09:40:29 +0100 From: Conor Dooley To: Jesse Taube CC: , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Evan Green , Andrew Jones , Charlie Jenkins , Xiao Wang , Andy Chiu , Eric Biggers , Greentime Hu , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Heiko Stuebner , Costa Shulyupin , Andrew Morton , Baoquan He , Anup Patel , Zong Li , Sami Tolvanen , Ben Dooks , Alexandre Ghiti , "Gustavo A. R. Silva" , Erick Archer , Joel Granados , , , Subject: Re: [PATCH v2 4/6] RISC-V: Detect unaligned vector accesses supported. Message-ID: <20240614-distaste-negligee-ba9216a8684e@wendy> References: <20240613191616.2101821-1-jesse@rivosinc.com> <20240613191616.2101821-5-jesse@rivosinc.com> <20240614-viral-dinghy-71d5f6585a55@wendy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2C5Ng6p8Cz1W0Nqu" Content-Disposition: inline In-Reply-To: <20240614-viral-dinghy-71d5f6585a55@wendy> --2C5Ng6p8Cz1W0Nqu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 14, 2024 at 09:36:55AM +0100, Conor Dooley wrote: > On Thu, Jun 13, 2024 at 03:16:13PM -0400, Jesse Taube wrote: > > --- a/arch/riscv/kernel/unaligned_access_speed.c > > +++ b/arch/riscv/kernel/unaligned_access_speed.c > > @@ -19,7 +19,8 @@ > > #define MISALIGNED_BUFFER_ORDER get_order(MISALIGNED_BUFFER_SIZE) > > #define MISALIGNED_COPY_SIZE ((MISALIGNED_BUFFER_SIZE / 2) - 0x80) > > =20 > > -DEFINE_PER_CPU(long, misaligned_access_speed); > > +DEFINE_PER_CPU(long, misaligned_access_speed) =3D RISCV_HWPROBE_MISALI= GNED_UNKNOWN; > > +DEFINE_PER_CPU(long, vector_misaligned_access) =3D RISCV_HWPROBE_VEC_M= ISALIGNED_UNSUPPORTED; > > =20 > > #ifdef CONFIG_RISCV_PROBE_UNALIGNED_ACCESS > > static cpumask_t fast_misaligned_access; > > @@ -268,12 +269,18 @@ static int check_unaligned_access_all_cpus(void) > > =20 > > if (riscv_has_extension_unlikely(RISCV_ISA_EXT_ZICCLSM)) { > > for_each_online_cpu(cpu) { > > +#ifdef CONFIG_RISCV_VECTOR_MISALIGNED > > + per_cpu(vector_misaligned_access, cpu) =3D RISCV_HWPROBE_VEC_MISALI= GNED_FAST; > > +#endif > > +#ifdef CONFIG_RISCV_MISALIGNED > > per_cpu(misaligned_access_speed, cpu) =3D RISCV_HWPROBE_MISALIGNED_= FAST; > > +#endif >=20 > Can you IS_ENABLED()-ify these two as well please? Ah, you can't cos the variable doesn't exist in the other case. --2C5Ng6p8Cz1W0Nqu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZmwB/QAKCRB4tDGHoIJi 0lw0AP0dWhFA2S8cu1ZnOnJgSeMCQC978npy6RKjjZB2oEKb2wEAz/ZaOC0iE5/z bsJe/o/CJnvi7AXZcpQIaYdEDBNgIgs= =RIo5 -----END PGP SIGNATURE----- --2C5Ng6p8Cz1W0Nqu--