Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1415498pxb; Mon, 22 Feb 2021 00:57:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5bigduh43rKwasEakWSnC/sm3d1tq6uKXZX4JfJS3VPT8L79+H5fRQ0cJ9D6K4JtpGk1z X-Received: by 2002:a17:906:9bd2:: with SMTP id de18mr18973220ejc.191.1613984234263; Mon, 22 Feb 2021 00:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613984234; cv=none; d=google.com; s=arc-20160816; b=UurHhrNU7+Oj8LA68jK5IjpxJlhBpiHDGt5CYQ9sCEUaBJcsHl7n10rNDTaqLyVYds ZJQbZZoykVyAMJx7r+2ddOWW3w2LW0sqmDqA9aniOhPJLUEowjSbTCTDe8vDNVigQzm9 xljqm01c//dLKCijEFzv9I9T58QINXi5mC/I8ESYry7slDO3r3oaojK3NbN7osqt6ddK FKlyMuk5LwqQDNdY4vQ+2HVMfcdH2KG1kGFUoDWAISQQa6Vgsd7suAmgfu9uNI/ce0xV Wp3/zHyAMyzmiky2SNz4v8AmUDtigxIps+8yaRyganPopI8jMGE5hY6ovTZ/p/WeOokz HiQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=TUe1UmImZygpVrMTaNO4U2zusFGNSe382cd7Nhl7124=; b=deXNKQKVyHJhoj78z+sCCt1IxICYkuHlsi2xTh5EwnOiP6RdIf5Nrck7cgVWY5kxQn 2TbyLQkvC3DOyfewKonSsv8f+SEsTVIoGc/aFBY3w5gGJn2L6UkA7T/baAY4lUZVl3iH Wnb8ZLOveQJnkJl1znLGINrfomF9HDoICeFxX5ZXXgvB//ClSpFu4IdpartUnD+AWipO g0isLv1/8v/45P9BALtIKFVOi5/Bbw+Ls2eo6nv0XKlfYPANgmZlYxaDm9G/zmcV/i00 WMGOBaualBIRXRj4BiSByDeBfJlSxNkipKWgmI/4gHoPRjyzEo5trO0IZtU1+vwTAYJs CFtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id oz27si8171154ejb.458.2021.02.22.00.56.51; Mon, 22 Feb 2021 00:57:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230072AbhBVIxw (ORCPT + 99 others); Mon, 22 Feb 2021 03:53:52 -0500 Received: from mga05.intel.com ([192.55.52.43]:54164 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbhBVIxv (ORCPT ); Mon, 22 Feb 2021 03:53:51 -0500 IronPort-SDR: vRFphLsTiIUfaBw5Fr0wpqgoyDguLm/OqDmzaRifEAlD77eJQgiGxqHr3rDv2k9cfnWfFPDoQM YNseoAgTPp3w== X-IronPort-AV: E=McAfee;i="6000,8403,9902"; a="269311062" X-IronPort-AV: E=Sophos;i="5.81,196,1610438400"; d="scan'208";a="269311062" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2021 00:52:05 -0800 IronPort-SDR: 8UwXaghU0b5vpcSaBbTTIu5PGJ7VyA1pWz7tLKjf5KfXRNlD4UcMB0x2VtoKtVDgRewTTTXWzR uR0LxZBMELPQ== X-IronPort-AV: E=Sophos;i="5.81,196,1610438400"; d="scan'208";a="441317395" Received: from liujing-mobl.ccr.corp.intel.com (HELO [10.238.130.120]) ([10.238.130.120]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2021 00:51:53 -0800 Subject: Re: [PATCH RFC 3/7] kvm: x86: XSAVE state and XFD MSRs context switch To: Konrad Rzeszutek Wilk , Paolo Bonzini Cc: Sean Christopherson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, jing2.liu@intel.com References: <20210207154256.52850-1-jing2.liu@linux.intel.com> <20210207154256.52850-4-jing2.liu@linux.intel.com> <77b27707-721a-5c6a-c00d-e1768da55c64@redhat.com> From: "Liu, Jing2" Message-ID: <6b1e9cd9-b545-b027-2cda-aac76824c342@linux.intel.com> Date: Mon, 22 Feb 2021 16:51:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/9/2021 2:55 AM, Konrad Rzeszutek Wilk wrote: > On Mon, Feb 08, 2021 at 07:12:22PM +0100, Paolo Bonzini wrote: [...] >> >> However, running the host with _more_ bits set than necessary in XFD should >> not be a problem as long as the host doesn't use the AMX instructions. So >> perhaps Jing can look into keeping XFD=0 for as little time as possible, and >> XFD=host_XFD|guest_XFD as much as possible. > This sounds like the lazy-fpu (eagerfpu?) that used to be part of the > kernel? I recall that we had a CVE for that - so it may also be worth > double-checking that we don't reintroduce that one. Not sure if this means lazy restore, but the spec mentions that "System software should not use XFD to implement a 'lazy restore' approach to management of the XTILEDATA state component." One reason is XSAVE(S) will lose the xTILEDATA when XFD[i] is nonzero. Thanks, Jing