mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: linux-kernel@vger.kernel.org
Subject: K8 Errata #93: adjusting address to a fixup block
Date: 17 Oct 2004 16:46:49 -0300	[thread overview]
Message-ID: <orr7nxyvo6.fsf@livre.redhat.lsd.ic.unicamp.br> (raw)

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

While I investigated the problem of probing the touchpad on a Compaq
Presario r3004, I'd sometimes get the K8 Errata #93 warning.  One of
my theories was that we might be missing some fix up because of the
Errata, or adjusting an address that wasn't the current-instruction
address, so I came up with this patch.  It turned out to make no
difference, but it still feels like an improvement to me, since some
day we might be resuming from halt into a fix-up block.  Thoughts?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: linux-2.6.9-k8errata93.patch --]
[-- Type: text/x-patch, Size: 1245 bytes --]

--- arch/x86_64/mm/fault.c.k8errata93	2004-10-17 08:49:45.000000000 -0300
+++ arch/x86_64/mm/fault.c	2004-10-17 11:14:40.000000000 -0300
@@ -188,9 +188,12 @@
    Try to work around it here.
    Note we only handle faults in kernel here. */
 
-static int is_errata93(struct pt_regs *regs, unsigned long address) 
+static int is_errata93(struct pt_regs *regs, unsigned long address,
+		       unsigned long error_code)
 {
 	static int warned;
+	if ((error_code & 16) == 0)
+		return 0;
 	if (address != regs->rip)
 		return 0;
 	if ((address >> 32) != 0) 
@@ -202,6 +205,8 @@
 			printk(errata93_warning); 		
 			warned = 1;
 		}
+		printk(KERN_DEBUG "is_errata93 adjusted %lx to %lx\n",
+		       regs->rip, address);
 		regs->rip = address;
 		return 1;
 	}
@@ -253,6 +258,7 @@
 	const struct exception_table_entry *fixup;
 	int write;
 	siginfo_t info;
+	int errata93_return = 0;
 
 #ifdef CONFIG_CHECKING
 	{ 
@@ -463,8 +469,11 @@
  	if (is_prefetch(regs, address, error_code))
  		return;
 
-	if (is_errata93(regs, address))
-		return; 
+	if (is_errata93(regs, address, error_code)) {
+		errata93_return = 1;
+		goto no_context;
+	} else if (errata93_return)
+		return;
 
 /*
  * Oops. The kernel tried to access some bad page. We'll have to

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

             reply	other threads:[~2004-10-17 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-17 19:46 Alexandre Oliva [this message]
     [not found] <2Qpmj-1uX-13@gated-at.bofh.it>
2004-10-17 20:23 ` Andi Kleen
2004-10-21 16:49   ` Alexandre Oliva

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=orr7nxyvo6.fsf@livre.redhat.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=linux-kernel@vger.kernel.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®