From patchwork Fri Nov 15 08:33:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Xu X-Patchwork-Id: 11245385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF78F930 for ; Fri, 15 Nov 2019 08:35:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E7BB20723 for ; Fri, 15 Nov 2019 08:35:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E7BB20723 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVX4P-0007Vd-LY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Nov 2019 03:35:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVX3J-0006Vd-Ke for qemu-devel@nongnu.org; Fri, 15 Nov 2019 03:34:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVX3H-0000tR-NG for qemu-devel@nongnu.org; Fri, 15 Nov 2019 03:34:00 -0500 Received: from mga05.intel.com ([192.55.52.43]:38727) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iVX3H-0000sI-Dr for qemu-devel@nongnu.org; Fri, 15 Nov 2019 03:33:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2019 00:33:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,307,1569308400"; d="scan'208";a="230390059" Received: from tao-optiplex-7060.sh.intel.com ([10.239.159.36]) by fmsmga004.fm.intel.com with ESMTP; 15 Nov 2019 00:33:54 -0800 From: Tao Xu To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com Subject: [PATCH] target/i386: Remove monitor from some CPU model Date: Fri, 15 Nov 2019 16:33:45 +0800 Message-Id: <20191115083345.22638-1-tao3.xu@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.43 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: Tao Xu , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add new version of Snowridge, Denverton, Opteron_G3, EPYC, and Dhyana CPU model to remove MONITOR/MWAIT feature. After QEMU/KVM use "-overcommit cpu-pm=on" to expose MONITOR/MWAIT (commit id 6f131f13e68d648a8e4f083c667ab1acd88ce4cd), the MONITOR/MWAIT feature in these CPU model is unused. Signed-off-by: Tao Xu --- target/i386/cpu.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a624163ac2..7c5f1e8fe0 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2770,6 +2770,19 @@ static X86CPUDefinition builtin_x86_defs[] = { MSR_ARCH_CAP_RDCL_NO | MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY, .xlevel = 0x80000008, .model_id = "Intel Atom Processor (Denverton)", + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "monitor", "off" }, + { "model-id", + "Intel Atom Processor (Denverton, no MONITOR)" }, + { /* end of list */ }, + }, + }, + { /* end of list */ }, + }, }, { .name = "Snowridge", @@ -2850,6 +2863,16 @@ static X86CPUDefinition builtin_x86_defs[] = { { /* end of list */ }, }, }, + { + .version = 3, + .props = (PropValue[]) { + /* mpx was already removed by -v2 above */ + { "monitor", "off" }, + { "model-id", + "Intel Atom Processor (Snowridge, no MPX, no MONITOR)" }, + { /* end of list */ }, + }, + }, { /* end of list */ }, }, }, @@ -2961,6 +2984,19 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_EXT3_ABM | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, .xlevel = 0x80000008, .model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)", + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "monitor", "off" }, + { "model-id", + "AMD Opteron 23xx (Gen 3 Class Opteron, no MONITOR)" }, + { /* end of list */ }, + }, + }, + { /* end of list */ }, + }, }, { .name = "Opteron_G4", @@ -3085,6 +3121,16 @@ static X86CPUDefinition builtin_x86_defs[] = { { /* end of list */ } } }, + { + .version = 3, + .props = (PropValue[]) { + /* ibpb was already enabled by -v2 above */ + { "monitor", "off" }, + { "model-id", + "AMD EPYC Processor (with IBPB, no MONITOR)" }, + { /* end of list */ }, + }, + }, { /* end of list */ } } }, @@ -3137,6 +3183,18 @@ static X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x8000001E, .model_id = "Hygon Dhyana Processor", .cache_info = &epyc_cache_info, + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "monitor", "off" }, + { "model-id", "Hygon Dhyana Processor (no MONITOR)" }, + { /* end of list */ }, + }, + }, + { /* end of list */ }, + }, }, };