From patchwork Fri Sep 4 12:51:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 45679 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n84CrrCZ005062 for ; Fri, 4 Sep 2009 12:53:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756825AbZIDMxr (ORCPT ); Fri, 4 Sep 2009 08:53:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756828AbZIDMxr (ORCPT ); Fri, 4 Sep 2009 08:53:47 -0400 Received: from goliath.siemens.de ([192.35.17.28]:16608 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756803AbZIDMxq (ORCPT ); Fri, 4 Sep 2009 08:53:46 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n84CrZA9009063; Fri, 4 Sep 2009 14:53:35 +0200 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n84CrYIT002534; Fri, 4 Sep 2009 14:53:34 +0200 From: Jan Kiszka Subject: [PATCH 1/6] KGDB: Add kgdb_in_use To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Jason Wessel , Jan Kiszka Date: Fri, 04 Sep 2009 14:51:19 +0200 Message-ID: <20090904125119.18939.97835.stgit@mchn012c.ww002.siemens.net> In-Reply-To: <20090904125119.18939.89733.stgit@mchn012c.ww002.siemens.net> References: <20090904125119.18939.89733.stgit@mchn012c.ww002.siemens.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Allow other kernel subsystems to check for kgdb debug sessions. This will first be used by kvm to switch to conservative debug register saving/restoring on x86 if kgdb is in use. CC: Jason Wessel Signed-off-by: Jan Kiszka --- include/linux/kgdb.h | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 6adcc29..aebc768 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h @@ -72,6 +72,23 @@ struct uart_port; */ void kgdb_breakpoint(void); +/** + * kgdb_in_use - Check if kgdb is currently in use + * + * This function allows other kernel subsystems to check if the kernel + * is currently being debugged via kgdb. It returns false if not or if + * kgdb support was not built into the kernel. + * + */ +static inline int kgdb_in_use(void) +{ +#ifdef CONFIG_KGDB + return kgdb_connected; +#else + return 0; +#endif +} + extern int kgdb_connected; extern atomic_t kgdb_setting_breakpoint;