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

[stable] core.cpuid: Fix div-by-zero on AMD CPUs with 256 (physical?) cores #15859

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

kinke
Copy link
Contributor

@kinke kinke commented Nov 23, 2023

See: https://en.wikipedia.org/wiki/CPUID#EAX=80000008h:_Virtual_and_Physical_address_Sizes

This might fix Issue 24254, although I'd expect the read value for that CPU to be 127 (physical cores minus 1), not the problematic 255.

@dlang-bot
Copy link
Contributor

dlang-bot commented Nov 23, 2023

Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
24254 major LDC crash on Epyc Bergamo

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + dmd#15859"

See: https://en.wikipedia.org/wiki/CPUID#EAX=80000008h:_Virtual_and_Physical_address_Sizes

This *might* fix Issue 24254, although I'd expect the read value for
that CPU to be 127 (*physical* cores minus 1), not the problematic 255.
@kinke kinke changed the base branch from master to stable November 23, 2023 22:27
@kinke kinke changed the title core.cpuid: Fix div-by-zero on AMD CPUs with 256 (physical?) cores [stable] core.cpuid: Fix div-by-zero on AMD CPUs with 256 (physical?) cores Nov 23, 2023
Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

@dlang-bot dlang-bot merged commit 27b891c into dlang:stable Nov 24, 2023
43 checks passed
@kinke kinke deleted the cpuid branch November 24, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants