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.129.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 E70674014A9 for ; Tue, 4 Aug 2026 14:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=170.10.129.124 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785854082; cv=pass; b=B7lAZ5Vb77+03qJSNlt75pd5iPCOAHsQs4RzoQ0O9yRVcZ27hqcsYfj8JxgXGcWr3yED8uwGhnZNXN7JkFJQt18KRIxTGD/ilLtVX5mZm4iUOmVTpWxG4brs2vCBRfdmrr/x+1dEDdSYHjlbL4Dpa0FvkTdYAqKAFoYUP8nO4fg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785854082; c=relaxed/simple; bh=AkpbKoqkLE2ago1nKO8zeKKdehNgTrIPaOMhneanm5Q=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UnjoQpgU/4ilwU6nwvrYzggND40em71QTDJgiuRXDR4y0aNFOpXu5BqamFezVzL8BeQ3LGD7uS2SRfstdwckO7Y78msfXVCpTaU1TDPosysv+IB5HEZMpghiD8W6zyii08WzvwCOZbq7Z3XGELtlB31QKUIU9nwTWihFcMISzxU= ARC-Authentication-Results:i=2; 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=b3we5V7U; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=oeMRMRpR; arc=pass smtp.client-ip=170.10.129.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="b3we5V7U"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="oeMRMRpR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785854068; 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; bh=AkpbKoqkLE2ago1nKO8zeKKdehNgTrIPaOMhneanm5Q=; b=b3we5V7UvlhlD3TTG9R1sBM9eROLbjYrnKuw+fq/CN5lpvoGXBS33Rxag6DJstwW1aMFc9 m1kzFk5iFziFyYifY28KKX1MqdZuKKpTMDfSjw+PFRVLR+QcOl0rV2tnvltblqIG7iUQyl IP9zYpw8Ztil/RJ2qInZyjdAgGV7MGQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-211-zTPY6ex7NVCuBKkQQTjG_A-1; Tue, 04 Aug 2026 10:34:26 -0400 X-MC-Unique: zTPY6ex7NVCuBKkQQTjG_A-1 X-Mimecast-MFC-AGG-ID: zTPY6ex7NVCuBKkQQTjG_A_1785854065 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4955d314945so18084595e9.0 for ; Tue, 04 Aug 2026 07:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1785854065; cv=none; d=google.com; s=arc-20260327; b=YtJyd23nECX70+t6/uDA0oSVWj+I4b31Cuj4trhaDz37Srmash+HtlWCnldeSPt9LH S4bsRGSNp5/G9vhOg7F824bYon/uciJWL0xxqktYqx8XQOUfI82p/0RAi62TZsiGgS1i lGVMLlCBnz5p5ZeYpj/8BlDzThYhe/hpeIQhxswjJiHKvKZbUpk/4SjxlgO0okBW34cj 9sc09eiwODf6R9RvKj6t5N3oSMWrNWGcRG4LRN4WN9JK+7pnqLrjHarg3pg+fyxhWVcM trziYzdcWiV9jCVIvV1VtNUWogVTlrC0YBKt+PLxfOTt9yso6fyM6b1YkTZWO9OKpPxI fQxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AkpbKoqkLE2ago1nKO8zeKKdehNgTrIPaOMhneanm5Q=; fh=97MG91QgRxDHVKawcFai/CjO0IunA6lJAMBSg8KM0AE=; b=Y9eHuX1RZ0j9sa8JPny4T8m2gbjrfg8dVd5b6HAY8ND93hd382CPNYoQRdTP1JzqG1 VCq88eviUhnAQ+9KxOYkzBFxColt/FMmO5dCrb4MaD1yd0aO/D8eP1bCcE/0WNMkSAp5 DDbiNGPgxVFpGyPr94hdPdLHl5gygcBJMvCEFPwXifYN9KBzoWEDY5PDFvwEH5tKqgou zeMEK9uUITrt05PVLY/o/12U5fogGw9eBj13yyDOXhOxusVEpWrk23A9HXhtP6U4y8dc 1tn5OLUcHXgkIga9JhjwXoiaw/WRCZKIvl3tIqv7VSg4G8eK+iGgjOgxJxMDD5cvmgW+ qvyw==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1785854065; x=1786458865; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=AkpbKoqkLE2ago1nKO8zeKKdehNgTrIPaOMhneanm5Q=; b=oeMRMRpRXphJnO2A7FxxFVB0wCiMjMW8eGzqDqv2/23j2YgrmWgB31vK8yab9wfqmT jeXV01qn72sI+XW26nr9Pp+VaUaYtCIwGOEN2kQTbP3Y5NDiF11zSq+99UbaZkOJkRn+ lP98cWMUkl/z3pBC62N3IYiwBs9uXTzp6ONVbnk7Wy/UqTkWYoDzNuetR4hI57Tb7Gb3 /7h/ywWBQEAF39kFKL65t05fzKpIOE81lYviqwnR+q/7opfdn1AhQ2bxyR0eP2Wrozuo 8Dad5ojqaEsh4lUNarBzp+AdKK+TZjHygsQvdW9wwyZz9AEkOYm7Q+BmyYiQYiS4PNGE T9+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785854065; x=1786458865; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=AkpbKoqkLE2ago1nKO8zeKKdehNgTrIPaOMhneanm5Q=; b=hVn3ylLO0F8th3uaB0hslevdIpBbShmEzMdFUL/sfK3IidlLv+aAId5MJxLWCYyp4t urL1WRNDGNYgDPgJC9VhdB+2FQ/Lq8UN7a7ubgIBbfI3n+86fkkNj12iuS/Lpoey8sH1 vVq+DI84qU7PhET+rjnA4dbnW8HiKE/MnTKwTOUozAnW6zRJenNYLfmMoAF04+/14B7b KeT6yl63XWWG+BWiSpL/t4J7LRujkWjR7gYavW9xggbbeQ6IxmJV5n4PtU33yZLyknxW 0O4aXf00/S1wzGr7X7NaKIyalqZ5JRiVSOQWE2hAkvF6Tdxk34+7T743wLf83wcsjitz 1bSg== X-Gm-Message-State: AOJu0YxHxCAYFDVLseX+iPU9BHSo8PnN+wgKCV3jrnawHixOBuGy9WgK 3z8Ozr8eOwrjoO0Mnodyr5Iciq3opbuRtz98QN7YhYR24ktT2rO9Xq6dPyB5D1WY/SHEy0iG24I DuRKKevmaEWNv5GfhIgRmzWs98qyX7CDqJA5fSEMnr3tgpjLVl6M3c/y+waT3ggK8OUIFyMsDmI 8O/rM2/4LDxSsBKkKkQADNHpVauy3hNOzBDuETJLSR X-Gm-Gg: AR+sD11YnGhD4Xb4773PBFfAJzuaT6Om2zG/bQeb9uGz2FjN3T+WM9Ht5P7vSw1N0tT X7S/7Tz5p9EnQhl1H/34I7BhVJG45nkTcL8/zfMQ9VTHBT1oeb8oAxo5yG7H8vBOUwGftMUBQqk ukXu+bh/cAWU2zl3oHnBt//sQfHN844JmW9CT5ClSYTm+YZjFx6xarmjp4Q7UObpsxwqbz9OcwK YUEgny7lc2yxlXXaO1npH+hy6N2zPd2S9rYAt1rq+0Snym6rQGOH5l2wSs= X-Received: by 2002:a05:600c:4fc5:b0:494:6baa:ccef with SMTP id 5b1f17b1804b1-4980f23257cmr337369015e9.11.1785854064939; Tue, 04 Aug 2026 07:34:24 -0700 (PDT) X-Received: by 2002:a05:600c:4fc5:b0:494:6baa:ccef with SMTP id 5b1f17b1804b1-4980f23257cmr337368035e9.11.1785854064514; Tue, 04 Aug 2026 07:34:24 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260804120529.1730187-1-pbonzini@redhat.com> <20260804120529.1730187-3-pbonzini@redhat.com> <20260804161549.4cd9a66f@fedora-21.home> <20260804161850.58c55c6e@fedora-21.home> In-Reply-To: <20260804161850.58c55c6e@fedora-21.home> From: Paolo Bonzini Date: Tue, 4 Aug 2026 16:34:10 +0200 X-Gm-Features: AUfX_my1qzxj9_dJklyDF5G5un-IXavjOuTxcyczoqFAniCfVGichGNEROtCVP4 Message-ID: Subject: Re: [PATCH v2 2/6] drm/shmem_helper: use vmf_insert_pfn_mkwrite() To: Boris Brezillon Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Alex Williamson , bcm-kernel-feedback-list@broadcom.com, Christian Koenig , David Hildenbrand , dri-devel@lists.freedesktop.org, Fei Li , Huang Rui , linux-mm@kvack.org, linux-s390@vger.kernel.org, Michal Hocko , Peter Xu , Sergio Lopez , Sean Christopherson , Thomas Zimmermann , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 4, 2026 at 4:19=E2=80=AFPM Boris Brezillon wrote: > On Tue, 4 Aug 2026 16:15:49 +0200 > Boris Brezillon wrote: > > Actually, if we're making the drm_gem_shmem_record_mkwrite() call > > unconditional (for PTE and PMD updates) in that path, can't we drop the > > drm_gem_shmem_pfn_mkwrite() call living in drm_gem_shmem_pfn_mkwrite()? > > > > Also, I'm not even sure we can end up with write=3Dtrue for PTE updates= , > > because our pfn_mkwrite implementation returns zero, not VM_FAULT_ERROR > > or VM_FAULT_NOPAGE. This means the default RO -> RW PTE upgrade > > implemented in finish_mkwrite_fault() [1] will take place. If we really > > want out try_insert_pfn() to be called for those RO -> RW updgrades, we > > need to call try_insert_pfn() from drm_gem_shmem_pfn_mkwrite(). > > Nevermind, it's all explained in the comment you've added. Sorry for > the noise. I keep wondering if we shouldn't call try_insert_pfn() from > pfn_mkwrite() though, like is done in other places. No, the .pfn_mkwrite() callback is invoked when a PTE already exists, and mm/ already takes care of making it writable. So there's nothing to insert, you just have to take note which you do with drm_gem_shmem_record_mkwrite(). Paolo