From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A26CC433F5 for ; Fri, 10 Sep 2021 07:39:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 036D161153 for ; Fri, 10 Sep 2021 07:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231601AbhIJHk0 (ORCPT ); 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.