From patchwork Sun Dec 27 13:23:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 561164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 889DA140C88 for ; Mon, 28 Dec 2015 00:30:56 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDBPT-0002JM-2y; Sun, 27 Dec 2015 13:30:55 +0000 Received: from mail-db5eur01on0047.outbound.protection.outlook.com ([104.47.2.47] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDBPR-0002Gf-2H for linux-snps-arc@lists.infradead.org; Sun, 27 Dec 2015 13:30:53 +0000 Received: from DB5PR02CA0038.eurprd02.prod.outlook.com (10.161.237.48) by VI1PR02MB1232.eurprd02.prod.outlook.com (10.163.164.144) with Microsoft SMTP Server (TLS) id 15.1.361.13; Sun, 27 Dec 2015 13:30:29 +0000 Received: from DB3FFO11FD010.protection.gbl (2a01:111:f400:7e04::133) by DB5PR02CA0038.outlook.office365.com (2a01:111:e400:5805::48) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Sun, 27 Dec 2015 13:30:29 +0000 Authentication-Results: spf=fail (sender IP is 212.179.42.66) smtp.mailfrom=ezchip.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; dmarc=none action=none header.from=ezchip.com; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 212.179.42.66 as permitted sender) receiver=protection.outlook.com; client-ip=212.179.42.66; helo=ezex10.ezchip.com; Received: from ezex10.ezchip.com (212.179.42.66) by DB3FFO11FD010.mail.protection.outlook.com (10.47.216.166) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sun, 27 Dec 2015 13:30:28 +0000 Received: from localhost.localdomain (10.1.3.132) by ezex10.ezchip.com (10.1.1.4) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sun, 27 Dec 2015 15:30:05 +0200 From: Noam Camus To: Subject: [PATCH v5 14/20] ARC: [plat-eznps] Use dedicated user stack top Date: Sun, 27 Dec 2015 15:23:33 +0200 Message-ID: <1451222619-3610-15-git-send-email-noamc@ezchip.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1451222619-3610-1-git-send-email-noamc@ezchip.com> References: <1451222619-3610-1-git-send-email-noamc@ezchip.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.000.1202-22026.007 X-TM-AS-Result: No--10.715100-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD010; 1:dZbe3jtoxi52+C1n836h98U4tgfoQsMcMVZE/hmhlMWV/BVe5LSkq9LkOrIA0fsCQSOW1FMFliAVOdIdyX7+8WZWXN4SkXTxQTzHE861D/pw9Crya5MAT14dqMDv95bAhbRjrcXEsOTcXaR+UnguK896DMsMWLtfqcZoUwGd7P061TDTjOQtjO+LDIO52F1v9Zzl49v9zoc/u3mYr/XxN/4IJMwkgnPce073atCOhdoV682sTA3I5661FRSn0y8PCn4l3saoH7S+PhWuQ+lPVcIu68WufBn8Gqu5PP5VACNJMhwJheU2m1SjvTt1aMMzNaxSDxVXS/Qvrbwl+RwEmipPdYnIyE+on4jrLr92pI8kDQ9JvU1ux4kF6pcxzr2rmMZcJvLZpTD9y3MjZJx6hdlMSqqOUwskuJBfhvSUSUg= X-Forefront-Antispam-Report: CIP:212.179.42.66; CTRY:IL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(2950100001)(92566002)(33646002)(5008740100001)(105606002)(107886002)(50986999)(11100500001)(87936001)(586003)(6806005)(76176999)(106466001)(49486002)(110136002)(36756003)(2351001)(229853001)(5003940100001)(189998001)(50466002)(19580395003)(86362001)(5001970100001)(19580405001)(77096005)(104016004)(47776003)(4001430100002)(50226001)(1220700001)(1096002)(85426001)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR02MB1232; H:ezex10.ezchip.com; FPR:; SPF:Fail; PTR:ezmail.ezchip.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1232; 2:WxoZzAB8qaQLNvw0WVJknEM530OSQ4SnUw8vFzWruSiSi67vHJsCif+l9pxGsxZiKUMj8Ip7wQDkTYpNfBnSoZ7qzHbfukyvKWcMkg8NXVP5BC+5tfgI6zlOerKNsUh04pZtAJtHoRXBrkEsEzkSyA==; 3:zXo+A1z3D/JB1XOS237wKfoqRsGzoXUi2d8uyxdHmkgZx4v8yC0EXgoaq3+URF12nKkOYHwqew/qT+8KO1FagQFunvd8p9P++A/NntWyT5eA0WZUGJg/Y+exiHueiPP7LB7V1yaj0s1IcTnFAIUqttZmwO6Fjpj1whjHU19XbR0+OquTsY5TPb1CTYgw/OISz7+tj407uuiVlvdqlv09D9C/+HimcMtOKgdooSw+cKI=; 25:dEPg1CA8paga4xRwOFsTE/paAn7YiLP6VPPhbyvUUs3NAhOoFKVYub1bY34gc9FAJAJkNLgHZXXq85kxFEZK+J1us9AWBzyWFYHao+sZkenMDIkeyS3L3oKSqWG6GXl9kNhwnPGZJzvHacVP/X41OrL+kDuSrt2/1AQDdaNBEcUk4D91RkVu1eKOcp9m/UdujMuuPEup0fEQ5i6LaLiwFlpKJ38J/XH4FdLDJIixMyepQXX69PRfSwEa69SEDXJtOFfC4luib2uhdoqYiDKTNA==; 20:JN7LiRuPAD32a0e26vM3vencf6jEKllitFjRjLXb+T7Wc8Yicdi5PqtRS6GnW/Gwpx7eIXRRlSysC7pevaenL5MW5HFA3u+ypUBDmVodlkuFhlb3nwh1aNEuuQLECcO/b9+XFz7LOK94BDT8jcMeSCvtZOinS2Q9CkF2jPuTMOo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB1232; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(121898900299872); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:VI1PR02MB1232; BCL:0; PCL:0; RULEID:; SRVR:VI1PR02MB1232; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1232; 4:yKq9ZNX4yVKkaxjYNlm9wFX8T85BP3Zn4wj9+MosnR6Wm6K+r8mmBgO5jQNJ3ZVIKybGm6oV2Q0yt4nMfIWHfLCbA9jI33NKr7hMj9iWNEcflDdpUcOlP9Z5jldoneImI8fI+y8llm7NVPWczQ4mNK+1LOd5yylrY9gTl9Xg06sur8Vwf8vZVeVh6WCNtTGo5ZFsYfRgwM0/Zm2eaUgDudpnxuY/+z+xkDpdmf0bPlODBE3QyGbyCDHMeaW+M/4QaSeeVsqDsJhZ0AXWEI0izj6bXxijCp2qQ4KVji1wt8iclWGsXBeJORiczC6KaLlbJU3HEpbvS/oCUMjb2Jk/IiKKUB87mdmBOii7v3NbQlcigsfLIqRS4BccdpelC8Rf4Y7XMvU+hW1ddav1rYtU78BsXLHviE5MsU8ykv8fiyF7eRNrFTOjZVakJaJ16hQ5 X-Forefront-PRVS: 0803A0241F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR02MB1232; 23:d4KuAuRoR2Xc+OJFC2SR13lhKYHgqvTfAuVHjujRn?= =?us-ascii?Q?+m964C/k4tMJeVdxFYoegSYMv88M6EnZT2nmm0MoZmYBQ7y3nrACmYI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ezl9gGlDES9Xd5A9n6M21D4NHBFMqUtJw87Q9?= =?us-ascii?Q?mZb7d3Orn4JSn9YxUaTsqWHF1biUC+cRVCMTierZFltjD9hibPDfHsgJggOI?= =?us-ascii?Q?txvBFAxsUGjkC5mD5anuIvv2hvTL0QgzWt2qSHiH1aDOKKujA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1232; 5:Mk9scJ4iQoJavd5F4CznjNRT8jPGsi+fYTWGsuClyYzkptX9LI7oxI7wY9/e+UenIjauNE+5G1MqmwsDqgQorop3KDuWZDSLlrksHGiQCe+EAD+gzBhIEFaG4VsKkV8OtaSD+cX3gq8JJ83Dq6tEfg==; 24:7vlSaFJ5xGKKVA3WezmAWQENW7Qv3rlqO+uY7q74Jr39fE3jcBYN0r33bvpsm8NJ2mMYUVA9Maj0vfGnvA2Vgm2DMX9tgItJEq9LqM+hwvs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2015 13:30:28.7306 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[212.179.42.66]; Helo=[ezex10.ezchip.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB1232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151227_053053_467848_49021C63 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [104.47.2.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [104.47.2.47 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, cmetcalf@ezchip.com, daniel.lezcano@linaro.org, Noam Camus , linux-kernel@vger.kernel.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Noam Camus NPS use special mapping right below TASK_SIZE. Hence we need to lower STACK_TOP so that user stack won't overlap NPS special mapping. Signed-off-by: Noam Camus Acked-by: Vineet Gupta --- arch/arc/include/asm/processor.h | 17 +++++++++++++++++ arch/arc/mm/tlb.c | 6 ++++++ 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h index 8a77ccd..41142ab 100644 --- a/arch/arc/include/asm/processor.h +++ b/arch/arc/include/asm/processor.h @@ -122,7 +122,24 @@ extern unsigned int get_wchan(struct task_struct *p); #define USER_KERNEL_GUTTER (VMALLOC_START - TASK_SIZE) +#ifdef CONFIG_ARC_PLAT_EZNPS +/* NPS architecture defines special window of 129M in user address space for + * special memory areas, when accessing this window the MMU do not use TLB. + * Instead MMU direct the access to: + * 0x57f00000:0x57ffffff -- 1M of closely coupled memory (aka CMEM) + * 0x58000000:0x5fffffff -- 16 huge pages, 8M each, with fixed map (aka FMTs) + * + * CMEM - is the fastest memory we got and its size is 16K. + * FMT - is used to map either to internal/external memory. + * Internal memory is the second fast memory and its size is 16M + * External memory is the biggest memory (16G) and also the slowest. + * + * STACK_TOP need to be PMD align (21bit) that is why we supply 0x57e00000. + */ +#define STACK_TOP 0x57e00000 +#else /* CONFIG_ARC_PLAT_EZNPS */ #define STACK_TOP TASK_SIZE +#endif /* CONFIG_ARC_PLAT_EZNPS */ #define STACK_TOP_MAX STACK_TOP /* This decides where the kernel will search for a free chunk of vm diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 843e1a5..01f85e5 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -820,6 +820,12 @@ void arc_mmu_init(void) */ BUILD_BUG_ON(!IS_ALIGNED((CONFIG_ARC_VMALLOC_SIZE << 20), PMD_SIZE)); + /* + * stack top size sanity check, + * Can't be done in processor.h due to header include depenedencies + */ + BUILD_BUG_ON(!IS_ALIGNED(STACK_TOP, PMD_SIZE)); + /* For efficiency sake, kernel is compile time built for a MMU ver * This must match the hardware it is running on. * Linux built for MMU V2, if run on MMU V1 will break down because V1