From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8673AC43334 for ; Fri, 24 Jun 2022 02:46:08 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LThML5vRpz3cKB for ; Fri, 24 Jun 2022 12:46:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=WyfAml4N; dkim-atps=neutral Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LThLk3s0jz3blX for ; Fri, 24 Jun 2022 12:45:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=WyfAml4N; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4LThLd09Mpz4xDK; Fri, 24 Jun 2022 12:45:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1656038729; bh=FsNPhLyLQp+amgbFWjLHPt/TWXWo4hOyqccddO50Dxg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WyfAml4Niz8W3LAIUYtA3TTVSHHKZOsJJJu5kLv4FtmDCD1eYxS+W4sEcCet1QKHj 0IMrTzdYHLZGaCGCRZRTzn4pxrV4fV/3/6M1lVzlJdYTu+jjalxzCTY+2i3+eWKUzV xO+/aq/1RKTo5wBveuVudeVekc1sx7NizVAbYz2xtDCU/0KcHwrtKcEqQ31ZNxLcCS jRsbzVNbIrDEAfOsy2MeQCb+/ZYsb3EBxlGdItXwiAKTMjRQ7iBJLsc16ATQxaogMb u+JKXyXS8U6W6ahPkXtSkanQFfcRa6CQ0yT3iPv/0C/AnD+wGZG35hkyPYQ9Pc0Xot 36vN0bG94jESA== From: Michael Ellerman To: "Aneesh Kumar K.V" , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 3/3] powerpc/mm: Use VMALLOC_START to validate addr In-Reply-To: <20220623122922.640980-3-aneesh.kumar@linux.ibm.com> References: <20220623122922.640980-1-aneesh.kumar@linux.ibm.com> <20220623122922.640980-3-aneesh.kumar@linux.ibm.com> Date: Fri, 24 Jun 2022 12:45:24 +1000 Message-ID: <87bkui6apn.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mm@kvack.org, Kefeng Wang , Michal Hocko , "Aneesh Kumar K.V" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" "Aneesh Kumar K.V" writes: > Instead of high_memory use VMALLOC_START to validate that the address is > not in the vmalloc range. > > Cc: Kefeng Wang > Cc: Christophe Leroy > Signed-off-by: Aneesh Kumar K.V Isn't this really the fix for ffa0b64e3be5 ("powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit") ? cheers > diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h > index e5f75c70eda8..256cad69e42e 100644 > --- a/arch/powerpc/include/asm/page.h > +++ b/arch/powerpc/include/asm/page.h > @@ -134,7 +134,7 @@ static inline bool pfn_valid(unsigned long pfn) > > #define virt_addr_valid(vaddr) ({ \ > unsigned long _addr = (unsigned long)vaddr; \ > - _addr >= PAGE_OFFSET && _addr < (unsigned long)high_memory && \ > + _addr >= PAGE_OFFSET && _addr < (unsigned long)VMALLOC_START && \ > pfn_valid(virt_to_pfn(_addr)); \ > }) > > -- > 2.36.1