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 845FDC27C4F for ; Fri, 21 Jun 2024 08:02:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C66568D0145; Fri, 21 Jun 2024 04:02:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C15C38D0138; Fri, 21 Jun 2024 04:02:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3F5A8D0145; Fri, 21 Jun 2024 04:02:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 847508D0138 for ; Fri, 21 Jun 2024 04:02:18 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1D63A1C1B31 for ; Fri, 21 Jun 2024 08:02:18 +0000 (UTC) X-FDA: 82254153156.01.B411788 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf25.hostedemail.com (Postfix) with ESMTP id BBABDA0021 for ; Fri, 21 Jun 2024 08:02:15 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Gv8Nnl8G; spf=pass (imf25.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718956926; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Xkmx4VxgKTDJ6kTchpyZaVShYEbHtP+HAhQKYy4kBtU=; b=UESTxVFbgerkMQiXd3koQQo6qbf3CvbB+e2SNytEU4MD2ueW/qnIILlK7V1sP78sn34Am0 piCxAdJUTJCHyg6NzFl+xRMzAOLTualOA5wscQttzIohTJeuIJ5jtZQ1mUoKp1CmC8OgVY 5ge4ULUal2YzGfdZMXWXgD7lOe9A9WQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718956926; a=rsa-sha256; cv=none; b=x0OdB32x1e3b4/fLRA7YVVQRk6HhRw739VsyXnqo05VktvV7hsy1/dw9sjIQoQz9cbM8wx 8XwG1M4CdVdyP79fBUq3hwpfIyrFlDu4Dks+VK7ueYbhbcvgUiSHBwJaNW5b2rdFLIXOVy 1WFSuYxJYjTgHZqfL0nz/saRn2rgIEM= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Gv8Nnl8G; spf=pass (imf25.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718956935; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Xkmx4VxgKTDJ6kTchpyZaVShYEbHtP+HAhQKYy4kBtU=; b=Gv8Nnl8Gf3fXWUuf0hyx0DiiNuGradwti82yLlJ0OLfmS5uxvJr5yLzL2HsYL8o0GykLGT J+hZ0IWWYLaou+V7Zj++6HNTDm/DWO/hv7PeKr4O3CWVDA3kkKrZOireh4vCeDdbvHb44z KJGc8pbqELGa/FK357lAGlhK+3kr/bo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-zZPzWKORO9izAwhWo81LuQ-1; Fri, 21 Jun 2024 04:02:11 -0400 X-MC-Unique: zZPzWKORO9izAwhWo81LuQ-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3644be85453so953859f8f.0 for ; Fri, 21 Jun 2024 01:02:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718956930; x=1719561730; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Xkmx4VxgKTDJ6kTchpyZaVShYEbHtP+HAhQKYy4kBtU=; b=QJNVqNCUkcdnpVj/HQzJfwyqP8N+n6H4Ajjhee3fOImOVGyN4U6wsHdlHIFXx/7oWy AL/zeIkrvHXl+6TMpXpwopCz3kpv5d2BT8q3nM1/Ao+lV4hFpbB6PQiIhHK2iMkEgQUm LhW2OiGHyZ3h3A+3F9/NKOQlPOjWBCxyoIML4YwITZT4Zn8EmAE2MZcvFK5FBa7gvsXm onrwrsDmub3AMSieihi7Ev+DuXOSUPkA4vAjL19+TpwW1G0znx4LxxQMgP5kx0EIWsP7 i8Xgvra4o6au1The+wqbm7WseLh40amv9tz77QPWE3H4Jrt7FHDSYnCsM2b/x9tauYHv yWOQ== X-Forwarded-Encrypted: i=1; AJvYcCVYPWN02k2j6r0C6Aa60+EgqatWpwAnGRRAC8mGiFtLFxUatWsN7FtHUw/n0z81mNl9yVKmjkfdrVTHEhhoCzGzv5w= X-Gm-Message-State: AOJu0YxRs/m1A+qiqwULxZrk+i6o7j0bNIH0zQDodPXzPJdvjmL7EocV eH7Y853LuwUSxs8s7WS/AsG7iuYQikdjbYIrQUSuk9LUhkaDvr8YX+5VLumt7g2rHZxxUyY/fmn ShLmLmpbsrrTw0UR8M5fsK49CwTf7CgBf4BhxeybcBRhoBPIl X-Received: by 2002:adf:cd0b:0:b0:360:8769:2bcd with SMTP id ffacd0b85a97d-363ec4f3a35mr4232187f8f.22.1718956930354; Fri, 21 Jun 2024 01:02:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSQMV3nkBUbWMbVYELKjHtfrKlZ7Qwe5QzWr06EgevF7vNjrJxpQ7CrJ3ZgBR3qkCYw9QWfw== X-Received: by 2002:adf:cd0b:0:b0:360:8769:2bcd with SMTP id ffacd0b85a97d-363ec4f3a35mr4232160f8f.22.1718956929840; Fri, 21 Jun 2024 01:02:09 -0700 (PDT) Received: from ?IPV6:2003:cb:c725:e600:4063:2059:fd18:9d65? (p200300cbc725e60040632059fd189d65.dip0.t-ipconnect.de. [2003:cb:c725:e600:4063:2059:fd18:9d65]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36638d9c16esm965765f8f.57.2024.06.21.01.02.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jun 2024 01:02:09 -0700 (PDT) Message-ID: Date: Fri, 21 Jun 2024 10:02:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 0/5] mm/gup: Introduce exclusive GUP pinning To: Quentin Perret , Jason Gunthorpe Cc: Elliot Berman , Fuad Tabba , Christoph Hellwig , John Hubbard , Andrew Morton , Shuah Khan , Matthew Wilcox , maz@kernel.org, kvm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, pbonzini@redhat.com References: <14bd145a-039f-4fb9-8598-384d6a051737@redhat.com> <20240619115135.GE2494510@nvidia.com> <20240620135540.GG2494510@nvidia.com> <6d7b180a-9f80-43a4-a4cc-fd79a45d7571@redhat.com> <20240620142956.GI2494510@nvidia.com> <20240620140516768-0700.eberman@hu-eberman-lv.qualcomm.com> <20240620231814.GO2494510@nvidia.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= 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 WNyWQQ== Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BBABDA0021 X-Stat-Signature: ibwgjyyr1rg33xjanotsx85z7z4ihn7j X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1718956935-490788 X-HE-Meta: U2FsdGVkX1+5ryz1YpSLeXlWld2VYK4t06vt2NPxurksTOPYK8GHRvA6Ix9Gu1v//taeyO75gQmSD4PvLYnPgudwnpo7suywu4MDVg+MzkP1LsvyAawe2pzl3jM/NRaj498iLemRTEsXyjOyC+TKzEqnUyLeL/YgERhUs+rLYvf6zZLz6YWB+KR/dDs+NRdGT0pHvH/Ca2i7q2oiogbeaGFuWpnYuD5beEApcLX/vNBMxTuneTPo/7qrBaJXHhWlpt6zHp2IKebmU/CAdVbVxad4ei23WvrqXAIUoKXDf3ncf0wvS71IArXCaj7Rh4MVboA6fkrmzTaFMlM9n3CV6nZ2kT/5ahO9aQkz24Acdxaz6P/zSd1PZidPqIgxOAgDDaG42V1F6L2jRkvln+AgoXZUT/MpmFsR6WrmsPsczLmVaMDQ3vOga2aevOM3PtO2nvBaUGGV1vMHSeAE82yc14yTBXfOuttOn8Trllq0FZPnGTkgnb4PXV2ic+Nwo8Hx6Ceat5fSHMa54ywU5oQL320VaStimWWnqMUWVJdAUeUZKOHfUf94RjEOLXsHp+nzPxYDcFJ3B/JHheP2+HyJND1zkg1fAo8HzF8iRPdD9vSaD3qKx/Uz/HPXBkugCH+AQyfHeZf1FN9en5KebIvk8/CaiaMrOpMf3YI1UKzWrJki4PBG8EJ83IEbFwnzsCmYDH+k4Rv3ZCpHW/Fn7ncHZYom2yxas/AnbaUNfLZyPmDMRGF1qerlso0gQiQEUewofFVbbBKKdMvqnV8F59TnpJtnrTGx4pEmLHkqSmU+RbziadJXRXyshEPI3EhI6106Jo32yWGEV2YnWivZPz1OsD9XiIRgDcjGhSIPAcqC4038j17iDOJwqd8Xy9fWTn78Ubqr/1BPPuv4ujbkRm1tmhGy4rDYI+2R/01clED6S6BDII0O0qKa94bWD+XptWbCtgEJR25CF8OxLSbPExN J4WVFa+R cfcl8sok1t+91Wp+LavkQvsDKZZNXlcuRL9fSLpdWN2cR/snMYe5mLVxoU4l5+vt7OZsLMnJ8NBOPujZu70pgNVKRGkEPYjixHht1+5nCaet02Z7Brm8OoZd405djeUTjrl2UvGpb7EORbId6nk9ClCHaa7FA35wN/LOf8zwhoJ1Ak3qFpv7engHeXUfeeGgHTdTKjqRmLN9Y2pkB6YxIyAO1D3odDXfzaXgw552Ha3EFQEiVUSpyrWnUupQkdjHOV88jJMYYFIi7qNv41esWDZ0CQAeTTPSeZP/VIXRiHdgxpOzrMec/pps3vVgDGTsAxe/mxpI2omopD4MXwf1oAI2GR6w/NN9ziJF7hgTdVpjB2PBQVr01JldzMQ== 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: On 21.06.24 09:32, Quentin Perret wrote: > On Thursday 20 Jun 2024 at 20:18:14 (-0300), Jason Gunthorpe wrote: >> On Thu, Jun 20, 2024 at 03:47:23PM -0700, Elliot Berman wrote: >>> On Thu, Jun 20, 2024 at 11:29:56AM -0300, Jason Gunthorpe wrote: >>>> On Thu, Jun 20, 2024 at 04:01:08PM +0200, David Hildenbrand wrote: >>>>> Regarding huge pages: assume the huge page (e.g., 1 GiB hugetlb) is shared, >>>>> now the VM requests to make one subpage private. >>>> >>>> I think the general CC model has the shared/private setup earlier on >>>> the VM lifecycle with large runs of contiguous pages. It would only >>>> become a problem if you intend to to high rate fine granual >>>> shared/private switching. Which is why I am asking what the actual >>>> "why" is here. >>>> >>> >>> I'd let Fuad comment if he's aware of any specific/concrete Anrdoid >>> usecases about converting between shared and private. One usecase I can >>> think about is host providing large multimedia blobs (e.g. video) to the >>> guest. Rather than using swiotlb, the CC guest can share pages back with >>> the host so host can copy the blob in, possibly using H/W accel. I >>> mention this example because we may not need to support shared/private >>> conversions at granularity finer than huge pages. >> >> I suspect the more useful thing would be to be able to allocate actual >> shared memory and use that to shuffle data without a copy, setup much >> less frequently. Ie you could allocate a large shared buffer for video >> sharing and stream the video frames through that memory without copy. >> >> This is slightly different from converting arbitary memory in-place >> into shared memory. The VM may be able to do a better job at >> clustering the shared memory allocation requests, ie locate them all >> within a 1GB region to further optimize the host side. >> >>> Jason, do you have scenario in mind? I couldn't tell if we now had a >>> usecase or are brainstorming a solution to have a solution. >> >> No, I'm interested in what pKVM is doing that needs this to be so much >> different than the CC case.. > > The underlying technology for implementing CC is obviously very > different (MMU-based for pKVM, encryption-based for the others + some > extra bits but let's keep it simple). In-place conversion is inherently > painful with encryption-based schemes, so it's not a surprise the > approach taken in these cases is built around destructive conversions as > a core construct. But as Elliot highlighted, the MMU-based approach > allows for pretty flexible and efficient zero-copy, which we're not > ready to sacrifice purely to shoehorn pKVM into a model that was > designed for a technology that has very different set of constraints. > A private->shared conversion in the pKVM case is nothing more than > setting a PTE in the recipient's stage-2 page-table. > > I'm not at all against starting with something simple and bouncing via > swiotlb, that is totally fine. What is _not_ fine however would be to > bake into the userspace API that conversions are not in-place and > destructive (which in my mind equates to 'you can't mmap guest_memfd > pages'). But I think that isn't really a point of disagreement these > days, so hopefully we're aligned. > > And to clarify some things I've also read in the thread, pKVM can > handle the vast majority of faults caused by accesses to protected > memory just fine. Userspace accesses protected guest memory? Fine, > we'll SEGV the userspace process. The kernel accesses via uaccess > macros? Also fine, we'll fail the syscall (or whatever it is we're > doing) cleanly -- the whole extable machinery works OK, which also > means that things like load_unaligned_zeropad() keep working as-is. > The only thing pKVM does is re-inject the fault back into the kernel > with some extra syndrome information it can figure out what to do by > itself. > > It's really only accesses via e.g. the linear map that are problematic, > hence the exclusive GUP approach proposed in the series that tries to > avoid that by construction. That has the benefit of leaving > guest_memfd to other CC solutions that have more things in common. I > think it's good for that discussion to happen, no matter what we end up > doing in the end. Thanks for the information. IMHO we really should try to find a common ground here, and FOLL_EXCLUSIVE is likely not it :) Thanks for reviving this discussion with your patch set! pKVM is interested in in-place conversion, I believe there are valid use cases for in-place conversion for TDX and friends as well (as discussed, I think that might be a clean way to get huge/gigantic page support in). This implies the option to: 1) Have shared+private memory in guest_memfd 2) Be able to mmap shared parts 3) Be able to convert shared<->private in place and later in my interest 4) Have huge/gigantic page support in guest_memfd with the option of converting individual subpages We might not want to make use of that model for all of CC -- as you state, sometimes the destructive approach might be better performance wise -- but having that option doesn't sound crazy to me (and maybe would solve real issues as well). After all, the common requirement here is that "private" pages are not mapped/pinned/accessible. Sure, there might be cases like "pKVM can handle access to private pages in user page mappings", "AMD-SNP will not crash the host if writing to private pages" but there are not factors that really make a difference for a common solution. private memory: not mapped, not pinned shared memory: maybe mapped, maybe pinned granularity of conversion: single pages Anything I am missing? -- Cheers, David / dhildenb