KVM: PPC: Book3S PR: Rework SLB switching code
authorAlexander Graf <agraf@suse.de>
Thu, 15 May 2014 12:38:03 +0000 (14:38 +0200)
committerAlexander Graf <agraf@suse.de>
Fri, 30 May 2014 12:26:30 +0000 (14:26 +0200)
commitd8d164a9850d486cc48081c18831680254688d0f
tree6c8d77919d3f2c0ce26f448c148be55cbf2c0bfa
parent207438d4e21e05728a8a58b5e25b0f6553260068
KVM: PPC: Book3S PR: Rework SLB switching code

On LPAR guest systems Linux enables the shadow SLB to indicate to the
hypervisor a number of SLB entries that always have to be available.

Today we go through this shadow SLB and disable all ESID's valid bits.
However, pHyp doesn't like this approach very much and honors us with
fancy machine checks.

Fortunately the shadow SLB descriptor also has an entry that indicates
the number of valid entries following. During the lifetime of a guest
we can just swap that value to 0 and don't have to worry about the
SLB restoration magic.

While we're touching the code, let's also make it more readable (get
rid of rldicl), allow it to deal with a dynamic number of bolted
SLB entries and only do shadow SLB swizzling on LPAR systems.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kernel/paca.c
arch/powerpc/kvm/book3s_64_slb.S
arch/powerpc/mm/slb.c