Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: s390: pv: Add query dump information

The dump API requires userspace to provide buffers into which we will
store data. The dump information added in this patch tells userspace
how big those buffers need to be.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Link: https://lore.kernel.org/r/20220517163629.3443-6-frankja@linux.ibm.com
Message-Id: <20220517163629.3443-6-frankja@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>

authored by

Janosch Frank and committed by
Christian Borntraeger
fe9a93e0 06eb3388

+22 -1
+11
arch/s390/kvm/kvm-s390.c
··· 2255 2255 2256 2256 return len_min; 2257 2257 } 2258 + case KVM_PV_INFO_DUMP: { 2259 + len_min = sizeof(info->header) + sizeof(info->dump); 2260 + 2261 + if (info->header.len_max < len_min) 2262 + return -EINVAL; 2263 + 2264 + info->dump.dump_cpu_buffer_len = uv_info.guest_cpu_stor_len; 2265 + info->dump.dump_config_mem_buffer_per_1m = uv_info.conf_dump_storage_state_len; 2266 + info->dump.dump_config_finalize_len = uv_info.conf_dump_finalize_len; 2267 + return len_min; 2268 + } 2258 2269 default: 2259 2270 return -EINVAL; 2260 2271 }
+11 -1
include/uapi/linux/kvm.h
··· 1662 1662 1663 1663 enum pv_cmd_info_id { 1664 1664 KVM_PV_INFO_VM, 1665 + KVM_PV_INFO_DUMP, 1666 + }; 1667 + 1668 + struct kvm_s390_pv_info_dump { 1669 + __u64 dump_cpu_buffer_len; 1670 + __u64 dump_config_mem_buffer_per_1m; 1671 + __u64 dump_config_finalize_len; 1665 1672 }; 1666 1673 1667 1674 struct kvm_s390_pv_info_vm { ··· 1688 1681 1689 1682 struct kvm_s390_pv_info { 1690 1683 struct kvm_s390_pv_info_header header; 1691 - struct kvm_s390_pv_info_vm vm; 1684 + union { 1685 + struct kvm_s390_pv_info_dump dump; 1686 + struct kvm_s390_pv_info_vm vm; 1687 + }; 1692 1688 }; 1693 1689 1694 1690 enum pv_cmd_id {