Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp695308rwj; Thu, 22 Dec 2022 13:26:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8vwHpoG7igl+3tW5Dh+eV0BZYpMm08AwdMCxgfCAg4h5mdv5a7nkoDeydQfhXdGGQmWw3 X-Received: by 2002:a05:6a20:1455:b0:a4:829f:a43f with SMTP id a21-20020a056a20145500b000a4829fa43fmr11158247pzi.2.1671744416521; Thu, 22 Dec 2022 13:26:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671744416; cv=none; d=google.com; s=arc-20160816; b=vDhgtUCiaaLuEyQUS7t3UR28uICOmEwVL8N3uVTWEu5e7v+Of9u0TcLuSStxiBTt3i v2LlOvrpP3PXen0rYuWwxgYYHrwCsYPE9AcxXPngoRtNJ3jsLMLX7mzJgGE7Ddnl0VpB E450cvpnfErXfBsKW8kUXdjk+4HstBU7nyQeQLSlhHfgL2SHxXia4BDQwa3hubnWD89z /t60A7Ysxg98PmbDKCjjIzpUaF5926AkRNzswLXmmi8aJPhE9lVl0gRPxRUNmElim3By nMIH/7Hoh55O2Nd/m+ObvGs5y4sF8QwfIQiuKRMKArvfiZ/bzt97ojSt/w5MEpqaiEoL orWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JvoMNsJvzMmJ+w485oCvbJgOGlOvC+kCcpkVN/ffzRU=; b=jjiHY9+q5QT+gAR9PZE/424GushakDBzmExtnVlIAwECP+6sVkxeP1C2vdXJfQhwVT 47OPTTIgPdzwJF6JtXZw4AZlnVZ8Ix9B3DvQlKThVZHp0BxaI71Ih/7DD7VkB7p57RbV nQAiCUbgcw7JMG6YOIAPA8VF+pnNSO8+Tn5VJVNO4Pk+SoP6wnqtc+yQ9OKKZW6RGJNh MwYbOC8jfrTatl7YtUFA9SGu72Hhcx4jqFMZwLbTAkpM1LNGAXQxTvlsrFzkvM67b+J0 XG3DE1Y3+l1EmytoegLCTwbyaYyOPA9xtRrf5YNZit6s12Rlb61E3M0f4768XleKUoGk sqhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZlhZvkt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a63b306000000b0046eed2ed669si1847971pgf.209.2022.12.22.13.26.46; Thu, 22 Dec 2022 13:26:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZlhZvkt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235655AbiLVVSS (ORCPT + 68 others); Thu, 22 Dec 2022 16:18:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbiLVVSO (ORCPT ); Thu, 22 Dec 2022 16:18:14 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64BD81E73C for ; Thu, 22 Dec 2022 13:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671743848; 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=JvoMNsJvzMmJ+w485oCvbJgOGlOvC+kCcpkVN/ffzRU=; b=ZlhZvkt1ZHFOHoejwRn74jaguvWENAxne55JpkLWtaGEatWQdOssWVxRAFdUqrFfvJxAKP r6jh++bLpyHDQFAdnii73cHZaF7sW9tj8uCW4ZlwMsJjId5sYWOEU625rEOiDwCYKF42gd zM67RI2VPaAXlH9GXeIeD99HYN0zz/Q= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-360-VS9mfCa-NwCmbM8h7-6ixQ-1; Thu, 22 Dec 2022 16:17:25 -0500 X-MC-Unique: VS9mfCa-NwCmbM8h7-6ixQ-1 Received: by mail-qt1-f200.google.com with SMTP id e18-20020ac845d2000000b003a6a5cbbebcso1223593qto.20 for ; Thu, 22 Dec 2022 13:17:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JvoMNsJvzMmJ+w485oCvbJgOGlOvC+kCcpkVN/ffzRU=; b=huxXNPIzKO5qSlt2ldnbR0T7qj91S2D30VI17QzQonHwe8aS7h+bIQiXgVNLaRfgKO NoSbfc5NwZtSZ2+RtVlY7mt5lWAYu14MehDDls8RPgQz9US2n1j4U7D76acjvwZ5m52z L80l+fmb03UMcHLPUfAeh0cdtiVACH8/ocIwsIeej/UbbFsmYUTrCgvvCYdNoQIAosTf wdb1/TAqAwkc1Clux5NRqON+4d/J6Uo4gP4WbFNh7YHEzLm42foZSQX7fbij6yCw+H0B YuqK3IXINffeis6Hmfx6xFEbKSyEmv3UxiN6b/qeRLlpnZoyEhYIt3HiRn5+jULCqUmT JA/A== X-Gm-Message-State: AFqh2krjfKi/wgDWqw0gAQfXhuFcv+rBPBln1zyuG6jL6P5Rh29v3pdb aC2AbIV5Xek7hUz6ZcuyhchdI55BRfTcUPclGNpOOqCO+AQxBTyzMFg2wmLUUl3JQw64GrADH2Z SVQdmhuQUx7TPOqUfXrOIZiBN X-Received: by 2002:ac8:7616:0:b0:3ab:5f5f:a0d7 with SMTP id t22-20020ac87616000000b003ab5f5fa0d7mr10184620qtq.2.1671743845525; Thu, 22 Dec 2022 13:17:25 -0800 (PST) X-Received: by 2002:ac8:7616:0:b0:3ab:5f5f:a0d7 with SMTP id t22-20020ac87616000000b003ab5f5fa0d7mr10184601qtq.2.1671743845312; Thu, 22 Dec 2022 13:17:25 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-45-70-31-26-132.dsl.bell.ca. [70.31.26.132]) by smtp.gmail.com with ESMTPSA id fy15-20020a05622a5a0f00b003999d25e772sm898838qtb.71.2022.12.22.13.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 13:17:24 -0800 (PST) Date: Thu, 22 Dec 2022 16:17:22 -0500 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mike Kravetz , Muchun Song , Miaohe Lin Subject: Re: [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection() Message-ID: References: <20221222205511.675832-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221222205511.675832-1-david@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 22, 2022 at 09:55:09PM +0100, David Hildenbrand wrote: > Playing with virtio-mem and background snapshots (using uffd-wp) on > hugetlb in QEMU, I managed to trigger a VM_BUG_ON(). Looking into the > details, hugetlb_change_protection() seems to not handle uffd-wp correctly > in all cases. > > Patch #1 fixes my test case. I don't have reproducers for patch #2, as > it requires running into migration entries. > > I did not yet check in detail yet if !hugetlb code requires similar care. > > Cc: Andrew Morton > Cc: Mike Kravetz > Cc: Peter Xu > Cc: Muchun Song > Cc: Miaohe Lin > > David Hildenbrand (2): > mm/hugetlb: fix PTE marker handling in hugetlb_change_protection() > mm/hugetlb: fix uffd-wp handling for migration entries in > hugetlb_change_protection() Reviewed-by: Peter Xu Thanks, David. -- Peter Xu