From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbcFUKh2 (ORCPT ); Tue, 21 Jun 2016 06:37:28 -0400 Received: from mail-ty1jpn01on0113.outbound.protection.outlook.com ([104.47.93.113]:50335 "EHLO JPN01-TY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751973AbcFUKhH convert rfc822-to-8bit (ORCPT ); Tue, 21 Jun 2016 06:37:07 -0400 From: =?iso-2022-jp?B?GyRCP0BFRCEhPjAbKEI=?= To: David Miller CC: "sparclinux@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] sparc64: Swap registers for fault code and address in mna trap Thread-Topic: [PATCH] sparc64: Swap registers for fault code and address in mna trap Thread-Index: AQHRyDczoQDrRuB//kmeO+Wp2WYvsJ/uwGAAgATzAW8= Date: Tue, 21 Jun 2016 10:36:42 +0000 Message-ID: References: ,<20160617.231234.1295900275353757289.davem@davemloft.net> In-Reply-To: <20160617.231234.1295900275353757289.davem@davemloft.net> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=hikanda@zlab.co.jp; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [25.168.40.4] x-ms-office365-filtering-correlation-id: 17484033-52b8-4e76-de3b-08d399bfefc8 x-microsoft-exchange-diagnostics: 1;TYXPR01MB0589;6:xWx1cTL38WugMUPxHe+ny8us9ZcXD/KN6mRC1l/QxRC6fU9infuL6Ovdwkg2AOQldx/Th0v3CrCV7UauP2SWr+4y+m8AiqqIZkk+wrWe9K+LBcFwsvRLefPN0fl3HtRzjmdW947rOL59TdSo0EGIFdcCfEzN/uD7yDMJDcpJa5UIcTJGt4OALY7jMKs719IqyXMgb1FHx3ubEnzForUHswdLF4K4Bbjtl/D2buUFaUwg7NaT7IMY3jpc+Ya65GvtV23Dk+iDcModOks/hpR8AtGQ74Qe11LBT9XyNWb99m65Y8Hy1HweRrOnkaClDcIn;5:KyWbDvbmBr+NHM2xLXcM7jz+V9jpo6xFk2HNPPTzeSy4XhvBAylxb2zuPyjXJyUIDH337YMOde4Bffx+0xtjuKr3UzMuOOxXOI1lQHNPKnuETh/GHvAflDZE90k/ZhA09uHchuSxDrM+jy1mTOqf5Q==;24:5oLt/URh3AxwtT1cUBtWCVPusHKO7pvjWNzmlNJr4TtMTLoUbvnACVyMPLAbLXE4bvZbu8DejNmTNc6OKA9LnnOAED71S4A7FLV6BEGCw0Y=;7:i3SiewjJkGA1QNJUV/fNK/OndUl8HgMaMFb6litj3lcNkXHTsLuq+CruLFz+2iAOytZijZA1Wh1uPyzdMFYRRQaG2fDT7VqsE8gcifQeTzJgUgCNx8Wj/45eeiKTG+UofLK8lu9nB0PU50txBXmE1VA2COs5wgfDcyS9XgCYwbgwoc+uJBsaUgf7hHZKbjk2GbIAIHa2FYvfC1Ysy+gong== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:TYXPR01MB0589; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040130)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041072)(6043046)(6042046);SRVR:TYXPR01MB0589;BCL:0;PCL:0;RULEID:;SRVR:TYXPR01MB0589; x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(51444003)(199003)(189002)(19580395003)(86362001)(74316001)(19580405001)(345774005)(87936001)(85182001)(81166006)(66066001)(7846002)(101416001)(97736004)(3280700002)(4326007)(7736002)(81156014)(2906002)(106116001)(2950100001)(2900100001)(105586002)(8676002)(106356001)(8936002)(77096005)(3846002)(54356999)(33656002)(68736007)(189998001)(110136002)(122556002)(76576001)(102836003)(5002640100001)(10400500002)(9686002)(3660700001)(74482002)(586003)(92566002)(7696003)(6116002)(5003600100003)(76176999)(50986999);DIR:OUT;SFP:1102;SCL:1;SRVR:TYXPR01MB0589;H:TYXPR01MB0589.jpnprd01.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;CAT:NONE;LANG:en;CAT:NONE; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: zlab.co.jp X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2016 10:36:42.7593 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 58f17630-b846-437d-ac06-7ecf8a587a66 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYXPR01MB0589 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, David Thank you for your reply. > If you can really trigger this code path, please post the kernel log > backtrace that happens when the BUG() triggers. That way we can > figure out what the real problem is. I'm sorry I cannot show the information. I don't have now. In fact, BUG() in do_sparc64_fault occurred in modified version of linux-2.6.25.8 on SPARC64VIIIfx. I'm misunderstanding that the same problem remains in the latest. > Your patch is also wrong for other reasons, it would break the > unaligned trap code paths that don't go via user_rtt_fill_64bit > fixups. And from the first, I was wrong. I got it. I have some questions. I think that if %tl > 1, winfix_mna will be called. Is it correct? And, the call trace is never occurred? ________________________________________ From: David Miller Date: 2016年6月18日 15:12 To: 神田 尚 CC: sparclinux@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] sparc64: Swap registers for fault code and address in mna trap From: 神田 尚 Date: Fri, 17 Jun 2016 01:49:11 +0000 > This bug may occur in the following. > > user_rtt_fill_64bit <= If mna trap occurred, call do_mna > +-> do_mna <= Mistake storing registers for fault code and address > +-> winfix_mna > +-> user_rtt_fill_fixup <= Put fault address into thread_info->flag's TI_FAULT_CODE > +-> do_sparc64_fault() <= If fault address has FAULT_CODE_ITLB and FAULT_CODE_DTLB bits, call BUG() > +-> BUG() We should not be invoking do_sparc64_fault() in this case. Instead, we call either sun4v_do_mna() or mem_address_unaligned(). Neither of which care about the values stored in the thread's fault address and code. If you can really trigger this code path, please post the kernel log backtrace that happens when the BUG() triggers. That way we can figure out what the real problem is. Your patch is also wrong for other reasons, it would break the unaligned trap code paths that don't go via user_rtt_fill_64bit fixups.