Skip to content

runtime: Handle auxv data for ppc64 and ppc64le #16643

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

Closed
ceseo opened this issue Aug 9, 2016 · 11 comments
Closed

runtime: Handle auxv data for ppc64 and ppc64le #16643

ceseo opened this issue Aug 9, 2016 · 11 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ceseo
Copy link
Contributor

ceseo commented Aug 9, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go1.7rc6

  1. What operating system and processor architecture are you using (go env)?

linux/ppc64le and linux/ppc64

  1. What did you do?
    N/A
  2. What did you expect to see?
    N/A
  3. What did you see instead?

ppc64/ppc64le lacks runtime checks for hardware capabilities / ISA levels. These will be important as we start to add runtime optimizations for POWER8/POWER9, so they don't break compatibility with older processors. We will need to read the HWCAP/HWCAP2 values from the auxv for this verification.

@ceseo
Copy link
Contributor Author

ceseo commented Aug 9, 2016

I'll submit a change shortly to add this.

@ceseo
Copy link
Contributor Author

ceseo commented Aug 9, 2016

CC @laboger

@minux
Copy link
Member

minux commented Aug 9, 2016 via email

@laboger
Copy link
Contributor

laboger commented Aug 9, 2016

Are you referring to #15403? I don't believe I had seen this proposal before. Sounds like it is doing the same thing as this but in a more general way.

@ceseo
Copy link
Contributor Author

ceseo commented Aug 9, 2016

Ah... it seems I missed that issue. Thanks, @laboger

@minux 's proposal is more generic than what I have. My idea was to create a 'runtime/os_linux_ppc64x.go' file and implement archauxv() to read from HWCAP/HWCAP2, then implement a function that does the check.

I'm fine with either proposal, so I'll wait and see the opinions of others before submitting any changes.

@minux
Copy link
Member

minux commented Aug 10, 2016 via email

@ceseo
Copy link
Contributor Author

ceseo commented Aug 10, 2016

@minux good, I also prefer not duplicating code. Are you already working on this?

Btw, I don't think the functions for checking capabilities need to be necessarily internal. We could export those in a similar way gcc does with __builtin_cpu_is() / __builtin_cpu_supports(). Just an idea.

@quentinmit quentinmit added this to the Go1.8 milestone Aug 11, 2016
@laboger
Copy link
Contributor

laboger commented Sep 26, 2016

The purpose of this check is to be able to tell when altivec is available. If the change for altivec breaks ppc64 BE we need this check, either the way Carlos has proposed it or Minux' proposal in order to determine it.

@ceseo
Copy link
Contributor Author

ceseo commented Sep 26, 2016

@laboger this proposal moved forward in thread #15403. @mundaym suggested that I add (hackily) some simple mechanism for now and then clean it up later when the proposed package is in place. I was thinking about something trivial, like ceseo/go@ca09310.

If no one objects, I can submit that quickly.

@ceseo
Copy link
Contributor Author

ceseo commented Sep 26, 2016

Btw, the check is needed for POWER5 and POWER5+ (big endian), since neither have Altivec capability. PPC970, POWER6 and beyond are good.

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 29, 2016
ceseo added a commit to ceseo/go that referenced this issue Oct 28, 2016
This implements a check that can be done at runtime for the ISA level and
hardware capability. It follows the same implementation as in s390x.

Updates golang#15403
Fixes golang#16643
ceseo added a commit to ceseo/go that referenced this issue Oct 28, 2016
This implements a check that can be done at runtime for the ISA level and
hardware capability. It follows the same implementation as in s390x.

Updates golang#15403
Fixes golang#16643
ceseo added a commit to ceseo/go that referenced this issue Oct 28, 2016
This implements a check that can be done at runtime for the ISA level and
hardware capability. It follows the same implementation as in s390x.

Updates golang#15403
Fixes golang#16643
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/32330 mentions this issue.

@golang golang locked and limited conversation to collaborators Nov 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants