SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
CPUID handling for guests
Andrew Cooper
Citrix XenServer
Friday 26th August 2016
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 1 / 11
The CPUID instruction
Introduced in 1993
Takes input parameters in %eax and %ecx
Returns values in %eax, %ebx, %ecx and %edx
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 2 / 11
The CPUID instruction
Introduced in 1993
Takes input parameters in %eax and %ecx
Returns values in %eax, %ebx, %ecx and %edx
Return information about the processor
Identifying information (GenuineIntel, AuthenticAMD, etc)
Feature information (available instructions, MSRs, etc)
Topology information (sockets, cores, threads, caches, TLBs, etc)
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 2 / 11
The CPUID instruction
Introduced in 1993
Takes input parameters in %eax and %ecx
Returns values in %eax, %ebx, %ecx and %edx
Return information about the processor
Identifying information (GenuineIntel, AuthenticAMD, etc)
Feature information (available instructions, MSRs, etc)
Topology information (sockets, cores, threads, caches, TLBs, etc)
Unpriveleged
Useable by userspace
Doesn’t trap to supervisor mode
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 2 / 11
OS expectations
CPUID information don’t change after boot
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 3 / 11
OS expectations
CPUID information don’t change after boot
Some kernels binary patch themselves (e.g. Alternatives framework)
e.g. New features in fastpaths (SMAP)
e.g. Errata workarounds
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 3 / 11
OS expectations
CPUID information don’t change after boot
Some kernels binary patch themselves (e.g. Alternatives framework)
e.g. New features in fastpaths (SMAP)
e.g. Errata workarounds
Userspace function dispatching at process start
e.g. Most efficient memset()
e.g. Hardware crypto if available
e.g. Audio or video processing
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 3 / 11
OS expectations
CPUID information don’t change after boot
Some kernels binary patch themselves (e.g. Alternatives framework)
e.g. New features in fastpaths (SMAP)
e.g. Errata workarounds
Userspace function dispatching at process start
e.g. Most efficient memset()
e.g. Hardware crypto if available
e.g. Audio or video processing
Migration modelled as suspend/resume
Not a reboot
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 3 / 11
OS expectations
CPUID information don’t change after boot
Some kernels binary patch themselves (e.g. Alternatives framework)
e.g. New features in fastpaths (SMAP)
e.g. Errata workarounds
Userspace function dispatching at process start
e.g. Most efficient memset()
e.g. Hardware crypto if available
e.g. Audio or video processing
Migration modelled as suspend/resume
Not a reboot
Guest must not observe a loss of dependent features
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 3 / 11
How compatible does hardware need to be?
All features previously used need to continue functioning
All instructions, MSRs, etc
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 4 / 11
How compatible does hardware need to be?
All features previously used need to continue functioning
All instructions, MSRs, etc
Available features controlled by:
CPU family, model and stepping
Firmware version and settings
Microcode version
Xen’s hardware support and administrator choices
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 4 / 11
How compatible does hardware need to be?
All features previously used need to continue functioning
All instructions, MSRs, etc
Available features controlled by:
CPU family, model and stepping
Firmware version and settings
Microcode version
Xen’s hardware support and administrator choices
Typically, “identical” servers are not
Different CPUs, especially on RMA’d hardware
Configuring firmware is tedious and error prone
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 4 / 11
How compatible does hardware need to be?
All features previously used need to continue functioning
All instructions, MSRs, etc
Available features controlled by:
CPU family, model and stepping
Firmware version and settings
Microcode version
Xen’s hardware support and administrator choices
Typically, “identical” servers are not
Different CPUs, especially on RMA’d hardware
Configuring firmware is tedious and error prone
Must lie to guests (for their own good)
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 4 / 11
Controlling a guests view of information
HVM guests
CPUID instruction traps to hypervisor
Xen can control all information seen
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 5 / 11
Controlling a guests view of information
HVM guests
CPUID instruction traps to hypervisor
Xen can control all information seen
PV guests
CPUID instruction doesn’t trap
Xen has no direct control
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 5 / 11
Controlling a guests view of information
HVM guests
CPUID instruction traps to hypervisor
Xen can control all information seen
PV guests
CPUID instruction doesn’t trap
Xen has no direct control
PV Emulated CPUID
Software can opt in to Xen’s control
Adhoc use in PV guest kernels, but not by userspace
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 5 / 11
Controlling a guests view of information
HVM guests
CPUID instruction traps to hypervisor
Xen can control all information seen
PV guests
CPUID instruction doesn’t trap
Xen has no direct control
PV Emulated CPUID
Software can opt in to Xen’s control
Adhoc use in PV guest kernels, but not by userspace
CPUID Faulting
Non-architectural, but available in Intel IvyBridge and later
Causes CPUID to fault with #GP(0)
Xen can control all information seen
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 5 / 11
Controlling a guests view of information (2)
CPUID Masking
Non-architectural, “documented” only in whitepapers
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 6 / 11
Controlling a guests view of information (2)
CPUID Masking
Non-architectural, “documented” only in whitepapers
AMD (All hardware Xen can run on)
Override MSRs
Must be careful not to advertise features unsupported in silicon
Covers basic and extended feature leaves
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 6 / 11
Controlling a guests view of information (2)
CPUID Masking
Non-architectural, “documented” only in whitepapers
AMD (All hardware Xen can run on)
Override MSRs
Must be careful not to advertise features unsupported in silicon
Covers basic and extended feature leaves
Intel (only some Nehalem/Westmere processors, SandyBridge)
AND mask against the real hardware values
Different MSRs on different hardware
Covers basic, extended and xsave feature leaves
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 6 / 11
Controlling a guests view of information (2)
CPUID Masking
Non-architectural, “documented” only in whitepapers
AMD (All hardware Xen can run on)
Override MSRs
Must be careful not to advertise features unsupported in silicon
Covers basic and extended feature leaves
Intel (only some Nehalem/Westmere processors, SandyBridge)
AND mask against the real hardware values
Different MSRs on different hardware
Covers basic, extended and xsave feature leaves
Magic CPUID bits
APIC and OSXSAVE bits fast forwarded from other state
Interaction with masking completely undocumented
Behaviour reverse engineered, hopefully right
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 6 / 11
Problematic areas to control
Guests can probe for some features
1GB Superpage support
AES instructions
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 7 / 11
Problematic areas to control
Guests can probe for some features
1GB Superpage support
AES instructions
Some features don’t have feature bits
AMD’s Long Mode Segment Limit Enable
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 7 / 11
Problematic areas to control
Guests can probe for some features
1GB Superpage support
AES instructions
Some features don’t have feature bits
AMD’s Long Mode Segment Limit Enable
FPU pipeline behaviour exposed directly to guests
MXCSR_MASK
Intel’s FPDP and FPCSDS
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 7 / 11
Problematic areas to control
Guests can probe for some features
1GB Superpage support
AES instructions
Some features don’t have feature bits
AMD’s Long Mode Segment Limit Enable
FPU pipeline behaviour exposed directly to guests
MXCSR_MASK
Intel’s FPDP and FPCSDS
Some feature bits affect the interpretation of other leaves
CMP_LEGACY, HTT and X2APIC affect the topology interpretation
Can’t control topology information with masking
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 7 / 11
CPUID handling in Xen
No real develoment since the uni-vcpu guest days
No concept of topology information
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 8 / 11
CPUID handling in Xen
No real develoment since the uni-vcpu guest days
No concept of topology information
No auditing of the toolstack-provided information
Lots of runtime adjustment to regain plausibility
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 8 / 11
CPUID handling in Xen
No real develoment since the uni-vcpu guest days
No concept of topology information
No auditing of the toolstack-provided information
Lots of runtime adjustment to regain plausibility
Inconsistent whitelist/blacklist approach
Different approaches between different leaves
Different approaches between different guest types
Some information passed straight through from hardware
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 8 / 11
CPUID handling in Xen
No real develoment since the uni-vcpu guest days
No concept of topology information
No auditing of the toolstack-provided information
Lots of runtime adjustment to regain plausibility
Inconsistent whitelist/blacklist approach
Different approaches between different leaves
Different approaches between different guest types
Some information passed straight through from hardware
No knowledge of feature dependency
Buggy assumptions in guests result in crashes
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 8 / 11
CPUID handling in Xen
No real develoment since the uni-vcpu guest days
No concept of topology information
No auditing of the toolstack-provided information
Lots of runtime adjustment to regain plausibility
Inconsistent whitelist/blacklist approach
Different approaches between different leaves
Different approaches between different guest types
Some information passed straight through from hardware
No knowledge of feature dependency
Buggy assumptions in guests result in crashes
No way for the toolstack to evaluate the hardware capability
Feature internals exposed in the ABI, with no API
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 8 / 11
CPUID handling in Xen
No real develoment since the uni-vcpu guest days
No concept of topology information
No auditing of the toolstack-provided information
Lots of runtime adjustment to regain plausibility
Inconsistent whitelist/blacklist approach
Different approaches between different leaves
Different approaches between different guest types
Some information passed straight through from hardware
No knowledge of feature dependency
Buggy assumptions in guests result in crashes
No way for the toolstack to evaluate the hardware capability
Feature internals exposed in the ABI, with no API
PV dependence on leaked CPUID information
Hardware domain for C/P states, MTRRs
Control domain for building guests
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 8 / 11
CPUID-related improvements in Xen 4.7
Introduce “a featureset” in the API/ABI
Keys as specified in architecture manuals
Can be treated as opaque by higher level software
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 9 / 11
CPUID-related improvements in Xen 4.7
Introduce “a featureset” in the API/ABI
Keys as specified in architecture manuals
Can be treated as opaque by higher level software
At boot, Xen calculates featuresets for itself and the toolstack:
raw Features supported by hardware
host Features used by Xen (after errata, command line, etc)
pv Maximum featureset available for PV guests
hvm Maximum featureset available for HVM guests
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 9 / 11
CPUID-related improvements in Xen 4.7
Introduce “a featureset” in the API/ABI
Keys as specified in architecture manuals
Can be treated as opaque by higher level software
At boot, Xen calculates featuresets for itself and the toolstack:
raw Features supported by hardware
host Features used by Xen (after errata, command line, etc)
pv Maximum featureset available for PV guests
hvm Maximum featureset available for HVM guests
Shared Xen/libxc algorithm for feature dependencies
Provides consistent logic between Xen and libxc
Build-time calculations to avoid complicated runtime logic
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 9 / 11
Future work
Extend the featureset concept to a full CPUID policy
Needs guest topology information
Will allow control of MAXPHYSADDR
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 10 / 11
Future work
Extend the featureset concept to a full CPUID policy
Needs guest topology information
Will allow control of MAXPHYSADDR
Improved hypercalls for policies
XEN_DOMCTL_get_cpuid_policy
Xen to audit policy plausibility at hypercall time, not runtime
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 10 / 11
Future work
Extend the featureset concept to a full CPUID policy
Needs guest topology information
Will allow control of MAXPHYSADDR
Improved hypercalls for policies
XEN_DOMCTL_get_cpuid_policy
Xen to audit policy plausibility at hypercall time, not runtime
More migration stream work
CPUID policy should be in the migration stream
Avoid mistakes when regenerating
Can finaly audit RAM/CPU state against reality
Allows for a pre-migrate check at the destination
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 10 / 11
Future work
Extend the featureset concept to a full CPUID policy
Needs guest topology information
Will allow control of MAXPHYSADDR
Improved hypercalls for policies
XEN_DOMCTL_get_cpuid_policy
Xen to audit policy plausibility at hypercall time, not runtime
More migration stream work
CPUID policy should be in the migration stream
Avoid mistakes when regenerating
Can finaly audit RAM/CPU state against reality
Allows for a pre-migrate check at the destination
MSRs
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 10 / 11
CPUID handling for guests
Any Questions?
Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th
August 2016 11 / 11

