x86/boot/64: Use defines for page size
authorBorislav Petkov <bp@suse.de>
Thu, 24 Nov 2016 21:05:50 +0000 (22:05 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 25 Nov 2016 06:11:29 +0000 (07:11 +0100)
... instead of naked numbers like the rest of the asm does in this file.

No code changed:

  # arch/x86/kernel/head_64.o:

   text    data     bss     dec     hex filename
   1124  290864    4096  296084   48494 head_64.o.before
   1124  290864    4096  296084   48494 head_64.o.after

md5:
   87086e202588939296f66e892414ffe2  head_64.o.before.asm
   87086e202588939296f66e892414ffe2  head_64.o.after.asm

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161124210550.15025-1-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/head_64.S

index b07cd27e33a544d5647503907c83f8d2038a84e7..a15d381e602030dd91be680699099912295475ba 100644 (file)
@@ -112,20 +112,20 @@ startup_64:
        movq    %rdi, %rax
        shrq    $PGDIR_SHIFT, %rax
 
-       leaq    (4096 + _KERNPG_TABLE)(%rbx), %rdx
+       leaq    (PAGE_SIZE + _KERNPG_TABLE)(%rbx), %rdx
        movq    %rdx, 0(%rbx,%rax,8)
        movq    %rdx, 8(%rbx,%rax,8)
 
-       addq    $4096, %rdx
+       addq    $PAGE_SIZE, %rdx
        movq    %rdi, %rax
        shrq    $PUD_SHIFT, %rax
        andl    $(PTRS_PER_PUD-1), %eax
-       movq    %rdx, 4096(%rbx,%rax,8)
+       movq    %rdx, PAGE_SIZE(%rbx,%rax,8)
        incl    %eax
        andl    $(PTRS_PER_PUD-1), %eax
-       movq    %rdx, 4096(%rbx,%rax,8)
+       movq    %rdx, PAGE_SIZE(%rbx,%rax,8)
 
-       addq    $8192, %rbx
+       addq    $PAGE_SIZE * 2, %rbx
        movq    %rdi, %rax
        shrq    $PMD_SHIFT, %rdi
        addq    $(__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL), %rax