linux/arch/arm/kvm/hyp
Christoffer Dall e329fb75d5 KVM: arm/arm64: Factor out VMID into struct kvm_vmid
In preparation for nested virtualization where we are going to have more
than a single VMID per VM, let's factor out the VMID data into a
separate VMID data structure and change the VMID allocator to operate on
this new structure instead of using a struct kvm.

This also means that udate_vttbr now becomes update_vmid, and that the
vttbr itself is generated on the fly based on the stage 2 page table
base address and the vmid.

We cache the physical address of the pgd when allocating the pgd to
avoid doing the calculation on every entry to the guest and to avoid
calling into potentially non-hyp-mapped code from hyp/EL2.

If we wanted to merge the VMID allocator with the arm64 ASID allocator
at some point in the future, it should actually become easier to do that
after this patch.

Note that to avoid mapping the kvm_vmid_bits variable into hyp, we
simply forego the masking of the vmid value in kvm_get_vttbr and rely on
update_vmid to always assign a valid vmid value (within the supported
range).

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
[maz: minor cleanups]
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2019-02-19 21:05:35 +00:00
..
Makefile arm: port KCOV to arm 2018-06-15 07:55:24 +09:00
banked-sr.c ARM: kvm: fix building with gcc-8 2018-02-15 20:58:36 +01:00
cp15-sr.c arm/arm64: KVM: Statically configure the host's view of MPIDR 2019-02-19 21:05:35 +00:00
entry.S arm: KVM: Handle async aborts delivered while at HYP 2016-09-08 12:53:00 +02:00
hyp-entry.S ARM: KVM: Teach some form of type-safety to kvm_call_hyp 2019-02-19 21:05:34 +00:00
s2-setup.c ARM: KVM: Move kvm/hyp/hyp.h to include/asm/kvm_hyp.h 2016-02-29 18:34:18 +00:00
switch.c KVM: arm/arm64: Factor out VMID into struct kvm_vmid 2019-02-19 21:05:35 +00:00
tlb.c KVM: arm/arm64: Factor out VMID into struct kvm_vmid 2019-02-19 21:05:35 +00:00
vfp.S ARM: KVM: Add VFP save/restore 2016-02-29 18:34:13 +00:00