Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3114255ybf; Mon, 2 Mar 2020 23:21:50 -0800 (PST) X-Google-Smtp-Source: ADFU+vsyMy5cCHSmqrbIlfOoKTiouTBGK6oRGK9fW777CmLs26PNUWXTDL16F+qPGqqcGJlF20Dq X-Received: by 2002:aca:5f87:: with SMTP id t129mr1597162oib.36.1583220110438; Mon, 02 Mar 2020 23:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583220110; cv=none; d=google.com; s=arc-20160816; b=dHBP9phXfu1r5XnQbq1JeT923e8Oq1xVutSEUh50fSMhpSNNn6IjIGYWcbUUj0OMSY ijxCWQDERV2nO1Mv+7UAgGgLtdDdXLVFZjr+zz9MBMZb0Uk3gfH6oiDKTIfeq3f8dqD6 YpIF/NZgIUn4XU+Mra0gRfCjDAf1iYRxH9To4ckr8F26ugH2WDr2GiNaw5zq47jn3d3q 27aC4pP9lA3M6QEo4bCulVeFJslgGrRIzlXoMTBoJC3ljWAHp/na4KqlL7cLDW/+OF9X k2NdngYk5/d3wkYaObh7EwbcYDMHamEVJJypVlfvwnjrtYBtHZIMp0cHuYEjv/5XVdnq EGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject; bh=zgnpMu8mqy1OxuSz8elcI47MvaQROq6fOgOwSwtoxF8=; b=QJfbEPoHzag0bzE2CYfmOQTvYr9QD98l5rgzGxuwmc6pnYqij2Ym4vHGxWFOQSESy3 wLNzlVMV1JWimDsKPSHyFusuQhal4tqNSXsrD6TL3I2H9poR8QDhI5OEiPoIMWBu7UEG bKO0gzamDVXgzTs4aSBaFqpUWNX3Ha9wIHsmNKFP6VOt5AytWcDSROxSH/Gv41PKoS6r ZZDW9G3kBOmi03FzDuaascayvREtJAwAxbRaJcwy59uBZIpUldglvdWJJq9AE1rXV7pa liit9rfa6uMqcCeQOwzr26j/cnrq8o58WkwTQtyQoFrhAWo2y4EE/Ur9/+FwKxJ50kDG 5k9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si7778812ota.299.2020.03.02.23.21.36; Mon, 02 Mar 2020 23:21:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727542AbgCCHVZ (ORCPT + 99 others); Tue, 3 Mar 2020 02:21:25 -0500 Received: from mga17.intel.com ([192.55.52.151]:1263 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727522AbgCCHVZ (ORCPT ); Tue, 3 Mar 2020 02:21:25 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2020 23:21:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,510,1574150400"; d="scan'208";a="412644822" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.167]) ([10.237.72.167]) by orsmga005.jf.intel.com with ESMTP; 02 Mar 2020 23:21:22 -0800 Subject: Re: [PATCH] x86: perf: insn: Tweak opcode map for Intel CET instructions From: Adrian Hunter To: Mingbo Zhang , x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Masami Hiramatsu , Arnaldo Carvalho de Melo , Andi Kleen , Josh Poimboeuf , linux-kernel@vger.kernel.org, Yu-cheng Yu References: <20200303045033.6137-1-whensungoes@gmail.com> <931d8779-8b77-b75f-bb3a-ee2f9d75f149@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Tue, 3 Mar 2020 09:20:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <931d8779-8b77-b75f-bb3a-ee2f9d75f149@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/03/20 9:17 am, Adrian Hunter wrote: > On 3/03/20 6:50 am, Mingbo Zhang wrote: >> Intel CET instructions are not described in the Intel SDM. When trying to >> get the instruction length, the following instructions get wrong (missing >> ModR/M byte). >> >> RDSSPD r32 >> RSDDPQ r64 >> ENDBR32 >> ENDBR64 >> WRSSD r/m32, r32 >> WRSSQ r/m64, r64 >> >> RDSSPD/Q and ENDBR32/64 use the same opcode (f3 0f 1e) slot, which is >> described in SDM as Reserved-NOP with no encoding characters, and got an >> empty slot in the opcode map. WRSSD/Q (0f 38 f6) also got an empty slot. > > We have patches for that: > > https://lore.kernel.org/lkml/20200204171425.28073-1-yu-cheng.yu@intel.com/ > > But they have not yet been applied. Arnaldo, could you take them? > For reference: Subject: [PATCH 0/2] Introduce Control-flow Enforcement opcodes Date: Tue, 4 Feb 2020 09:14:23 -0800 Message-ID: <20200204171425.28073-1-yu-cheng.yu@intel.com> (raw) Control-flow Enforcement (CET) introduces 10 new instructions [1]. Add them to the opcode map. This series has been separated from the CET patches [2] for ease of review. [1] Detailed information on CET can be found in "Intel 64 and IA-32 Architectures Software Developer's Manual": https://software.intel.com/en-us/download/intel-64-and-ia-32- architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4 [2] CET patches: https://lkml.kernel.org/r/20190813205225.12032-1-yu-cheng.yu@intel.com/ https://lkml.kernel.org/r/20190813205359.12196-1-yu-cheng.yu@intel.com/ Adrian Hunter (1): x86/insn: perf tools: Add CET instructions to the new instructions test Yu-cheng Yu (1): x86/insn: Add Control-flow Enforcement (CET) instructions to the opcode map arch/x86/lib/x86-opcode-map.txt | 17 +- tools/arch/x86/lib/x86-opcode-map.txt | 17 +- tools/perf/arch/x86/tests/insn-x86-dat-32.c | 112 +++++++++ tools/perf/arch/x86/tests/insn-x86-dat-64.c | 196 +++++++++++++++ tools/perf/arch/x86/tests/insn-x86-dat-src.c | 236 +++++++++++++++++++ 5 files changed, 566 insertions(+), 12 deletions(-)