Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1576560iob; Fri, 29 Apr 2022 08:14:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1Q/4y6bsQTBJg0DpCD38y25u19CSMKuT79OHW1WS+2iffECIuMOhyUFyTKURsGl11aeGN X-Received: by 2002:a65:60c1:0:b0:39d:9c28:909a with SMTP id r1-20020a6560c1000000b0039d9c28909amr32564513pgv.352.1651245256871; Fri, 29 Apr 2022 08:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651245256; cv=none; d=google.com; s=arc-20160816; b=z+O0nwU/ocKQ17lKWflc7fInhvwOd97U9HENTqMkhbIZVYtkF3L3p8MPW643BcmUSj n06QlbP510fJrGg4JTaO/dQ5CA8f6DMHsroJQekgxADx9M2Qax2DkXxhoACuvXpKPApn tUZ31GajT16YorQQO5q+HXmzld9AGVxz5zJqy31CJDENYC0ntAQPCXL+7cOc2gu+aLRH G+mPzbm6+3DhfEpq5X2hzK5XFAu1SD+RhscnpQFlAg3nHoP+p7JQYNdAL2X+qPUc+Si0 hRQwrIIOB5VNi5scQb8zPSNax0XpW64dLbYD/bePT+DxikDn8Dr9A/m1NRwcMSsIRqar hmiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=R/HIMZ6Oktz/QstIS528YwovKn42Z3tRqotPYo1Io2Q=; b=kv6FPn4bBCSnC9c//H8BL+HYON1gPwm0xH+XkhGpzPnEFdaJkxolDbuTNymKjr/jzm sFXQAWtAC4NrSK9AzVcTv+z4S8KUjMIsVCzM7hEMV8AdkwAkTZ07RWDnPvubZvWuhctF f/8Z0Uo7g3sMpVG0UkY1CbgzHcuG7FLy4nQtWybXbcw2C08N6Xspi31TXnK6Jhfr69ja /FdX+ez2Dyw3MiLrVYEoLB9S8Mj0k9qf6mWOOVI/CLk4lS8mjecZ8CCIcnVk3Z/zOE4r vGbMLDPmaYFH6ka3VBqplZHSHe2ilLTpFYr8jFktmH5i4YL5L+Mr3cIWW/bk+DcPZ9Bm Tk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WLl1K1Bq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a056a0021c800b0050d96e21e36si5526561pfj.173.2022.04.29.08.13.57; Fri, 29 Apr 2022 08:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WLl1K1Bq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377963AbiD2Oxb (ORCPT + 99 others); Fri, 29 Apr 2022 10:53:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377264AbiD2Ox2 (ORCPT ); Fri, 29 Apr 2022 10:53:28 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8496962BCE for ; Fri, 29 Apr 2022 07:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651243807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R/HIMZ6Oktz/QstIS528YwovKn42Z3tRqotPYo1Io2Q=; b=WLl1K1Bq5tgPHDoWsow9CdZUHVS6cHAkn7FhdMYj9gSH9tJNi4iSZFIv82y0KvDOAypufo mckefnEP99BR0fBkodWca5/hwxVo+0XHbeCjAhJFmS6e7T922Nh9jA4KRbPIdkMSrQ10V8 eAfK/t/ymw+roLL3k0+QSFNCPI5Gn8s= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-379-M3X3tszMNCy_qS1ggAoF8g-1; Fri, 29 Apr 2022 10:50:05 -0400 X-MC-Unique: M3X3tszMNCy_qS1ggAoF8g-1 Received: by mail-ej1-f71.google.com with SMTP id qa34-20020a17090786a200b006f3de9cc704so2816437ejc.3 for ; Fri, 29 Apr 2022 07:50:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=R/HIMZ6Oktz/QstIS528YwovKn42Z3tRqotPYo1Io2Q=; b=wRoBKzRzUdH35/6Na7flyzTa9wJ40afoN/h/zUYZsySykAQmN4krGZiHv6FRgnJxzH 3oyFgSv8EyCkPYixq/Thz80jmKByB1BkvkTBROgyHgy10lLahoFrXzB9c3TkEtnuFSFf yEZM2LzvR68P6hGhXc63q3ds3MHM7YfxoqML9eeC7Knw0LUb+x05qdIVo4UuQ7pCXTmM +wbf0t3+zOcHzuUA4eG8AWQrgjex73SBtACTETUaAKccIlmWRBoWG7RZkDN/QgHsNEaV GTHXvLXpiQOqNQt708eR9Odi4DlRbSYUVdo8X+S1BXMPsrzj2wtDWTYUUEY3SFLoAcBF XdTQ== X-Gm-Message-State: AOAM532uSMJZR0+18HvP3QUL8ktUc9DBaBxtctJYpsWbth4dvTmDajra mPqyz7IEaG7GLFuxG9qjMe7I53nEhuQy3dKxuQnOvr9zlaGLlPZnKwmT+EhohnhG0PQYPgP6D9Q jOu5DqyOReLBO6eEXj+uaLOZb X-Received: by 2002:a17:906:2883:b0:6e8:7012:4185 with SMTP id o3-20020a170906288300b006e870124185mr36210391ejd.204.1651243803839; Fri, 29 Apr 2022 07:50:03 -0700 (PDT) X-Received: by 2002:a17:906:2883:b0:6e8:7012:4185 with SMTP id o3-20020a170906288300b006e870124185mr36210371ejd.204.1651243803634; Fri, 29 Apr 2022 07:50:03 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:1c09:f536:3de6:228c? ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.googlemail.com with ESMTPSA id qz24-20020a170907681800b006f3ef214de0sm706876ejc.70.2022.04.29.07.50.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Apr 2022 07:50:03 -0700 (PDT) Message-ID: Date: Fri, 29 Apr 2022 16:50:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] KVM: x86/mmu: Do not create SPTEs for GFNs that exceed host.MAXPHYADDR Content-Language: en-US To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Maxim Levitsky , Ben Gardon , David Matlack References: <20220428233416.2446833-1-seanjc@google.com> <337332ca-835c-087c-c99b-92c35ea8dcd3@redhat.com> <20e1e7b1-ece7-e9e7-9085-999f7a916ac2@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/29/22 16:42, Sean Christopherson wrote: > On Fri, Apr 29, 2022, Paolo Bonzini wrote: >> On 4/29/22 16:24, Sean Christopherson wrote: >>> I don't love the divergent memslot behavior, but it's technically correct, so I >>> can't really argue. Do we want to "officially" document the memslot behavior? >>> >> >> I don't know what you mean by officially document, > > Something in kvm/api.rst under KVM_SET_USER_MEMORY_REGION. Not sure if the API documentation is the best place because userspace does not know whether shadow paging is on (except indirectly through other capabilities, perhaps)? It could even be programmatic, such as returning 52 for CPUID[0x80000008]. A nested KVM on L1 would not be able to use the #PF(RSVD) trick to detect MMIO faults. That's not a big price to pay, however I'm not sure it's a good idea in general... Paolo > >> but at least I have relied on it to test KVM's MAXPHYADDR=52 cases before >> such hardware existed. :) > > Ah, that's a very good reason to support this for shadow paging. Maybe throw > something about testing in the changelog? Without considering the testing angle, > it looks like KVM supports max=52 for !TDP just because it can, because practically > speaking there's unlikely to be a use case for exposing that much memory to a > guest when using shadow paging. >