Message ID | 20220215144241.3812052-39-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 6294BC433FE for <linux-mm@archiver.kernel.org>; Tue, 15 Feb 2022 14:44:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76A0E6B00A3; Tue, 15 Feb 2022 09:44:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F4D46B00A1; Tue, 15 Feb 2022 09:44:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AA866B00A3; Tue, 15 Feb 2022 09:44:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 2BC316B00A1 for <linux-mm@kvack.org>; Tue, 15 Feb 2022 09:44:03 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E1500180AC336 for <linux-mm@kvack.org>; Tue, 15 Feb 2022 14:44:02 +0000 (UTC) X-FDA: 79145283924.15.F5E13D6 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 1D082180011 for <linux-mm@kvack.org>; Tue, 15 Feb 2022 14:44:01 +0000 (UTC) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21FEi0eF006569; Tue, 15 Feb 2022 14:44:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=+4nU7Ofk1jrXrP4pqOdfm0N2E62lly6HrFJ1/GN1vsQ=; b=0054uSXeOgvt7ixZyHpzj9nO6D0S1c84sT1M5JmaNXLeUKEWurPIV0FZ+P43LMc9x/Q/ BpUR0co1UciCmLnDoHue/IImMGUki47wN5s3ezT/h6JOIsKB2uvOhy8dVTVq9fOGv8c2 1FgG/utDophgCbvmvnjbBRELWsi5NKeLbef3sTO7w6QYSu9XDJzXjO7yrYkwaVXt2S/y eZ5YhFg+IvPvvWxvLagCKtD/+EUGCIdf4JWPYHQ7/aovAM0CIVculcx+FRt30kRmIyQ8 9fQHr2C2RdAqoBFhiVXg2wLXynSxsNproZorgJJE53Wt51CXkz1YARArZZ3TrdoYHQte EQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3e86n0hgd6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Feb 2022 14:43:59 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21FEeT4J145723; Tue, 15 Feb 2022 14:43:57 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2042.outbound.protection.outlook.com [104.47.74.42]) by aserp3030.oracle.com with ESMTP id 3e62xeqfex-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Feb 2022 14:43:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JNei5QIZn/AZuX7q7chlg+s6Zcffin9GeR07o44c93u9EBfl/dbPksG6ngY0motUwMp1CT+2TnvF1WuA8Udi4l18lIOlwm6q3RTFOV1xIP+XMzcBdUN9o1oITHIiloQ+dUujo9Gz4pYfIrLWndADVgGXmbJrjZG6cexqoQuA5+IxvtKwZqX1PeialUSjTcD56bBXfv/XXrTU8STHXTm5hgJXVtaUhJfSy3TGYt2C0iNoRSJFjSTtjecQycsgzXxyMFKTRu2HfJWEM69xaofsnWdxxEdFpIC4DmX4KJUNfRBw8zynS4SYURHyqs4MrTbHJFL2axXZbWVJTk+yY9Zbpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+4nU7Ofk1jrXrP4pqOdfm0N2E62lly6HrFJ1/GN1vsQ=; b=OrH5TPT0ryLH+WCWfn3WIa/1nJAuw3blupRAf/4/R6VO5OqrRkcpsHCrjTYtXDnGgpG0FJemkQLBeIj75xoVy+ObqJ0/jvXBjemJf3xITKMaIJll+y4D/dbdRpWznfdUcOUZaTZ8UjNMSwSZQtCj9VhcrXJLdZESUfN7BCB0ienpLpCbBnkGAAPSYYri0ewJcDATHhzWmy9LiZrlTcfFLZHbtYB8uDqBFod/Z3UoRLRw+sys2W5k/E9FBaQcbtvCMrFJs9PGnZX/hIFSyl9qva68AGWs+L3F4MvRat8bujetDbajqOpLKg17anT06yKWtv/9k/RJD/wxpYqjH5zBjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+4nU7Ofk1jrXrP4pqOdfm0N2E62lly6HrFJ1/GN1vsQ=; b=lHNfikdhPqzNKV6v8dMBjlT8J4DnGJwCdIYDUd6NkOJx8IPHB078piZjLP0Lg9dzibAVayVLIK6vFDV40hz7p1BF+HQuaEkIlt2LuYdgVeCE5Uou6wwisDum8WOccHvdwxQ8BrG//lhvhLSAwzRFg4nN4HAvRChVIGRoxUEHT8A= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH0PR10MB5578.namprd10.prod.outlook.com (2603:10b6:510:f1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Tue, 15 Feb 2022 14:43:53 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::899e:951a:8129:8ef1]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::899e:951a:8129:8ef1%4]) with mapi id 15.20.4975.019; Tue, 15 Feb 2022 14:43:53 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v6 39/71] optee: Remove vma linked list walk Thread-Topic: [PATCH v6 39/71] optee: Remove vma linked list walk Thread-Index: AQHYInpe5DjP0pd0X0y058OZnDV7Mg== Date: Tue, 15 Feb 2022 14:43:17 +0000 Message-ID: <20220215144241.3812052-39-Liam.Howlett@oracle.com> References: <20220215143728.3810954-1-Liam.Howlett@oracle.com> <20220215144241.3812052-1-Liam.Howlett@oracle.com> In-Reply-To: <20220215144241.3812052-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.34.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37543f4f-d7c8-417b-783a-08d9f09196a6 x-ms-traffictypediagnostic: PH0PR10MB5578:EE_ x-microsoft-antispam-prvs: <PH0PR10MB55788351E1112DA382AE2564FD349@PH0PR10MB5578.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kF03VONjTrIcPAR04DzKr5lWsGCdv4YTQgbWhSqgRwWNUAYM6cw0P3gZgKNn7ENeXrdVdo8k1aY+2PKuYd5OHmzi/RhIyIMIHrwWkINXuVSMlD0Wdwl9Of3njJW9/tdePHfCy5EyJqAA//Z8isVogRsCk86RVZzK79yB1APzjzfXsx42T6esieuDRbVslZbmr9jHJM9Fx+keWtQRiZUbLDOzfnnvwQ9jGrzJRGoq/FNz7qs/q9fRiqAj4b52DH1zcI9n66Gh24+vHE3rRbu2rKIBMLpDJu5Y8AI8uECVydO7Ha+DnUaEnIsobYxdkqy7cP5zHX7wXDaIx66j8K6pGXxNhg7Thk1eEMz8pgNvkHAfdODlmKtuj5VSwTqN0mh0urZgOwFNn6PR6qk+N9EtyowagYBHFLh2dqrNDKY93K49v0Eux3wqkFirM9Dm4FSiWxCqPH32852FQOSReggro5gOyhc8AxWqWe1CDQH+3LTVxVYn2jZEGKZXanzooBb+S+eU5YTITLVgCSqHNEBTIE3IzjWVBbwTejMxgaVml41gMgCZ3SObHmkRA4GWw5VflmRFe+wFJKpLOnBsVDS8MAeUN/W5Shs3EfIJA33UZdWuiZNPu3+IOvDj32kLl2h1RCtStyBB19u1EUFGzDMcAloBlu+zJiJdacwFnLo4LMAC7UFP14jBb/kigTEKVuAu/HoXkpEO/Rv1V5DDk+5VZw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(316002)(2906002)(6486002)(83380400001)(38100700002)(110136005)(508600001)(91956017)(64756008)(66556008)(66476007)(66446008)(5660300002)(66946007)(76116006)(8676002)(71200400001)(38070700005)(44832011)(86362001)(2616005)(1076003)(122000001)(6506007)(186003)(6666004)(6512007)(26005)(8936002)(36756003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?ERuzJroATcEBYs1wpRjdKjm?= =?iso-8859-1?q?c8/rmuN3KmM9jbT639g0UbuSvqbiizgINrMFRvDNE8DAoiON7DZFqX8fBCJX?= =?iso-8859-1?q?WV65uGrSXLSuJLBOWEkA37ZlqOyN7l9n0qif3ZGkZnCeCpImkbt1cHeWLrnp?= =?iso-8859-1?q?D09XZSrQFMzPfNAeRdz46VeRKWVdThRsDoXkwGaGyw/Sk3CIVaPV4aC8H7NI?= =?iso-8859-1?q?h0W3YTwPCJorAg/VkVp9Puelh1RN3g8wtW6w9APF9dURIpb8vPeg0al0glqH?= =?iso-8859-1?q?aEzBgruOh56t/FfwpNfvUsljN2uFv948VjyjMN+ghvxMXqldYLPv+47+Z+fG?= =?iso-8859-1?q?Jc7YmQOk4g/gEI3cZptpOxltKrc2sBme0hcrX4VsV3heG+zliTi29upjlGoa?= =?iso-8859-1?q?fhPD3/GqLR1Ici+raprjgJHQRTYSS4bdHBtbMAfjzM0+b4E1GFYHxKZfEsQ9?= =?iso-8859-1?q?w7dScjjtFg0S29gc3a6lMdScvro35jFtQ//O2HNa1VgglGoTY+D9zsRsY8zC?= =?iso-8859-1?q?XkQIgLA79CQPDY/A9Pibtv/+IKRlyILHXQq924Nz2SCDU+9/QZbbXUhPPC+W?= =?iso-8859-1?q?a36WRhOVaD2ZZgubnJm1G7FufXGXF0azMCCy2aMIlhTHknwk/XgqDsHwTDyl?= =?iso-8859-1?q?n0sCd0/IoUkgMi88QFs3cR2HWYfbrGQLZMsW5/cEGKDRFgvoe79xBroEPU/0?= =?iso-8859-1?q?oJtyAAlPnidk5BMcFjZwIyJG7iyN15UJgL9HZFml5la7/R95kAgHzTsWkFFE?= =?iso-8859-1?q?PIOqnxgWPC4MQrmcL3oWoE9umbrMPjBe41QDbt/bhaxy0Xma/0Bag25wMCzX?= =?iso-8859-1?q?lBxvByuM94+sbTe2+FX8QYBcXVGlDtcEntDSWxNfn86Rc3A3P3oOhhAMweVN?= =?iso-8859-1?q?qQeu12st2wyM8du1amQZdDj2xpzSv9EighQwFNlRsYQGvnaKm0vGq2VwiToH?= =?iso-8859-1?q?DPye9Nwn7fjK9BzyD2OL+JbAqYdEE74VhiVbE288wK3RxOwO8WceHcX0B1TX?= =?iso-8859-1?q?85obJh5ZjlrHCXMw9t3KXit1dB+2P4PPvXDnnLcw39uCj9zBPW91MCuvaEi7?= =?iso-8859-1?q?xiktJKpva2uEkE389qdyH4E/+aU75EpmSYcxScC2YvjlBkp41kvBmSpCzyHK?= =?iso-8859-1?q?Yi2holj4HszZwq3XJKtihy3yIiOrMZvkarFXQz/Urj8jhjjvnrFtqPEutvhj?= =?iso-8859-1?q?SNRmnrXQuQ/XK7D+DVW44DO8Zv/ZyXc/LMqFXTEBBvnsUuBs1HYOhdkScbpx?= =?iso-8859-1?q?BuIeJCTm+Mch+lyk+OfXMHLmZcdQl28Nh1lUsTVfcWYDDMGeFr+x+XduSkKj?= =?iso-8859-1?q?ZNl35Ryd6crfGNjXnsEnfXVCvgdhq2tELCyyY8UOzec+gfzTdCCrdHlfbVlO?= =?iso-8859-1?q?jR2itchvrOTRul40mONRjNZnT8JiYUDlvglJnQ4OaD+ChgGMSVSiD+XFg41a?= =?iso-8859-1?q?+SQ9mvdBLNB/yOfrdcSZ3AcNlu4cNeYrHM56neUl+4LmTrpT+2+WUun+xn9c?= =?iso-8859-1?q?WoAe4qTFRwrDje+CN4sA+V+pXdZhvtFCUozLNfd97f5puA/83/OB44znBAT0?= =?iso-8859-1?q?zxqXYtv9nPMuFLqza6iwFrdmWrebF2L0aWXUlsU6XFIZYA9Toy+v2bucsxaD?= =?iso-8859-1?q?r1XNQ9OEb4W5DtxKo4iX2a6FoM+4qMjsWTxxaKweO8WabGOKudyk/GT/vb28?= =?iso-8859-1?q?=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37543f4f-d7c8-417b-783a-08d9f09196a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2022 14:43:17.4326 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: a7IcQBwcfIE3l5khDR1qrpu6ZgvSgQzW4El4nZmuTH44IezTA4h3VKOrSluARa3BkuWR6deG5fI0w6AJiqwh+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5578 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10258 signatures=673431 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202150085 X-Proofpoint-ORIG-GUID: fA-Dj_OqZmUGAzHdgxNkTbgThso14vZx X-Proofpoint-GUID: fA-Dj_OqZmUGAzHdgxNkTbgThso14vZx X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1D082180011 X-Stat-Signature: y74qzuo5mki3xx8z5rbf8intgpqaj4wx X-Rspam-User: Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=0054uSXe; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lHNfikdh; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf06.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=liam.howlett@oracle.com X-HE-Tag: 1644936241-463017 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: <linux-mm.kvack.org> |
Series |
Introducing the Maple Tree
|
expand
|
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c index b25cc1fac945..177575c445de 100644 --- a/drivers/tee/optee/call.c +++ b/drivers/tee/optee/call.c @@ -342,15 +342,18 @@ static bool is_normal_memory(pgprot_t p) #endif } -static int __check_mem_type(struct vm_area_struct *vma, unsigned long end) +static int __check_mem_type(struct mm_struct *mm, unsigned long start, + unsigned long end) { - while (vma && is_normal_memory(vma->vm_page_prot)) { - if (vma->vm_end >= end) - return 0; - vma = vma->vm_next; + struct vm_area_struct *vma; + VMA_ITERATOR(vmi, mm, start); + + for_each_vma_range(vmi, vma, end) { + if (!is_normal_memory(vma->vm_page_prot)) + return -EINVAL; } - return -EINVAL; + return 0; } int optee_check_mem_type(unsigned long start, size_t num_pages) @@ -366,8 +369,7 @@ int optee_check_mem_type(unsigned long start, size_t num_pages) return 0; mmap_read_lock(mm); - rc = __check_mem_type(find_vma(mm, start), - start + num_pages * PAGE_SIZE); + rc = __check_mem_type(mm, start, start + num_pages * PAGE_SIZE); mmap_read_unlock(mm); return rc;