x86/boot: Comment what finalize_identity_maps() does
authorBorislav Petkov <bp@suse.de>
Sat, 7 May 2016 09:59:40 +0000 (11:59 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 10 May 2016 08:12:02 +0000 (10:12 +0200)
So it is not really obvious that finalize_identity_maps() doesn't do any
finalization but it *actually* writes CR3 with the ident PGD. Comment
that at the call site.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
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: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: akpm@linux-foundation.org
Cc: bhe@redhat.com
Cc: dyoung@redhat.com
Cc: jkosina@suse.cz
Cc: linux-tip-commits@vger.kernel.org
Cc: luto@kernel.org
Cc: vgoyal@redhat.com
Cc: yinghai@kernel.org
Link: http://lkml.kernel.org/r/20160507100541.GA24613@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/boot/compressed/kaslr.c

index f82975b..f5a138c 100644 (file)
@@ -437,6 +437,8 @@ unsigned char *choose_random_location(unsigned long input,
        choice = random_addr;
 
        add_identity_map(choice, output_size);
+
+       /* This actually loads the identity pagetable on x86_64. */
        finalize_identity_maps();
 out:
        return (unsigned char *)choice;