Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2420815pxj; Mon, 17 May 2021 00:49:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznjtbpOKUwzSkSrTMkkN6aESxqjAOuaBA0S8t5AKDu2RnC/BIUqH/SyDJc3FR8fAjnt99a X-Received: by 2002:a02:c73a:: with SMTP id h26mr8515527jao.95.1621237783922; Mon, 17 May 2021 00:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621237783; cv=none; d=google.com; s=arc-20160816; b=clDHOwZ/MJ+34f+xrF83N13d56mMXi2/d88iCo/nYqOifUV2RRPaHcVmE0ziPAE8rH RxSVbwgNKgD5yo/sHTjQUQxChmyGTBV5AvHgcBTn4LgbzooirpqNcHrkt7NNTJFO3yhT W/2jnreN8EFkaI/zNP8DFix1aBDDPAxQ42v8VJjgAuz21zWAJk9ykyfg+xVitj1fVE04 h5Rjbql97tSyiO+7tooxZMneyBlZW3k2QJLG++Z2r3BQoQT9IEJJTdLwODj3E7UCe1d1 +zvF/nyOxfSXCBSvWYJiHhSlgpUOQT3NDeYRrYVCiL2sMT0vxRKzOTVYgizDPAUvS/Sw Gi/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=4fsn+jjcGOWxJneY135TsRQA6iTK8uVZwHBhrXWtxws=; b=Js4tsk0KBL1DeEBfi9KSP756Hqzhr9DWFlGP8PzoCX/6B9NlHWL0grUMLoRbblrnIL wnv6C8021I1HFkgBOk+tfdN5oS6/+fbN0yRxEowjyuUEPmU4W/CET9sdWiyhNNTv0hc+ xnbWEB/S6aA17ayLozKzvpuHhYMDOqCiI8V8/iIprBMKNxlSBD/1XIl1QS4howPd492L TubNBzGTALSS9xAzGIXbTpjRzbAaEOslnnPkyP9zKAFJxoDjIiGSouoo6bQQmSvQPX+4 yBXPc2koOenVgEygOu1oQ37ppANPVN5upfHs8TGiVhgEVoac9HWlfoAdlrViYVbv1xH+ ghPg== 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 k43si2197548jav.84.2021.05.17.00.49.31; Mon, 17 May 2021 00:49:43 -0700 (PDT) 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 S235219AbhEQHWM (ORCPT + 99 others); Mon, 17 May 2021 03:22:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:44010 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbhEQHWA (ORCPT ); Mon, 17 May 2021 03:22:00 -0400 IronPort-SDR: /rGWpKg/tsGgYywzcG14Ksa5GqaOmtGM6mfJrflrlIa38NWD6o2hVkamjsy5cKZfkgnaiglPX4 e8dYfTiAt28Q== X-IronPort-AV: E=McAfee;i="6200,9189,9986"; a="200091577" X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="200091577" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 00:20:38 -0700 IronPort-SDR: qtW4z5bbW322z0qZvkkjRDL/Dcz1QaNsEBaVRkDR6rYQ51+cISpp6hH4U6JVIN+qpuDSIEJw6p gBU4A149evMA== X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="472276011" Received: from unknown (HELO [10.239.13.114]) ([10.239.13.114]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 00:20:35 -0700 Subject: Re: [PATCH] KVM: VMX: Enable Notify VM exit To: Sean Christopherson , Andy Lutomirski Cc: Tao Xu , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , kvm list , LKML References: <20201102061445.191638-1-tao3.xu@intel.com> <20201102173130.GC21563@linux.intel.com> <20201102183359.GE21563@linux.intel.com> From: Xiaoyao Li Message-ID: <5117f8d3-c40c-204d-b09c-e49af42ad665@intel.com> Date: Mon, 17 May 2021 15:20:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20201102183359.GE21563@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, Andy and Paolo, On 11/3/2020 2:33 AM, Sean Christopherson wrote: > On Mon, Nov 02, 2020 at 10:01:16AM -0800, Andy Lutomirski wrote: >> On Mon, Nov 2, 2020 at 9:31 AM Sean Christopherson >> wrote: >>> >>> Tao, this patch should probably be tagged RFC, at least until we can experiment >>> with the threshold on real silicon. KVM and kernel behavior may depend on the >>> accuracy of detecting actual attacks, e.g. if we can set a threshold that has >>> zero false negatives and near-zero false postives, then it probably makes sense >>> to be more assertive in how such VM-Exits are reported and logged. >> >> If you can actually find a threshold that reliably mitigates the bug >> and does not allow a guest to cause undesirably large latency in the >> host, then fine. 1/10 if a tick is way too long, I think. > > Yes, this was my internal review feedback as well. Either that got lost along > the way or I wasn't clear enough in stating what should be used as a placeholder > until we have silicon in hand. > We have tested on real silicon and found it can work even with threshold being set to 0. It has an internal threshold, which is added to vmcs.notify_window as the final effective threshold. The internal threshold is big enough to cover normal instructions. For those long latency instructions like WBINVD, the processor knows they cannot cause no interrupt window attack. So no Notify VM exit will happen on them. Initially, our hardware architect wants to set the notify window to scheduler tick to not break kernel scheduling. But you folks want a smaller one. So are you OK to set the window to 0?