From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 36384470453 for ; Wed, 22 Jul 2026 07:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784706756; cv=none; b=KMJ9RMrcdv+bHmG81eMp+nw6fUHV/nmvID4Ibi152/B8/mf/+G39UQkIxhSAMOd//WiCOyjwi4zL7ev9h5kfilf6Fe+OZCcW99c0GL1fzG+8eeSkBujH4X7irhTOaJBscd43V6PA5n3Rgboc0z0HoMlzgjDcQCe2WA0n0PZYoNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784706756; c=relaxed/simple; bh=PIMICJOliSFh/mxIXRLbp9QNZQoXBr2mUObIuad0KMQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=qGWA8cIuPfp7+1RKuFUYqhBJPBowfP9kJpIRSFMCTb7TrsUsyt8+eoYIj7fhm+rzcd8d4SywI2IBJlY2ahdJB0ZJx0kOe3RqSw+4KlWWgnaq870H1LF0j/huL2Zjv+EVObVDDtC9q4Mm4xIc/lKxH9eQagVL//P3OZF8jJe7Ilk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=B7lH0kcI; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sv206CJj; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="B7lH0kcI"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sv206CJj" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1784706753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PIMICJOliSFh/mxIXRLbp9QNZQoXBr2mUObIuad0KMQ=; b=B7lH0kcIg6EepRauWvBylMJNh4OAV8/T/k0pAPME65n1yUJiledATEHSvGlUhi0NgYDZV0 2SVDgUI0suEvrCabuYQGSwg80Tc5BrPNl6FOOMju5QSIe8LYRtzaaCpZCsWd1i5TPhOIHN 23mLIX47ZhBKXVLQAGn06Syati7u7kKrg0yj907Tn2hpgNIgwqIICyDIve+hHJ4oaD/3r/ nEOWNOKAcnpQNCUxQd2PdADpdBUhlQ4tOkC1KBJtvIu0UBnoCnT40r0dvhcA7jpSRa1GJL o+JJj400akiMTma3NFRJnLnkSQPigy4sKNZ+1X/x7amGQQW+nIVQrsNNmQkUbQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1784706753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PIMICJOliSFh/mxIXRLbp9QNZQoXBr2mUObIuad0KMQ=; b=sv206CJj7UFmeFdeFrQTQkLDUr51W5u05R2KYjZ8zqypIH2kMfKzLqL2eHRiUXPkl/14Nt HENjMen8cPQIRtCg== To: Rui Qi , linux-riscv@lists.infradead.org Cc: Rui Qi , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Kees Cook , Jingwei Wang , open list Subject: Re: [PATCH] riscv: hwprobe: Register unaligned probes before usermode In-Reply-To: <20260721150511.1607105-1-qirui.001@bytedance.com> References: <20260721150511.1607105-1-qirui.001@bytedance.com> Date: Wed, 22 Jul 2026 09:52:32 +0200 Message-ID: <87a4rja2bj.fsf@yellow.woof> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Rui Qi" writes: > The hwprobe vDSO data is populated by the first riscv_hwprobe syscall. > Some values, such as MISALIGNED_VECTOR_PERF, may depend on the async > vector unaligned access speed probe registered by > check_unaligned_access_all_cpus(). > > That initcall currently runs at late_initcall level. However, > rootfs_initcall enables usermode helpers before late initcalls run, so an > early helper can execute userspace and call riscv_hwprobe first. > > In that case complete_hwprobe_vdso_data() consumes the initial > pending_boot_probes reference, populates the vDSO cache, and marks it > ready before the later async probe is registered. The eventual probe > result then cannot update the already-ready cache. > > Move check_unaligned_access_all_cpus() to fs_initcall_sync. This still > runs after clocksource_done_booting(), so the ktime_get_mono_fast_ns() > benchmark uses a stable clocksource, but it runs before rootfs_initcall > enables usermode helpers. > > Any async hwprobe probe is therefore registered before userspace can > trigger the one-time vDSO cache population. > > Fixes: 6455c6c11827 ("riscv: Clean up & optimize unaligned scalar access probe") > Signed-off-by: Rui Qi Sounds reasonable. Reviewed-by: Nam Cao