Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
paravirt_types.h File Reference
#include <asm/desc_defs.h>
#include <asm/kmap_types.h>
#include <asm/pgtable_types.h>

Go to the source code of this file.

Data Structures

struct  paravirt_callee_save
 
struct  pv_info
 
struct  pv_init_ops
 
struct  pv_lazy_ops
 
struct  pv_time_ops
 
struct  pv_cpu_ops
 
struct  pv_irq_ops
 
struct  pv_apic_ops
 
struct  pv_mmu_ops
 
struct  pv_lock_ops
 
struct  paravirt_patch_template
 
struct  paravirt_patch_site
 

Macros

#define CLBR_NONE   0
 
#define CLBR_EAX   (1 << 0)
 
#define CLBR_ECX   (1 << 1)
 
#define CLBR_EDX   (1 << 2)
 
#define CLBR_EDI   (1 << 3)
 
#define CLBR_RAX   CLBR_EAX
 
#define CLBR_RCX   CLBR_ECX
 
#define CLBR_RDX   CLBR_EDX
 
#define CLBR_RDI   CLBR_EDI
 
#define CLBR_RSI   (1 << 4)
 
#define CLBR_R8   (1 << 5)
 
#define CLBR_R9   (1 << 6)
 
#define CLBR_R10   (1 << 7)
 
#define CLBR_R11   (1 << 8)
 
#define CLBR_ANY   ((1 << 9) - 1)
 
#define CLBR_ARG_REGS
 
#define CLBR_RET_REG   (CLBR_RAX)
 
#define CLBR_SCRATCH   (CLBR_R10 | CLBR_R11)
 
#define CLBR_CALLEE_SAVE   ((CLBR_ARG_REGS | CLBR_SCRATCH) & ~CLBR_RET_REG)
 
#define PARAVIRT_PATCH(x)   (offsetof(struct paravirt_patch_template, x) / sizeof(void *))
 
#define paravirt_type(op)
 
#define paravirt_clobber(clobber)   [paravirt_clobber] "i" (clobber)
 
#define _paravirt_alt(insn_string, type, clobber)
 
#define paravirt_alt(insn_string)   _paravirt_alt(insn_string, "%c[paravirt_typenum]", "%c[paravirt_clobber]")
 
#define DEF_NATIVE(ops, name, code)
 
#define PARAVIRT_CALL   "call *%c[paravirt_opptr];"
 
#define PVOP_VCALL_ARGS
 
#define PVOP_CALL_ARGS   PVOP_VCALL_ARGS
 
#define PVOP_CALL_ARG1(x)   "D" ((unsigned long)(x))
 
#define PVOP_CALL_ARG2(x)   "S" ((unsigned long)(x))
 
#define PVOP_CALL_ARG3(x)   "d" ((unsigned long)(x))
 
#define PVOP_CALL_ARG4(x)   "c" ((unsigned long)(x))
 
#define PVOP_VCALL_CLOBBERS
 
#define PVOP_CALL_CLOBBERS   PVOP_VCALL_CLOBBERS, "=a" (__eax)
 
#define PVOP_VCALLEE_CLOBBERS   "=a" (__eax)
 
#define PVOP_CALLEE_CLOBBERS   PVOP_VCALLEE_CLOBBERS
 
#define EXTRA_CLOBBERS   , "r8", "r9", "r10", "r11"
 
#define VEXTRA_CLOBBERS   , "rax", "r8", "r9", "r10", "r11"
 
#define PVOP_TEST_NULL(op)   ((void)op)
 
#define ____PVOP_CALL(rettype, op, clbr, call_clbr, extra_clbr,pre, post,...)
 
#define __PVOP_CALL(rettype, op, pre, post,...)
 
#define __PVOP_CALLEESAVE(rettype, op, pre, post,...)
 
#define ____PVOP_VCALL(op, clbr, call_clbr, extra_clbr, pre, post,...)
 
#define __PVOP_VCALL(op, pre, post,...)
 
#define __PVOP_VCALLEESAVE(op, pre, post,...)
 
#define PVOP_CALL0(rettype, op)   __PVOP_CALL(rettype, op, "", "")
 
#define PVOP_VCALL0(op)   __PVOP_VCALL(op, "", "")
 
#define PVOP_CALLEE0(rettype, op)   __PVOP_CALLEESAVE(rettype, op, "", "")
 
#define PVOP_VCALLEE0(op)   __PVOP_VCALLEESAVE(op, "", "")
 
