From patchwork Mon Dec 4 14:13:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 10090469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A84F60327 for ; Mon, 4 Dec 2017 14:16:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A46A288BE for ; Mon, 4 Dec 2017 14:16:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF07288CF; Mon, 4 Dec 2017 14:16:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C371A288BE for ; Mon, 4 Dec 2017 14:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=0L8A+b8vWiv0QwGwNYcrH8OLZiyVZ5agQTE2ks/QvgI=; b=YUiyPJTuWVXIFvRm6BK1igH44B PwifyaNkAK9ViE5W37RZnwZgRIGzQI2X+Ibc71TOKmbsm64dEuKKM6+VTRrpUbpUvVLPgyOChQdB3 QA8QWAxynP1+jHiv896BtzKV2G5Vhvyjzvm+DvZmbDjOAM7gzYaI+2ok8uD0GTAiEEg2OJvtklu0Q lI29a9BV/qxnXRXYpIjrTV13WguPg8yxz2jLFPzpy4X7n59AQZ7x+hy8o+4A7QwabAhkV5Kemem0A c64IAmLYOsy8kYOeKOBJvclmsFjJ2et5x+4Bj965hG1zdvuQxMLhV7lAmJrHohPUxJprUezAYEeyC LnUxF13g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLrYG-0000o7-Sx; Mon, 04 Dec 2017 14:16:56 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLrVh-0004h9-Kg for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 14:14:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AD827165C; Mon, 4 Dec 2017 06:13:39 -0800 (PST) Received: from capper-debian.emea.arm.com (unknown [10.37.7.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5F2C53F236; Mon, 4 Dec 2017 06:13:38 -0800 (PST) From: Steve Capper To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH 05/12] arm64: mm: Remove VMALLOC checks from update_mapping_prot(.) Date: Mon, 4 Dec 2017 14:13:06 +0000 Message-Id: <20171204141313.31604-6-steve.capper@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171204141313.31604-1-steve.capper@arm.com> References: <20171204141313.31604-1-steve.capper@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_061418_636777_A7F4F0AD X-CRM114-Status: UNSURE ( 7.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, ard.biesheuvel@linaro.org, Steve Capper , Suzuki.Poulose@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP update_mapping_prot assumes that it will be used on the VA for the kernel .text section. (Via the check virt >= VMALLOC_START) Recent kdump patches employ this function to modify the protection of the direct linear mapping (which is strictly speaking outside of this area), via mark_linear_text_alias_ro(.). We "get away" with this as the direct linear mapping currently follows the VA for the kernel text, so the check passes. This patch removes the check in update_mapping_prot allowing us to move the kernel VA layout without spuriously firing the warning. Signed-off-by: Steve Capper --- arch/arm64/mm/mmu.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 58b1ed6fd7ec..c8f486384fe3 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -383,12 +383,6 @@ void __init create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys, static void update_mapping_prot(phys_addr_t phys, unsigned long virt, phys_addr_t size, pgprot_t prot) { - if (virt < VMALLOC_START) { - pr_warn("BUG: not updating mapping for %pa at 0x%016lx - outside kernel range\n", - &phys, virt); - return; - } - __create_pgd_mapping(init_mm.pgd, phys, virt, size, prot, NULL, NO_CONT_MAPPINGS);