From: Florian Fainelli <f.fainelli@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Ard Biesheuvel <ardb@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Russell King <linux@armlinux.org.uk>,
Arnd Bergmann <arnd@arndb.de>, Stefan Wahren <wahrenst@gmx.net>,
Kees Cook <keescook@chromium.org>,
linux-arm-kernel@lists.infradead.org,
Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH v3 4/4] ARM: Implement PAN for LPAE by TTBR0 page table walks disablement
Date: Tue, 14 May 2024 09:54:07 -0700 [thread overview]
Message-ID: <6ae2ba4a-584a-42f8-84c2-410d975f07fa@gmail.com> (raw)
In-Reply-To: <CAMuHMdVitrfOMi_MoWnSJ0=7Aovwvc0d2ROxNAFiiYv8zxN62g@mail.gmail.com>
On 5/14/24 09:06, Geert Uytterhoeven wrote:
> On Tue, May 14, 2024 at 1:28 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Tue, May 14, 2024 at 10:25 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>>> On Tue, 14 May 2024 at 10:04, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>>> On Tue, May 14, 2024 at 9:59 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>>>>> On Tue, 14 May 2024 at 09:46, Linus Walleij <linus.walleij@linaro.org> wrote:
>>>>>> On Tue, May 14, 2024 at 8:41 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>>>>>
>>>>>>> I sent you a small initramfs by PM.
>>>>>>
>>>>>> Booted this just fine on Vexpress QEMU:
>>>>>>
>>>>>> Run /init as init process
>>>>>> sysctl: error: 'kernel.hotplug' is an unknown key
>>>>>>
>>>>>>
>>>>>> boot (Linux 6.9.0-rc1+, BusyBox v1.16.0.git, kexec-tools 2.0.1-git)
>>>>>> / # mount -t debugfs none /sys/kernel/debug
>>>>>> / # echo "ACCESS_USERSPACE" | cat >/sys/kernel/debug/provoke-crash/DIRECT
>>>>>> lkdtm: Performing direct entry ACCESS_USERSPACE
>>>>>> lkdtm: attempting bad read at 76fea000
>>>>>> 8<--- cut here ---
>>>>>> Unable to handle kernel paging request at virtual address 76fea000 when read
>>>>>> [76fea000] *pgd=82c93003, *pmd=82c94003, *pte=a00000811e2f5f
>>>>>> Internal error: Oops: 206 [#1] SMP ARM
>>>>>> CPU: 1 PID: 86 Comm: cat Not tainted 6.9.0-rc1+ #46
>>>>>> Hardware name: ARM-Versatile Express
>>>>>> PC is at lkdtm_ACCESS_USERSPACE+0xc0/0x138
>>>>>> LR is at lkdtm_ACCESS_USERSPACE+0xc0/0x138
>>>>>>
>>>>>> I'm starting to think it is something about different LPAE implementations here.
>>>>>
>>>>> I have built multi_v7_defconfig with the following enabled
>>>>>
>>>>> CONFIG_ARM_LPAE=y
>>>>> CONFIG_CPU_TTBR0_PAN=y
>>>>> CONFIG_LKDTM=y
>>>>>
>>>>> and the resulting kernel boots happily as a 32-bit VM running under a
>>>>> Rpi4 KVM host.
>>>>>
>>>>> Could someone post an actual .config that reproduces this? Rpi4 is
>>>>> A72, which both works and doesn't work in Florian's testing, so I'd be
>>>>> highly surprised if this is not a config issue.
>>>>
>>>> shmobile_defconfig with CONFIG_LPAE=y added failed for me before.
>>>>
>>>> Building multi_v7_defconfig with the above enabled...
>>
>> And that works, while shmobile_defconfig with the above does not!
>> So it is config-related.
>
> I ran tools/testing/ktest/config-bisect.pl and found the "offending"
> config option: CONFIG_CC_OPTIMIZE_FOR_SIZE=y gives a broken
> kernel, CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y works.
> (verified by just enabling CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE in my
> broken config)....
I second that, my working configuration has
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y whereas my
broken one has CONFIG_CC_OPTIMIZE_FOR_SIZE=y, sure enough, changing the
broken configuration to have CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y turns
it into a "working" configuration on the Raspberry Pi 4B in AArch32 mode.
That makes more sense because BCM7211 and BCM2711 are exactly the same
CPU, thanks for restoring sanity!
--
Florian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-05-14 16:54 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 12:52 [PATCH v3 0/4] PAN for ARM32 using LPAE Linus Walleij
2024-03-12 12:52 ` [PATCH v3 1/4] ARM: Add TTBCR_* definitions to pgtable-3level-hwdef.h Linus Walleij
2024-03-12 12:52 ` [PATCH v3 2/4] ARM: Move asm statements accessing TTBCR into C functions Linus Walleij
2024-03-12 12:52 ` [PATCH v3 3/4] ARM: Reduce the number of #ifdef CONFIG_CPU_SW_DOMAIN_PAN Linus Walleij
2024-03-12 12:52 ` [PATCH v3 4/4] ARM: Implement PAN for LPAE by TTBR0 page table walks disablement Linus Walleij
2024-05-07 13:10 ` Geert Uytterhoeven
2024-05-13 19:23 ` Linus Walleij
2024-05-13 19:58 ` Geert Uytterhoeven
2024-05-13 20:29 ` Linus Walleij
2024-05-14 3:56 ` Florian Fainelli
2024-05-14 8:14 ` Russell King (Oracle)
2024-05-14 11:22 ` Geert Uytterhoeven
2024-05-14 11:33 ` Russell King (Oracle)
2024-05-14 12:32 ` Geert Uytterhoeven
2024-05-14 12:38 ` Russell King (Oracle)
2024-05-14 15:03 ` Catalin Marinas
2024-05-14 6:41 ` Geert Uytterhoeven
2024-05-14 7:46 ` Linus Walleij
2024-05-14 7:59 ` Ard Biesheuvel
2024-05-14 8:04 ` Geert Uytterhoeven
2024-05-14 8:25 ` Ard Biesheuvel
2024-05-14 9:22 ` Russell King (Oracle)
2024-05-14 11:40 ` Linus Walleij
2024-05-14 11:28 ` Geert Uytterhoeven
2024-05-14 16:06 ` Geert Uytterhoeven
2024-05-14 16:54 ` Florian Fainelli [this message]
2024-05-14 17:03 ` Russell King (Oracle)
2024-05-14 18:26 ` Florian Fainelli
2024-05-14 20:33 ` Linus Walleij
2024-05-14 20:34 ` Florian Fainelli
2024-05-15 8:36 ` Ard Biesheuvel
2024-05-15 8:45 ` Geert Uytterhoeven
2024-05-15 8:49 ` Ard Biesheuvel
2024-05-15 9:21 ` Geert Uytterhoeven
2024-05-15 9:39 ` Ard Biesheuvel
2024-05-15 11:58 ` Linus Walleij
2024-05-15 14:05 ` Geert Uytterhoeven
2024-05-15 8:48 ` Russell King (Oracle)
2024-05-15 8:53 ` Ard Biesheuvel
2024-05-15 12:27 ` Russell King (Oracle)
2024-05-15 15:41 ` Ard Biesheuvel
2024-05-15 16:18 ` Russell King (Oracle)
2024-05-15 16:36 ` Ard Biesheuvel
2024-05-15 21:51 ` Arnd Bergmann
2024-05-15 8:10 ` Geert Uytterhoeven
2024-05-14 7:37 ` Linus Walleij
2024-05-14 14:39 ` Catalin Marinas
2024-03-12 17:45 ` [PATCH v3 0/4] PAN for ARM32 using LPAE Florian Fainelli
2024-03-13 8:13 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ae2ba4a-584a-42f8-84c2-410d975f07fa@gmail.com \
--to=f.fainelli@gmail.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=geert@linux-m68k.org \
--cc=keescook@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).