[PATCH] D61450: [compiler-rt] Set the ZX_VMO_RESIZABLE option for zx_vmo_create

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 10:01:47 PDT 2019


phosek created this revision.
phosek added reviewers: mcgrathr, jakehehrlich, juliehockett, cryptoad.
Herald added subscribers: llvm-commits, Sanitizers, dberris, kubamracek.
Herald added projects: LLVM, Sanitizers.

Currently VMO in Zircon create using the zx_vmo_create is resizable
by default, but we'll be changing this in the future, requiring an
explicit flag to make the VMO resizable.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D61450

Files:
  compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
  compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
  compiler-rt/lib/scudo/standalone/fuchsia.cc
  compiler-rt/lib/xray/xray_utils.cc


Index: compiler-rt/lib/xray/xray_utils.cc
===================================================================
--- compiler-rt/lib/xray/xray_utils.cc
+++ compiler-rt/lib/xray/xray_utils.cc
@@ -78,7 +78,7 @@
 LogWriter *LogWriter::Open() XRAY_NEVER_INSTRUMENT {
   // Create VMO to hold the profile data.
   zx_handle_t Vmo;
-  zx_status_t Status = _zx_vmo_create(0, 0, &Vmo);
+  zx_status_t Status = _zx_vmo_create(0, ZX_VMO_RESIZABLE, &Vmo);
   if (Status != ZX_OK) {
     Report("XRay: cannot create VMO: %s\n", _zx_status_get_string(Status));
     return nullptr;
Index: compiler-rt/lib/scudo/standalone/fuchsia.cc
===================================================================
--- compiler-rt/lib/scudo/standalone/fuchsia.cc
+++ compiler-rt/lib/scudo/standalone/fuchsia.cc
@@ -80,7 +80,7 @@
     }
   } else {
     // Otherwise, create a Vmo and set its name.
-    Status = _zx_vmo_create(Size, 0, &Vmo);
+    Status = _zx_vmo_create(Size, ZX_VMO_RESIZABLE, &Vmo);
     if (Status != ZX_OK) {
       if (Status != ZX_ERR_NO_MEMORY || !AllowNoMem)
         dieOnMapUnmapError(Status == ZX_ERR_NO_MEMORY);
Index: compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
+++ compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
@@ -132,7 +132,7 @@
       // The first sample goes at [1] to reserve [0] for the magic number.
       next_index_ = 1 + num_guards;
 
-      zx_status_t status = _zx_vmo_create(DataSize(), 0, &vmo_);
+      zx_status_t status = _zx_vmo_create(DataSize(), ZX_VMO_RESIZABLE, &vmo_);
       CHECK_EQ(status, ZX_OK);
 
       // Give the VMO a name including our process KOID so it's easy to spot.
Index: compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
===================================================================
--- compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
+++ compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
@@ -70,7 +70,7 @@
       return -1;
 
     /* Create VMO to hold the profile data. */
-    Status = _zx_vmo_create(0, 0, &__llvm_profile_vmo);
+    Status = _zx_vmo_create(0, ZX_VMO_RESIZABLE, &__llvm_profile_vmo);
     if (Status != ZX_OK)
       return -1;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61450.197815.patch
Type: text/x-patch
Size: 2291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190502/91601977/attachment-0001.bin>


More information about the llvm-commits mailing list