Thread (44 messages) 44 messages, 5 authors, 2023-08-18

Re: [PATCH 06/12] arch: Declare screen_info in <asm/screen_info.h>

From: WANG Xuerui <kernel@xen0n.name>
Date: 2023-06-29 12:55:22
Also in: dri-devel, linux-alpha, linux-arch, linux-efi, linux-hyperv, linux-mips, linux-riscv, linux-sh, linux-staging, linuxppc-dev, lkml, loongarch, sparclinux

On 2023/6/29 19:45, Thomas Zimmermann wrote:
quoted hunk ↗ jump to hunk
The variable screen_info does not exist on all architectures. Declare
it in <asm-generic/screen_info.h>. All architectures that do declare it
will provide it via <asm/screen_info.h>.

Add the Kconfig token ARCH_HAS_SCREEN_INFO to guard against access on
architectures that don't provide screen_info.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Ivan Kokshaysky <redacted>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Brian Cain <redacted>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <redacted>
Cc: Paul Walmsley <redacted>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Gleixner <redacted>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Kees Cook <redacted>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Juerg Haefliger <redacted>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Anshuman Khandual <redacted>
Cc: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: "Russell King (Oracle)" <redacted>
Cc: Linus Walleij <redacted>
Cc: Sebastian Reichel <redacted>
Cc: "Mike Rapoport (IBM)" <rppt@kernel.org>
Cc: "Kirill A. Shutemov" <redacted>
Cc: Zi Yan <ziy@nvidia.com>
---
  arch/Kconfig                      |  6 ++++++
  arch/alpha/Kconfig                |  1 +
  arch/arm/Kconfig                  |  1 +
  arch/arm64/Kconfig                |  1 +
  arch/csky/Kconfig                 |  1 +
  arch/hexagon/Kconfig              |  1 +
  arch/ia64/Kconfig                 |  1 +
  arch/loongarch/Kconfig            |  1 +
  arch/mips/Kconfig                 |  1 +
  arch/nios2/Kconfig                |  1 +
  arch/powerpc/Kconfig              |  1 +
  arch/riscv/Kconfig                |  1 +
  arch/sh/Kconfig                   |  1 +
  arch/sparc/Kconfig                |  1 +
  arch/x86/Kconfig                  |  1 +
  arch/xtensa/Kconfig               |  1 +
  drivers/video/Kconfig             |  3 +++
  include/asm-generic/Kbuild        |  1 +
  include/asm-generic/screen_info.h | 12 ++++++++++++
  include/linux/screen_info.h       |  2 +-
  20 files changed, 38 insertions(+), 1 deletion(-)
  create mode 100644 include/asm-generic/screen_info.h
diff --git a/arch/Kconfig b/arch/Kconfig
index 205fd23e0cada..2f58293fd7bcb 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1466,6 +1466,12 @@ config ARCH_HAS_NONLEAF_PMD_YOUNG
  	  address translations. Page table walkers that clear the accessed bit
  	  may use this capability to reduce their search space.
  
+config ARCH_HAS_SCREEN_INFO
+	bool
+	help
+	  Selected by architectures that provide a global instance of
+	  screen_info.
+
  source "kernel/gcov/Kconfig"
  
  source "scripts/gcc-plugins/Kconfig"
[snip]
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index d38b066fc931b..6aab2fb7753da 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -13,6 +13,7 @@ config LOONGARCH
  	select ARCH_HAS_FORTIFY_SOURCE
  	select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
  	select ARCH_HAS_PTE_SPECIAL
+	select ARCH_HAS_SCREEN_INFO
  	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
  	select ARCH_INLINE_READ_LOCK if !PREEMPTION
  	select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
[snip]
Acked-by: WANG Xuerui <redacted> # loongarch

Thanks!

-- 
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help