From nobody Sun Feb 8 19:20:52 2026 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 6FDBE22E412; Fri, 2 May 2025 09:04:31 +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=1746176673; cv=none; b=jsVTD48KA88vtglHGbL0mIgpCIp4dDjagZbcUyTMJ5tU9bWyB5mVU87aHI/2fadY5W7DZOCo/aads0fn+wD1jyAGkQkvK/xxyDh1FICc5RWvo92HscRk1u3hMwFfd3sCNZzM4ywbFbt3KrqyiUoy4a1n4QcPBtqRJ6BjZyuaQ/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746176673; c=relaxed/simple; bh=gAfpwhRy0PausGyXExpuYTcFnsAqoO/Rg6ex+WXRp18=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=f7gt926PXk2jNPooCu/IqnXPqtcAnKUZJsSQ1HXe3ADzPZffyILWh8h1h1X8/oCm914Az45LaNJ14cDabs6pO+x8enEPJ1G+IpNs9bBz5nSJAL03M28EkDuctR/VGez7imiWeygc6pUQdpVV39w33/Iy/a/02SR/w4tpmxO/gII= 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=codDo3iP; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nQA89Cr/; 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="codDo3iP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nQA89Cr/" Date: Fri, 02 May 2025 09:04:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746176670; 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; bh=vCCx+cl/KgyFWO+2MpwB6p8/gEIAgSU6eo2RisRWUJo=; b=codDo3iP+5ycBk2tqhh4wafziqwyBEXzheUzrgDAmx98Tp2uWqSjWXa7nHDooo0k6ND9GU baijUL0Nbv9lIakQvf6WBKBVVFORO+3zPnwoDy+Itw1ydBQoK2LEe5YcxqZgwqQ0nWc0kh s+tWEWmNv8hgmokgHjmsMl/CGGEvO65JN16MAPAP1rfCfBzDSA7dlCM4faY+kTauVMeRv6 gM9gVLSqLhcZroW1/cbc/2FF+FsdEcvAH2pBVNkfW3P8IBRGtbHcvP7DA9K+RDovzwes3f EK57SvZXyN4b50usDzcdhfgaI5PMsSotQSD0+l4Ra0b7my2xuNn+jYNNc24ZRw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746176670; 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; bh=vCCx+cl/KgyFWO+2MpwB6p8/gEIAgSU6eo2RisRWUJo=; b=nQA89Cr/p/bx0LodT0HbecpaRJR3QWO1UzXMycomWz/zAMXSodTi4DcbzAw9asQ+3xQ1rY c00/YFfhzqsB9QAA== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/merge] x86/msr: Move the EAX_EDX_*() methods from to Cc: Ingo Molnar , Andy Lutomirski , Brian Gerst , Juergen Gross , "H. Peter Anvin" , Linus Torvalds , Kees Cook , Peter Zijlstra , Borislav Petkov , Thomas Gleixner , Josh Poimboeuf , Uros Bizjak , linux-kernel@vger.kernel.org, x86@kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174617666933.22196.17231571188397764274.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 x86/merge branch of tip: Commit-ID: bdfda83a6b5988f1ac62cd0eaceb6c3b44dc2a31 Gitweb: https://git.kernel.org/tip/bdfda83a6b5988f1ac62cd0eaceb6c3b4= 4dc2a31 Author: Ingo Molnar AuthorDate: Fri, 02 May 2025 10:13:53 +02:00 Committer: Ingo Molnar CommitterDate: Fri, 02 May 2025 10:18:19 +02:00 x86/msr: Move the EAX_EDX_*() methods from to We are going to use them from multiple headers, and in any case, such register access wrapper macros are better in anyway. Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Brian Gerst Cc: Juergen Gross Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Kees Cook Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Thomas Gleixner Cc: Josh Poimboeuf Cc: Uros Bizjak Cc: linux-kernel@vger.kernel.org --- arch/x86/include/asm/asm.h | 19 +++++++++++++++++++ arch/x86/include/asm/msr.h | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index cc28815..206e134 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -243,5 +243,24 @@ register unsigned long current_stack_pointer asm(_ASM_= SP); #define _ASM_EXTABLE_FAULT(from, to) \ _ASM_EXTABLE_TYPE(from, to, EX_TYPE_FAULT) =20 +/* + * Both i386 and x86_64 returns 64-bit values in edx:eax for certain + * instructions, but GCC's "A" constraint has different meanings. + * For i386, "A" means exactly edx:eax, while for x86_64 it + * means rax *or* rdx. + * + * These helpers wrapping these semantic differences save one instruction + * clearing the high half of 'low': + */ +#ifdef CONFIG_X86_64 +# define EAX_EDX_DECLARE_ARGS(val, low, high) unsigned long low, high +# define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32) +# define EAX_EDX_RET(val, low, high) "=3Da" (low), "=3Dd" (high) +#else +# define EAX_EDX_DECLARE_ARGS(val, low, high) u64 val +# define EAX_EDX_VAL(val, low, high) (val) +# define EAX_EDX_RET(val, low, high) "=3DA" (val) +#endif + #endif /* __KERNEL__ */ #endif /* _ASM_X86_ASM_H */ diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index d57a94c..856d660 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -37,25 +37,6 @@ struct saved_msrs { }; =20 /* - * Both i386 and x86_64 returns 64-bit values in edx:eax for certain - * instructions, but GCC's "A" constraint has different meanings. - * For i386, "A" means exactly edx:eax, while for x86_64 it - * means rax *or* rdx. - * - * These helpers wrapping these semantic differences save one instruction - * clearing the high half of 'low': - */ -#ifdef CONFIG_X86_64 -# define EAX_EDX_DECLARE_ARGS(val, low, high) unsigned long low, high -# define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32) -# define EAX_EDX_RET(val, low, high) "=3Da" (low), "=3Dd" (high) -#else -# define EAX_EDX_DECLARE_ARGS(val, low, high) u64 val -# define EAX_EDX_VAL(val, low, high) (val) -# define EAX_EDX_RET(val, low, high) "=3DA" (val) -#endif - -/* * Be very careful with includes. This header is prone to include loops. */ #include