]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: H_ENTER filter out reserved HPTE[B] value
authorNicholas Piggin <npiggin@gmail.com>
Mon, 4 Oct 2021 14:57:49 +0000 (00:57 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 13 Oct 2021 02:08:16 +0000 (13:08 +1100)
commit4dfe26e2a84d940898f89f9b1cb2d11021f69968
treee72163580c2e4b476e8852ce3d8bbfa492cd122f
parentfa5d4460cfe6a4ab811a36d49fe44ccb61944b70
KVM: PPC: Book3S HV: H_ENTER filter out reserved HPTE[B] value

The HPTE B field is a 2-bit field with values 0b10 and 0b11 reserved.
This field is also taken from the HPTE and used when KVM executes
TLBIEs to set the B field of those instructions.

Disallow the guest setting B to a reserved value with H_ENTER by
rejecting it. This is the same approach already taken for rejecting
reserved (unsupported) LLP values. This prevents the guest from being
able to induce the host to execute TLBIE with reserved values, which
is not known to be a problem with current processors but in theory it
could prevent the TLBIE from working correctly in a future processor.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211004145749.1331331-1-npiggin@gmail.com
arch/powerpc/include/asm/kvm_book3s_64.h
arch/powerpc/kvm/book3s_hv_rm_mmu.c