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: <20230521114715.955823-2-heiko.stuebner@vrull.eu>
Date:   Sun, 21 May 2023 13:47:14 +0200
From:   Heiko Stuebner <heiko@...ech.de>
To:     linux-riscv@...ts.infradead.org, palmer@...belt.com,
        paul.walmsley@...ive.com
Cc:     linux-kernel@...r.kernel.org, christoph.muellner@...ll.eu,
        David.Laight@...LAB.COM, Heiko Stuebner <heiko.stuebner@...ll.eu>
Subject: [PATCH v3 1/2] riscv: don't include kernel.h into alternative.h

From: Heiko Stuebner <heiko.stuebner@...ll.eu>

This include is not currently needed for alternatives and creates
possible issues when we want to add alternatives to deeper kernel
infrastructure.

The issue in question came from trying to introduce Zawrs alternatives,
which resulted in a somewhat circular dependency like:

In file included from ../include/linux/bitops.h:34,
                 from ../include/linux/kernel.h:22,
                 from ../arch/riscv/include/asm/alternative.h:16,
                 from ../arch/riscv/include/asm/errata_list.h:8,
                 from ../arch/riscv/include/asm/barrier.h:15,
                 from ../include/linux/list.h:11,
                 from ../include/linux/preempt.h:11,
                 from ../include/linux/spinlock.h:56,
                 from ../include/linux/mmzone.h:8,
                 from ../include/linux/gfp.h:7,
                 from ../include/linux/mm.h:7,
                 from ../arch/riscv/kernel/asm-offsets.c:10:
../include/asm-generic/bitops/generic-non-atomic.h: In function ‘generic_test_bit_acquire’:
../include/asm-generic/bitops/generic-non-atomic.h:140:23: error: implicit declaration of function ‘smp_load_acquire’ [-Werror=implicit-function-declaration]
  140 |         return 1UL & (smp_load_acquire(p) >> (nr & (BITS_PER_LONG-1)));
      |                       ^~~~~~~~~~~~~~~~

Signed-off-by: Heiko Stuebner <heiko.stuebner@...ll.eu>
---
 arch/riscv/include/asm/alternative.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
index 6a41537826a7..05885de6048c 100644
--- a/arch/riscv/include/asm/alternative.h
+++ b/arch/riscv/include/asm/alternative.h
@@ -13,7 +13,6 @@
 #ifdef CONFIG_RISCV_ALTERNATIVE
 
 #include <linux/init.h>
-#include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/stddef.h>
 #include <asm/hwcap.h>
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