Lines Matching +full:boot +full:- +full:page +full:- +full:step

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/arch/x86/kernel/head_64.S -- start in 32bit and switch to 64bit
18 #include <asm/page.h>
21 #include <asm/processor-flags.h>
25 #include <asm/nospec-branch.h>
32 * We are not able to switch in one step to the final KERNEL ADDRESS SPACE
33 * because we need identity-mapped pages.
42 * and someone has loaded an identity mapped page table
43 * for us. These identity mapped page tables map all of the
51 * arch/x86/boot/compressed/head_64.S.
53 * We only come here initially at boot nothing else comes here.
56 * compiled to run at we first fixup the physical addresses in our page
85 * be done now, since this also includes setup of the SEV-SNP CPUID table,
114 * For SEV guests: Verify that the C-bit is correct. A malicious
115 * hypervisor could lie about the C-bit position to perform a ROP
142 * and someone has loaded a mapped page table.
148 * to have any identity mapped pages in the kernel page table
149 * after the boot processor executes this code.
157 * SEV-ES guests. In those guests the call to verify_cpu() would cause
161 * All non SEV-ES systems, especially Intel systems, need to execute
168 /* Clear %R15 which holds the boot_params pointer on the boot CPU */
173 addq $(init_top_pgt - __START_KERNEL_map), %rax
220 * Set CR4.PGE to re-enable global translations.
227 * For parallel boot, the APIC ID is read from the APIC, and then
232 * Bit 0-23 CPU# if STARTUP_xx flags are not set
239 * in bit 0-23. This is also the boot CPU case (CPU number 0).
267 /* Read the APIC ID from the fix-mapped MMIO space. */
306 xorl %edx, %edx /* zero-extended to clear all of RDX */
310 * Setup a boot time stack - Any secondary CPU will have lost its stack
311 * by now because the cr3-switch above unmaps the real-mode stack.
313 * RDX contains the per-cpu offset
320 * protection. For the boot CPU the pointer is NULL!
335 movw $(GDT_SIZE-1), (%rsp)
359 * Note that, on SMP, the boot cpu uses init data section until
423 * restarting the boot CPU or for restarting SEV guest CPUs after CPU hot
440 * VC Exception handler used during early boot when running on kernel
498 .fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc
513 /* The vector number is currently in the pt_regs->di slot. */
514 pushq %rsi /* pt_regs->si */
516 movq %rdi, 8(%rsp) /* pt_regs->di = RDI */
517 pushq %rdx /* pt_regs->dx */
518 pushq %rcx /* pt_regs->cx */
519 pushq %rax /* pt_regs->ax */
520 pushq %r8 /* pt_regs->r8 */
521 pushq %r9 /* pt_regs->r9 */
522 pushq %r10 /* pt_regs->r10 */
523 pushq %r11 /* pt_regs->r11 */
524 pushq %rbx /* pt_regs->bx */
525 pushq %rbp /* pt_regs->bp */
526 pushq %r12 /* pt_regs->r12 */
527 pushq %r13 /* pt_regs->r13 */
528 pushq %r14 /* pt_regs->r14 */
529 pushq %r15 /* pt_regs->r15 */
541 * VC Exception handler used during very early boot. The
543 * paravirtualized INTERRUPT_RETURN and pv-ops don't work that early.
548 * available to boot secondary CPUs.
568 /* Pure iret required here - don't use INTERRUPT_RETURN */
577 * strictly *need* the second page, but this allows us to
585 /* This ensures they are 8k-aligned: */
599 .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
613 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
615 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
617 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
618 .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
623 .quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
647 .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
653 /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */
654 .quad level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
655 .quad level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
676 .fill (512 - 4 - FIXMAP_PMD_NUM),8,0
679 .quad level1_fixmap_pgt + (pgtno << PAGE_SHIFT) - __START_KERNEL_map \
703 #include "../xen/xen-head.S"