Message ID | 20231205105030.8698-11-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3358842vqy; Tue, 5 Dec 2023 03:22:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgbv6uXcl1fDQiLQS+Dz0g5U53hd9IiGs6i4wFGU3BL4Kr4YJZE5WIoprgWGjHYG9Lr+vL X-Received: by 2002:a17:90a:46:b0:285:a0de:c726 with SMTP id 6-20020a17090a004600b00285a0dec726mr676285pjb.35.1701775323977; Tue, 05 Dec 2023 03:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775323; cv=none; d=google.com; s=arc-20160816; b=SriqczlCdLlpIlktYyFB4oj+SO9LPAaMPHeL66eRuImGIN4nk0OpdMM7eagdSE/3l2 zfdhlQIlVTaOEuEfrEdrXs7uZx8H68ARDMOvtCReZ8uLDrQHCt7CdUuakV3DLflSziS5 /Pwi8TZxo7C2gjZMo4LcjK7ueb9RJZiNR1XOEkcw0iprdobCz8dHdkbB8yr6OFG+bsYF rvqCJlzbPCTjYi+H0nkbZNJYvy+/skrRTZRv4bjLLQ5SDOmOEI45RaDfbyXFs8d8xo3x L1kp/8fmKmY2EFqDlZLVUVlgxscMJBS8nM6/jUXDFaM4W/WojRL8B/R3te/kRPRxRjh9 yUYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y/TD/VALuASHosN2MT9/9TMGtpqd4qzm5S2GVJifbc0=; fh=uCCWEUVpLc/xDP/D3WvGY/BxHU9d0NQYu/T71GEsNmA=; b=pXGc+WyxgQdRuv+I/iOFITdVKWoXabY0KIgYw1Jl/DzBUbwGYVD1vjmR1cI9ODT1jo QCvFrzcrVJl9+9AyGVoGebwkRZNj0fZu2j7MyYXAYvmEdGD2vDigpsjZRtrqeAg7L1Iw WM7QL0UtR8QeqD7EFg9EApFjvMSaZbQrxnbGyG8Nuxcp/sR5bHh3FGkX0isC3pq4E+bX yF1vTn8Zcwu0Vu7cbxxQrDW/VtJWHFCcz3d+E4ipyBIl0M7zkxBlpPUvur3aSz9jtkvj uZ1XEFI35ozueiEylUkmBBq3cI9tuWdNKIdlkMt0TjCwB6PYIUbumpHu1FcoXdbtJlca gd5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PisZ+4BE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d10-20020a17090ad3ca00b002851c699781si9295982pjw.154.2023.12.05.03.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:22:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PisZ+4BE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0057880C0395; Tue, 5 Dec 2023 03:22:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442185AbjLELVr (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Tue, 5 Dec 2023 06:21:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442069AbjLELVS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 5 Dec 2023 06:21:18 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A54B4135; Tue, 5 Dec 2023 03:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701775285; x=1733311285; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8zwQaI6Tk7f8mb2xHC28eOqgRd27v5i+M1zjLpRj75Y=; b=PisZ+4BE2m9zWBVoo8xuTuXLh11Hg+UBXSSvCouiqe1VmyGTwho3LH5i n3E4mOYYnlHV116Yk8ESWRyK3moYDF2XMRTeyKAEqBY5tACy24RyRystt DN+KK+3pXK5QitLncIvVOLFIHcwnPqvoScoJe6hIYv/4aFo5GHugeO7nu eLaBu8idXTDpu/LP/tXWx9Bogw6v8/HRc/K20UUeIVgRmmdYOfWR4m+1j 6h+/QAGJz0GSIqVEwFgoT4xnJGP7zDQCey9GjERcP6kjZbroNvSZQON5n AHSqGyotZLO2ciKoUEkEg5CuU4qiwGYTCC5i3lV4CyYzzNw7Aq465SiGx g==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="942432" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="942432" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 03:21:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018192932" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018192932" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2023 03:21:18 -0800 From: Xin Li <xin3.li@intel.com> To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, pbonzini@redhat.com, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, andrew.cooper3@citrix.com, jiangshanlai@gmail.com, nik.borisov@suse.com, shan.kang@intel.com Subject: [PATCH v13 10/35] x86/objtool: Teach objtool about ERET[US] Date: Tue, 5 Dec 2023 02:49:59 -0800 Message-ID: <20231205105030.8698-11-xin3.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205105030.8698-1-xin3.li@intel.com> References: <20231205105030.8698-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:22:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784440761944610163 X-GMAIL-MSGID: 1784440761944610163 |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
Dec. 5, 2023, 10:49 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com> Update the objtool decoder to know about the ERET[US] instructions (type INSN_CONTEXT_SWITCH). Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Tested-by: Shan Kang <shan.kang@intel.com> Signed-off-by: Xin Li <xin3.li@intel.com> --- tools/objtool/arch/x86/decode.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index e327cd827135..3a1d80a7878d 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -509,11 +509,20 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec if (op2 == 0x01) { - if (modrm == 0xca) - insn->type = INSN_CLAC; - else if (modrm == 0xcb) - insn->type = INSN_STAC; - + switch (insn_last_prefix_id(&ins)) { + case INAT_PFX_REPE: + case INAT_PFX_REPNE: + if (modrm == 0xca) + /* eretu/erets */ + insn->type = INSN_CONTEXT_SWITCH; + break; + default: + if (modrm == 0xca) + insn->type = INSN_CLAC; + else if (modrm == 0xcb) + insn->type = INSN_STAC; + break; + } } else if (op2 >= 0x80 && op2 <= 0x8f) { insn->type = INSN_JUMP_CONDITIONAL;