hw/xen: Implement GNTTABOP_query_size

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
This commit is contained in:
David Woodhouse 2022-12-16 23:49:48 +00:00
parent 28b7ae94a2
commit b46f9745b1
3 changed files with 36 additions and 1 deletions

View file

@ -1207,7 +1207,21 @@ static bool kvm_xen_hcall_gnttab_op(struct kvm_xen_exit *exit, X86CPU *cpu,
}
break;
}
case GNTTABOP_query_size:
case GNTTABOP_query_size: {
struct gnttab_query_size size;
qemu_build_assert(sizeof(size) == 16);
if (kvm_copy_from_gva(cs, arg, &size, sizeof(size))) {
err = -EFAULT;
break;
}
err = xen_gnttab_query_size_op(&size);
if (!err && kvm_copy_to_gva(cs, arg, &size, sizeof(size))) {
err = -EFAULT;
}
break;
}
case GNTTABOP_setup_table:
case GNTTABOP_copy:
case GNTTABOP_map_grant_ref: