Print this page
patch lower-case-segops
remove xhat
The xhat infrastructure was added to support hardware such as the zulu
graphics card - hardware which had on-board MMUs.  The VM used the xhat code
to keep the CPU's and Zulu's page tables in-sync.  Since the only xhat user
was zulu (which is gone), we can safely remove it simplifying the whole VM
subsystem.
Assorted notes:
- AS_BUSY flag was used solely by xhat

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/watchpoint.c
          +++ new/usr/src/uts/common/os/watchpoint.c
↓ open down ↓ 174 lines elided ↑ open up ↑
 175  175          ASSERT(as != &kas);
 176  176  
 177  177  startover:
 178  178          ASSERT(rv == 0);
 179  179          if (avl_numnodes(&as->a_wpage) == 0)
 180  180                  return (0);
 181  181  
 182  182          /*
 183  183           * as->a_wpage can only be changed while the process is totally stopped.
 184  184           * Don't grab p_lock here.  Holding p_lock while grabbing the address
 185      -         * space lock leads to deadlocks with the clock thread.  Note that if an
 186      -         * as_fault() is servicing a fault to a watched page on behalf of an
 187      -         * XHAT provider, watchpoint will be temporarily cleared (and wp_prot
 188      -         * will be set to wp_oprot).  Since this is done while holding as writer
 189      -         * lock, we need to grab as lock (reader lock is good enough).
      185 +         * space lock leads to deadlocks with the clock thread.
 190  186           *
 191  187           * p_maplock prevents simultaneous execution of this function.  Under
 192  188           * normal circumstances, holdwatch() will stop all other threads, so the
 193  189           * lock isn't really needed.  But there may be multiple threads within
 194  190           * stop() when SWATCHOK is set, so we need to handle multiple threads
 195  191           * at once.  See holdwatch() for the details of this dance.
 196  192           */
 197  193  
 198  194          mutex_enter(&p->p_maplock);
 199  195          AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
↓ open down ↓ 104 lines elided ↑ open up ↑
 304  300                  if (pwp->wp_oprot != 0) {       /* if page exists */
 305  301                          struct seg *seg;
 306  302                          uint_t oprot;
 307  303                          int err, retrycnt = 0;
 308  304  
 309  305                          AS_LOCK_EXIT(as, &as->a_lock);
 310  306                          AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
 311  307                  retry:
 312  308                          seg = as_segat(as, addr);
 313  309                          ASSERT(seg != NULL);
 314      -                        SEGOP_GETPROT(seg, addr, 0, &oprot);
      310 +                        segop_getprot(seg, addr, 0, &oprot);
 315  311                          if (prot != oprot) {
 316      -                                err = SEGOP_SETPROT(seg, addr, PAGESIZE, prot);
      312 +                                err = segop_setprot(seg, addr, PAGESIZE, prot);
 317  313                                  if (err == IE_RETRY) {
 318  314                                          ASSERT(retrycnt == 0);
 319  315                                          retrycnt++;
 320  316                                          goto retry;
 321  317                                  }
 322  318                          }
 323  319                          AS_LOCK_EXIT(as, &as->a_lock);
 324  320                  } else
 325  321                          AS_LOCK_EXIT(as, &as->a_lock);
 326  322  
↓ open down ↓ 72 lines elided ↑ open up ↑
 399  395          pwp = p->p_wprot;
 400  396          while (pwp != NULL) {
 401  397  
 402  398                  vaddr = pwp->wp_vaddr;
 403  399                  retrycnt = 0;
 404  400          retry:
 405  401                  ASSERT(pwp->wp_flags & WP_SETPROT);
 406  402                  if ((seg = as_segat(as, vaddr)) != NULL &&
 407  403                      !(pwp->wp_flags & WP_NOWATCH)) {
 408  404                          prot = pwp->wp_prot;
 409      -                        err = SEGOP_SETPROT(seg, vaddr, PAGESIZE, prot);
      405 +                        err = segop_setprot(seg, vaddr, PAGESIZE, prot);
 410  406                          if (err == IE_RETRY) {
 411  407                                  ASSERT(retrycnt == 0);
 412  408                                  retrycnt++;
 413  409                                  goto retry;
 414  410                          }
 415  411                  }
 416  412  
 417  413                  next = pwp->wp_list;
 418  414  
 419  415                  if (pwp->wp_read + pwp->wp_write + pwp->wp_exec == 0) {
↓ open down ↓ 77 lines elided ↑ open up ↑
 497  493   */
 498  494  int
 499  495  pr_is_watchpage(caddr_t addr, enum seg_rw rw)
 500  496  {
 501  497          struct as *as = curproc->p_as;
 502  498          int rv;
 503  499  
 504  500          if ((as == &kas) || avl_numnodes(&as->a_wpage) == 0)
 505  501                  return (0);
 506  502  
 507      -        /* Grab the lock because of XHAT (see comment in pr_mappage()) */
 508  503          AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
 509  504          rv = pr_is_watchpage_as(addr, rw, as);
 510  505          AS_LOCK_EXIT(as, &as->a_lock);
 511  506  
 512  507          return (rv);
 513  508  }
 514  509  
 515  510  
 516  511  
 517  512  /*
↓ open down ↓ 1227 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX