• Nicholas Piggin's avatar
    KVM: PPC: Book3S PR: Disallow AIL != 0 · 839d893b
    Nicholas Piggin authored
    KVM PR does not implement address translation modes on interrupt, so it
    must not allow H_SET_MODE to succeed. The behaviour change caused by
    this mode is architected and not advisory (interrupts *must* behave
    differently).
    
    QEMU does not deal with differences in AIL support in the host. The
    solution to that is a spapr capability and corresponding KVM CAP, but
    this patch does not break things more than before (the host behaviour
    already differs, this change just disallows some modes that are not
    implemented properly).
    
    By happy coincidence, this allows PR Linux guests that are using the SCV
    facility to boot and run, because Linux disables the use of SCV if AIL
    can not be set to 3. This does not fix the underlying problem of missing
    SCV support (an OS could implement real-mode SCV vectors and try to
    enable the facility). The true fix for that is for KVM PR to emulate scv
    interrupts from the facility unavailable interrupt.
    Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Reviewed-by: default avatarFabiano Rosas <farosas@linux.ibm.com>
    Link: https://lore.kernel.org/r/20220222064727.2314380-3-npiggin@gmail.com
    839d893b
book3s_pr_papr.c 12.2 KB