Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB86AC636D6 for ; Sat, 4 Feb 2023 06:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbjBDGuK (ORCPT ); Sat, 4 Feb 2023 01:50:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjBDGuJ (ORCPT ); Sat, 4 Feb 2023 01:50:09 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02A5430E8D for ; Fri, 3 Feb 2023 22:50:07 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 641E467373; Sat, 4 Feb 2023 07:50:02 +0100 (CET) Date: Sat, 4 Feb 2023 07:50:01 +0100 From: Christoph Hellwig To: Ira Weiny Cc: Sumit Garg , Andrew Morton , Al Viro , Christoph Hellwig , linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org, linux-mm@kvack.org, Jens Wiklander , "Fabio M. De Francesco" , John Hubbard , Matthew Wilcox , Thomas Gleixner Subject: Re: [PATCH v2 1/4] highmem: Enhance is_kmap_addr() to check kmap_local_page() mappings Message-ID: <20230204065001.GA18482@lst.de> References: <20230203-get_kernel_pages-v2-0-f1dc4af273f1@intel.com> <20230203-get_kernel_pages-v2-1-f1dc4af273f1@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230203-get_kernel_pages-v2-1-f1dc4af273f1@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 03, 2023 at 08:06:32PM -0800, Ira Weiny wrote: > - return addr >= PKMAP_ADDR(0) && addr < PKMAP_ADDR(LAST_PKMAP); > + > + return (addr >= PKMAP_ADDR(0) && addr < PKMAP_ADDR(LAST_PKMAP)) || > + (addr >= __fix_to_virt(FIX_KMAP_END) && > + addr < __fix_to_virt(FIX_KMAP_BEGIN)); Isn't the second check inverted?