feat: Add CPU vendor and features identification

Add functionality to identify the CPU vendor and features using the CPUID instruction.
The CPU vendor information is stored in the Processor Control Block (PRCB),
including the vendor name and a corresponding enumeration.
CPU features are also retrieved and stored in the PRCB.
Previously, the CPU vendor was not properly stored in the PRCB, caused by a missing type cast.
Using Rtl functions to copy the CPU vendor name to the PRCB.

Details:
- Introduced functions `ArpSetCpuVendor` and `ArpSetCpuFeatures` to set CPU vendor and features, respectively.
- Modified `ArpIdentifyProcessor` to call the new functions for vendor and features identification.
- Added `CPU_FEATURES` structure to `KPROCESSOR_CONTROL_BLOCK` structure to store CPU features.

Tests:
- Tested x86_64 on QEMU. Verified that the CPU vendor and features are correctly identified and stored in the PRCB.
This commit is contained in:
2023-11-23 23:22:54 +01:00
parent a01ccff6dc
commit a270c08dcf
8 changed files with 337 additions and 45 deletions

View File

@@ -288,4 +288,12 @@ ArpSetIdtGate(IN PKIDTENTRY Idt,
IN USHORT Ist,
IN USHORT Access);
XTAPI
VOID
ArpSetCpuVendor(VOID);
XTAPI
VOID
ArpSetCpuFeatures(VOID);
#endif /* __XTOSKRNL_AMD64_AR_H */

View File

@@ -284,4 +284,12 @@ XTAPI
VOID
ArpSetNonMaskableInterruptTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock);
XTAPI
VOID
ArpSetCpuVendor(VOID);
XTAPI
VOID
ArpSetCpuFeatures(VOID);
#endif /* __XTOSKRNL_I686_AR_H */