From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161352AbcA1WOs (ORCPT ); Thu, 28 Jan 2016 17:14:48 -0500 Received: from mail-db3on0081.outbound.protection.outlook.com ([157.55.234.81]:55008 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966782AbcA1WOo (ORCPT ); Thu, 28 Jan 2016 17:14:44 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=cmetcalf@ezchip.com; Subject: Re: [PATCH 01/31] Add hard/soft lockup debugger entry points To: Jeffrey Merkey , References: <1454010366-28416-1-git-send-email-jeffmerkey@gmail.com> CC: , , , , , , , , From: Chris Metcalf Message-ID: <56AA7D14.5090407@ezchip.com> Date: Thu, 28 Jan 2016 15:41:56 -0500 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454010366-28416-1-git-send-email-jeffmerkey@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: CY1PR0101CA0024.prod.exchangelabs.com (2a01:111:e400:51d0::34) To AM3PR02MB113.eurprd02.prod.outlook.com (2a01:111:e400:8807::12) X-Microsoft-Exchange-Diagnostics: 1;AM3PR02MB113;2:jad1z+e3Us9qSOlS0A2wkdZ+Pt345K3g5eng0VRQvNf0865SAe8TMMJnVB9S0hixVnB8qBt0gYM2rd1O+oiufgrfcSLxOqO//ZDPspZxJpcKFHQqYZ4RNXEHgZ06Y+/QCyCMsIckEFO0H6Co6If4qQ==;3:EkaEX43VvTMeQVH5WGZq5myqyV2beRpYZxf937stqMXMexBhbvZ/2Emc959DrQYxsqvOy95+d5v+WectOrLyZx+nE2ftzw5HBP/3SUoKfeWzyA6TSgFQ4njkDIOoP98q;25:6VpbNTqUIhK29rIouCTpakNnW+y4OUjqy0oshctvt+Kmb1/KTGyYk+J0oRsMWdrOmqcUho/5M8rHrVhxb3jYCDMpCRxWWN4tmoPnhYSNT31eaC9SFvFmQvfvAfS5SNEqzZWztZWXUIpP0+VOG3qaQRvTC4oBtrSxdAns8IZHR+hhWfdTEK72/AiOp3SBLftme7tzB0/UenSMTTwIbfZfwS0/mI5T8udhaltvUn9b54s24ipDUUGMS+Iz1afEl4Uy;20:QVMz6Rp5fbsTReWZ9Cxg+SqyzycsqU9alqwhBO97vi5wt73r7vzaj6IFyvBrNjlpnpbaLs9KgoGgRKyAUIYkkySy0+5BxFVQb5tT8WrD7Uobf3MyRcrtqpCWcjFdDemv9XEdkMyXqazSHk2cvqkre81rXh/XaIgPphXjHHg3zUI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB113; X-MS-Office365-Filtering-Correlation-Id: 57e67e93-def4-4735-eeaa-08d328238056 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:AM3PR02MB113;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB113; X-Microsoft-Exchange-Diagnostics: 1;AM3PR02MB113;4:e8WsR59OwYV6b0ACrLmsvvqTInvImy5Z/8IS7KqGyWHD+AcoZ3SVDw/z9QFo7PLzWxiNxjfUfoqHTRPJ/GynYUQyBTYYrqIlw4hv8tk4tErggkhyuJpujxDnUowZRlhkpcrXgZThQG+oTNQSitmgoXno3ewRNvM1mOUNP3D10bZmLDkln24KGWmvTsiLU1DTiltE6b04aOQTMOiSPMEr1uabkSUSfHcipltvBiPFNDaygDGSuaXSqin3MiPg3QtTByU9/1JaNzWcI3pK2flh8cxWMm2DwZ54r2YO3sg+TIsT+z033DaeuEg1MFpilBIYP6gGS5rHPflVFjDOVWCYD0Hty2pSq8m+urndIxmivAzivz/Y6OyYAKnbsExShO3s X-Forefront-PRVS: 083526BF8A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(189002)(199003)(479174004)(377454003)(24454002)(3470700001)(4326007)(6116002)(1096002)(586003)(3846002)(2906002)(36756003)(64126003)(4001350100001)(5001770100001)(97736004)(5004730100002)(15975445007)(5001960100002)(189998001)(33656002)(81156007)(77096005)(76176999)(65806001)(2950100001)(101416001)(65956001)(66066001)(106356001)(65816999)(105586002)(87266999)(54356999)(50986999)(87976001)(92566002)(19580395003)(42186005)(86362001)(80316001)(47776003)(122386002)(40100003)(50466002)(59896002)(230700001)(5008740100001)(83506001)(23746002)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR02MB113;H:[10.7.0.41];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;AM3PR02MB113;23:b4Zk4vyU7kXw24uuwKc0WwLekm6VyXuB9pBD16?= =?Windows-1252?Q?uu9I6DfdcHt4O6FVLe4ItqlWhlKfW8moLT730F0UrbZ1HnTSokO19FY8?= =?Windows-1252?Q?oM7GheDq+dykkcbHvqhKG8yqkHgE6NMIfZEKIjB24Ubu1KygxHj+vBxG?= =?Windows-1252?Q?DCGxLRL59uu8od+cnGY901YbY9tHRre2sC3+pg22vdbcyXe6pX0+OA+T?= =?Windows-1252?Q?9ygUqTY4MrttFnxTiRoz8eS+IcGFEDFi86M9Wh940Nj27SJFntkiZKix?= =?Windows-1252?Q?yDstaBc6OhILhn2hy3BWSrMF47XEUlBKDMV9vD53/mzn+jyoj2WpG3Gh?= =?Windows-1252?Q?CdyC8yKLUEi30rHAnSxcAG3DUl5Gz/trs6F+IHTTZo6R+FowNo0egQx8?= =?Windows-1252?Q?JBFnECawaJOK7qWqfFqx90essos2I4cC8vdgX3D/MLZ7ZqJ5Z21nkBfO?= =?Windows-1252?Q?8kAakAnKvrlYjKBKx1XECRCCh79Pjds2YKLdUM6f3K0A0fSzeZ709Hs6?= =?Windows-1252?Q?rtbOWCfgO2qxAQOE2oVNV6IeqIrNmeiEKIWRWfQxPZ2ca8Qb1yArvqE4?= =?Windows-1252?Q?SwZ1PsGVgBIUXiDYNR3HXr56Z6NfxJrJPz+csQtOjzjHwX1EZFmyJPfy?= =?Windows-1252?Q?rMO53JgRPhCPhN5g81AasFzdHl7l2BXik6rJ1zsM2uAWYSUMTK5il17e?= =?Windows-1252?Q?zHfuufRybmT0PDU/gVfoIymQRo/tk9CmKGvAAcgJcDMpoOHT0j7JYbI6?= =?Windows-1252?Q?iI1o2lgDiV9xwy9jONVUNgAqiqV9Wku+mnGCOjpZUZZEFEtrWUXE3jfh?= =?Windows-1252?Q?R90Ysivj7BJ7Qzv95YSjKb71STsehnOUzv6A9tXJ8ftIlPpAtGRpW4KI?= =?Windows-1252?Q?X/K2XFc6Moifjci6KQzrooN+wHvPLex67a9e+4w57fDmrLGyxBnZ0Bfq?= =?Windows-1252?Q?f+QisyRXlxdnn4pYCE7OHMR5TqQmm/bf7LtOoSdWx1eytcLGp7cbqwEn?= =?Windows-1252?Q?/HWhxL7qqPuRG4wQ9Lj7jx0qrAiB8H76eigMb8PYaKGTaklJcVyxUlnE?= =?Windows-1252?Q?XoR5TE+HJQO6+6FYUI2c+rb+DpDGYMBuBxaJgPVczXc8BbtSZh/WcTq/?= =?Windows-1252?Q?oAk4X5GQhoU7B4HroFwlWZUuPVW4ePrIFc2E3t+gi/FVympMRxIVjfOr?= =?Windows-1252?Q?3PPrdcifa6N0+LqmANUt4T8ZgVsSbCSuRIVyOXz6JlWaldyLEJpbLiC7?= =?Windows-1252?Q?RigDN1zOHeILKDSzfs/Iy7QSXm2x97V5Md0W+mVkLU4zegt2GqVwMQmI?= =?Windows-1252?Q?dhtLCY2ugRH+bZlaOja+z8Z52IuUqOiAasdoYFrSsGIbaOoCXAalNwBf?= =?Windows-1252?Q?bGnK4mrq8OCY3fD/yVdnWPgQwfmTqjr/BHyGgNYc1HLeL26k2lloxX8j?= =?Windows-1252?Q?Tz5s2yM8dpzc8VX0EKgCTN7+h6667MC9O9ejaLuetFN51hsoJuw1XLuX?= =?Windows-1252?Q?ydhoY=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM3PR02MB113;5:r9fqK9Utli9iULmwbBTI4gRav4PFQ/Wi4mu10tlNxTajm9QAkH06d/TIASzjw6EQO2rB1dTxfGAMQ5Yr2qC6thoHu1JmWCliTVHvcNqaenXDNp4iN1G6DqRS7EYAQotN06p43hv1j+1XK3m1EGMyPw==;24:A0HZR3J+4YQmBHq9Gqb6COFSNQkHms3abAWC59SSrPHS3Dc5MFdj8Vrd9Y07zCABZUe9WRI6imN1FiFv89/IRfiISo5On7DFWFyqlq2+bjg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2016 20:42:10.2971 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR02MB113 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/28/2016 02:46 PM, Jeffrey Merkey wrote: > This patch series adds an export which can be set by system debuggers to > direct the hard lockup and soft lockup detector to trigger a breakpoint > exception and enter a debugger if one is active. It is assumed that if > someone sets this variable, then an breakpoint handler of some sort will > be actively loaded or registered via the notify die handler chain. > > This addition is extremely useful for debugging hard and soft lockups > real time and quickly from a console debugger. I'm concerned that you are duplicating the breakpoint instructions for all the platforms. Could you make kgdb.h include kdebug.h and just move the arch_kgdb_breakpoint() implementations in kgdb.h to arch_breakpoint() in kdebug.h? Then each platform can just put an appropriate define in kgdb.h, e.g. "#define arch_kgdb_breakpoint arch_breakpoint", unless (like mips) they have a more complicated requirement. I'm concerned that in some cases (e.g. arm64) there is a perfectly good breakpoint defined in kgdb.h but you are providing a no-op in kdebug.h. You should probably do another check across all the architectures for this case. You should probably add your no-op implementation of arch_breakpoint() to asm-generic/kdebug.h, and then add "generic-y" lines to the Kbuild files for the architectures that you are creating new empty files for. I'm a little ambivalent about the "silent no-op" implementation, but I'm not really sure there's a better option. For mips, I'm pretty sure you don't want to create a global "breakinst" symbol every time you insert a breakpoint into code. I think this is an example of where you need to have a different implementation of arch_breakpoint() and arch_kgdb_breakpoint(), since mips makes its breakpoint magical by knowing what the address used for that specific instruction is, and you can't do that for arch_breakpoint(). As a general rule, you probably want to provide header guards in new headers that you create, but if you just use asm-generic instead, it actually won't matter for this case. I should add that I didn't do a thorough review of the patch series, just a quick skim of a few of the architectures. -- Chris Metcalf, EZChip Semiconductor http://www.ezchip.com