KVM Book3E support for Hardware Page Tablewalk enabled guests
cover KVM Book3E support for Hardware Page Tablewalk enabled guests
This is a revival of LRAT & HWPTW support that Mike submitted some time ago [1].
Patches are rebased and (most [2]) feedback addressed. Also, fixed some issues i noticed plus some cleanup.
[1] https://patchwork.ozlabs.org/patch/366892/
https://patchwork.ozlabs.org/patch/366895/ https://patchwork.ozlabs.org/patch/366893/ https://patchwork.ozlabs.org/patch/366894/
[2] Comments not addressed
[Alex] "Don't we have to keep the page locked so it doesn't get swapped away?"
* when will the page be unlocked?
* Alex, can you please elaborate more on this? Where would the unlock happen if we keep it locked here?
[Scott] "use local_paca->tcd for tlb1 as well (except on 32-bit)"
* i guess this needs a distinct patch, no?
[Scott] "A-008139"
* distinct patch adding the erratum workaround
in __write_host_tlbe(), e500_mmu_host.c
Detailed changes per patch from RFC:
[1/4] powerpc/booke64: Add LRAT next and max entries to tlb_core_data structure [2/4] KVM: PPC: Book3E: Handle LRAT error exception
- use tcd_ptr pointing to common tcd instead of local paca tcd
- drop lrat_size() as it only had 2 uses
- squashed these 2 patches as they address the same topic (lrat support):
- mmap_sem was left locked on an exit path
- wrapped new tcd struct members with #ifdef CONFIG_KVM_BOOKE_HV
- dropped inline in c files (Alex)
- changed lrat_next() implementation (Alex, Scott)
- s/WARN/WARN_ONCE (Alex, Scott)
- dropped write_host_lrate() unused lrat_entry param (Scott)
- use get_paca() instead of local_paca (Scott)
[3/4] KVM: PPC: e500: TLB emulation for IND entries
[4/4] KVM: PPC: e500mc: Advertise E.PT to support HTW guests
- squashed these too as they address the same topic (add HPTW support)
- rebased & merged with e6500 single threaded vcpu support
- commented inval_*_on_host() (Scott)
- split generic MMUv2 support in a distinct patch (Scott)
- s/tlbilx 3/tlbilxva/ (Scott)
- code style (Scott)
- dropped inval_tlb_on_host() and called kvmppc_e500_tlbil_lpid() or kvmppc_e500_tlbil_pid() directly (Scott)
- for better naming and consistency:
s/kvmppc_e500_tlbil_lpid/kvmppc_e500_tlbil_lpid_on_host
s/kvmppc_e500_tlbil_pid/kvmppc_e500_tlbil_pid_on_host
s/inval_ea_on_host/kvmppc_e500_tlbil_ea_on_host - use MAS4_TLBSELD instead of open-coding
- reworded some comments
- TSIZE of a page table of an IND entry may be <4K so don't limit it
Mihai Caraman (2):
KVM: PPC: e6500: Handle LRAT error exception
KVM: PPC: e6500: TLB emulation for IND entries
arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/asm/kvm_ppc.h | 2 + arch/powerpc/include/asm/mmu-book3e.h | 14 ++++ arch/powerpc/include/asm/reg_booke.h | 14 ++++ arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kvm/booke.c | 41 ++++++++++ arch/powerpc/kvm/bookehv_interrupts.S | 9 ++- arch/powerpc/kvm/e500.h | 93 +++++++++++++++++++---- arch/powerpc/kvm/e500_mmu.c | 92 ++++++++++++++++++----- arch/powerpc/kvm/e500_mmu_host.c | 136 +++++++++++++++++++++++++++++++++- arch/powerpc/kvm/e500mc.c | 49 +++++++++++- arch/powerpc/mm/fsl_booke_mmu.c | 10 +++ 12 files changed, 421 insertions(+), 41 deletions(-)
Signature · 2 lines
1.8.3.1 ---