diff options
author | Joe Perches <joe@perches.com> | 2011-04-25 01:00:50 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:40:00 -0400 |
commit | ae8cc059550b2c2ec7a5e9650bb1be7b988a1208 (patch) | |
tree | 6f78e28c0c886bf7a5b36a805fc79f2bc642d824 /arch/x86/kvm/svm.c | |
parent | 8f74d8e16812d63639871b4e56409b08bdcb66fc (diff) |
KVM: SVM: Make dump_vmcb static, reduce text
dump_vmcb isn't used outside this module, make it static.
Shrink text and object by ~1% by standardizing formats.
$ size arch/x86/kvm/svm.o*
text data bss dec hex filename
52910 580 10072 63562 f84a arch/x86/kvm/svm.o.new
53563 580 10072 64215 fad7 arch/x86/kvm/svm.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 176 |
1 files changed, 94 insertions, 82 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 9cff0368e1fc..506e4fe23adc 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3191,97 +3191,109 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm) = { | |||
3191 | [SVM_EXIT_NPF] = pf_interception, | 3191 | [SVM_EXIT_NPF] = pf_interception, |
3192 | }; | 3192 | }; |
3193 | 3193 | ||
3194 | void dump_vmcb(struct kvm_vcpu *vcpu) | 3194 | static void dump_vmcb(struct kvm_vcpu *vcpu) |
3195 | { | 3195 | { |
3196 | struct vcpu_svm *svm = to_svm(vcpu); | 3196 | struct vcpu_svm *svm = to_svm(vcpu); |
3197 | struct vmcb_control_area *control = &svm->vmcb->control; | 3197 | struct vmcb_control_area *control = &svm->vmcb->control; |
3198 | struct vmcb_save_area *save = &svm->vmcb->save; | 3198 | struct vmcb_save_area *save = &svm->vmcb->save; |
3199 | 3199 | ||
3200 | pr_err("VMCB Control Area:\n"); | 3200 | pr_err("VMCB Control Area:\n"); |
3201 | pr_err("cr_read: %04x\n", control->intercept_cr & 0xffff); | 3201 | pr_err("%-20s%04x\n", "cr_read:", control->intercept_cr & 0xffff); |
3202 | pr_err("cr_write: %04x\n", control->intercept_cr >> 16); | 3202 | pr_err("%-20s%04x\n", "cr_write:", control->intercept_cr >> 16); |
3203 | pr_err("dr_read: %04x\n", control->intercept_dr & 0xffff); | 3203 | pr_err("%-20s%04x\n", "dr_read:", control->intercept_dr & 0xffff); |
3204 | pr_err("dr_write: %04x\n", control->intercept_dr >> 16); | 3204 | pr_err("%-20s%04x\n", "dr_write:", control->intercept_dr >> 16); |
3205 | pr_err("exceptions: %08x\n", control->intercept_exceptions); | 3205 | pr_err("%-20s%08x\n", "exceptions:", control->intercept_exceptions); |
3206 | pr_err("intercepts: %016llx\n", control->intercept); | 3206 | pr_err("%-20s%016llx\n", "intercepts:", control->intercept); |
3207 | pr_err("pause filter count: %d\n", control->pause_filter_count); | 3207 | pr_err("%-20s%d\n", "pause filter count:", control->pause_filter_count); |
3208 | pr_err("iopm_base_pa: %016llx\n", control->iopm_base_pa); | 3208 | pr_err("%-20s%016llx\n", "iopm_base_pa:", control->iopm_base_pa); |
3209 | pr_err("msrpm_base_pa: %016llx\n", control->msrpm_base_pa); | 3209 | pr_err("%-20s%016llx\n", "msrpm_base_pa:", control->msrpm_base_pa); |
3210 | pr_err("tsc_offset: %016llx\n", control->tsc_offset); | 3210 | pr_err("%-20s%016llx\n", "tsc_offset:", control->tsc_offset); |
3211 | pr_err("asid: %d\n", control->asid); | 3211 | pr_err("%-20s%d\n", "asid:", control->asid); |
3212 | pr_err("tlb_ctl: %d\n", control->tlb_ctl); | 3212 | pr_err("%-20s%d\n", "tlb_ctl:", control->tlb_ctl); |
3213 | pr_err("int_ctl: %08x\n", control->int_ctl); | 3213 | pr_err("%-20s%08x\n", "int_ctl:", control->int_ctl); |
3214 | pr_err("int_vector: %08x\n", control->int_vector); | 3214 | pr_err("%-20s%08x\n", "int_vector:", control->int_vector); |
3215 | pr_err("int_state: %08x\n", control->int_state); | 3215 | pr_err("%-20s%08x\n", "int_state:", control->int_state); |
3216 | pr_err("exit_code: %08x\n", control->exit_code); | 3216 | pr_err("%-20s%08x\n", "exit_code:", control->exit_code); |
3217 | pr_err("exit_info1: %016llx\n", control->exit_info_1); | 3217 | pr_err("%-20s%016llx\n", "exit_info1:", control->exit_info_1); |
3218 | pr_err("exit_info2: %016llx\n", control->exit_info_2); | 3218 | pr_err("%-20s%016llx\n", "exit_info2:", control->exit_info_2); |
3219 | pr_err("exit_int_info: %08x\n", control->exit_int_info); | 3219 | pr_err("%-20s%08x\n", "exit_int_info:", control->exit_int_info); |
3220 | pr_err("exit_int_info_err: %08x\n", control->exit_int_info_err); | 3220 | pr_err("%-20s%08x\n", "exit_int_info_err:", control->exit_int_info_err); |
3221 | pr_err("nested_ctl: %lld\n", control->nested_ctl); | 3221 | pr_err("%-20s%lld\n", "nested_ctl:", control->nested_ctl); |
3222 | pr_err("nested_cr3: %016llx\n", control->nested_cr3); | 3222 | pr_err("%-20s%016llx\n", "nested_cr3:", control->nested_cr3); |
3223 | pr_err("event_inj: %08x\n", control->event_inj); | 3223 | pr_err("%-20s%08x\n", "event_inj:", control->event_inj); |
3224 | pr_err("event_inj_err: %08x\n", control->event_inj_err); | 3224 | pr_err("%-20s%08x\n", "event_inj_err:", control->event_inj_err); |
3225 | pr_err("lbr_ctl: %lld\n", control->lbr_ctl); | 3225 | pr_err("%-20s%lld\n", "lbr_ctl:", control->lbr_ctl); |
3226 | pr_err("next_rip: %016llx\n", control->next_rip); | 3226 | pr_err("%-20s%016llx\n", "next_rip:", control->next_rip); |
3227 | pr_err("VMCB State Save Area:\n"); | 3227 | pr_err("VMCB State Save Area:\n"); |
3228 | pr_err("es: s: %04x a: %04x l: %08x b: %016llx\n", | 3228 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3229 | save->es.selector, save->es.attrib, | 3229 | "es:", |
3230 | save->es.limit, save->es.base); | 3230 | save->es.selector, save->es.attrib, |
3231 | pr_err("cs: s: %04x a: %04x l: %08x b: %016llx\n", | 3231 | save->es.limit, save->es.base); |
3232 | save->cs.selector, save->cs.attrib, | 3232 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3233 | save->cs.limit, save->cs.base); | 3233 | "cs:", |
3234 | pr_err("ss: s: %04x a: %04x l: %08x b: %016llx\n", | 3234 | save->cs.selector, save->cs.attrib, |
3235 | save->ss.selector, save->ss.attrib, | 3235 | save->cs.limit, save->cs.base); |
3236 | save->ss.limit, save->ss.base); | 3236 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3237 | pr_err("ds: s: %04x a: %04x l: %08x b: %016llx\n", | 3237 | "ss:", |
3238 | save->ds.selector, save->ds.attrib, | 3238 | save->ss.selector, save->ss.attrib, |
3239 | save->ds.limit, save->ds.base); | 3239 | save->ss.limit, save->ss.base); |
3240 | pr_err("fs: s: %04x a: %04x l: %08x b: %016llx\n", | 3240 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3241 | save->fs.selector, save->fs.attrib, | 3241 | "ds:", |
3242 | save->fs.limit, save->fs.base); | 3242 | save->ds.selector, save->ds.attrib, |
3243 | pr_err("gs: s: %04x a: %04x l: %08x b: %016llx\n", | 3243 | save->ds.limit, save->ds.base); |
3244 | save->gs.selector, save->gs.attrib, | 3244 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3245 | save->gs.limit, save->gs.base); | 3245 | "fs:", |
3246 | pr_err("gdtr: s: %04x a: %04x l: %08x b: %016llx\n", | 3246 | save->fs.selector, save->fs.attrib, |
3247 | save->gdtr.selector, save->gdtr.attrib, | 3247 | save->fs.limit, save->fs.base); |
3248 | save->gdtr.limit, save->gdtr.base); | 3248 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3249 | pr_err("ldtr: s: %04x a: %04x l: %08x b: %016llx\n", | 3249 | "gs:", |
3250 | save->ldtr.selector, save->ldtr.attrib, | 3250 | save->gs.selector, save->gs.attrib, |
3251 | save->ldtr.limit, save->ldtr.base); | 3251 | save->gs.limit, save->gs.base); |
3252 | pr_err("idtr: s: %04x a: %04x l: %08x b: %016llx\n", | 3252 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3253 | save->idtr.selector, save->idtr.attrib, | 3253 | "gdtr:", |
3254 | save->idtr.limit, save->idtr.base); | 3254 | save->gdtr.selector, save->gdtr.attrib, |
3255 | pr_err("tr: s: %04x a: %04x l: %08x b: %016llx\n", | 3255 | save->gdtr.limit, save->gdtr.base); |
3256 | save->tr.selector, save->tr.attrib, | 3256 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", |
3257 | save->tr.limit, save->tr.base); | 3257 | "ldtr:", |
3258 | save->ldtr.selector, save->ldtr.attrib, | ||
3259 | save->ldtr.limit, save->ldtr.base); | ||
3260 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", | ||
3261 | "idtr:", | ||
3262 | save->idtr.selector, save->idtr.attrib, | ||
3263 | save->idtr.limit, save->idtr.base); | ||
3264 | pr_err("%-5s s: %04x a: %04x l: %08x b: %016llx\n", | ||
3265 | "tr:", | ||
3266 | save->tr.selector, save->tr.attrib, | ||
3267 | save->tr.limit, save->tr.base); | ||
3258 | pr_err("cpl: %d efer: %016llx\n", | 3268 | pr_err("cpl: %d efer: %016llx\n", |
3259 | save->cpl, save->efer); | 3269 | save->cpl, save->efer); |
3260 | pr_err("cr0: %016llx cr2: %016llx\n", | 3270 | pr_err("%-15s %016llx %-13s %016llx\n", |
3261 | save->cr0, save->cr2); | 3271 | "cr0:", save->cr0, "cr2:", save->cr2); |
3262 | pr_err("cr3: %016llx cr4: %016llx\n", | 3272 | pr_err("%-15s %016llx %-13s %016llx\n", |
3263 | save->cr3, save->cr4); | 3273 | "cr3:", save->cr3, "cr4:", save->cr4); |
3264 | pr_err("dr6: %016llx dr7: %016llx\n", | 3274 | pr_err("%-15s %016llx %-13s %016llx\n", |
3265 | save->dr6, save->dr7); | 3275 | "dr6:", save->dr6, "dr7:", save->dr7); |
3266 | pr_err("rip: %016llx rflags: %016llx\n", | 3276 | pr_err("%-15s %016llx %-13s %016llx\n", |
3267 | save->rip, save->rflags); | 3277 | "rip:", save->rip, "rflags:", save->rflags); |
3268 | pr_err("rsp: %016llx rax: %016llx\n", | 3278 | pr_err("%-15s %016llx %-13s %016llx\n", |
3269 | save->rsp, save->rax); | 3279 | "rsp:", save->rsp, "rax:", save->rax); |
3270 | pr_err("star: %016llx lstar: %016llx\n", | 3280 | pr_err("%-15s %016llx %-13s %016llx\n", |
3271 | save->star, save->lstar); | 3281 | "star:", save->star, "lstar:", save->lstar); |
3272 | pr_err("cstar: %016llx sfmask: %016llx\n", | 3282 | pr_err("%-15s %016llx %-13s %016llx\n", |
3273 | save->cstar, save->sfmask); | 3283 | "cstar:", save->cstar, "sfmask:", save->sfmask); |
3274 | pr_err("kernel_gs_base: %016llx sysenter_cs: %016llx\n", | 3284 | pr_err("%-15s %016llx %-13s %016llx\n", |
3275 | save->kernel_gs_base, save->sysenter_cs); | 3285 | "kernel_gs_base:", save->kernel_gs_base, |
3276 | pr_err("sysenter_esp: %016llx sysenter_eip: %016llx\n", | 3286 | "sysenter_cs:", save->sysenter_cs); |
3277 | save->sysenter_esp, save->sysenter_eip); | 3287 | pr_err("%-15s %016llx %-13s %016llx\n", |
3278 | pr_err("gpat: %016llx dbgctl: %016llx\n", | 3288 | "sysenter_esp:", save->sysenter_esp, |
3279 | save->g_pat, save->dbgctl); | 3289 | "sysenter_eip:", save->sysenter_eip); |
3280 | pr_err("br_from: %016llx br_to: %016llx\n", | 3290 | pr_err("%-15s %016llx %-13s %016llx\n", |
3281 | save->br_from, save->br_to); | 3291 | "gpat:", save->g_pat, "dbgctl:", save->dbgctl); |
3282 | pr_err("excp_from: %016llx excp_to: %016llx\n", | 3292 | pr_err("%-15s %016llx %-13s %016llx\n", |
3283 | save->last_excp_from, save->last_excp_to); | 3293 | "br_from:", save->br_from, "br_to:", save->br_to); |
3284 | 3294 | pr_err("%-15s %016llx %-13s %016llx\n", | |
3295 | "excp_from:", save->last_excp_from, | ||
3296 | "excp_to:", save->last_excp_to); | ||
3285 | } | 3297 | } |
3286 | 3298 | ||
3287 | static void svm_get_exit_info(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2) | 3299 | static void svm_get_exit_info(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2) |