From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F04B24EF91 for ; Thu, 3 Apr 2025 14:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743691719; cv=none; b=PxdkQ1SbIPTrcgHvmQ72OhHWsL1aceeP6hwM/KVFZftnVqxpL6NcZCEEdGeGQwS6X3yxooMfRI/V0nTAwd5HcO6zEcnXl5KlmBT9Q/ZhSFoQfgJ3BD0d2mL2cMaHJaAi17pOx3OBJoNPPq4ciQMEUQH1KHSQw8fg3JlKxqxzfyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743691719; c=relaxed/simple; bh=wmF3ASAu4l5e5QaPK3NSuhBM69OYwzUeQtDHQcn6MS4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qcvJ5/g7VEO8u1G69JZCg7cK7wEN9Xv3lnya8y+9ZMO6/NNMwIenxXn7IdFlGFA/VrIPbASvuJKLH1JsyU5KkS3+o/ogrRiBTa/KGm63zyACcmAUbwUboiqH1cSw0D392HTI2mf7bHVCU/dipdXxH55xwS5e/nflZtxqDZSxH1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=AhsoEFTd; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="AhsoEFTd" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-73691c75863so1283044b3a.0 for ; Thu, 03 Apr 2025 07:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743691717; x=1744296517; darn=lists.linux.dev; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=igg3zobfFtydVGAelA7JZ01NRykTuhkzUPbgteiqM9Q=; b=AhsoEFTdMsDhALuZxaaDqBjgTfp1+FXbatxvz8c6jRAZm6op6QuLIwW82x1H8CBrv7 ctrvnTKtupFMieNXvOOms1VyERTf6h3EcpnYh0cf8fvYknn3WSoIyT0dbCpbNJ4iPeoj m3SNrV/1Vv2fdOj9wbxnSseIU1ozOPdcm/Hn+vHLs/PntUlqQdkgTZkzbyeazRFGbLjV TzpAL/YLF2jm0nwxqPftbYJFmwSClrahCItXkEnTocQmOOZ4pSVEqVFnwwLJUc8on65E JCY46bygHlHUgAIaNntWmEP4ERuhcI0zFGcx/jWsZo5s08BesRgndBkCe6uIzP1dpZmO W8Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743691717; x=1744296517; 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=igg3zobfFtydVGAelA7JZ01NRykTuhkzUPbgteiqM9Q=; b=BRRqotp2dpSQPZ+xF7MzxP1BoWOnSbL6HHTsvQWFV+96hw8yjpMXn+4GJfSOQ8F7ii 7zCoeT14ZKDbgVmpSeFpBXPXYKH+FHcp2jeDJtyaQBSrRvlNXGCEye6BOLpg+4obobCC W26iTEJBLFPs6G3qWpaoUXrRPGt+d7c3rGxkNpEaQmrNFrues5ctXntAh0w6aQ6iaEtq al3GJ7CZ9Cbnm/y3c6VvsBi8guYr4Pv9eeVFWBfjvMbZGkGrU8+y3OH9FVhdCDtfMvbn 3b+h2en1/P/ehniqWLM3EFVtgC6L7eOrPgx7GdADo08YhVBhSeXv+CaDzkBrMU+VnxU9 kSHw== X-Forwarded-Encrypted: i=1; AJvYcCUPke/MwJRGZ/0BfQtOhNmHVvddOPB+ZdSRZz8FLbf4s97KEXMp7SFiN4u7DbQg9L8HZATVabKxJ392@lists.linux.dev X-Gm-Message-State: AOJu0YynyQHWyEmDnlzk8p8FZ3sq6wCxOOppkNVYKEL9tPenR9PyTVHa PC89VK9y6CBOWAx3V+GbqTE6RchV7J5q5qqbjJoY5u/oxktgZzi4Y66TJb9ABzXRtui1gT80wIP +Wg== X-Google-Smtp-Source: AGHT+IG9IJrC2WV7WLtmMSWgTecisx21a4/DmbtG4CGcCIp6FaiyOk56NSQtsUf8hBMYnyjC9Po0xvGrGdU= X-Received: from pfam26.prod.google.com ([2002:aa7:8a1a:0:b0:734:6f4e:794]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:848:b0:736:5b85:a911 with SMTP id d2e1a72fcca58-73980399504mr32373172b3a.8.1743691716806; Thu, 03 Apr 2025 07:48:36 -0700 (PDT) Date: Thu, 3 Apr 2025 07:48:35 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241122-guestmem-library-v5-0-450e92951a15@quicinc.com> <20241122-guestmem-library-v5-2-450e92951a15@quicinc.com> Message-ID: Subject: Re: [PATCH v5 2/2] mm: guestmem: Convert address_space operations to guestmem library From: Sean Christopherson To: Matthew Wilcox Cc: Elliot Berman , Paolo Bonzini , Andrew Morton , Fuad Tabba , Ackerley Tng , Mike Rapoport , David Hildenbrand , "H. Peter Anvin" , Jonathan Corbet , Trond Myklebust , Anna Schumaker , Mike Marshall , Martin Brandenburg , Alexander Viro , Christian Brauner , Jan Kara , James Gowans , Mike Day , linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-nfs@vger.kernel.org, devel@lists.orangefs.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" On Fri, Nov 22, 2024, Matthew Wilcox wrote: > On Fri, Nov 22, 2024 at 09:29:39AM -0800, Elliot Berman wrote: > > A few near-term features are coming to guest_memfd which make sense to > > create a built-in library. > > You haven't created a library, you've created a middle-layer. This > file primarily consists of functions which redispatch to a function > pointer. I think you'd be better off creating a library! That is, > have the consumers register their own address_space_operations and > have functions in this library which provide useful implementations. Or, go even further and move the overwhelming majority of guest_memfd code into mm/. But I suspect that will be practically infeasible, in which case I think I agree with Matthew. Either way, the Gunyah usage of the library/middle-layer needs to be included in the series. It's impossible to review the code split and APIs without seeing both KVM's usage and Gunyah's usage. E.g. this series allows __guestmem_invalidate_begin() to fail, without any explanation as to while that's legal or desirable.