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

runtime: Handle auxv data for ppc64 and ppc64le #16643

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

Comments

Projects
None yet
6 participants
@ceseo
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2016

I'll submit a change shortly to add this.

@ceseo

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2016

@minux

This comment has been minimized.

Copy link
Member

commented Aug 9, 2016

@laboger

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Aug 10, 2016

@ceseo

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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 label Sep 29, 2016

ceseo added a commit to ceseo/go that referenced this issue Oct 28, 2016

runtime: get ISA level from HWCAP/HWCAP2
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

runtime: get ISA level from HWCAP/HWCAP2
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

runtime: get ISA level from HWCAP/HWCAP2
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

This comment has been minimized.

Copy link

commented Oct 28, 2016

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

@gopherbot gopherbot closed this in 40aaf28 Nov 1, 2016

@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.
You can’t perform that action at this time.