Re: [RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-14 Thread Alexandre Chartre
On 5/13/19 6:47 PM, Alexandre Chartre wrote: On 5/13/19 5:50 PM, Dave Hansen wrote: +    /* + * Copy the mapping for all the kernel text. We copy at the PMD + * level since the PUD is shared with the module mapping space. + */ +    rv = kvm_copy_mapping((void *)__START_KERNEL_map

Re: [RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-13 Thread Alexandre Chartre
On 5/13/19 6:00 PM, Andy Lutomirski wrote: On Mon, May 13, 2019 at 8:50 AM Dave Hansen wrote: + /* + * Copy the mapping for all the kernel text. We copy at the PMD + * level since the PUD is shared with the module mapping space. + */ + rv = kvm_copy_mapping((void *)_

Re: [RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-13 Thread Alexandre Chartre
On 5/13/19 5:50 PM, Dave Hansen wrote: + /* +* Copy the mapping for all the kernel text. We copy at the PMD +* level since the PUD is shared with the module mapping space. +*/ + rv = kvm_copy_mapping((void *)__START_KERNEL_map, KERNEL_IMAGE_SIZE, +

Re: [RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-13 Thread Sean Christopherson
On Mon, May 13, 2019 at 08:50:19AM -0700, Dave Hansen wrote: > I seem to remember that the KVM VMENTRY/VMEXIT context is very special. > Interrupts (and even NMIs?) are disabled. Would it be feasible to do > the switching in there so that we never even *get* interrupts in the KVM > context? NMIs

Re: [RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-13 Thread Andy Lutomirski
On Mon, May 13, 2019 at 8:50 AM Dave Hansen wrote: > > > + /* > > + * Copy the mapping for all the kernel text. We copy at the PMD > > + * level since the PUD is shared with the module mapping space. > > + */ > > + rv = kvm_copy_mapping((void *)__START_KERNEL_map, KERNEL_IMA

Re: [RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-13 Thread Dave Hansen
> + /* > + * Copy the mapping for all the kernel text. We copy at the PMD > + * level since the PUD is shared with the module mapping space. > + */ > + rv = kvm_copy_mapping((void *)__START_KERNEL_map, KERNEL_IMAGE_SIZE, > + PGT_LEVEL_PMD); > + if (rv) > +

[RFC KVM 19/27] kvm/isolation: initialize the KVM page table with core mappings

2019-05-13 Thread Alexandre Chartre
The KVM page table is initialized with adding core memory mappings: the kernel text, the per-cpu memory, the kvm module, the cpu_entry_area, %esp fixup stacks, IRQ stacks. Signed-off-by: Alexandre Chartre --- arch/x86/kernel/cpu/common.c |2 + arch/x86/kvm/isolation.c | 131