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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 B25AAC433E0 for ; Fri, 12 Feb 2021 01:00:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 723CD64E36 for ; Fri, 12 Feb 2021 01:00:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbhBLA7v (ORCPT ); Thu, 11 Feb 2021 19:59:51 -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-Google-Smtp-Source: ABdhPJwboH2bgMuX2aLA+0ostnowl3Ehax1DZAhkm1wfOYTPGkTXxKvLSaPPwydNjb3E+ZSGF8jwG+s959v/ITGHUbc= 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