From patchwork Thu Jun 23 12:29:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 12892321 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1768C43334 for ; Thu, 23 Jun 2022 12:30:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5BA558E014F; Thu, 23 Jun 2022 08:30:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 568838E0144; Thu, 23 Jun 2022 08:30:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 430968E014F; Thu, 23 Jun 2022 08:30:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2F8A88E0144 for ; Thu, 23 Jun 2022 08:30:01 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 061FF2094F for ; Thu, 23 Jun 2022 12:30:01 +0000 (UTC) X-FDA: 79609432602.28.0B48CF1 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf19.hostedemail.com (Postfix) with ESMTP id 645481A00B0 for ; Thu, 23 Jun 2022 12:30:00 +0000 (UTC) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25NBogOS003688; Thu, 23 Jun 2022 12:29:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=I0XDoqGAyD9wFQlqMc8lxz6HDUp5LOCjaeVn1njh074=; b=otjtix2pSjz9u7VmbEFDcM8gMhYNWciWNnmg21J9JA04jPwbH43QSwjpSKwhPPGdjMTC ipXE8k1FTHGKBzn37KqZ76onVX4DJdZQ49uZRA00ZYfghTHdkkOIrBrPGqJQjs/fP285 4Qre1wT74JUKMsWTQhMpWMiP708WE5yla+40+zbVFEK4GBDysuMeoWfAaznJt/LU8Od8 gLytjCV9Zo6J/+iALdyyNYcYn7iD63fRD2AVS864w7ApQZ/pEo9tUZuBJGNDXn9OsUax CMCKKzEpjUvh/3rwRbNlyRdwNxX5ZBrzCcegDBbm5t4XKb7edzwoTcJBmT2f2Lpw+VLa Pg== Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gvqnj1327-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 12:29:45 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25NCKcXa003896; Thu, 23 Jun 2022 12:29:44 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01wdc.us.ibm.com with ESMTP id 3gv5cjwxtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 12:29:44 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25NCThKB18415966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jun 2022 12:29:43 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BADF628058; Thu, 23 Jun 2022 12:29:43 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2393F28059; Thu, 23 Jun 2022 12:29:41 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.18.68]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 23 Jun 2022 12:29:40 +0000 (GMT) From: "Aneesh Kumar K.V" To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au Cc: linux-mm@kvack.org, Michal Hocko , "Aneesh Kumar K.V" , Kefeng Wang , Christophe Leroy Subject: [PATCH 3/3] powerpc/mm: Use VMALLOC_START to validate addr Date: Thu, 23 Jun 2022 17:59:22 +0530 Message-Id: <20220623122922.640980-3-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623122922.640980-1-aneesh.kumar@linux.ibm.com> References: <20220623122922.640980-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: lqFXGDskXzs26GTPeZJKCdYL15mWLfZt X-Proofpoint-ORIG-GUID: lqFXGDskXzs26GTPeZJKCdYL15mWLfZt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-23_05,2022-06-23_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 phishscore=0 mlxscore=0 mlxlogscore=870 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206230049 ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=otjtix2p; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf19.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655987400; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=I0XDoqGAyD9wFQlqMc8lxz6HDUp5LOCjaeVn1njh074=; b=FHOPI75Ig2XJ95fduQ5qn95qeHcrWk3UihDi/VVdP1PS4a7l7AOSeD/rienB304z/ajML5 PI9TYvdBEY1KMZaxWIYJXBi4xOpBK5ZYKDxKkG2R7FXPWQGz6UUR5CJ5JrEJqlGtX9NuKP OXAY7n71TdSoF5R4i/kyO5MrcqDhAB4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655987400; a=rsa-sha256; cv=none; b=uo11XYX3sL1pyopX1LJcfty0bNU4Cx/pFmZOHxlGi31HInUTYTjbG82J6iMnMdSTlIuPJ1 LDP9rnhhxJTATZsMlS9hHMEiHTTIGlUzaGHJM4dzsLRoriNzPMVOYkACDRpQz8t5erwL4b o4zrY5kdlI+S79lNIGkZaI2bLwj3cAk= X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=otjtix2p; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf19.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com X-Stat-Signature: 1qiqjigo3rxzfoh3fahuppm7py5o4411 X-Rspamd-Queue-Id: 645481A00B0 X-Rspamd-Server: rspam12 X-HE-Tag: 1655987400-499738 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- arch/powerpc/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); \ })