From patchwork Tue Oct 8 21:38:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 11180081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 544F71709 for ; Tue, 8 Oct 2019 21:39:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 21B0521835 for ; Tue, 8 Oct 2019 21:39:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="IXmN2l/j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21B0521835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5910F8E0005; Tue, 8 Oct 2019 17:39:07 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 541468E0003; Tue, 8 Oct 2019 17:39:07 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47E1C8E0005; Tue, 8 Oct 2019 17:39:07 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id 2473B8E0003 for ; Tue, 8 Oct 2019 17:39:07 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id B743D181AC9B4 for ; Tue, 8 Oct 2019 21:39:06 +0000 (UTC) X-FDA: 76021933092.04.river46_6c9569e7ef54f X-Spam-Summary: 2,0,0,aae180b8ab2bd266,d41d8cd98f00b204,vineet.gupta1@synopsys.com,:linux-snps-arc@lists.infradead.org:linux-kernel@vger.kernel.org:kirill.shutemov@linux.intel.com::vineet.gupta1@synopsys.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1042:1260:1261:1311:1314:1345:1431:1437:1515:1534:1541:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:3872:4250:4321:4605:5007:6119:6261:6653:10004:11026:11473:11657:11658:11914:12043:12114:12297:12438:12517:12519:12555:12895:13069:13311:13357:13894:14096:14181:14384:14394:14721:21060:21080:21324:21451:21627:21772:30003:30054:30070,0,RBL:198.182.61.142:@synopsys.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:84,LUA_SUMMARY:none X-HE-Tag: river46_6c9569e7ef54f X-Filterd-Recvd-Size: 3407 Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [198.182.61.142]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Oct 2019 21:39:06 +0000 (UTC) Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 20B12C016B; Tue, 8 Oct 2019 21:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1570570720; bh=JAzSMbVKPnZ9LRpz5V9AajWg5VC5h3GO+qyt5a4bXd0=; h=From:To:Cc:Subject:Date:From; b=IXmN2l/jckt3C4NEgwFRsV9LU+Y6rqIDsnWdolKOVZA3nyjDaGiE9S3UustmW3vmn jOjObD9GgyEui7tBwFVzwLi0cMG6/LxAzE8FB1MlFpwRryT56A0Xp+rRcHJs/FrnyQ Cj7BGMWQvqR3Dmduyd2X5zl+fz/Y50Ffg/87QjEHWGsqTn/dOFC18aToxQW4QKootU C2VgYfAyYyjFiOmBXA7vg2uQrSsB61lFw2wADHtsUk04+uK3UyD7KkgPxoOrItbG+5 dK62zsewhuIYDPk9rd3h+2Knyc/xL34gpJhJhWIozHxfF1waDOL0Oq66KvKgwOQ+us F5PZXDU4zPAOA== Received: from vineetg-Latitude-E7450.internal.synopsys.com (vineetg-latitude-e7450.internal.synopsys.com [10.10.161.61]) by mailhost.synopsys.com (Postfix) with ESMTP id 536FDA006B; Tue, 8 Oct 2019 21:38:39 +0000 (UTC) From: Vineet Gupta To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, Vineet Gupta Subject: [PATCH] ARC: mm: remove __ARCH_USE_5LEVEL_HACK Date: Tue, 8 Oct 2019 14:38:36 -0700 Message-Id: <20191008213836.19266-1-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: Add the intermediate p4d accessors to make it 5 level compliant. Thi sis non-functional change anyways since ARC has software page walker with 2 lookup levels (pgd -> pte) Signed-off-by: Vineet Gupta --- arch/arc/include/asm/pgtable.h | 1 - arch/arc/mm/fault.c | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index 976b5931372e..902d45428cea 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -33,7 +33,6 @@ #define _ASM_ARC_PGTABLE_H #include -#define __ARCH_USE_5LEVEL_HACK #include #include #include /* to propagate CONFIG_ARC_MMU_VER */ diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index 3861543b66a0..fb86bc3e9b35 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c @@ -30,6 +30,7 @@ noinline static int handle_kernel_vaddr_fault(unsigned long address) * with the 'reference' page table. */ pgd_t *pgd, *pgd_k; + p4d_t *p4d, *p4d_k; pud_t *pud, *pud_k; pmd_t *pmd, *pmd_k; @@ -39,8 +40,13 @@ noinline static int handle_kernel_vaddr_fault(unsigned long address) if (!pgd_present(*pgd_k)) goto bad_area; - pud = pud_offset(pgd, address); - pud_k = pud_offset(pgd_k, address); + p4d = p4d_offset(pgd, address); + p4d_k = p4d_offset(pgd_k, address); + if (!p4d_present(*p4d_k)) + goto bad_area; + + pud = pud_offset(p4d, address); + pud_k = pud_offset(p4d_k, address); if (!pud_present(*pud_k)) goto bad_area;