mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
svm: Replace call to svm_load_cr2 with conditional call to svm_trace_vmentry
Remove the call to svm_load_cr2 (which doesn't do anything useful). The old svm_load_cr2 is now replaced with a svm_trace_vmentry. A call to this function is done if "tb_init_done" is non-zero, so we don't call this unless it's actually being used. Signed-off-by: Mats Petersson <mats.petersson@amd.com>
This commit is contained in:
1 parent
8cc22ae8d1
commit
012be4bc30
3 files changed
+37
-9
No files matched your search
@@ -2520,14 +2520,12 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
|
||||
}
|
||||
}
|
||||
|
||||
asmlinkage void svm_load_cr2(void)
|
||||
asmlinkage void svm_trace_vmentry(void)
|
||||
{
|
||||
struct vcpu *v = current;
|
||||
|
||||
/* This is the last C code before the VMRUN instruction. */
|
||||
HVMTRACE_0D(VMENTRY, v);
|
||||
|
||||
asm volatile ( "mov %0,%%cr2" : : "r" (v->arch.hvm_svm.cpu_cr2) );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -38,15 +38,22 @@
|
||||
ENTRY(svm_asm_do_resume)
|
||||
GET_CURRENT(%ebx)
|
||||
CLGI
|
||||
/* Run ASID stuff. */
|
||||
call svm_asid_handle_vmrun
|
||||
|
||||
movl VCPU_processor(%ebx),%eax
|
||||
shl $IRQSTAT_shift,%eax
|
||||
testl $~0,irq_stat(%eax,1)
|
||||
jnz svm_process_softirqs
|
||||
|
||||
call svm_asid_handle_vmrun
|
||||
call svm_intr_assist
|
||||
call svm_load_cr2
|
||||
|
||||
/* Check if the trace buffer is initialized.
|
||||
* Because the below condition is unlikely, we jump out of line
|
||||
* instead of having a mostly taken branch over the unlikely code.
|
||||
*/
|
||||
cmpb $0,tb_init_done
|
||||
jnz svm_trace
|
||||
svm_trace_done:
|
||||
|
||||
movl VCPU_svm_vmcb(%ebx),%ecx
|
||||
movl UREGS_eax(%esp),%eax
|
||||
@@ -89,3 +96,11 @@ svm_process_softirqs:
|
||||
STGI
|
||||
call do_softirq
|
||||
jmp svm_asm_do_resume
|
||||
|
||||
svm_trace:
|
||||
/* Call out to C, as this is not speed critical path
|
||||
* Note: svm_trace_vmentry will recheck the tb_init_done,
|
||||
* but this is on the slow path, so who cares
|
||||
*/
|
||||
call svm_trace_vmentry
|
||||
jmp svm_trace_done
|
||||
@@ -38,16 +38,23 @@
|
||||
ENTRY(svm_asm_do_resume)
|
||||
GET_CURRENT(%rbx)
|
||||
CLGI
|
||||
/* Run ASID stuff. */
|
||||
call svm_asid_handle_vmrun
|
||||
|
||||
movl VCPU_processor(%rbx),%eax
|
||||
shl $IRQSTAT_shift,%rax
|
||||
leaq irq_stat(%rip),%rdx
|
||||
testl $~0,(%rdx,%rax,1)
|
||||
jnz svm_process_softirqs
|
||||
|
||||
call svm_asid_handle_vmrun
|
||||
call svm_intr_assist
|
||||
call svm_load_cr2
|
||||
|
||||
/* Check if the trace buffer is initialized.
|
||||
* Because the below condition is unlikely, we jump out of line
|
||||
* instead of having a mostly taken branch over the unlikely code.
|
||||
*/
|
||||
cmpb $0,tb_init_done(%rip)
|
||||
jnz svm_trace
|
||||
svm_trace_done:
|
||||
|
||||
movq VCPU_svm_vmcb(%rbx),%rcx
|
||||
movq UREGS_rax(%rsp),%rax
|
||||
@@ -106,3 +113,11 @@ svm_process_softirqs:
|
||||
STGI
|
||||
call do_softirq
|
||||
jmp svm_asm_do_resume
|
||||
|
||||
svm_trace:
|
||||
/* Call out to C, as this is not speed critical path
|
||||
* Note: svm_trace_vmentry will recheck the tb_init_done,
|
||||
* but this is on the slow path, so who cares
|
||||
*/
|
||||
call svm_trace_vmentry
|
||||
jmp svm_trace_done
|
||||