Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp104589pxb; Thu, 12 Aug 2021 11:51:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCL+qj1UKfnSMGowBYmrPl5xvV1Itt/6JNya8lhUdE1nIoffiMhk0y6v0WL2aDkppkDRGk X-Received: by 2002:a05:6638:539:: with SMTP id j25mr4953571jar.69.1628794269402; Thu, 12 Aug 2021 11:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628794269; cv=none; d=google.com; s=arc-20160816; b=w7/oOzB+XT50kt9+xZcbDlsMZlzI0w/Iwwj9oBRThD080jYLGfj7jSLcHASMXJBEFN QzcsP470n/0FSV6q38f55h9vecYyUkZst6L1vtRlbw/q5+FaCHVsstfP5/lIVPah76Ym 98IqQKywcEkRLvC67fRk2T/oXY0QZysfL/NxxIUYPFIGSXYny+GBQojWJ+yD0o01orry BZB/NEW9gRu7U/8kfISiwCL69jXw9iJNCVbzkf69yYF7UvU319K5OXxNw67ICcaO7X0L 8ettrnQ06oZH5KIUBR3KlPo8Dk+mTCG7t6tiPE/HN0cB9g8SFbz36LuaDAd2pN+2VDPv CVSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VzSi7iYmrmtOx5fJEmZOizgBlKohhjrX2as2U2GYhuU=; b=E2UeUauzMMBKh6KxNxRaLYNRAXYU0mOn/jiJUFSaTU7HSPBlSrGGawuyIkZS/q8b18 5v2Zm37Snx0KqwBNtjvL1FqtecWaV3UWoxt1h+VWu0nGZBUwghAZJPhPPnhRUg2EQAMf 2frVeCaF+eFlnDfA5adwemTwkNATVcc2gVUx/D9B+Rmy2qw2Z331Chmlmo4UzKeGQ6qi AyEhzK9iEoeAnXgzKeAWsPL254sKIZsMpULcNscsGDffoIMQyd8DZcgG08t8oXWlcqhf 1z+xTkNJK94osV0go1Zd5ZjaJJgCevlPCbyQJNuY7PD9mO4R1RkKNhxaUbhTZz6+l2XD eVKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Iuy65cd9; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si3659268ilc.155.2021.08.12.11.50.52; Thu, 12 Aug 2021 11:51:09 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=Iuy65cd9; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236433AbhHLRpR (ORCPT + 99 others); Thu, 12 Aug 2021 13:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235535AbhHLRpQ (ORCPT ); Thu, 12 Aug 2021 13:45:16 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D76C061756 for ; Thu, 12 Aug 2021 10:44:50 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id w20so14899539lfu.7 for ; Thu, 12 Aug 2021 10:44:50 -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=VzSi7iYmrmtOx5fJEmZOizgBlKohhjrX2as2U2GYhuU=; b=Iuy65cd9QD+W9oRklapTOl/vGpAt69N7AHt7935VmuWT30nUSkBLsSxbBrjsTXF7sd oQhFyLJbIV4AG5eZxit2x5DDOhwcVnLN4gXvzkbjwnIbNabPvlFuA71xPSVB/kYfVKFN 3/C0/AcMW17FPpO++mCmXAQPCNveA2p+lEPQ+RE4fl7mP2z5PMBkuLhz9LaK9T1XyOd8 Arjc6Jc7Isi4CiCjizQpJFyMBywuVFQInPHSxLqhCpQ9P2Pu3sFJcjGVVVRTG4fub5dI EfYh0w3jsVGTHl0lgFqtJB3dUiFCY89HsoHoe2oUSTV33ExdvvdGg76zfUVgynG7kXuf d8jA== 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=VzSi7iYmrmtOx5fJEmZOizgBlKohhjrX2as2U2GYhuU=; b=GJYNXwJl+O7gklBEEuop0grarCAUGFADgxQkt59DCG5X2caGvQKZoYm58Xod1d0css Qu1GbifSU2dqAkcOdSbUdxJPFmnTMcTs+YoxPFgyEd767RA2+5qakfmAyXAomyxv7o7Q 8PqreffU/NTLfRtms4/HyUeqxzw0ZZXBSDBpTcR7YMOo9dqM/Hldvfw2KGw41aSNQMLn P5JO4LukSNIvfOVMVzFaGm4o7+gLf3vZOgNGAdP3ClvbOABUfpIT5uuaX34ItOEHVPSG IlLyEEILWcB+qydMTDx9ikYn4XXuaapZvckTGYAlv8JXzGonPddPA0TXZuG5AvG74dhP mTig== X-Gm-Message-State: AOAM5324GnBfBXK827UqAdCQ0bwwbj05Z0UWVxQqWD8b4v9DiVgiINk1 EO6i+0n2x8cqpAN2Hq8mNySe9yZH1rN9cOJ0Fi1OCg== X-Received: by 2002:ac2:429a:: with SMTP id m26mr3402699lfh.80.1628790288914; Thu, 12 Aug 2021 10:44:48 -0700 (PDT) MIME-Version: 1.0 References: <20210807134936.3083984-1-pbonzini@redhat.com> In-Reply-To: <20210807134936.3083984-1-pbonzini@redhat.com> From: David Matlack Date: Thu, 12 Aug 2021 10:44:21 -0700 Message-ID: Subject: Re: [PATCH 00/16] KVM: x86: pass arguments on the page fault path via struct kvm_page_fault To: Paolo Bonzini Cc: LKML , kvm list , Isaku Yamahata , Sean Christopherson , Peter Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 7, 2021 at 6:49 AM Paolo Bonzini wrote: > > This is a revival of Isaku's patches from > https://lore.kernel.org/kvm/cover.1618914692.git.isaku.yamahata@intel.com/. > The current kvm page fault handlers passes around many arguments to the > functions. To simplify those arguments and local variables, introduce > a data structure, struct kvm_page_fault, to hold those arguments and > variables. struct kvm_page_fault is allocated on stack on the caller > of kvm fault handler, kvm_mmu_do_page_fault(), and passed around. (I was out of office for the past few days so I'm just getting around to this series now.) Overall it looks good. Thanks for getting it cleaned up and merged into kvm/queue. I'll get Ben's memslot series applied on top of this, do a bit of performance testing, and send it out probably tomorrow or early next week. > > The patches were redone from scratch based on the suggested struct layout > from the review (https://lore.kernel.org/kvm/YK65V++S2Kt1OLTu@google.com/) > and the subjects of Isaku's patches, so I kept authorship for myself > and gave him a "Suggested-by" tag. > > The first two steps are unrelated cleanups that come in handy later on. > > Paolo > > Paolo Bonzini (16): > KVM: MMU: pass unadulterated gpa to direct_page_fault > KVM: x86: clamp host mapping level to max_level in > kvm_mmu_max_mapping_level > KVM: MMU: Introduce struct kvm_page_fault > KVM: MMU: change mmu->page_fault() arguments to kvm_page_fault > KVM: MMU: change direct_page_fault() arguments to kvm_page_fault > KVM: MMU: change page_fault_handle_page_track() arguments to > kvm_page_fault > KVM: MMU: change try_async_pf() arguments to kvm_page_fault > KVM: MMU: change handle_abnormal_pfn() arguments to kvm_page_fault > KVM: MMU: change __direct_map() arguments to kvm_page_fault > KVM: MMU: change FNAME(fetch)() arguments to kvm_page_fault > KVM: MMU: change kvm_tdp_mmu_map() arguments to kvm_page_fault > KVM: MMU: change tdp_mmu_map_handle_target_level() arguments to > kvm_page_fault > KVM: MMU: change fast_page_fault() arguments to kvm_page_fault > KVM: MMU: change kvm_mmu_hugepage_adjust() arguments to kvm_page_fault > KVM: MMU: change disallowed_hugepage_adjust() arguments to > kvm_page_fault > KVM: MMU: change tracepoints arguments to kvm_page_fault > > arch/x86/include/asm/kvm_host.h | 4 +- > arch/x86/kvm/mmu.h | 81 ++++++++++- > arch/x86/kvm/mmu/mmu.c | 241 ++++++++++++++------------------ > arch/x86/kvm/mmu/mmu_internal.h | 13 +- > arch/x86/kvm/mmu/mmutrace.h | 18 +-- > arch/x86/kvm/mmu/paging_tmpl.h | 96 ++++++------- > arch/x86/kvm/mmu/tdp_mmu.c | 49 +++---- > arch/x86/kvm/mmu/tdp_mmu.h | 4 +- > 8 files changed, 253 insertions(+), 253 deletions(-) > > -- > 2.27.0 >