提交 b176862f 编写于 作者: B Borislav Petkov 提交者: Ingo Molnar

x86/mm/ptdump: Remove paravirt_enabled()

is_hypervisor_range() can simply check if the PGD index is
within ffff800000000000 - ffff87ffffffffff which is the range
reserved for a hypervisor. That range is practically an ABI, see
Documentation/x86/x86_64/mm.txt.

Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> # Under Xen, as PV guest
Signed-off-by: NBorislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455825641-19585-1-git-send-email-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 e2c7698c
...@@ -358,20 +358,19 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, pgd_t addr, ...@@ -358,20 +358,19 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, pgd_t addr,
#define pgd_none(a) pud_none(__pud(pgd_val(a))) #define pgd_none(a) pud_none(__pud(pgd_val(a)))
#endif #endif
#ifdef CONFIG_X86_64
static inline bool is_hypervisor_range(int idx) static inline bool is_hypervisor_range(int idx)
{ {
#ifdef CONFIG_X86_64
/* /*
* ffff800000000000 - ffff87ffffffffff is reserved for * ffff800000000000 - ffff87ffffffffff is reserved for
* the hypervisor. * the hypervisor.
*/ */
return paravirt_enabled() && return (idx >= pgd_index(__PAGE_OFFSET) - 16) &&
(idx >= pgd_index(__PAGE_OFFSET) - 16) && (idx < pgd_index(__PAGE_OFFSET));
(idx < pgd_index(__PAGE_OFFSET));
}
#else #else
static inline bool is_hypervisor_range(int idx) { return false; } return false;
#endif #endif
}
static void ptdump_walk_pgd_level_core(struct seq_file *m, pgd_t *pgd, static void ptdump_walk_pgd_level_core(struct seq_file *m, pgd_t *pgd,
bool checkwx) bool checkwx)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册