#define PVOP_CALL1(rettype, op, arg1)   __PVOP_CALL(rettype, op, "", "", PVOP_CALL_ARG1(arg1))
 
#define PVOP_VCALL1(op, arg1)   __PVOP_VCALL(op, "", "", PVOP_CALL_ARG1(arg1))
 
#define PVOP_CALLEE1(rettype, op, arg1)   __PVOP_CALLEESAVE(rettype, op, "", "", PVOP_CALL_ARG1(arg1))
 
#define PVOP_VCALLEE1(op, arg1)   __PVOP_VCALLEESAVE(op, "", "", PVOP_CALL_ARG1(arg1))
 
#define PVOP_CALL2(rettype, op, arg1, arg2)
 
#define PVOP_VCALL2(op, arg1, arg2)
 
#define PVOP_CALLEE2(rettype, op, arg1, arg2)
 
#define PVOP_VCALLEE2(op, arg1, arg2)
 
#define PVOP_CALL3(rettype, op, arg1, arg2, arg3)
 
#define PVOP_VCALL3(op, arg1, arg2, arg3)
 
#define PVOP_CALL4(rettype, op, arg1, arg2, arg3, arg4)
 
#define PVOP_VCALL4(op, arg1, arg2, arg3, arg4)
 
#define paravirt_nop   ((void *)_paravirt_nop)
 

Enumerations

enum  paravirt_lazy_mode {
  PARAVIRT_LAZY_NONE, PARAVIRT_LAZY_MMU, PARAVIRT_LAZY_CPU, PARAVIRT_LAZY_NONE,
  PARAVIRT_LAZY_MMU, PARAVIRT_LAZY_CPU
}
 

Functions

unsigned paravirt_patch_nop (void)
 
unsigned paravirt_patch_ident_32 (void *insnbuf, unsigned len)
 
unsigned paravirt_patch_ident_64 (void *insnbuf, unsigned len)
 
unsigned paravirt_patch_ignore (unsigned len)
 
unsigned paravirt_patch_call (void *insnbuf, const void *target, u16 tgt_clobbers, unsigned long addr, u16 site_clobbers, unsigned len)
 
unsigned paravirt_patch_jmp (void *insnbuf, const void *target, unsigned long addr, unsigned len)
 
unsigned paravirt_patch_default (u8 type, u16 clobbers, void *insnbuf, unsigned long addr, unsigned len)
 
unsigned paravirt_patch_insns (void *insnbuf, unsigned len, const char *start, const char *end)
 
unsigned native_patch (u8 type, u16 clobbers, void *ibuf, unsigned long addr, unsigned len)
 
int paravirt_disable_iospace (void)
 
enum paravirt_lazy_mode paravirt_get_lazy_mode (void)
 
void paravirt_start_context_switch (struct task_struct *prev)
 
void paravirt_end_context_switch (struct task_struct *next)
 
void paravirt_enter_lazy_mmu (void)
 
void paravirt_leave_lazy_mmu (void)
 
void _paravirt_nop (void)
 
u32 _paravirt_ident_32 (u32)
 
u64 _paravirt_ident_64 (u64)
 

Variables

struct pv_info pv_info
 
struct pv_init_ops pv_init_ops
 
struct pv_time_ops pv_time_ops
 
struct pv_cpu_ops pv_cpu_ops
 
struct pv_irq_ops pv_irq_ops
 
struct pv_apic_ops pv_apic_ops
 
struct pv_mmu_ops pv_mmu_ops
 
struct pv_lock_ops pv_lock_ops
 
struct paravirt_patch_site __parainstructions []
 
struct paravirt_patch_site __parainstructions_end []
 

Macro Definition Documentation

#define ____PVOP_CALL (   rettype,
  op,
  clbr,
  call_clbr,
  extra_clbr,
  pre,
  post,
  ... 
)
Value:
({ \
rettype __ret; \
PVOP_CALL_ARGS; \
PVOP_TEST_NULL(op); \
/* This is 32-bit specific, but is okay in 64-bit */ \
/* since this condition will never hold */ \
if (sizeof(rettype) > sizeof(unsigned long)) { \
asm volatile(pre \
post \
: call_clbr \
paravirt_clobber(clbr), \
##__VA_ARGS__ \
: "memory", "cc" extra_clbr); \
__ret = (rettype)((((u64)__edx) << 32) | __eax); \
} else { \
asm volatile(pre \
paravirt_alt(PARAVIRT_CALL) \
post \
: call_clbr \
: paravirt_type(op), \
paravirt_clobber(clbr), \
##__VA_ARGS__ \
: "memory", "cc" extra_clbr); \
__ret = (rettype)__eax; \
} \
__ret; \
})

