Commit-ID:  db516997a985b461f021d594e78155bbc7fc3e7e
Gitweb:     http://git.kernel.org/tip/db516997a985b461f021d594e78155bbc7fc3e7e
Author:     Tom Lendacky <thomas.lenda...@amd.com>
AuthorDate: Mon, 17 Jul 2017 16:10:31 -0500
Committer:  Ingo Molnar <mi...@kernel.org>
CommitDate: Tue, 18 Jul 2017 11:38:05 +0200

x86/mm: Create native_make_p4d() for PGTABLE_LEVELS <= 4

Currently, native_make_p4d() is only defined when CONFIG_PGTABLE_LEVELS
is greater than 4. Create a macro that will allow for defining and using
native_make_p4d() when CONFIG_PGTABLES_LEVELS is not greater than 4.

Signed-off-by: Tom Lendacky <thomas.lenda...@amd.com>
Reviewed-by: Thomas Gleixner <t...@linutronix.de>
Cc: Alexander Potapenko <gli...@google.com>
Cc: Andrey Ryabinin <aryabi...@virtuozzo.com>
Cc: Andy Lutomirski <l...@kernel.org>
Cc: Arnd Bergmann <a...@arndb.de>
Cc: Borislav Petkov <b...@alien8.de>
Cc: Brijesh Singh <brijesh.si...@amd.com>
Cc: Dave Young <dyo...@redhat.com>
Cc: Dmitry Vyukov <dvyu...@google.com>
Cc: Jonathan Corbet <cor...@lwn.net>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: Larry Woodman <lwood...@redhat.com>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Matt Fleming <m...@codeblueprint.co.uk>
Cc: Michael S. Tsirkin <m...@redhat.com>
Cc: Paolo Bonzini <pbonz...@redhat.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Radim Krčmář <rkrc...@redhat.com>
Cc: Rik van Riel <r...@redhat.com>
Cc: Toshimitsu Kani <toshi.k...@hpe.com>
Cc: kasan-...@googlegroups.com
Cc: k...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux...@kvack.org
Link: 
http://lkml.kernel.org/r/b645e14f9e73731023694494860ceab73feff777.1500319216.git.thomas.lenda...@amd.com
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 arch/x86/include/asm/pgtable_types.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/include/asm/pgtable_types.h 
b/arch/x86/include/asm/pgtable_types.h
index 830992f..6c55973 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -309,6 +309,11 @@ static inline p4dval_t native_p4d_val(p4d_t p4d)
 #else
 #include <asm-generic/pgtable-nop4d.h>
 
+static inline p4d_t native_make_p4d(pudval_t val)
+{
+       return (p4d_t) { .pgd = native_make_pgd((pgdval_t)val) };
+}
+
 static inline p4dval_t native_p4d_val(p4d_t p4d)
 {
        return native_pgd_val(p4d.pgd);

Reply via email to