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

fix: function asmCpuid missing Go declaration #83

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Conversation

Laisky
Copy link
Contributor

@Laisky Laisky commented Sep 20, 2023

I got this error, maybe misspell the function's name?

# github.com/google/go-sev-guest/abi
abi/cpuid_amd64.s:18:1: [amd64] asmCpuid: function asmCpuid missing Go declaration

Append: also add a cpuid.go file to compatable with non-amd64 machine that could also import this package

Copy link
Collaborator

@deeglaze deeglaze left a comment

Choose a reason for hiding this comment

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

Thanks for your report and proposed fix! I hit this internally and thought it was a difference in build system quirks.

@@ -14,8 +14,8 @@

//+build amd64,!gccgo

// func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32)
TEXT ·asmCpuid(SB), 7, $0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert name change.

abi/cpuid_amd64.go Show resolved Hide resolved
abi/cpuid.go Outdated Show resolved Hide resolved
abi/abi.go Outdated Show resolved Hide resolved
abi/cpuid.go Outdated Show resolved Hide resolved
abi/cpuid.go Outdated Show resolved Hide resolved
abi/cpuid_amd64.go Outdated Show resolved Hide resolved
abi/cpuid_amd64.go Outdated Show resolved Hide resolved
@Laisky
Copy link
Contributor Author

Laisky commented Sep 21, 2023

@deeglaze Thank you for your detailed guidance. I have made another revision, please take a look.

abi/cpuid.go Outdated Show resolved Hide resolved
abi/abi_test.go Show resolved Hide resolved
- Added new files `abi/cpuid_amd64.go` and `abi/cpuid.go`
- Implemented the `asmCpuid` function in the `abi` package
- Added tests for the `cpuid` function in `abi/abi_test.go`
abi/cpuid.go Outdated Show resolved Hide resolved
abi/abi_test.go Outdated Show resolved Hide resolved
abi/abi_test.go Outdated Show resolved Hide resolved
@Laisky
Copy link
Contributor Author

Laisky commented Sep 21, 2023

@deeglaze done

Copy link
Collaborator

@deeglaze deeglaze left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@Laisky
Copy link
Contributor Author

Laisky commented Sep 21, 2023

Thanks for your contribution!

Thank you for your patient guidance 😁

@deeglaze deeglaze merged commit 307fceb into google:main Sep 21, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants