From patchwork Sun May 22 05:01:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 9130715 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 EFE30607D4 for ; Sun, 22 May 2016 05:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9148928191 for ; Sun, 22 May 2016 05:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8636A28195; Sun, 22 May 2016 05:04:23 +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 D21AC2819E for ; Sun, 22 May 2016 05:04:19 +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 1b4LWV-0005c1-M6; Sun, 22 May 2016 05:01:55 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4LWU-0005bc-Jp for xen-devel@lists.xen.org; Sun, 22 May 2016 05:01:54 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id CE/60-20564-14D31475; Sun, 22 May 2016 05:01:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRWlGSWpSXmKPExsVyMXThIV1HW8d wg0XzeCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozfi9uYChbrVxx/OJ+5gbFDvYuRi0NIYAKj xOav+1lBHBaBecwSr5e+ZQJxJAT6WSVOrzrK3sXICeTESOyZfpIVwq6WeLj6ACOILSSgIPF7w iEmiFHzmCT6Pm9mAUmwCWhIPPk1gw3EFhGQlrj2+TIjSBGzwDMmideHu5hBEsICthIvpl5gAr FZBFQlGl/MApvKK+Ag0bh4J9BmDqBtchIL3vuAmJwCjhIXvmtD7HWQaFi3kGUCo8ACRoZVjOr FqUVlqUW6pnpJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXrJ+bmbGIGBxQAEOxi/9DsfYpTk YFIS5U3ttg8X4kvKT6nMSCzOiC8qzUktPsQow8GhJMErb+MYLiRYlJqeWpGWmQMMcZi0BAePk ghEmre4IDG3ODMdInWK0ZJjy+9ra5k4Pm28AyS3Tb23lkmIJS8/L1VKnFcVpEEApCGjNA9uHC wOLzHKSgnzMgIdKMRTkFqUm1mCKv+KUZyDUUmY1xNkCk9mXgnc1ldABzEBHfRQ2gHkoJJEhJR UA+OiT5Zx+zwfMd8/N4lt0gyPZgs1rYN8mnoVU/yUr+412ZZy9J1guE/gsoVtwc9Sok+KXnl2 rjX5yME4sRsZW9VXrfqXXOF5ZVaj2E+tmyyBW24yLcjOSru/p71MaZeng42VULcV4/NOubTbn NyWJpp2rDnz/0uUWBneNvN5HbDoJcetwtehC5VYijMSDbWYi4oTAdkOYu++AgAA X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1463893312!40930263!1 X-Originating-IP: [209.85.161.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5418 invoked from network); 22 May 2016 05:01:53 -0000 Received: from mail-yw0-f194.google.com (HELO mail-yw0-f194.google.com) (209.85.161.194) by server-4.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 22 May 2016 05:01:52 -0000 Received: by mail-yw0-f194.google.com with SMTP id j74so887254ywg.1 for ; Sat, 21 May 2016 22:01:52 -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=j/abczN4Z+C2FhS0P2kKsDxgxp+bvhi20IcL4YZtFXU=; b=aLyLbqycQcOOhMqXudc2eXvWlHuUVzVX4kM+UDCjm6vTD9ihQbtdSaQKHGsI8nJ+wJ VdNhWzexRrEfkS/dGGdyW+nQdmArZ671N1XqF92SfshRyfqaJ8JNsLfzGm16sZvY3K9K 7tFLtDDelQ5bGOG190E+PDRKBhRO7WNWSdA98= 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=j/abczN4Z+C2FhS0P2kKsDxgxp+bvhi20IcL4YZtFXU=; b=FfifP5b397PUh2FKb/qFoTWDky9kaqlcaZVNXL3ReIz5+VO2t/1ECkSC7nbYuHzVTl wmESLS9nZ3Urc69RLpFxJVDKs06j1IIvWJtinlL8TE/NmMwk5yKkaUYXcJh2Sl/SwBfO 2nNG8doCceGd9PGzMXGAJCJvVwtTjjJGf89DR8zGlfD9F6BBZSfHHCbUrqgtCRIcooYS 0JwlMn8NOq9QQ4yfNX8SGjt5noqm0MZys+A44OFE1IeOmwfvRiIHXLnnn4SP2nw4pPYr Oa7Y50gmkXBrO9PPix1Wyy8O1jRrL/gSpss+8CaENLJD+EGMzTp9J3RVjDOQ5b+rZY4e cVFA== X-Gm-Message-State: AOPr4FWHHWD5M9Ygp8AJbs+tFIp9FMThVd28m36eJzd5+H83q99PVIuL+ID1/WVynSBclQ== X-Received: by 10.129.51.140 with SMTP id z134mr6056135ywz.322.1463893311773; Sat, 21 May 2016 22:01:51 -0700 (PDT) Received: from localhost.localdomain (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id z20sm15961686ywd.44.2016.05.21.22.01.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 May 2016 22:01:50 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Sun, 22 May 2016 00:01:31 -0500 Message-Id: <1463893295-2610-3-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1463893295-2610-1-git-send-email-cardoe@cardoe.com> References: <1463893295-2610-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 v4 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 --- 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 b446027..308911a 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -10,4 +10,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 be able to attach gdb to Xen to be able to debug + Xen if it crashes then say Y. + +endif # DEBUG || EXPERT + endmenu diff --git a/xen/Rules.mk b/xen/Rules.mk index 86c1e0d..45aad61 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) $(error "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 */