* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
@ 2005-01-11 18:49 ` William Lee Irwin III
2005-01-12 3:56 ` Bob Breuer
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: William Lee Irwin III @ 2005-01-11 18:49 UTC (permalink / raw)
To: sparclinux
On Tue, Jan 11, 2005 at 08:36:05AM -0600, Art Haas wrote:
> A pull of the current BK kernel failed to build, with an error in
> mm/memory.c about pte_read() not being defined. This function was added
> in at revsion 1.204, and the 'bk prs' with this comment:
> D 1.204 05/01/04 18:48:23-08:00 gnb@melbourne.sgi.com[torvalds] 213 212 18/2/215
> 6
> P mm/memory.c
> C oprofile: add check_user_page_readable()
> The pte_read() function is defined at include/asm-sparc64/pgtable.h for
> 64-bit Sparc, but is not defined for 32-bit Sparc. Anyone taken a shot
> at making a patch for this yet?
According to Bob Breuer, returning 1 always seems to work for ordinary
userspace (as opposed to "unusual" programs). I've got documentation,
so I'll brew up something more accurate for it over the weekend.
-- wli
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
2005-01-11 18:49 ` William Lee Irwin III
@ 2005-01-12 3:56 ` Bob Breuer
2005-01-12 5:38 ` William Lee Irwin III
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Bob Breuer @ 2005-01-12 3:56 UTC (permalink / raw)
To: sparclinux
William Lee Irwin III wrote:
> On Tue, Jan 11, 2005 at 08:36:05AM -0600, Art Haas wrote:
>
>>A pull of the current BK kernel failed to build, with an error in
>>mm/memory.c about pte_read() not being defined. This function was added
...
>>The pte_read() function is defined at include/asm-sparc64/pgtable.h for
>>64-bit Sparc, but is not defined for 32-bit Sparc. Anyone taken a shot
>>at making a patch for this yet?
>
>
> According to Bob Breuer, returning 1 always seems to work for ordinary
> userspace (as opposed to "unusual" programs). I've got documentation,
> so I'll brew up something more accurate for it over the weekend.
>
Yes, the easy way out is to return 1 from pte_read. To do it right we will
need a combined solution for sun4c and sun4m. I think that sun4 can use the
sun4c version and sun4d will share with sun4m.
For sun4c, we can use the software managed read bit:
return pte_val(pte) & _SUN4C_PAGE_READ;
I can't test this myself, but it mirrors the pte_write functionality.
For sun4m, there is no software bit for read, so we peek at the hardware ACC
field from the pte:
return !(pte_val(pte) & 0x10);
We need a #define to go with the new usage of this bit, maybe SRMMU_NOREAD?
I have tested the sun4m solution on my SS20 and it works for me.
Now, how can these be combined using the btfixup magic?
Bob
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
2005-01-11 18:49 ` William Lee Irwin III
2005-01-12 3:56 ` Bob Breuer
@ 2005-01-12 5:38 ` William Lee Irwin III
2005-01-12 6:24 ` William Lee Irwin III
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: William Lee Irwin III @ 2005-01-12 5:38 UTC (permalink / raw)
To: sparclinux
William Lee Irwin III wrote:
>> According to Bob Breuer, returning 1 always seems to work for ordinary
>> userspace (as opposed to "unusual" programs). I've got documentation,
>> so I'll brew up something more accurate for it over the weekend.
On Tue, Jan 11, 2005 at 10:02:58PM -0600, Bob Breuer wrote:
> Yes, the easy way out is to return 1 from pte_read. To do it right we will
> need a combined solution for sun4c and sun4m. I think that sun4 can use
> the sun4c version and sun4d will share with sun4m.
> For sun4c, we can use the software managed read bit:
> return pte_val(pte) & _SUN4C_PAGE_READ;
> I can't test this myself, but it mirrors the pte_write functionality.
> For sun4m, there is no software bit for read, so we peek at the hardware
> ACC field from the pte:
> return !(pte_val(pte) & 0x10);
> We need a #define to go with the new usage of this bit, maybe SRMMU_NOREAD?
> I have tested the sun4m solution on my SS20 and it works for me.
> Now, how can these be combined using the btfixup magic?
Ship me what you've got and I'll test it on sun4c and BTFIXUP-ize it.
-- wli
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
` (2 preceding siblings ...)
2005-01-12 5:38 ` William Lee Irwin III
@ 2005-01-12 6:24 ` William Lee Irwin III
2005-01-12 6:30 ` Bob Breuer
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: William Lee Irwin III @ 2005-01-12 6:24 UTC (permalink / raw)
To: sparclinux
William Lee Irwin III wrote:
>> Ship me what you've got and I'll test it on sun4c and BTFIXUP-ize it.
On Wed, Jan 12, 2005 at 12:30:19AM -0600, Bob Breuer wrote:
> Ok, how about this patch to start from?
Looks good to work with. I'll send back something probably by the end
of the day tomorrow.
-- wli
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
` (3 preceding siblings ...)
2005-01-12 6:24 ` William Lee Irwin III
@ 2005-01-12 6:30 ` Bob Breuer
2005-01-21 23:05 ` Art Haas
2005-01-21 23:09 ` William Lee Irwin III
6 siblings, 0 replies; 8+ messages in thread
From: Bob Breuer @ 2005-01-12 6:30 UTC (permalink / raw)
To: sparclinux
William Lee Irwin III wrote:
>
> Ship me what you've got and I'll test it on sun4c and BTFIXUP-ize it.
>
Ok, how about this patch to start from?
diff -urp linux-2.6.10-bk8-clean/include/asm-sparc/pgtable.h linux-2.6.10-bk8/include/asm-sparc/pgtable.h
--- linux-2.6.10-bk8-clean/include/asm-sparc/pgtable.h 2005-01-12 00:16:39.000000000 -0600
+++ linux-2.6.10-bk8/include/asm-sparc/pgtable.h 2005-01-12 00:15:21.000000000 -0600
@@ -186,10 +186,21 @@ BTFIXUPDEF_CALL(void, pgd_clear, pgd_t *
* The following only work if pte_present() is true.
* Undefined behaviour if not..
*/
+//BITFIXUPDEF_????(pte_readi)
BTFIXUPDEF_HALF(pte_writei)
BTFIXUPDEF_HALF(pte_dirtyi)
BTFIXUPDEF_HALF(pte_youngi)
+extern int pte_read(pte_t pte) __attribute_const__;
+extern __inline__ int pte_read(pte_t pte)
+{
+#if 0 // SUN4/SUN4C
+ return pte_val(pte) & _SUN4C_PAGE_READ;
+#else // SUN4M
+ return !(pte_val(pte) & SRMMU_NOREAD);
+#endif
+}
+
extern int pte_write(pte_t pte) __attribute_const__;
extern __inline__ int pte_write(pte_t pte)
{
diff -urp linux-2.6.10-bk8-clean/include/asm-sparc/pgtsrmmu.h linux-2.6.10-bk8/include/asm-sparc/pgtsrmmu.h
--- linux-2.6.10-bk8-clean/include/asm-sparc/pgtsrmmu.h 2004-10-18 16:53:46.000000000 -0500
+++ linux-2.6.10-bk8/include/asm-sparc/pgtsrmmu.h 2005-01-12 00:09:44.000000000 -0600
@@ -73,6 +73,7 @@
#define SRMMU_CACHE 0x80
#define SRMMU_DIRTY 0x40
#define SRMMU_REF 0x20
+#define SRMMU_NOREAD 0x10
#define SRMMU_EXEC 0x08
#define SRMMU_WRITE 0x04
#define SRMMU_VALID 0x02 /* SRMMU_ET_PTE */
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
` (4 preceding siblings ...)
2005-01-12 6:30 ` Bob Breuer
@ 2005-01-21 23:05 ` Art Haas
2005-01-21 23:09 ` William Lee Irwin III
6 siblings, 0 replies; 8+ messages in thread
From: Art Haas @ 2005-01-21 23:05 UTC (permalink / raw)
To: sparclinux
On Tue, Jan 11, 2005 at 10:24:29PM -0800, William Lee Irwin III wrote:
> William Lee Irwin III wrote:
> >> Ship me what you've got and I'll test it on sun4c and BTFIXUP-ize it.
>
> On Wed, Jan 12, 2005 at 12:30:19AM -0600, Bob Breuer wrote:
> > Ok, how about this patch to start from?
>
> Looks good to work with. I'll send back something probably by the end
> of the day tomorrow.
>
Hi.
Has a BTFIXUP'ed patch slipped by? Still being tested/developed?
Art
--
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.
-Thomas Jefferson to James Smith, 1822
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Current BK kernel error
2005-01-11 14:36 Current BK kernel error Art Haas
` (5 preceding siblings ...)
2005-01-21 23:05 ` Art Haas
@ 2005-01-21 23:09 ` William Lee Irwin III
6 siblings, 0 replies; 8+ messages in thread
From: William Lee Irwin III @ 2005-01-21 23:09 UTC (permalink / raw)
To: sparclinux
On Tue, Jan 11, 2005 at 10:24:29PM -0800, William Lee Irwin III wrote:
>> Looks good to work with. I'll send back something probably by the end
>> of the day tomorrow.
On Fri, Jan 21, 2005 at 05:05:19PM -0600, Art Haas wrote:
> Has a BTFIXUP'ed patch slipped by? Still being tested/developed?
I've been shaken up by current events. I'll get to it this weekend.
-- wli
^ permalink raw reply [flat|nested] 8+ messages in thread