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
Fixes for SPARC support #6750
Fixes for SPARC support #6750
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patches looks good just a few minor suggestions. Thanks for going back to the source and adding back in these sparc optimizations, I didn't realize we'd dropped them in the original port.
module/icp/algs/sha1/sha1.c
Outdated
| SHA1Transform((ctx)->state[0], (ctx)->state[1], (ctx)->state[2], \ | ||
| (ctx)->state[3], (ctx)->state[4], (ctx), (in)) | ||
| SHA1Transform((ctx)->state[0], (ctx)->state[1], (ctx)->state[2], \ | ||
| (ctx)->state[3], (ctx)->state[4], (ctx), (in)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It looks like this style fix should be in 3b05b50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased the branch and that styling issue fix is now in its correct place.
lib/libspl/Makefile.am
Outdated
| @@ -13,7 +13,8 @@ DEFAULT_INCLUDES += \ | |||
| -I$(top_srcdir)/lib/libspl/include | |||
|
|
|||
| AM_CCASFLAGS = \ | |||
| -I$(top_srcdir)/lib/libspl/include | |||
| -I$(top_srcdir)/lib/libspl/include \ | |||
| $(CFLAGS) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you can remove -I$(top_srcdir)/lib/libspl/include from AM_CCASFLAGS while you're here to simplify things. CPPASCOMPILE and LTCPPASCOMPILE both already include DEFAULT_INCLUDES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new commit to remove that line.
Codecov Report
@@ Coverage Diff @@
## master #6750 +/- ##
=========================================
+ Coverage 74.1% 74.21% +0.1%
=========================================
Files 295 295
Lines 93905 93905
=========================================
+ Hits 69591 69687 +96
+ Misses 24314 24218 -96
Continue to review full report at Codecov.
|
Passing arguments explicitly into SHA1Transform() increases the number of registers abailable to the compiler, hence leaving more local and out registers available. The missing symbol of sha1_consts[], which prevents compiling on SPARC, is added back, which speeds up the process of utilizing the relative constants. This should fix #6738. Signed-off-by: Pengcheng Xu <i@jsteward.moe>
Normally a SPARC processor runs in big endian mode. Save the extra labor needed for little endian machines when the target is a big endian one (sparc). Signed-off-by: Pengcheng Xu <i@jsteward.moe>
It's important to respect the user's CFLAGS as mismatched -mcpu will directly result in the assembler not able to produce correct code. Fixes #6733. Signed-off-by: Pengcheng Xu <i@jsteward.moe>
CPPASCOMPILE and LTCPPASCOMPILE all include DEFAULT_INCLUDES, hence it's unnecessary to add the includes again. Signed-off-by: Pengcheng Xu <i@jsteward.moe>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good.
The current code base almost compiles on SPARC, but a few fixes are required for the code to compile (and work efficiently). Code in this PR comes from OpenZFS project which was initially dropped when porting the crypto framework. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pengcheng Xu <i@jsteward.moe> Closes openzfs#6733 Closes openzfs#6738 Closes openzfs#6750
The current code base almost compiles on SPARC, but a few fixes are required for the code to compile (and work efficiently). Code in this PR comes from OpenZFS project which was initially dropped when porting the crypto framework. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pengcheng Xu <i@jsteward.moe> Closes #6733 Closes #6738 Closes #6750
Description
Current code base almost compiles on SPARC, yet a few fixes are required for the code to compile
(and work efficiently). Code in this PR comes from OpenZFS project, nearly all of them dates back
to OpenZFS launch (~12 yrs ago).
Motivation and Context
Fixes #6738.
Fixes #6733.
How Has This Been Tested?
Compile passed (including all compile-time unit tests) on an UltraSPARC T2 machine (namely a Sun Enterprise T5120).
ztestfinished successfully with return value 0.Types of changes
Checklist:
Signed-off-by.