Skip to contentSkip to conversation

Help With Identifying CPUID faulting logic in Xen code

DISCUSSION Fonyuy-Asheri Caleb 2 participants 3 messages Jan 3, 2025

lore
Share & tools
lore
#0 lore raw

Hello,

I am interested in finding understanding how xen handles CPUID faulting and VM exits in general. Please can someone indicate to me the concerned files?

I want to know how xen detects the execution of the CPUID instruction and ensures a guest only gets the features defined in cpuid-autogen.h file depending on the guest type.

I started looking at the file xen/arch/x86/cpuid.c but don't really know which other files to check next.

Thanks

Caleb

#1 lore raw
Quoted 7 lines · Fonyuy-Asheri Caleb

Hello,

I am interested in finding understanding how xen handles CPUID faulting and
VM exits in general. Please can someone indicate to me the concerned files?

Quoted 7 lines

I want to know how xen detects the execution of the CPUID instruction and ensures a guest only gets the features defined in cpuid-autogen.h file depending on the guest type.

I started looking at the file xen/arch/x86/cpuid.c but don't really know which other
files to check next.

https://xenbits.xen.org/docs/unstable/features/feature-levelling.html

has a reasonable introduction.  Being nearly a decade old, it's slightly stale.  AMD now have CPUID Faulting capability too, new in Zen4 CPUs IIRC.

LCAP_faulting specifically is the constant you're looking for, in the Xen code.

~Andrew

#2 lore raw

Thank you

Caleb

----- Original Message -----

Quoted 31 lines

From: "Andrew Cooper" <[email protected]>
To: "Fonyuy-Asheri Caleb" <[email protected]>, "xen-devel" <[email protected]>
Cc: "Jan Beulich" <[email protected]>
Sent: Friday, January 3, 2025 3:35:43 PM
Subject: Re: Help With Identifying CPUID faulting logic in Xen code

Quoted 7 lines · Fonyuy-Asheri Caleb

Hello,

I am interested in finding understanding how xen handles CPUID faulting and
VM exits in general. Please can someone indicate to me the concerned files?

Quoted 7 lines

I want to know how xen detects the execution of the CPUID instruction and ensures a guest only gets the features defined in cpuid-autogen.h file depending on the guest type.

I started looking at the file xen/arch/x86/cpuid.c but don't really know which other
files to check next.

https://xenbits.xen.org/docs/unstable/features/feature-levelling.html

has a reasonable introduction.  Being nearly a decade old, it's slightly stale.  AMD now have CPUID Faulting capability too, new in Zen4 CPUs IIRC.

LCAP_faulting specifically is the constant you're looking for, in the Xen code.

~Andrew