From nobody Mon Dec 15 18:55:56 2025 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 DE7EF314D15; Mon, 3 Nov 2025 14:48:15 +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=1762181297; cv=none; b=W4IqY/KWFPhUMRboJGFPT8DDiCsBe785eRWWDBYiR+uMyCIX13iKhMtQcMYJZoRMF6n6r1PZvbHUmkMb9COfbQE+FqhGW1PCPKvxxYCyJYQTljEYzQowZnMzVelbKJqj/OsiiGc75VXLGECK7QMcxgqYG5PLngHf1bPOLyT9aBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762181297; c=relaxed/simple; bh=UysfJMIe/bn/3ljyPqmpAgbo4+BOlB8x2Eh2MjCVTX4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=ovs+RgZgCJ0tpzdfmA1urzbZ7mhoJL7xvpgsCHYzOk9gSF8c5PN7pC7Yem5X3QfDoJDzku+K/VzkpuDQQdbwvWEWjHRL5mhn2bMw8XBvSSpBsfOVV2TbttnodesjJ9nsYKGhi2AEjTeG51Q09NVLApqEpbEYvtkXwqb76ASFhq4= 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=FYszmzmh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=y+OH+W0k; 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="FYszmzmh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="y+OH+W0k" Date: Mon, 03 Nov 2025 14:48:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762181294; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUpr2u7CDyfQkJlmvdQoguV5PDCjMrOOovcN5lk0b2o=; b=FYszmzmhhJxMfYwCUW0SbuSy0E2Gqb3Qw0IenkomHfJ/MQ6Mm46ss61h/bj1frnQDrhQyG zR0VJ3Vqx7Pu04iv4la21C2XQmTf+JnGsQmIm157QMsjcxGN7ktTgENTWcYPTkaepFlyYX 6kryqDQlsehD2gr7hKPeO9rrf/H/0nzuxp4w/FdGXjFX7rhrcam7+O4m11eTU82qSY90e6 ruZvsPR+42Kbk/TYsfEBDNCm8wOarvDhzQdghO/BMon6wYhKBz8vig5pawBJvxCVU9iDfj HI+vD9d1U8lC9N+5CLs60xFhdibYOp5pui5C2F4Dhuw4Hq9Y2EzgHG95a0OKEA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762181294; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUpr2u7CDyfQkJlmvdQoguV5PDCjMrOOovcN5lk0b2o=; b=y+OH+W0k5BJqT+YsJaT2SbGjk0SgPrVGUTiLbtplqgTUpZuRxhxx/Y4ETzJqvxm7QwkrUU R1rAVVbWI842F2Cg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/rseq] ARM: uaccess: Implement missing __get_user_asm_dword() Cc: kernel test robot , Thomas Gleixner , "Peter Zijlstra (Intel)" , Mathieu Desnoyers , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20251027083745.168468637@linutronix.de> References: <20251027083745.168468637@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <176218129319.2601451.17735585075234538848.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the core/rseq branch of tip: Commit-ID: 44c5b6768e3a1385fdf3b10893404bc5a2c1248a Gitweb: https://git.kernel.org/tip/44c5b6768e3a1385fdf3b10893404bc5a= 2c1248a Author: Thomas Gleixner AuthorDate: Mon, 27 Oct 2025 09:43:42 +01:00 Committer: Peter Zijlstra CommitterDate: Mon, 03 Nov 2025 15:26:09 +01:00 ARM: uaccess: Implement missing __get_user_asm_dword() When CONFIG_CPU_SPECTRE=3Dn then get_user() is missing the 8 byte ASM varia= nt for no real good reason. This prevents using get_user(u64) in generic code. Implement it as a sequence of two 4-byte reads with LE/BE awareness and make the unsigned long (or long long) type for the intermediate variable to read into dependend on the the target type. The __long_type() macro and idea was lifted from PowerPC. Thanks to Christophe for pointing it out. Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mathieu Desnoyers Closes: https://lore.kernel.org/oe-kbuild-all/202509120155.pFgwfeUD-lkp@int= el.com/ Link: https://patch.msgid.link/20251027083745.168468637@linutronix.de --- arch/arm/include/asm/uaccess.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index f90be31..d6ae80b 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -283,10 +283,17 @@ extern int __put_user_8(void *, unsigned long long); __gu_err; \ }) =20 +/* + * This is a type: either unsigned long, if the argument fits into + * that type, or otherwise unsigned long long. + */ +#define __long_type(x) \ + __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) + #define __get_user_err(x, ptr, err, __t) \ do { \ unsigned long __gu_addr =3D (unsigned long)(ptr); \ - unsigned long __gu_val; \ + __long_type(x) __gu_val; \ unsigned int __ua_flags; \ __chk_user_ptr(ptr); \ might_fault(); \ @@ -295,6 +302,7 @@ do { \ case 1: __get_user_asm_byte(__gu_val, __gu_addr, err, __t); break; \ case 2: __get_user_asm_half(__gu_val, __gu_addr, err, __t); break; \ case 4: __get_user_asm_word(__gu_val, __gu_addr, err, __t); break; \ + case 8: __get_user_asm_dword(__gu_val, __gu_addr, err, __t); break; \ default: (__gu_val) =3D __get_user_bad(); \ } \ uaccess_restore(__ua_flags); \ @@ -353,6 +361,22 @@ do { \ #define __get_user_asm_word(x, addr, err, __t) \ __get_user_asm(x, addr, err, "ldr" __t) =20 +#ifdef __ARMEB__ +#define __WORD0_OFFS 4 +#define __WORD1_OFFS 0 +#else +#define __WORD0_OFFS 0 +#define __WORD1_OFFS 4 +#endif + +#define __get_user_asm_dword(x, addr, err, __t) \ + ({ \ + unsigned long __w0, __w1; \ + __get_user_asm(__w0, addr + __WORD0_OFFS, err, "ldr" __t); \ + __get_user_asm(__w1, addr + __WORD1_OFFS, err, "ldr" __t); \ + (x) =3D ((u64)__w1 << 32) | (u64) __w0; \ +}) + #define __put_user_switch(x, ptr, __err, __fn) \ do { \ const __typeof__(*(ptr)) __user *__pu_ptr =3D (ptr); \