mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
KVM: keep track of running ioctls
Using the new accel-blocker API, mark where ioctls are being called in KVM. Next, we will implement the critical section that will take care of performing memslots modifications atomically, therefore preventing any new ioctl from running and allowing the running ones to finish. Signed-off-by: David Hildenbrand <david@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20221111154758.1372674-3-eesposit@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
bd688fc931
commit
a27dd2de68
1 changed files with 7 additions and 0 deletions
|
@ -2310,6 +2310,7 @@ static int kvm_init(MachineState *ms)
|
||||||
assert(TARGET_PAGE_SIZE <= qemu_real_host_page_size());
|
assert(TARGET_PAGE_SIZE <= qemu_real_host_page_size());
|
||||||
|
|
||||||
s->sigmask_len = 8;
|
s->sigmask_len = 8;
|
||||||
|
accel_blocker_init();
|
||||||
|
|
||||||
#ifdef KVM_CAP_SET_GUEST_DEBUG
|
#ifdef KVM_CAP_SET_GUEST_DEBUG
|
||||||
QTAILQ_INIT(&s->kvm_sw_breakpoints);
|
QTAILQ_INIT(&s->kvm_sw_breakpoints);
|
||||||
|
@ -3014,7 +3015,9 @@ int kvm_vm_ioctl(KVMState *s, int type, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
trace_kvm_vm_ioctl(type, arg);
|
trace_kvm_vm_ioctl(type, arg);
|
||||||
|
accel_ioctl_begin();
|
||||||
ret = ioctl(s->vmfd, type, arg);
|
ret = ioctl(s->vmfd, type, arg);
|
||||||
|
accel_ioctl_end();
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
}
|
}
|
||||||
|
@ -3032,7 +3035,9 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg);
|
trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg);
|
||||||
|
accel_cpu_ioctl_begin(cpu);
|
||||||
ret = ioctl(cpu->kvm_fd, type, arg);
|
ret = ioctl(cpu->kvm_fd, type, arg);
|
||||||
|
accel_cpu_ioctl_end(cpu);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
}
|
}
|
||||||
|
@ -3050,7 +3055,9 @@ int kvm_device_ioctl(int fd, int type, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
trace_kvm_device_ioctl(fd, type, arg);
|
trace_kvm_device_ioctl(fd, type, arg);
|
||||||
|
accel_ioctl_begin();
|
||||||
ret = ioctl(fd, type, arg);
|
ret = ioctl(fd, type, arg);
|
||||||
|
accel_ioctl_end();
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue