8387381: RISC-V: assert failed with fastdebug build on systems with different core types - #31717
8387381: RISC-V: assert failed with fastdebug build on systems with different core types#31717zifeihan wants to merge 1 commit into
Conversation
… build on systems with different core types
|
👋 Welcome back gcao! A progress list of the required criteria for merging this PR into |
|
@zifeihan This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 20 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@DingliZhang, @RealFYang) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
RealFYang
left a comment
There was a problem hiding this comment.
Looks reasonable.
Here is what I read about the syscall:
struct riscv_hwprobe {
__s64 key;
__u64 value;
};
long sys_riscv_hwprobe(struct riscv_hwprobe *pairs, size_t pair_count,
size_t cpusetsize, cpu_set_t *cpus,
unsigned int flags);
For value-like keys (eg. vendor, arch, impl), the returned value will only be valid if all CPUs in the given set have the same value. Otherwise -1 will be returned.
|
Thanks all for the review. |
|
/sponsor |
|
Going to push as commit aa17cf5.
Your commit was automatically rebased without conflicts. |
|
@RealFYang @zifeihan Pushed as commit aa17cf5. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
HI, Can you help to review this patch? Thanks!
Here is a crash with a fastdebug build on SpacemiT Key Stone K3, which has different core types.
On systems with different core types, the kernel hwprobe syscall returns (uint64_t)-1 as value for MARCHID/MIMPID when CPUs disagree[1]. RVNonExtFeatureValue uses the same -1 as its internal sentinel (DEFAULT_VALUE), so enable_feature(-1) hits the assert.
SpacemiT Key Stone K3 has X100 (marchid=0x8000000058000002) and A100 (marchid=0x8000000041000002) cores, querying all CPUs gives marchid=-1 and mimpid=-1.
Fix: use a separate bool _enabled flag instead of the sentinel value.
[1] https://docs.kernel.org/arch/riscv/hwprobe.html
Testing
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31717/head:pull/31717$ git checkout pull/31717Update a local copy of the PR:
$ git checkout pull/31717$ git pull https://git.openjdk.org/jdk.git pull/31717/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31717View PR using the GUI difftool:
$ git pr show -t 31717Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31717.diff
Using Webrev
Link to Webrev Comment