Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails on linux 6.3/risc-v #14974

Closed
q66 opened this issue Jun 11, 2023 · 3 comments
Closed

build fails on linux 6.3/risc-v #14974

q66 opened this issue Jun 11, 2023 · 3 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@q66
Copy link
Contributor

q66 commented Jun 11, 2023

System information

Type Version/Name
Distribution Name Chimera Linux
Distribution Version rolling
Kernel Version 6.3.7
Architecture riscv64
OpenZFS Version 2.1.12

Describe the problem you're observing

The kernel module build fails:

  MODPOST /builddir/linux-stable-zfs-bin-2.1.12.6.3.7/zfs/2.1.12/build/module/Module.symvers
ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'PageHuge'

I believe the issue is this: https://github.com/torvalds/linux/blob/master/arch/riscv/include/asm/cacheflush.h#L24

The relevant upstream commit should be this: torvalds/linux@d33deda

This was previously worked around for powerpc, in 589f59b

Describe how to reproduce the problem

Build the kernel module on riscv with kernel 6.3.

@q66 q66 added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jun 11, 2023
@sevan
Copy link

sevan commented Aug 29, 2023

This applies to 6.2 as well. Just hit it via DKMS on Ubuntu/riscv64 23.04, which has switched from 5.19.0 to 6.2.0 kernel.

@palmer-dabbelt
Copy link

If there's something we can do on the arch/riscv side of things just LMK (or send a patch ;)). Maybe we just need a flush_dcache_page_nongpl(...) for non-GPL modules?

Harry-Chen added a commit to Harry-Chen/zfs that referenced this issue Dec 3, 2023
Since Linux 6.2, the implementation of flush_dcache_page on riscv
references GPL-only symbol `PageHuge`, breaking the build of zfs.

This patch uses existing mechanism to override flush_dcache_page,
removing the call to `PageHuge`. According to comments in kernel,
it is only used to do some check against HugeTLB pages, which only
exist in userspace. ZFS uses flush_dcache_page only on kernel pages,
thus this patch will not introduce any behaviour change.

See also: torvalds/linux@d33deda, openzfs/zfs@589f59b
Closes: openzfs#14974

Signed-off-by: Shengqi Chen <[email protected]>
@Harry-Chen
Copy link
Contributor

I proposed a workaround similar to that on powerpc (thanks @q66 for detailed information). You might want to try my patch in #15627.

Harry-Chen added a commit to Harry-Chen/zfs that referenced this issue Dec 5, 2023
Since Linux 6.2, the implementation of flush_dcache_page on riscv
references GPL-only symbol `PageHuge`, breaking the build of zfs.

This patch uses existing mechanism to override flush_dcache_page,
removing the call to `PageHuge`. According to comments in kernel,
it is only used to do some check against HugeTLB pages, which only
exist in userspace. ZFS uses flush_dcache_page only on kernel pages,
thus this patch will not introduce any behaviour change.

See also: torvalds/linux@d33deda, openzfs/zfs@589f59b
Closes: openzfs#14974

Signed-off-by: Shengqi Chen <[email protected]>
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Dec 12, 2023
Since Linux 6.2, the implementation of flush_dcache_page on riscv
references GPL-only symbol `PageHuge`, breaking the build of zfs.

This patch uses existing mechanism to override flush_dcache_page,
removing the call to `PageHuge`. According to comments in kernel,
it is only used to do some check against HugeTLB pages, which only
exist in userspace. ZFS uses flush_dcache_page only on kernel pages,
thus this patch will not introduce any behaviour change.

See also: torvalds/linux@d33deda, openzfs/zfs@589f59b

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Shengqi Chen <[email protected]>
Closes openzfs#14974 
Closes openzfs#15627
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Jan 12, 2024
Since Linux 6.2, the implementation of flush_dcache_page on riscv
references GPL-only symbol `PageHuge`, breaking the build of zfs.

This patch uses existing mechanism to override flush_dcache_page,
removing the call to `PageHuge`. According to comments in kernel,
it is only used to do some check against HugeTLB pages, which only
exist in userspace. ZFS uses flush_dcache_page only on kernel pages,
thus this patch will not introduce any behaviour change.

See also: torvalds/linux@d33deda, openzfs/zfs@589f59b

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Shengqi Chen <[email protected]>
Closes openzfs#14974 
Closes openzfs#15627
ixhamza pushed a commit to truenas/zfs that referenced this issue Jan 15, 2024
Since Linux 6.2, the implementation of flush_dcache_page on riscv
references GPL-only symbol `PageHuge`, breaking the build of zfs.

This patch uses existing mechanism to override flush_dcache_page,
removing the call to `PageHuge`. According to comments in kernel,
it is only used to do some check against HugeTLB pages, which only
exist in userspace. ZFS uses flush_dcache_page only on kernel pages,
thus this patch will not introduce any behaviour change.

See also: torvalds/linux@d33deda, openzfs/zfs@589f59b

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Shengqi Chen <[email protected]>
Closes openzfs#14974 
Closes openzfs#15627
behlendorf pushed a commit that referenced this issue Jan 16, 2024
Since Linux 6.2, the implementation of flush_dcache_page on riscv
references GPL-only symbol `PageHuge`, breaking the build of zfs.

This patch uses existing mechanism to override flush_dcache_page,
removing the call to `PageHuge`. According to comments in kernel,
it is only used to do some check against HugeTLB pages, which only
exist in userspace. ZFS uses flush_dcache_page only on kernel pages,
thus this patch will not introduce any behaviour change.

See also: torvalds/linux@d33deda, 589f59b

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Shengqi Chen <[email protected]>
Closes #14974 
Closes #15627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

4 participants