Received: by 10.223.185.116 with SMTP id b49csp3210316wrg; Mon, 5 Mar 2018 16:37:09 -0800 (PST) X-Google-Smtp-Source: AG47ELsnksGsV9e2PKZIT9hYIJFrsvdZMMmtm4lyfvU4sXe0rUWnDxtnCvsvN0KmBpVVqHWZMiQX X-Received: by 2002:a17:902:8b82:: with SMTP id ay2-v6mr14706885plb.12.1520296628906; Mon, 05 Mar 2018 16:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296628; cv=none; d=google.com; s=arc-20160816; b=x94wIBzHiAJFCw3kXyPQwach4vvy0HrJr05WG96/KUKzZF1R9wj4VEjPGeMA+lekca FOOKz9GHhWxGSxuYUhFBBAeR7muSW13fODfB3eb0ZSYOdsjlkQTMd19WOlq9vZoB8a9Y Y2LziydyhgPvC99Sw2dIRYc8Dwsuv4i6uiwTqqt1uWzUQQ3v80u3cms4BRWxSTgiAuJ8 IZ+oXXd024EYgUA+gsJwk8npJo/5AMNuDakE6qbnZxgegzl5WQFmckFjqqiYeKgv9iLa HRGZ5X52lb3PntyOg9nm8vpfdlIt6rGn0chvweijdV2SM12jqSl2OrrgjeckAC7NXEya fXkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=ThHOEZY7L4BENk/u11Bd9oEiSXYHFF3hH369H5ivfRE=; b=SKgDbtmMmb7J8Zp/NPI1y4VQMNSIGgKgzh4pzcUZpFSaKh4DLWQZ8OjFlvnOWS6AJP WFmWbBeI3fC+AhNc7BQyIvlMDTUycjnrSPKeq7dr24DVClnfP/pb4IJqGV7C+wqAxOn1 8Vo9ymsDmfWRGMM6sduuVvd3Vx+iimmTUUe5v5sOPN8EcZZn+yDdMUVAALCBkZZIoAN1 rkSAdR9onE2HDG6M3//qV8mB+tJPh//96Ea0gyVRPKTDRmqBEgtCYbaErTyHBGG76Ber uS/bBdCXh4vHMlO/c7DGQ+/bEv6OpC07PoXXlRC6V1wjnEqPN6e+j6qwBYZJefJfnDOu pcyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=nxQKhUXR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d70si11027845pfj.238.2018.03.05.16.36.54; Mon, 05 Mar 2018 16:37:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=nxQKhUXR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933570AbeCFAfM (ORCPT + 99 others); Mon, 5 Mar 2018 19:35:12 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56408 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932847AbeCFA0f (ORCPT ); Mon, 5 Mar 2018 19:26:35 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260LgUx034926; Tue, 6 Mar 2018 00:26:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=ThHOEZY7L4BENk/u11Bd9oEiSXYHFF3hH369H5ivfRE=; b=nxQKhUXRjhNQZVTi1TbINIBg82Z2LyCNsBzrY9vN3ZsaydYxAnIKlceEBEgCQ4YQzsYs r0hds6WJl6BGIDTI+2JgAFlf//J8o+2L3CGRy2fvlYPW2bVr9YQnCsKJZoeCz0w3z4Dh 2gEq/wfS3Q7He7zQnui/SDxuVo2+PXsTckYIGvsRJO7Vo36ib5V9BqlLUXHCgAEMQOHj ex8La52czaBIgk+y7gwX/5177gxFfywgVF9tyO0wBd+ZxjPSwAM/Ag/C4MEI482vddAi hMt9aB58Kmn0QJMdXhqsLeBdPnK87SfQGNfW4H2bjag4NPpL0nQkfG84zgoS8uPNq4ng /A== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2ghe3kgg43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:31 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w260QUk9030679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:30 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w260QU7i000354; Tue, 6 Mar 2018 00:26:30 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:30 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 36/65] kaiser: tidied up kaiser_add/remove_mapping slightly Date: Mon, 5 Mar 2018 19:25:09 -0500 Message-Id: <20180306002538.1761-37-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=765 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hugh Dickins Yes, unmap_pud_range_nofree()'s declaration ought to be in a header file really, but I'm not sure we want to use it anyway: so for now just declare it inside kaiser_remove_mapping(). And there doesn't seem to be such a thing as unmap_p4d_range(), even in a 5-level paging tree. Signed-off-by: Hugh Dickins Acked-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 0c68228f7b39c96cabd89bee3e1d6bd55926df80) Signed-off-by: Pavel Tatashin --- arch/x86/mm/kaiser.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c index 058d0886086b..190371071a02 100644 --- a/arch/x86/mm/kaiser.c +++ b/arch/x86/mm/kaiser.c @@ -286,8 +286,7 @@ void __init kaiser_init(void) __PAGE_KERNEL); } -extern void unmap_pud_range_nofree(pgd_t *pgd, unsigned long start, unsigned long end); -// add a mapping to the shadow-mapping, and synchronize the mappings +/* Add a mapping to the shadow mapping, and synchronize the mappings */ int kaiser_add_mapping(unsigned long addr, unsigned long size, unsigned long flags) { return kaiser_add_user_map((const void *)addr, size, flags); @@ -295,15 +294,13 @@ int kaiser_add_mapping(unsigned long addr, unsigned long size, unsigned long fla void kaiser_remove_mapping(unsigned long start, unsigned long size) { + extern void unmap_pud_range_nofree(pgd_t *pgd, + unsigned long start, unsigned long end); unsigned long end = start + size; unsigned long addr; for (addr = start; addr < end; addr += PGDIR_SIZE) { pgd_t *pgd = native_get_shadow_pgd(pgd_offset_k(addr)); - /* - * unmap_p4d_range() handles > P4D_SIZE unmaps, - * so no need to trim 'end'. - */ unmap_pud_range_nofree(pgd, addr, end); } } -- 2.16.2