From: Kumba <kumba@gentoo.org>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] Fix for 2.6.5/2.6.6 Swap issue
Date: Thu, 27 May 2004 14:39:54 -0400 [thread overview]
Message-ID: <40B635FA.3080807@gentoo.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
Peter Horton wrote this patch up several weeks ago for Cobalt, but it's
applicable for all MIPS machines I've seen thus far (atleast SGI and
Cobalt). It fixes the kernel panic resulting from trying to activate
swap on a system running 2.6.5 and up. It's been in Gentoo's
mips-sources for quite some time, and I've had no problems with it on my
O2 or Cobalt.
--Kumba
--
"Such is oft the course of deeds that move the wheels of the world:
small hands do them because they must, while the eyes of the great are
elsewhere." --Elrond
[-- Attachment #2: mipscvs-2.6.5-swapbug-fix.patch --]
[-- Type: text/plain, Size: 1329 bytes --]
diff -urN include/asm-mips/pgtable-32.h include/asm-mips/pgtable-32.h
--- include/asm-mips/pgtable-32.h 2004-03-11 16:46:57.000000000 +0000
+++ include/asm-mips/pgtable-32.h 2004-04-17 09:06:02.000000000 +0100
@@ -203,14 +203,18 @@
/* Swap entries must have VALID and GLOBAL bits cleared. */
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
-#define __swp_type(x) (((x).val >> 1) & 0x7f)
-#define __swp_offset(x) ((x).val >> 10)
-#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 10) })
+/* offset is limited to 17 bits (512MB @ 4K page) */
+/* VALID & GLOBAL are bits 9 & 8 */
+#define __swp_type(x) (((x).val >> 10) & 0x1f)
+#define __swp_offset(x) ((x).val >> 15)
+#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 10) | ((offset) << 15) })
#else
-#define __swp_type(x) (((x).val >> 1) & 0x1f)
-#define __swp_offset(x) ((x).val >> 8)
-#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
+/* offset is limited to 19 bits (2GB @ 4K page) */
+/* VALID & GLOBAL are bits 7 & 6 */
+#define __swp_type(x) (((x).val >> 8) & 0x1f)
+#define __swp_offset(x) ((x).val >> 13)
+#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 8) | ((offset) << 13) })
#endif
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
reply other threads:[~2004-05-27 18:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=40B635FA.3080807@gentoo.org \
--to=kumba@gentoo.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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