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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 393E6C3DA7F for ; Tue, 30 Jul 2024 22:36:08 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=kmM7Tzmb; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WYVSQ43x6z3dBX for ; Wed, 31 Jul 2024 08:36:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=kmM7Tzmb; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--seanjc.bounces.google.com (client-ip=2607:f8b0:4864:20::449; helo=mail-pf1-x449.google.com; envelope-from=3qgqpzgykdf8pb7kg9dlldib.9ljifkrumm9-absifpqp.lwi78p.lod@flex--seanjc.bounces.google.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WYVRf4Mqyz3cVR for ; Wed, 31 Jul 2024 08:35:25 +1000 (AEST) Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-710415c77f8so1529870b3a.2 for ; Tue, 30 Jul 2024 15:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1722378921; x=1722983721; darn=lists.ozlabs.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eSOwPlC4K/K4c1NtKrHXJlP1TgjanOwgNCfxP6XzMYQ=; b=kmM7TzmbEhYff2gm16QukWc6XgqxUlj2ahiLh9D57AtIvQEV27IvL6KFKxzpAxmabi 75yas5mrvw6N4R5d4mkw9nX6kiyuiFsXKDWmP+/TWIHzj9FK3tceTM2QIVQN8pv3gqTW yDRY0GOX+7rjwS4xU0Gi393YWXQrobjPL2BFSbCZ8KhWt6Ki4J11ShkXRc4Wt1y+ZJpj oVLqJ6vzwRdBCOxF3FkTgaiEOHCovc6aKRa58ohLHaUP55zgd4inqVZSE+ydbw6mImV0 OgudfgIEDCh36RnsnWOa9K/3ciQ99fjErfrpXbq4z/BMvEbfo/VHfPyGoeSw5D9vfYyV 6a3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722378921; x=1722983721; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eSOwPlC4K/K4c1NtKrHXJlP1TgjanOwgNCfxP6XzMYQ=; b=DAL8KFximtR4KeJbvpwhsqGJDM5KS1YpXsfvP1Acd+u5H0iry9PWF29nlSoiJVs4iY TlSk50ndFS8tqFAh56XrMDL1Tm+Fy8RWXpp1WfrZtlHDUPMlMK4LPl6Cjx/VDXadfdpH ZznEySwa4d2+2427dQUpdrhwsEFMtukpCD05WJfm4JGyO7R2jLhLd/kZOL5JiIbRRxQs juIIiibLtZFIkt6iqF+YTmvvX0ZHVsmoBh1mynQN4myE2CAIg0Ew+C9cwrZ95KeWSbbV cjY7pzm9L1Blk/xsFeAsSIowh0yUnj4WzxPZ04cuAnlvtQfY87iaevuly2OTHPORy/uW P/mg== X-Forwarded-Encrypted: i=1; AJvYcCUdXfDghUwYiNDYv+UxxgvDDyGE5GZeHcMLmbrE+pMUd9Mz19cA2LiYn5COesF3PdSidML9+q7hgnoZaeJFLBYql8SMZIKH7ucFSZ5adg== X-Gm-Message-State: AOJu0YwbyLXSuOozaSJ9vasC8JmV1l+M1qpkFqJuCiJQ5+vjaFWylJX2 ZL1H3elylVp1qoR3kcNRNCgHv5ddzyLNXmkgckeRO9zt7m1MsiYF5iz6zBadtJZljx3WZ2CwnDQ ++Q== X-Google-Smtp-Source: AGHT+IFhvXMAoVFBOUzUOOlo2Rzlu+lOmmXT/AMKduASO9OrwvfaDw5U6qKsr5Vo6lwrA4+Cjt72+QiZt8Y= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:91c7:b0:710:4d08:e41f with SMTP id d2e1a72fcca58-7104d08e48amr716b3a.4.1722378920090; Tue, 30 Jul 2024 15:35:20 -0700 (PDT) Date: Tue, 30 Jul 2024 15:35:18 -0700 In-Reply-To: <419ea6ce-83ca-413e-936c-1935e2c51497@redhat.com> Mime-Version: 1.0 References: <20240726235234.228822-1-seanjc@google.com> <419ea6ce-83ca-413e-936c-1935e2c51497@redhat.com> Message-ID: Subject: Re: [PATCH v12 00/84] KVM: Stop grabbing references to PFNMAP'd pages From: Sean Christopherson To: Paolo Bonzini Content-Type: text/plain; charset="us-ascii" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , linux-riscv@lists.infradead.org, Claudio Imbrenda , Marc Zyngier , Janosch Frank , Huacai Chen , Christian Borntraeger , Albert Ou , Bibo Mao , loongarch@lists.linux.dev, Paul Walmsley , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Oliver Upton , Palmer Dabbelt , David Stevens , kvm-riscv@lists.infradead.org, Anup Patel , Tianrui Zhao , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Jul 30, 2024, Paolo Bonzini wrote: > An interesting evolution of the API could be to pass a struct kvm_follow_pfn > pointer to {,__}kvm_faultin_pfn() and __gfn_to_page() (the "constructors"); > and on the other side to kvm_release_faultin_page() and > kvm_release_page_*(). The struct kvm_follow_pfn could be embedded in the > (x86) kvm_page_fault and (generic) kvm_host_map structs. But certainly not > as part of this already huge work. For kvm_faultin_pfn(), my hope/dream is to make kvm_page_fault a common struct, with an arch member (a la kvm_vcpu), and get to something like: static int arch_page_fault_handler(...) { struct kvm_page_fault fault = { , .arch.xxx = , }; r = kvm_faultin_pfn(); ... } In theory, that would allow moving the kvm->mmu_invalidate_seq handling, memslot lookup, etc. into kvm_faultin_pfn(), or maybe another helper that is invoked to setup the fault structure. I.e. it would give us a way to drive convergence for at least some of the fault handling logic, without having to tackle gory arch details, at least not right away.