Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp854307pxk; Thu, 3 Sep 2020 14:28:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUb6Nc2p6D1989JmVccVFHunsMoc0wVdCuAD4cH9Ff42UWBa9Ux9sYFQaRIi+OPNgR2Fxg X-Received: by 2002:a17:906:cd0d:: with SMTP id oz13mr4175784ejb.212.1599168496506; Thu, 03 Sep 2020 14:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599168496; cv=none; d=google.com; s=arc-20160816; b=XCPeE7/+uysh0B3HLI3bRnevAzMONheKYLft2pGXcq3Yv8/6RA9s4lJ9ZL1r2xL8Be u1qqRegeEmVKOXLfmAZwuGGC1mrNkHzeXl4B8hGUsfFuL3F0w1gPy6EVVDsvdpwfHISy K7bcYvDcJ3Qdp/5lbgnkYWs3WDI9in5WCRWBASvpsZ61/wU23fk07Qk+FPKdiqfhcyhM gz1TjXi0ckYgAvDVnxDsiWzERcQ5595qFmjNjkcbmQax+o5ModyTHB/X3c6uNBRpSlyx poTz+F5Pas3Sr+0gQ2/GzMsOxKHM96nnDl69H7XcXkzznw61/0zvsNR/HqGyQmnWO8s7 wE7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aDDCxUq5LYXZ2vWhxqpUhB793LjuCmYKYt240ziQivQ=; b=pT23RjAYsK51eDEYWP5ROXk2G1L/Czp5ZlzKfEmSSGGdLIQ2PUzndlochACL1dOqf0 iGPOAQfHnxT7WV4XWRqPUSvI8yrtdDx9OSWW4Hk4TvJvzza9jQ/ACswckUgz978plP4o tq3LjG2GbWaDV4/Byjcw8c/Fz1Yl8jgrlCxkUWzPm3dm/W184N//UXVvddWPDspgsQRP xl18dySTkzqDm0L5bNCamM6sYY2RstZAA1J1pig5Nli9vCqcGi2I8K1BufnuHOP6Kqpv N5V/zJtbSoPkotVxBhhqeqn6BP4LxboZeyhbbAcFG5+uyDlVZqRePVx4p9hoymhTPAjm HKaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=flXhhVWW; 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 j17si2611062ejc.26.2020.09.03.14.27.52; Thu, 03 Sep 2020 14:28:16 -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=20161025 header.b=flXhhVWW; 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 S1728573AbgICV1L (ORCPT + 99 others); Thu, 3 Sep 2020 17:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgICV1K (ORCPT ); Thu, 3 Sep 2020 17:27:10 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF60C061244 for ; Thu, 3 Sep 2020 14:27:10 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id i4so4099666ota.2 for ; Thu, 03 Sep 2020 14:27:10 -0700 (PDT) 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=aDDCxUq5LYXZ2vWhxqpUhB793LjuCmYKYt240ziQivQ=; b=flXhhVWWhNBcfgPFbSoJ7dRSwbXxNizmHPAIsj23YZlfVwoSOJdwd5cRtKavfCouWo ynjvydUPvgYTL72rYUDSEbEd+Vzau4WHprxZpoQV9g7eFZa1EBIGOQyQ6U2uQnGN5/fS d8tfxntyw2vjR8R+0DZQ5NaSRVjpBg8C0wnKWar0sLTieE9H0IQny3afACakGvDkrBZR PTWaE1JTL3PB3q9pqGZ6lse9sHpU7bwSCKMmjcFNWCLnifratRe2rKUMB7JArDUfOIjk Qx2eU3pbiFUdNndcypC9C4tlblWlaaKEcNsP2EMz9i2ARTFjJRiL7PjzPXeCY+c2IjZE XbMg== 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=aDDCxUq5LYXZ2vWhxqpUhB793LjuCmYKYt240ziQivQ=; b=mO0+9tB0K8eDaSOAqkRHwcG337vMYbh9chbEMZcsQv7705Op5wBki9fidVRlWsypmJ o61Ch6zesI8UywBxxSxgRrVTsGLfk3BULA+NbLQsSQ2LNwR0rW2Kg1W7bJ60jHtzIZeg IO+5NfnQD5b/4wem3jjcNlsaAtWjesDLDPuETCwqakOsMM6cWwo43dOFjGEZSbv87xcx DZActMbOAXx3Z6GaY0R2FjzptOENIZWL5Erw9Mz0fWEWi4sLXvE9BuPhn/LOHdDeMO3s oe0Kt2yTCN2/x9Xe6VBoAz0EHlTY3nputamYUkwXrrn74+aVns3ZlTYsg1fOMUEuoB9C mFxA== X-Gm-Message-State: AOAM533E9Waj5tXctajqJr762Cp2QQ50xq6u/utb/ptJdbp2f/pVXKrX 4G+TGhl4hijNrmFULK+PWvy4m1Z7+lh9WP/PrEC4PQ== X-Received: by 2002:a9d:1c8f:: with SMTP id l15mr3111739ota.241.1599168429267; Thu, 03 Sep 2020 14:27:09 -0700 (PDT) MIME-Version: 1.0 References: <20200903141122.72908-1-mgamal@redhat.com> <00b0f9eb-286b-72e8-40b5-02f9576f2ce3@redhat.com> <208da546-e8e3-ccd5-9686-f260d07b73fd@redhat.com> In-Reply-To: <208da546-e8e3-ccd5-9686-f260d07b73fd@redhat.com> From: Jim Mattson Date: Thu, 3 Sep 2020 14:26:57 -0700 Message-ID: Subject: Re: [PATCH] KVM: x86: VMX: Make smaller physical guest address space support user-configurable To: Paolo Bonzini Cc: Mohammed Gamal , kvm list , LKML , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 3, 2020 at 1:02 PM Paolo Bonzini wrote: > > On 03/09/20 20:32, Jim Mattson wrote: > >> [Checking writes to CR3] would be way too slow. Even the current > >> trapping of present #PF can introduce some slowdown depending on the > >> workload. > > > > Yes, I was concerned about that...which is why I would not want to > > enable pedantic mode. But if you're going to be pedantic, why go > > halfway? > > Because I am not sure about any guest, even KVM, caring about setting > bits 51:46 in CR3. > > >>> Does the typical guest care about whether or not setting any of the > >>> bits 51:46 in a PFN results in a fault? > >> > >> At least KVM with shadow pages does, which is a bit niche but it shows > >> that you cannot really rely on no one doing it. As you guessed, the > >> main usage of the feature is for machines with 5-level page tables where > >> there are no reserved bits; emulating smaller MAXPHYADDR allows > >> migrating VMs from 4-level page-table hosts. > >> > >> Enabling per-VM would not be particularly useful IMO because if you want > >> to disable this code you can just set host MAXPHYADDR = guest > >> MAXPHYADDR, which should be the common case unless you want to do that > >> kind of Skylake to Icelake (or similar) migration. > > > > I expect that it will be quite common to run 46-bit wide legacy VMs on > > Ice Lake hardware, as Ice Lake machines start showing up in > > heterogeneous data centers. > > If you'll be okay with running _all_ 46-bit wide legacy VMs without > MAXPHYADDR emulation, that's what this patch is for. If you'll be okay > with running _only_ 46-bit wide VMs without emulation, you still don't > need special enabling per-VM beyond the automatic one based on > CPUID[0x8000_0008]. Do you think you'll need to enable it for some > special 46-bit VMs? Yes. From what you've said above, we would only want to enable this for the niche case of 46-bit KVM guests using shadow paging. I would expect that to be a very small number of VMs. :-)