Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6252309pxv; Thu, 29 Jul 2021 09:53:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPDL0u92XrnC9Kk8waL7yCvQrYB7THk700SfL/J2BawAo2gC0SudnEUHlzDV+sdBW3xvg6 X-Received: by 2002:a05:6402:cb9:: with SMTP id cn25mr6475077edb.271.1627577606512; Thu, 29 Jul 2021 09:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627577606; cv=none; d=google.com; s=arc-20160816; b=U9E23oTsiSZaEfnjSBxgFMHzoGobLXz4+Jxk97esIR4sZ/chRzlrI622tMmCXSX7bW U93egwEL9QyXGGuHkWC8o3gSPmA9t3i+QG0KKX8qdiBrb/06pBrHMp16W6tRMw4sIVIK k+wUuG8OfSlBv0j//xOSbc+iXQmheW+0ebahOXuHX9BimAeef861u4HPqVij2o7eirGE ymbYc9UPVnTXXiP57/DJAbnFFgCS7ssOSXbsvc/3rMY5i0Xy+/+MiFNgf/uBn+Pf5hqX PCITXF69OH1y8ksccyoNnQz6BbTFJhDLeHyh/BVC1iCUPKIqLZhJCqHAr60+a8nqhslC oZSw== 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=DXZNKuVHbOtsiclPBWnL4uJr8QcRCA2WFLB0EDrIQss=; b=ZRmmszBS0ismAoOMBfjKrC1j7Rq4IX0DAXBUFlg4hPOC2kBnCJ9Sx20hmS5wRnP1Pc LoIhJZlu7rNWF+vsPLfrwZb3DnzPCg8nyDHp7gCzvwuzuWpqrafi7DEsSj/i8MuckozM mmX31mag5eRvubjEVBAQpg8ZnroMZWEc9sx5ndopd9GTq03ZdmRl7LW4IBo+VQrUU7lz pkPzZ451/gQbUfHev1OEu97RUHkBATAmGAiB7iA4+FZQrKwIL1VTYnOZoKa9BW34Eqb5 jl4qn8LlSdun+yvRacGKuAZ+SBRULU3ZIVZfyta0moIVnVILqaPYRygRfowR06VODP/w DObA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MLzJm6zG; 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 t12si3847759edc.179.2021.07.29.09.53.02; Thu, 29 Jul 2021 09:53:26 -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=MLzJm6zG; 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 S229922AbhG2QtQ (ORCPT + 99 others); Thu, 29 Jul 2021 12:49:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbhG2QtF (ORCPT ); Thu, 29 Jul 2021 12:49:05 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 837FDC0613C1 for ; Thu, 29 Jul 2021 09:48:59 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id a26so12166090lfr.11 for ; Thu, 29 Jul 2021 09:48:59 -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=DXZNKuVHbOtsiclPBWnL4uJr8QcRCA2WFLB0EDrIQss=; b=MLzJm6zGo5s1C/yn5QoO8wdaLFYGAObntZbeF/pK53U5+/cpCYl3DeJy3QdkAdZfFB E9qE8e2p+WNuj/RE/UB3O2ywhfpfe655Q2VHgR4hyvt8lFGIkVaAXP2S2fxLJFFhVq7C ujWROOX5VLnf+ENc3YnRGqguAibtEUiYkvlvF/t6Iiug+f4ZrdgxsE3Tr7BWWS7Fw6Gr vESLZGzELlK4RyKo4sQWK6/i9JvjrVeL2RB6xWzw0+GInnoKTPkD3XNbPAY5IH1gXGU4 ElMOMmO28CgO+QPlE+Jvd1eZPP26gt9ey4VECPBrJdmwn8q0NNz6w1si+rYVx8BN1Rrv LqTA== 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=DXZNKuVHbOtsiclPBWnL4uJr8QcRCA2WFLB0EDrIQss=; b=QuDF4/ZzEgU4Uo1C20ZriNdA33sQZyvRh0nxxD4VnJBfyCimTpcM89ZmNQ8Zli6SZy EH20LsUYQ0qDypPB/Tk9c5WbIXRKrdLVswU3K3JLOsyE1d7T/LUYIOwSugXCn9+2ecHu 6+TPjTPSRq6mQdxlH9EePzIx7vXRkwsUTEcONy7T4GN8upCPzMXFpa9jcKOFYaFrripM mWdpvBzg4CmeoM2HJD/tXdsOtQ19zb+pT+fY9LADbpiiwtM3QyYmyodqfcrVeiLbgj68 Z8nsJfF+AX08OpcSOzSYs6R8fr0nQd+6Pk+f6WnT1z7hNvOCD1bVzmmoXwK8CXem8Cd4 haMw== X-Gm-Message-State: AOAM533rvZldwoAUQ0YEy99YMpiy96bpSnUlY3rhmANG6eo3Po+Hym+Z 3XL6uGndGDuEPBgWtUlWxcd7a++7SAdRt14pknNHig== X-Received: by 2002:a05:6512:128e:: with SMTP id u14mr4336224lfs.483.1627577337579; Thu, 29 Jul 2021 09:48:57 -0700 (PDT) MIME-Version: 1.0 References: <936b00e2-1bcc-d5cc-5ae1-59f43ab5325f@redhat.com> <20210610220056.GA642297@private.email.ne.jp> In-Reply-To: <20210610220056.GA642297@private.email.ne.jp> From: David Matlack Date: Thu, 29 Jul 2021 09:48:31 -0700 Message-ID: Subject: Re: [RFC PATCH 00/10] KVM: x86/mmu: simplify argument to kvm page fault handler To: Isaku Yamahata Cc: Paolo Bonzini , Sean Christopherson , Isaku Yamahata , kvm list , LKML , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 3:05 PM Isaku Yamahata wrote: > > Thanks for feedback. Let me respin it. Hi Isaku, I'm working on a series to plumb the memslot backing the faulting gfn through the page fault handling stack to avoid redundant lookups. This would be much cleaner to implement on top of your struct kvm_page_fault series than the existing code. Are you still planning to send another version of this series? Or if you have decided to drop it or go in a different direction? > > On Thu, Jun 10, 2021 at 02:45:55PM +0200, > Paolo Bonzini wrote: > > > On 26/05/21 23:10, Sean Christopherson wrote: > > > - Have kvm_mmu_do_page_fault() handle initialization of the struct. That > > > will allow making most of the fields const, and will avoid the rather painful > > > kvm_page_fault_init(). > > > > > > - Pass @vcpu separately. Yes, it's associated with the fault, but literally > > > the first line in every consumer is "struct kvm_vcpu *vcpu = kpf->vcpu;". > > > > > > - Use "fault" instead of "kpf", mostly because it reads better for people that > > > aren't intimately familiar with the code, but also to avoid having to refactor > > > a huge amount of code if we decide to rename kvm_page_fault, e.g. if we decide > > > to use that name to return fault information to userspace. > > > > > > - Snapshot anything that is computed in multiple places, even if it is > > > derivative of existing info. E.g. it probably makes sense to grab > > > > I agree with all of these (especially it was a bit weird not to see vcpu in > > the prototypes). Thanks Sean for the review! > > > > Paolo > > > > -- > Isaku Yamahata