Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp294155pxb; Thu, 12 Aug 2021 16:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9MfTpf7L1SHvWjF8QzNKjA9sqSlCr0GeDdp9aXtE+9su5ShYUF6LH78CylNRtldSd/x5i X-Received: by 2002:a6b:b502:: with SMTP id e2mr4828006iof.152.1628812219380; Thu, 12 Aug 2021 16:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628812219; cv=none; d=google.com; s=arc-20160816; b=z7isDQTH0547abasQMwwHh3ohqgkiEs64dih8kFoPhGlFjk7WK680v2Z5ctU53AmMa 0a7xHMlcTkTTZWGeQFZhOI2xYbCEMUcFR3l0Izgp/0aENorhwH9Pjhftbyfb7ac+qpv6 rJGHPOXJvGMqpqEFW/YC2+yNvXBDTgx5kqrqtPIsGRF0ZIYFDc3Bc62KyIpPLj9xZqm4 63oHRp/0cN+MVWbkAITMM1wxG3+dPZ/VK0oK5MlQfSaY0ccr6CGmMhIBIHgqRdy2R+Nq moIbgZsX3p1SOH2x5CG0Q8EUe+3mLtlZySNFYk0Dfzo1y6e+4gH1CWvpNgaO+lRS+WRX eA1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PoDu6Kj0cftLfNFyvViMkxuMkuW7VpMJxM92gs2zxAk=; b=FAteoyUAPdYePzIdHS8+qg7+AMlPYYEKwAzjWn7fxJ5ZJlpshVbSwdxXnJOYV8zXRg o7b0jEn8af4lb4kgn5yYGflrhDC3tIlYhdaz9zCvjO63tZrmh7NpjcKHG/mly0xwDfIo CuCdrxJoveBnuRzh8/yo7m8HFQyTrdN+F1sbG8lvlAeW2O4Xq3Av8D0D2VMnq3cgR2fW KFSZJdFnAmBlHmCDRi5lVu0bm3DEoVwn2JXo2QDthmo5jH4rbqYhSzzrIMLDgf/xnzcE HFleZnpQoitHSVu44ZIBMTjuehnagRoycS+7ppJ99BhQAhtvUlKAVMeGI1jRmwsVWV2r Orpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qSLCgRfD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si4430838jaf.48.2021.08.12.16.50.08; Thu, 12 Aug 2021 16:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qSLCgRfD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238540AbhHLXjF (ORCPT + 99 others); Thu, 12 Aug 2021 19:39:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:48968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238475AbhHLXia (ORCPT ); Thu, 12 Aug 2021 19:38:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 00929610FF; Thu, 12 Aug 2021 23:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628811484; bh=OznPj0H31NuyGJ0zu5NrPr8zmibKxgGabmxj0tfu3OI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSLCgRfDUgYypTq6vAUv99MIOcg2OnKf0tnDXJqcySf3ubU/7uoPK7McrjorJIkxX VfcDxT+ITm2tR4CPvh0KFoYz7ntI9yAluS95kThBPQzj4peUcTgFXvXnixaRcjf4oz mvs8MWR0B4l9tfx3cNDVtWbyU9kofkJhuFdo243+DMU9Jh8DGEgSEz+EkTdio3gE+g J/H9DmrTQ4RbJIOPOW9rTn8IDNhacihpSUGjLyQzwhEITlQo9bQeNjdriIb90bWMvn ETyBJ0iKYzooOHqC2RVmF1lRDL8zf7EGYlVavXPmsVbI08yOdOsazanNOQZVC2nb8z xgdu49URX80Dg== From: Vineet Gupta To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual , Mike Rapoport , Vineet Gupta Subject: [PATCH v2 15/19] ARC: mm: hack to allow 2 level build with 4 level code Date: Thu, 12 Aug 2021 16:37:49 -0700 Message-Id: <20210812233753.104217-16-vgupta@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812233753.104217-1-vgupta@kernel.org> References: <20210812233753.104217-1-vgupta@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PMD_SHIFT is mapped to PUD_SHIFT or PGD_SHIFT by asm-generic/pgtable-* but only for !__ASSEMBLY__ tlbex.S asm code has PTRS_PER_PTE which uses PMD_SHIFT hence barfs for CONFIG_PGTABLE_LEVEL={2,3} and works for 4. So add a workaround local to tlbex.S - the proper fix is to change asm-generic/pgtable-* headers to expose the defines for __ASSEMBLY__ too Signed-off-by: Vineet Gupta --- arch/arc/mm/tlbex.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S index 0b4bb62fa0ab..c4a5f16444ce 100644 --- a/arch/arc/mm/tlbex.S +++ b/arch/arc/mm/tlbex.S @@ -145,6 +145,14 @@ ex_saved_reg1: ;TLB Miss handling Code ;============================================================================ +#ifndef PMD_SHIFT +#define PMD_SHIFT PUD_SHIFT +#endif + +#ifndef PUD_SHIFT +#define PUD_SHIFT PGDIR_SHIFT +#endif + ;----------------------------------------------------------------------------- ; This macro does the page-table lookup for the faulting address. ; OUT: r0 = PTE faulted on, r1 = ptr to PTE, r2 = Faulting V-address -- 2.25.1