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 99979C001DF for ; Sat, 22 Jul 2023 01:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbjGVB23 (ORCPT ); Fri, 21 Jul 2023 21:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbjGVB21 (ORCPT ); Fri, 21 Jul 2023 21:28:27 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 051673AA7 for ; Fri, 21 Jul 2023 18:28:26 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1b8a7735231so13208885ad.1 for ; Fri, 21 Jul 2023 18:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689989305; x=1690594105; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1aVuOJi4p6R+oWVqYM04BRjT7YTKinYLVZF7mVB27JU=; b=53nMhtDHVrBhZrfs0o3fbYfzq59/6d2VisNdxNl7flD7JzyzeaXlCYtwk004G2feNg X62ufNG8xZSBzynjAkIhuU1d9Nloet8/0U1t/jQiuDPmPawkss3TeIedq6VFvzy1zyL6 NVMnal+DQ14XXTlipiy4PWOnti2wOnhc+CNXHmZxRXwmKueTowtBIWCaGRJaRhy+KIkO wDdtE0FmI3Lx9xMqRF3X+sWYMAWefeJfitD9xzd6dB3CrHo71hy6w7CcfGZ0Z258LYhW RkXbIL1E0B2TcLMuKigvhXoE2cOH+rnls/2XeqCa9GORldosDTev7dwH8nRn+LbjUAy/ dfhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689989305; x=1690594105; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1aVuOJi4p6R+oWVqYM04BRjT7YTKinYLVZF7mVB27JU=; b=hEqgS/LOrjtQKcIqsdK+zN5JL3js8OnEeO++liTiZd78bynHs6EPxC0o9tSS5rKqrO yoJer3TUNNznVZojH4w9+YSctI4PzvJXMsJFgxErUNHGurGxQtmjywGoUfzdu7kwXjhI z0UrIYe+hcadfDDavExohFCXvNSpk6z0iinRKFbt4EW5F5p0JJPK1tkJ8BWyTWirrDA8 bTUL2bgScT3PQcVV4q8A7OyvxRB48UuxxRNTvf0hsXv+dybNyQlbPeuFE3uxR7shODg9 BDQOIOmIvGdrGybZYO3CrwMcv7U+3G89TOKCCJ3ZYlxVBXbth0BMD9666vBwMGZeX1/3 KgLw== X-Gm-Message-State: ABy/qLZMsNKOLcHk2f4mmk5i161zK9/g9PqIJVJCpaJaOUqL7qrH87Mk Tqkt2fqE4ssDqA7mSCO/P+8MKP09rws= X-Google-Smtp-Source: APBJJlE5fyTLe8Av8vgAjnpGC6KaeaXF544cF46Nyy6GjtO1N4mJgdsCJ4OwDt2AWBBCyC+TlcrUexSYPdQ= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:cece:b0:1bb:1ffd:5cc8 with SMTP id d14-20020a170902cece00b001bb1ffd5cc8mr15856plg.11.1689989305504; Fri, 21 Jul 2023 18:28:25 -0700 (PDT) Date: Fri, 21 Jul 2023 18:28:23 -0700 In-Reply-To: <5caef6bf-c3da-5928-32c9-54d6e42511ec@linux.intel.com> Mime-Version: 1.0 References: <20230606091842.13123-1-binbin.wu@linux.intel.com> <20230606091842.13123-4-binbin.wu@linux.intel.com> <5caef6bf-c3da-5928-32c9-54d6e42511ec@linux.intel.com> Message-ID: Subject: Re: [PATCH v9 3/6] KVM: x86: Virtualize CR3.LAM_{U48,U57} From: Sean Christopherson To: Binbin Wu Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, chao.gao@intel.com, kai.huang@intel.com, David.Laight@aculab.com, robert.hu@linux.intel.com Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 03, 2023, Binbin Wu wrote: > > On 6/29/2023 1:40 AM, Sean Christopherson wrote: > > On Wed, Jun 28, 2023, Binbin Wu wrote: > > > > > > On 6/28/2023 7:40 AM, Sean Christopherson wrote: > > > > I think I'd prefer to drop this field and avoid bikeshedding the name entirely. The > > > > only reason to effectively cache "X86_CR3_LAM_U48 | X86_CR3_LAM_U57" is because > > > > guest_cpuid_has() is slow, and I'd rather solve that problem with the "governed > > > > feature" framework. > > > Thanks for the suggestion. > > > > > > Is the below patch the lastest patch of "governed feature" framework > > > support? > > > https://lore.kernel.org/kvm/20230217231022.816138-2-seanjc@google.com/ > > Yes, I haven't refreshed it since the original posting. > > > > > Do you have plan to apply it to kvm-x86 repo? > > I'm leaning more and more towards pushing it through sooner than later as this > > isn't the first time in recent memory that a patch/series has done somewhat odd > > things to workaround guest_cpuid_has() being slow. I was hoping to get feedback > > before applying, but that's not looking likely at this point. > Hi Sean, > > I plan to adopt the "KVM-governed feature framework" to track whether the > guest can use LAM feature. > Because your patchset is not applied yet, there are two ways to do it. Which > one do you prefer? > > Option 1: > Make KVM LAM patchset base on your "KVM-governed feature framework" > patchset. > > Option 2: > Temporarily add a bool in kvm_vcpu_arch as following, and use the bool > "can_use_lam" instead of guest_can_use(vcpu, X86_FEATURE_LAM). > And provide a cleanup patch to use "KVM-governed feature framework", which > can be applied along with or after your patchset. Sorry for not responding. I was hoping I could get v2 posted before advising on a direction, but long story short, I made a few goofs and got delayed (I won't get v2 out until next week). Belatedly, either option is fine by me (I see you posted v10 on top of the governed feature stuff). Thank! And again, sorry.