aregm / cpuid Goto Github PK
View Code? Open in Web Editor NEWIntel CPUID library for Go Programming Language
License: BSD 3-Clause "New" or "Revised" License
Intel CPUID library for Go Programming Language
License: BSD 3-Clause "New" or "Revised" License
#18 introduced some constants, e.g. AMD_SEV
, in cpuid_amd64.go
, and then used them in cpuid.go
. They will be undefined when building on non-x86_64 architectures.
e.g. on s390x:
$ go get github.com/intel-go/cpuid
# github.com/intel-go/cpuid
go/pkg/mod/github.com/intel-go/[email protected]/cpuid.go:291:2: undefined: AMD_SME
go/pkg/mod/github.com/intel-go/[email protected]/cpuid.go:292:2: undefined: AMD_SEV
go/pkg/mod/github.com/intel-go/[email protected]/cpuid.go:293:2: undefined: AMD_PAGE_FLUSH_MSR
go/pkg/mod/github.com/intel-go/[email protected]/cpuid.go:294:2: undefined: AMD_SEV_ES
/cc @jimcadden
I am curious if there is any support for an idea of integrating cpuid tool with console/shell scripting tools (configure, that could invoke as an external executable, to get stdout from the running binary) and GNU make/CMake/...
Ivan
Can you add support for detecting SGX features to the library?
First off -- thanks for a writing a clean, cross platform go library that can be used to detect cpu features, etc.
I work on Intel's ISecL library and migrated its "hostinfo" package away from using command line tools like dmidecode (see https://github.com/intel-secl/intel-secl/tree/master/pkg/lib/hostinfo). At that time I was unaware of this library and will definately integrate it for the cpu detection requirements.
ISecL needs to detect the CBNT profile on Linux and Windows (Windows is a new feature). On Linux, the hostinfo package reads from /dev/cpu/0/msr. As far as I can see there is not a way to get msr data on Windows from user space.
Anyway, for the "asks"...
HyperV - the microsoft hypervisor implementation, reports its supported features using cpuid bits.
The HyperV feature support bits as documented in the HyperV Top Level Functional Specifications.
It would be nice to have support for these hyperv flags in cpuid. The feature could be used by virtualized guests running inside HyperV Virtual Machines.
I can contribute a PR adding support for this feature if there is interest from the project maintainers. Thoughts?
Hi.
Investigated the bug while running the test:
https://github.com/u-root/u-root/blob/master/cmds/core/ln/ln_test.go
.
@hugelgupf could tell more.
ok github.com/u-root/u-root/cmds/core/ln 0.691s
# github.com/intel-go/cpuid
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s: Assembler messages:
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:8: Error: no such instruction:text ·cpuid_low(SB),NOSPLIT,$0-24' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:9: Error: junk
(FP)' after expression
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:9: Error: too many memory references formov' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:10: Error: junk
(FP)' after expression
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:10: Error: too many memory references formov' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:12: Error: too many memory references for
mov'
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:13: Error: too many memory references formov' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:14: Error: too many memory references for
mov'
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:15: Error: too many memory references formov' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:19: Error: no such instruction:
text ·xgetbv_low(SB),NOSPLIT,$0-16'
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:20: Error: junk(FP)' after expression ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:20: Error: too many memory references for
mov'
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:21: Error: no such instruction:byte $0x0F' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:22: Error: no such instruction:
byte $0x01'
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:23: Error: no such instruction:byte $0xD0' ../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:24: Error: too many memory references for
mov'
../go/pkg/mod/github.com/intel-go/[email protected]/cpuidlow_amd64.s:25: Error: too many memory references for `mov'
I am using
$ go version
go version go1.15.2 gollvm LLVM 12.0.0git linux/amd64
CC @jcooklin @aregm @dvnagorny @xmikus01 @linux4life798 @bramp @rscohn2 @jodh-intel
CC @thanm @cherrymui @ianlancetaylor
// Maximum number of addressable IDs for logical processors in this physical package
var MaxLogocalCPUId uint32
go build
./cpuidlow_amd64.s:2: illegal or missing addressing mode for symbol NOSPLIT
./cpuidlow_amd64.s:12: illegal or missing addressing mode for symbol NOSPLIT
asm: asm: assembly of ./cpuidlow_amd64.s failed
go version go1.6 darwin/amd6
Hello!
I'm wondering: is it possible to publish variable brandId
(to make it BrandID
)? We are trying to execute different code depending on is it Intel or AMD.
https://github.com/intel-go/cpuid/blob/5747e5cec0d96c427e569cfa14cb539bf116f7ad/cpuid.go#L323
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.