Skip to content

Commit

Permalink
gnt: Bring accesses to OCaml fields outside of the critical section for
Browse files Browse the repository at this point in the history
stub_gnttab_map_fresh

Signed-off-by: Andrii Sultanov <[email protected]>
  • Loading branch information
last-genius committed Jan 23, 2025
1 parent ab12662 commit 24b70bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gnt/gnttab_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ stub_gnttab_map_fresh (value xgh,
CAMLparam4 (xgh, reference, domid, writable);
CAMLlocal1 (contents);
void *map;
xengnttab_handle* xgt = _G(xgh);
uint32_t domid_c = Int_val(domid);
uint32_t ref = Int_val(reference);
int prot = Bool_val (writable) ? PROT_READ | PROT_WRITE : PROT_READ;

caml_enter_blocking_section ();
map = xengnttab_map_grant_ref (_G (xgh), Int_val (domid),
Int_val (reference),
Bool_val (writable) ? PROT_READ |
PROT_WRITE : PROT_READ);
map = xengnttab_map_grant_ref (xgt, domid_c, ref, prot);
caml_leave_blocking_section ();

if (map == NULL)
Expand Down

0 comments on commit 24b70bc

Please sign in to comment.