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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BC98C27C4F for ; Wed, 19 Jun 2024 00:11:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2495A6B0377; Tue, 18 Jun 2024 20:11:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D2436B037D; Tue, 18 Jun 2024 20:11:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F192D6B0377; Tue, 18 Jun 2024 20:11:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D385B6B0375 for ; Tue, 18 Jun 2024 20:11:35 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8BB0CA3035 for ; Wed, 19 Jun 2024 00:11:35 +0000 (UTC) X-FDA: 82245709350.01.7E3418E Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf03.hostedemail.com (Postfix) with ESMTP id 5FD8D20014 for ; Wed, 19 Jun 2024 00:11:33 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=aUoeFcz7; spf=pass (imf03.hostedemail.com: domain of quic_eberman@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_eberman@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718755886; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KZU+R13/Ttt99a5SqVwpops+V2v9unmEIBAarn5mQJ4=; b=lGnKT1r04RBhxtTatAbnkBorwpxWGrTNWVFPkrH1gUO0dBPTYtXZwMj4a56YcmsRbvlkj0 5KoP3z8NsAQXeGvSvTngqyZNk01RMITO/ZvMxG+H375xjhsCfFxFJUs98qPz/RqBcnIHpr 2oqy5kyNB0EL/eOzpLozPQExBe/Wj/E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718755886; a=rsa-sha256; cv=none; b=Fo+UPW5XezTzDeM2R6ZNBWI8oMijhX6E9cmMmd4DSMbgRPH/DVQk2xrTab3rVje4XtJjIH oxWqReZ6N3nsGcKncXuizKTxTne9T2jVwIF009ya3nJqDdtlKwWn+peEvq7t+bnWxaiJsg uofMPYH6bXwgvvoWx2VBQUATlauQB0A= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=aUoeFcz7; spf=pass (imf03.hostedemail.com: domain of quic_eberman@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_eberman@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45ILZsTY006075; Wed, 19 Jun 2024 00:11:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=KZU+R13/Ttt99a5SqVwpops+ V2v9unmEIBAarn5mQJ4=; b=aUoeFcz7t0nCQEjWostul9clAp42UKksOciHpmfX BwK8DQjww10rB09sy64oKigiCAb2GNwdzt52Q9qX7DFBzwfCHcRnkit0mEeOKR0G /nXNhJy4o8uyw6SfMesilR4yikPpZ+d+6qWVRxk10UI/2Wxry41K7almnowA1TmC 1CQ8HLVxkU3nzFJTxyyrg9hFlXUiEyA7UkvElK/VWb6pa5bd9aN4n0HTWBJ58dNL m1FAst1BuKTColUSDvYSINCM8xfR0u2B3a2XlnsQAeSTfgp3SLQAEeiD7sFdkVLh +0Ht84cwvYmR3Zn1brs/Uyr7A8yO1YHX4rT4xKtWwEO8Lg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yuj9u07pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 00:11:05 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45J0B1e7014737 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 00:11:01 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 18 Jun 2024 17:11:00 -0700 Date: Tue, 18 Jun 2024 17:11:00 -0700 From: Elliot Berman To: Andrew Morton , Shuah Khan , David Hildenbrand , Matthew Wilcox , CC: , , , , , , Fuad Tabba , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH RFC 0/5] mm/gup: Introduce exclusive GUP pinning Message-ID: <20240618170853139-0700.eberman@hu-eberman-lv.qualcomm.com> References: <20240618-exclusive-gup-v1-0-30472a19c5d1@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240618-exclusive-gup-v1-0-30472a19c5d1@quicinc.com> X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: YwAw23Mh7tamv-wTy3-W4oEdnIM4fPV1 X-Proofpoint-ORIG-GUID: YwAw23Mh7tamv-wTy3-W4oEdnIM4fPV1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-18_06,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 mlxlogscore=999 clxscore=1011 mlxscore=0 phishscore=0 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406190000 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5FD8D20014 X-Stat-Signature: icytdfz1m519ku8hpenrnfg1r7chyt5x X-HE-Tag: 1718755893-715995 X-HE-Meta: U2FsdGVkX180wtXsCsLhGCuNztJo0d4MmFUGmljUP9E2MNjXwayWxgnCSiAuw2u2SJxZR2ZwVUMVur5SUycU1NKs3H+2q3nxlDqxI9TYhfq0vOJvXaylp6pRW/zRnMJ2H3NrnzsIpDwyc3HOcHBLiQzgVECSOJhPPmrejcGEETNjBFW2pZuDSm7BkOj6lTWr2G8euwovWmltlqeOOk4rmn+2CYO1R6Bdi79uUWODRmOqi7GZooUvO+HRGwWbdPlAs9m5QHz0DVN/QQifdekBztDp8c84D7oZByLacoGjAjDtL8J781hrlnIERKGT9oHseTbztiSzQIEGicV2xsZz87SCxiDv+tQv0UNFBZusYo/fM1DSEimy/xlj3GDG/3FzfSNd8BueeRDj3u4sTg5aB3sbWRYdn9WAVpA8wq1/JXK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su3Ds3OS X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: b4 wasn't happy with my copy/paste of the CC list from Fuad's series [1]. CC'ing them here. [1]: https://lore.kernel.org/all/20240222161047.402609-1-tabba@google.com/ On Tue, Jun 18, 2024 at 05:05:06PM -0700, Elliot Berman wrote: > In arm64 pKVM and QuIC's Gunyah protected VM model, we want to support > grabbing shmem user pages instead of using KVM's guestmemfd. These > hypervisors provide a different isolation model than the CoCo > implementations from x86. KVM's guest_memfd is focused on providing > memory that is more isolated than AVF requires. Some specific examples > include ability to pre-load data onto guest-private pages, dynamically > sharing/isolating guest pages without copy, and (future) migrating > guest-private pages. In sum of those differences after a discussion in > [1] and at PUCK, we want to try to stick with existing shmem and extend > GUP to support the isolation needs for arm64 pKVM and Gunyah. To that > end, we introduce the concept of "exclusive GUP pinning", which enforces > that only one pin of any kind is allowed when using the FOLL_EXCLUSIVE > flag is set. This behavior doesn't affect FOLL_GET or any other folio > refcount operations that don't go through the FOLL_PIN path. > > [1]: https://lore.kernel.org/all/20240319143119.GA2736@willie-the-truck/ > > Tree with patches at: > https://git.codelinaro.org/clo/linux-kernel/gunyah-linux/-/tree/sent/exclusive-gup-v1 > > > Signed-off-by: Elliot Berman > --- > Elliot Berman (2): > mm/gup-test: Verify exclusive pinned > mm/gup_test: Verify GUP grabs same pages twice > > Fuad Tabba (3): > mm/gup: Move GUP_PIN_COUNTING_BIAS to page_ref.h > mm/gup: Add an option for obtaining an exclusive pin > mm/gup: Add support for re-pinning a normal pinned page as exclusive > > include/linux/mm.h | 57 ++++---- > include/linux/mm_types.h | 2 + > include/linux/page_ref.h | 74 ++++++++++ > mm/Kconfig | 5 + > mm/gup.c | 265 ++++++++++++++++++++++++++++++---- > mm/gup_test.c | 108 ++++++++++++++ > mm/gup_test.h | 1 + > tools/testing/selftests/mm/gup_test.c | 5 +- > 8 files changed, 457 insertions(+), 60 deletions(-) > --- > base-commit: 6ba59ff4227927d3a8530fc2973b80e94b54d58f > change-id: 20240509-exclusive-gup-66259138bbff > > Best regards, > -- > Elliot Berman >