gz / rust-cpuid

cpuid library in rust.
https://docs.rs/raw-cpuid/
MIT License
150 stars 45 forks source link

Implement AMD leaf 0x8000_001D (Cache Properties/Parameters) #95

Closed Umio-Yasuno closed 2 years ago

Umio-Yasuno commented 2 years ago

Related: #61

AMD CPU supports Leaf: 0x8000_001D from Family 15h, same format as Intel Leaf: 0x4. https://www.amd.com/system/files/TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf

Umio-Yasuno commented 2 years ago

Sorry, the AMD CPU is lacking max_cores_for_package [EAX Bit31-26], has_complex_indexing [EDX Bit02].

gz commented 2 years ago

Thanks a lot for the PR!

See my comments above but if tests pass and we get the documentation in order this should be good to merge.

Umio-Yasuno commented 2 years ago

Thank you for your review. I fixed documentation comments.

gz commented 2 years ago

Thanks a lot!

Do you mind also adding the right emoji annotations for "AMD / Intel" to the rest of the functions in the impl e.g., here:

https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2613 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2618 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2623 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2628 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2628 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2646 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2651 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2656 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2661 https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2668

The idea is that once we mark a struct partially supported (yellow dot) then we go and add annotation on what's actually supported for every function of that leaf/struct.

gz commented 2 years ago

Should mark this partial here too:

https://github.com/gz/rust-cpuid/pull/95/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R2560

gz commented 2 years ago

Awesome thanks!

Umio-Yasuno commented 2 years ago

Thanks!