Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 532C1C433EF for ; Fri, 15 Jul 2022 01:15:03 +0000 (UTC) Received: from localhost ([::1]:52718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oC9v4-0007Kn-5x for qemu-devel@archiver.kernel.org; Thu, 14 Jul 2022 21:15:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC9uL-0006ei-DE for qemu-devel@nongnu.org; Thu, 14 Jul 2022 21:14:17 -0400 Received: from mga12.intel.com ([192.55.52.136]:34844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC9uI-000808-B7 for qemu-devel@nongnu.org; Thu, 14 Jul 2022 21:14:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657847654; x=1689383654; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=FauaFQ6SOABa4ptPcRmdKeT5KMQO2//mgiKgDMU4Wcc=; b=HOJZeNImZv8Am9Z9/RyTsMcTRT6POvxD+iWoAhmMA5TpAN2RaUTnoYiq Gr5TlJNLJ+LbqMh9Qkh1DEUOsWSVmKCbrKJ3PDD4VZFuhs0jedurW1KhY zytigtmfYi8cjUsHJXRlro41O07X16jPceXCefVecyB+5NR8+CCTV4acv h6Y/QE7eQ5mjHJ3IrsoN5ZTpfh875HKUw/O5tTRXw95VEbYU+o+9O8LK5 ydRUqD//mGJ5t3sVbRD5nGMnAbKuo3O4NnZ7ZfEx01c8KiEf/4793WDzH aV0AN09y9IyXlNyzCG/xvd8WI66872rBggZy3vDqeW/Vj+/wB8UHVe9hM g==; X-IronPort-AV: E=McAfee;i="6400,9594,10408"; a="265462285" X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="265462285" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 18:14:06 -0700 X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="546481340" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.249.170.192]) ([10.249.170.192]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 18:13:59 -0700 Message-ID: Date: Fri, 15 Jul 2022 09:13:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH v2] target/i386: Restore TSX features with taa-no Content-Language: en-US To: Paolo Bonzini , Zhenzhong Duan , qemu-devel@nongnu.org Cc: ehabkost@redhat.com, xiangfeix.ma@intel.com, seanjc@google.com References: <20220714053631.417152-1-zhenzhong.duan@intel.com> From: Xiaoyao Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=192.55.52.136; envelope-from=xiaoyao.li@intel.com; helo=mga12.intel.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/14/2022 3:59 PM, Paolo Bonzini wrote: > On 7/14/22 07:36, Zhenzhong Duan wrote: >> On ICX-2S2 host, when run L2 guest with both L1/L2 using >> Icelake-Server-v3 >> or above, we got below warning: >> >> "warning: host doesn't support requested feature: MSR(10AH).taa-no >> [bit 8]" >> >> This is because L1 KVM doesn't expose taa-no to L2 if RTM is disabled, >> then starting L2 qemu triggers the warning. >> >> Fix it by restoring TSX features in Icelake-Server-v3, which may also >> help >> guest performance if host isn't susceptible to TSX Async Abort (TAA) >> vulnerabilities. >> >> Fixes: d965dc35592d ("target/i386: Add ARCH_CAPABILITIES related bits >> into Icelake-Server CPU model") >> Tested-by: Xiangfei Ma >> Signed-off-by: Zhenzhong Duan >> --- >> v2: Rewrite commit message > > Why wouldn't the fix be (in an Icelake-Server-v4 model) to remove taa-no? Production Icelake silicon should have the taa-no set, that's the reason taa-no was added in v3 model. When taa-no presents, it's safe to bring TSX features back. I'm wondering if we need a new version (v7) for this change. > Paolo > >>   target/i386/cpu.c | 3 +++ >>   1 file changed, 3 insertions(+) >> >> diff --git a/target/i386/cpu.c b/target/i386/cpu.c >> index 14f681e998cc..25ef972a3eed 100644 >> --- a/target/i386/cpu.c >> +++ b/target/i386/cpu.c >> @@ -3423,6 +3423,9 @@ static const X86CPUDefinition builtin_x86_defs[] >> = { >>               { >>                   .version = 3, >>                   .props = (PropValue[]) { >> +                    /* Restore TSX features removed by -v2 above */ >> +                    { "hle", "on" }, >> +                    { "rtm", "on" }, >>                       { "arch-capabilities", "on" }, >>                       { "rdctl-no", "on" }, >>                       { "ibrs-all", "on" }, >