[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H7Mz1Z5Bo59tq5VRSUx-N39axeiG7xZs2Szn6nuOxgZfQ@mail.gmail.com>
Date: Fri, 3 Feb 2023 10:00:42 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: David Laight <David.Laight@...lab.com>
Cc: Huacai Chen <chenhuacai@...ngson.cn>,
Arnd Bergmann <arnd@...db.de>,
"loongarch@...ts.linux.dev" <loongarch@...ts.linux.dev>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Xuefeng Li <lixuefeng@...ngson.cn>,
Guo Ren <guoren@...nel.org>, Xuerui Wang <kernel@...0n.name>,
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, David,
On Thu, Feb 2, 2023 at 5:01 PM David Laight <David.Laight@...lab.com> wrote:
>
> From: Huacai Chen
> > Sent: 02 February 2023 08:43
> >
> > Introduce Kconfig option ARCH_STRICT_ALIGN to make -mstrict-align be
> > configurable.
> >
> > Not all LoongArch cores support h/w unaligned access, we can use the
> > -mstrict-align build parameter to prevent unaligned accesses.
> >
> > This option is disabled by default to optimise for performance, but you
> > can enabled it manually if you want to run kernel on systems without h/w
> > unaligned access support.
>
> Should there be an associated run-time check during kernel initialisation
> that a kernel compiled without -mstrict-align isn't being run on hardware
> that doesn't support unaligned accesses.
>
> It can be quite a while before you get a compiler-generated misaligned accesses.
If we don't use -mstrict-align, the kernel cannot be run on hardware
that doesn't support unaligned accesses, so I think the run-time check
is useless, and it has no chance to run the checking.
>
> Also isn't there a HAVE_EFFICIENT_MISALIGNED_ACCESS define that would
> also need to be set correctly??
Yes, HAVE_EFFICIENT_MISALIGNED_ACCESS should be kept consistency with
ARCH_STRICT_ALIGN, thank you.
Huacai
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
Powered by blists - more mailing lists