hv: cpu: using struct cpu_gp_regs for general-purpose regs in inter_excp_ctx

The purpos is to unify the layout of general-purpose regs in interrupt/excpetion context.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Binbin Wu
2018-07-24 20:20:43 +08:00
committed by lijinxia
parent 586b527e2c
commit f1b9f5ac97
3 changed files with 78 additions and 94 deletions

View File

@@ -265,42 +265,45 @@ vector =0x20
*/
.align 8
excp_save_frame:
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
pushq %rax
pushq %rbp
pushq %rbx
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rdi
pushq %rsi
pushq %rbp
pushq %rsp
pushq %rbx
pushq %rdx
pushq %rcx
pushq %rax
/* Put current stack pointer into 1st param register (rdi) */
movq %rsp, %rdi
call dispatch_exception
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbx
popq %rbp
popq %rax
popq %rcx
popq %rdx
popq %rbx
popq %rsp
popq %rbp
popq %rsi
popq %rdi
popq %r8
popq %r9
popq %r10
popq %r11
popq %r12
popq %r13
popq %r14
popq %r15
/* Skip vector and error code*/
add $16, %rsp
@@ -315,45 +318,44 @@ excp_save_frame:
*/
.align 8
excp_rsvd:
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
pushq %rax
pushq %rbp
pushq %rbx
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rdi
pushq %rsi
pushq %rbp
pushq %rsp
pushq %rbx
pushq %rdx
pushq %rcx
pushq %rax
/* Put current stack pointer into 1st param register (rdi) */
movq %rsp, %rdi
call dispatch_exception
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbx
popq %rbp
popq %rax
popq %rcx
popq %rdx
popq %rbx
popq %rsp
popq %rbp
popq %rsi
popq %rdi
popq %r8
popq %r9
popq %r10
popq %r11
popq %r12
popq %r13
popq %r14
popq %r15
/* Skip vector and error code*/
add $16, %rsp
@@ -367,23 +369,22 @@ excp_rsvd:
*/
.align 8
external_interrupt_save_frame:
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
pushq %rax
pushq %rbp
pushq %rbx
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rdi
pushq %rsi
pushq %rbp
pushq %rsp
pushq %rbx
pushq %rdx
pushq %rcx
pushq %rax
/* Put current stack pointer into 1st param register (rdi) */
movq %rsp, %rdi
@@ -395,22 +396,22 @@ external_interrupt_save_frame:
* are for Guest, and we can execute softirq in hv_main() loop
*/
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbx
popq %rbp
popq %rax
popq %rcx
popq %rdx
popq %rbx
popq %rsp
popq %rbp
popq %rsi
popq %rdi
popq %r8
popq %r9
popq %r10
popq %r11
popq %r12
popq %r13
popq %r14
popq %r15
/* Skip vector and error code*/
add $16, %rsp