Mais conteúdo relacionado

Mais procurados

kexec / kdump implementation in Linux Kernel and Xen hypervisor
kexec / kdump implementation in Linux Kernel and Xen hypervisorkexec / kdump implementation in Linux Kernel and Xen hypervisor
kexec / kdump implementation in Linux Kernel and Xen hypervisor
The Linux Foundation
 

Mais procurados (20)

Rootlinux17: An introduction to Xen Project Virtualisation
Rootlinux17:  An introduction to Xen Project VirtualisationRootlinux17:  An introduction to Xen Project Virtualisation
Rootlinux17: An introduction to Xen Project Virtualisation
 
XPDS16: AMD's virtualization memory encryption technology - Brijesh Singh, A...
XPDS16:  AMD's virtualization memory encryption technology - Brijesh Singh, A...XPDS16:  AMD's virtualization memory encryption technology - Brijesh Singh, A...
XPDS16: AMD's virtualization memory encryption technology - Brijesh Singh, A...
 
kdump: usage and_internals
kdump: usage and_internalskdump: usage and_internals
kdump: usage and_internals
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)
 
LFNW2014 Advanced Security Features of Xen Project Hypervisor
LFNW2014 Advanced Security Features of Xen Project HypervisorLFNW2014 Advanced Security Features of Xen Project Hypervisor
LFNW2014 Advanced Security Features of Xen Project Hypervisor
 
LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...
LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...
LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...
 
ELC21: VM-to-VM Communication Mechanisms for Embedded
ELC21: VM-to-VM Communication Mechanisms for EmbeddedELC21: VM-to-VM Communication Mechanisms for Embedded
ELC21: VM-to-VM Communication Mechanisms for Embedded
 
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARMXPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
 
System Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperSystem Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and Lopper
 
kexec / kdump implementation in Linux Kernel and Xen hypervisor
kexec / kdump implementation in Linux Kernel and Xen hypervisorkexec / kdump implementation in Linux Kernel and Xen hypervisor
kexec / kdump implementation in Linux Kernel and Xen hypervisor
 
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
 
XPDS14 - Xen on ARM: Status and Performance - Stefano Stabellini, Citrix
XPDS14 - Xen on ARM: Status and Performance - Stefano Stabellini, CitrixXPDS14 - Xen on ARM: Status and Performance - Stefano Stabellini, Citrix
XPDS14 - Xen on ARM: Status and Performance - Stefano Stabellini, Citrix
 
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
 
XPDS13: HVM Dom0 - Any unmodified OS as Dom0 - Will Auld, Intel
XPDS13: HVM Dom0 - Any unmodified OS as Dom0 - Will Auld, IntelXPDS13: HVM Dom0 - Any unmodified OS as Dom0 - Will Auld, Intel
XPDS13: HVM Dom0 - Any unmodified OS as Dom0 - Will Auld, Intel
 
