Skip to content

Commit b050c78

Browse files
authored
xenctrlext: do not truncate the amount of memory in claims to 32 bits (#6372)
Int_val truncates values to a 32-bit int. Instead use Long_val, which does not suffer from this. This is a problem when claiming more than ≈ 9706GiBs for a domain. Found after reading this PR ocaml/ocaml#13852
2 parents 29ab6b6 + 8e0b253 commit b050c78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ocaml/xenopsd/c_stubs/xenctrlext_stubs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ CAMLprim value stub_xenctrlext_domain_claim_pages(value xch_val, value domid_val
678678
int retval, the_errno;
679679
xc_interface* xch = xch_of_val(xch_val);
680680
uint32_t domid = Int_val(domid_val);
681-
unsigned long nr_pages = Int_val(nr_pages_val);
681+
unsigned long nr_pages = Long_val(nr_pages_val);
682682

683683
caml_release_runtime_system();
684684
retval = xc_domain_claim_pages(xch, domid, nr_pages);

0 commit comments

Comments
 (0)