This is a note to let you know that I've just added the patch titled mm: Add PAGE_ALIGN_DOWN macro to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mm-add-page_align_down-macro.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 1010ea86092ac587fbb3c0526eb6844f51365440 Author: David Gow <davidgow@xxxxxxxxxx> Date: Fri Jul 1 17:16:19 2022 +0800 mm: Add PAGE_ALIGN_DOWN macro [ Upstream commit 335e52c28cf9954d65b819cb68912fd32de3c844 ] This is just the same as PAGE_ALIGN(), but rounds the address down, not up. Suggested-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Signed-off-by: David Gow <davidgow@xxxxxxxxxx> Acked-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Richard Weinberger <richard@xxxxxx> Stable-dep-of: be35d91c8880 ("xen: tolerate ACPI NVS memory overlapping with Xen allocated memory") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/include/linux/mm.h b/include/linux/mm.h index 26a5fba226644..e76bbe77e0f7d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -143,6 +143,9 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) +/* to align the pointer to the (prev) page boundary */ +#define PAGE_ALIGN_DOWN(addr) ALIGN_DOWN(addr, PAGE_SIZE) + /* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */ #define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)(addr), PAGE_SIZE)