Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp181126lqg; Fri, 1 Mar 2024 01:45:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcBDQI2NgzihtvtTiooyTAUK5EZ0MTOyK9vWyxu15jFtBww5y8oqIe/Csis1CxuNQ5PNbPdfjbEZ1805jN+QE9nDDILburmhHzjOFJPw== X-Google-Smtp-Source: AGHT+IEBVBR9wvU4Ty0olufiLRMoDWPfvs1Fui87QY0PyXPFbpWqfjOmrISu+4QdPXaR7ZmaQTAi X-Received: by 2002:a05:6a00:989:b0:6e5:5d1d:d1ba with SMTP id u9-20020a056a00098900b006e55d1dd1bamr1406098pfg.21.1709286316817; Fri, 01 Mar 2024 01:45:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709286316; cv=pass; d=google.com; s=arc-20160816; b=cSdmRtxPkPSmHmCt1/G62PpDc3G/IY5i6W/O33+aA8ybObyJi0uAK9z93LYNw1NCFu o07V4W5pvQPn9VWwEKuW1NTMBCYqLC37zU5YIO7ndtyX+sMVJAMWL5K1nfJKokkAe8tz aEqQOulEmUwXrvDOyCJ2e1U+vdoQgNMF+xfg3zzIKp0VKJjjtSNUDkS/ai3Dfx5lH+Us NvnyLjvdskbk2ItgBzC1Mblyo/yGbEzLF35GmlXLbsUpyxaozt9+TBBjicpSpS/8sK7J WWxTYweVd+r6v4DmCErSO6OgEnt1WTZ1+UHIF9ye7a5QK4Y2RCMctldzeKmAhqN+9joT WKsg== 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=l7/w/M9Qg8/uTF4RCzKi8u0Y/0s8UezyrPjWXYLzReY=; fh=QHZMhd4fWYFJKKVq1mZ7xfOBuw+oLWObSnczA2NtVKg=; b=C0jdZA6nMn9pL9SfG4OQHcRBWJs4pHL0WgheIXX/Kp1trR7qdeS6UgOxr31l9SWXyr rnYcF+OpSGLZ7UWhGaVAPy1+q7L+UNTgvILwtuJcsPe98DmnGSA3ltC8h9Pd8Xjs+cJh 3NdBAwiSNG8IQrm4eABKzzcrvn2IRyFsZ725FPQNihj8rRJxLyi7BSFEXXl+YKOu5i2a vDhTtaZgN1uHg8id4przEnz9fkk6YASKFikSUjP7hNboVZVDPSqikjUx3P8NDDak/2fL 2O0tQWusAz/ODFDYhP/g01g5vjQUnEn4CfS5NpmUGSAiuhpTPbwed0kQ/zy2d9rP2bZT 0WNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=E3r8JZ91; 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-88185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88185-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y12-20020a62f24c000000b006e59615813bsi2843337pfl.376.2024.03.01.01.45.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 01:45:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88185-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=@microchip.com header.s=mchp header.b=E3r8JZ91; 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-88185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88185-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 BC1EEB29B8B for ; Fri, 1 Mar 2024 09:28:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD6E06AF85; Fri, 1 Mar 2024 09:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="E3r8JZ91" 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 A4B6E6A8D6 for ; Fri, 1 Mar 2024 09:28:09 +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=1709285292; cv=none; b=Xm6TaGoAoT1L6bKAzBffCV/sEYqBd3RpnPhpqbIpPbZDCuKJ3P7XMNxH5J7vCA7mTfcIPqy7VipI1y8rIbeRdeyyI+NAv6tEWcETr1Lxwtk1fTUJQODejkzzn4p1uHMjAIF19r9SkYA2mLm1bP6KJXGvtjf8gab74A3lLlkgCHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709285292; c=relaxed/simple; bh=l7/w/M9Qg8/uTF4RCzKi8u0Y/0s8UezyrPjWXYLzReY=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gHMwb6KQDGczamoJLeoMaKamLOzMIIsoUivt2E7IxAstEjHpq8GZ5hqalfZlD45zhT0e1BbMAMbJTG1pnYouRgAM+grUwjZEIIbhGNpH3b8PW7pZM6cwI4gMtqhUGz4A10qYa3mWntX62fAZt7RexXucZq7/PPTR3szoRJlcZXk= 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=E3r8JZ91; arc=none smtp.client-ip=68.232.154.123 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=1709285289; x=1740821289; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=l7/w/M9Qg8/uTF4RCzKi8u0Y/0s8UezyrPjWXYLzReY=; b=E3r8JZ91XbFUDYTC/PSNRPAuDRdWIPMz19g1ZhyS6td3xvSJHeUNRM6c 10vzfnnn7uPDHLLoTCYw4XTS2FRY3dB3Qb0jjPoMAo1KgrXID7F2gM78T oupnJXyEqcLMbk/Kov4OMiehFgN0OaeHhMBpZSId0bVAWQMpR0Y06cB43 OlYJeyeYvqC0RQYs6WxKUQl6m64/8Bsphr93eg4kGhicpaYr4UGF/cMwn eUD7j2ukflzXjOvVftS41dml2I1tmI7qBJw1rzLatdapB6W7GQWiUVUdZ 22ljIlRjOLHETDn6+wXhSsy9pzsQpz38TZ8Up/BaVASz0H15NpQC7/wmo Q==; X-CSE-ConnectionGUID: ygVnSIYfQEKFz2nIe+wEow== X-CSE-MsgGUID: v34koBgySemG9lkf8xSESQ== X-IronPort-AV: E=Sophos;i="6.06,195,1705388400"; d="asc'?scan'208";a="17056042" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Mar 2024 02:28:07 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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; Fri, 1 Mar 2024 02:27:44 -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, 1 Mar 2024 02:27:41 -0700 Date: Fri, 1 Mar 2024 09:26:58 +0000 From: Conor Dooley To: Charlie Jenkins CC: Conor Dooley , 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 v5 2/2] riscv: Set unaligned access speed at compile time Message-ID: <20240301-reload-gristle-b417fe02f980@wendy> References: <20240227-disable_misaligned_probe_config-v5-0-b6853846e27a@rivosinc.com> <20240227-disable_misaligned_probe_config-v5-2-b6853846e27a@rivosinc.com> <20240229-company-taste-daa305961e3a@spud> <20240229-dolphin-pennant-eef41ce44043@spud> 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="OWPJFMUiteII9XLr" Content-Disposition: inline In-Reply-To: --OWPJFMUiteII9XLr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 29, 2024 at 11:23:08AM -0800, Charlie Jenkins wrote: > > > > 1 probe: probe at boot time, falling back to emulated if not perfor= mant > > > > 2 emulated: always emulate it in the kernel > > > > 3 slow: don't probe or emulate in the kernel > > > > 4 fast: Your current fast option > > >=20 > > > Emulated doesn't mean that the kernel will always emulate the unalign= ed > > > accesses. It means that the kernel has the ability to emulate them. It > > > will only emulate them if the CPU traps on unaligned accesses. Kernel > > > code can choose to forcefully align an address it thinks may cause an > > > unaligned access, but that's slightly different from emulated. > >=20 > > Sure, make option 2 "don't probe at boot time, emulate it in the kernel > > if we trap". I suppose in this case though, to get a correct output in > > hwprobe you'd have to still attempt an unaligned access at boot time to > > see if you trap but it will not perform the speed test? >=20 > Are you trying to cover the case here that the kernel is compiled as > "emulate unaligned accesses" but the kernel isn't actually needed to > emulate unaligned accesses? Nope, the case "don't probe at boot time, emulate it in the kernel if we trap" which is replacing 2 above. > Seems like if the kernel is compiled as > such it would make sense to report emulated with the assumption that if > the kernel isn't emulating it, something else is. Or maybe nothing is emulating it, we don't know. Feels to me like it should report slow by default, given that's the option you can infer the least information from, and then report emulated on trap. --OWPJFMUiteII9XLr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZeGfXgAKCRB4tDGHoIJi 0md+AQC9ln9J1hgmg38Hb8NELNWiEuurKRN0vtr8/lu8ceH4fQD/RjZiXsoMUXMx e4Gjfj0VS2ezNPwHU685ZVn5/3sqogI= =dmRT -----END PGP SIGNATURE----- --OWPJFMUiteII9XLr--