Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2588625pxb; Thu, 11 Feb 2021 17:06:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIX/GERVMmEwg7cruiW6/aMnF1R9yUshhZrrXr3YUbHOkus+RgsC0xArJec85aLGRfXYtF X-Received: by 2002:a05:6402:17a6:: with SMTP id j6mr853185edy.305.1613092013496; Thu, 11 Feb 2021 17:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613092013; cv=none; d=google.com; s=arc-20160816; b=vi3m1FIG/AzOXsEiCGTqdgfhZ7BjjwF4A2z2CkFPGOXwdg5qmLaSfKYeTw/g3xdFG3 fPFbHurtFfV3bPvCQ/jLVUoGD6Uva4I/lbovltBmhiL8IDXOoblTULbJtOmXUaSkqL/l iEJAW3CPcr0/F+RatV633ttqcX9EM2bK4XbkZGpLFve5w+G823ZSz+K4b0hzM0GCtSUQ IUf0a4Zus+PCgjUp4fieprpZaPPs8VR2coJtR+Kz6cHVWBy5yI+M18zcxGf4TWm/mkUG XTWsDfuNqZLJ/4bEGGHf8B4S2gblOiUVyFUVIKm6NpNYYxymOoZRTpLPy+HgFJCi18hA 4Ixg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=E8dTklfppDgtQ5t+jdmFpUHmiL5MAONXlpGXODd+kf0=; b=PWPrYOmY7u3MqX+Ss3x4cFt42K+xMXoFWbt7oQNU+aAzw8NvPTDN7TwuG1HBjzwRlt PozhoPxoPecmnC+23E2z74javjeoTv7sjch9AkmkUJB4EAxMkpbqNOPU4ZFR7tRcv0la RrNiQMjVbWZT2MBHG5hsj2nInwBP4AcTN48B5AoGlrtoIFyewT9ttMd/IntuPwcw1bS6 7We7tLTTKTbbl4mpeuR6HmHHZ7AGQDGFWbj/KJn6nXZvb2gcoyazv8Z6j9NIPdEjuo+b 4wk+3jVi33OAtJdfgQMBsynYGjRsf3Qvjjkk0C1y1xfDu9OZT5OMHyWQDIXEaK5mIE8j R6IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SorPw2Sc; 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 m15si4888822edc.599.2021.02.11.17.06.30; Thu, 11 Feb 2021 17:06:53 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=SorPw2Sc; 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 S229564AbhBLA7t (ORCPT + 99 others); Thu, 11 Feb 2021 19:59:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbhBLA7t (ORCPT ); Thu, 11 Feb 2021 19:59:49 -0500 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388DCC061574 for ; Thu, 11 Feb 2021 16:59:09 -0800 (PST) Received: by mail-ot1-x333.google.com with SMTP id s107so6992736otb.8 for ; Thu, 11 Feb 2021 16:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E8dTklfppDgtQ5t+jdmFpUHmiL5MAONXlpGXODd+kf0=; b=SorPw2Scef1yOshGti7Inf8DzOeiRsZ7yHSUKsbc8+NXWhPG7zW6N0DoyhxI6UIQNh mayKPkr0QDB6iD4VNbHnqlgheyTykyjR8/q7e4w6T94NDAwfNxEWA95SmJyrzPkWaRRP 13sIzAmOwV6ixC/LwBlXS3oJ47cquyc5yETttJHrDGcTj8myLn377pxQMxqAWlE6CzyH xHgkRcokd3P0ywLLItHIyZBp9MQhc649ifyZu/v3VpdQOi9XLPFydp7JZVvo96aSBbH6 m9JI3H6OhFvjpglhgPpXY6zDoGUkcpexn1f70W2OrhC+GOzZAtx0PpVQRaUUKjI+badu jU7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E8dTklfppDgtQ5t+jdmFpUHmiL5MAONXlpGXODd+kf0=; b=mjEibhoruqfKbFY7IBRl9se5XgO+Yx7yo6EdSLprNA/tkD5x+JSy76pfaP4ZrsGdH+ GeVAx32dyi8LuWzLKAT+RtEKQM563uhnGFGo2Z6rZ589N+YEan5qlpxoZWATC2bJe6Yh t/vX+n7aDWvkFVoKbkun8l4fhium/6HndFMz9eyDesO0e+ky/KUW33SR9bjxDgnap0Gb RHO7tvZErw45hVg8LyHVTPhEwmlQcAv1dqIX524S+cxjhReeLP3YGmmcl9Cu2oD/mumV dheZtgCseKZCgL4otvJgIpXCKxLjpLDuHbBr41YBqpUURZuCc3lRfiwkRMclZ2ul+1sJ e5rA== X-Gm-Message-State: AOAM533eQm7ykYDu1lOQ6ROwtHF34V+ihTDAIktu8gyaLZQEHeGAOdFg Kl/O3sdV7+RCA5JH3sBNGKTeDtTSrZ+mOumWFLnmGw== X-Received: by 2002:a05:6830:902:: with SMTP id v2mr474189ott.56.1613091548340; Thu, 11 Feb 2021 16:59:08 -0800 (PST) MIME-Version: 1.0 References: <20210212003411.1102677-1-seanjc@google.com> <20210212003411.1102677-4-seanjc@google.com> In-Reply-To: <20210212003411.1102677-4-seanjc@google.com> From: Jim Mattson Date: Thu, 11 Feb 2021 16:58:57 -0800 Message-ID: Subject: Re: [PATCH 3/3] KVM: VMX: Allow INVPCID in guest without PCID To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm list , LKML , Babu Moger Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 11, 2021 at 4:34 PM Sean Christopherson wrote: > > Remove the restriction that prevents VMX from exposing INVPCID to the > guest without PCID also being exposed to the guest. The justification of > the restriction is that INVPCID will #UD if it's disabled in the VMCS. > While that is a true statement, it's also true that RDTSCP will #UD if > it's disabled in the VMCS. Neither of those things has any dependency > whatsoever on the guest being able to set CR4.PCIDE=1, which is what is > effectively allowed by exposing PCID to the guest. > > Removing the bogus restriction aligns VMX with SVM, and also allows for > an interesting configuration. INVPCID is that fastest way to do a global > TLB flush, e.g. see native_flush_tlb_global(). Allowing INVPCID without > PCID would let a guest use the expedited flush while also limiting the > number of ASIDs consumed by the guest. > > Signed-off-by: Sean Christopherson I always thought this was a bizarre one-off restriction. Reviewed-by: Jim Mattson