Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp4149288pxm; Tue, 1 Mar 2022 12:19:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFyB33vW40bm9M7BU4KQTPX+D0Qlg+bBGXmTglToe2+C9RWlHeX8McfZdRrXorWjcUrBBd X-Received: by 2002:a17:907:250d:b0:6d6:e342:be1e with SMTP id y13-20020a170907250d00b006d6e342be1emr4569777ejl.337.1646165989070; Tue, 01 Mar 2022 12:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646165989; cv=none; d=google.com; s=arc-20160816; b=ksvxUeRYEcw2kHyoQgsD5Cwg0eHx6Om8FvCszxIPrf7x3nG1lnQPqR8pIyr3Kt2ig2 5OjqBJfxywwBR+dgdb6iHZHkdp5rg/6ahHl/mXKAWOfwxRvOIa9s9YQ3cr+eLvU2kpzZ O7JxuzJdrwb0Hu+iS5nHkTUYhnNEo6yc/JaYRJyZfWlu+arT44j4Cr88J5bD2Re0ahdA ViemUFT9Rit26QXi7Vakuyx/30ZZ0B+suGuay5LQsi/YoXmOeFoVWowxL3PlKK73GSOk OVh2UF6/6OYh5FYAVs2JCvSn7egQL+8rWKTR0VdqlgHX80hn1SL+TXc6OCqk86TpSzxU seHw== 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=ZJDZOzPGUsKbLll7llFaQ4OK3orYVysgYCGoUQk0SGM=; b=e83FnFGEpCZE8ugR3gEqGnppPyDiNad6c2YaTcmDDIXrTtjC4Hkb1nJlqAbbCu9pvE Kieyeae9S7GNzEUnHSzlqXhnpHO50SzrDOsK5VycBUMmNRElhKO125H9f52rawFo47CS 6VDXGajgHoa2xkKH0VIt6HeJKvPNy1u/jfnygKXnfftl4D1zB8stxVspT0+zaLb+Dzbp IxNFcKZonWK3e2zs5cnj5SnhNEgUXi0+IN6QfhqF3pTHwIdG0F4JT/rf2DZalD8sIgOg GPzlVjNF6IW6hSj4mDMaWDpRbLbFbLVHraky2zYh0wY+WxcTtieiHdXiZ+Z684vUYIPm r9QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=c1iUK0ez; 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 ej8-20020a056402368800b00410a4fac7adsi9666360edb.283.2022.03.01.12.19.25; Tue, 01 Mar 2022 12:19:49 -0800 (PST) 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=c1iUK0ez; 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 S236339AbiCARJo (ORCPT + 99 others); Tue, 1 Mar 2022 12:09:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236321AbiCARJm (ORCPT ); Tue, 1 Mar 2022 12:09:42 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40CEC1B7BC for ; Tue, 1 Mar 2022 09:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646154540; 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=ZJDZOzPGUsKbLll7llFaQ4OK3orYVysgYCGoUQk0SGM=; b=c1iUK0ezcxC/wUM6QytAgC3gUT/TASo7/VPV5oJDyMZlmf6pqMRw0n1DgHm6FNVFQCr8hi DxDGcUakqFQCQbRDFRF674pQYerIkNNVCnObI06p8lGQTwmyGTjpNu+kt67TZ6rt4jn995 b5lwzFz7/8AOigF5zsq3F0Jq+otOKwE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-UAKtXMddNJO_IP8ciOO88Q-1; Tue, 01 Mar 2022 12:08:58 -0500 X-MC-Unique: UAKtXMddNJO_IP8ciOO88Q-1 Received: by mail-wm1-f72.google.com with SMTP id r206-20020a1c44d7000000b00380e36c6d34so1082503wma.4 for ; Tue, 01 Mar 2022 09:08:58 -0800 (PST) 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=ZJDZOzPGUsKbLll7llFaQ4OK3orYVysgYCGoUQk0SGM=; b=Ft+7JsN541O81oCqCj3NRbnx4j4MtbjjcDWC9K9mPiKQMfc1KEtI/2yowRTXygw6kx 1jFuAIGT+qIwbxdEGjrw74DghDqx+Av56a783Qa0txNqQvWfzL7VHEMn4FNmYTyFr51M KSjoPUr/yfNihJwCptA+A3HrvKGO6buYoc/mfLu4DK2atA7FsHkmzf2pOO63wzEPiJn7 ZTg94FCYLJAEqO4abPqv0yKPxwKT9c626cIDKkAX5VYNM2Nz+m8TVjzxj81Cl6ggEESR IaGB/jNVfzqL90/ywUWLhOMzZTsQn0mdn49o2UHQobpwem4gv84VoXCf3UZGfCddYgIu aQ+A== X-Gm-Message-State: AOAM530XcjapmE3mLEkJj5i9DNWPJ+QtsruTr+kkE4CvGbrRWr/RsAku cGJrCVcgRYC5ITOyIvFMhkbgrh+LtsofMS1UERDkBQSM7qXOHi2KATyPEw+0BA1Yq5cJJ7RZUpQ oV9exspD+71ugql9yWiwFuyiG X-Received: by 2002:a05:600c:4ed0:b0:37b:e983:287b with SMTP id g16-20020a05600c4ed000b0037be983287bmr17602647wmq.156.1646154537126; Tue, 01 Mar 2022 09:08:57 -0800 (PST) X-Received: by 2002:a05:600c:4ed0:b0:37b:e983:287b with SMTP id g16-20020a05600c4ed000b0037be983287bmr17602614wmq.156.1646154536842; Tue, 01 Mar 2022 09:08:56 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.googlemail.com with ESMTPSA id m2-20020adff382000000b001f022ef0375sm1306419wro.102.2022.03.01.09.08.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Mar 2022 09:08:56 -0800 (PST) Message-ID: <90363e5c-e21c-16cc-7ed1-59e3f73d9a87@redhat.com> Date: Tue, 1 Mar 2022 18:08:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 0/7] KVM: x86/mmu: Zap only obsolete roots on "reload" Content-Language: en-US To: Sean Christopherson , Christian Borntraeger , Janosch Frank Cc: David Hildenbrand , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Gardon , Lai Jiangshan References: <20220225182248.3812651-1-seanjc@google.com> From: Paolo Bonzini In-Reply-To: <20220225182248.3812651-1-seanjc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 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,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 2/25/22 19:22, Sean Christopherson wrote: > For all intents and purposes, this is an x86/mmu series, but it touches > s390 and common KVM code because KVM_REQ_MMU_RELOAD is currently a generic > request despite its use being encapsulated entirely within arch code. > > The meat of the series is to zap only obsolete (a.k.a. invalid) roots in > response to KVM marking a root obsolete/invalid due to it being zapped. > KVM currently drops/zaps all roots, which, aside from being a performance > hit if the guest is using multiple roots, complicates x86 KVM paths that > load a new root because it raises the question of what should be done if > there's a pending KVM_REQ_MMU_RELOAD, i.e. if the path _knows_ that any > root it loads will be obliterated. > > Paolo, I'm hoping you can squash patch 01 with your patch it "fixes". > > I'm also speculating that this will be applied after my patch to remove > KVM_REQ_GPC_INVALIDATE, otherwise the changelog in patch 06 will be > wrong. Queued, thanks. Paolo > v2: > - Collect reviews. [Claudio, Janosch] > - Rebase to latest kvm/queue. > > v1: https://lore.kernel.org/all/20211209060552.2956723-1-seanjc@google.com > > Sean Christopherson (7): > KVM: x86: Remove spurious whitespaces from kvm_post_set_cr4() > KVM: x86: Invoke kvm_mmu_unload() directly on CR4.PCIDE change > KVM: Drop kvm_reload_remote_mmus(), open code request in x86 users > KVM: x86/mmu: Zap only obsolete roots if a root shadow page is zapped > KVM: s390: Replace KVM_REQ_MMU_RELOAD usage with arch specific request > KVM: Drop KVM_REQ_MMU_RELOAD and update vcpu-requests.rst > documentation > KVM: WARN if is_unsync_root() is called on a root without a shadow > page > > Documentation/virt/kvm/vcpu-requests.rst | 7 +- > arch/s390/include/asm/kvm_host.h | 2 + > arch/s390/kvm/kvm-s390.c | 8 +-- > arch/s390/kvm/kvm-s390.h | 2 +- > arch/x86/include/asm/kvm_host.h | 2 + > arch/x86/kvm/mmu.h | 1 + > arch/x86/kvm/mmu/mmu.c | 83 ++++++++++++++++++++---- > arch/x86/kvm/x86.c | 10 +-- > include/linux/kvm_host.h | 4 +- > virt/kvm/kvm_main.c | 5 -- > 10 files changed, 90 insertions(+), 34 deletions(-) > > > base-commit: f4bc051fc91ab9f1d5225d94e52d369ef58bec58