Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757656AbcCUTS4 (ORCPT ); Mon, 21 Mar 2016 15:18:56 -0400 Received: from mail-by2on0084.outbound.protection.outlook.com ([207.46.100.84]:46541 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757404AbcCUTSx (ORCPT ); Mon, 21 Mar 2016 15:18:53 -0400 Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Mon, 21 Mar 2016 21:43:12 +0300 From: Yury Norov To: "Zhangjian (Bamvor)" CC: Alexander Graf , Andreas Schwab , , , , , , , , , , , , , , , Bamvor Zhang Jian , "dingtianhong@huawei.com" Subject: Re: [RFC5 PATCH v6 00/21] ILP32 for ARM64 Message-ID: <20160321184312.GB26563@yury-N73SV> References: <56AC38F1.2030608@huawei.com> <20160218223506.GA7816@yury-N73SV> <20160225202855.GD16123@yury-N73SV> <56EBD84D.2060009@huawei.com> <20160318154918.GA1595@yury-N73SV> <56EC24EE.6020803@suse.de> <20160318164627.GA3201@yury-N73SV> <56EE5B6E.6030305@huawei.com> <56EFD9B0.6080004@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <56EFD9B0.6080004@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM2PR03CA0042.eurprd03.prod.outlook.com (25.160.207.52) To CO2PR07MB619.namprd07.prod.outlook.com (10.141.228.151) X-MS-Office365-Filtering-Correlation-Id: a911054e-7f38-488d-dab6-08d351b8b355 X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB619;2:r7QgAptbgn5MiXqveXtW/7aITBmWW2pGJYgdyx8u125ig3L0uuEvHLA4jfDWB+vJkUEg8KT2g5cxgcnFphYPslMrNcKSD5ew/nU4REK/qawjpi6eYgdEjtvIWHY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TmofbFdoPAg/wkB0TqMHxBCIl6SgmxpD+UnBSwm+V6/c49CW9A2EV/Sq2Bqy058C4tUYnpaB4gAXvmphSUjbbsOx9wjx8oyva9sL7MuNxmuxMrLzTeuG4fEqWOYhktYlWZQWtFHEayk3D+z0DfnaJxjKEqka1l35carR0s+stOvap07aN1VtbxAhLhswQCMdqqLdo7WRGVOdnhhdolY9J11/nS5XMIVoMZW1WS5dzEwf2r02glmed5KssCqx7L+3nItgQdWEddiWpzOptGXtvEuD3ZKUxQNl4mE4k4J7+dn/gcA2ZfsXmwWl3UNfPCnM4+paJbFemvwkQMKT0BgUWPxIyQOZIrwdoFaRWP4VsVejuG65zCE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:CO2PR07MB619;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB619; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB619;4:Sl+Z/tAzimLg0rDaYD+6u982Zo2ZTmdJh0h7SsmvqGlXyftyF/U+GyvrRhhHuJDlGrwmTjhYbNGYxPYpv0lIgSDsMQJIAFiaaPNpP7VFcjs4q8q1Q4oePf49GaT60LNPgtpeA/DkcJH+2DCuqrktI+GsUAIGkAeC5SRLj32B06U6oNKqhVBHmmmk0FHMElVhoR728pd9xwrlOeKwZHlOb9Kg1bed3pI8TDLMnG4XUAH1RUysRrslUtQNycSLLktwGmWVOzutTb8BDXnM2qRgOPmnfd7seWLkAkwPhtoDlriJmAJhbPN6ccnTlxwMuiyn3qFx3YkXdauVoT3u9EcJc9JRVZXczvIyDIFXfMOFqq0QubQILyy0rpeptisK2qxe X-Forefront-PRVS: 0888B1D284 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(24454002)(5008740100001)(50466002)(586003)(3846002)(189998001)(66066001)(47776003)(23726003)(6116002)(92566002)(5004730100002)(1076002)(76506005)(1096002)(81166005)(93886004)(42186005)(83506001)(4001350100001)(46406003)(77096005)(4326007)(76176999)(54356999)(97756001)(50986999)(2950100001)(110136002)(2906002)(33716001)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR07MB619;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB619;23:U8hRECuUGxnzcJTOB1amZOf/KCThRHYl6uSjLKjZRei9c7eUyc0ySIVBcfRzYvBa6gVUb6nZ6rNtKXGcmDL962nqjOujxWibmopUmwyePiaT3aFOv0KDHvk4oczv7NlgU46sit9QLvO5FRWCOX9ng7/ZNty9a9ITsizuXl++TUuxixv+KbHj29LQaXN9CQg0nePkFXfuhhXuchiiO7K34PsbFQNGau82ISDk3BqqCpK+hzEayx3EFKNBtBiCkMwWFa0/q/eN82Gjqbec8Vvuz4SzAY2L/zUZ/TZNvnisrEIVuZxcqTaUtS03AOIFeVed8UJn4r0Ei47Hw9q+6rUKs7YNMFRF9/xrShfNxoMEOXQWisiyhaWJrGRm/KB3DF+OikKQcdhCI5qCv+YVrui3GdMRPPiaEvFeAiT8o6Swfz44NCYVu92pO0wm5jQ/VP7tjzwRouVRevu8zngDnAZKr+X0R7gKjqvX7FDFw+C1+vpvu3nVUhB+raEiREMJ6bfv/2eF7tbiDkxu1br3yT+qfSwh0BEfM8x/U67Iq00cKQ8M1Y2jbcDzDhbt0rpMaPVQJb5iq6yA23ftncuggBWnzeHiONVxDTT48+eAMWUahAWHz2epnzLqXR21eG567wlmw13dO5in6OxByR/dtj3kTQaDxN41AXbyXZ8pVlmm1rnBjYE52CMd2r8wHOjq8oRJfwZtufaO4yAQTSK96zjQb21J1S5hi5rWyFX93bvfsJjQxSH9zl40FLaypY2enyeQlimGHs98FqTRD5TxLaDRSKGLY7QjqjixT+ibN9o3Zf475zsyO9R7rm32pNYcc/ADh+4GlGV4ZC746x2FAkRVb5WZzfix3/8XdH2tiF8ZU2Ljk6tqXH2bNr+tKo637Nks3X6hbAo/XTQcc6oiMsCtArABFbAOATWQ4i6RqEv8GorOBQdZjXEqgT4OaurZ9wKG X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB619;5:ZqPIUN3LKf3na8kVvZKsSYkRAcNOkEW/ayciFou1pYIeP9suzxCAjaW1Wqxgs7PfABIBL6h3IDvW793FajanJ8q6b6nRSAbmqyymA5x+UTNR4usFMqGhoz30ORuxhL85aC4n9DOR/C2rRvUyV0XXuw==;24:1EVHTKp0oAAmojRyzRUGVNgaIptWJdckuYSmAc2AWO2JdhaismhN4sWkP7/3cId/UFe/MM9SPoNAIoxsiF0XsGSy1oXirdg9AzciLptdpTE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2016 18:43:30.9421 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB619 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1626 Lines: 45 On Mon, Mar 21, 2016 at 07:23:28PM +0800, Zhangjian (Bamvor) wrote: > >>So this most probably means that ilp32 code doesn't handle one of cloned > >>item properly. I have already discovered a bug where child processes > >>used parent TLS, > >It is a kernel bug or glibc bug? Could you please explain it or show the patch? > >The current ILP32 patches looks good to me. Recently, I backport these patches > >to our 4.1 kernel. And I saw crash frequently even if I only do a single print > >or infinite loop. There is some small changes about tls register after 4.1. I > >am not sure if it is a similar issue. It is great if you have some suggestions/ > >ideas. > My issue is because I forget to change is_compat_task to > is_a32_compat_task in arch/arm64/kernel/process.c such piece of code > is delete after commit d00a3810c162 ("arm64: context-switch user tls > register tpidr_el0 for compat tasks). It is not exist in upstream > kernel, never mind. > > Meanwhile, I found that it seem that there is another is_compat_task > in tls_thread_flush. Is it relative the issue you mentioned? > > ``` > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > index 432b094..9ab968c 100644 > --- a/arch/arm64/kernel/process.c > +++ b/arch/arm64/kernel/process.c > @@ -209,7 +209,7 @@ static void tls_thread_flush(void) > { > asm ("msr tpidr_el0, xzr"); > > - if (is_compat_task()) { > + if (is_a32_compat_task()) { > current->thread.tp_value = 0; > > /* > ``` > > Regards > > Bamvor Hi, This fix looks correct, though doesn't fix issue. Thank you. Yury.