Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp411723lqi; Thu, 7 Mar 2024 00:27:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwqmzDmnd7O4GPgq6NQlswAZYNJedBwykG4x2jGjxC5+Eg/kxPZAaihxdxH5K2ww3gwXnrg8pAztNtSAVc+nabpzjepQnu3S2HMea/ng== X-Google-Smtp-Source: AGHT+IEB4v6pbhSzApMd1MlZWUaLeaB3pvaNIfaEA3WL2e5MQs1ePcrh7O2f7T0tw1RxAvecCqDl X-Received: by 2002:a05:6871:60a:b0:221:71a5:752c with SMTP id w10-20020a056871060a00b0022171a5752cmr1286437oan.11.1709800023801; Thu, 07 Mar 2024 00:27:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709800023; cv=pass; d=google.com; s=arc-20160816; b=ZcVaTKCQtGySbOE7sYLcXh8hwBYQrpasgIngXLiNfHjsPYwndQQrJQkBw8mcveyHe3 Mt29KHYkaXuTXadDMxBUxPt3bFOF1rdGQNEF9pDwArtadg4qpczQuJfTc8KDnl2WKDdk eJwq0UnGB8YMIxscokqeCQ5EaxYp5kpYsjiDATnJ9ptr4gpm0F0SB6M393tRRchEUYBy USrytK/Tv+s2NtXCGcjfeV/puERLypwc+UfhtZHdmy7LiMTQgR1rtG3Akp2I+pnfAb5a O+rfvvjHNY/lOqVhh2z6Rm6/IiZKtbMpdgJjj0LzsoDp/cJS4GI25MvE6+l3Zj+CVTRJ uzrg== 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=Odoaz/G+N/uMV8GiPds6NgrzZiijRFfVDPU7OrcOg4s=; fh=9PTrdyZGceCOWFVD4ofsjYrTkS4qSjA9/9YUDEUVxrk=; b=gIb/cHZWtMowGy3PkilBZic1ssrjTi57tID7lg8WbxEEQY5aQxKcRluwfmkKJX75Y7 Cvnaywg6RHkWLJo5x/qvrpCQCQCNVJalDm8W+sIj20GLFd5Q9ZLyuFV6epLTX0v4wJ6D +dMl1mKzIShV3onW9MvstZs6NxYYrcmFvXiXbk1lDkFyWcit4dEVFcYr22ZXLX7xsQ+B 62nDVekHdCiIyS8xjQ479va3bF5xK5dIed3hPO6fTORD8sgOtXhjOwm3Qm7+Ib0YVJGa Kqunctd5GyDtjtxI0T3HL/tDXcdmuwI2i2jkL4dStpfGwqdXQVfQbfx5LXdkV6iqaC0+ 1V+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Ni1iXQ5g; 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-95129-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w3-20020a636203000000b005dca5590c21si13375613pgb.454.2024.03.07.00.27.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 00:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95129-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=@microchip.com header.s=mchp header.b=Ni1iXQ5g; 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-95129-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E5833B2291C for ; Thu, 7 Mar 2024 08:25:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCA5F63405; Thu, 7 Mar 2024 08:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Ni1iXQ5g" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 8E8F956447 for ; Thu, 7 Mar 2024 08:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709799943; cv=none; b=BOmbAWV/boFXOXbDfnDfGqRWIE69Pzp+N7WRff4rJhO80BwbyOtJcDeXGRbC2hWM+P4yT+e2Nw6AOGZ1DY8tinRWn8ajYCx3SzoOGjqhR/0TYJc5abGS4yAQt46yKVzE6TScjUxte9vzkmGeZzCAsuez/JhS35TkuLQ2RpBGPmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709799943; c=relaxed/simple; bh=enCse7dbdQXNzTOxJ1nbIU4FpLfhxhz5LWnaFVXaicE=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=khHQ4bBJDXLqtWbjkVm+RqacFCuM+YzEjY28/4uu89fvlN8SvF+ZvuU4b5k7n5ggH9XzDQHw6vHDEa+92Zb4wtkxWVU3nfQxByedSE73yXpQfWDy9ac1WMdxiJjKp8AKX4UBbwuhJXiFD7T9MgJR58crHJq7774J2wkddMdJ9CU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=Ni1iXQ5g; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=1709799941; x=1741335941; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=enCse7dbdQXNzTOxJ1nbIU4FpLfhxhz5LWnaFVXaicE=; b=Ni1iXQ5guegWf+m/xnRo98cHaT1chKVhLq/QxCpM55G5mc3329b3E5uw QKYKX2Q/kFozDXsmxTKZgK0tp3U4hFvGYlFt91iPCZm3VlQ2ZcJoYb+/6 SCHCX7Cp+1ZWXISfuD2kiczYigJ/SGsz1k3fIsSnjQZlCxhwRnQUiqH7R FAR+QbEbh5ZuXuDDYE1Eh5SgijIZaKYP2roJForlbujIqaSUVDXBYmsPA r7ExOxgBxvNlbyhYqBngsMagB7SOTD+hQmEh+9MOWGXjijz4TXRXyPzja lx9+NW6v+mnUd95YjxuIyZOeMnUULxG9cg7yymM2guqTs7GTnYe9bIiNP g==; X-CSE-ConnectionGUID: kAZEeyzJTe2x8LD+/3TGaw== X-CSE-MsgGUID: sdgDN0UeSoumQpAx3OOG4Q== X-IronPort-AV: E=Sophos;i="6.06,210,1705388400"; d="asc'?scan'208";a="18986441" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 07 Mar 2024 01:25:40 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 7 Mar 2024 01:25:23 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 7 Mar 2024 01:25:21 -0700 Date: Thu, 7 Mar 2024 08:24:37 +0000 From: Conor Dooley To: Charlie Jenkins CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Eric Biggers , Elliot Berman , Charles Lohr , , Subject: Re: [PATCH v7 4/4] riscv: Set unaligned access speed at compile time Message-ID: <20240307-defraud-antonym-407fc29261d1@wendy> References: <20240306-disable_misaligned_probe_config-v7-0-6c90419e7a96@rivosinc.com> <20240306-disable_misaligned_probe_config-v7-4-6c90419e7a96@rivosinc.com> 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="iUWIDEsf5AaiYg6s" Content-Disposition: inline In-Reply-To: <20240306-disable_misaligned_probe_config-v7-4-6c90419e7a96@rivosinc.com> --iUWIDEsf5AaiYg6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 06, 2024 at 12:00:04PM -0800, Charlie Jenkins wrote: > +static u64 hwprobe_misaligned(const struct cpumask *cpus) > +{ > + if (IS_ENABLED(CONFIG_RISCV_EMULATED_UNALIGNED_ACCESS)) > + if (unaligned_ctl_available()) > + return RISCV_HWPROBE_MISALIGNED_EMULATED; > + else > + return RISCV_HWPROBE_MISALIGNED_SLOW; > + else if (IS_ENABLED(CONFIG_RISCV_SLOW_UNALIGNED_ACCESS)) > + return RISCV_HWPROBE_MISALIGNED_SLOW; > + else if (IS_ENABLED(CONFIG_RISCV_EFFICIENT_UNALIGNED_ACCESS)) > + return RISCV_HWPROBE_MISALIGNED_FAST; > +} > +#endif Isn't this just static u64 hwprobe_misaligned(const struct cpumask *cpus) { if (IS_ENABLED(CONFIG_RISCV_EFFICIENT_UNALIGNED_ACCESS)) return RISCV_HWPROBE_MISALIGNED_FAST; if (IS_ENABLED(CONFIG_RISCV_EMULATED_UNALIGNED_ACCESS) && unaligned_ctl_available()) return RISCV_HWPROBE_MISALIGNED_EMULATED; return RISCV_HWPROBE_MISALIGNED_SLOW; } ? Otherwise, Reviewed-by: Conor Dooley The kconfig stuff looks ~good to me, I wanted to make one comment about the wording of a sentence I wrote being pretty meh, but I think it's time to let go there... Cheers, Conor. --iUWIDEsf5AaiYg6s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZel5xQAKCRB4tDGHoIJi 0pPlAPwKe8nxyNXBCUxArQriqoMFYmNKeb0YDkPKt4MH66EXlAD7BfOP6iDRPpa/ qDkpTdHvENUdrS09wUiH9vE93smHeww= =xXdV -----END PGP SIGNATURE----- --iUWIDEsf5AaiYg6s--