From: Thomas Huth Date: Tue, 04 Apr 2017 08:00:32 +0000 Subject: Re: [PATCH] KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs Message-Id: <1267dbd0-0507-dc01-0b1c-96c1b2e80429@redhat.com> List-Id: References: <1491218595-10943-1-git-send-email-thuth@redhat.com> <20170404062545.2ajhqhhyeiime5mp@oak.ozlabs.ibm.com> In-Reply-To: <20170404062545.2ajhqhhyeiime5mp@oak.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Laurent Vivier On 04.04.2017 08:25, Paul Mackerras wrote: > On Mon, Apr 03, 2017 at 01:23:15PM +0200, Thomas Huth wrote: >> According to the PowerISA 2.07, mtspr and mfspr should not generate >> an illegal instruction exception when being used with an undefined SPR, >> but rather treat the instruction as a NOP, inject a privilege exception >> or an emulation assistance exception - depending on the SPR number. > > The emulation assist interrupt is a hypervisor interrupt, so the guest > would not be expecting to receive it. On a real machine, the > hypervisor would synthesize an illegal instruction type program > interrupt as described in the last programming note in section 6.5.9 > of Book III of Power ISA v2.07B. Since we are the hypervisor here, we > should synthesize a program interrupt rather than an emulation assist > interrupt. Ah, right, we're doing this in other spots, too, so a PROGILL is indeed more consistent here. I'll send a v2 ... Thomas