From nobody Fri May 17 01:07:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1612256518; cv=none; d=zohomail.com; s=zohoarc; b=lGjWVnbDSggODt40nfYJscxulKyvVysEUXrZ/86pvZhN17To+Ay3SoUxFFQePBbGPbFgHQq7KLJLMtYbVVO26OxLVDQ4MTAfNX1AnVTz98Hmq8czSHO9NWCCCaGuQ3tDsOsWaZO5KzQTE06ujbkkzwMEYPfLh5+M6TpQ894MUk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612256518; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=XxdTpWnWX7XcSkVI/HRb5HwY7kyjUPIxxDSLGtO9q5M=; b=ngIbEoR7aGlYL7xhE9KAWaXrJ1Mmao7dHnfAh2RhP6rFBcDLQPW6fepoJFIKzREz1GlbPtFEW5t7RwWVLdFA/QgugYpX8Iy9NtLfem6C9Zu9IMV30yH56gp+sZdxcjjaTuA/2Xx+V5AVU0du1+vJplzwXXzJCCNI2vUDDXgrn64= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612256518795578.0121231492342; Tue, 2 Feb 2021 01:01:58 -0800 (PST) Received: from localhost ([::1]:55366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6rZN-0001cV-6A for importer@patchew.org; Tue, 02 Feb 2021 04:01:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6rXF-00015b-IC for qemu-devel@nongnu.org; Tue, 02 Feb 2021 03:59:45 -0500 Received: from mga07.intel.com ([134.134.136.100]:32943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6rXC-00057O-R6 for qemu-devel@nongnu.org; Tue, 02 Feb 2021 03:59:45 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2021 00:59:35 -0800 Received: from chenyi-pc.sh.intel.com ([10.239.159.24]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2021 00:59:27 -0800 IronPort-SDR: Dp+aUk9n5cnnQoUykQppjRN4h5T8YvoeDyawT/UXk4Y2h0mUjGEJFc7q7sGlf19egEYaZEBLLi 6DtESXPu6bEg== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="244903955" X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="244903955" IronPort-SDR: k3PxExP0FG2pg7g0NQhBnxjLml6VauxDV9/z6HjAjcDTNzoOUT0otD3lOTT9PLvTTJzhgOrdRw sINqk9Iuk7aQ== X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="371877776" From: Chenyi Qiang To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , Xiaoyao Li Subject: [PATCH] target/i386: Add bus lock debug exception support Date: Tue, 2 Feb 2021 17:02:24 +0800 Message-Id: <20210202090224.13274-1-chenyi.qiang@intel.com> X-Mailer: git-send-email 2.17.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.100; envelope-from=chenyi.qiang@intel.com; helo=mga07.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Bus lock debug exception is a feature that can notify the kernel by generate an #DB trap after the instruction acquires a bus lock when CPL>0. This allows the kernel to enforce user application throttling or mitigations. This feature is enumerated via CPUID.(EAX=3D7,ECX=3D0).ECX[bit 24]. Signed-off-by: Chenyi Qiang --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ae89024d36..55f3b5829f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -963,7 +963,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS]= =3D { "avx512bitalg", NULL, "avx512-vpopcntdq", NULL, "la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL, - NULL, "cldemote", NULL, "movdiri", + "bus-lock-detect", "cldemote", NULL, "movdiri", "movdir64b", NULL, NULL, NULL, }, .cpuid =3D { diff --git a/target/i386/cpu.h b/target/i386/cpu.h index d23a5b340a..417f49b721 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -762,6 +762,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_ECX_LA57 (1U << 16) /* Read Processor ID */ #define CPUID_7_0_ECX_RDPID (1U << 22) +/* Bus Lock Debug Exception */ +#define CPUID_7_0_ECX_BUS_LOCK_DETECT (1U << 24) /* Cache Line Demote Instruction */ #define CPUID_7_0_ECX_CLDEMOTE (1U << 25) /* Move Doubleword as Direct Store Instruction */ --=20 2.17.1