From patchwork Mon May 2 04:10:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 8989781 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A1D39BF29F for ; Mon, 2 May 2016 04:13:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94355201DD for ; Mon, 2 May 2016 04:13:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76B13201C7 for ; Mon, 2 May 2016 04:13:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax5CN-0002EA-Ep; Mon, 02 May 2016 04:11:07 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax5CL-0002Db-Dr for xen-devel@lists.xen.org; Mon, 02 May 2016 04:11:05 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id 5B/F5-03757-853D6275; Mon, 02 May 2016 04:11:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsVyMXThYd3wy2r hBrsPWFos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlzGnrYCh7oVUx6zt3AeFSti5GLQ0hgEqPE xkV32EEcFoF5zBLLn39jBHEkBPpZJdY+mc7WxcgJ5MRInHk0DaiKA8iulXh5zB4kLCSgIPF7w iEmiEmTmSQ+XJ3PDJJgE9CQePJrBliviIC0xLXPlxlBbGaBEom983+A2cICdhL3TuxhBJnJIq AqsbChHCTMK+Ao0blsExPEKjmJBe99QMKcAk4SfV83MUOsdZR4+uE+4wRGgQWMDKsY1YtTi8p Si3RN9ZKKMtMzSnITM3N0DQ1N9HJTi4sT01NzEpOK9ZLzczcxAkOKAQh2MK5b7HyIUZKDSUmU d/IxtXAhvqT8lMqMxOKM+KLSnNTiQ4wyHBxKErw3LgLlBItS01Mr0jJzgMENk5bg4FES4bU9B 5TmLS5IzC3OTIdInWK05Njy+9paJo5PG+8AyW1T761lEmLJy89LlRLnNbkE1CAA0pBRmgc3Dh aBlxhlpYR5GYEOFOIpSC3KzSxBlX/FKM7BqCTM6w0yhSczrwRu6yugg5iADsperwpyUEkiQkq qgfH0DG738GkbDuxacyizstRPZp+3cQhXQOj3sDhZ292s8+1ZKsI/yAmbWwZP4T+l+fvB5Jvl 2+Ou3vgisMcp6bWWMu/OP/O3fCq3WFH9d2m+4GSVBYfynaUUfFynKK0MmbTLUrhUbKrP7D9Ki TcsN1ZwZlee/Ka5pM+oPF0/4let+jvNbw+m31FiKc5INNRiLipOBACsX651uwIAAA== X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1462162262!38894335!1 X-Originating-IP: [209.85.161.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57348 invoked from network); 2 May 2016 04:11:03 -0000 Received: from mail-yw0-f195.google.com (HELO mail-yw0-f195.google.com) (209.85.161.195) by server-16.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 2 May 2016 04:11:03 -0000 Received: by mail-yw0-f195.google.com with SMTP id i22so17783006ywc.1 for ; Sun, 01 May 2016 21:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XHIuIleohMhTfGQBt7uoctP/pXHQ0ChJW18kkZ5qm+M=; b=dJ9A/MLtuB2m53anIscTabWD4TghVp6FX+XvvQMNMLm6O+4uTf64KvUXufYPeDD68m MmZ84eRwAkR7GSlJFwq8fRqPHIMu893e/L7hy8L68Pol0F88zgH0OlwENNZPhi1TdPEN Oq+50F7eyg+A7w5vQ5eu75DthukZ2nSZ69t4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XHIuIleohMhTfGQBt7uoctP/pXHQ0ChJW18kkZ5qm+M=; b=HjN1YcqFB0AnzfmtPGb2sWLW7D7SzlpqOMimup5HDrU8AB9FMkrOa2KfOuxohtdlGk ZjYi86E4ysVoLbmvUp/QkECJpHjX0Q3mlU0Wg9uZurWIEINKCqyMwodtbjRTu0Cd23sn 8aLkDb4hoR4YpeVXtmn5Ah+F+DgMwi2D0Ho37YPUdJwBFOA7/br+LxCnlo8SnQuHi8Ud WMBCnoIklkkGkjRALsn5Y3qjpgsgGJDSLCShYI8XfXMVXQ3MoMERZDKYnTJV73S0jBB9 r04d7aQYoc9N5psqW2dUt4GkLm8EpLCd+jSj1RrSUW/XU6vJRsEwzrmSAQhoXz+/f2bA X32A== X-Gm-Message-State: AOPr4FUcfMrpivlJvZWSoGRCBUVjtxWj3sXvMcJtWH+/aR0nO3kC1h9lccyVWJx3+/U15Q== X-Received: by 10.129.131.203 with SMTP id t194mr17772350ywf.107.1462162262439; Sun, 01 May 2016 21:11:02 -0700 (PDT) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id j3sm14334897ywj.32.2016.05.01.21.11.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 May 2016 21:11:01 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Sun, 1 May 2016 23:10:41 -0500 Message-Id: <1462162246-32413-3-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1462162246-32413-1-git-send-email-cardoe@cardoe.com> References: <1462162246-32413-1-git-send-email-cardoe@cardoe.com> Cc: Andrew Cooper , Doug Goldstein , Jan Beulich Subject: [Xen-devel] [RFC PATCH 2/7] build: convert crash_debug to Kconfig X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID,UNPARSEABLE_RELAY,URIBL_BLACK autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert the crash_debug option to Kconfig as CONFIG_CRASH_DEBUG. This was previously togglable on the command line so this adds a message for users enabling it from the command line to tell them to enable it from make menuconfig. Signed-off-by: Doug Goldstein --- CC: Jan Beulich CC: Andrew Cooper --- INSTALL | 1 - docs/misc/crashdb.txt | 4 ++-- xen/Kconfig.debug | 11 +++++++++++ xen/Rules.mk | 5 +++-- xen/arch/x86/Makefile | 3 +-- xen/arch/x86/x86_64/Makefile | 2 +- xen/common/Makefile | 2 +- xen/include/asm-x86/debugger.h | 2 +- xen/include/xen/gdbstub.h | 2 +- 9 files changed, 21 insertions(+), 11 deletions(-) diff --git a/INSTALL b/INSTALL index 95fa94d..2974b9b 100644 --- a/INSTALL +++ b/INSTALL @@ -231,7 +231,6 @@ verbose=y perfc=y perfc_arrays=y lock_profile=y -crash_debug=y frame_pointer=y lto=y diff --git a/docs/misc/crashdb.txt b/docs/misc/crashdb.txt index b41a538..9733666 100644 --- a/docs/misc/crashdb.txt +++ b/docs/misc/crashdb.txt @@ -5,7 +5,7 @@ Xen has a simple gdb stub for doing post-mortem debugging i.e. once you've crashed it, you get to poke around and find out why. There's also a special key handler for making it crash, which is handy. -You need to have crash_debug=y set when compiling , and you also need +You need to have CRASH_DEBUG=y set when compiling, and you also need to enable it on the Xen command line, eg by gdb=com1. If you need to have a serial port shared between gdb and the console, @@ -19,7 +19,7 @@ if you have a simple null modem connection between the test box and the workstation, and aren't using a H/L split console: * Set debug=y in Config.mk - * Set crash_debug=y in xen/Rules.mk + * Set CRASH_DEBUG=y with `make -C xen menuconfig` * Make the changes in the attached patch, and build. * Arrange to pass gdb=com1 as a hypervisor command line argument (I already have com1=38400,8n1 console=com1,vga sync_console) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index d14d758..ee68f0d 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -5,3 +5,14 @@ menuconfig DEBUG If you want to debug Xen say Y and select any additional debugging support options. This enables additional debugging through Xen and as a result enabling this option results in no security guarantees. + +if DEBUG + +config CRASH_DEBUG + bool "Crash Debugging Support" + depends on X86 + ---help--- + If you want to be able to attach gdb to Xen to be able to debug + Xen if it crashes then say Y. + +endif # DEBUG diff --git a/xen/Rules.mk b/xen/Rules.mk index 961d533..c044fd1 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -7,7 +7,6 @@ verbose ?= n perfc ?= n perfc_arrays ?= n lock_profile ?= n -crash_debug ?= n frame_pointer ?= n lto ?= n @@ -30,6 +29,9 @@ endif ifneq ($(origin kexec),undefined) $(error "You must use 'make menuconfig' to enable/disable kexec now.") endif +ifneq ($(origin crash_debug),undefined) +$(error "You must use 'make menuconfig' to enable/disable crash_debug now.") +endif # Set ARCH/SUBARCH appropriately. override TARGET_SUBARCH := $(XEN_TARGET_ARCH) @@ -58,7 +60,6 @@ CFLAGS += -Wa,--strip-local-absolute endif CFLAGS-$(verbose) += -DVERBOSE -CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS CFLAGS-$(lock_profile) += -DLOCK_PROFILE diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 4665a68..4ccef4a 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -27,6 +27,7 @@ obj-y += domain_page.o obj-y += e820.o obj-y += extable.o obj-y += flushtlb.o +obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o obj-y += i387.o obj-y += i8259.o obj-y += io_apic.o @@ -66,8 +67,6 @@ obj-y += vm_event.o obj-$(CONFIG_XSPLICE) += alternative.o xsplice.o obj-y += xstate.o -obj-$(crash_debug) += gdbstub.o - x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \ diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile index 5b54c16..d8815e7 100644 --- a/xen/arch/x86/x86_64/Makefile +++ b/xen/arch/x86/x86_64/Makefile @@ -14,4 +14,4 @@ obj-y += cpu_idle.o obj-y += cpufreq.o obj-bin-$(CONFIG_KEXEC) += kexec_reloc.o -obj-$(crash_debug) += gdbstub.o +obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o diff --git a/xen/common/Makefile b/xen/common/Makefile index afd84b6..a98bcc2 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -8,6 +8,7 @@ obj-y += domain.o obj-y += event_2l.o obj-y += event_channel.o obj-y += event_fifo.o +obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o obj-y += grant_table.o obj-y += guestcopy.o obj-bin-y += gunzip.init.o @@ -64,7 +65,6 @@ obj-$(CONFIG_XSPLICE) += xsplice_elf.o obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o) obj-$(perfc) += perfc.o -obj-$(crash_debug) += gdbstub.o obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o) diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h index 33f4700..fb92ee4 100644 --- a/xen/include/asm-x86/debugger.h +++ b/xen/include/asm-x86/debugger.h @@ -39,7 +39,7 @@ #define DEBUGGER_trap_fatal(_v, _r) \ if ( debugger_trap_fatal(_v, _r) ) return; -#if defined(CRASH_DEBUG) +#if defined(CONFIG_CRASH_DEBUG) #include diff --git a/xen/include/xen/gdbstub.h b/xen/include/xen/gdbstub.h index ab710da..a5e6714 100644 --- a/xen/include/xen/gdbstub.h +++ b/xen/include/xen/gdbstub.h @@ -23,7 +23,7 @@ #include #include -#ifdef CRASH_DEBUG +#ifdef CONFIG_CRASH_DEBUG struct gdb_context { int serhnd; /* handle on our serial line */