From patchwork Tue May 24 13:56:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 9133723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D59426075E for ; Tue, 24 May 2016 13:59:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C634628285 for ; Tue, 24 May 2016 13:59:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAE5D28288; Tue, 24 May 2016 13:59:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 330A228233 for ; Tue, 24 May 2016 13:59:13 +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 1b5CpP-00065W-De; Tue, 24 May 2016 13:56:59 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5CpO-00064u-HG for xen-devel@lists.xen.org; Tue, 24 May 2016 13:56:58 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 41/45-07835-9AD54475; Tue, 24 May 2016 13:56:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsVyMXThYd2VsS7 hBqee8Fos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlffgYUrDeoODiRq4GxV6OLkZNDSGAio8SE tSwgNovAPGaJWwf1QGwJgX5Wies3ZCHsGIkZ548B1XAA2TUS7+/6QrQqSPyecIipi5ELyJ7CJ PHl1gdGkASbgIbEk18z2EBsEQFpiWufLzOCFDELPGOSeH24ixkkISxgK/H5/SJWiMWqEs/XLW ECsXkFHCX2Td4OtUxOYsF7HxCTU8BJYts3eYi9jhKP5x9hnsAosICRYRWjRnFqUVlqka6hoV5 SUWZ6RkluYmaOrqGBqV5uanFxYnpqTmJSsV5yfu4mRmA4MQDBDsaV7c6HGCU5mJREeQ20XMKF +JLyUyozEosz4otKc1KLDzHKcHAoSfByxgDlBItS01Mr0jJzgIENk5bg4FES4Y0BSfMWFyTmF memQ6ROMVpybPl9bS0Tx6eNd4Dktqn31jIJseTl56VKifMygzQIgDRklObBjYNF3yVGWSlhXk agA4V4ClKLcjNLUOVfMYpzMCoJ8xaBTOHJzCuB2/oK6CAmoIP8vziDHFSSiJCSamAUVs1pW7u Gv4tzre+mG1MVmr/Pyj/Y80bNfP0N3xfG3SeXOz+7NjnkvPhXua3v9/Q1Gut8nFZTaX+inPsr b/3d6o3Pva65RUY7af89ott25VpUet97UbHPbSvfa+hO+XmD1YWvKeACq4CfZrd88/z3gt/Kl P/0az+46XLyyksOQXVBG+kH+5cpsRRnJBpqMRcVJwIAKy6x5bkCAAA= X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1464098216!41342381!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 48841 invoked from network); 24 May 2016 13:56:57 -0000 Received: from mail-yw0-f195.google.com (HELO mail-yw0-f195.google.com) (209.85.161.195) by server-5.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 24 May 2016 13:56:57 -0000 Received: by mail-yw0-f195.google.com with SMTP id j74so2334375ywg.1 for ; Tue, 24 May 2016 06:56:56 -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=fRxhwHzW9hpKm871y93Y9p1cwFjcjDfwDFs7B2y+rw4=; b=QLaoA/oFxW2+YtIUwftbEmIh6tSyPy+OFnK0uX2xX5GpJp6grihQ7q7wk92Bw5O+Iq Wo49W5F3R6PmF4xAwyrkSJYw+Q1OlTBqLDFgIUylK3P/2B1HfYCmb1XwnNW8olZHAMo/ KZnEYmaaEG4toSaCQR/KJsEYtvBP7ara3XEaw= 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=fRxhwHzW9hpKm871y93Y9p1cwFjcjDfwDFs7B2y+rw4=; b=XU+GoxqLHYTZ5MHQKQiqPo/m+vEI+NBTo9AkN9otmyTNZvfD2fvNS3pE3um22enRLl xPSrmsyOfvUqbzYw2AqCv4PH+7wwcKw/ZlgBJDK31bHZMUZKiC4sibIVPOy3JKF9G0QS IlUVTnhr8YKgoIJeJkkaLSzrTlwOsZ04fs+Mc0ONmcfx4ai6KVy8/v2x3HxfixxDnI6t Eg88C4K/CROMuLaKdyOFxuBmMBBuLl7CcYRhwIPKSE1gcxb2Viurhg+i/igY6ZYqksn7 4sfae9MOoXDfdVewq1OkwVmY4tTJ8UmgT7Tk1sGx0jUAW9GinSQmfCvGNbFdnwX/3oXm ofLQ== X-Gm-Message-State: ALyK8tLYQzG60isMma1caJ2o/mhf1xv+OU+8C6EAta4C83TBD5dxtAqRdgSrIuRTkr9UGw== X-Received: by 10.129.116.131 with SMTP id p125mr2845984ywc.201.1464098215829; Tue, 24 May 2016 06:56:55 -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 i67sm22199641ywf.34.2016.05.24.06.56.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 May 2016 06:56:54 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Tue, 24 May 2016 08:56:35 -0500 Message-Id: <1464098199-19851-3-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1464098199-19851-1-git-send-email-cardoe@cardoe.com> References: <1464098199-19851-1-git-send-email-cardoe@cardoe.com> Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Doug Goldstein , Tim Deegan , Jan Beulich , Ian Jackson Subject: [Xen-devel] [PATCH v5 2/6] 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-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 Reviewed-by: Andrew Cooper Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Jan Beulich --- CC: Andrew Cooper CC: George Dunlap CC: Ian Jackson CC: Jan Beulich CC: Konrad Rzeszutek Wilk CC: Stefano Stabellini CC: Tim Deegan CC: Wei Liu --- 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 796af0c..8eeb13f 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -11,4 +11,15 @@ config DEBUG You probably want to say 'N' here. +if DEBUG || EXPERT = "y" + +config CRASH_DEBUG + bool "Crash Debugging Support" + depends on X86 + ---help--- + If you want to attach gdb to Xen to debug Xen if it crashes + then say Y. + +endif # DEBUG || EXPERT + endmenu diff --git a/xen/Rules.mk b/xen/Rules.mk index da2f490..b077e25 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 @@ -25,6 +24,9 @@ ifeq ($(perfc_arrays),y) perfc := y endif +ifneq ($(origin crash_debug),undefined) +$(error "You must use 'make menuconfig' to enable/disable crash_debug now.") +endif ifeq ($(origin debug),command line) $(warning "You must use 'make menuconfig' to enable/disable debug now.") endif @@ -59,7 +61,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..271cbaa 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) +#ifdef 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 */