linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Skov <jskov@redhat.com>
To: Peter Allworth <linsol@zeta.org.au>
Cc: duncanp@research.canon.com.au,
	linuxppc-embedded@lists.linuxppc.org,
	linuxppc-dev@lists.linuxppc.org
Subject: Re: Low memory problems in 8xx Linux
Date: 08 Feb 2000 11:01:55 +0100	[thread overview]
Message-ID: <ot1z6of1ws.fsf@thinktwice.zoftcorp.dk> (raw)
In-Reply-To: Peter Allworth's message of "Wed, 02 Feb 2000 11:25:04 +1100"


>>>>> "Peter" == Peter Allworth <linsol@zeta.org.au> writes:

Peter> duncanp@research.canon.com.au wrote:
>>  Dan,
>>
>> On 1 Feb, Dan Malek wrote: > I have already incorporated most of
>> these into 2.3.xx > kernel, and a 2.2.13 version that I will update
>> as a tar file > on a server.
>>
>> would you mind posting a diff against the current 2.2.13 kernel on
>> the ftp server when you do this as well? we've got a kernel in CVS
>> here (i imagine plently of others are doing this too), and it would
>> be easier for us if we can patch it.
>>
>> Dunk.

Peter> Dunk,

Peter> If you need the MMU patches straight-away, I've put them on

Peter> http://www.zeta.org.au/~linsol

Peter> They only work against cllf-2.2.13 for now. Marcus Sundberg has
Peter> sent me a revised patch which should work for other 2.2 kernels
Peter> (caveat emptor).  I'll try to add that asap.

Peter and Duncan,

The 2.2.13 patch you posted was slightly (but critically) wrong, if
I'm not mistaken. The value updated in memory was not reloaded into
r21 which is where the code below this snipped expects to find the
value.

This patch should do the trick. At least my kernel seems to work.


--- head.S.orig	Sat Oct 23 00:18:03 1999
+++ head.S	Tue Feb  8 10:34:02 2000
@@ -1024,6 +1024,18 @@
 	ori	r21, r21, 1	/* Set valid bit in physical L2 page */
 	mtspr	MD_TWC, r21	/* Load pte table base address */
 	mfspr	r21, MD_TWC	/* ....and get the pte address */
+	lwz	r20, 0(r21)			/* Get the pte */
+	andi.	r20, r20, _PAGE_PRESENT		/* Set cr0 if it's invalid */
+	beq	4f				/* Skip update if invalid */
+	mfspr	r20, DSISR			/* Check for store op */
+	andis.	r20, r20, 0x0200		/* If set, indicates store */
+	lwz	r20, 0(r21)			/* Get the pte again */
+	beq	3f
+	ori	r20, r20, _PAGE_DIRTY|_PAGE_HWWRITE /* Set the dirty flags */
+3:
+	ori	r20, r20, _PAGE_ACCESSED	/* Set the accessed flag */
+	stw	r20, 0(r21)			/* Update the pte */
+4:
 	lwz	r21, 0(r21)	/* Get the pte */

 	/* Set four subpage valid bits (24, 25, 26, and 27).


An alternative and slighly faster implementation might be to skip the
_PAGE_PRESENT check. Any reason something like this wouldn't work?


 	ori	r21, r21, 1	/* Set valid bit in physical L2 page */
 	mtspr	MD_TWC, r21	/* Load pte table base address */
 	mfspr	r21, MD_TWC	/* ....and get the pte address */
	mfspr	r20, DSISR			/* Check for store op */
	andis.	r20, r20, 0x0200		/* If set, indicates store */
	lwz	r20, 0(r21)			/* Get the pte again */
	beq	3f
	ori	r20, r20, _PAGE_DIRTY|_PAGE_HWWRITE /* Set the dirty flags */
3:
	ori	r20, r20, _PAGE_ACCESSED	/* Set the accessed flag */
	stw	r20, 0(r21)			/* Update the pte */
 	mr	r21, r20	/* Get the pte */


Cheers,
Jesper

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2000-02-08 10:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-31 15:02 Low memory problems in 8xx Linux Marcus Sundberg
2000-02-01  2:51 ` Peter Allworth
2000-02-01 18:08   ` Marcus Sundberg
2000-02-01 19:47     ` Dan Malek
2000-02-01 23:30       ` Peter Allworth
2000-02-01 23:59         ` Dan Malek
2000-02-01 23:54       ` duncanp
2000-02-02  0:25         ` Peter Allworth
2000-02-08 10:01           ` Jesper Skov [this message]
2000-02-09  0:00             ` Peter Allworth
2000-02-09  8:43               ` Jesper Skov
2000-02-09 23:26                 ` Peter Allworth
2000-02-09  1:11             ` more " Peter Allworth
2000-02-09  5:52               ` Dan Malek
2000-02-09  8:40               ` Jesper Skov
2000-03-22 15:43   ` Residual data Claude Robitaille
2000-03-23 10:36     ` Gabriel Paubert

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=ot1z6of1ws.fsf@thinktwice.zoftcorp.dk \
    --to=jskov@redhat.com \
    --cc=duncanp@research.canon.com.au \
    --cc=linsol@zeta.org.au \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=linuxppc-embedded@lists.linuxppc.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).