From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51F242135AD for ; Mon, 1 Dec 2025 18:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764614149; cv=none; b=B9RPBmJKPbDpNjmuTYGxtDDcg9XZlnYUd2Dk7X967dm/CBJeoIi/wDM1s0Z591EBxBJFoacgMmsixp4WWruiXgqLBNYd5eeFIKDmminuM+LmUXilVHhwrAxb2EuEwAwDlGzjm96RCX80G2rqa0wg/0Hm1mF/NTl9RCvVIt0w/Ts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764614149; c=relaxed/simple; bh=7GnbR9QZqw7J2SMIEk6efP4FG5Tr7Ngm60EmLw+aaV0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=une6ENwg49BR5+5FnK+qlTCKIE/LEqV2a5neyScdLuHyLqNE4I1KkVKp1CRC/vULvRY65DukG+f/a2lI7uwxWbAhepNtThmouOnFMMnt3kSSsXYQif13T0leHBIXonot2ZMmn9HlgcC7PNbTYlsHlYW/UmOD7JPpV5wb/jzqFIY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BOkuOOA9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=AJaPzgqx; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BOkuOOA9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="AJaPzgqx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764614147; 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: in-reply-to:in-reply-to:references:references; bh=+SbwtOZH9ducWOEZb4+vngRgdkRzNyQHiBzNVLWt3d8=; b=BOkuOOA9Sq9vMJfGErUE7h2XWAS8+95rjPDjNx+tTh380kr/XpCL6xIXyIAud7k3w67UvI q1uOXqdEU+DroSa8Rw0uBv6wPwfePNau7VFNu/UJhGrBAtc9PHZQMJDUMFGAjSN9XcOq+f yGpwuA7YO10DFw5Rz6vJPxskCxnFNKE= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-NBWsFjgMM6eUBzZ43nKtqg-1; Mon, 01 Dec 2025 13:35:44 -0500 X-MC-Unique: NBWsFjgMM6eUBzZ43nKtqg-1 X-Mimecast-MFC-AGG-ID: NBWsFjgMM6eUBzZ43nKtqg_1764614144 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8b225760181so504408985a.2 for ; Mon, 01 Dec 2025 10:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764614144; x=1765218944; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+SbwtOZH9ducWOEZb4+vngRgdkRzNyQHiBzNVLWt3d8=; b=AJaPzgqxtxamZP/Jc/2sOHUS9o2QlayuF4AuWdPdk+G7F70VcO7MK9QM87bS9YmVsk ULTQ3GeueQjel0frYtpXNNw8BDH7ioE3+DXxXuJwHr0Skm+ulQQ4DT7e1fPgAAAWcOvl dfuPVXmf6JqVcV+oOMQAEb/Skx9E2SWxfJZ5y/wNu4JbrrJYY08PJ0F5BXKLDU2wOdnI 8z/jJS0wOfhkvDL2Otl0j9eR4TirhgUpvieiNWpx/W5tgNPbXRVyt03WTcxUpJ7NG+2Y yQ93wiWtSw4mCkSBBxr+WXSJfuC8fOVKMev0FuHuPyt9Wn67l7/RPs0epaOKJXM9gjEI 8zfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764614144; x=1765218944; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+SbwtOZH9ducWOEZb4+vngRgdkRzNyQHiBzNVLWt3d8=; b=ipuy0bYm/jxdyQhjVzpXgqLyPBjNRk31q1EUYGSbxG5+mUV/nTDI/LqbSa+OKz38V5 6rFq1Xq4LCnd3MqsRfXRc2AmAZu1RQuatIBUGk0Y+2goStXJaGGom8Maivr7j0bTUK7Y o545+fTSVGvvwOcvw7U3C/BLmN9beO/AHyT0/z4fzfza7Ytdw8TTU0FsRaMvNvpERLjw QaI5QTGnM6KNONIpQUtgDiRjKdRvCK4XN3DiOYbRD4PYOQkzxn5mNsoctvX+K9+wMlza C49EnlAqHlLOQH+6s+SqdA0ZHT0loZVn9bs1ss7UQBj0y5uvcvWbp6YEb804oTBIDgUm 7viQ== X-Forwarded-Encrypted: i=1; AJvYcCUHcoAJsbWhWuABqkAnmcH1tjl5mB7I1fHj8IDYl38k5Lp4XIJe4Fv9P2NmP/eA/5MD5zc2Pqw/yTmVzgc=@vger.kernel.org X-Gm-Message-State: AOJu0YzSAYPdhI7Z6Jhe7RNh6jFax5g8S3AAPG/PWjCe6thH6XK9ib94 BeGVfKDZcKfaYACbKAFPE/ro5NrS83OSP9o9i3DZV253WDTYiCbOeJfOdZZJet2TYtmb/IWCdSM 3p+lxv1WgwvPQCRMKWxnhtIczJQhpOzrERP30SsNYfvN35AGhWPGLSn+VH++WrqpGjQ== X-Gm-Gg: ASbGncuv18UO4L6Y4CDC+p+o4KzPh2i28iQDtn170R4Gg8bcBbp2mr6Pxy2qhGttzBB vu1jPsOzBRWRElxTpVo2vabzO3outQrut/mHbKroKxtezIllzHKowr4JcTGLiOLFhvAlntRm38m iaxorapwrFQ2WbbNWlLT/oklg2fmv8jSX6NWhp1jCNDaql4Frx0ASX+2iLXDviQ9ww2gaYEwcL1 IvhYk/+hfe0tYjecLgZ06VXo4W93Xo8ZotTPfZsPS7y3KFn9K30rofn+S5Lcn6ByntNpW+R9CXR fSG/MeHV5xmW5AjZ0Tt8vCBbfADHqk65jf67cYfsf5aVA/nxBe0s0YsW+Q6TMOybdioSVu9yMIP RDiE= X-Received: by 2002:a05:620a:4047:b0:850:b7ad:c978 with SMTP id af79cd13be357-8b4ebd9eb33mr3684778585a.49.1764614144211; Mon, 01 Dec 2025 10:35:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHc/IAOaSDf8i1YjJ+6md5JjMRZyr0e09X4B+I8m0ASlSLeFoGocESiXm6l1ZZbPYuAyWGexg== X-Received: by 2002:a05:620a:4047:b0:850:b7ad:c978 with SMTP id af79cd13be357-8b4ebd9eb33mr3684771285a.49.1764614143671; Mon, 01 Dec 2025 10:35:43 -0800 (PST) Received: from x1.local ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8b5299a69d1sm898568985a.16.2025.12.01.10.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 10:35:42 -0800 (PST) Date: Mon, 1 Dec 2025 13:35:40 -0500 From: Peter Xu To: Nikita Kalyazin Cc: "David Hildenbrand (Red Hat)" , Mike Rapoport , linux-mm@kvack.org, Andrea Arcangeli , Andrew Morton , Axel Rasmussen , Baolin Wang , Hugh Dickins , James Houghton , "Liam R. Howlett" , Lorenzo Stoakes , Michal Hocko , Paolo Bonzini , Sean Christopherson , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 4/5] guest_memfd: add support for userfaultfd minor mode Message-ID: References: <20251130111812.699259-1-rppt@kernel.org> <20251130111812.699259-5-rppt@kernel.org> <652578cc-eeff-4996-8c80-e26682a57e6d@amazon.com> <2d98c597-0789-4251-843d-bfe36de25bd2@kernel.org> <553c64e8-d224-4764-9057-84289257cac9@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <553c64e8-d224-4764-9057-84289257cac9@amazon.com> On Mon, Dec 01, 2025 at 04:48:22PM +0000, Nikita Kalyazin wrote: > I believe I found the precise point where we convinced ourselves that minor > support was sufficient: [1]. If at this moment we don't find that reasoning > valid anymore, then indeed implementing missing is the only option. > > [1] https://lore.kernel.org/kvm/Z9GsIDVYWoV8d8-C@x1.local Now after I re-read the discussion, I may have made a wrong statement there, sorry. I could have got slightly confused on when the write() syscall can be involved. I agree if you want to get an event when cache missed with the current uffd definitions and when pre-population is forbidden, then MISSING trap is required. That is, with/without the need of UFFDIO_COPY being available. Do I understand it right that UFFDIO_COPY is not allowed in your case, but only write()? One way that might work this around, is introducing a new UFFD_FEATURE bit allowing the MINOR registration to trap all pgtable faults, which will change the MINOR fault semantics. That'll need some further thoughts, meanwhile we may also want to make sure the old shmem/hugetlbfs semantics are kept (e.g. they should fail MINOR registers if the new feature bit is enabled in the ctx somehow; or support them properly in the codebase). Thanks, -- Peter Xu