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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF81AC433F5 for ; Mon, 29 Nov 2021 22:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234340AbhK2WTU (ORCPT ); Mon, 29 Nov 2021 17:19:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232793AbhK2WQ5 (ORCPT ); Mon, 29 Nov 2021 17:16:57 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3053C041F40 for ; Mon, 29 Nov 2021 10:23:41 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id iq11so13352489pjb.3 for ; Mon, 29 Nov 2021 10:23:41 -0800 (PST) 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=ieSn6CI4O2ZLeLlECiGDLKzxg/GtHx0Kn0OdLIkrPs8=; b=I42OIB8Tn0Kh3k4AbnHLbuRddHu0E2lCAIKiefyjD2VTpViiDcXGJ02muiwA7dHbX0 pwT+ViUYAviPVahPNOqA0mCXULr8XhFRLJddPEV7xpwj4fcgcCZGiniR04ckN3+UwnzF pdAF7qjoYwgd9RUvYjgn0qJ7IaVWzneCHsFF61+ZqcW9fVBj7K/IAGGiZZ8/FSAYthnZ VQvb61hOqu9UKDG2IGdIgmR4pKokTwA/3tqKmbkDf/0vXHazLzuMopwMN9b82Fqz+19t NddG8U3dNtEcEUJBotClzD5ZWr4gzJwZ+ls1I+dHRKgeOBM2232yGVKwKkJ1lY4lcHdk pPgg== 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=ieSn6CI4O2ZLeLlECiGDLKzxg/GtHx0Kn0OdLIkrPs8=; b=fdZGt99J49oiMe0Ms0MM//Vv7EUVNN+TISYs66BeTfBvwCQcBCFkTWLJhOJYYhnJCy 7rlCutHU7+z+WTJVohAbCwsN9zZ4SdDQ5ayDprsMubSXQrKiCQrDJGCAUCQ5+onaw85D 7nPWr3hsvlaxd1ZX0yBseLjgl6SH+lZReFVyHxHNj1t9yBQ9+2ei/5NA9otetISm/sex aCbq0GN4axRrh++kg9M9GJAaxDkmoakv+4+Qnm0AuU9pLBHL/3MsKQXsxv3mAxWsDJXi 29sjbFK1xRWV+FYOInfPSSbYzIbcfchspiLY4hbF4GjaVQ5f9xrtnoAeP2LiYnUFxN6Q kw2g== X-Gm-Message-State: AOAM530Fwanv41YHvswgLKb/LoXhuwNlnELPUki+OFtir0RLEnZUfN97 awFVQiiAMZHMmyUOxwPH89e9fw== X-Google-Smtp-Source: ABdhPJy0eOYRLQITkw9U0pff+97vxzgm8hmIub7itZ9EEtr3SCgjyDhTUMe2DGGaWbUWbAV6gASeRw== X-Received: by 2002:a17:90a:fd93:: with SMTP id cx19mr30827pjb.190.1638210221054; Mon, 29 Nov 2021 10:23:41 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y4sm19146496pfi.178.2021.11.29.10.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 10:23:40 -0800 (PST) Date: Mon, 29 Nov 2021 18:23:37 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Thomas Gleixner , isaku.yamahata@intel.com, Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , erdemaktas@google.com, Connor Kuehl , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, isaku.yamahata@gmail.com, Sean Christopherson Subject: Re: [RFC PATCH v3 46/59] KVM: VMX: Move register caching logic to common code Message-ID: References: <2f3c1207f66f44fdd2f3eb0809d552f5632e4b41.1637799475.git.isaku.yamahata@intel.com> <87mtlshu66.ffs@tglx> <620e127f-59d3-ccad-e0f6-39ca9ee7098e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <620e127f-59d3-ccad-e0f6-39ca9ee7098e@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 25, 2021, Paolo Bonzini wrote: > On 11/25/21 21:11, Thomas Gleixner wrote: > > > > > > Use kvm_x86_ops.cache_reg() in ept_update_paging_mode_cr0() rather than > > > trying to expose vt_cache_reg() to vmx.c, even though it means taking a > > > retpoline. The code runs if and only if EPT is enabled but unrestricted > > > guest. > > This sentence does not parse because it's not a proper sentence. Heh, supposed to be "... but unrestricted guest is disabled". > > > Only one generation of CPU, Nehalem, supports EPT but not > > > unrestricted guest, and disabling unrestricted guest without also > > > disabling EPT is, to put it bluntly, dumb. > > This one is only significantly better and lacks an explanation what this > > means for the dumb case. > > Well, it means a retpoline (see paragraph before). No, the point being made is that, on a CPU that supports Unrestricted Guest (UG), disabling UG without disabling EPT is really, really stupid. UG requires EPT, so disabling EPT _and_ UG is reasonable as there are scenarios where using shadow paging is desirable. But inentionally disabling UG and enabling EPT makes no sense. It forces KVM to emulate non-trivial amounts of guest code and has zero benefits for anything other than testing KVM itself. > why it one wouldn't create a vt.h header with all vt_* functions. > > Paolo >