From patchwork Thu Sep 14 15:17:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9953363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D947602C9 for ; Thu, 14 Sep 2017 15:19:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1014D2877F for ; Thu, 14 Sep 2017 15:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04CAF290BE; Thu, 14 Sep 2017 15:19:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C2F728C01 for ; Thu, 14 Sep 2017 15:19:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsVtn-0003Wm-T8; Thu, 14 Sep 2017 15:17:51 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsVtm-0003Wa-Pn for xen-devel@lists.xenproject.org; Thu, 14 Sep 2017 15:17:50 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 29/3E-02225-E9D9AB95; Thu, 14 Sep 2017 15:17:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRWlGSWpSXmKPExsXS6fjDS3fW3F2 RBss+qVt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBm7PnSxF7TzVxx5fIm5gXEpVxcjJ4eQQJ7E 7F0zWUFsXgE7ia/fHjOD2BIChhKnF95kAbFZBFQlViw7yg5iswmoS7Q92w5Uz8EhImAgce5oE ojJLBAvcXWdPUiFsECgxJ69F9khphdJ3O6cyQhicwrYS3TOnwbWySsgKPF3hzBImFlAS+Lhr1 ssELa2xLKFr5khJkpLLP/HMYGRbxZCwywkDbOQNMxCaFjAyLKKUb04tagstUjXRC+pKDM9oyQ 3MTNH19DAWC83tbg4MT01JzGpWC85P3cTIzDsGIBgB2PjF6dDjJIcTEqivHt1d0YK8SXlp1Rm JBZnxBeV5qQWH2KU4eBQkuAtmbMrUkiwKDU9tSItMwcYATBpCQ4eJRHeBSBp3uKCxNzizHSI1 ClGXY6Om3f/MAmx5OXnpUqJ8/qCFAmAFGWU5sGNgEXjJUZZKWFeRqCjhHgKUotyM0tQ5V8xin MwKgnz3gWZwpOZVwK36RXQEUxAR5w5vQPkiJJEhJRUAyP3Br9CDz1+9sXbMqM4+v8/31S2M81 q3nw7efGrci7zmHMlitzWTondtfsXk8/Veg2jD21RO52EvUMlu5QtzeZt2Z94UKQuScKtTUVt 8s/06pKt/6dvZL8akesYyPz9w5dWhkdhy422KSyL/zZdK8slb3/Tgnadjdq77j3Wfr6o1c7QU X2JkBJLcUaioRZzUXEiAGORskjBAgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1505402264!110772913!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30056 invoked from network); 14 Sep 2017 15:17:46 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-15.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Sep 2017 15:17:46 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 14 Sep 2017 09:17:44 -0600 Message-Id: <59BAB9B6020000780017B3A2@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.2 Date: Thu, 14 Sep 2017 09:17:42 -0600 From: "Jan Beulich" To: "xen-devel" References: <59BAB38A020000780017B34E@prv-mh.provo.novell.com> <59BAB38A020000780017B34E@prv-mh.provo.novell.com> In-Reply-To: <59BAB38A020000780017B34E@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Disposition: inline Cc: George Dunlap , Andrew Cooper Subject: [Xen-devel] [PATCH v2 10/17] x86emul: add tables for XOP 08 and 09 extension spaces X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Convert the few existing opcodes so far supported. Also adjust two vex_* case labels to better be ext_* (the values are identical). Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -458,6 +458,20 @@ static const opcode_desc_t xop_table[] = DstReg|SrcImm|ModRM, }; +static const struct { + uint8_t simd_size:5; + uint8_t two_op:1; + uint8_t four_op:1; +} ext8f08_table[256] = { +}; + +static const struct { + uint8_t simd_size:5; + uint8_t two_op:1; +} ext8f09_table[256] = { + [0x01 ... 0x02] = { .two_op = 1 }, +}; + #define REX_PREFIX 0x40 #define REX_B 0x01 #define REX_X 0x02 @@ -2724,7 +2738,7 @@ x86_decode( } break; - case vex_0f38: + case ext_0f38: d = ext0f38_table[b].to_mem ? DstMem | SrcReg : DstReg | SrcMem; if ( ext0f38_table[b].two_op ) @@ -2734,7 +2748,14 @@ x86_decode( state->simd_size = ext0f38_table[b].simd_size; break; - case vex_0f3a: + case ext_8f09: + if ( ext8f09_table[b].two_op ) + d |= TwoOp; + state->simd_size = ext8f09_table[b].simd_size; + break; + + case ext_0f3a: + case ext_8f08: /* * Cannot update d here yet, as the immediate operand still * needs fetching. @@ -2927,6 +2948,15 @@ x86_decode( break; case ext_8f08: + d = DstReg | SrcMem; + if ( ext8f08_table[b].two_op ) + d |= TwoOp; + else if ( ext8f08_table[b].four_op && !mode_64bit() ) + imm1 &= 0x7f; + state->desc = d; + state->simd_size = ext8f08_table[b].simd_size; + break; + case ext_8f09: case ext_8f0a: break;