2 /^int kvm_init\
(/ { anon_inodes =
1 }
4 /return 0;/ && anon_inodes
{
5 print "\tr = kvm_init_anon_inodes();";
7 print "\t\t__free_page(bad_page);";
10 print "\tpreempt_notifier_sys_init();";
11 printf("\tprintk(\"loaded kvm module (%s)\\n\");\n", version
);
15 /^void kvm_exit
/ { anon_inodes_exit =
1 }
17 /\
}/ && anon_inodes_exit
{
18 print "\tkvm_exit_anon_inodes();";
19 print "\tpreempt_notifier_sys_exit();";
24 printf("MODULE_INFO(version, \"%s\");\n", version
)
27 /^static void vmx_load_host_state
/ {
28 vmx_load_host_state =
1
31 /vmcs_readl\
(HOST_GS_BASE\
)/ && vmx_load_host_state
{
32 $
0 =
"\t\twrmsrl(MSR_GS_BASE, gsbase);";
33 vmx_load_host_state =
0
36 /atomic_inc\
(&kvm
->mm
->mm_count\
);/ { $
0 =
"//" $
0 }
39 fcn = gensub
(/,/, "", "g", $
3)
40 $
0 =
"\t.VMA_OPS_FAULT(fault) = VMA_OPS_FAULT_FUNC(" fcn
"),"
43 { sub(/linux\
/mm_types\.h
/, "linux/mm.h") }
48 print "\tspecial_reload_dr7();"
51 /unsigned long flags
;/ && vmx_load_host_state
{
52 print "\tunsigned long gsbase;"
55 /local_irq_save
/ && vmx_load_host_state
{
56 print "\t\tgsbase = vmcs_readl(HOST_GS_BASE);"