aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/head_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/head_64.S')
-rw-r--r--arch/x86/kernel/head_64.S30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index a468c0a65c42..6fd514d9f69a 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -514,8 +514,38 @@ ENTRY(phys_base)
514 /* This must match the first entry in level2_kernel_pgt */ 514 /* This must match the first entry in level2_kernel_pgt */
515 .quad 0x0000000000000000 515 .quad 0x0000000000000000
516 516
517#ifdef CONFIG_KASAN
518#define FILL(VAL, COUNT) \
519 .rept (COUNT) ; \
520 .quad (VAL) ; \
521 .endr
522
523NEXT_PAGE(kasan_zero_pte)
524 FILL(kasan_zero_page - __START_KERNEL_map + _KERNPG_TABLE, 512)
525NEXT_PAGE(kasan_zero_pmd)
526 FILL(kasan_zero_pte - __START_KERNEL_map + _KERNPG_TABLE, 512)
527NEXT_PAGE(kasan_zero_pud)
528 FILL(kasan_zero_pmd - __START_KERNEL_map + _KERNPG_TABLE, 512)
529
530#undef FILL
531#endif
532
533
517#include "../../x86/xen/xen-head.S" 534#include "../../x86/xen/xen-head.S"
518 535
519 __PAGE_ALIGNED_BSS 536 __PAGE_ALIGNED_BSS
520NEXT_PAGE(empty_zero_page) 537NEXT_PAGE(empty_zero_page)
521 .skip PAGE_SIZE 538 .skip PAGE_SIZE
539
540#ifdef CONFIG_KASAN
541/*
542 * This page used as early shadow. We don't use empty_zero_page
543 * at early stages, stack instrumentation could write some garbage
544 * to this page.
545 * Latter we reuse it as zero shadow for large ranges of memory
546 * that allowed to access, but not instrumented by kasan
547 * (vmalloc/vmemmap ...).
548 */
549NEXT_PAGE(kasan_zero_page)
550 .skip PAGE_SIZE
551#endif