From patchwork Tue May 10 21:05:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 9063331 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0B5319F1D3 for ; Tue, 10 May 2016 21:08:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB2F5201DD for ; Tue, 10 May 2016 21:08:14 +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 91891201C8 for ; Tue, 10 May 2016 21:08: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 1b0Eqf-0006ku-Cj; Tue, 10 May 2016 21:05:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0Eqe-0006kC-To for xen-devel@lists.xen.org; Tue, 10 May 2016 21:05:45 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id E5/9D-12920-82D42375; Tue, 10 May 2016 21:05:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRWlGSWpSXmKPExsVyMXThQV11X6N wg0UbVS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyma0vYC2bpV0y72sjawDhRvYuRi0NIYCKj xJrrS9lAHBaBecwSV+5OYAVxJAT6WSVWNS1h7GLkBHJiJE4+6meGsCslnu/cAmYLCShI/J5wi Ali1CQmicUTJ7OAJNgENCSe/JrBBmKLCEhLXPt8mRGkiFngGZPE68NdYN3CArYSV89dA7NZBF Qlns06ANbAK+Ag0bbvKZDNAbRNTmLBex+QMKeAo8TiKatYIBY7SJz/fIFxAqPAAkaGVYzqxal FZalFukZ6SUWZ6RkluYmZObqGBqZ6uanFxYnpqTmJScV6yfm5mxiBocUABDsYv/9xOsQoycGk JMrb42YULsSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mCN8gHKCdYlJqeWpGWmQMMcpi0BAePkgivA Eiat7ggMbc4Mx0idYrRkmPL72trmTg+bbwDJLdNvbeWSYglLz8vVUqclxOkQQCkIaM0D24cLB IvMcpKCfMyAh0oxFOQWpSbWYIq/4pRnINRSZi3AWQKT2ZeCdzWV0AHMQEdJMemD3JQSSJCSqq BMWzplZivnkf3b+d5PG9VpIbh1HeNxvdUFJhzrv1LspoUmsI9NavWgyfxmoXwUflsZ7b2yfqp 8cvzNmVLTN23brPhzMeLEpYprz52OdFxj6jP7d85qdfrJN33y8b/2u8zY2PKl2dFyTNnNMa6O 3ucXOZtdu3aqoPq006fOev1Z0Ws+NVN/x62siuxFGckGmoxFxUnAgDvrHRQvwIAAA== X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1462914342!38647286!1 X-Originating-IP: [209.85.161.193] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50310 invoked from network); 10 May 2016 21:05:43 -0000 Received: from mail-yw0-f193.google.com (HELO mail-yw0-f193.google.com) (209.85.161.193) by server-6.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 May 2016 21:05:43 -0000 Received: by mail-yw0-f193.google.com with SMTP id i22so2213828ywc.1 for ; Tue, 10 May 2016 14:05:43 -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=QNY96eT5vhDXMZtfPuJOJzQmyClESvhLkUB4SkyZ240=; b=I1+ERduZs5wIIGu6qHmTmUcZVOGo2Wj9WVqCKSmj3Fc0oVfz/JY6gIsNoRyHlepu7F g8GgU1350lDcOocX545ohGCK6rhmNJmRXK4Su2L5vumWqcZJH2ZiySYDY3yz0ApBwQ5C B01S2LVPROZ0fijcGlVwKFp5tS9811PxGnUok= 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=QNY96eT5vhDXMZtfPuJOJzQmyClESvhLkUB4SkyZ240=; b=ZaiXpTyE0qcpBIsi9Zp2+5Hcigxt8g9S/Wiv5U49Nl65u5c3ASfm3zBZzmUvni08/x 0L8iZt3czmxJ5udlVdTxqf+MpwMnLUxrLly74KIElZampn6yKqUGx8wTXagwid+SoNpx 1vxGEl8ssqKmeEPSf04gDZ6OAsTIaQyF4NyYr1aND6b7OHlRSx4PkKvIEqm7oFe82rwo 4mCdJXTOPNglnDKIjwTOg+IfB06tRh7zEOZiBi9UEMXRv/SK/2ss8njJfqTT8VKHHK98 xoxm+PwjcRTSJ0H9qSXa6LU+rg+WgQ7zCAIt1kK3FNRC+6ADd5KpvZEp/tNE/GZiM0yJ 7moQ== X-Gm-Message-State: AOPr4FWVmFIT4Jaigt265PizENYswoHykWwmv+OZ0kRtSgv106f1LXoHV3meauQ8Y9E0Sw== X-Received: by 10.13.220.65 with SMTP id f62mr23270383ywe.36.1462914342251; Tue, 10 May 2016 14:05:42 -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 e6sm2198740ywd.23.2016.05.10.14.05.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 May 2016 14:05:41 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Tue, 10 May 2016 16:05:25 -0500 Message-Id: <1462914329-8797-3-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1462914329-8797-1-git-send-email-cardoe@cardoe.com> References: <1462914329-8797-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 v3 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY 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: 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 | 7 +++++++ 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, 17 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 47dc885..8abfbaa 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -1,6 +1,13 @@ menu "Debugging Options" +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. + config DEBUG bool "Developer Checks" ---help--- diff --git a/xen/Rules.mk b/xen/Rules.mk index f73d86e..1a220bd 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 @@ -28,6 +27,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) @@ -56,7 +58,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 */