mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tab@snarc.org (Vincent Hanquez)
To: "2/6][XEN]"@snarc.org, "[x86]"@snarc.org, <akpm@osdl.org>, ",
	<ian.pratt@cl.cam.ac.uk>,,
	<vincent.hanquez@cl.cam.ac.uk>"@snarc.org, Andrew@snarc.org,
	debugreg@snarc.org, ",
	for, Hanquez, linux-kernel@vger.kernel.org, macro, Morton, new,
	Pratt, use, Vincent"@snarc.org
Cc: Ian@snarc.org
Subject: "[PATCH
Date: Tue, 26 Apr 2005 12:38:03 +0200 (CEST)	[thread overview]
Message-ID: <20050426103803.D47114BE14@darwin.snarc.org> (raw)

Hi,

The following patch make use of the 2 new macro cpu_set_debugreg and
cpu_get_debugreg.

as well, I can regenerate a patch keeping loaddebug if you folks seems
that is necessary or better.

Please apply, or comments.

	Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk>

diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/cpu/common.c linux-2.6.12-rc3.2/arch/i386/kernel/cpu/common.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/cpu/common.c	2005-04-21 11:45:45.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/cpu/common.c	2005-04-22 12:10:11.000000000 +0100
@@ -631,7 +631,7 @@
 
 	/* Clear all 6 debug registers: */
 
-#define CD(register) __asm__("movl %0,%%db" #register ::"r"(0) );
+#define CD(register) cpu_set_debugreg(0, register)
 
 	CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7);
 
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/process.c linux-2.6.12-rc3.2/arch/i386/kernel/process.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/process.c	2005-04-22 12:10:22.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/process.c	2005-04-22 13:53:54.000000000 +0100
@@ -626,13 +626,13 @@
 	 * Now maybe reload the debug registers
 	 */
 	if (unlikely(next->debugreg[7])) {
-		loaddebug(next, 0);
-		loaddebug(next, 1);
-		loaddebug(next, 2);
-		loaddebug(next, 3);
+		cpu_set_debugreg(current->thread.debugreg[0], 0);
+		cpu_set_debugreg(current->thread.debugreg[1], 1);
+		cpu_set_debugreg(current->thread.debugreg[2], 2);
+		cpu_set_debugreg(current->thread.debugreg[3], 3);
 		/* no 4 and 5 */
-		loaddebug(next, 6);
-		loaddebug(next, 7);
+		cpu_set_debugreg(current->thread.debugreg[6], 6);
+		cpu_set_debugreg(current->thread.debugreg[7], 7);
 	}
 
 	if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/signal.c linux-2.6.12-rc3.2/arch/i386/kernel/signal.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/signal.c	2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/signal.c	2005-04-22 12:10:11.000000000 +0100
@@ -618,7 +618,7 @@
 		 * inside the kernel.
 		 */
 		if (unlikely(current->thread.debugreg[7])) {
-			loaddebug(&current->thread, 7);
+			cpu_set_debugreg(current->thread.debugreg[7], 7);
 		}
 
 		/* Whee!  Actually deliver the signal.  */
diff -Naur linux-2.6.12-rc3.1/arch/i386/kernel/traps.c linux-2.6.12-rc3.2/arch/i386/kernel/traps.c
--- linux-2.6.12-rc3.1/arch/i386/kernel/traps.c	2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/kernel/traps.c	2005-04-22 12:10:11.000000000 +0100
@@ -682,7 +682,7 @@
 	unsigned int condition;
 	struct task_struct *tsk = current;
 
-	__asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
+	cpu_get_debugreg(condition, 6);
 
 	if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
 					SIGTRAP) == NOTIFY_STOP)
@@ -724,9 +724,7 @@
 	 * the signal is delivered.
 	 */
 clear_dr7:
-	__asm__("movl %0,%%db7"
-		: /* no output */
-		: "r" (0));
+	cpu_set_debugreg(0, 7);
 	return;
 
 debug_vm86:
diff -Naur linux-2.6.12-rc3.1/arch/i386/power/cpu.c linux-2.6.12-rc3.2/arch/i386/power/cpu.c
--- linux-2.6.12-rc3.1/arch/i386/power/cpu.c	2005-04-21 11:45:46.000000000 +0100
+++ linux-2.6.12-rc3.2/arch/i386/power/cpu.c	2005-04-22 12:10:11.000000000 +0100
@@ -94,13 +94,13 @@
 	 * Now maybe reload the debug registers
 	 */
 	if (current->thread.debugreg[7]){
-                loaddebug(&current->thread, 0);
-                loaddebug(&current->thread, 1);
-                loaddebug(&current->thread, 2);
-                loaddebug(&current->thread, 3);
-                /* no 4 and 5 */
-                loaddebug(&current->thread, 6);
-                loaddebug(&current->thread, 7);
+		cpu_set_debugreg(current->thread.debugreg[0], 0);
+		cpu_set_debugreg(current->thread.debugreg[1], 1);
+		cpu_set_debugreg(current->thread.debugreg[2], 2);
+		cpu_set_debugreg(current->thread.debugreg[3], 3);
+		/* no 4 and 5 */
+		cpu_set_debugreg(current->thread.debugreg[6], 6);
+		cpu_set_debugreg(current->thread.debugreg[7], 7);
 	}
 
 }

             reply	other threads:[~2005-04-26 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-26 10:38 Vincent Hanquez [this message]
2005-04-26 10:57 ` [PATCH 2/6][XEN][x86] Use new macro for debugreg Vincent Hanquez
  -- strict thread matches above, loose matches on Subject: below --
2023-10-08  2:10 [PATCH Pavan Bobba
2023-10-08  2:10 ` [PATCH Pavan Bobba
2023-10-08  2:10 ` [PATCH Pavan Bobba
2023-10-08  2:10 ` [PATCH Pavan Bobba
2023-10-08  2:13 ` [PATCH opensource india
2005-04-26 10:38 "[PATCH Vincent Hanquez
2005-04-26 10:38 "[PATCH Vincent Hanquez
2005-04-26 10:38 "[PATCH Vincent Hanquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050426103803.D47114BE14@darwin.snarc.org \
    --to=tab@snarc.org \
    --cc=", <ian.pratt@cl.cam.ac.uk>,, <vincent.hanquez@cl.cam.ac.uk>"@snarc.org \
    --cc=", for, Hanquez, linux-kernel@vger.kernel.org, macro, Morton, new, Pratt, use, Vincent"@snarc.org \
    --cc="2/6][XEN]"@snarc.org \
    --cc="[x86]"@snarc.org \
    --cc=Andrew@snarc.org \
    --cc=Ian@snarc.org \
    --cc=akpm@osdl.org \
    --cc=debugreg@snarc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®