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

Failed to build on powerpc* if Linux was configured without CONFIG_ALTIVEC or CONFIG_VSX #14591

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

Low-power
Copy link
Contributor

@Low-power Low-power commented Mar 7, 2023

Motivation and Context

This fixes building ZFS for Linux 4.7+ powerpc* architecture, where Linux was configured without CONFIG_ALTIVEC or CONFIG_VSX.

Description

simd_powerpc.h defines kfpu_begin() and kfpu_end() to call (enable|disable)_kernel_(altivec|vsx)\(\), but they are unavailable from Linux without CONFIG_(ALTIVEC|VSX)=y, causing build failure:

In file included from /home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../include/os/linux/kernel/linux/simd.h:38,
                 from /home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../include/os/linux/spl/sys/simd.h:28,
                 from /home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:29:
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c: In function ‘tf_sha256_ppc’:
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../include/os/linux/kernel/linux/simd_powerpc.h:88:3: error: implicit declaration of function ‘enable_kernel_altivec’; did you mean ‘enable_kernel_fp’? [-Werror=implicit-function-declaration]
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:37:2: note: in expansion of macro ‘kfpu_begin’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:159:1: note: in expansion of macro ‘TF’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../include/os/linux/kernel/linux/simd_powerpc.h:89:3: error: implicit declaration of function ‘enable_kernel_vsx’; did you mean ‘enable_kernel_fp’? [-Werror=implicit-function-declaration]
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:37:2: note: in expansion of macro ‘kfpu_begin’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:159:1: note: in expansion of macro ‘TF’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../include/os/linux/kernel/linux/simd_powerpc.h:93:3: error: implicit declaration of function ‘disable_kernel_vsx’; did you mean ‘disable_kernel_fp’? [-Werror=implicit-function-declaration]
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:37:28: note: in expansion of macro ‘kfpu_end’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:159:1: note: in expansion of macro ‘TF’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../include/os/linux/kernel/linux/simd_powerpc.h:94:3: error: implicit declaration of function ‘disable_kernel_altivec’; did you mean ‘disable_kernel_fp’? [-Werror=implicit-function-declaration]
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:37:28: note: in expansion of macro ‘kfpu_end’
/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/../module/icp/algs/sha2/sha256_impl.c:159:1: note: in expansion of macro ‘TF’
cc1: some warnings being treated as errors
make[4]: *** [../scripts/Makefile.build:304: /home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/module/icp/algs/sha2/sha256_impl.o] Error 1
make[3]: *** [/home/whr/src/linux-4.19.271/Makefile:1555: _module_/home/whr/src/zfs/build.4.19.271-powerpc64-noaltivec/module] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:24: __sub-make] Error 2
make[1]: Leaving directory '/home/whr/src/linux-4.19.271/build.rivoreo-powerpc64-noaltivec'
make: *** [Makefile:56: modules-Linux] Error 2

How Has This Been Tested?

Tested with Linux 4.19.271 configured:

  • CONFIG_ALTIVEC=n and CONFIG_VSX=n.
  • CONFIG_ALTIVEC=y and CONFIG_VSX=n.
  • CONFIG_ALTIVEC=y and CONFIG_VSX=y.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@Low-power Low-power force-pushed the linux-powerpc-without-altivec branch 2 times, most recently from 25c3015 to 892ee51 Compare March 7, 2023 06:42
Signed-off-by: WHR <msl0000023508@gmail.com>
@Low-power Low-power force-pushed the linux-powerpc-without-altivec branch from 892ee51 to 781811a Compare March 7, 2023 06:50
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 7, 2023
@behlendorf
Copy link
Contributor

cc @mcmilk

Copy link
Contributor

@mcmilk mcmilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks @Low-power

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 7, 2023
@behlendorf behlendorf merged commit 1f196e3 into openzfs:master Mar 7, 2023
mcmilk pushed a commit to mcmilk/zfs that referenced this pull request Mar 13, 2023
This fixes building ZFS for Linux 4.7+ powerpc* architecture, where 
Linux was configured without CONFIG_ALTIVEC or CONFIG_VSX.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: WHR <msl0000023508@gmail.com>
Closes openzfs#14591
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 16, 2023
This fixes building ZFS for Linux 4.7+ powerpc* architecture, where 
Linux was configured without CONFIG_ALTIVEC or CONFIG_VSX.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: WHR <msl0000023508@gmail.com>
Closes openzfs#14591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants