Skip to content

x86/kaiser: Boot time disabling and debug support

Thomas Gleixner linux-mm lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 21 repliesIn review
  2. v14 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Prevent setting PAGE_GLOBAL/NX when not supported or disabled

- Restructured the debug stuff a bit

- Extended the boot time disable to debug stuff

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5x86/kaiser: Respect disabled CPU featuresarch/x86/include/asm/pgtable_64.h arch/x86/mm/kaiser.c+13 -26 replies
2/5x86/kaiser: Simplify disabling of global pagesarch/x86/include/asm/pgtable_types.h arch/x86/mm/init.c arch/x86/mm/pageattr.c+19 -263 replies
3/5x86/dump_pagetables: Check KAISER shadow page table for WX pagesarch/x86/include/asm/pgtable.h arch/x86/mm/debug_pagetables.c arch/x86/mm/dump_pagetables.c+24 -61 reply
4/5x86/mm/debug_pagetables: Allow dumping current pagetablesarch/x86/include/asm/pgtable.h arch/x86/mm/debug_pagetables.c arch/x86/mm/dump_pagetables.c+79 -87 replies
5/5x86/kaiser: Add boottime disable switcharch/x86/entry/calling.h arch/x86/include/asm/kaiser.h arch/x86/include/asm/pgtable_64.h +4 more+62 -59 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [patch V2 0/5] x86/kaiser: Boot time disabling and debug support

This patch series applies on top of

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/mm

It contains the following updates:

- Don't set NX/PAGE_GLOBAL unconditionally

- Get rid of the compile time PAGE_GLOBAL disabling

- Add debug support for WX mappings in the KAISER shadow table

- Provide debug files to dump the kernel and the user page table for the current task.

- Add a boot time switch to disable KAISER. This does not yet take care of the 8k PGD allocations, but that can be done on top.

Changes vs. V1:

- Prevent setting PAGE_GLOBAL/NX when not supported or disabled

- Restructured the debug stuff a bit

- Extended the boot time disable to debug stuff

I tried to reenable paravirt by disabling kaiser at boot time when XEN_PV is detected. XEN_PV is the only one having CR3 access paravirtualized, which will explode nicely in the enter/exit code.

But enabling KAISER has some weird not yet debugged side effects even on KVM guests. Will look at that tomorrow morning.

Thanks,

tglx

---
 arch/x86/entry/calling.h             |    7 +++
 arch/x86/include/asm/kaiser.h        |   10 ++++
 arch/x86/include/asm/pgtable.h       |    1 
 arch/x86/include/asm/pgtable_64.h    |    9 +++
 arch/x86/include/asm/pgtable_types.h |   16 ------
 arch/x86/mm/debug_pagetables.c       |   81 ++++++++++++++++++++++++++++++++---
 arch/x86/mm/dump_pagetables.c        |   32 +++++++++++--
 arch/x86/mm/init.c                   |   14 ++++--
 arch/x86/mm/kaiser.c                 |   42 +++++++++++++++++-
 arch/x86/mm/pageattr.c               |   16 +++---
 security/Kconfig                     |    2 
 11 files changed, 190 insertions(+), 40 deletions(-)