Lines Matching +full:block +full:- +full:copy

1 // SPDX-License-Identifier: GPL-2.0-only
14 * kvm_stats_read() - Common function to read from the binary statistics
20 * @stats: start address of stats data block for a vm or a vcpu
21 * @size_stats: the size of stats data block pointed by @stats
28 * +-------------+
30 * +-------------+
32 * +-------------+
34 * +-------------+
36 * +-------------+
41 * and some other necessary information. This is a one-time work for the
43 * 2. Read id string from its offset. This is a one-time work for the lifecycle
46 * descriptors. This is a one-time work for the lifecycle of the
67 size_desc = header->num_desc * sizeof(*desc); in kvm_stats_read()
69 len = KVM_STATS_NAME_SIZE + size_header + size_desc + size_stats - pos; in kvm_stats_read()
76 * Copy kvm stats header. in kvm_stats_read()
77 * The header is the first block of content userspace usually read out. in kvm_stats_read()
79 * The copy of the header would be skipped if offset is larger than the in kvm_stats_read()
83 copylen = size_header - pos; in kvm_stats_read()
88 return -EFAULT; in kvm_stats_read()
89 remain -= copylen; in kvm_stats_read()
95 * Copy kvm stats header id string. in kvm_stats_read()
103 copylen = header->id_offset + KVM_STATS_NAME_SIZE - pos; in kvm_stats_read()
106 src = id + pos - header->id_offset; in kvm_stats_read()
108 return -EFAULT; in kvm_stats_read()
109 remain -= copylen; in kvm_stats_read()
115 * Copy kvm stats descriptors. in kvm_stats_read()
116 * The descriptors copy would be skipped in the typical case that in kvm_stats_read()
119 * (header->header.desc_offset + size_desc) causing copylen <= 0. in kvm_stats_read()
121 copylen = header->desc_offset + size_desc - pos; in kvm_stats_read()
124 src = (void *)desc + pos - header->desc_offset; in kvm_stats_read()
126 return -EFAULT; in kvm_stats_read()
127 remain -= copylen; in kvm_stats_read()
132 /* Copy kvm stats values */ in kvm_stats_read()
133 copylen = header->data_offset + size_stats - pos; in kvm_stats_read()
136 src = stats + pos - header->data_offset; in kvm_stats_read()
138 return -EFAULT; in kvm_stats_read()