Skip to contentSkip to conversation

x86: kgdb support

PATCH In review Ingo Molnar 2 participants 3 messages Feb 10, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 5/6 x86: kgdb support

From: Ingo Molnar <[email protected]>

simplified and streamlined kgdb support on x86, both 32-bit and 64-bit, based on patch from:

Subject: kgdb: core-lite
From: Jason Wessel <[email protected]>

[ and countless other authors - see the patch for details. ]

---
 arch/x86/Kconfig         |    4 
 arch/x86/kernel/Makefile |    1 
 arch/x86/kernel/kgdb.c   |  550 +++++++++++++++++++++++++++++++++++++++++++++++
 include/asm-x86/kgdb.h   |   87 +++++++
 4 files changed, 642 insertions(+)
arch/x86/Kconfig +4 -0
Index: linux-kgdb.q/arch/x86/Kconfig
===================================================================
@@ -14,6 +14,7 @@ config X86_32
 
 config X86_64
 	def_bool 64BIT
+	select KGDB_ARCH_HAS_SHADOW_INFO
 
 ### Arch settings
 config X86
@@ -139,6 +140,9 @@ config AUDIT_ARCH
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_SUPPORTS_KGDB
+	def_bool y
+
 # Use the generic interrupt handling code in kernel/irq/:
 config GENERIC_HARDIRQS
 	bool
arch/x86/kernel/Makefile +1 -0
Index: linux-kgdb.q/arch/x86/kernel/Makefile
===================================================================
@@ -58,6 +58,7 @@ obj-$(CONFIG_MODULES)		+= module_$(BITS)
 obj-$(CONFIG_ACPI_SRAT) 	+= srat_32.o
 obj-$(CONFIG_EFI) 		+= efi.o efi_$(BITS).o efi_stub_$(BITS).o
 obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault_32.o
+obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_VM86)		+= vm86_32.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/x86/kernel/kgdb.c new file +550 -0

550 lines not on this page · raw message

include/asm-x86/kgdb.h new file +87 -0

87 lines not on this page · raw message

#1 lore raw
Quoted 32 lines · Ingo Molnar

From: Ingo Molnar <[email protected]>

simplified and streamlined kgdb support on x86, both 32-bit and 64-bit, based on patch from:

Subject: kgdb: core-lite
From: Jason Wessel <[email protected]>

[ and countless other authors - see the patch for details. ]

---
 arch/x86/Kconfig         |    4 
 arch/x86/kernel/Makefile |    1 
 arch/x86/kernel/kgdb.c   |  550 +++++++++++++++++++++++++++++++++++++++++++++++
 include/asm-x86/kgdb.h   |   87 +++++++
 4 files changed, 642 insertions(+)

Index: linux-kgdb.q/arch/x86/Kconfig
===================================================================

arch/x86/Kconfig +1 -0
@@ -14,6 +14,7 @@ config X86_32
 
 config X86_64
 	def_bool 64BIT
+	select KGDB_ARCH_HAS_SHADOW_INFO
 
 ### Arch settings
 config X86

arch/x86/Kconfig config AUDIT_ARCH · line 145

Quoted 6 lines
arch/x86/Kconfig +3 -0
@@ -139,6 +140,9 @@ config AUDIT_ARCH
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_SUPPORTS_KGDB
+	def_bool y
+

Please use the documented HAVE_ approach and not this ugly "one variable per arch" idiom.
This was also commented last time the patchset were posted.

Sam

#2 lore raw
Quoted 10 lines · Sam Ravnborg
Quoted 10 lines

config X86_64

arch/x86/Kconfig +1 -0
 	def_bool 64BIT
+	select KGDB_ARCH_HAS_SHADOW_INFO
 
 ### Arch settings
 config X86
@@ -139,6 +140,9 @@ config AUDIT_ARCH
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
Quoted 7 lines

arch/x86/Kconfig config AUDIT_ARCH · line 145

Quoted 3 lines
arch/x86/Kconfig +3 -0
+config ARCH_SUPPORTS_KGDB
+	def_bool y
+

Please use the documented HAVE_ approach and not this ugly "one variable per arch" idiom. This was also commented last time the patchset were posted.

hm, i wasnt Cc:-ed to that so i didnt read it yet. I have just followed the logical ARHC_SUPPORTS_* idiom which reads more naturally than HAVE_ARCH_*. But ... no string feelings, changing it is easy enough, i renamed them and pushed out the new iteration to:

git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb.git

diffstat and shortlog did not change (just a rename of these config variables) - but i'm including them below for completeness of the submission.

any other observations?

Ingo

------------------>
Ingo Molnar (3):
pids: add pid_max prototype
uaccess: add probe_kernel_write()
x86: kgdb support

Jan Kiszka (1):
consoles: polling support, kgdboc

Jason Wessel (2):
kgdb: core
kgdb: document parameters

 Documentation/kernel-parameters.txt |    5 +
 arch/x86/Kconfig                    |    4 +
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/kgdb.c              |  550 ++++++++++
 drivers/char/tty_io.c               |   47 +
 drivers/serial/8250.c               |   62 ++
 drivers/serial/Kconfig              |    3 +
 drivers/serial/Makefile             |    1 +
 drivers/serial/kgdboc.c             |  164 +++
 drivers/serial/serial_core.c        |   67 ++-
 include/asm-generic/kgdb.h          |   93 ++
 include/asm-x86/kgdb.h              |   87 ++
 include/linux/kgdb.h                |  264 +++++
 include/linux/pid.h                 |    2 +
 include/linux/serial_core.h         |    4 +
 include/linux/tty_driver.h          |   12 +
 include/linux/uaccess.h             |   22 +
 kernel/Makefile                     |    1 +
 kernel/kgdb.c                       | 2020 +++++++++++++++++++++++++++++++++++
 kernel/sysctl.c                     |    2 +-
 lib/Kconfig.debug                   |    2 +
 lib/Kconfig.kgdb                    |   37 +
 22 files changed, 3448 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/kernel/kgdb.c
 create mode 100644 drivers/serial/kgdboc.c
 create mode 100644 include/asm-generic/kgdb.h
 create mode 100644 include/asm-x86/kgdb.h
 create mode 100644 include/linux/kgdb.h
 create mode 100644 kernel/kgdb.c
 create mode 100644 lib/Kconfig.kgdb