• Nicholas Piggin's avatar
    KVM: PPC: Book3S HV: Fix radix guest SLB side channel · 68ad28a4
    Nicholas Piggin authored
    The slbmte instruction is legal in radix mode, including radix guest
    mode. This means radix guests can load the SLB with arbitrary data.
    
    KVM host does not clear the SLB when exiting a guest if it was a
    radix guest, which would allow a rogue radix guest to use the SLB as
    a side channel to communicate with other guests.
    
    Fix this by ensuring the SLB is cleared when coming out of a radix
    guest. Only the first 4 entries are a concern, because radix guests
    always run with LPCR[UPRT]=1, which limits the reach of slbmte. slbia
    is not used (except in a non-performance-critical path) because it
    can clear cached translations.
    Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
    Reviewed-by: default avatarFabiano Rosas <farosas@linux.ibm.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    68ad28a4
book3s_hv_rmhandlers.S 88.3 KB