]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
x86: Remove guest registers parameter from vcpu_handle_hypercall
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 3 Apr 2015 13:03:22 +0000 (15:03 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 10 Apr 2015 07:00:52 +0000 (09:00 +0200)
The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
from the per-cpu data structure now.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/include/asm/vcpu.h
hypervisor/arch/x86/svm.c
hypervisor/arch/x86/vcpu.c
hypervisor/arch/x86/vmx.c

index 4cd0eaaf49ac9c1ce1ed2a62b0519c6d3458c01a..a827f6e3496cef0c570791f0fca1d3b495ad6811 100644 (file)
@@ -105,7 +105,7 @@ bool vcpu_get_guest_paging_structs(struct guest_paging_structures *pg_structs);
 
 void vcpu_vendor_set_guest_pat(unsigned long val);
 
-void vcpu_handle_hypercall(union registers *guest_regs);
+void vcpu_handle_hypercall(void);
 
 bool vcpu_handle_io_access(union registers *guest_regs);
 bool vcpu_handle_mmio_access(union registers *guest_regs);
index fa88c4b8405999d1b365b16fad7196aae56ac9ac..70226390b1db9b6820e2a9fdfee938db4065f4f4 100644 (file)
@@ -953,7 +953,7 @@ void vcpu_handle_exit(struct per_cpu *cpu_data)
                /* FIXME: We are not intercepting CPUID now */
                return;
        case VMEXIT_VMMCALL:
-               vcpu_handle_hypercall(guest_regs);
+               vcpu_handle_hypercall();
                return;
        case VMEXIT_CR0_SEL_WRITE:
                cpu_data->stats[JAILHOUSE_CPU_STAT_VMEXITS_CR]++;
index 4c204e585aa9f45214c1a17fe00889c09f14b873..dd3e1cf22fb6913395ad56d119b53d0d31935990 100644 (file)
@@ -133,8 +133,9 @@ void vcpu_cell_exit(struct cell *cell)
        vcpu_vendor_cell_exit(cell);
 }
 
-void vcpu_handle_hypercall(union registers *guest_regs)
+void vcpu_handle_hypercall(void)
 {
+       union registers *guest_regs = &this_cpu_data()->guest_regs;
        unsigned long code = guest_regs->rax;
        struct vcpu_execution_state x_state;
        unsigned long arg_mask;
index 5116e73803c1c77415611f2b476161057f89c631..eba68ac8e74814cb8d5482025a443dc6e7419203 100644 (file)
@@ -1071,7 +1071,7 @@ void vcpu_handle_exit(struct per_cpu *cpu_data)
                      (u32 *)&guest_regs->rcx, (u32 *)&guest_regs->rdx);
                return;
        case EXIT_REASON_VMCALL:
-               vcpu_handle_hypercall(guest_regs);
+               vcpu_handle_hypercall();
                return;
        case EXIT_REASON_CR_ACCESS:
                cpu_data->stats[JAILHOUSE_CPU_STAT_VMEXITS_CR]++;