From owner-svn-src-head@freebsd.org Tue Feb 21 21:06:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AA4DCE8FE4; Tue, 21 Feb 2017 21:06:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07B7C1B65; Tue, 21 Feb 2017 21:06:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1LL6DKb077435; Tue, 21 Feb 2017 21:06:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1LL6DCi077434; Tue, 21 Feb 2017 21:06:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702212106.v1LL6DCi077434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Feb 2017 21:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314057 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 21:06:14 -0000 Author: markj Date: Tue Feb 21 21:06:12 2017 New Revision: 314057 URL: https://svnweb.freebsd.org/changeset/base/314057 Log: ddb show pte: use pmap of kdb_thread show pte from the pmap of the process of the current DDB thread, instead of necessarily the PCPU pmap. Submitted by: Ryan Libby Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9645 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Feb 21 21:01:01 2017 (r314056) +++ head/sys/amd64/amd64/pmap.c Tue Feb 21 21:06:12 2017 (r314057) @@ -7239,6 +7239,7 @@ pmap_quick_remove_page(vm_offset_t addr) #include "opt_ddb.h" #ifdef DDB +#include #include DB_SHOW_COMMAND(pte, pmap_print_pte) @@ -7250,13 +7251,17 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) pt_entry_t *pte, PG_V; vm_offset_t va; - if (have_addr) { - va = (vm_offset_t)addr; - pmap = PCPU_GET(curpmap); /* XXX */ - } else { + if (!have_addr) { db_printf("show pte addr\n"); return; } + va = (vm_offset_t)addr; + + if (kdb_thread != NULL) + pmap = vmspace_pmap(kdb_thread->td_proc->p_vmspace); + else + pmap = PCPU_GET(curpmap); + PG_V = pmap_valid_bit(pmap); pml4 = pmap_pml4e(pmap, va); db_printf("VA %#016lx pml4e %#016lx", va, *pml4);