Skip to content

Commit a3bd2f7

Browse files
anlshsean-jc
authored andcommitted
KVM: Add function comments for __kvm_read/write_guest_page()
The (gfn, data, offset, len) order of parameters is a little strange since "offset" applies to "gfn" rather than to "data". Add function comments to make things perfectly clear. Signed-off-by: Anish Moorthy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent ed2f049 commit a3bd2f7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

virt/kvm/kvm_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,6 +3308,7 @@ static int next_segment(unsigned long len, int offset)
33083308
return len;
33093309
}
33103310

3311+
/* Copy @len bytes from guest memory at '(@gfn * PAGE_SIZE) + @offset' to @data */
33113312
static int __kvm_read_guest_page(struct kvm_memory_slot *slot, gfn_t gfn,
33123313
void *data, int offset, int len)
33133314
{
@@ -3409,6 +3410,7 @@ int kvm_vcpu_read_guest_atomic(struct kvm_vcpu *vcpu, gpa_t gpa,
34093410
}
34103411
EXPORT_SYMBOL_GPL(kvm_vcpu_read_guest_atomic);
34113412

3413+
/* Copy @len bytes from @data into guest memory at '(@gfn * PAGE_SIZE) + @offset' */
34123414
static int __kvm_write_guest_page(struct kvm *kvm,
34133415
struct kvm_memory_slot *memslot, gfn_t gfn,
34143416
const void *data, int offset, int len)

0 commit comments

Comments
 (0)