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 74294C433FE for ; Wed, 9 Feb 2022 17:16:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237191AbiBIRQN (ORCPT ); Wed, 9 Feb 2022 12:16:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbiBIRQJ (ORCPT ); Wed, 9 Feb 2022 12:16:09 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A4EBC0613C9 for ; Wed, 9 Feb 2022 09:16:13 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id i30so5388624pfk.8 for ; Wed, 09 Feb 2022 09:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OS/vYOaEcHltj8pU0RU1HWmOJM4B0kiaQM88fHj6Yl0=; b=hmlScaG/MxxcGv/Ce3Q4Oi9usYARksWWYafzDMafamI2qghv/S0/M4+43akD8WMij2 efXyMsqUtMgbmaz06fwBdZIlcl4RcHgu0W4zBpPwECH/FmNeJsFmH1nNhiwLwO0kFnRd 3iYQgsDZT4n3wg9BplUVExDHt5mw2okNzzUyebjeCYcuCTB+TPqZr9JcO+vp4eLdIH2V s6nzk6+CA+HLokzqv0s96cGozIqi0Su0pNUGwIeo4ehZX6IuMnjbY7ju6Kg/1al0JiuP V9oiitH4w/5+6jSVY14WjRjYFTINblj83m87TfnsjlbkgXEXSRsthZ5rIrJF7/Mpig2t ciUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OS/vYOaEcHltj8pU0RU1HWmOJM4B0kiaQM88fHj6Yl0=; b=5AAdzMSuy569Q2np4u4oWAfkHoltWEA5mv5zgRixFCWkLpHvo7lt8B+aIuHEg5zDfo PE6r/A5rCWtz0xPuOICzl1AI4N87JhxDtaGpxoL/0XluPcaRnTmd0v/o5oNTvA06/bex SztFWIzhRoR4CtRQ3VA4gI1MaKb5Sz9heqRYnbfxeYo5s1H5qeCMKZzUzIpHOLlPDA0P YmEV48AYerIEFDEe46qKMIpusFz4HDMGakTiKxv67wBRQR4dJZfl5qq3A+Z3jpqF8Nwj 1QS+W0F6jlwaIGU8+nUJlK5+HOOBHSX2k8xrlgEIBd4Kj++t4zTOWtJdwooCl/A/1aas jcFA== X-Gm-Message-State: AOAM532bhUN64fcl09AsXvwLXWlBeKJV7L+YiylQhktmWNqGjLZXVuWO VQoO20XWORYv7r7IPZ44bKIySg== X-Google-Smtp-Source: ABdhPJx8SCWRZTEmqxObdVShTYrZp66VDixB774iK68T4PYn/ZZtmlUWHXx0vQ8kdvJJiRwTXP0w4Q== X-Received: by 2002:a63:b207:: with SMTP id x7mr2638660pge.392.1644426972381; Wed, 09 Feb 2022 09:16:12 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id q1sm3926434pfs.112.2022.02.09.09.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 09:16:11 -0800 (PST) Date: Wed, 9 Feb 2022 17:16:08 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, vkuznets@redhat.com, mlevitsk@redhat.com, dmatlack@google.com Subject: Re: [PATCH 00/12] KVM: MMU: do not unload MMU roots on all role changes Message-ID: References: <20220209170020.1775368-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 09, 2022, Paolo Bonzini wrote: > On 2/9/22 18:07, Sean Christopherson wrote: > > On Wed, Feb 09, 2022, Paolo Bonzini wrote: > > > The TDP MMU has a performance regression compared to the legacy MMU > > > when CR0 changes often. This was reported for the grsecurity kernel, > > > which uses CR0.WP to implement kernel W^X. In that case, each change to > > > CR0.WP unloads the MMU and causes a lot of unnecessary work. When running > > > nested, this can even cause the L1 to hardly make progress, as the L0 > > > hypervisor it is overwhelmed by the amount of MMU work that is needed. > > > > FWIW, my flushing/zapping series fixes this by doing the teardown in an async > > worker. There's even a selftest for this exact case :-) > > > > https://lore.kernel.org/all/20211223222318.1039223-1-seanjc@google.com > > I'll check it out (it's next on my list as soon as I finally push > kvm/{master,next}, which in turn was blocked by this work). No rush, I need to spin a new version (rebase, and hopefully drop unnecessarily complex be3havior). > But not zapping the roots is even better No argument there :-)