Skip to content

Commit

Permalink
libkvmi: add view parameter to kvmi_change_gfn
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian Eikenberg authored and mdontu-bd committed Dec 13, 2023
1 parent 2d1cee7 commit bc80de9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/libkvmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int kvmi_get_ept_view( void *dom, unsigned short vcpu, unsigned short *view
int kvmi_control_ept_view( void *dom, unsigned short vcpu, unsigned short view, bool visible );
bool kvmi_remote_mapping_v2( void );
size_t kvmi_get_pending_events( void *dom );
int kvmi_change_gfn( void *dom, unsigned short vcpu, __u64 old_gfn, __u64 new_gfn );
int kvmi_change_gfn( void *dom, unsigned short vcpu, unsigned short view, __u64 old_gfn, __u64 new_gfn );
int kvmi_alloc_gfn( void *dom, __u64 gfn );
int kvmi_free_gfn( void *dom, __u64 gfn );

Expand Down
3 changes: 3 additions & 0 deletions include/linux/kvmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ struct kvmi_vcpu_translate_gva_reply {
};

struct kvmi_vcpu_change_gfn {
__u16 view;
__u16 padding1;
__u32 padding2;
__u64 old_gfn;
__u64 new_gfn;
};
Expand Down
4 changes: 2 additions & 2 deletions src/kvmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2705,12 +2705,12 @@ int kvmi_translate_gva( void *dom, unsigned short vcpu, __u64 gva, __u64 *gpa )
return err;
}

int kvmi_change_gfn( void *dom, unsigned short vcpu, __u64 old_gfn, __u64 new_gfn )
int kvmi_change_gfn( void *dom, unsigned short vcpu, unsigned short view, __u64 old_gfn, __u64 new_gfn )
{
struct {
struct kvmi_vcpu_hdr vcpu;
struct kvmi_vcpu_change_gfn cmd;
} req = { .vcpu = { .vcpu = vcpu }, .cmd = { .old_gfn = old_gfn, .new_gfn = new_gfn } };
} req = { .vcpu = { .vcpu = vcpu }, .cmd = { .view = view, .old_gfn = old_gfn, .new_gfn = new_gfn } };

return request( dom, KVMI_VCPU_CHANGE_GFN, &req, sizeof( req ), NULL, NULL );
}
Expand Down

0 comments on commit bc80de9

Please sign in to comment.