Print this page
OS-881 To workaround OS-580 add support to only invalidate mappings from a single process

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/syscall/memcntl.c
          +++ new/usr/src/uts/common/syscall/memcntl.c
↓ open down ↓ 107 lines elided ↑ open up ↑
 108  108          if (attr) {
 109  109                  attr |= PROT_USER;
 110  110          }
 111  111  
 112  112          switch (cmd) {
 113  113          case MC_SYNC:
 114  114                  /*
 115  115                   * MS_SYNC used to be defined to be zero but is now non-zero.
 116  116                   * For binary compatibility we still accept zero
 117  117                   * (the absence of MS_ASYNC) to mean the same thing.
      118 +                 * Binary compatibility is not an issue for MS_INVALCURPROC.
 118  119                   */
 119  120                  iarg = (uintptr_t)arg;
 120  121                  if ((iarg & ~MS_INVALIDATE) == 0)
 121  122                          iarg |= MS_SYNC;
 122  123  
 123      -                if (((iarg & ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE)) != 0) ||
 124      -                    ((iarg & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC))) {
      124 +                if (((iarg &
      125 +                    ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE|MS_INVALCURPROC)) != 0) ||
      126 +                    ((iarg & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC)) ||
      127 +                    ((iarg & (MS_INVALIDATE|MS_INVALCURPROC)) ==
      128 +                    (MS_INVALIDATE|MS_INVALCURPROC))) {
 125  129                          error = set_errno(EINVAL);
 126  130                  } else {
 127  131                          error = as_ctl(as, addr, len, cmd, attr, iarg, NULL, 0);
 128  132                          if (error) {
 129  133                                  (void) set_errno(error);
 130  134                          }
 131  135                  }
 132  136                  return (error);
 133  137          case MC_LOCKAS:
 134  138                  if ((uintptr_t)arg & ~(MCL_FUTURE|MCL_CURRENT) ||
↓ open down ↓ 275 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX