From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 103B6C32771 for ; Wed, 22 Jan 2020 04:12:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4ACA2465A for ; Wed, 22 Jan 2020 04:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579666319; bh=v29QQvk5dO+gNH/UWuB5vLE2PNIwKeDSrqt3jQ8zSH4=; h=From:To:Cc:Subject:Date:List-ID:From; b=jWNRHi/lTD8TyCnfCMVIq+2GvujGkN3GyEEN1uk2bLLZw2NCvE8HvKmAiwL1drvkf w/O8Z4zXX1XKLh2fzC3LG8nmUGSNI/QWOuV9tEMjoSGhnxsaqUXPNeRRIcMctfEzVS TH2pO//gozZhHNu2Rr3YVixhWtpzYkp6iwyDGTOw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728609AbgAVEL7 (ORCPT ); Tue, 21 Jan 2020 23:11:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:57792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbgAVEL7 (ORCPT ); Tue, 21 Jan 2020 23:11:59 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C134F2070C; Wed, 22 Jan 2020 04:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579666318; bh=v29QQvk5dO+gNH/UWuB5vLE2PNIwKeDSrqt3jQ8zSH4=; h=From:To:Cc:Subject:Date:From; b=I0Mn4qCt9fghJspZGWTvyWcZ0hohhHl4QR7wkS6Q5qkxGTqI7NiES5StcLYpY8851 ncD+JLBJVjC0zhi+GK0n8LXlizKjoLuK38A/k2yr47p9cuBwmAWF7vOwYj9Ekk4x6m Q2a1fAxXMsRpDhFXniMMflyco4DjPhYuptn9HxSE= From: Masami Hiramatsu To: Ingo Molnar Cc: Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Josh Poimboeuf , Masami Hiramatsu , X86 ML , Ingo Molnar , Thomas Gleixner Subject: [PATCH -tip] [RESEND] x86/decoder: Add TEST opcode to Group3-2 Date: Wed, 22 Jan 2020 13:11:54 +0900 Message-Id: <157966631413.9580.10311036595431878351.stgit@devnote2> X-Mailer: git-send-email 2.20.1 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org Add TEST opcode to Group3-2 reg=001b as same as Group3-1 does. Commit 12a78d43de76 ("x86/decoder: Add new TEST instruction pattern") added a TEST opcode assignment to f6 XX/001/XXX (Group 3-1), but not added f7 XX/001/XXX (Group 3-2). Actually these TEST opcode is not described in Intel SDM Vol2, but described in AMD64 Architecture Programmer's Manual Vol.3, Appendix A.2 Table A-6. ModRM.reg Extensions for the Primary Opcode Map. Without this fix, Randy found a warning by insn_decoder_test related to this issue as below. HOSTCC arch/x86/tools/insn_decoder_test HOSTCC arch/x86/tools/insn_sanity TEST posttest arch/x86/tools/insn_decoder_test: warning: Found an x86 instruction decoder bug, please report this. arch/x86/tools/insn_decoder_test: warning: ffffffff81000bf1: f7 0b 00 01 08 00 testl $0x80100,(%rbx) arch/x86/tools/insn_decoder_test: warning: objdump says 6 bytes, but insn_get_length() says 2 arch/x86/tools/insn_decoder_test: warning: Decoded and checked 11913894 instructions with 1 failures TEST posttest arch/x86/tools/insn_sanity: Success: decoded and checked 1000000 random instructions with 0 errors (seed:0x871ce29c) To fix this error, add TEST opcode according to AMD64 APM Vol.3. Reported-by: Randy Dunlap Signed-off-by: Masami Hiramatsu Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- arch/x86/lib/x86-opcode-map.txt | 2 +- tools/arch/x86/lib/x86-opcode-map.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt index 8908c58bd6cd..53adc1762ec0 100644 --- a/arch/x86/lib/x86-opcode-map.txt +++ b/arch/x86/lib/x86-opcode-map.txt @@ -929,7 +929,7 @@ EndTable GrpTable: Grp3_2 0: TEST Ev,Iz -1: +1: TEST Ev,Iz 2: NOT Ev 3: NEG Ev 4: MUL rAX,Ev diff --git a/tools/arch/x86/lib/x86-opcode-map.txt b/tools/arch/x86/lib/x86-opcode-map.txt index 8908c58bd6cd..53adc1762ec0 100644 --- a/tools/arch/x86/lib/x86-opcode-map.txt +++ b/tools/arch/x86/lib/x86-opcode-map.txt @@ -929,7 +929,7 @@ EndTable GrpTable: Grp3_2 0: TEST Ev,Iz -1: +1: TEST Ev,Iz 2: NOT Ev 3: NEG Ev 4: MUL rAX,Ev