Re: [tip: x86/mm] x86/idle: Standardize argument types for MONITOR{,X} and MWAIT{,X} instruction wrappers on 'u32'
From: Andrew Cooper
Date: Wed Apr 02 2025 - 19:27:18 EST
On 02/04/2025 9:43 pm, tip-bot2 for Uros Bizjak wrote:
> The following commit has been merged into the x86/mm branch of tip:
>
> Commit-ID: 1ae899e413105aa81068d0282ab6e22974891d74
> Gitweb: https://git.kernel.org/tip/1ae899e413105aa81068d0282ab6e22974891d74
> Author: Uros Bizjak <ubizjak@xxxxxxxxx>
> AuthorDate: Wed, 02 Apr 2025 20:08:05 +02:00
> Committer: Ingo Molnar <mingo@xxxxxxxxxx>
> CommitterDate: Wed, 02 Apr 2025 22:26:17 +02:00
>
> x86/idle: Standardize argument types for MONITOR{,X} and MWAIT{,X} instruction wrappers on 'u32'
>
> MONITOR and MONITORX expect 32-bit unsigned integer arguments in the %ecx
> and %edx registers. MWAIT and MWAITX expect 32-bit usigned int
> argument in %eax and %ecx registers.
>
> Some of the helpers around these instructions in <asm/mwait.h> are using
> too wide types (long), standardize on u32 instead that makes it clear that
> this is a hardware ABI.
>
> [ mingo: Cleaned up the changelog. ]
>
> Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
Something I noticed while looking over this is that you want to push the
u32's up into the callers too.
mwait_idle_with_hints() with have (marginally) better code gen by
swapping it's unsigned longs for u32's.
~Andrew