From patchwork Fri Jun 1 12:39:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chintan Pandya X-Patchwork-Id: 10443259 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 0003C602BD for ; Fri, 1 Jun 2018 12:42:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E523C28C0D for ; Fri, 1 Jun 2018 12:42:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D871F28C22; Fri, 1 Jun 2018 12:42:27 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 80AEF28C0D for ; Fri, 1 Jun 2018 12:42:27 +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=G7M9Nr8sr94NepzY95JVBhBdFeD1UnvHdKIqog9luhk=; b=srTuJ0JlIsypNzzC3UWPyNCcMe DMf1yv+T6+1jZ/8zvePU9qVmog4nN0J3HIEaQW1TFwDXttAIn8TM4YQ5kiRs78Otgia6E9heib/nX REbKh7Nn+3EmUn6k4iFlc1zSoh2/lWfK2LZGk9uOBwCPBoQwtuP4gkCIM0p34T7aBRf+NNqSCCeTs tbRK3w8XORz74RKjVws15YxNOEfOGt6xYZrsvZZ1JmDUEvM3Pj7RDbbZnZEmGIZ0hgiALaH1Zy44f j3ErxdLEjQ/TSkO2SnnBC2dUX7JF0dM+JITIS7GMOaJ4VSnGEt6/qoVG8Ej3PZVgdqDf7vu+ko/7x f4WjWNqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOjNn-00046U-Ii; Fri, 01 Jun 2018 12:42:15 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOjLm-0001jP-2U for linux-arm-kernel@lists.infradead.org; Fri, 01 Jun 2018 12:40:37 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 919AD60795; Fri, 1 Jun 2018 12:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527856799; bh=WubhHD9Hp6pLM2BDogrx9jy9cZxFOcGkheb+hewSswU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVOSahotAamhHmA91t1T121DeDkZ83l3+XVT7ufTxVUHeltuBQtYOQnAxG6M1hIiI wMxcbHQplRMjKBQFQFjCLWm0baG6NFPtzP+SKefovIPtQgeFqhdMpfcGYO5lawdBFh H/5IBhbHHMsSmBNOD6Dt7GIVlP+OjT6kC3Ak1wFQ= Received: from cpandya-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cpandya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C104760263; Fri, 1 Jun 2018 12:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527856798; bh=WubhHD9Hp6pLM2BDogrx9jy9cZxFOcGkheb+hewSswU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TTG3hBm5oWvi0DkG+D1Z99ryqs3CTNeUeUtn3fWfCOi4B+owAs6DavRFKWatlKHFW tUK4NR7fadQTCc2EtfpWriU4YXUnL+TU8UdlutACyPUsPdvWTRu9rr91liGhSjeytG Tq+5mS3wYiSuS2mnP++rEjdLX7GHHwvIZB0q9DNA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C104760263 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=cpandya@codeaurora.org From: Chintan Pandya To: will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org Subject: [PATCH v12 5/5] arm64: Allow huge io mappings again Date: Fri, 1 Jun 2018 18:09:18 +0530 Message-Id: <1527856758-27169-6-git-send-email-cpandya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527856758-27169-1-git-send-email-cpandya@codeaurora.org> References: <1527856758-27169-1-git-send-email-cpandya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180601_054010_178804_C6D3D9CB X-CRM114-Status: GOOD ( 10.87 ) 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: Chintan Pandya , linux-arm-kernel@lists.infradead.org, toshi.kani@hpe.com, linux-kernel@vger.kernel.org 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 Huge mappings have had stability issues due to stale TLB entry and memory leak issues. Since, those are addressed in this series of patches, it is now safe to allow huge mappings. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6e7e16c..c65abc4 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -934,15 +934,8 @@ int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot) { pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT | pgprot_val(mk_sect_prot(prot))); - pud_t new_pud = pfn_pud(__phys_to_pfn(phys), sect_prot); - - /* Only allow permission changes for now */ - if (!pgattr_change_is_safe(READ_ONCE(pud_val(*pudp)), - pud_val(new_pud))) - return 0; - BUG_ON(phys & ~PUD_MASK); - set_pud(pudp, new_pud); + set_pud(pudp, pfn_pud(__phys_to_pfn(phys), sect_prot)); return 1; } @@ -950,15 +943,8 @@ int pmd_set_huge(pmd_t *pmdp, phys_addr_t phys, pgprot_t prot) { pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT | pgprot_val(mk_sect_prot(prot))); - pmd_t new_pmd = pfn_pmd(__phys_to_pfn(phys), sect_prot); - - /* Only allow permission changes for now */ - if (!pgattr_change_is_safe(READ_ONCE(pmd_val(*pmdp)), - pmd_val(new_pmd))) - return 0; - BUG_ON(phys & ~PMD_MASK); - set_pmd(pmdp, new_pmd); + set_pmd(pmdp, pfn_pmd(__phys_to_pfn(phys), sect_prot)); return 1; }