]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs
authorThomas Huth <thuth@redhat.com>
Wed, 5 Apr 2017 13:58:51 +0000 (15:58 +0200)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 20 Apr 2017 01:39:32 +0000 (11:39 +1000)
commit9a567c86b8eb0d8e181bc0fa82521c9ecbf9fb76
tree6049c97e88caf30912603728ca446d457bfd739f
parentbb47291480b1f6551fbb12e9150e30fec20afcc7
KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs

According to the PowerISA 2.07, mtspr and mfspr should not always
generate an illegal instruction exception when being used with an
undefined SPR, but rather treat the instruction as a NOP or inject a
privilege exception in some cases, too - depending on the SPR number.
Also turn the printk here into a ratelimited print statement, so that
the guest can not flood the dmesg log of the host by issueing lots of
illegal mtspr/mfspr instruction here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_emulate.c
arch/powerpc/kvm/emulate.c