Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (58 sloc) 1.58 KB
# ##########################################################
# Copyright 2007-2011 VMware, Inc. All rights reserved.
# -- VMware Confidential
# ##########################################################/
string str;
# Pretty-printer for VT exits
string
vt_pretty_print() {
code = VMCS_EXIT_REASON;
sprintf(str, "%3d ", code);
# Exit code 0: software exception
if (code == 0) {
intrInfo = VMCS_EXIT_INTR_INFO;
faultNum = intrInfo & 0xff;
sprintf(str, "%s softint exc %d", str, faultNum);
if (faultNum == 14) {
sprintf(str, "%s #PF @%#llx", str, VMCS_EXIT_QUAL);
}
}
if (code == 1) {
intrInfo = VMCS_EXIT_INTR_INFO;
sprintf(str, "%s hwIRQ %03d", str, intrInfo & 0xff);
}
if (code == 12) {
sprintf(str, "%s HLT", str);
}
if (code == 14) {
sprintf(str, "%s INVLPG @%#llx", str, VMCS_EXIT_QUAL);
}
# Exit code 28: CR
if (code == 28) {
qual = VMCS_EXIT_QUAL;
sprintf(str, "%s CR%1d", str, qual & 0xf);
if (qual & (1 << 4)) {
sprintf(str, "%s WRITE ", str);
} else {
sprintf(str, "%s READ ", str);
}
}
# Exit code 30: PIO instruction
if (code == 30) {
qual = VMCS_EXIT_QUAL;
wasIn = qual & (1 << 3);
port = (qual >> 16) & 0xfff;
if (wasIn) {
sprintf(str, "%s %s", str, "IN ");
} else {
sprintf(str, "%s %s", str, "OUT ");
}
sprintf(str, "%s port %04x", str, port);
}
if (code == 43) {
sprintf(str, "%s TPR", str);
}
return str;
}
# E.g.:
# HV_Exit exits[vt_pretty_print()]++;
Jump to Line
Something went wrong with that request. Please try again.