From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753430AbdKXKi2 (ORCPT ); Fri, 24 Nov 2017 05:38:28 -0500 Received: from mail.skyhub.de ([5.9.137.197]:53978 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171AbdKXKi0 (ORCPT ); Fri, 24 Nov 2017 05:38:26 -0500 Date: Fri, 24 Nov 2017 11:38:17 +0100 From: Borislav Petkov To: Ingo Molnar , "H.J. Lu" Cc: linux-kernel@vger.kernel.org, Dave Hansen , Andy Lutomirski , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra , Linus Torvalds Subject: Re: [PATCH 01/43] x86/decoder: Add new TEST instruction pattern Message-ID: <20171124103817.vpn73yvs52gdhw3g@pd.tnic> References: <20171124091448.7649-1-mingo@kernel.org> <20171124091448.7649-2-mingo@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20171124091448.7649-2-mingo@kernel.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 24, 2017 at 10:14:06AM +0100, Ingo Molnar wrote: > From: Masami Hiramatsu > > The kbuild test robot reported this build warning: > > Warning: arch/x86/tools/test_get_len found difference at :ffffffff8103dd2c > > Warning: ffffffff8103dd82: f6 09 d8 testb $0xd8,(%rcx) > Warning: objdump says 3 bytes, but insn_get_length() says 2 > Warning: decoded and checked 1569014 instructions with 1 warnings > > This sequence seems to be a new instruction not in the opcode map in the Intel SDM. > > The instruction sequence is "F6 09 d8", means Group3(F6), MOD(00)REG(001)RM(001), and 0xd8. So that's TEST Eb,Ib with ModRM.reg == 1b which is documented in the AMD APM but not in the Intel SDM. Maybe H.J. has some insights on why. CCed and leaving in the rest for reference. > Intel SDM vol2 A.4 Table A-6 said the table index in the group is "Encoding of Bits 5,4,3 of > the ModR/M Byte (bits 2,1,0 in parenthesis)" > > In that table, opcodes listed by the index REG bits as: > > 000 001 010 011 100 101 110 111 > TEST Ib/Iz,(undefined),NOT,NEG,MUL AL/rAX,IMUL AL/rAX,DIV AL/rAX,IDIV AL/rAX > > So, it seems TEST Ib is assigned to 001. > > Add the new pattern. > > Greg Kroah-Hartman > Reported-by: kbuild test robot > Signed-off-by: Masami Hiramatsu > Cc: > Cc: H. Peter Anvin > Cc: Linus Torvalds > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Ingo Molnar > --- > arch/x86/lib/x86-opcode-map.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt > index 12e377184ee4..c4d55919fac1 100644 > --- a/arch/x86/lib/x86-opcode-map.txt > +++ b/arch/x86/lib/x86-opcode-map.txt > @@ -896,7 +896,7 @@ EndTable > > GrpTable: Grp3_1 > 0: TEST Eb,Ib > -1: > +1: TEST Eb,Ib > 2: NOT Eb > 3: NEG Eb > 4: MUL AL,Eb > -- > 2.14.1 > -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.