Xen Test Framework
Functions
lib.h File Reference
#include <xtf/types.h>
#include <xtf/extable.h>
#include <xen/arch-x86/xen.h>
#include <arch/desc.h>
#include <arch/msr.h>
+ Include dependency graph for lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void cpuid (uint32_t leaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
 
static uint32_t cpuid_eax (uint32_t leaf)
 
static uint32_t cpuid_ebx (uint32_t leaf)
 
static uint32_t cpuid_ecx (uint32_t leaf)
 
static uint32_t cpuid_edx (uint32_t leaf)
 
static void pv_cpuid (uint32_t leaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
 
static void cpuid_count (uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
 
static void pv_cpuid_count (uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
 
static uint8_t inb (uint16_t port)
 
static uint16_t inw (uint16_t port)
 
static uint32_t inl (uint16_t port)
 
static void outb (uint8_t val, uint16_t port)
 
static void outw (uint16_t val, uint16_t port)
 
static void outl (uint32_t val, uint16_t port)
 
static unsigned int read_cs (void)
 
static unsigned int read_ds (void)
 
static unsigned int read_es (void)
 
static unsigned int read_fs (void)
 
static unsigned int read_gs (void)
 
static unsigned int read_ss (void)
 
static void write_cs (unsigned long cs)
 
static void write_ds (unsigned int ds)
 
static void write_es (unsigned int es)
 
static void write_fs (unsigned int fs)
 
static void write_gs (unsigned int gs)
 
static void write_ss (unsigned int ss)
 
static unsigned long read_flags (void)
 
static void write_flags (unsigned long flags)
 
static unsigned long read_cr0 (void)
 
static unsigned long read_cr2 (void)
 
static unsigned long read_cr3 (void)
 
static unsigned long read_cr4 (void)
 
static unsigned long read_cr8 (void)
 
static void write_cr0 (unsigned long cr0)
 
static void write_cr2 (unsigned long cr2)
 
static void write_cr3 (unsigned long cr3)
 
static void write_cr4 (unsigned long cr4)
 
static bool write_cr4_safe (unsigned long cr4)
 
static void write_cr8 (unsigned long cr8)
 
static uint32_t read_mxcsr (void)
 
static void write_mxcsr (uint32_t mxcsr)
 
static void invlpg (const void *va)
 
static void lgdt (const desc_ptr *gdtr)
 
static void lidt (const desc_ptr *idtr)
 
static void lldt (unsigned int sel)
 
static void ltr (unsigned int sel)
 
static void sgdt (desc_ptr *gdtr)
 
static void sidt (desc_ptr *idtr)
 
static unsigned int sldt (void)
 
static unsigned int str (void)
 
static uint64_t xgetbv (uint32_t index)
 
static void xsetbv (uint32_t index, uint64_t value)
 
static uint64_t read_xcr0 (void)
 
static void write_xcr0 (uint64_t xcr0)
 
static void clflush (const void *ptr)
 
static void flush_tlb (void)
 

Function Documentation

◆ cpuid()

static void cpuid ( uint32_t  leaf,
uint32_t eax,
uint32_t ebx,
uint32_t ecx,
uint32_t edx 
)
inlinestatic

Definition at line 10 of file lib.h.

+ Here is the caller graph for this function:

◆ cpuid_eax()

static uint32_t cpuid_eax ( uint32_t  leaf)
inlinestatic

Definition at line 19 of file lib.h.

+ Here is the call graph for this function:

◆ cpuid_ebx()

static uint32_t cpuid_ebx ( uint32_t  leaf)
inlinestatic

Definition at line 28 of file lib.h.

+ Here is the call graph for this function:

◆ cpuid_ecx()

static uint32_t cpuid_ecx ( uint32_t  leaf)
inlinestatic

Definition at line 37 of file lib.h.

+ Here is the call graph for this function:

◆ cpuid_edx()

static uint32_t cpuid_edx ( uint32_t  leaf)
inlinestatic

Definition at line 46 of file lib.h.

+ Here is the call graph for this function:

◆ pv_cpuid()

static void pv_cpuid ( uint32_t  leaf,
uint32_t eax,
uint32_t ebx,
uint32_t ecx,
uint32_t edx 
)
inlinestatic

Definition at line 55 of file lib.h.

◆ cpuid_count()

static void cpuid_count ( uint32_t  leaf,
uint32_t  subleaf,
uint32_t eax,
uint32_t ebx,
uint32_t ecx,
uint32_t edx 
)
inlinestatic

Definition at line 64 of file lib.h.

+ Here is the caller graph for this function:

◆ pv_cpuid_count()

static void pv_cpuid_count ( uint32_t  leaf,
uint32_t  subleaf,
uint32_t eax,
uint32_t ebx,
uint32_t ecx,
uint32_t edx 
)
inlinestatic

Definition at line 73 of file lib.h.

+ Here is the caller graph for this function:

◆ inb()

static uint8_t inb ( uint16_t  port)
inlinestatic

Definition at line 82 of file lib.h.

◆ inw()

static uint16_t inw ( uint16_t  port)
inlinestatic

Definition at line 91 of file lib.h.

◆ inl()

static uint32_t inl ( uint16_t  port)
inlinestatic

Definition at line 100 of file lib.h.

◆ outb()

static void outb ( uint8_t  val,
uint16_t  port 
)
inlinestatic

Definition at line 109 of file lib.h.

◆ outw()

static void outw ( uint16_t  val,
uint16_t  port 
)
inlinestatic

Definition at line 114 of file lib.h.

◆ outl()

static void outl ( uint32_t  val,
uint16_t  port 
)
inlinestatic

Definition at line 119 of file lib.h.

◆ read_cs()

static unsigned int read_cs ( void  )
inlinestatic

Definition at line 124 of file lib.h.

+ Here is the caller graph for this function:

◆ read_ds()

static unsigned int read_ds ( void  )
inlinestatic

Definition at line 133 of file lib.h.

◆ read_es()

static unsigned int read_es ( void  )
inlinestatic

Definition at line 142 of file lib.h.

◆ read_fs()

static unsigned int read_fs ( void  )
inlinestatic

Definition at line 151 of file lib.h.

◆ read_gs()

static unsigned int read_gs ( void  )
inlinestatic

Definition at line 160 of file lib.h.

◆ read_ss()

static unsigned int read_ss ( void  )
inlinestatic

Definition at line 169 of file lib.h.

+ Here is the caller graph for this function:

◆ write_cs()

static void write_cs ( unsigned long  cs)
inlinestatic

Definition at line 178 of file lib.h.

+ Here is the caller graph for this function:

◆ write_ds()

static void write_ds ( unsigned int  ds)
inlinestatic

Definition at line 186 of file lib.h.

+ Here is the caller graph for this function:

◆ write_es()

static void write_es ( unsigned int  es)
inlinestatic

Definition at line 191 of file lib.h.

+ Here is the caller graph for this function:

◆ write_fs()

static void write_fs ( unsigned int  fs)
inlinestatic

Definition at line 196 of file lib.h.

+ Here is the caller graph for this function:

◆ write_gs()

static void write_gs ( unsigned int  gs)
inlinestatic

Definition at line 201 of file lib.h.

+ Here is the caller graph for this function:

◆ write_ss()

static void write_ss ( unsigned int  ss)
inlinestatic

Definition at line 206 of file lib.h.

+ Here is the caller graph for this function:

◆ read_flags()

static unsigned long read_flags ( void  )
inlinestatic

Definition at line 211 of file lib.h.

+ Here is the caller graph for this function:

◆ write_flags()

static void write_flags ( unsigned long  flags)
inlinestatic

Definition at line 220 of file lib.h.

+ Here is the caller graph for this function:

◆ read_cr0()

static unsigned long read_cr0 ( void  )
inlinestatic

Definition at line 225 of file lib.h.

+ Here is the caller graph for this function:

◆ read_cr2()

static unsigned long read_cr2 ( void  )
inlinestatic

Definition at line 234 of file lib.h.

+ Here is the caller graph for this function:

◆ read_cr3()

static unsigned long read_cr3 ( void  )
inlinestatic

Definition at line 243 of file lib.h.

+ Here is the caller graph for this function:

◆ read_cr4()

static unsigned long read_cr4 ( void  )
inlinestatic

Definition at line 252 of file lib.h.

+ Here is the caller graph for this function:

◆ read_cr8()

static unsigned long read_cr8 ( void  )
inlinestatic

Definition at line 261 of file lib.h.

◆ write_cr0()

static void write_cr0 ( unsigned long  cr0)
inlinestatic

Definition at line 270 of file lib.h.

+ Here is the caller graph for this function:

◆ write_cr2()

static void write_cr2 ( unsigned long  cr2)
inlinestatic

Definition at line 275 of file lib.h.

◆ write_cr3()

static void write_cr3 ( unsigned long  cr3)
inlinestatic

Definition at line 280 of file lib.h.

+ Here is the caller graph for this function:

◆ write_cr4()

static void write_cr4 ( unsigned long  cr4)
inlinestatic

Definition at line 285 of file lib.h.

+ Here is the caller graph for this function:

◆ write_cr4_safe()

static bool write_cr4_safe ( unsigned long  cr4)
inlinestatic

Definition at line 290 of file lib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_cr8()

static void write_cr8 ( unsigned long  cr8)
inlinestatic

Definition at line 303 of file lib.h.

◆ read_mxcsr()

static uint32_t read_mxcsr ( void  )
inlinestatic

Definition at line 308 of file lib.h.

+ Here is the caller graph for this function:

◆ write_mxcsr()

static void write_mxcsr ( uint32_t  mxcsr)
inlinestatic

Definition at line 317 of file lib.h.

+ Here is the caller graph for this function:

◆ invlpg()

static void invlpg ( const void *  va)
inlinestatic

Definition at line 322 of file lib.h.

+ Here is the caller graph for this function:

◆ lgdt()

static void lgdt ( const desc_ptr *  gdtr)
inlinestatic

Definition at line 327 of file lib.h.

◆ lidt()

static void lidt ( const desc_ptr *  idtr)
inlinestatic

Definition at line 332 of file lib.h.

+ Here is the caller graph for this function:

◆ lldt()

static void lldt ( unsigned int  sel)
inlinestatic

Definition at line 337 of file lib.h.

+ Here is the caller graph for this function:

◆ ltr()

static void ltr ( unsigned int  sel)
inlinestatic

Definition at line 342 of file lib.h.

+ Here is the caller graph for this function:

◆ sgdt()

static void sgdt ( desc_ptr *  gdtr)
inlinestatic

Definition at line 347 of file lib.h.

+ Here is the caller graph for this function:

◆ sidt()

static void sidt ( desc_ptr *  idtr)
inlinestatic

Definition at line 352 of file lib.h.

+ Here is the caller graph for this function:

◆ sldt()

static unsigned int sldt ( void  )
inlinestatic

Definition at line 357 of file lib.h.

◆ str()

static unsigned int str ( void  )
inlinestatic

Definition at line 366 of file lib.h.

+ Here is the caller graph for this function:

◆ xgetbv()

static uint64_t xgetbv ( uint32_t  index)
inlinestatic

Definition at line 375 of file lib.h.

+ Here is the caller graph for this function:

◆ xsetbv()

static void xsetbv ( uint32_t  index,
uint64_t  value 
)
inlinestatic

Definition at line 385 of file lib.h.

+ Here is the caller graph for this function:

◆ read_xcr0()

static uint64_t read_xcr0 ( void  )
inlinestatic

Definition at line 392 of file lib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_xcr0()

static void write_xcr0 ( uint64_t  xcr0)
inlinestatic

Definition at line 397 of file lib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clflush()

static void clflush ( const void *  ptr)
inlinestatic

Definition at line 402 of file lib.h.

+ Here is the caller graph for this function:

◆ flush_tlb()

static void flush_tlb ( void  )
inlinestatic

Definition at line 407 of file lib.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: