Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1819915iol; Fri, 10 Jun 2022 16:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCZaSnS/yOwlN908qwcvySWnKpBz/5GD8PQDn+ihhW6e06kVXgKuv55cHg7YrUoaFgTuiS X-Received: by 2002:a63:69c2:0:b0:3fa:78b5:d991 with SMTP id e185-20020a6369c2000000b003fa78b5d991mr42676021pgc.40.1654902349998; Fri, 10 Jun 2022 16:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654902349; cv=none; d=google.com; s=arc-20160816; b=KCqfUFLuRwFmVkffy6LOTJioL7PNtuHwcKdKDqOUely8RKtak/lQB8U3aNa18YOefG TTUd8iwSx5hX0GScRr2sb3Iwkaof1WuM4KrfcKOsHTgdvxcIP2NQIfJ6plQ+tCtQefzd aT3B9SrDItVsTcwCYxIW7bmNRtFwfwz4eaRWdZdBq1mrZtHqmvJP2w/iKxAtB1vGCI3o 52Odn69Hs9qU3jMlAJBgZ+P6l0HQuQrj1OQEZsJ0FPR4XS37nM2U8VQo6fHHFWLE24OC a89I44FOdrokF4E7B9G7AsGADgsQM+f2hIyDCyqt+qClI+sUw4nEVZbNKPL9RKdLXNdw oY0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=brhqSH0cfxiVMdkhaA/t1am/po1k847+vpjU5c9Z/Ic=; b=X+H+v6GlZNorm7MIALfu1pT43vB7FmqwIScYmHgOiGT0XzydDZ+3QUBtF5u4GcrQjR /sHrcucfzaVcqKAlsJbSXWbWZ71ra209rDK2Oaeazojudxxnb0WoMd7qf1PREYnLHq0J Ug9joXYlFSBHGFO93gIg2nS1BVaROpGQ73FVgWY3azQrQKGYtPttTllvuWKhGuKDbZP1 bHLCB72L5SRyw4E4uBZnSAU/MvmkOhZR5WOnSV9/2NOdsi0U6BQsNZCSu8dEEcnSDnyl DA/XLpEjT9RWBJtsP8RISdXS+LvayYbNqmh5Z76FxkNzhmRXsuI3FciT0KTXOn4E+G/6 C6uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dqgp7c2b; 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 b19-20020a637153000000b003fc5fe35f9asi487106pgn.415.2022.06.10.16.05.38; Fri, 10 Jun 2022 16:05:49 -0700 (PDT) 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=Dqgp7c2b; 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 S1347365AbiFJWfj (ORCPT + 99 others); Fri, 10 Jun 2022 18:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245351AbiFJWfi (ORCPT ); Fri, 10 Jun 2022 18:35:38 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FB6F391803 for ; Fri, 10 Jun 2022 15:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654900526; 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; bh=brhqSH0cfxiVMdkhaA/t1am/po1k847+vpjU5c9Z/Ic=; b=Dqgp7c2b6YoThDb7y22GLOY3oiRKaohzjNR+MMO2MPK/078dFnlVDuXI6l0aZ/q64Lc1cM GIZvfHoFGYxwo/RzTdwy9J5iSzDne5RCUobnBEM05PIX6VuwuAYZ0isOm2g3j9uz9FrxVy IL1LbG9X2GynvkMf8nf+IxJGjyvqMak= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-631-ERtf0sUvPCO1L59yA4nI4Q-1; Fri, 10 Jun 2022 18:35:15 -0400 X-MC-Unique: ERtf0sUvPCO1L59yA4nI4Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F32FE801755; Fri, 10 Jun 2022 22:35:14 +0000 (UTC) Received: from [172.30.41.16] (unknown [10.22.35.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B37EC23DBF; Fri, 10 Jun 2022 22:35:14 +0000 (UTC) Subject: [PATCH] mm: Re-allow pinning of zero pfns From: Alex Williamson To: akpm@linux-foundation.org, minchan@kernel.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, jhubbard@nvidia.com, joaodias@google.com, jgg@ziepe.ca, david@redhat.com Date: Fri, 10 Jun 2022 16:35:13 -0600 Message-ID: <165490039431.944052.12458624139225785964.stgit@omen> User-Agent: StGit/1.5.dev2+g9ce680a52bd9 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 The commit referenced below subtly and inadvertently changed the logic to disallow pinning of zero pfns. This breaks device assignment with vfio and potentially various other users of gup. Exclude the zero page test from the negation. Fixes: 1c563432588d ("mm: fix is_pinnable_page against a cma page") Signed-off-by: Alex Williamson --- At least I assume this was inadvertent... If there's a better fix, please run with it as I'm out of the office the 1st half of next week and would like to see this fixed ASAP. Thanks! include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index bc8f326be0ce..781fae17177d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page) if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE) return false; #endif - return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page))); + return !is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page)); } #else static inline bool is_pinnable_page(struct page *page)