-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
UefiCpuPkg: RISC-V: Initialize FPU #6210
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.
Hi Heinrich,
Thank you very much for the PR. The changes look good to me. However, please fix CI issues like adding to spellcheck ignore list.
@vlsunil:
|
For #6210 I get this test result: |
@vlsunil The spellchecker is in audit mode, so that's not the failure, just noise. @makubacki can you help figure out what's going on? |
That said, I will take this an opportunity to add the information directly to the build output. That was avoided early on due to concern about the larger number of errors while the codebase was in transition. Now, I think it's obvious placing this information front and center would be more efficient to resolve the problem. |
@makubacki: Thanks for pointing me to the right attachment. Looking at https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/5_source_files/52_spacing.html#52-spacing I would not know which rule I have broken. Does the CI assume that all files are formatted via
even if they don't break any rule in https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification? |
Thanks! @makubacki for the help!. Thanks @xypron for fixing the CI issue. I always run uncrustify locally using the edk2's config but you have a good point on documentation vs uncrustify expectations. May be @makubacki or @mdkinney can help clarify. Since major changes are in MdePkg and UefiPkg, need help from @mdkinney and @niruiyu to review and merge this PR. |
Yes. There was much deliberation, that ultimately led to the decision to apply consistency to elements like alignment and spacing that were too tedious to include in the specification. Many IDEs have a way to run an external tool with additional context. I personally use VS Code with the uncrustify plugin as described here: EDK II Code Formatting - Recommended Usage: Visual Studio (VS) Code Plugin. I stage or commit the file with actual modifications and then use a keyboard shortcut to run uncrustify on the current file. After a comparison to see what changed, I add the changes to the staging area or amend my commit. |
8026849
to
4817ab0
Compare
* Define CSR fcsr * Define bitmasks for vs and fs bit fields in the mstatus register Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
The OpenSSL library uses floating point registers. The is no guarantee that a prior firmware stage has enabled the FPU. Provide a library BaseRiscVFpuLib to * Enable the FPU and set it to state 'dirty'. * Clear the fcsr CSR. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Enable building the BaseRiscVFpuLib library for OvmfPkg to * Enable the FPU and set it to state 'dirty'. * Clear the fcsr CSR. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Description
EDK II build with TLS running on top of QEMU/KVM crashes when reaching the first floating point instruction in the OpenSSL library (https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2036604). This is due to the floating point unit being in an disabled state (FS bit-field in CSR mstatus).
With the series a library module BaseRiscVFpuLib is added. Here the relevant CSRs are initialized.
In future we can add here the initialization of the vector unit once any library uses it.
How This Was Tested
Running with QEMU/KVM on SiFive HiFive Premier.
Integration Instructions
N/A