Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 PR kern/55033: kernel panics when starting X



details:   https://anonhg.NetBSD.org/src/rev/2d8f49e33c8e
branches:  trunk
changeset: 1007782:2d8f49e33c8e
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Feb 29 20:17:11 2020 +0000

description:
PR kern/55033: kernel panics when starting X

Remove the uvm_page_owner_locked_p() assertions in the x86 pmap.  The DRM
code doesn't follow the locking protocol (it's OK though, since pages aren't
changing identity) and having thought about it more we're most likely going
to have to do full PV locking to make progress on concurrent fault handing,
ergo assertions not so important.

diffstat:

 sys/arch/x86/x86/pmap.c |  21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)

diffs (105 lines):

diff -r f9a29c4062be -r 2d8f49e33c8e sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Sat Feb 29 19:29:38 2020 +0000
+++ b/sys/arch/x86/x86/pmap.c   Sat Feb 29 20:17:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.359 2020/02/23 22:28:53 ad Exp $    */
+/*     $NetBSD: pmap.c,v 1.360 2020/02/29 20:17:11 ad Exp $    */
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.359 2020/02/23 22:28:53 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.360 2020/02/29 20:17:11 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -230,7 +230,7 @@
  * - pg->uobject->vmobjlock, pg->uanon->an_lock
  *   These per-object locks are taken by the VM system before calling into
  *   the pmap module.  Holding them prevents concurrent operations on the
- *   given page or set of pages.  Asserted with uvm_page_owner_locked_p().
+ *   given page or set of pages.
  *
  * - pmap->pm_lock (per pmap)
  *   This lock protects the fields in the pmap structure including the
@@ -3588,7 +3588,6 @@
        }
 
        if ((pg = PHYS_TO_VM_PAGE(pmap_pte2pa(opte))) != NULL) {
-               KASSERT(uvm_page_owner_locked_p(pg, false));
                pp = VM_PAGE_TO_PP(pg);
        } else if ((pp = pmap_pv_tracked(pmap_pte2pa(opte))) == NULL) {
                paddr_t pa = pmap_pte2pa(opte);
@@ -3921,9 +3920,6 @@
        struct pmap_page *pp;
        paddr_t pa;
 
-       /* Need an exclusive lock to prevent PV list changing behind us. */
-       KASSERT(uvm_page_owner_locked_p(pg, true));
-
        pp = VM_PAGE_TO_PP(pg);
        pa = VM_PAGE_TO_PHYS(pg);
        pmap_pp_remove(pp, pa);
@@ -3963,9 +3959,6 @@
        u_int result;
        paddr_t pa;
 
-       /* Need an exclusive lock to prevent PV list changing behind us. */
-       KASSERT(uvm_page_owner_locked_p(pg, true));
-
        pp = VM_PAGE_TO_PP(pg);
        if ((pp->pp_attrs & testbits) != 0) {
                return true;
@@ -4037,9 +4030,6 @@
        struct pmap_page *pp;
        paddr_t pa;
 
-       /* Need an exclusive lock to prevent PV list changing behind us. */
-       KASSERT(uvm_page_owner_locked_p(pg, true));
-
        pp = VM_PAGE_TO_PP(pg);
        pa = VM_PAGE_TO_PHYS(pg);
 
@@ -4316,7 +4306,6 @@
                /* This is a managed page */
                npte |= PTE_PVLIST;
                new_pp = VM_PAGE_TO_PP(new_pg);
-               KASSERT(uvm_page_owner_locked_p(new_pg, false));
        } else if ((new_pp = pmap_pv_tracked(pa)) != NULL) {
                /* This is an unmanaged pv-tracked page */
                npte |= PTE_PVLIST;
@@ -4448,7 +4437,6 @@
         */
        if ((~opte & (PTE_P | PTE_PVLIST)) == 0) {
                if ((old_pg = PHYS_TO_VM_PAGE(oldpa)) != NULL) {
-                       KASSERT(uvm_page_owner_locked_p(old_pg, false));
                        old_pp = VM_PAGE_TO_PP(old_pg);
                } else if ((old_pp = pmap_pv_tracked(oldpa)) == NULL) {
                        panic("%s: PTE_PVLIST with pv-untracked page"
@@ -5212,7 +5200,6 @@
                /* This is a managed page */
                npte |= EPT_PVLIST;
                new_pp = VM_PAGE_TO_PP(new_pg);
-               KASSERT(uvm_page_owner_locked_p(new_pg, false));
        } else if ((new_pp = pmap_pv_tracked(pa)) != NULL) {
                /* This is an unmanaged pv-tracked page */
                npte |= EPT_PVLIST;
@@ -5329,7 +5316,6 @@
         */
        if ((~opte & (EPT_R | EPT_PVLIST)) == 0) {
                if ((old_pg = PHYS_TO_VM_PAGE(oldpa)) != NULL) {
-                       KASSERT(uvm_page_owner_locked_p(old_pg, false));
                        old_pp = VM_PAGE_TO_PP(old_pg);
                } else if ((old_pp = pmap_pv_tracked(oldpa)) == NULL) {
                        panic("%s: EPT_PVLIST with pv-untracked page"
@@ -5495,7 +5481,6 @@
        }
 
        if ((pg = PHYS_TO_VM_PAGE(pmap_pte2pa(opte))) != NULL) {
-               KASSERT(uvm_page_owner_locked_p(pg, false));
                pp = VM_PAGE_TO_PP(pg);
        } else if ((pp = pmap_pv_tracked(pmap_pte2pa(opte))) == NULL) {
                paddr_t pa = pmap_pte2pa(opte);



Home | Main Index | Thread Index | Old Index