linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Sparc32: BTFIXUPSET_CALL(pmd_clear, . . .)-related issue in older versions of the kernel
       [not found] <CAK1sNPDMcX=D+=1uxVpX5HOgKyCzXr1EeUx7Eyky2j-2n3q0Ng@mail.gmail.com>
@ 2012-05-27 12:03 ` Ilya Malakhov
  2012-05-27 15:04   ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Malakhov @ 2012-05-27 12:03 UTC (permalink / raw)
  To: linux-kernel

 Hi.

 While analyzing a rather nasty problem with an application running at
sun4m sparc32 hosts with "Fujitsu TurboSparc" and "TI Viking/MXCC"
MMUs, I realized, that as a 4Kb "Page Table" was freed, only the first
element in the corresponding `pmdv[]' array in

typedef struct { unsigned long pmdv[16]; } pmd_t;

was actually cleared, rather than all the 16 ones.

 The reason for that was the use of `BTFIXUPCALL_SWAPO0G0' instead of
`BTFIXUPCALL_NORM' for `pmd_clear' in case of "default" SRMMU (except
for some specific types of SRMMU) during initialization:
 . .
BTFIXUPSET_CALL(pmd_clear, srmmu_pmd_clear, BTFIXUPCALL_SWAPO0G0);
 . .

 That would probably be OK if pmd_t were `struct { unsigned long pmd;
}' as it used to be ten years ago, but seems to be erroneous nowadays,
doesn't it?

 From a user's point of view this leads to poorly diagnosable
problems. E.g., after a series of mmaps and munmaps one may find
himself in a situation, where different virtual addresses are mapped to
the same physical one.

 A recent commit by David Miller, where pmd_clear() is un-btfixupped,
is likely to solve this problem in future versions of the kernel. I
wonder, if any patches for older ones should be expected.

 Thanks,
 Ilya.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Sparc32: BTFIXUPSET_CALL(pmd_clear, . . .)-related issue in older versions of the kernel
  2012-05-27 12:03 ` Sparc32: BTFIXUPSET_CALL(pmd_clear, . . .)-related issue in older versions of the kernel Ilya Malakhov
@ 2012-05-27 15:04   ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2012-05-27 15:04 UTC (permalink / raw)
  To: Ilya Malakhov; +Cc: linux-kernel, David S. Miller, sparclinux

Hi Ilya.

Cc: sparclinux + David S. Miller.

On Sun, May 27, 2012 at 04:03:50PM +0400, Ilya Malakhov wrote:
>  Hi.
> 
>  While analyzing a rather nasty problem with an application running at
> sun4m sparc32 hosts with "Fujitsu TurboSparc" and "TI Viking/MXCC"
> MMUs, I realized, that as a 4Kb "Page Table" was freed, only the first
> element in the corresponding `pmdv[]' array in
> 
> typedef struct { unsigned long pmdv[16]; } pmd_t;
> 
> was actually cleared, rather than all the 16 ones.
> 
>  The reason for that was the use of `BTFIXUPCALL_SWAPO0G0' instead of
> `BTFIXUPCALL_NORM' for `pmd_clear' in case of "default" SRMMU (except
> for some specific types of SRMMU) during initialization:
>  . .
> BTFIXUPSET_CALL(pmd_clear, srmmu_pmd_clear, BTFIXUPCALL_SWAPO0G0);
>  . .
> 
>  That would probably be OK if pmd_t were `struct { unsigned long pmd;
> }' as it used to be ten years ago, but seems to be erroneous nowadays,
> doesn't it?
> 
>  From a user's point of view this leads to poorly diagnosable
> problems. E.g., after a series of mmaps and munmaps one may find
> himself in a situation, where different virtual addresses are mapped to
> the same physical one.
> 
Sounds like a problem that have taken long time to track down!

>  A recent commit by David Miller, where pmd_clear() is un-btfixupped,
> is likely to solve this problem in future versions of the kernel.
We were very glad to kill off this btfixup thing.


> I wonder, if any patches for older ones should be expected.

If someone submits a patch for this it is likely to happen - hint!
That patch should explicit reference the commit in upstrem
that fixes the same bug.

Otherwise - no.

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-27 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAK1sNPDMcX=D+=1uxVpX5HOgKyCzXr1EeUx7Eyky2j-2n3q0Ng@mail.gmail.com>
2012-05-27 12:03 ` Sparc32: BTFIXUPSET_CALL(pmd_clear, . . .)-related issue in older versions of the kernel Ilya Malakhov
2012-05-27 15:04   ` Sam Ravnborg

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).