PVH : PV Guest in HVM container
PVH : PV Guest in HVM containerPVH : PV Guest in HVM container
PVH : PV Guest in HVM container
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
XPDS16: Windows PV Network Performance - Paul Durrant, Citrix Systems Inc
XPDS16: Windows PV Network Performance - Paul Durrant, Citrix Systems IncXPDS16: Windows PV Network Performance - Paul Durrant, Citrix Systems Inc
XPDS16: Windows PV Network Performance - Paul Durrant, Citrix Systems Inc
 
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
 
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM Systems
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM SystemsXPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM Systems
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM Systems
 
XPDS14: Removing the Xen Linux Upstream Delta of Various Linux Distros - Luis...
XPDS14: Removing the Xen Linux Upstream Delta of Various Linux Distros - Luis...XPDS14: Removing the Xen Linux Upstream Delta of Various Linux Distros - Luis...
XPDS14: Removing the Xen Linux Upstream Delta of Various Linux Distros - Luis...
 

Destaque

OSCON16: Analysis of the Xen code review process: An example of software deve...
OSCON16: Analysis of the Xen code review process: An example of software deve...OSCON16: Analysis of the Xen code review process: An example of software deve...
OSCON16: Analysis of the Xen code review process: An example of software deve...
The Linux Foundation
 
LinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and BeyondLinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and Beyond
The Linux Foundation
 

Destaque (17)

XPDS16: Scope and Performance of Credit-2 Scheduler. - Anshul Makkar, Ctirix...
XPDS16:  Scope and Performance of Credit-2 Scheduler. - Anshul Makkar, Ctirix...XPDS16:  Scope and Performance of Credit-2 Scheduler. - Anshul Makkar, Ctirix...
XPDS16: Scope and Performance of Credit-2 Scheduler. - Anshul Makkar, Ctirix...
 
XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D...
 XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D... XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D...
XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D...
 
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARMXPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
 
XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...
XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...
XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...
 
XPDS16: Live Migration of vGPU - Xiao Zheng, Intel Asia-Pacific Research & De...
XPDS16: Live Migration of vGPU - Xiao Zheng, Intel Asia-Pacific Research & De...XPDS16: Live Migration of vGPU - Xiao Zheng, Intel Asia-Pacific Research & De...
XPDS16: Live Migration of vGPU - Xiao Zheng, Intel Asia-Pacific Research & De...
 
XPDS16: Making Migration More Secure - John Shackleton, Adventium Labs
XPDS16: Making Migration More Secure - John Shackleton, Adventium LabsXPDS16: Making Migration More Secure - John Shackleton, Adventium Labs
XPDS16: Making Migration More Secure - John Shackleton, Adventium Labs
 
Fosdem17 - Mixed License FOSS Projects
Fosdem17 - Mixed License FOSS ProjectsFosdem17 - Mixed License FOSS Projects
Fosdem17 - Mixed License FOSS Projects
 
XPDS16: Live scalability for vGPU using gScale - Xiao Zheng, Intel
XPDS16: Live scalability for vGPU using gScale - Xiao Zheng, IntelXPDS16: Live scalability for vGPU using gScale - Xiao Zheng, Intel
XPDS16: Live scalability for vGPU using gScale - Xiao Zheng, Intel
 