Definition at line 534 of file paravirt_types.h.

#define ____PVOP_VCALL (   op,
  clbr,
  call_clbr,
  extra_clbr,
  pre,
  post,
  ... 
)
Value:
({ \
PVOP_VCALL_ARGS; \
PVOP_TEST_NULL(op); \
asm volatile(pre \
post \
: call_clbr \
paravirt_clobber(clbr), \
##__VA_ARGS__ \
: "memory", "cc" extra_clbr); \
})

Definition at line 576 of file paravirt_types.h.

#define __PVOP_CALL (   rettype,
  op,
  pre,
  post,
  ... 
)
Value:
EXTRA_CLOBBERS, pre, post, ##__VA_ARGS__)

Definition at line 566 of file paravirt_types.h.

#define __PVOP_CALLEESAVE (   rettype,
  op,
  pre,
  post,
  ... 
)
Value:
____PVOP_CALL(rettype, op.func, CLBR_RET_REG, \
pre, post, ##__VA_ARGS__)

Definition at line 570 of file paravirt_types.h.

#define __PVOP_VCALL (   op,
  pre,
  post,
  ... 
)
Value:

Definition at line 590 of file paravirt_types.h.

#define __PVOP_VCALLEESAVE (   op,
  pre,
  post,
  ... 
)
Value:
pre, post, ##__VA_ARGS__)

Definition at line 595 of file paravirt_types.h.

#define _paravirt_alt (   insn_string,
  type,
  clobber 
)
Value:
"771:\n\t" insn_string "\n" "772:\n" \
".pushsection .parainstructions,\"a\"\n" \
_ASM_ALIGN "\n" \
_ASM_PTR " 771b\n" \
" .byte " type "\n" \
" .byte 772b-771b\n" \
" .short " clobber "\n" \
".popsection\n"

Definition at line 373 of file paravirt_types.h.

#define CLBR_ANY   ((1 << 9) - 1)

Definition at line 29 of file paravirt_types.h.

#define CLBR_ARG_REGS
Value:
CLBR_RCX | CLBR_R8 | CLBR_R9)

Definition at line 31 of file paravirt_types.h.

#define CLBR_CALLEE_SAVE   ((CLBR_ARG_REGS | CLBR_SCRATCH) & ~CLBR_RET_REG)

Definition at line 38 of file paravirt_types.h.

#define CLBR_EAX   (1 << 0)

Definition at line 6 of file paravirt_types.h.

#define CLBR_ECX   (1 << 1)

Definition at line 7 of file paravirt_types.h.

#define CLBR_EDI   (1 << 3)

Definition at line 9 of file paravirt_types.h.

#define CLBR_EDX   (1 << 2)

Definition at line 8 of file paravirt_types.h.

#define CLBR_NONE   0

Definition at line 5 of file paravirt_types.h.

#define CLBR_R10   (1 << 7)

Definition at line 26 of file paravirt_types.h.

#define CLBR_R11   (1 << 8)

Definition at line 27 of file paravirt_types.h.

#define CLBR_R8   (1 << 5)

Definition at line 24 of file paravirt_types.h.

#define CLBR_R9   (1 << 6)

Definition at line 25 of file paravirt_types.h.

#define CLBR_RAX   CLBR_EAX

Definition at line 19 of file paravirt_types.h.

#define CLBR_RCX   CLBR_ECX

Definition at line 20 of file paravirt_types.h.

#define CLBR_RDI   CLBR_EDI

Definition at line 22 of file paravirt_types.h.

#define CLBR_RDX   CLBR_EDX

Definition at line 21 of file paravirt_types.h.

#define CLBR_RET_REG   (CLBR_RAX)

Definition at line 33 of file paravirt_types.h.

#define CLBR_RSI   (1 << 4)

Definition at line 23 of file paravirt_types.h.

#define CLBR_SCRATCH   (CLBR_R10 | CLBR_R11)

Definition at line 34 of file paravirt_types.h.

