| Message ID | 20250317170625.1142870-9-cleger@rivosinc.com |
|---|---|
| State | Superseded |
| Headers | show
Return-Path:
<kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=pass (2048-bit key;
secure) header.d=lists.infradead.org header.i=@lists.infradead.org
header.a=rsa-sha256 header.s=bombadil.20210309 header.b=FTgzJoaZ;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=rivosinc-com.20230601.gappssmtp.com
header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256
header.s=20230601 header.b=XvOqAcqW;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=none (no SPF record) smtp.mailfrom=lists.infradead.org
(client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;
envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;
receiver=patchwork.ozlabs.org)
Received: from bombadil.infradead.org (bombadil.infradead.org
[IPv6:2607:7c80:54:3::133])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZGhPZ4lQsz1yFy
for <incoming@patchwork.ozlabs.org>; Tue, 18 Mar 2025 04:13:06 +1100 (AEDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.infradead.org; s=bombadil.20210309; h=Sender:
Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:
Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
List-Owner; bh=a8L5y8vrJEQazWPsU4afRsGurRI5hCCowrsLNdNq07k=; b=FTgzJoaZZR+E4z
K4467pyDTM7X1mVLSobz68D9YOxh6oMxiEKynYaP03hyJAD3dcPx83CoOrf+XXS7+7ZjJ6jgzyG8Q
hpuYsJCJYtqHm8Hy97JD0cdq2vlGdx+zoNJkZC+TcRRQJQ3DF6DALxqsn+r+//q15Q0vQjjI5WBRA
DhBHeTFng0r2a6+0bcYL0qN9Ir4Bnit5U7uXLHBINLgo4kFYYEBqwR32tD9HgT9LzM76RBLbLE/+Z
RrZD8KPjA5NmDGc2nOJEBG0AHGSAwcu0wH5kS1mSG0b4htHfAORl0S0BRRRFjRvnx6pf3FRr3/D9a
09n55z6jFBvgGQPH2jIg==;
Received: from localhost ([::1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux))
id 1tuE1T-00000003V2y-2z65;
Mon, 17 Mar 2025 17:13:07 +0000
Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333])
by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux))
id 1tuDwn-00000003TSp-00eH
for kvm-riscv@lists.infradead.org;
Mon, 17 Mar 2025 17:08:18 +0000
Received: by mail-wm1-x333.google.com with SMTP id
5b1f17b1804b1-43cfb6e9031so20959535e9.0
for <kvm-riscv@lists.infradead.org>;
Mon, 17 Mar 2025 10:08:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1742231296;
x=1742836096; darn=lists.infradead.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=AU7F+Sv/M47Pn2Qo6/tW45mjDMKI8ET1F5gpFniyHfw=;
b=XvOqAcqW3EODMwaL38JCt+9VYNoTPC7k1h7c+rESb6sP6w9+OXuoYJUsxIYNd7MRzZ
GGJKfSg23AsGOvaKntKUoZh7F2j4FMi5rWbi6ueC0eCgJLraIV0pX3y9rcxLJhZFl4ox
svLiXuq6ZYT4Z4EFNeqb6Br0HYIKwLGggPMR93DXFblJ/OF6/gBnKdrJaEj7ES/cgsZS
+zawXHGmdR8m/WIKFN0hAhPjLE8xq4uzpSjkrda6DTXBXRuoyrMWXuHxhoYNIG6k9upO
1EhgWCYBRwuchOg3ZKW+gwy+RSxjt4xKPBzX0rNqfjrCKVMDIvJdrIRuMmpLq6m8Xqqw
Iuxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1742231296; x=1742836096;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=AU7F+Sv/M47Pn2Qo6/tW45mjDMKI8ET1F5gpFniyHfw=;
b=PbPd8r60vFhq+WxFXwO9rOAxbqfvgtPfN9i9a25ErESXbZy0SQoEJ+YLYuCKOtPtH8
l2Jcv8JLeE5epb7vo/Guk+M8s9n/hd7R7cWhq/3Kk9sPJbfHfP51iDna8yxQengSHHo3
qU8aLpK8l5fiSuQj4AxzqkfYe3Z5j1Z+HL/bOgLla3H4V+JdTIXlcRcHVDPcuwG85bMi
G6Qb53h7RuvaqQ43JxKuaFcMQksl63DXeAhzECipSV3P4V19nFZ0TJsg4OlaRzddcKdg
IE38/nOvZN7uCODbbJZH6kgMhA26UdOU3OaZECrVpLijArTK9PFUhHd/MSwk1ydWMstL
X1AA==
X-Forwarded-Encrypted: i=1;
AJvYcCUQ6KKQ+laGM3wq7MBS4rYnb689/jivaZ/sVWlSuWVOBawy5hlInn8a9vuwMOlYfMNUGcHqxwlgT/A=@lists.infradead.org
X-Gm-Message-State: AOJu0YzzXdS0tmvqYqvSw8E1k7Tc4pomvRdcVg9X0M+nlJ7Wo9nPUxC9
jyhzDmfrWTHwYoKabXw/vsX/f5lRelTHXoJK0b8kunG4TqPdoVMkxBq2QYbHvXE=
X-Gm-Gg: ASbGnctSwuoCJxPiw7kU4L6/U250vRRRfnO5+I27BKVOy+5yw+Y3MUpNtlgt3SR6WvC
tPJ71L6j/AJjbBEwyHakPL7gJy9nXZ0d6zrFb1GSxnsLnL6M/2aX2zYz6HzfSBlbkJoYwZxzj+b
IHGl3yVA/V+l03KQ8sukuM53Rw7tf3VNxMIsPDZ6kdqsYSyJHlVtpgKge4X+siI3xSDA3v51wv2
jhv9zovQPIlUVPFfjtIg7JyLCla6dUEpVZhmsDX39if9NhJ0W6m7lfnTiZQmEgNLmlhykyOT94E
0eIjTuGUT/R9nRIojMAwZI5caM044Cqjjd1GghHpWyRGCA==
X-Google-Smtp-Source:
AGHT+IGpDbXWpDYRUzGh2bTIaNirJTVxXi2O+kKj5FZQdCmID2IJ/McRsJVBPF2vymf5U0IMdZpfhQ==
X-Received: by 2002:a05:600c:3b9f:b0:43d:94:cff0 with SMTP id
5b1f17b1804b1-43d1ecd83demr128705695e9.19.1742231295702;
Mon, 17 Mar 2025 10:08:15 -0700 (PDT)
Received: from carbon-x1.. ([2a01:e0a:e17:9700:16d2:7456:6634:9626])
by smtp.gmail.com with ESMTPSA id
5b1f17b1804b1-43d23cddb2asm96014505e9.39.2025.03.17.10.08.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 17 Mar 2025 10:08:15 -0700 (PDT)
From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Anup Patel <anup@brainfault.org>,
Atish Patra <atishp@atishpatra.org>,
Shuah Khan <shuah@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org,
kvm@vger.kernel.org,
kvm-riscv@lists.infradead.org,
linux-kselftest@vger.kernel.org
Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com>,
Samuel Holland <samuel.holland@sifive.com>,
Andrew Jones <ajones@ventanamicro.com>
Subject: [PATCH v4 08/18] riscv: misaligned: move emulated access uniformity
check in a function
Date: Mon, 17 Mar 2025 18:06:14 +0100
Message-ID: <20250317170625.1142870-9-cleger@rivosinc.com>
X-Mailer: git-send-email 2.47.2
In-Reply-To: <20250317170625.1142870-1-cleger@rivosinc.com>
References: <20250317170625.1142870-1-cleger@rivosinc.com>
MIME-Version: 1.0
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20250317_100817_059732_C64FBC21
X-CRM114-Status: GOOD ( 11.23 )
X-Spam-Score: -1.9 (-)
X-Spam-Report: Spam detection software,
running on the system "bombadil.infradead.org",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: Split the code that check for the uniformity of misaligned
accesses performance on all cpus from
check_unaligned_access_emulated_all_cpus()
to its own function which will be used for delegation check. [...]
Content analysis details: (-1.9 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no
trust
[2a00:1450:4864:20:0:0:0:333 listed in]
[list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID Message has at least one valid DKIM or DK
signature
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
X-BeenThere: kvm-riscv@lists.infradead.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: <kvm-riscv.lists.infradead.org>
List-Unsubscribe: <http://lists.infradead.org/mailman/options/kvm-riscv>,
<mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe>
List-Archive: <http://lists.infradead.org/pipermail/kvm-riscv/>
List-Post: <mailto:kvm-riscv@lists.infradead.org>
List-Help: <mailto:kvm-riscv-request@lists.infradead.org?subject=help>
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/kvm-riscv>,
<mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: "kvm-riscv" <kvm-riscv-bounces@lists.infradead.org>
Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
|
| Series |
riscv: add SBI FWFT misaligned exception delegation support
|
expand
|
diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c index 8175b3449b73..3c77fc78fe4f 100644 --- a/arch/riscv/kernel/traps_misaligned.c +++ b/arch/riscv/kernel/traps_misaligned.c @@ -672,10 +672,20 @@ static int cpu_online_check_unaligned_access_emulated(unsigned int cpu) return 0; } -bool check_unaligned_access_emulated_all_cpus(void) +static bool all_cpus_unaligned_scalar_access_emulated(void) { int cpu; + for_each_online_cpu(cpu) + if (per_cpu(misaligned_access_speed, cpu) != + RISCV_HWPROBE_MISALIGNED_SCALAR_EMULATED) + return false; + + return true; +} + +bool check_unaligned_access_emulated_all_cpus(void) +{ /* * We can only support PR_UNALIGN controls if all CPUs have misaligned * accesses emulated since tasks requesting such control can run on any @@ -683,10 +693,8 @@ bool check_unaligned_access_emulated_all_cpus(void) */ on_each_cpu(check_unaligned_access_emulated, NULL, 1); - for_each_online_cpu(cpu) - if (per_cpu(misaligned_access_speed, cpu) - != RISCV_HWPROBE_MISALIGNED_SCALAR_EMULATED) - return false; + if (!all_cpus_unaligned_scalar_access_emulated()) + return false; unaligned_ctl = true; return true;