From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Dan Malek <dan@embeddededge.com>
Cc: linux-ppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: fix swapping on 8xx?
Date: Mon, 7 Nov 2005 13:10:11 -0200 [thread overview]
Message-ID: <20051107151011.GA17161@logos.cnet> (raw)
Hi,
The following is an attempt to fix swapping on 8xx by not touching
_PAGE_ACCESSED bit if the page is not present.
Dan, what do you think?
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index de09787..4451828 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -41,6 +41,22 @@
#else
#define DO_8xx_CPU6(val, reg)
#endif
+
+/* can't overwrite the _PAGE_ACCESSED bit of a non-present page (might
+ contain swap data). */
+#ifdef CONFIG_SWAP
+#define SET_PAGE_ACCESSED(reg, destreg, tmpreg) \
+ andi. tmpreg, reg, _PAGE_PRESENT; \
+ beq 9f; \
+ ori reg, reg, _PAGE_ACCESSED; \
+ stw r10, 0(destreg); \
+9:
+#else
+#define SET_PAGE_ACCESSED(reg, destreg, tmpreg) \
+ ori reg, reg, _PAGE_ACCESSED; \
+ stw reg, 0(destreg);
+#endif
+
.text
.globl _stext
_stext:
@@ -332,8 +348,7 @@ InstructionTLBMiss:
mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
lwz r10, 0(r11) /* Get the pte */
- ori r10, r10, _PAGE_ACCESSED
- stw r10, 0(r11)
+ SET_PAGE_ACCESSED(r10, r11, r3)
/* The Linux PTE won't go exactly into the MMU TLB.
* Software indicator bits 21, 22 and 28 must be clear.
@@ -399,8 +414,7 @@ DataStoreTLBMiss:
mtspr SPRN_MD_TWC, r11
mfspr r11, SPRN_MD_TWC /* get the pte address again */
- ori r10, r10, _PAGE_ACCESSED
- stw r10, 0(r11)
+ SET_PAGE_ACCESSED(r10, r11, r3) /* and update pte in table */
/* The Linux PTE won't go exactly into the MMU TLB.
* Software indicator bits 21, 22 and 28 must be clear.
@@ -507,9 +521,9 @@ DataTLBError:
/* Update 'changed', among others.
*/
- ori r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
+ ori r10, r10, _PAGE_DIRTY|_PAGE_HWWRITE
mfspr r11, SPRN_MD_TWC /* Get pte address again */
- stw r10, 0(r11) /* and update pte in table */
+ SET_PAGE_ACCESSED(r10, r11, r3) /* and update pte in table */
/* The Linux PTE won't go exactly into the MMU TLB.
* Software indicator bits 21, 22 and 28 must be clear.
next reply other threads:[~2005-11-07 20:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-07 15:10 Marcelo Tosatti [this message]
2005-11-08 0:55 ` fix swapping on 8xx? Dan Malek
2005-11-08 11:59 ` David Jander
2005-11-08 17:56 ` Tom Rini
2005-11-08 18:57 ` Dan Malek
2005-11-08 19:44 ` David Jander
2005-11-08 20:56 ` Wolfgang Denk
2005-11-08 20:52 ` Wolfgang Denk
2005-11-08 21:02 ` Tom Rini
2005-11-08 22:46 ` Wolfgang Denk
2005-11-08 23:20 ` Dan Malek
2005-11-08 22:30 ` Dan Malek
2005-11-09 11:21 ` Marcelo Tosatti
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=20051107151011.GA17161@logos.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=dan@embeddededge.com \
--cc=linuxppc-embedded@ozlabs.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;
as well as URLs for NNTP newsgroup(s).