[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H7X_T7t88TbEZfkrwUcDAoJy1X4KbzWw_KZaoXuq730RA@mail.gmail.com>
Date: Wed, 8 Feb 2023 19:17:59 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Jianmin Lv <lvjianmin@...ngson.cn>,
WANG Xuerui <kernel@...0n.name>,
David Laight <David.Laight@...lab.com>,
Huacai Chen <chenhuacai@...ngson.cn>,
"loongarch@...ts.linux.dev" <loongarch@...ts.linux.dev>,
Linux-Arch <linux-arch@...r.kernel.org>,
Xuefeng Li <lixuefeng@...ngson.cn>, guoren <guoren@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] LoongArch: Make -mstrict-align be configurable
Hi, Arnd,
On Tue, Feb 7, 2023 at 10:11 PM Arnd Bergmann <arnd@...db.de> wrote:
>
> On Tue, Feb 7, 2023, at 14:28, Jianmin Lv wrote:
> > On 2023/2/7 下午6:32, Arnd Bergmann wrote:
> >> I agree the default should always be to have a kernel that works on
> >> every machine that has been produced, but this also depends on which
> >> models specifically lack the unaligned access. If it's just about
> >> pre-production silicon that is now all but scrapped, things are different
> >> from a situation where users may actually use them for normal workloads.
> >>
> >> Is there an overview of the available loongarch CPU cores that have
> >> been produced so far, and which ones support unaligned access?
> >
> > So far, produced CPUs based LoongArch include 3A5000, 3B5000, 3C5000L,
> > 3C5000, 2K2000, 2K1000LA and 2K0500, where 2K1000LA and 2K0500 are
> > unaligned-access-unsupported, and others are unaligned-access-supported.
>
> Ok, so these are actually some of the newer (though low-end)
> implementations that require the workaround, not the older chips.
>
> In this case, I think both the kernel and toolchain need to default
> to -mstrict-align, unless someone specifically asks for the variant
> that can support unaligned access. The kernel option could be
> guarded by 'depends on EXPERT' to ensure that this is not set by
> default.
>
> To be sure that this is set correctly, the
> arch/loongarch/kernel/unaligned.c file should also never be included
> when EFFICIENT_UNALIGNED_ACCESS is set, to ensure that any attempt
> to run such a non-portable kernel on 2K1000LA results in a
> a kernel panic rather than silently fixing up the unaligned accesses
> at a huge performance cost.
OK, sounds reasonable, I will send V2 for that.
Huacai
>
> Arnd
>
Powered by blists - more mailing lists