mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
clear_page_rep() and clear_page_erms() are wrappers around "REP; STOS" variations. Inlining gets rid of an unnecessary CALL/RET (which isn't free when using RETHUNK speculative execution mitigations.) Fixup and rename clear_page_orig() to adapt to the changed calling convention. Also add a comment from Dave Hansen detailing various clearing mechanisms used in clear_page(). Link: https://lkml.kernel.org/r/20260107072009.1615991-5-ankur.a.arora@oracle.com Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com> Tested-by: Raghavendra K T <raghavendra.kt@amd.com> Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: David Hildenbrand <david@kernel.org> Cc: David Hildenbrand <david@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Konrad Rzessutek Wilk <konrad.wilk@oracle.com> Cc: Lance Yang <ioworker0@gmail.com> Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com> Cc: Li Zhe <lizhe.67@bytedance.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Mateusz Guzik <mjguzik@gmail.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
38 lines
829 B
C
38 lines
829 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_PAGE_32_H
|
|
#define _ASM_X86_PAGE_32_H
|
|
|
|
#include <asm/page_32_types.h>
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
|
|
#ifdef CONFIG_DEBUG_VIRTUAL
|
|
extern unsigned long __phys_addr(unsigned long);
|
|
#else
|
|
#define __phys_addr(x) __phys_addr_nodebug(x)
|
|
#endif
|
|
#define __phys_addr_symbol(x) __phys_addr(x)
|
|
#define __phys_reloc_hide(x) RELOC_HIDE((x), 0)
|
|
|
|
#include <linux/string.h>
|
|
|
|
/**
|
|
* clear_page() - clear a page using a kernel virtual address.
|
|
* @page: address of kernel page
|
|
*
|
|
* Does absolutely no exception handling.
|
|
*/
|
|
static inline void clear_page(void *page)
|
|
{
|
|
memset(page, 0, PAGE_SIZE);
|
|
}
|
|
|
|
static inline void copy_page(void *to, void *from)
|
|
{
|
|
memcpy(to, from, PAGE_SIZE);
|
|
}
|
|
#endif /* !__ASSEMBLER__ */
|
|
|
|
#endif /* _ASM_X86_PAGE_32_H */
|