Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1670905pxb; Fri, 10 Sep 2021 10:57:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMMVuXt0HQYHXmlEpbvjtyT5sXMkMpCm8o+WYlsU4xdWvXmBOql3qHerEWVkdazTwnzyVC X-Received: by 2002:a17:906:994d:: with SMTP id zm13mr10700576ejb.557.1631296655092; Fri, 10 Sep 2021 10:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631296655; cv=none; d=google.com; s=arc-20160816; b=qbqHU/pLS2W6KMjAFRouhQHjjwyLHawURQeqbzUnAQynW0cOmhfcZ4iGUshHEDyFmE BoTS2xf5/7zo80s7m1GD8B5cNEfcxW9r8B6wLH3Odj2BdDgIffecUt1Z9px+VFsruWZg zas1YFp1QVgilULznWPAjcKBeYd237jsMebkRvB9x7OW0Y+qFVftEqI9L/XTpARLiGdm IbeJD0BQODu8gZW+rIn5WqvuiB4ipREBbknBwywWJRKS6qRmCinG7nKyYE601JXWYYgW xtWeYexfcRXKZqhaMjLhK86mAcEZt53XOH5JpkmNz98mzJVTZ6cfZrUzkLSIcWvB19K4 9JXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=74br1N0NBz3VAESrVPeVqbSv4KpvlUpZC5wb7BVH5bM=; b=bjShRnb2ZqT43xa9ae3bRNifLD/TAcTerREaZZpQ6HpFDNJING+xe3eOslTX+SChZr tNxXJaVkvtbn7gT2vIxajJ8GlnRgzNgtYHGlzkYtjRy0PCnoY8HqjqMglEFB0dDDJtOZ hjQs8csZjMNtON2Z32P6vvkC24FmlOiPAnUBvoMnoUdbd98m9QFZboe1lKmu5wJ+3VIp 53b8Sp9H7Xf4oGruI6rHfxepTrFcb6nVMDQiJrNvkQAz32b6PC10TtZTgA2O3qQYn/6M KaQZyTTJV0/+8oMGH6iVmsDjUedlfm1DbmjpaB88g7OiekD6Z7GBmTKKZjvXskEk5sri 2wzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PoMBT5Pz; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h4si7384754edt.426.2021.09.10.10.57.11; Fri, 10 Sep 2021 10:57:35 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=PoMBT5Pz; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231965AbhIJR4k (ORCPT + 99 others); Fri, 10 Sep 2021 13:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbhIJR4i (ORCPT ); Fri, 10 Sep 2021 13:56:38 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0169C061574 for ; Fri, 10 Sep 2021 10:55:27 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id n4so1627523plh.9 for ; Fri, 10 Sep 2021 10:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=74br1N0NBz3VAESrVPeVqbSv4KpvlUpZC5wb7BVH5bM=; b=PoMBT5PzZXpKtCxjsX/Fld3niyqTFQTJjrnbjxl22WWNvHGWfD3bdB0IiukTT5/T2m U5lyc00oHBvpOWjq2DGox4Cctkd4i6lRb2SoWvoH5pcIQEfkorPNdRgbzBmfmntSWKXV 7iX1e/se+bux8EjhtPtfZ79ou55zlTOSM8B4FbWY1tDIwbmFhmY5xq05r0kfOOBllEQ6 PLrpL4zQM89JZ8dNbS/NiOFb7fXms/Tp39FzOijmzTOmvd09isUJ8+S6rEOt17UD+xsL XtrUs17yUp+CTl+sP2ZrsAb8C1wzaPBcc84g1KC0c8pL6nz+BZ+P4/VOTsSSlJzhwrwH 8/Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=74br1N0NBz3VAESrVPeVqbSv4KpvlUpZC5wb7BVH5bM=; b=0Obv7oSDRvqE9rr31BdbekC2Ril3l30nW40lQYLvrVciwVTveMOGHGWWu+uDy6zLZB lCdwoiOpOyaLT7yWlkU1Sn2Qa7vLOKgBCByVpyS49cojVs2ki54McuVqmk/rxWoO5/2f vvJuAXh+tcwk4H8pisg4+KkLWMbIjCCUufg9aMasjaFKSu2iNaIH+1Vxc8XSgoR/0oc6 FjpI/erCo1P14+nSqYShx7aEsqlNxSfMxhbjnsIKX8ZSgtf9pmCEGuaZJ/7SgWF1fGAf ZhdumfkhhZonuXcov8M2m+wLNRSpfoIOdgiidj2Ms5JOdYnv+1nieQvvIPYQcEucLXJy Pstg== X-Gm-Message-State: AOAM530NzinhBP7PN+WEJ1HHDElOnB/YxeYAb/qNylrWrgeD6nlAtV3u JpiEk2ZU83mOAZrAFsTOjWjCFA== X-Received: by 2002:a17:902:ea11:b0:13a:db38:cfcf with SMTP id s17-20020a170902ea1100b0013adb38cfcfmr4790469plg.3.1631296527096; Fri, 10 Sep 2021 10:55:27 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id b17sm5635774pfo.98.2021.09.10.10.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 10:55:26 -0700 (PDT) Date: Fri, 10 Sep 2021 17:55:22 +0000 From: Sean Christopherson To: Xiaoyao Li 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 Subject: Re: [PATCH v2] KVM: VMX: Enable Notify VM exit Message-ID: References: <20210525051204.1480610-1-tao3.xu@intel.com> <080602dc-f998-ec13-ddf9-42902aa477de@intel.com> <4079f0c9-e34c-c034-853a-b26908a58182@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021, Xiaoyao Li wrote: > 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. It helps in that hacking KVM to disable #AC interception is a lot easier than re-writing a test from scratch. > Second, release the attacking case is not the correct action. As in it's irresponsible to provide code that can be used to DoS a hypervisor? The CVE is six years old, IMO security-through-obscurity is unnecessary at this point.