Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1054763lqs; Wed, 6 Mar 2024 05:13:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWscZUzXkWaQRDgrpo8KPG4H9IeNJoj2Bj16y9iUad19cfjjaBpXp022VaipzZyF5B1VpJsM2qN0XNEXH2macwyukPjY6VYST2GVAzW7g== X-Google-Smtp-Source: AGHT+IEZoHz6c0fJg5AFyd8NfSvFGGhHm9Zqt3ngDGD3UzOCsw1yXVEc3etdCSFpBekmosTjoK+i X-Received: by 2002:a05:6122:319f:b0:4d3:3236:e91 with SMTP id ch31-20020a056122319f00b004d332360e91mr4825558vkb.11.1709730834094; Wed, 06 Mar 2024 05:13:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709730834; cv=pass; d=google.com; s=arc-20160816; b=wBHa7gNIEz/LcXUoB2RHP96e2pLyZbj5dl3fYGIf1/EITMGfIUE8ydle3kgaRiCj37 U5XKcvbq3PVDOOh2RBEmHSEE5x/fSf7kQ1AxAFuxcu1P6gloCUv6AtzZUwm7D3O7k44p R3tRbMUq7GG9I5nrIaQfsqYZ/gUnZuJ0ehRPEQqXM1y7HFed5tpkarXaYbTMa/A4H6mw iYT9S08WRgsiMjmNMBeXK0nVdsMuoM6pxI9t+CcRBNTF2Grn4U8OD3jFCp1T5VZ1SM0M XwRR7vbVhvLEKrqpYu6n1zYvXU20lYeW9zay5tNdWsADMeNDG9cmSdHLQiJWB7/mfAWe czfQ== 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=B75xuqRAKxgsf0d+YK9qTFrsVHEmh5teUl5KesOGcEU=; fh=9PTrdyZGceCOWFVD4ofsjYrTkS4qSjA9/9YUDEUVxrk=; b=izLztLlDr5VfPwCO7t/TAogUdwPKAYvz4O8MKPwysAjFtYJ5gsZcGI0v6eUqGEJQPN TNpEe3b/jlAQhes+042ADlrK/MGMg7FLT/aKH2CYcp/RTWpiWksEBukLmQwb/TW6PCsX XyqOJwpRrO0yLM1Fq/Zd++HRv3v09Ca5Oerk/GL9cLdGik0MgXeDNY+ZUcJmPO5Hhx4U twOO19RrNTMVcFjsJN8tyjxhLvKvIr9YaT0mmoVA4spAaP75+DfjjNo5zum3FM4Ou0/m 0z75AApPjrbrpXbkq4jIXbMlyVxkO2rJQWPm+KlCeDQRpJzVUMcBAj8fp5xkgXsK2lz1 RF/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=DpufhFl0; 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-93958-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q26-20020a67b91a000000b00472ab32c729si1234274vsn.482.2024.03.06.05.13.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 05:13:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93958-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=DpufhFl0; 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-93958-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93958-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A1B401C21B5D for ; Wed, 6 Mar 2024 13:13:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43B35131756; Wed, 6 Mar 2024 13:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="DpufhFl0" 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 7E5C4131743 for ; Wed, 6 Mar 2024 13:12:39 +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=1709730761; cv=none; b=qcOssI0A3u7gNujJMDNQOpSBNaejdajTNbZaV58yOQe77wNd2D+DSwSwg6NIkoPs9VM5kosWvj2zDBWVxBjDMy65xiXOgdNzS4GTBq+HZPaDQwp8ZUFSBgHtCA3pJ7NLQ+Cwja79w8s3zCh3e+YRNOU4w2jeogR8L7OZrZnGV5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709730761; c=relaxed/simple; bh=zc2zZ6M5U5YJr4cZh6IDmp+6jTvsRZlZFYiNFJlAj2M=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GT4V2F8KZpcIpbZT1av0NCG9tGizn7Ejz3d+clmQDfY5bY4XNKalWp/e4nzUN52eeyVIgD46kLYOuSUC4+x4ggTh85AdE1hzsblOLEMVTtXApHpZTRIWpKMZw8edncgh5ZOqcgC+kCx6UouBQz1QWcKRp8zE875RB5Xb1HWJcKs= 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=DpufhFl0; 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=1709730759; x=1741266759; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zc2zZ6M5U5YJr4cZh6IDmp+6jTvsRZlZFYiNFJlAj2M=; b=DpufhFl0tHMBF+/bOZsP+Idw6ID45hbmOKdhES7g4N28A2Y+DUy0V3sw 9Vquj3UQgRBIRxJBTO8cUZMF0yLvzcNtq53Jxf0bXO+AQ3Sjgrk4L4C/v Fg4EMlABLxpI42YBdO+1gAGWGqVTM/oxptNBjiVD9leO4/1A5BJRB0qZY SCg8G5iHxIY+tQU0uQ++pXu3QaqKzSJe98TQpLxsHgkrLnsxl6y4CtmiV zsovoigTUx36fl9dgTFEd00kkUW6s23kKlyvYDCruX0ZGqIUo5T9fNvMK ZCNg8kxX1ivuTN+7zOX4qtHA3TOPTZGPG/JsGNwwmzXE/WdZ4ABzWDWID Q==; X-CSE-ConnectionGUID: It6AnLiDS5GINWmYX8VNaw== X-CSE-MsgGUID: M2/mz+qiSvaT8qbC98gVHA== X-IronPort-AV: E=Sophos;i="6.06,208,1705388400"; d="asc'?scan'208";a="18925469" 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; 06 Mar 2024 06:12:37 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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; Wed, 6 Mar 2024 06:12:30 -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; Wed, 6 Mar 2024 06:12:28 -0700 Date: Wed, 6 Mar 2024 13:11:43 +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 v6 2/4] riscv: Only check online cpus for emulated accesses Message-ID: <20240306-spry-retread-56d6c8dce327@wendy> References: <20240301-disable_misaligned_probe_config-v6-0-612ebd69f430@rivosinc.com> <20240301-disable_misaligned_probe_config-v6-2-612ebd69f430@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="CLY4JT0rzhj1XS62" Content-Disposition: inline In-Reply-To: <20240301-disable_misaligned_probe_config-v6-2-612ebd69f430@rivosinc.com> --CLY4JT0rzhj1XS62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 01, 2024 at 05:45:33PM -0800, Charlie Jenkins wrote: > The unaligned access checker only sets valid values for online cpus. > Check for these values on online cpus rather than on present cpus. >=20 > Signed-off-by: Charlie Jenkins > Fixes: 71c54b3d169d ("riscv: report misaligned accesses emulation to hwpr= obe") Reviewed-by: Conor Dooley Cheers, Conor. > --- > arch/riscv/kernel/traps_misaligned.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/tra= ps_misaligned.c > index 8ded225e8c5b..c2ed4e689bf9 100644 > --- a/arch/riscv/kernel/traps_misaligned.c > +++ b/arch/riscv/kernel/traps_misaligned.c > @@ -632,7 +632,7 @@ void unaligned_emulation_finish(void) > * accesses emulated since tasks requesting such control can run on any > * CPU. > */ > - for_each_present_cpu(cpu) { > + for_each_online_cpu(cpu) { > if (per_cpu(misaligned_access_speed, cpu) !=3D > RISCV_HWPROBE_MISALIGNED_EMULATED) { > return; I went looking to see what the practical differences were between "present" and "possible", cos I'd never really seen much code using "present". Turns out present and possible are essentially the same on riscv. TIL. --CLY4JT0rzhj1XS62 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZehrjwAKCRB4tDGHoIJi 0nKQAQC/tSJTZ1Iyv8vL/KUSfV1d92ey0waFTZfCGSIMtUCNYgEA3wE18AO5OlwU 9ZQodv7iKYlcM9xT0XbN4zjDfJsrmAw= =A42a -----END PGP SIGNATURE----- --CLY4JT0rzhj1XS62--