]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
x86: Remove guest registers parameter from vcpu_handle_mmio_access
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 4 Apr 2015 06:20:33 +0000 (08:20 +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 88b2e6ead785a008a1c8cb8fed0796c480f26a35..f43e6ef3480aafc87309cfc048d55d0118137798 100644 (file)
@@ -108,7 +108,7 @@ void vcpu_vendor_set_guest_pat(unsigned long val);
 void vcpu_handle_hypercall(void);
 
 bool vcpu_handle_io_access(void);
-bool vcpu_handle_mmio_access(union registers *guest_regs);
+bool vcpu_handle_mmio_access(void);
 
 bool vcpu_handle_msr_read(union registers *guest_regs);
 bool vcpu_handle_msr_write(union registers *guest_regs);
index 0b80dab24e54ec39ec0767e11c1ce3d0655e501b..69ccb635c1a564ccd304f9d0d708891b29cfa8d2 100644 (file)
@@ -979,7 +979,7 @@ void vcpu_handle_exit(struct per_cpu *cpu_data)
                } else {
                        /* General MMIO (IOAPIC, PCI etc) */
                        cpu_data->stats[JAILHOUSE_CPU_STAT_VMEXITS_MMIO]++;
-                       if (vcpu_handle_mmio_access(guest_regs))
+                       if (vcpu_handle_mmio_access())
                                return;
                }
 
index 6ddf42aa97a79d3197dcd03156e07d89c0d0c0b3..12cf5cbc975a145c650892123c0d53f21b8a60eb 100644 (file)
@@ -191,7 +191,7 @@ invalid_access:
        return false;
 }
 
-bool vcpu_handle_mmio_access(union registers *guest_regs)
+bool vcpu_handle_mmio_access(void)
 {
        struct per_cpu *cpu_data = this_cpu_data();
        struct guest_paging_structures pg_structs;
@@ -212,7 +212,7 @@ bool vcpu_handle_mmio_access(union registers *guest_regs)
                goto invalid_access;
 
        if (mmio.is_write)
-               val = guest_regs->by_index[inst.reg_num];
+               val = cpu_data->guest_regs.by_index[inst.reg_num];
 
        result = ioapic_access_handler(cpu_data->cell, mmio.is_write,
                                       mmio.phys_addr, &val);
@@ -226,7 +226,7 @@ bool vcpu_handle_mmio_access(union registers *guest_regs)
 
        if (result == 1) {
                if (!mmio.is_write)
-                       guest_regs->by_index[inst.reg_num] = val;
+                       cpu_data->guest_regs.by_index[inst.reg_num] = val;
                vcpu_skip_emulated_instruction(inst.inst_len);
                return true;
        }
index 06b1329fb108419c84d8a8d91fa2af753ee481a0..b17ad2febb7e0d28f34584551a25b31e02f2de22 100644 (file)
@@ -1106,7 +1106,7 @@ void vcpu_handle_exit(struct per_cpu *cpu_data)
                break;
        case EXIT_REASON_EPT_VIOLATION:
                cpu_data->stats[JAILHOUSE_CPU_STAT_VMEXITS_MMIO]++;
-               if (vcpu_handle_mmio_access(guest_regs))
+               if (vcpu_handle_mmio_access())
                        return;
                break;
        default: