[PATCH 1/5] Fix spurious segmentation faults
Sebastien Jan
s-jan at ti.com
Thu Jul 1 14:15:38 UTC 2010
On 07/01/2010 07:07 AM, Bryan Wu wrote:
> Sebjan,
>
> I heard this bug from Ogra before. And this patch touches the ARM common MM
> code, I also failed to find it in upstream mainline.
>
> I think if you or Rob can pointed out in the git log, it is better for us to review.
>
> Ogra, do we have a bug in LP about this?
>
> BTW, CONFIG_CPU_USE_DOMAINS=n in our ti-omap4 config
>
> Thanks,
> -Bryan
>
> On 07/01/2010 01:02 PM, Bryan Wu wrote:
>> From: Rob Clark <rob at ti.com>
>>
>> This patch helps fixing some 'segmentation faults' seen on Maverick FS.
>> It is an import of a part of an ARM patch.
>>
>> Signed-off-by: Sebastien Jan <s-jan at ti.com>
>> ---
>> arch/arm/mm/proc-macros.S | 9 ++++++++-
>> arch/arm/mm/proc-v7.S | 3 +++
>> 2 files changed, 11 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
>> index 7d63bea..1ccf579 100644
>> --- a/arch/arm/mm/proc-macros.S
>> +++ b/arch/arm/mm/proc-macros.S
>> @@ -99,7 +99,11 @@
>> * 110x 0 1 0 r/w r/o
>> * 11x0 0 1 0 r/w r/o
>> * 1111 0 1 1 r/w r/w
>> - */
>> + *
>> + * If !CONFIG_CPU_USE_DOMAINS, the following permissions are changed:
>> + * 110x 1 1 1 r/o r/o
>> + * 11x0 1 1 1 r/o r/o
>> + */
>> .macro armv6_mt_table pfx
>> \pfx\()_mt_table:
>> .long 0x00 @ L_PTE_MT_UNCACHED
>> @@ -138,8 +142,11 @@
>>
>> tst r1, #L_PTE_USER
>> orrne r3, r3, #PTE_EXT_AP1
>> +#ifdef CONFIG_CPU_USE_DOMAINS
>> + @ allow kernel read/write access to read-only user pages
>> tstne r3, #PTE_EXT_APX
>> bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
>> +#endif
>>
>> tst r1, #L_PTE_EXEC
>> orreq r3, r3, #PTE_EXT_XN
>> diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
>> index df74916..c1c3fe0 100644
>> --- a/arch/arm/mm/proc-v7.S
>> +++ b/arch/arm/mm/proc-v7.S
>> @@ -152,8 +152,11 @@ ENTRY(cpu_v7_set_pte_ext)
>>
>> tst r1, #L_PTE_USER
>> orrne r3, r3, #PTE_EXT_AP1
>> +#ifdef CONFIG_CPU_USE_DOMAINS
>> + @ allow kernel read/write access to read-only user pages
>> tstne r3, #PTE_EXT_APX
>> bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
>> +#endif
>>
>> tst r1, #L_PTE_EXEC
>> orreq r3, r3, #PTE_EXT_XN
Right, I shall have provided this info in the commit itself:
An early version of the following patch from Catalin was integrated into our omap4 branch:
http://www.spinics.net/lists/arm-kernel/msg91260.html
(see commit f22c4b02)
But there have been some updates to this patch series, which the current patch aims to cover, as it fixes some very ugly side effects.
Regarding patch author: I specified Rob as he did the investigations on the segfault we had, and find out the missing parts. We may have to credit Catalin instead/additionaly.
More information about the kernel-team
mailing list