Re: [PATCH RFC v4 01/12] x86/mm: add untagged_addr_remote_unlocked()
From: John Hubbard
Date: Mon Jul 27 2026 - 21:45:12 EST
On 7/24/26 3:29 PM, Rik van Riel wrote:
...
> -#define untagged_addr_remote(mm, addr) ({ \
> +#define untagged_addr_remote_unlocked(mm, addr) ({ \
> unsigned long __addr = (__force unsigned long)(addr); \
> (__force __typeof__(addr))__untagged_addr_remote(mm, __addr); \
> })
>
> +#define untagged_addr_remote(mm, addr) ({ \
> + mmap_assert_locked(mm); \
> + untagged_addr_remote_unlocked(mm, addr); \
> +})
> +
With this diff, mm is now getting evaluated twice.
You could instead do this:
#define untagged_addr_remote(mm, addr) ({ \
struct mm_struct *__mm = (mm); \
mmap_assert_locked(__mm); \
untagged_addr_remote_unlocked(__mm, addr); \
})
thanks,
--
John Hubbard