On 04/05/2018 11:30, Marc Zyngier wrote: >> you should also add the arm/mips/power maintainers so that they can review their >> struct kvm_arch if any of the content is passed directly to the hardware (e.g. with >> __pa). A quick looks seems to indicate that there is no issue. > Well, there is a small issue, at least on arm64. Only VAs that are part > of the linear mapping can easily be mapped at EL2 (so that we can play > our kern_to_hyp_va trick on ARMv8.0 cores), and the kvm structure is > assumed to be physically contiguous. > > Switch to a vmalloc'ed structure breaks these two requirements since, as > you noticed it, the kvm struct is more than a single page. > > I'd suggest you let each architecture buy into this, or provide a > kmalloc-based kvm_arch_{alloc,free}_vm for architectures that cannot use > the vmalloc area for this. On arm64, we could use vmalloc on VHE-capable > cores, and stick to kmalloc for the rest. > Alternatively you could have a #define __KVM_KMALLOC_STRUCT_KVM and define it in arch/arm*/include/asm/kvm_host.h. Paolo