Skip to content

Comments

fix(x86_64): raw_cpu_id() for x86_64#271

Merged
ytakano merged 1 commit intomainfrom
fix/raw_cpu_id_x86
Jan 14, 2025
Merged

fix(x86_64): raw_cpu_id() for x86_64#271
ytakano merged 1 commit intomainfrom
fix/raw_cpu_id_x86

Conversation

@Koichi98
Copy link
Contributor

@Koichi98 Koichi98 commented Jan 13, 2025

Description

A case was identified where retrieving leaf 0x1f returned invalid values (eax, ebx, ecx, edx are all 0) even though max_leaf was 0x1f. This occurred on an Intel(R) Core(TM) i9-14900K running Linux kernel 6.5.0-44-generic kvm. Following guidance from Intel's Software Developer's Manual (Order Number: 253665-086US December 2024), I modified the implementation to use leaf 0x0b also in the cases where the upper 8 bits of ecx are invalid.

If sub-leaf index “N” returns an invalid domain type in ECX[15:08] (00H), then all sub-leaves with an
index greater than “N” shall also return an invalid domain type. A sub-leaf returning an invalid domain
always returns 0 in EAX and EBX.

Related links

Intel's Software Developer's Manual

How was this PR tested?

On the following environment.

Intel(R) Core(TM) i9-14900K (kvm)
Intel(R) Core(TM) i7-10750H (kvm)
12th Gen Intel(R) Core(TM) i7-12700

Notes for reviewers

Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
@Koichi98 Koichi98 requested a review from ytakano January 14, 2025 00:49
@ytakano ytakano merged commit 15ce275 into main Jan 14, 2025
1 check passed
@Koichi98 Koichi98 deleted the fix/raw_cpu_id_x86 branch January 14, 2025 01:17
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