Coder Social home page Coder Social logo

Comments (9)

zacaway avatar zacaway commented on May 22, 2024 1

I've tested v2.0.14 and can confirm it is working. Many thanks!

from cpuid.

klauspost avatar klauspost commented on May 22, 2024

@zacaway Are you running in a VM?

from cpuid.

zacaway avatar zacaway commented on May 22, 2024

Yes, I am running under Xen.

from cpuid.

klauspost avatar klauspost commented on May 22, 2024

It must have a buggy implementation of its cpuid emulation, then.

Is it possible for you to insert this:

@@ -848,6 +858,11 @@ func (c *CPUInfo) cacheSize() {
 			if typ == 0 {
 				return
 			}
+			fmt.Printf("EAX: 0x%08x, EBX: 0x%08x, ECX: 0x%08x; ", eax, ebx, ecx)
+			fmt.Println("type", typ, "size:", size)
+			if i > 100 {
+				return
+			}
 
 			switch level {
 			case 1:

I need a secondary break condition.

The docs specify that EAX low 4==0 bits indicates that there are no more (page 33).

from cpuid.

klauspost avatar klauspost commented on May 22, 2024

(I will need the output to look at a fix)

from cpuid.

zacaway avatar zacaway commented on May 22, 2024

Hi, here is the output (from running cmd/cpuid/main.go with that patch):

EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
EAX: 0x00004121, EBX: 0x01c0003f, ECX: 0x0000003f; type 1 size: 32768
Name: AMD Ryzen 7 5700G with Radeon Graphics
Vendor String: AuthenticAMD
Vendor ID: AMD
PhysicalCores: 16
Threads Per Core: 2
Logical Cores: 32
CPU Family 25 Model: 80
Features: ADX,AESNI,AVX,AVX2,BMI1,BMI2,CLMUL,CLZERO,CMOV,CMPXCHG8,CX16,ERMS,F16C,FMA3,FXSR,FXSROPT,HTT,HYPERVISOR,LAHF,LZCNT,MMX,MMXEXT,MOVBE,MSR_PAGEFLUSH,NX,OSXSAVE,POPCNT,RDRAND,RDSEED,RDTSCP,SCE,SEV,SEV_64BIT,SEV_ALTERNATIVE,SEV_DEBUGSWAP,SEV_ES,SEV_RESTRICTED,SHA,SME,SSE,SSE2,SSE3,SSE4,SSE42,SSE4A,SSSE3,VTE,X87,XGETBV1,XSAVE,XSAVEC,XSAVEOPT,XSAVES
Microarchitecture level: 3
Cacheline bytes: 64
L1 Instruction Cache: 32768 bytes
L1 Data Cache: 32768 bytes
L2 Cache: 524288 bytes
L3 Cache: -1 bytes

Thanks

from cpuid.

klauspost avatar klauspost commented on May 22, 2024

ok, this is buggy, unless you have endless level 1 data cache :)

Seems like it just ignores ECX value given, which should return different cache levels.

from cpuid.

zacaway avatar zacaway commented on May 22, 2024

Great, thanks. Yes, I don't think I have an infinite cache unfortunately :)

from cpuid.

klauspost avatar klauspost commented on May 22, 2024

Thanks for the help.

You can try the cpuid of the latest release: https://github.com/klauspost/cpuid/releases/tag/v2.0.14 - should catch your case.

I will upstream if you can confirm it works.

from cpuid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.