From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KSLlR-0004tW-Jm for kexec@lists.infradead.org; Mon, 11 Aug 2008 01:00:02 +0000 Subject: Re: [PATCH -v2 6/8] kexec jump: fix for lockdep From: Huang Ying In-Reply-To: <1218190426.8625.71.camel@twins> References: <1218178365.22039.79.camel@caritas-dev.intel.com> <1218190426.8625.71.camel@twins> Date: Mon, 11 Aug 2008 08:59:56 +0800 Message-Id: <1218416396.30464.9.camel@caritas-dev.intel.com> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Peter Zijlstra Cc: nigel@nigel.suspend2.net, Kexec Mailing List , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , "Eric W. Biederman" , Pavel Machek , Andrew Morton , Linus Torvalds , mingo@elte.hu, Vivek Goyal On Fri, 2008-08-08 at 12:13 +0200, Peter Zijlstra wrote: > On Fri, 2008-08-08 at 14:52 +0800, Huang Ying wrote: > > Replace local_irq_disable() with raw_local_irq_disable() to prevent > > lockdep complain. > Uhhm, please provide more information - just using raw_* to silence > lockdep is generally the wrong thing to do. In traditional kexec, the new kernel will replace current one, so the irq is simply disabled. But now jumping back from kexeced kernel is supported, so the irq should be enabled again. The code sequence of irq during kexec jump is as follow: local_irq_disable(); /* in kernel_kexec() */ local_irq_disable(); /* in machine_kexec() */ local_irq_enable(); /* in kernel_kexec() */ The disable and enable is not match. Maybe another method is to use local_irq_save(), local_irq_restore() pair in machine_kexec(), so the disable and enable is matched. Best Regrards, Huang Ying _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754429AbYHKBAO (ORCPT ); Sun, 10 Aug 2008 21:00:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753247AbYHKBAA (ORCPT ); Sun, 10 Aug 2008 21:00:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:45320 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753134AbYHKBAA (ORCPT ); Sun, 10 Aug 2008 21:00:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.31,341,1215414000"; d="scan'208";a="324999474" Subject: Re: [PATCH -v2 6/8] kexec jump: fix for lockdep From: Huang Ying To: Peter Zijlstra Cc: "Eric W. Biederman" , Pavel Machek , nigel@nigel.suspend2.net, "Rafael J. Wysocki" , Andrew Morton , Vivek Goyal , mingo@elte.hu, Linus Torvalds , linux-kernel@vger.kernel.org, Kexec Mailing List In-Reply-To: <1218190426.8625.71.camel@twins> References: <1218178365.22039.79.camel@caritas-dev.intel.com> <1218190426.8625.71.camel@twins> Content-Type: text/plain Date: Mon, 11 Aug 2008 08:59:56 +0800 Message-Id: <1218416396.30464.9.camel@caritas-dev.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2008-08-08 at 12:13 +0200, Peter Zijlstra wrote: > On Fri, 2008-08-08 at 14:52 +0800, Huang Ying wrote: > > Replace local_irq_disable() with raw_local_irq_disable() to prevent > > lockdep complain. > Uhhm, please provide more information - just using raw_* to silence > lockdep is generally the wrong thing to do. In traditional kexec, the new kernel will replace current one, so the irq is simply disabled. But now jumping back from kexeced kernel is supported, so the irq should be enabled again. The code sequence of irq during kexec jump is as follow: local_irq_disable(); /* in kernel_kexec() */ local_irq_disable(); /* in machine_kexec() */ local_irq_enable(); /* in kernel_kexec() */ The disable and enable is not match. Maybe another method is to use local_irq_save(), local_irq_restore() pair in machine_kexec(), so the disable and enable is matched. Best Regrards, Huang Ying