lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H6Bji1FKcuhxLntfWe4iJGpr-tmWLt7q3L55sVPHrH7AA@mail.gmail.com>
Date: Fri, 3 Jan 2025 17:35:34 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Jiaxun Yang <jiaxun.yang@...goat.com>
Cc: Xuerui Wang <kernel@...0n.name>, loongarch@...ts.linux.dev, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] loongarch: Disable FIX_EARLYCON_MEM when ARCH_IOREMAP is enabled

On Fri, Jan 3, 2025 at 5:02 PM Jiaxun Yang <jiaxun.yang@...goat.com> wrote:
>
>
>
> 在2025年1月3日一月 上午2:38,Huacai Chen写道:
> > Hi, Jiaxun,
> >
> > On Thu, Jan 2, 2025 at 10:34 PM Jiaxun Yang <jiaxun.yang@...goat.com> wrote:
> >>
> >> When ARCH_IOREMAP is enabled, we are using always accessible DMW
> >> for ioremap. It makes no sense to create a dedicated mapping for
> >> earlycon given that we can access the region via DMW.
> >>
> >> Disable FIX_EARLYCON_MEM when ARCH_IOREMAP is selected. This can
> >> ease debugging for early mapping issues.
> > Fixmap has nothing to do with IOREMAP, whether you use ARCH_IOREMAP or
> > GENERIC_IOREMAP, earlycon is mapped by fixmap rather than ioremap().
>
> When you have ARCH_IOREMAP it’s not necessary to create fixed map for earlycon.
>
> As ioremap along is sufficient to access MMIO.
It's sufficient but ioremap() doesn't need to control everything about
MMIO, and I don't like the #ifdef in fixmap.h.

Huacai
>
> I’m doing this as it can help with debugging early mapping issues.
>
> Thanks
>
> >
> > Huacai
> >
> >>
> >> Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> >> ---
> >>  arch/loongarch/Kconfig              | 2 +-
> >>  arch/loongarch/include/asm/fixmap.h | 2 ++
> >>  2 files changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
> >> index 1c4d13aa677e2e04b9791882fba7523f93d6a69d..ad8a8cf75343799ea626be52f521fa75e7cbe07b 100644
> >> --- a/arch/loongarch/Kconfig
> >> +++ b/arch/loongarch/Kconfig
> >> @@ -246,7 +246,7 @@ config MACH_LOONGSON64
> >>         def_bool 64BIT
> >>
> >>  config FIX_EARLYCON_MEM
> >> -       def_bool y
> >> +       def_bool !ARCH_IOREMAP
> >>
> >>  config PGTABLE_2LEVEL
> >>         bool
> >> diff --git a/arch/loongarch/include/asm/fixmap.h b/arch/loongarch/include/asm/fixmap.h
> >> index d2e55ae55bb9c499b9a685509bc26d663054b58e..905dc7a5f9fa52ac924fe832749f39283c28a9f8 100644
> >> --- a/arch/loongarch/include/asm/fixmap.h
> >> +++ b/arch/loongarch/include/asm/fixmap.h
> >> @@ -12,7 +12,9 @@
> >>
> >>  enum fixed_addresses {
> >>         FIX_HOLE,
> >> +#ifdef CONFIG_FIX_EARLYCON_MEM
> >>         FIX_EARLYCON_MEM_BASE,
> >> +#endif
> >>         __end_of_fixed_addresses
> >>  };
> >>
> >>
> >> ---
> >> base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
> >> change-id: 20250102-la-earlycon-fixed-map-d6a48bd5b831
> >>
> >> Best regards,
> >> --
> >> Jiaxun Yang <jiaxun.yang@...goat.com>
> >>
>
> --
> - Jiaxun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