lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1264196472-5387-4-git-send-email-henne@nachtwindheim.de>
Date:	Fri, 22 Jan 2010 22:41:12 +0100
From:	Henrik Kretzschmar <henne@...htwindheim.de>
To:	jonathan@...zard.org.uk
Cc:	alan@...ux.intel.com, tlinux-users@....toshiba-dme.co.jp,
	linux-kernel@...r.kernel.org,
	Henrik Kretzschmar <henne@...htwindheim.de>
Subject: [PATCH 4/4] [DRIVERS] add a register dumper for debugging

Add a dumper to examine the changes of the registers before and after
calling the Toshiba SMM.

Signed-off-by: Henrik Kretzschmar <henne@...htwindheim.de>
---
 drivers/char/toshiba.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c
index 111baba..626d281 100644
--- a/drivers/char/toshiba.c
+++ b/drivers/char/toshiba.c
@@ -75,6 +75,20 @@
 #define DRV_NAME "toshiba"
 #define TOSH_MINOR_DEV 181
 
+#if TOSH_DEBUG == 1
+static void pr_smmregs(SMMRegisters *regs)
+{
+	printk(KERN_DEBUG DRV_NAME " EAX: 0x%08x EBX: 0x%08x ECX: 0x%08x\n",
+	       regs->eax, regs->ebx, regs->ecx);
+	printk(KERN_DEBUG DRV_NAME " EDX: 0x%08x ESI: 0x%08x EDI: 0x%08x\n",
+	       regs->edx, regs->esi, regs->edi);
+}
+#else
+static inline void pr_smmregs(SMMRegisters *regs)
+{
+}
+#endif
+
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jonathan Buzzard <jonathan@...zard.org.uk>");
 MODULE_DESCRIPTION("Toshiba laptop SMM driver");
@@ -220,6 +234,9 @@ int tosh_smm(SMMRegisters *regs)
 {
 	int eax;
 
+	printk(KERN_DEBUG DRV_NAME " %s start\n", __func__);
+	pr_smmregs(regs);
+
 	asm ("# load the values into the registers\n\t" \
 		"pushl %%eax\n\t" \
 		"movl 0(%%eax),%%edx\n\t" \
@@ -249,6 +266,9 @@ int tosh_smm(SMMRegisters *regs)
 		: "a" (regs)
 		: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
 
+	pr_smmregs(regs);
+	printk(KERN_DEBUG DRV_NAME " %s done\n", __func__);
+
 	return eax;
 }
 EXPORT_SYMBOL(tosh_smm);
-- 
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