* PTE entries
@ 2007-04-20 4:34 Siva Prasad
2007-04-24 1:05 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 7+ messages in thread
From: Siva Prasad @ 2007-04-20 4:34 UTC (permalink / raw)
To: linuxppc-dev, linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 266 bytes --]
Hi,
Where exactly the PTE are setup for any given new user program?
In other words, if you are trying to execute a user level program,
kernel needs to load it and setup PTEs for that program. Where does
kernel do it?
Thanks
Siva
[-- Attachment #2: Type: text/html, Size: 2357 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PTE entries
2007-04-20 4:34 PTE entries Siva Prasad
@ 2007-04-24 1:05 ` Benjamin Herrenschmidt
2007-04-25 3:34 ` Siva Prasad
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-24 1:05 UTC (permalink / raw)
To: Siva Prasad; +Cc: linuxppc-dev, linuxppc-embedded
On Thu, 2007-04-19 at 21:34 -0700, Siva Prasad wrote:
> Hi,
>
>
>
> Where exactly the PTE are setup for any given new user program?
>
>
>
> In other words, if you are trying to execute a user level program,
> kernel needs to load it and setup PTEs for that program. Where does
> kernel do it?
They are faulted in.
See do_page_fault
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: PTE entries
2007-04-24 1:05 ` Benjamin Herrenschmidt
@ 2007-04-25 3:34 ` Siva Prasad
2007-04-25 3:50 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 7+ messages in thread
From: Siva Prasad @ 2007-04-25 3:34 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linuxppc-embedded
Thanks Ben.
I managed to fix this. I am working on how best we can rewrite the self
modifying code we have for create_hpte routine. I would prefer to read
from SDR1, than to hardcode (or self modify the code) the way it is done
now.
Feel free to let me know what you think.
Thanks
Siva
-----Original Message-----
From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]=20
Sent: Monday, April 23, 2007 6:05 PM
To: Siva Prasad
Cc: linuxppc-dev@ozlabs.org; linuxppc-embedded@ozlabs.org
Subject: Re: PTE entries
On Thu, 2007-04-19 at 21:34 -0700, Siva Prasad wrote:
> Hi,
>=20
> =20
>=20
> Where exactly the PTE are setup for any given new user program?
>=20
> =20
>=20
> In other words, if you are trying to execute a user level program,
> kernel needs to load it and setup PTEs for that program. Where does
> kernel do it?
They are faulted in.
See do_page_fault
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: PTE entries
2007-04-25 3:34 ` Siva Prasad
@ 2007-04-25 3:50 ` Benjamin Herrenschmidt
2007-05-02 19:58 ` Siva Prasad
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 3:50 UTC (permalink / raw)
To: Siva Prasad; +Cc: linuxppc-dev, linuxppc-embedded
On Tue, 2007-04-24 at 20:34 -0700, Siva Prasad wrote:
> Thanks Ben.
>
> I managed to fix this. I am working on how best we can rewrite the self
> modifying code we have for create_hpte routine. I would prefer to read
> from SDR1, than to hardcode (or self modify the code) the way it is done
> now.
>
> Feel free to let me know what you think.
Self-modifying allows better performances in that very critical code path...
Why would you need to change that code anyway ?
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: PTE entries
2007-04-25 3:50 ` Benjamin Herrenschmidt
@ 2007-05-02 19:58 ` Siva Prasad
2007-05-02 22:03 ` Paul Mackerras
2007-05-02 22:12 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 7+ messages in thread
From: Siva Prasad @ 2007-05-02 19:58 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linuxppc-embedded
Hi Ben,
First,=20
Are there any other places where we have self modifying code in Linux
kernel, other than in arch/powerpc/mm/ppc_mmu_32.c:MMU_init_hw()
(basically modified create_hpte and flush_hash_page)
Second,
Instead of using addis, why can't we move it from SDR1 register and mask
the second half. SDR1 has the required value. Right?
May be I am missing something here.
Thanks
- Siva
-----Original Message-----
From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]=20
Sent: Tuesday, April 24, 2007 8:50 PM
To: Siva Prasad
Cc: linuxppc-dev@ozlabs.org; linuxppc-embedded@ozlabs.org
Subject: RE: PTE entries
On Tue, 2007-04-24 at 20:34 -0700, Siva Prasad wrote:
> Thanks Ben.
>=20
> I managed to fix this. I am working on how best we can rewrite the
self
> modifying code we have for create_hpte routine. I would prefer to read
> from SDR1, than to hardcode (or self modify the code) the way it is
done
> now.
>=20
> Feel free to let me know what you think.
Self-modifying allows better performances in that very critical code
path...
Why would you need to change that code anyway ?
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: PTE entries
2007-05-02 19:58 ` Siva Prasad
@ 2007-05-02 22:03 ` Paul Mackerras
2007-05-02 22:12 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 7+ messages in thread
From: Paul Mackerras @ 2007-05-02 22:03 UTC (permalink / raw)
To: Siva Prasad; +Cc: linuxppc-embedded, linuxppc-dev
Siva Prasad writes:
> Are there any other places where we have self modifying code in Linux
> kernel, other than in arch/powerpc/mm/ppc_mmu_32.c:MMU_init_hw()
> (basically modified create_hpte and flush_hash_page)
Yes, the cpu feature stuff writes nops over various bits of code
depending on what cpu you're running on. See do_feature_fixups() in
arch/powerpc/kernel/cputable.c.
> Instead of using addis, why can't we move it from SDR1 register and mask
> the second half. SDR1 has the required value. Right?
> May be I am missing something here.
mtspr is slow on most processors, certainly slower than addis.
Paul.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: PTE entries
2007-05-02 19:58 ` Siva Prasad
2007-05-02 22:03 ` Paul Mackerras
@ 2007-05-02 22:12 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2007-05-02 22:12 UTC (permalink / raw)
To: Siva Prasad; +Cc: linuxppc-dev, linuxppc-embedded
On Wed, 2007-05-02 at 12:58 -0700, Siva Prasad wrote:
> Hi Ben,
>
> First,
> Are there any other places where we have self modifying code in Linux
> kernel, other than in arch/powerpc/mm/ppc_mmu_32.c:MMU_init_hw()
> (basically modified create_hpte and flush_hash_page)
There is the cpu feature fixup code, there might also be something
around the SMP code.
> Second,
> Instead of using addis, why can't we move it from SDR1 register and mask
> the second half. SDR1 has the required value. Right?
> May be I am missing something here.
Would be slower. Accessing SPRs is slow.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-05-02 22:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-20 4:34 PTE entries Siva Prasad
2007-04-24 1:05 ` Benjamin Herrenschmidt
2007-04-25 3:34 ` Siva Prasad
2007-04-25 3:50 ` Benjamin Herrenschmidt
2007-05-02 19:58 ` Siva Prasad
2007-05-02 22:03 ` Paul Mackerras
2007-05-02 22:12 ` Benjamin Herrenschmidt
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).