* [PATCH] RISC-V: Remove unnecessary include from compat.h
@ 2024-11-26 14:32 Palmer Dabbelt
2024-11-27 15:20 ` patchwork-bot+linux-riscv
2024-12-08 16:42 ` Yao Zi
0 siblings, 2 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2024-11-26 14:32 UTC (permalink / raw)
To: linux-riscv; +Cc: Palmer Dabbelt
Without this I get a bunch of build errors like
In file included from ./include/linux/sched/task_stack.h:12,
from ./arch/riscv/include/asm/compat.h:12,
from ./arch/riscv/include/asm/pgtable.h:115,
from ./include/linux/pgtable.h:6,
from ./include/linux/mm.h:30,
from arch/riscv/kernel/asm-offsets.c:8:
./include/linux/kasan.h:50:37: error: ‘MAX_PTRS_PER_PTE’ undeclared here (not in a function); did you mean ‘PTRS_PER_PTE’?
50 | extern pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS];
| ^~~~~~~~~~~~~~~~
| PTRS_PER_PTE
./include/linux/kasan.h:51:8: error: unknown type name ‘pmd_t’; did you mean ‘pgd_t’?
51 | extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
| ^~~~~
| pgd_t
./include/linux/kasan.h:51:37: error: ‘MAX_PTRS_PER_PMD’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
51 | extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
| ^~~~~~~~~~~~~~~~
| PTRS_PER_PGD
./include/linux/kasan.h:52:8: error: unknown type name ‘pud_t’; did you mean ‘pgd_t’?
52 | extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
| ^~~~~
| pgd_t
./include/linux/kasan.h:52:37: error: ‘MAX_PTRS_PER_PUD’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
52 | extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
| ^~~~~~~~~~~~~~~~
| PTRS_PER_PGD
./include/linux/kasan.h:53:8: error: unknown type name ‘p4d_t’; did you mean ‘pgd_t’?
53 | extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
| ^~~~~
| pgd_t
./include/linux/kasan.h:53:37: error: ‘MAX_PTRS_PER_P4D’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
53 | extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
| ^~~~~~~~~~~~~~~~
| PTRS_PER_PGD
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
arch/riscv/include/asm/compat.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/riscv/include/asm/compat.h b/arch/riscv/include/asm/compat.h
index aa103530a5c8..6081327e55f5 100644
--- a/arch/riscv/include/asm/compat.h
+++ b/arch/riscv/include/asm/compat.h
@@ -9,7 +9,6 @@
*/
#include <linux/types.h>
#include <linux/sched.h>
-#include <linux/sched/task_stack.h>
#include <asm-generic/compat.h>
static inline int is_compat_task(void)
--
2.45.2
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] RISC-V: Remove unnecessary include from compat.h
2024-11-26 14:32 [PATCH] RISC-V: Remove unnecessary include from compat.h Palmer Dabbelt
@ 2024-11-27 15:20 ` patchwork-bot+linux-riscv
2024-12-08 16:42 ` Yao Zi
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-11-27 15:20 UTC (permalink / raw)
To: Palmer Dabbelt; +Cc: linux-riscv
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Tue, 26 Nov 2024 06:32:50 -0800 you wrote:
> Without this I get a bunch of build errors like
>
> In file included from ./include/linux/sched/task_stack.h:12,
> from ./arch/riscv/include/asm/compat.h:12,
> from ./arch/riscv/include/asm/pgtable.h:115,
> from ./include/linux/pgtable.h:6,
> from ./include/linux/mm.h:30,
> from arch/riscv/kernel/asm-offsets.c:8:
> ./include/linux/kasan.h:50:37: error: ‘MAX_PTRS_PER_PTE’ undeclared here (not in a function); did you mean ‘PTRS_PER_PTE’?
> 50 | extern pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PTE
> ./include/linux/kasan.h:51:8: error: unknown type name ‘pmd_t’; did you mean ‘pgd_t’?
> 51 | extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
> | ^~~~~
> | pgd_t
> ./include/linux/kasan.h:51:37: error: ‘MAX_PTRS_PER_PMD’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
> 51 | extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PGD
> ./include/linux/kasan.h:52:8: error: unknown type name ‘pud_t’; did you mean ‘pgd_t’?
> 52 | extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
> | ^~~~~
> | pgd_t
> ./include/linux/kasan.h:52:37: error: ‘MAX_PTRS_PER_PUD’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
> 52 | extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PGD
> ./include/linux/kasan.h:53:8: error: unknown type name ‘p4d_t’; did you mean ‘pgd_t’?
> 53 | extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
> | ^~~~~
> | pgd_t
> ./include/linux/kasan.h:53:37: error: ‘MAX_PTRS_PER_P4D’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
> 53 | extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PGD
>
> [...]
Here is the summary with links:
- RISC-V: Remove unnecessary include from compat.h
https://git.kernel.org/riscv/c/8d4f1e05ff82
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] RISC-V: Remove unnecessary include from compat.h
2024-11-26 14:32 [PATCH] RISC-V: Remove unnecessary include from compat.h Palmer Dabbelt
2024-11-27 15:20 ` patchwork-bot+linux-riscv
@ 2024-12-08 16:42 ` Yao Zi
1 sibling, 0 replies; 3+ messages in thread
From: Yao Zi @ 2024-12-08 16:42 UTC (permalink / raw)
To: Palmer Dabbelt, linux-riscv; +Cc: Yao Zi
On Tue, Nov 26, 2024 at 06:32:50AM -0800, Palmer Dabbelt wrote:
> Without this I get a bunch of build errors like
>
> In file included from ./include/linux/sched/task_stack.h:12,
> from ./arch/riscv/include/asm/compat.h:12,
> from ./arch/riscv/include/asm/pgtable.h:115,
> from ./include/linux/pgtable.h:6,
> from ./include/linux/mm.h:30,
> from arch/riscv/kernel/asm-offsets.c:8:
> ./include/linux/kasan.h:50:37: error: ‘MAX_PTRS_PER_PTE’ undeclared here (not in a function); did you mean ‘PTRS_PER_PTE’?
> 50 | extern pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PTE
> ./include/linux/kasan.h:51:8: error: unknown type name ‘pmd_t’; did you mean ‘pgd_t’?
> 51 | extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
> | ^~~~~
> | pgd_t
> ./include/linux/kasan.h:51:37: error: ‘MAX_PTRS_PER_PMD’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
> 51 | extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PGD
> ./include/linux/kasan.h:52:8: error: unknown type name ‘pud_t’; did you mean ‘pgd_t’?
> 52 | extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
> | ^~~~~
> | pgd_t
> ./include/linux/kasan.h:52:37: error: ‘MAX_PTRS_PER_PUD’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
> 52 | extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PGD
> ./include/linux/kasan.h:53:8: error: unknown type name ‘p4d_t’; did you mean ‘pgd_t’?
> 53 | extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
> | ^~~~~
> | pgd_t
> ./include/linux/kasan.h:53:37: error: ‘MAX_PTRS_PER_P4D’ undeclared here (not in a function); did you mean ‘PTRS_PER_PGD’?
> 53 | extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
> | ^~~~~~~~~~~~~~~~
> | PTRS_PER_PGD
>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---
> arch/riscv/include/asm/compat.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/compat.h b/arch/riscv/include/asm/compat.h
> index aa103530a5c8..6081327e55f5 100644
> --- a/arch/riscv/include/asm/compat.h
> +++ b/arch/riscv/include/asm/compat.h
> @@ -9,7 +9,6 @@
> */
> #include <linux/types.h>
> #include <linux/sched.h>
> -#include <linux/sched/task_stack.h>
> #include <asm-generic/compat.h>
>
> static inline int is_compat_task(void)
> --
> 2.45.2
Hi Palmer, do you think we should backport this to 6.12?
Commit fd7b4f9f46d4
("sched/task_stack: fix object_is_on_stack() for KASAN tagged pointers"),
introduces extra header dependency in linux/sched/task_stack.h. Without
this patch, build may fail because of the include sequence if KASAN is
enabled.
Since commit fd7b4f9f46d4 has landed in 6.12 before this patch was
merged, KASAN is completely broken on RISC-V in current LTS release.
Thanks,
Yao Zi
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-08 16:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-26 14:32 [PATCH] RISC-V: Remove unnecessary include from compat.h Palmer Dabbelt
2024-11-27 15:20 ` patchwork-bot+linux-riscv
2024-12-08 16:42 ` Yao Zi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox