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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 D3AF6C433E9 for ; Thu, 3 Sep 2020 18:33:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B877D20709 for ; Thu, 3 Sep 2020 18:33:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="X94xHdmw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729268AbgICSdD (ORCPT ); Thu, 3 Sep 2020 14:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729235AbgICScr (ORCPT ); Thu, 3 Sep 2020 14:32:47 -0400 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462F5C061244 for ; Thu, 3 Sep 2020 11:32:47 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id u25so3618636otq.6 for ; Thu, 03 Sep 2020 11:32:47 -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=82HbmK1MEBIFmpgC+4ObPuGeXfJ8JE9e+JzzYbyM3tE=; b=X94xHdmwtOXvMxEcdgfpcX4mJtVehcidGAiYCw1Vog/RSDUzgYyod31XsjIavxEQbY 4xEewzsKjrW3iUx+Y62sBhEBrAdv/m7FZfXszs7J7ppNdjEgwUkM6mJRiP3O1DtVpTWz HYV1nQfMyT8IsbhYIy4jmpPqZo/OUsUycK75ro178LPy5svxyfJL9XJsdw0ajeIHttQt C/uOGw/OcqNlCn9lsGsA0E1TMvN2xL+9eXVwwVdA17l/A3hey850rNFp+jSw/F4L9k/r 4P4TRpf8O4VTdBIJ/wIa60c8xQlAi+UZFXizgBr/WhHOwMtMS62EqI0d/HCF1tA20oaO ylpQ== 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=82HbmK1MEBIFmpgC+4ObPuGeXfJ8JE9e+JzzYbyM3tE=; b=Ass/kNg4HrSk42fzF2mLlhmXB5A/rUfgcNpHcrEKEaA92vX0ZFch/lN1Are1E6bIeu 0wZu1kt5mruVOGEGKDqu+//zqpLxwUpajnkvp/8FgJz7EXKIGG2OUqjzfmGMLoTjqufR FVSB0K7DT3Y6oI0yKsF8TJsdmZRlyjbhNe/kd+pbNfDNmtxr3SYDS2+vRDBIO7687Z6J 45T/xSPiSvDJddilczLJbFLbAgGOfnWmaHB1PysW11c6/nBnk4BSrdo9Led/b/tO0JnB K2xLZGXi3KcHgN3lLDPFgm6JcjU6r9mhFGAexNIHqEz12Svbhbz1cawgbHWjyRxsVlPa KwZg== X-Gm-Message-State: AOAM5322GYrIgvSxRLx6FrjbBd8dpGGvOg0ibKPw5PCqT7TjCsvrIqUt I7x9rIAEwAPj8jUXO/osN0IRyJdUdv6mA+fBvtJvlg== X-Google-Smtp-Source: ABdhPJx4FulqrTQ3lfTEcpEmm4pBJFjbKkKsoNqSqromwGpcbyaKjofyMNw2dD4agncvN2jgU3ZkvPOHjE/BxR0dyUo= X-Received: by 2002:a9d:1c8f:: with SMTP id l15mr2563980ota.241.1599157966243; Thu, 03 Sep 2020 11:32:46 -0700 (PDT) MIME-Version: 1.0 References: <20200903141122.72908-1-mgamal@redhat.com> <00b0f9eb-286b-72e8-40b5-02f9576f2ce3@redhat.com> In-Reply-To: <00b0f9eb-286b-72e8-40b5-02f9576f2ce3@redhat.com> From: Jim Mattson Date: Thu, 3 Sep 2020 11:32:34 -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 11:03 AM Paolo Bonzini wrote: > > On 03/09/20 19:57, Jim Mattson wrote: > > On Thu, Sep 3, 2020 at 7:12 AM Mohammed Gamal wrote: > >> This patch exposes allow_smaller_maxphyaddr to the user as a module parameter. > >> > >> Since smaller physical address spaces are only supported on VMX, the parameter > >> is only exposed in the kvm_intel module. > >> Modifications to VMX page fault and EPT violation handling will depend on whether > >> that parameter is enabled. > >> > >> Also disable support by default, and let the user decide if they want to enable > >> it. > > > > I think a smaller guest physical address width *should* be allowed. > > However, perhaps the pedantic adherence to the architectural > > specification could be turned on or off per-VM? And, if we're going to > > be pedantic, I think we should go all the way and get MOV-to-CR3 > > correct. > > That 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? > > 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.