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

@@ -180,15 +180,11 @@
                 return (0);
 
         /*
          * as->a_wpage can only be changed while the process is totally stopped.
          * Don't grab p_lock here.  Holding p_lock while grabbing the address
-         * space lock leads to deadlocks with the clock thread.  Note that if an
-         * as_fault() is servicing a fault to a watched page on behalf of an
-         * XHAT provider, watchpoint will be temporarily cleared (and wp_prot
-         * will be set to wp_oprot).  Since this is done while holding as writer
-         * lock, we need to grab as lock (reader lock is good enough).
+         * space lock leads to deadlocks with the clock thread.
          *
          * p_maplock prevents simultaneous execution of this function.  Under
          * normal circumstances, holdwatch() will stop all other threads, so the
          * lock isn't really needed.  But there may be multiple threads within
          * stop() when SWATCHOK is set, so we need to handle multiple threads

@@ -309,13 +305,13 @@
                         AS_LOCK_EXIT(as, &as->a_lock);
                         AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
                 retry:
                         seg = as_segat(as, addr);
                         ASSERT(seg != NULL);
-                        SEGOP_GETPROT(seg, addr, 0, &oprot);
+                        segop_getprot(seg, addr, 0, &oprot);
                         if (prot != oprot) {
-                                err = SEGOP_SETPROT(seg, addr, PAGESIZE, prot);
+                                err = segop_setprot(seg, addr, PAGESIZE, prot);
                                 if (err == IE_RETRY) {
                                         ASSERT(retrycnt == 0);
                                         retrycnt++;
                                         goto retry;
                                 }

@@ -404,11 +400,11 @@
         retry:
                 ASSERT(pwp->wp_flags & WP_SETPROT);
                 if ((seg = as_segat(as, vaddr)) != NULL &&
                     !(pwp->wp_flags & WP_NOWATCH)) {
                         prot = pwp->wp_prot;
-                        err = SEGOP_SETPROT(seg, vaddr, PAGESIZE, prot);
+                        err = segop_setprot(seg, vaddr, PAGESIZE, prot);
                         if (err == IE_RETRY) {
                                 ASSERT(retrycnt == 0);
                                 retrycnt++;
                                 goto retry;
                         }

@@ -502,11 +498,10 @@
         int rv;
 
         if ((as == &kas) || avl_numnodes(&as->a_wpage) == 0)
                 return (0);
 
-        /* Grab the lock because of XHAT (see comment in pr_mappage()) */
         AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
         rv = pr_is_watchpage_as(addr, rw, as);
         AS_LOCK_EXIT(as, &as->a_lock);
 
         return (rv);