Re: [RFCv2 11/16] KVM: Protected memory extension

2020-10-20 Thread Kirill A. Shutemov
On Tue, Oct 20, 2020 at 09:17:01AM +0200, Peter Zijlstra wrote: > On Tue, Oct 20, 2020 at 09:18:54AM +0300, Kirill A. Shutemov wrote: > > +int __kvm_protect_memory(unsigned long start, unsigned long end, bool > > protect) > > +{ > > + struct mm_struct *mm = current->mm; > > + struct vm_area_st

Re: [RFCv2 11/16] KVM: Protected memory extension

2020-10-20 Thread Peter Zijlstra
On Tue, Oct 20, 2020 at 09:18:54AM +0300, Kirill A. Shutemov wrote: > +int __kvm_protect_memory(unsigned long start, unsigned long end, bool > protect) > +{ > + struct mm_struct *mm = current->mm; > + struct vm_area_struct *vma, *prev; > + int ret; > + > + if (mmap_write_lock_killa

[RFCv2 11/16] KVM: Protected memory extension

2020-10-19 Thread Kirill A. Shutemov
Add infrastructure that handles protected memory extension. Arch-specific code has to provide hypercalls and define non-zero VM_KVM_PROTECTED. Signed-off-by: Kirill A. Shutemov --- include/linux/kvm_host.h | 4 +++ virt/kvm/Kconfig | 3 ++ virt/kvm/kvm_main.c | 68 +++