Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1877852iol; Fri, 10 Jun 2022 17:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV8LP9Lpa0dBQHsr0t/d8WcN8nYYVcmJMyQOmX9NCFLAPuA0mEhfddrfDTzsc/Mfh7LFCq X-Received: by 2002:a17:906:66d4:b0:70f:e86d:61b with SMTP id k20-20020a17090666d400b0070fe86d061bmr36316271ejp.401.1654908065726; Fri, 10 Jun 2022 17:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654908065; cv=none; d=google.com; s=arc-20160816; b=ZXkpwHCyXLAjhD4W2DSxXsg+KdKYV2VV4kqmavG6nVTRc2SzsEzficfDNpeIG3JJrP uJk1V7gPEhNPiKD/AHt12foq+K9pggCgNcPsh5Mfpx+m4609LXgR/Z3sf//Xg5u7mLKR 4q0+/hljz++TPPn+Q67D3ypY057XgvD3unylip2Nh6SNRa8UIb029/2MkgXfhlieonq7 acef4RxQ3fSomv4J8HMUaPuiCia05IzGxPovoSPc33iybOi78LRkEeC+PN1Sq7R+Pvu4 WkvAYqBOw+EykIgDeaDSaYvDW/l96PflQ7Y9fIny2R8VtZpoFLdrMDe/BXrzKR0PwFck b9/Q== 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:sender:dkim-signature; bh=orRX8bHVwIqsWUTRBwudWprTpQENg/NL+oJ4ZA+qZSY=; b=tOLmy9E1dezMouK/pgkHpYOyZ6hrMts3RiMISjLP/tsXhPPUn8fNEcQf1KNOLuW1if wz47WW2gUfkiaVndkUuwQ75DKCmOarMdUvMbnc5WXz5OfW81k6nLNVhNxO87mVkJs0YY lBQ1z61YyC2iq3Poic3U8eKGQne4nudxyVxfMhHExZ7GpXYZYpbb99TsPNGR40v4h0SM TxeLoFiZZ1NeavfZkKKoZl5726qajZMw6AqESJ5unq6U/lnR2oZ9HShs3JUI0gAU0N82 ZexYe/XcDudVOG/ljNuXDVTbT3JEJY5w0ETKPsIZLiqS4PuHzq6yM1EGcW9O1U3purii ZNSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="XX855K/K"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ge24-20020a170907909800b0071017c31a82si426373ejb.567.2022.06.10.17.40.39; Fri, 10 Jun 2022 17:41:05 -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=@gmail.com header.s=20210112 header.b="XX855K/K"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242840AbiFKAV6 (ORCPT + 99 others); Fri, 10 Jun 2022 20:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiFKAV4 (ORCPT ); Fri, 10 Jun 2022 20:21:56 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40D6E659B for ; Fri, 10 Jun 2022 17:21:55 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id i1so545770plg.7 for ; Fri, 10 Jun 2022 17:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=orRX8bHVwIqsWUTRBwudWprTpQENg/NL+oJ4ZA+qZSY=; b=XX855K/KCSKksyKnZmDsq5LuDRpawKh8kCwaNYSD3SP6Ep0RiA+aK04+29Hj15VSGb JWWokbqxXkNXk/jZGM6Zx1c7qXldpMbhCf0V+NzDjbCOcz56XaWgu2mHkMMGwa0gD4UC JCS2kRNxOsPLQk7JnL2qpSjI23R1MXgtlteHAW5Ln6pSPe8Y53VzOlBg4TW3vgWhxmo2 CftyR7g9fpPW7NcbSV6OUggXfrDWTDIPMZ+vp7AEm7/C19WKRF0ytvoS8QjC6WZkIm/d NEZleUq8wTkzzh2Qj8KQnRCQL0n98GNqnngu6b0GWxeN0mjYmDtSNrINCfnCrs5tMxkI MwtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=orRX8bHVwIqsWUTRBwudWprTpQENg/NL+oJ4ZA+qZSY=; b=47PH0jRBOx56zKhvEVcX6LOP2HDy5yEdBWRuzV3UpO5x3EOxsESVpddVzELHL2tYo0 FdET8a1oh31y5qwWWecLv0qgZU62ZJINzubTC0IrIV8vzilRH6hv2Rs4ysl2H9Xu6W/K WCWHooHW+d7Sp+Lf3PB7ggzkUY6pOnKuy2tAIkXhIBkbd4hnNSTDnzU3i/Guc+avnx51 fhqv5794/l9r9I1qGncaIeakQCM7dHu6B+fmdEY45K/t1BHuSUdf7Cu9USn1GT0d4y5Q 68Xm1uQQWS9yrYQJG5EeeREwcANGMeSpXQv+wGrgUJdRz97rZhFSv2lITHGayz/4XOMm +B+g== X-Gm-Message-State: AOAM5333B4RtAE3fT7+mQWLnDdQcUGMTil4fiY3M4V/r2TwmQzafLFe7 6TWc9fZnRLtDS2kHe1YVAZY= X-Received: by 2002:a17:90b:1b48:b0:1e8:5885:f8b with SMTP id nv8-20020a17090b1b4800b001e858850f8bmr2354020pjb.122.1654906914680; Fri, 10 Jun 2022 17:21:54 -0700 (PDT) Received: from google.com ([2620:15c:211:201:6481:5f82:42f7:8bcc]) by smtp.gmail.com with ESMTPSA id w1-20020a62c701000000b0050dc7628148sm162963pfg.34.2022.06.10.17.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 17:21:54 -0700 (PDT) Sender: Minchan Kim Date: Fri, 10 Jun 2022 17:21:52 -0700 From: Minchan Kim To: Alex Williamson Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, jhubbard@nvidia.com, joaodias@google.com, jgg@ziepe.ca, david@redhat.com Subject: Re: [PATCH] mm: Re-allow pinning of zero pfns Message-ID: References: <165490039431.944052.12458624139225785964.stgit@omen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <165490039431.944052.12458624139225785964.stgit@omen> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Jun 10, 2022 at 04:35:13PM -0600, Alex Williamson wrote: > 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)); Thanks for catching! I don't think zero pfn could stay in the movable zone or CMA area. Acked-by: Minchan Kim