[RFC 10/10] kvm, x86: move guest FPU state into process local memory

2019-06-12 Thread Marius Hillenbrand
context in the kernel. Signed-off-by: Marius Hillenbrand Inspired-by: Julian Stecklina (while jstec...@amazon.de) Cc: Alexander Graf Cc: David Woodhouse --- arch/x86/include/asm/kvm_host.h | 8 arch/x86/kvm/x86.c | 24 2 files changed, 20 insertions

[RFC 09/10] kvm, vmx: move gprs to process local memory

2019-06-12 Thread Marius Hillenbrand
blocks. To keep the changes minimal, we pass all required state as a pointer to a single struct in process-local memory, which is hidden from other processes. Note that this feature is strictly opt-in. When disabled, the world switch code remains unchanged. Signed-off-by: Marius Hillenbrand Inspired

[RFC 08/10] kvm, vmx: move register clearing out of assembly path

2019-06-12 Thread Marius Hillenbrand
that the purpose of this patch is to make the changes in the next commit more readable. we will drop this patch when rebasing to 5.x, since major refactoring of KVM makes it redundant.] Signed-off-by: Marius Hillenbrand Cc: Alexander Graf Cc: David Woodhouse --- arch/x86/kvm/vmx.c | 46

[RFC 07/10] kvm, vmx: move CR2 context switch out of assembly path

2019-06-12 Thread Marius Hillenbrand
dundant.] Signed-off-by: Marius Hillenbrand Cc: Alexander Graf Cc: David Woodhouse --- arch/x86/kvm/vmx.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6f59a6ad7835..16a383635b59 100644 --- a/arch/x86/kvm/vmx.c +++

[RFC 06/10] kvm/x86: add support for storing vCPU state in process-local memory

2019-06-12 Thread Marius Hillenbrand
guest state. Signed-off-by: Marius Hillenbrand Cc: Alexander Graf Cc: David Woodhouse --- arch/x86/include/asm/kvm_host.h | 9 arch/x86/kvm/Kconfig| 10 + arch/x86/kvm/svm.c | 37 +++- arch/x86/kvm/vmx.c | 38

[RFC 05/10] mm: allocate/release physical pages for process-local memory

2019-06-12 Thread Marius Hillenbrand
address ranges. The allocation only handles the smallest page size (i.e., 4 KiB), no huge pages, because in our use case, the size of individual allocations is in the order of 4 KiB. Signed-off-by: Marius Hillenbrand Cc: Alexander Graf Cc: David Woodhouse --- mm/proclocal.c | 167

[RFC 02/10] x86/speculation, mm: add process local virtual memory region

2019-06-12 Thread Marius Hillenbrand
may point to shared page tables for the kernel space). Signed-off-by: Marius Hillenbrand Inspired-by: Julian Stecklina (while jstec...@amazon.de) Cc: Alexander Graf Cc: David Woodhouse --- Documentation/x86/x86_64/mm.txt | 11 +-- arch/x86/Kconfig| 1 + arch

[RFC 04/10] mm: allocate virtual space for process-local memory

2019-06-12 Thread Marius Hillenbrand
in debugging (e.g., to see page faults instead of silent invalid accesses). For that purpose, use a global allocator for virtual address ranges of process-local mappings. Note that the single centralized lock is good enough for our use case. Signed-off-by: Marius Hillenbrand Cc: Alexander Graf Cc: David

[RFC 03/10] x86/mm, mm,kernel: add teardown for process-local memory to mm cleanup

2019-06-12 Thread Marius Hillenbrand
Process-local memory uses a dedicated pgd entry in kernel space and its own page table structure. Hook mm exit functions to cleanup those dedicated page tables. As a preparation, release any left-over process-local allocations in the address space. Signed-off-by: Marius Hillenbrand Cc: Alexander

[RFC 01/10] x86/mm/kaslr: refactor to use enum indices for regions

2019-06-12 Thread Marius Hillenbrand
-by: Marius Hillenbrand Cc: Alexander Graf Cc: David Woodhouse --- arch/x86/mm/kaslr.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c index 3f452ffed7e9..c455f1ffba29 100644 --- a/arch/x86/mm/kaslr.c +++ b/arch

[RFC 00/10] Process-local memory allocations for hiding KVM secrets

2019-06-12 Thread Marius Hillenbrand
evaluation. Impact on starting VMs was within measurement noise. --- Julian Stecklina (2): kvm, vmx: move CR2 context switch out of assembly path kvm, vmx: move register clearing out of assembly path Marius Hillenbrand (8): x86/mm/kaslr: refactor to use enum indices for regions x86/speculatio