#define DEF_NATIVE (   ops,
  name,
  code 
)
Value:
extern const char start_##ops##_##name[], end_##ops##_##name[]; \
asm("start_" #ops "_" #name ": " code "; end_" #ops "_" #name ":")

Definition at line 388 of file paravirt_types.h.

#define EXTRA_CLOBBERS   , "r8", "r9", "r10", "r11"

Definition at line 524 of file paravirt_types.h.

#define paravirt_alt (   insn_string)    _paravirt_alt(insn_string, "%c[paravirt_typenum]", "%c[paravirt_clobber]")

Definition at line 384 of file paravirt_types.h.

#define PARAVIRT_CALL   "call *%c[paravirt_opptr];"

Definition at line 419 of file paravirt_types.h.

#define paravirt_clobber (   clobber)    [paravirt_clobber] "i" (clobber)

Definition at line 366 of file paravirt_types.h.

#define paravirt_nop   ((void *)_paravirt_nop)

Definition at line 687 of file paravirt_types.h.

#define PARAVIRT_PATCH (   x)    (offsetof(struct paravirt_patch_template, x) / sizeof(void *))

Definition at line 360 of file paravirt_types.h.

#define paravirt_type (   op)
Value:
[paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \
[paravirt_opptr] "i" (&(op))

Definition at line 363 of file paravirt_types.h.

#define PVOP_CALL0 (   rettype,
  op 
)    __PVOP_CALL(rettype, op, "", "")

Definition at line 602 of file paravirt_types.h.

#define PVOP_CALL1 (   rettype,
  op,
  arg1 
)    __PVOP_CALL(rettype, op, "", "", PVOP_CALL_ARG1(arg1))

Definition at line 613 of file paravirt_types.h.

#define PVOP_CALL2 (   rettype,
  op,
  arg1,
  arg2 
)
Value:

Definition at line 624 of file paravirt_types.h.

#define PVOP_CALL3 (   rettype,
  op,
  arg1,
  arg2,
  arg3 
)
Value:

Definition at line 639 of file paravirt_types.h.

#define PVOP_CALL4 (   rettype,
  op,
  arg1,
  arg2,
  arg3,
  arg4 
)
Value:

Definition at line 659 of file paravirt_types.h.

#define PVOP_CALL_ARG1 (   x)    "D" ((unsigned long)(x))

Definition at line 510 of file paravirt_types.h.

#define PVOP_CALL_ARG2 (   x)    "S" ((unsigned long)(x))

Definition at line 511 of file paravirt_types.h.

#define PVOP_CALL_ARG3 (   x)    "d" ((unsigned long)(x))

Definition at line 512 of file paravirt_types.h.

#define PVOP_CALL_ARG4 (   x)    "c" ((unsigned long)(x))

Definition at line 513 of file paravirt_types.h.

#define PVOP_CALL_ARGS   PVOP_VCALL_ARGS

Definition at line 508 of file paravirt_types.h.

#define PVOP_CALL_CLOBBERS   PVOP_VCALL_CLOBBERS, "=a" (__eax)

Definition at line 518 of file paravirt_types.h.

#define PVOP_CALLEE0 (   rettype,
  op 
)    __PVOP_CALLEESAVE(rettype, op, "", "")

Definition at line 607 of file paravirt_types.h.

#define PVOP_CALLEE1 (   rettype,
  op,
  arg1 
)    __PVOP_CALLEESAVE(rettype, op, "", "", PVOP_CALL_ARG1(arg1))

Definition at line 618 of file paravirt_types.h.

#define PVOP_CALLEE2 (   rettype,
  op,
  arg1,
  arg2 
)
Value:

Definition at line 631 of file paravirt_types.h.

#define PVOP_CALLEE_CLOBBERS   PVOP_VCALLEE_CLOBBERS

Definition at line 522 of file paravirt_types.h.

#define PVOP_TEST_NULL (   op)    ((void)op)

Definition at line 531 of file paravirt_types.h.

#define PVOP_VCALL0 (   op)    __PVOP_VCALL(op, "", "")

Definition at line 604 of file paravirt_types.h.

#define PVOP_VCALL1 (   op,
  arg1 
)    __PVOP_VCALL(op, "", "", PVOP_CALL_ARG1(arg1))

Definition at line 615 of file paravirt_types.h.

#define PVOP_VCALL2 (   op,
  arg1,
  arg2 
)
Value:

Definition at line 627 of file paravirt_types.h.

#define PVOP_VCALL3 (   op,
  arg1,
  arg2,
  arg3 
)
Value:

Definition at line 642 of file paravirt_types.h.

