Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1228277pxb; Fri, 10 Sep 2021 00:43:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXlHNlhmXGquABIquzRT0asqoQIOBMQdOWkB6aFciK4nwLIOXfvbw+g0XUMGyTt44pMvbS X-Received: by 2002:a17:906:6b96:: with SMTP id l22mr8118050ejr.430.1631259811962; Fri, 10 Sep 2021 00:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631259811; cv=none; d=google.com; s=arc-20160816; b=BkC1XpXeo0ReQjrWy0tEhIhju4j1iXcPapbihS07ZbVhQswHkp5yzW4Nu1jUfsXC1x mJ+wOrWN3CGFBgkGA9bpdxEj3UE4EW5rgp6gqRhmw+saNtK6BRllIOam7MHQ2QZRsQZz uh/GQlpF7rvMIkfIT+JJ9cXzMfIJPQ8rSjL/3tS4XMjaM3GWEUczhqrBnG+YMYg6TgZh zI5wyBOkDUeCciaqtD4OXw/bd/AJds9sqZmvCmD9pgVu3okBWtPljOu1tEyE3RA9CmCG KPUwo0nkH1Qi0fMaiqanS4mNVTdsXWHTRGPIHv7BoGOHobkRp9h+aGtJ1O3RzfnVUj1P 4NpQ== 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; bh=dHD4NoJq1L3TZ4pEIfzfWbfUN4KU/RP4A7q4mpbsWOU=; b=QpGed1X+UqGPnRp10yz4aOZJGH7v88lyPsF96OJDg6rZeMDFzDNXT7jmSSiuCNR/6e mE+ZAXiRwDZVVmp6POXsuGqmRMhSfg91ztuKAIgfKCLblakj/Ob4FWKZ2g0fFWsF+TNt 2ZsIsLkDihf1PcxJBdFdFmhdyzOEImXAMJs1TKHAimpx0ZpNhXdv05SZkZwwWbXyAurS /ICroHpCkTkAW9aNH1vNec/tGjvGt6Ct4efcv6DuGQoiMOSuOADQMknpCalNpdsGFTp1 qwAWCw9em7EqJKwL68TfsNDWANGTWMj4wH6zk/teW3ej+F7u45+/jEHKYLnsGYaZRf4q ePHQ== 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 p17si4373898edy.229.2021.09.10.00.43.09; Fri, 10 Sep 2021 00:43:31 -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 S231548AbhIJHk0 (ORCPT + 99 others); Fri, 10 Sep 2021 03:40:26 -0400 Received: from mga14.intel.com ([192.55.52.115]:22333 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231290AbhIJHkZ (ORCPT ); Fri, 10 Sep 2021 03:40:25 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="220691649" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="220691649" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 00:39:11 -0700 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="549158582" Received: from unknown (HELO [10.239.13.122]) ([10.239.13.122]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 00:39:07 -0700 Subject: Re: [PATCH v2] KVM: VMX: Enable Notify VM exit To: Sean Christopherson Cc: Chenyi Qiang , Tao Xu , pbonzini@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210525051204.1480610-1-tao3.xu@intel.com> <080602dc-f998-ec13-ddf9-42902aa477de@intel.com> <4079f0c9-e34c-c034-853a-b26908a58182@intel.com> From: Xiaoyao Li Message-ID: Date: Fri, 10 Sep 2021 15:39:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: 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 On 9/10/2021 2:47 AM, Sean Christopherson wrote: > On Tue, Sep 07, 2021, Xiaoyao Li wrote: >> On 9/3/2021 12:29 AM, Sean Christopherson wrote: >>>> After syncing internally, we know that the internal threshold is not >>>> architectural but a model-specific value. It will be published in some place >>>> in future. >>> >>> Any chance it will also be discoverable, e.g. via an MSR? >> >> I also hope we can expose it via MSR. If not, we can maintain a table per >> FMS in KVM to get the internal threshold. However, per FMS info is not >> friendly to be virtualized (when we are going to enable the nested support). > > Yeah, FMS is awful. If the built-in buffer isn't discoverable, my vote is to > assume the worst, i.e. a built-in buffer of '0', and have the notify_window > param default to a safe value, e.g. 25k or maybe even 150k (to go above what the > hardware folks apparently deemed safe for SPR). It's obviously not idea, but > it's better than playing FMS guessing games. > >> I'll try to persuade internal to expose it via MSR, but I guarantee nothing. > > ... > >>> On a related topic, this needs tests. One thought would be to stop unconditionally >>> intercepting #AC if NOTIFY_WINDOW is enabled, and then have the test set up the >>> infinite #AC vectoring scenario. >>> >> >> yes, we have already tested with this case with notify_window set to 0. No >> false positive. > > Can you send a selftest or kvm-unit-test? > Actually we implement the attacking case of CVE-2015-5307 with kvm-unit-test, while manually disabling the intercept of #AC. First, it requires modification of KVM that only posting the kvm-unit-test doesn't help. Second, release the attacking case is not the correct action.