@@ -1032,6 +1032,51 @@ int xc_domain_add_to_physmap(xc_interface *xch,
10321032    return  do_memory_op (xch , XENMEM_add_to_physmap , & xatp , sizeof (xatp ));
10331033}
10341034
1035+ int  xc_domain_add_to_physmap_batch (xc_interface  * xch ,
1036+                                    domid_t  domid ,
1037+                                    domid_t  foreign_domid ,
1038+                                    unsigned int   space ,
1039+                                    unsigned int   size ,
1040+                                    xen_ulong_t  * idxs ,
1041+                                    xen_pfn_t  * gpfns ,
1042+                                    int  * errs )
1043+ {
1044+     int  rc ;
1045+     DECLARE_HYPERCALL_BOUNCE (idxs , size  *  sizeof (* idxs ), XC_HYPERCALL_BUFFER_BOUNCE_IN );
1046+     DECLARE_HYPERCALL_BOUNCE (gpfns , size  *  sizeof (* gpfns ), XC_HYPERCALL_BUFFER_BOUNCE_IN );
1047+     DECLARE_HYPERCALL_BOUNCE (errs , size  *  sizeof (* errs ), XC_HYPERCALL_BUFFER_BOUNCE_OUT );
1048+ 
1049+     struct  xen_add_to_physmap_batch  xatp_batch  =  {
1050+         .domid  =  domid ,
1051+         .space  =  space ,
1052+         .size  =  size ,
1053+         .u  =  { .foreign_domid  =  foreign_domid  }
1054+     };
1055+ 
1056+     if  ( xc_hypercall_bounce_pre (xch , idxs )  || 
1057+          xc_hypercall_bounce_pre (xch , gpfns ) || 
1058+          xc_hypercall_bounce_pre (xch , errs )  )
1059+     {
1060+         PERROR ("Could not bounce memory for XENMEM_add_to_physmap_batch" );
1061+         rc  =  -1 ;
1062+         goto out ;
1063+     }
1064+ 
1065+     set_xen_guest_handle (xatp_batch .idxs , idxs );
1066+     set_xen_guest_handle (xatp_batch .gpfns , gpfns );
1067+     set_xen_guest_handle (xatp_batch .errs , errs );
1068+ 
1069+     rc  =  do_memory_op (xch , XENMEM_add_to_physmap_batch ,
1070+                       & xatp_batch , sizeof (xatp_batch ));
1071+ 
1072+ out :
1073+     xc_hypercall_bounce_post (xch , idxs );
1074+     xc_hypercall_bounce_post (xch , gpfns );
1075+     xc_hypercall_bounce_post (xch , errs );
1076+ 
1077+     return  rc ;
1078+ }
1079+ 
10351080int  xc_domain_claim_pages (xc_interface  * xch ,
10361081                               uint32_t  domid ,
10371082                               unsigned long  nr_pages )
0 commit comments