[PATCH 2/2] powerpc/mm: Warn if W+X pages found on boot
Christophe Leroy
christophe.leroy at c-s.fr
Fri Aug 9 23:11:18 AEST 2019
Le 02/05/2019 à 07:51, Russell Currey a écrit :
>>>>> + if (radix_enabled())
>>>>> + st.start_address = PAGE_OFFSET;
>>>>> + else
>>>> + st.start_address = KERN_VIRT_START;
>>>>
>>>> KERN_VIRT_START doesn't exist on PPC32.
>>>>
>>>> Christophe
>>>>
>>> Thanks a lot for the review! Applied all your suggestions. What
>>> should I use on PPC32 instead?
>>
>> Indeed it looks like KERN_VIRT_START is defined as 0 for PPC32 at
>> the
>> top of ptdump.c, which look strange to me.
>>
>> I guess PAGE_OFFSET should be the good value for KERN_VIRT_START on
>> PPC32.
>>
>> Christophe
>
> git blame says you put it there :) I'll set it to PAGE_OFFSET instead
> of zero. Cheers
>
Finally it seems that I was right at first place. KERN_VIRT_START should
be 0 because in walk_pagetables(), it starts with:
pgd_t *pgd = pgd_offset_k(0UL);
Now that KERN_VIRT_START has changed to 0xc0000000, I get a shift of
0xc0000000 in the display, ie the kernel pages are displayed starting at
0x80000000 instead of 0xc0000000 (0x80000000 = 0xc0000000 + 0xc0000000)
Since we only want to display kernel pages, I guess we should use
pgd_t *pgd = pgd_offset_k(KERN_VIRT_START); but then we can't use the
for () loop as it is.
Does it work properly on PPC64 ? If so, that's surprising.
Christophe
More information about the Linuxppc-dev
mailing list