Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp89624lqc; Thu, 7 Mar 2024 11:06:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXjNx9AfsDPdyrn84ped1/e97I/MvYLzYSyWYMGjZGKoRToqDhA0lNLvA51yda1L/fIKBt3D08DnQf//Vz0Oo9oV7fJ6D1+DDVO5uvaBA== X-Google-Smtp-Source: AGHT+IHVgmAx8QwoRdmuyjtlIjxYfu/cyZNcRbDIAD4sYW08I/nC3Q9YBjo71HbBqmsGQ6UNZ50N X-Received: by 2002:a05:6358:569f:b0:176:a5c2:8f19 with SMTP id o31-20020a056358569f00b00176a5c28f19mr8020687rwf.30.1709838387293; Thu, 07 Mar 2024 11:06:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709838387; cv=pass; d=google.com; s=arc-20160816; b=Pna9YRxl9jjuCFo2y/7c5BriZp+YqOPHedf4zxUgojgUoQlF59QDujSb0P3PV4UJUy CoEaCpWBlBcpRHRPZKzwrxPrrrWlXAzWVyNMUEs57I4DQyEg0U2BRzYpXaDmtd18RIgW kproe9sleYaPlpOzzjSG+nut7CgLvWet0offMVuOGsuTjpccDJaSQ4Ld1TBNq5L8bphY PXwaGW95dFYUyhpPFwHzhDyy7PA/Zz0QIVdq4nM17OWCehLaerUuCp/l/NbMtCZQ1yOP EZRwr+NBfVxnDMigu5wTcSd2t0edv6/drwIrzZr46C9+sTieromzqUeZC5J+0XXS0Sff kitA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=h8i7Hn0NjGdBjABWwTPM97LUVWqQ4V1pWIxyh4e32z8=; fh=Wh89KTV4vPGWFCXPh+WRhkACX3g7ab4gjX2fvew/mkE=; b=jsvxbspBhC6PGRs6IoHYJfRnsMFOS00criPmMMEHfgy1jinOLCBDaT4+B3Ablk2Raw J2LxyYE0teIndvNnZxTk3pWT1pNx8tmekNCDJfVJJFc8AJPVJblh03QQxLlB5+u4185+ UCxvlFqJbOZKZnPhBuWat3etZB7PSEmT3rJ+XclfC2Mel+KbVTOrCAI4qrDxuhoaUK/R e9m+mgInQtrNj1BRrhje5/KT8yZIIE/P477lsZ5uVnkBugo7TB/wwbZR/qJGDNBL8AzT zcorsHTQthJpNd6oLXe74htjqhNekAEeVzPX25NLkqalGrZG9XlMfgaRQOhrm78QS7If 8oXw==; 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=2hh6kg83; 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-96053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96053-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gy4-20020a056214242400b0068f533cd2e3si17867835qvb.242.2024.03.07.11.06.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:06:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=2hh6kg83; 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-96053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96053-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 079461C209B2 for ; Thu, 7 Mar 2024 19:06:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0FE4136982; Thu, 7 Mar 2024 19:05:58 +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="2hh6kg83" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 8F4D2135A75 for ; Thu, 7 Mar 2024 19:05:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709838358; cv=none; b=quIMncyE1po9QQKxbSuSHJglPKgVSZDSHWrNyjRSC1h/KOsnEncmaumb4RdXawdr4orZli8BIi23XynEGpdNQ1raWQpEBSCtE5HLuYTb0dqjekEBAHl1I2PbirY2/dWNSmqtbEsDHNOozzQ47Ugqbq6IfWebIuHleq4zsoBRFVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709838358; c=relaxed/simple; bh=VSZiKx13zcdCVDYwqIRzCcJDp79icXmI6mc1wjrw+wY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=glI+N90FoU3rAwITB+L56ZYbSk1XcGLiQlHijUbuA8Z79K6uOk3djYdlD4/hDSW0BagXfxzxgFNC3lesHjCYYDXWoN5svRmxXbuacKZ7E2U2MK4RnXttswRYu5id8Tv6FxTWr607fWCcbyZoydFqeqp1bzl7HHOyUGonOTBgQ00= 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=2hh6kg83; arc=none smtp.client-ip=209.85.214.174 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-pl1-f174.google.com with SMTP id d9443c01a7336-1dd178fc492so8568395ad.2 for ; Thu, 07 Mar 2024 11:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1709838356; x=1710443156; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=h8i7Hn0NjGdBjABWwTPM97LUVWqQ4V1pWIxyh4e32z8=; b=2hh6kg83cEgyf699kuxP2hMBSkIZtXThRkCb+QdP/Jn7L+izyv9kh9XPVa+9ZFbiof Pri+K9HlCQJrJP7lqmW05znauSIJC9jWmILR/PVuMFP8aJPYgx10sAXpbmFdbElp8UOb 2n8fhxR9iXlAMkmuRnondvkKM5DCaN+Z5rN89QUIIih0WV7s99NtKSde0+L+0GUVp00Q gXVjZthMwY5IaloWpEICmk8lH8V/C1sy0YO0jehiurbnfXMoQPVE6fhTHXzHlQglyr62 sxIRG1gQB+OLSWoj0d9CqUVIkRttegS/Er8+xw9HkVR0XDjPpmKI1ayCq+uu/zOy8brr mxlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709838356; x=1710443156; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h8i7Hn0NjGdBjABWwTPM97LUVWqQ4V1pWIxyh4e32z8=; b=Dz2fISAMQzNPcKKOO5PanW4NE6TZ2ViarqPhkG0hRv8hFFhP7jSnhrPzDZ7LzJ5czi Tq78bF+c89ny6qhatUeM3YlXFWOyp1y7+ody1Bjv8fdsBvOYUaBYMZ461ssXbxq6+xzK 6LXTASGLkCK/7xqjEzdUjy8oHq927EM2JH/2uqxI0iC/0Cnh4kscWO344Q9mzCt9YpuG oNB0XeX4hXbblk6WW09fL5guEz9O+EfngeCOiL8kRh4dkE6A0Kqe/fjY1DC/uaTld0lT htfgdKeitxSd3PuFvGc1cj6Fk04JOPDadIJ53NNaYruzkOu2Z8Y6qGTgHWEfZWSs2cvc CqSA== X-Forwarded-Encrypted: i=1; AJvYcCW6Vf8Gi2hrAb9PNdWfRc8mboebpcRcYHY7ycOkR5JBz12okR2Pr3BlcMlVM892x3AzcvKkdvP8YMD/NG1iRI9tbGdmLtZ+A1wCgNFM X-Gm-Message-State: AOJu0Yw8oSZ/LzRmuMK4JDsyq2j18me0/rgfEnzJab3hylm/4j0cZAQd JQv1VFRLfvE1TEmSz9iGCNvT7/HXZnATkp2+0RyCz48KUqV5KZCOybz9O9363OY= X-Received: by 2002:a17:902:db0a:b0:1dd:a34:7321 with SMTP id m10-20020a170902db0a00b001dd0a347321mr10498088plx.25.1709838355931; Thu, 07 Mar 2024 11:05:55 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id h3-20020a170902680300b001dd526af36csm1747338plk.295.2024.03.07.11.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:05:55 -0800 (PST) From: Charlie Jenkins Date: Thu, 07 Mar 2024 11:05:46 -0800 Subject: [PATCH v8 2/4] riscv: Only check online cpus for emulated accesses Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240307-disable_misaligned_probe_config-v8-2-55d696cb398b@rivosinc.com> References: <20240307-disable_misaligned_probe_config-v8-0-55d696cb398b@rivosinc.com> In-Reply-To: <20240307-disable_misaligned_probe_config-v8-0-55d696cb398b@rivosinc.com> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Evan Green , =?utf-8?q?Cl=C3=A9ment_L=C3=A9ger?= , Eric Biggers , Elliot Berman , Charles Lohr , Conor Dooley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709838351; l=985; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=VSZiKx13zcdCVDYwqIRzCcJDp79icXmI6mc1wjrw+wY=; b=4lDes0vZrJms/4gMpoYeVGqXErBW/PLjmFFmXEprN4sEQrjl/O2TnHAvCflhkGywOBjrDhXZx brGOqXY3mv4DSqV1Bxg2PRf3Aizh4mrVFcQLGzt1urygWj2UkFOGR/j X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= The unaligned access checker only sets valid values for online cpus. Check for these values on online cpus rather than on present cpus. Signed-off-by: Charlie Jenkins Reviewed-by: Conor Dooley Fixes: 71c54b3d169d ("riscv: report misaligned accesses emulation to hwprobe") --- arch/riscv/kernel/traps_misaligned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_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) != RISCV_HWPROBE_MISALIGNED_EMULATED) { return; -- 2.43.2