From: Gustavo Romero Date: Tue, 18 Feb 2020 21:23:41 +0000 Subject: Re: [PATCH] KVM: PPC: Book3S HV: Treat unrecognized TM instructions as illegal Message-Id: <30664862-ede5-16c3-6215-ade0b660bb58@linux.vnet.ibm.com> List-Id: References: <20200213151532.12559-1-gromero@linux.ibm.com> <29b136e15c2f04f783b54ec98552d1a6009234db.camel@neuling.org> <20200217055712.GS22482@gate.crashing.org> <1752a0c735a455c5d3ca09209f5a52748c8f7116.camel@neuling.org> <20200217073743.GT22482@gate.crashing.org> In-Reply-To: <20200217073743.GT22482@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Segher Boessenkool , Michael Neuling Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, Gustavo Romero Hi, On 02/17/2020 04:37 AM, Segher Boessenkool wrote: > On Mon, Feb 17, 2020 at 05:23:07PM +1100, Michael Neuling wrote: >>>> Hence, we should NOP this, not generate an illegal. >>> >>> It is not a reserved bit. >>> >>> The IMC entry for it matches op11111 op2=1////01110 presumably, which >>> catches all TM instructions and nothing else (bits 0..5 and bits 21..30). >>> That does not look at bit 31, the softpatch handler has to deal with this. >>> >>> Some TM insns have bit 31 as 1 and some have it as /. All instructions >>> with a "." in the mnemonic have bit 31 is 1, all other have it reserved. >>> The tables in appendices D, E, F show tend. and tsr. as having it >>> reserved, which contradicts the individual instruction description (and >>> does not make much sense). (Only tcheck has /, everything else has 1; >>> everything else has a mnemonic with a dot, and does write CR0 always). >> >> Wow, interesting. >> >> P8 seems to be treating 31 as a reserved bit (with the table definition rather >> than the individual instruction description). I'm inclined to match P8 even >> though it's inconsistent with the dot mnemonic as you say. > > "The POWER8 core ignores the state of reserved bits in the instructions > (denoted by “///” in the instruction definition) and executes the > instruction normally. Software should set these bits to ‘0’ per the > Power ISA." (p8 UM, 3.1.1.3; same in the p9 UM). For the records, I've sent a v2 addressing Mikey's comments: https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-February/204502.html or https://marc.info/?l=kvm-ppc&m8206045520038&w=2 Thanks for the review. Best regards, Gustavo