#define PVOP_VCALL4 (   op,
  arg1,
  arg2,
  arg3,
  arg4 
)
#define PVOP_VCALL_ARGS
Value:
unsigned long __edi = __edi, __esi = __esi, \
__edx = __edx, __ecx = __ecx, __eax = __eax

Definition at line 505 of file paravirt_types.h.

#define PVOP_VCALL_CLOBBERS
Value:
"=D" (__edi), \
"=S" (__esi), "=d" (__edx), \
"=c" (__ecx)

Definition at line 515 of file paravirt_types.h.

#define PVOP_VCALLEE0 (   op)    __PVOP_VCALLEESAVE(op, "", "")

Definition at line 609 of file paravirt_types.h.

#define PVOP_VCALLEE1 (   op,
  arg1 
)    __PVOP_VCALLEESAVE(op, "", "", PVOP_CALL_ARG1(arg1))

Definition at line 620 of file paravirt_types.h.

#define PVOP_VCALLEE2 (   op,
  arg1,
  arg2 
)
Value:

Definition at line 634 of file paravirt_types.h.

#define PVOP_VCALLEE_CLOBBERS   "=a" (__eax)

Definition at line 521 of file paravirt_types.h.

#define VEXTRA_CLOBBERS   , "rax", "r8", "r9", "r10", "r11"

Definition at line 525 of file paravirt_types.h.

Enumeration Type Documentation

Enumerator:
PARAVIRT_LAZY_NONE 
PARAVIRT_LAZY_MMU 
PARAVIRT_LAZY_CPU 
PARAVIRT_LAZY_NONE 
PARAVIRT_LAZY_MMU 
PARAVIRT_LAZY_CPU 

Definition at line 670 of file paravirt_types.h.

Function Documentation

u32 _paravirt_ident_32 ( u32  )

Definition at line 49 of file paravirt.c.

u64 _paravirt_ident_64 ( u64  )

Definition at line 54 of file paravirt.c.

void _paravirt_nop ( void  )

Definition at line 44 of file paravirt.c.

unsigned native_patch ( u8  type,
u16  clobbers,
void ibuf,
unsigned long  addr,
unsigned  len 
)

Definition at line 27 of file paravirt_patch_32.c.

int paravirt_disable_iospace ( void  )

Definition at line 235 of file paravirt.c.

void paravirt_end_context_switch ( struct task_struct next)

Definition at line 277 of file paravirt.c.

void paravirt_enter_lazy_mmu ( void  )

Definition at line 256 of file paravirt.c.

enum paravirt_lazy_mode paravirt_get_lazy_mode ( void  )

Definition at line 287 of file paravirt.c.

void paravirt_leave_lazy_mmu ( void  )

Definition at line 261 of file paravirt.c.

unsigned paravirt_patch_call ( void insnbuf,
const void target,
u16  tgt_clobbers,
unsigned long  addr,
u16  site_clobbers,
unsigned  len 
)

Definition at line 88 of file paravirt.c.

unsigned paravirt_patch_default ( u8  type,
u16  clobbers,
void insnbuf,
unsigned long  addr,
unsigned  len 
)

Definition at line 141 of file paravirt.c.

unsigned paravirt_patch_ident_32 ( void insnbuf,
unsigned  len 
)

Definition at line 15 of file paravirt_patch_32.c.

unsigned paravirt_patch_ident_64 ( void insnbuf,
unsigned  len 
)

Definition at line 21 of file paravirt_patch_32.c.

unsigned paravirt_patch_ignore ( unsigned  len)

Definition at line 78 of file paravirt.c.

unsigned paravirt_patch_insns ( void insnbuf,
unsigned  len,
const char start,
const char end 
)

Definition at line 175 of file paravirt.c.

unsigned paravirt_patch_jmp ( void insnbuf,
const void target,
unsigned long  addr,
unsigned  len 
)

Definition at line 108 of file paravirt.c.

unsigned paravirt_patch_nop ( void  )

Definition at line 73 of file paravirt.c.

void paravirt_start_context_switch ( struct task_struct prev)

Definition at line 266 of file paravirt.c.

Variable Documentation

struct paravirt_patch_site __parainstructions[]
struct paravirt_patch_site __parainstructions_end[]

Definition at line 398 of file paravirt.c.

Definition at line 555 of file paravirt.c.

Definition at line 38 of file paravirt.c.

Definition at line 52 of file paravirt.c.

Definition at line 623 of file paravirt.c.

Definition at line 16 of file paravirt-spinlocks.c.

Definition at line 412 of file paravirt.c.

Definition at line 646 of file paravirt.c.