LCEU13: Securing your cloud with Xen's advanced security features - George Du...
LCEU13: Securing your cloud with Xen's advanced security features - George Du...LCEU13: Securing your cloud with Xen's advanced security features - George Du...
LCEU13: Securing your cloud with Xen's advanced security features - George Du...
 
Xen summit amd_2010v3
Xen summit amd_2010v3Xen summit amd_2010v3
Xen summit amd_2010v3
 
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
 
Cobbler Summit - Automated Xen VM Deployment
Cobbler Summit - Automated Xen VM DeploymentCobbler Summit - Automated Xen VM Deployment
Cobbler Summit - Automated Xen VM Deployment
 
XPDS16: Consideration of Real Time GPU Scheduling of XenGT in Automotive Embe...
XPDS16: Consideration of Real Time GPU Scheduling of XenGT in Automotive Embe...XPDS16: Consideration of Real Time GPU Scheduling of XenGT in Automotive Embe...
XPDS16: Consideration of Real Time GPU Scheduling of XenGT in Automotive Embe...
 
LF Collaboration Summit: Xen Project 4 4 Features and Futures
LF Collaboration Summit: Xen Project 4 4 Features and FuturesLF Collaboration Summit: Xen Project 4 4 Features and Futures
LF Collaboration Summit: Xen Project 4 4 Features and Futures
 
Performance Tuning Xen
Performance Tuning XenPerformance Tuning Xen
Performance Tuning Xen
 
OSCON16: Analysis of the Xen code review process: An example of software deve...
OSCON16: Analysis of the Xen code review process: An example of software deve...OSCON16: Analysis of the Xen code review process: An example of software deve...
OSCON16: Analysis of the Xen code review process: An example of software deve...
 
LinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and BeyondLinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and Beyond
 

Semelhante a XPDS16: CPUID handling for guests - Andrew Cooper, Citrix

VMware Performance Troubleshooting
VMware Performance TroubleshootingVMware Performance Troubleshooting
VMware Performance Troubleshooting
glbsolutions
 
Resume_AlicePancamo2016
Resume_AlicePancamo2016Resume_AlicePancamo2016
Resume_AlicePancamo2016
Alice Pancamo
 

Semelhante a XPDS16: CPUID handling for guests - Andrew Cooper, Citrix (20)

Sun VDI 3.1 - Oct 2009
Sun VDI 3.1 - Oct 2009Sun VDI 3.1 - Oct 2009
Sun VDI 3.1 - Oct 2009
 
Automating hard things may 2015
Automating hard things   may 2015Automating hard things   may 2015
Automating hard things may 2015
 
CSL_Cochin_c
CSL_Cochin_cCSL_Cochin_c
CSL_Cochin_c
 
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias ZarickTrivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
 
Gab17 lyon SQL on Linux - David BARBARIN
Gab17 lyon SQL on Linux - David BARBARINGab17 lyon SQL on Linux - David BARBARIN
Gab17 lyon SQL on Linux - David BARBARIN
 
Trivadis TechEvent 2017 Oracle on azure by Michael Schwarzgorn
Trivadis TechEvent 2017 Oracle on azure by Michael SchwarzgornTrivadis TechEvent 2017 Oracle on azure by Michael Schwarzgorn
Trivadis TechEvent 2017 Oracle on azure by Michael Schwarzgorn
 
Oracle RAC Presentation at Oracle Open World
Oracle RAC Presentation at Oracle Open WorldOracle RAC Presentation at Oracle Open World
Oracle RAC Presentation at Oracle Open World
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performance
 
The Unofficial VCAP / VCP VMware Study Guide
The Unofficial VCAP / VCP VMware Study GuideThe Unofficial VCAP / VCP VMware Study Guide
The Unofficial VCAP / VCP VMware Study Guide
 
Application hosting in the Intelligent WAN
Application hosting in the Intelligent WANApplication hosting in the Intelligent WAN
Application hosting in the Intelligent WAN
 
Making MySQL highly available using Oracle Grid Infrastructure
Making MySQL highly available using Oracle Grid InfrastructureMaking MySQL highly available using Oracle Grid Infrastructure
Making MySQL highly available using Oracle Grid Infrastructure
 
[ppt]
[ppt][ppt]
[ppt]
 
Understanding Oracle RAC 12c Internals OOW13 [CON8806]
Understanding Oracle RAC 12c Internals OOW13 [CON8806]Understanding Oracle RAC 12c Internals OOW13 [CON8806]
Understanding Oracle RAC 12c Internals OOW13 [CON8806]
 
