On 21/04/2017 08:54, Paul Durrant wrote: >> -----Original Message----- >> From: [email protected] [mailto:[email protected]] >> Sent: 20 April 2017 19:00 >> To: Xen-devel <[email protected]> >> Cc: Jennifer Herbert <[email protected]>; Andrew Cooper >> <[email protected]>; Paul Durrant <[email protected]>; >> Jan Beulich <[email protected]>; Julien Grall <[email protected]> >> Subject: [PATCH 1/4] hvm/dmop: Box dmop_args rather than passing >> multiple parameters around >> >> From: Jennifer Herbert <[email protected]> >> >> No functional change. >> >> Signed-off-by: Jennifer Herbert <[email protected]> >> Signed-off-by: Andrew Cooper <[email protected]> >> -- >> CC: Paul Durrant <[email protected]> >> CC: Andrew Cooper <[email protected]> >> CC: Jan Beulich <[email protected]> >> CC: Julien Grall <[email protected]> >> --- >> xen/arch/x86/hvm/dm.c | 47 ++++++++++++++++++++++++++++------------ >> ------- >> 1 file changed, 28 insertions(+), 19 deletions(-) >> >> diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c >> index d72b7bd..fb4bcec 100644 >> --- a/xen/arch/x86/hvm/dm.c >> +++ b/xen/arch/x86/hvm/dm.c >> @@ -25,6 +25,13 @@ >> >> #include <xsm/xsm.h> >> >> +struct dmop_args { >> + domid_t domid; >> + unsigned int nr_bufs; >> + /* Reserve enough buf elements for all current hypercalls. */ >> + struct xen_dm_op_buf buf[2]; >> +}; >> + >> static bool copy_buf_from_guest(const xen_dm_op_buf_t bufs[], >> unsigned int nr_bufs, void *dst, >> unsigned int idx, size_t dst_size) >> @@ -287,16 +294,14 @@ static int inject_event(struct domain *d, >> return 0; >> } >> >> -static int dm_op(domid_t domid, >> - unsigned int nr_bufs, >> - xen_dm_op_buf_t bufs[]) >> +static int dm_op(struct dmop_args *op_args) > Shouldn't this be a const pointer?
No. copy_to_guest_buf() uses a non const reference of op_args->buf[$IDX]. ~Andrew _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
