All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: sparclinux@vger.kernel.org
Subject: [sparc32] vm fault code handling
Date: Wed, 22 Dec 2004 14:31:13 +0000	[thread overview]
Message-ID: <20041222143113.GT771@holomorphy.com> (raw)

Convert arch/sparc/mm/fault.c to symbolic fault codes, default to minor
faults for unrecognized fault codes. Also treat VM_FAULT_OOM similarly
to VM_FAULT_SIGBUS in force_user_fault(), thereby fixing a latent bug.

Index: sparc32-2.6.10-rc3/arch/sparc/mm/fault.c
=================================--- sparc32-2.6.10-rc3.orig/arch/sparc/mm/fault.c	2004-10-07 04:01:27.000000000 -0700
+++ sparc32-2.6.10-rc3/arch/sparc/mm/fault.c	2004-12-21 08:10:56.962777738 -0800
@@ -294,16 +294,17 @@
 	 * the fault.
 	 */
 	switch (handle_mm_fault(mm, vma, address, write)) {
-	case 1:
-		current->min_flt++;
-		break;
-	case 2:
+	case VM_FAULT_SIGBUS:
+		goto do_sigbus;
+	case VM_FAULT_OOM:
+		goto out_of_memory;
+	case VM_FAULT_MAJOR:
 		current->maj_flt++;
 		break;
-	case 0:
-		goto do_sigbus;
+	case VM_FAULT_MINOR:
 	default:
-		goto out_of_memory;
+		current->min_flt++;
+		break;
 	}
 	up_read(&mm->mmap_sem);
 	return;
@@ -535,8 +536,11 @@
 		if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
 			goto bad_area;
 	}
-	if (!handle_mm_fault(mm, vma, address, write))
+	switch (handle_mm_fault(mm, vma, address, write)) {
+	case VM_FAULT_SIGBUS:
+	case VM_FAULT_OOM:
 		goto do_sigbus;
+	}
 	up_read(&mm->mmap_sem);
 	return;
 bad_area:

             reply	other threads:[~2004-12-22 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-22 14:31 William Lee Irwin III [this message]
2004-12-22 23:38 ` [sparc32] vm fault code handling Art Haas
2004-12-23  3:23 ` William Lee Irwin III

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=20041222143113.GT771@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.