Performance characteristics of traditional v ms vs docker containers (dockerc...
Performance characteristics of traditional v ms vs docker containers (dockerc...Performance characteristics of traditional v ms vs docker containers (dockerc...
Performance characteristics of traditional v ms vs docker containers (dockerc...
 
2 Sessione - Macchine virtuali per la scalabilità di calcolo per velocizzare ...
2 Sessione - Macchine virtuali per la scalabilità di calcolo per velocizzare ...2 Sessione - Macchine virtuali per la scalabilità di calcolo per velocizzare ...
2 Sessione - Macchine virtuali per la scalabilità di calcolo per velocizzare ...
 
Sql Server On A Cluster
Sql Server On A ClusterSql Server On A Cluster
Sql Server On A Cluster
 
Oracle Database on ACFS: a perfect marriage?
Oracle Database on ACFS: a perfect marriage?Oracle Database on ACFS: a perfect marriage?
Oracle Database on ACFS: a perfect marriage?
 
VMware Performance Troubleshooting
VMware Performance TroubleshootingVMware Performance Troubleshooting
VMware Performance Troubleshooting
 
Drupal Deployment on Solaris - DrupalCamp Bay Area 2007 - Mattoon
Drupal Deployment on Solaris - DrupalCamp Bay Area 2007 - MattoonDrupal Deployment on Solaris - DrupalCamp Bay Area 2007 - Mattoon
Drupal Deployment on Solaris - DrupalCamp Bay Area 2007 - Mattoon
 
Resume_AlicePancamo2016
Resume_AlicePancamo2016Resume_AlicePancamo2016
Resume_AlicePancamo2016
 

Mais de The Linux Foundation

Mais de The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

XPDS16: CPUID handling for guests - Andrew Cooper, Citrix

  • 1. CPUID handling for guests Andrew Cooper Citrix XenServer Friday 26th August 2016 Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 1 / 11
  • 2. The CPUID instruction Introduced in 1993 Takes input parameters in %eax and %ecx Returns values in %eax, %ebx, %ecx and %edx Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 2 / 11
  • 3. The CPUID instruction Introduced in 1993 Takes input parameters in %eax and %ecx Returns values in %eax, %ebx, %ecx and %edx Return information about the processor Identifying information (GenuineIntel, AuthenticAMD, etc) Feature information (available instructions, MSRs, etc) Topology information (sockets, cores, threads, caches, TLBs, etc) Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 2 / 11
  • 4. The CPUID instruction Introduced in 1993 Takes input parameters in %eax and %ecx Returns values in %eax, %ebx, %ecx and %edx Return information about the processor Identifying information (GenuineIntel, AuthenticAMD, etc) Feature information (available instructions, MSRs, etc) Topology information (sockets, cores, threads, caches, TLBs, etc) Unpriveleged Useable by userspace Doesn’t trap to supervisor mode Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 2 / 11
  • 5. OS expectations CPUID information don’t change after boot Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 3 / 11
  • 6. OS expectations CPUID information don’t change after boot Some kernels binary patch themselves (e.g. Alternatives framework) e.g. New features in fastpaths (SMAP) e.g. Errata workarounds Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 3 / 11
  • 7. OS expectations CPUID information don’t change after boot Some kernels binary patch themselves (e.g. Alternatives framework) e.g. New features in fastpaths (SMAP) e.g. Errata workarounds Userspace function dispatching at process start e.g. Most efficient memset() e.g. Hardware crypto if available e.g. Audio or video processing Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 3 / 11
  • 8. OS expectations CPUID information don’t change after boot Some kernels binary patch themselves (e.g. Alternatives framework) e.g. New features in fastpaths (SMAP) e.g. Errata workarounds Userspace function dispatching at process start e.g. Most efficient memset() e.g. Hardware crypto if available e.g. Audio or video processing Migration modelled as suspend/resume Not a reboot Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 3 / 11
  • 9. OS expectations CPUID information don’t change after boot Some kernels binary patch themselves (e.g. Alternatives framework) e.g. New features in fastpaths (SMAP) e.g. Errata workarounds Userspace function dispatching at process start e.g. Most efficient memset() e.g. Hardware crypto if available e.g. Audio or video processing Migration modelled as suspend/resume Not a reboot Guest must not observe a loss of dependent features Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 3 / 11
  • 10. How compatible does hardware need to be? All features previously used need to continue functioning All instructions, MSRs, etc Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 4 / 11
  • 11. How compatible does hardware need to be? All features previously used need to continue functioning All instructions, MSRs, etc Available features controlled by: CPU family, model and stepping Firmware version and settings Microcode version Xen’s hardware support and administrator choices Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 4 / 11
  • 12. How compatible does hardware need to be? All features previously used need to continue functioning All instructions, MSRs, etc Available features controlled by: CPU family, model and stepping Firmware version and settings Microcode version Xen’s hardware support and administrator choices Typically, “identical” servers are not Different CPUs, especially on RMA’d hardware Configuring firmware is tedious and error prone Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 4 / 11
  • 13. How compatible does hardware need to be? All features previously used need to continue functioning All instructions, MSRs, etc Available features controlled by: CPU family, model and stepping Firmware version and settings Microcode version Xen’s hardware support and administrator choices Typically, “identical” servers are not Different CPUs, especially on RMA’d hardware Configuring firmware is tedious and error prone Must lie to guests (for their own good) Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 4 / 11
  • 14. Controlling a guests view of information HVM guests CPUID instruction traps to hypervisor Xen can control all information seen Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 5 / 11
  • 15. Controlling a guests view of information HVM guests CPUID instruction traps to hypervisor Xen can control all information seen PV guests CPUID instruction doesn’t trap Xen has no direct control Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 5 / 11
  • 16. Controlling a guests view of information HVM guests CPUID instruction traps to hypervisor Xen can control all information seen PV guests CPUID instruction doesn’t trap Xen has no direct control PV Emulated CPUID Software can opt in to Xen’s control Adhoc use in PV guest kernels, but not by userspace Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 5 / 11
  • 17. Controlling a guests view of information HVM guests CPUID instruction traps to hypervisor Xen can control all information seen PV guests CPUID instruction doesn’t trap Xen has no direct control PV Emulated CPUID Software can opt in to Xen’s control Adhoc use in PV guest kernels, but not by userspace CPUID Faulting Non-architectural, but available in Intel IvyBridge and later Causes CPUID to fault with #GP(0) Xen can control all information seen Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 5 / 11
  • 18. Controlling a guests view of information (2) CPUID Masking Non-architectural, “documented” only in whitepapers Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 6 / 11
  • 19. Controlling a guests view of information (2) CPUID Masking Non-architectural, “documented” only in whitepapers AMD (All hardware Xen can run on) Override MSRs Must be careful not to advertise features unsupported in silicon Covers basic and extended feature leaves Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 6 / 11
  • 20. Controlling a guests view of information (2) CPUID Masking Non-architectural, “documented” only in whitepapers AMD (All hardware Xen can run on) Override MSRs Must be careful not to advertise features unsupported in silicon Covers basic and extended feature leaves Intel (only some Nehalem/Westmere processors, SandyBridge) AND mask against the real hardware values Different MSRs on different hardware Covers basic, extended and xsave feature leaves Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 6 / 11
  • 21. Controlling a guests view of information (2) CPUID Masking Non-architectural, “documented” only in whitepapers AMD (All hardware Xen can run on) Override MSRs Must be careful not to advertise features unsupported in silicon Covers basic and extended feature leaves Intel (only some Nehalem/Westmere processors, SandyBridge) AND mask against the real hardware values Different MSRs on different hardware Covers basic, extended and xsave feature leaves Magic CPUID bits APIC and OSXSAVE bits fast forwarded from other state Interaction with masking completely undocumented Behaviour reverse engineered, hopefully right Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 6 / 11
  • 22. Problematic areas to control Guests can probe for some features 1GB Superpage support AES instructions Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 7 / 11
  • 23. Problematic areas to control Guests can probe for some features 1GB Superpage support AES instructions Some features don’t have feature bits AMD’s Long Mode Segment Limit Enable Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 7 / 11
  • 24. Problematic areas to control Guests can probe for some features 1GB Superpage support AES instructions Some features don’t have feature bits AMD’s Long Mode Segment Limit Enable FPU pipeline behaviour exposed directly to guests MXCSR_MASK Intel’s FPDP and FPCSDS Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 7 / 11
  • 25. Problematic areas to control Guests can probe for some features 1GB Superpage support AES instructions Some features don’t have feature bits AMD’s Long Mode Segment Limit Enable FPU pipeline behaviour exposed directly to guests MXCSR_MASK Intel’s FPDP and FPCSDS Some feature bits affect the interpretation of other leaves CMP_LEGACY, HTT and X2APIC affect the topology interpretation Can’t control topology information with masking Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 7 / 11
  • 26. CPUID handling in Xen No real develoment since the uni-vcpu guest days No concept of topology information Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 8 / 11
  • 27. CPUID handling in Xen No real develoment since the uni-vcpu guest days No concept of topology information No auditing of the toolstack-provided information Lots of runtime adjustment to regain plausibility Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 8 / 11
  • 28. CPUID handling in Xen No real develoment since the uni-vcpu guest days No concept of topology information No auditing of the toolstack-provided information Lots of runtime adjustment to regain plausibility Inconsistent whitelist/blacklist approach Different approaches between different leaves Different approaches between different guest types Some information passed straight through from hardware Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 8 / 11
  • 29. CPUID handling in Xen No real develoment since the uni-vcpu guest days No concept of topology information No auditing of the toolstack-provided information Lots of runtime adjustment to regain plausibility Inconsistent whitelist/blacklist approach Different approaches between different leaves Different approaches between different guest types Some information passed straight through from hardware No knowledge of feature dependency Buggy assumptions in guests result in crashes Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 8 / 11
  • 30. CPUID handling in Xen No real develoment since the uni-vcpu guest days No concept of topology information No auditing of the toolstack-provided information Lots of runtime adjustment to regain plausibility Inconsistent whitelist/blacklist approach Different approaches between different leaves Different approaches between different guest types Some information passed straight through from hardware No knowledge of feature dependency Buggy assumptions in guests result in crashes No way for the toolstack to evaluate the hardware capability Feature internals exposed in the ABI, with no API Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 8 / 11
  • 31. CPUID handling in Xen No real develoment since the uni-vcpu guest days No concept of topology information No auditing of the toolstack-provided information Lots of runtime adjustment to regain plausibility Inconsistent whitelist/blacklist approach Different approaches between different leaves Different approaches between different guest types Some information passed straight through from hardware No knowledge of feature dependency Buggy assumptions in guests result in crashes No way for the toolstack to evaluate the hardware capability Feature internals exposed in the ABI, with no API PV dependence on leaked CPUID information Hardware domain for C/P states, MTRRs Control domain for building guests Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 8 / 11
  • 32. CPUID-related improvements in Xen 4.7 Introduce “a featureset” in the API/ABI Keys as specified in architecture manuals Can be treated as opaque by higher level software Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 9 / 11
  • 33. CPUID-related improvements in Xen 4.7 Introduce “a featureset” in the API/ABI Keys as specified in architecture manuals Can be treated as opaque by higher level software At boot, Xen calculates featuresets for itself and the toolstack: raw Features supported by hardware host Features used by Xen (after errata, command line, etc) pv Maximum featureset available for PV guests hvm Maximum featureset available for HVM guests Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 9 / 11
  • 34. CPUID-related improvements in Xen 4.7 Introduce “a featureset” in the API/ABI Keys as specified in architecture manuals Can be treated as opaque by higher level software At boot, Xen calculates featuresets for itself and the toolstack: raw Features supported by hardware host Features used by Xen (after errata, command line, etc) pv Maximum featureset available for PV guests hvm Maximum featureset available for HVM guests Shared Xen/libxc algorithm for feature dependencies Provides consistent logic between Xen and libxc Build-time calculations to avoid complicated runtime logic Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 9 / 11
  • 35. Future work Extend the featureset concept to a full CPUID policy Needs guest topology information Will allow control of MAXPHYSADDR Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 10 / 11
  • 36. Future work Extend the featureset concept to a full CPUID policy Needs guest topology information Will allow control of MAXPHYSADDR Improved hypercalls for policies XEN_DOMCTL_get_cpuid_policy Xen to audit policy plausibility at hypercall time, not runtime Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 10 / 11
  • 37. Future work Extend the featureset concept to a full CPUID policy Needs guest topology information Will allow control of MAXPHYSADDR Improved hypercalls for policies XEN_DOMCTL_get_cpuid_policy Xen to audit policy plausibility at hypercall time, not runtime More migration stream work CPUID policy should be in the migration stream Avoid mistakes when regenerating Can finaly audit RAM/CPU state against reality Allows for a pre-migrate check at the destination Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 10 / 11
  • 38. Future work Extend the featureset concept to a full CPUID policy Needs guest topology information Will allow control of MAXPHYSADDR Improved hypercalls for policies XEN_DOMCTL_get_cpuid_policy Xen to audit policy plausibility at hypercall time, not runtime More migration stream work CPUID policy should be in the migration stream Avoid mistakes when regenerating Can finaly audit RAM/CPU state against reality Allows for a pre-migrate check at the destination MSRs Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 10 / 11
  • 39. CPUID handling for guests Any Questions? Andrew Cooper (Citrix XenServer) CPUID handling for guests Friday 26th August 2016 11 / 11