Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3715399ybt; Tue, 23 Jun 2020 09:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ63IlPikuExszIM2vlUePpf91++Ol9UaS04B26HUiYChwjWtj3Vgs1OjKIaASY1Rft4Rq X-Received: by 2002:a50:b0a1:: with SMTP id j30mr22706523edd.387.1592928109253; Tue, 23 Jun 2020 09:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592928109; cv=none; d=google.com; s=arc-20160816; b=EKHlAQONYsrXFyAHCb+3sYsTUSj2+1/jU3Mfhkn7h83d/PVVZ4A/YaUuJSLpjTIZhf s+d8hVE7mGdjPD+fq/lNOu1Iyc/+tSUoajO29fpKxsdftS1rYpLjxRr2Y9U/qCbpY6QW sKxZ8TsUKrjA4g4gzm6WyPrt/s5Jc0zPajAKk9h0xSKVbILObfpTjvj1j/zQMlDv1qQ+ CelkoVvyjBB2B0LSaUnSnQ1DmZMYXdUn/Qo9Do02SyWBmtZcz2ewMmEU/ZP3k3vP9t4o S5nRzHY9O3CDFQjsFIz/I3n+8DHPSR5YgXnY4Z3sZ9h9EhACscxmHShmG+YosQebAxgj c2Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=Cz4FuCXnPSDXDqHD2J1GXENCE4lWkguMj0/3PeIE9QM=; b=UTDWSfOpSpcl6YGZI5HRwsDRAv4TDVthrRvYIVsT+x1K5XsBzREC3yN6xQRklMom9M cDRVV1yROOnoaKOFqAJp4rAx08vFuecle/GxFMMJ1VRJOJG0tDry6bgr4x8V89MwEAj0 Vqo8xpV2oH2rNdu1wP02RhyROTq1b7F3XHIwnN7Uv1EGMjUzcyxVaRxe/VH2QF7gK239 Yu4hazrT+sdnuhPHSoBPFEEet4y06yMKx9Z3VQhxxJV2S25gIfQLnM40TOctW5mAbFJW NmnL30oXXmFFjA/WJW22s8Rn0JSRT6gGJofmwXqEq+BUj8P0W80+Y72bTbXLgGzUjSn7 Quiw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si11074349edv.486.2020.06.23.09.01.25; Tue, 23 Jun 2020 09:01:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733049AbgFWP71 (ORCPT + 99 others); Tue, 23 Jun 2020 11:59:27 -0400 Received: from mga07.intel.com ([134.134.136.100]:31599 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731616AbgFWP70 (ORCPT ); Tue, 23 Jun 2020 11:59:26 -0400 IronPort-SDR: JLvwQvHAfJ24nOt7c4x1dL7A7H+/aMZnYu6O3btioplnOvwzRMNyz5slbB22fKC9lf/DlG0sfs g2GhNQv5r0Pw== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="209307529" X-IronPort-AV: E=Sophos;i="5.75,271,1589266800"; d="scan'208";a="209307529" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2020 08:59:22 -0700 IronPort-SDR: iq26dOLKgX3H15tBFZLuja+vdDxalzbD2WF/C0QK3i/G9gmZaftr40VuZiXDtyitN0nWawvHvG 0hDSMJ3QZjKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,271,1589266800"; d="scan'208";a="301299965" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.152]) by fmsmga004.fm.intel.com with ESMTP; 23 Jun 2020 08:59:19 -0700 Date: Tue, 23 Jun 2020 08:59:18 -0700 From: Sean Christopherson To: Peter Feiner Cc: Jon Cargille , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm list , LKML Subject: Re: [PATCH] kvm: x86 mmu: avoid mmu_page_hash lookup for direct_map-only VM Message-ID: <20200623155918.GC23842@linux.intel.com> References: <20200508182425.69249-1-jcargill@google.com> <20200508201355.GS27052@linux.intel.com> <20200623065348.GA23054@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200623065348.GA23054@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 11:53:48PM -0700, Sean Christopherson wrote: > If we do get agressive and zap all children (or if my analysis is wrong), > and prevent the mixed level insansity, then a simpler approach would be to > skip the lookup if the MMU is direct. I.e. no need for the per-VM toggle. > Direct vs. indirect MMUs are guaranteed to have different roles and so the > direct MMU's pages can't be reused/shared. Clarification on the above. Direct and not-guaranteed-to-be-direct MMUs for a given VM are guaranteed to have different roles, even for nested NPT vs. NPT, as nested MMUs will have role.guest_mode=1.