From mexas@bristol.ac.uk  Tue Jul 17 00:30:51 2012
Return-Path: <mexas@bristol.ac.uk>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1C6831065675
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Jul 2012 00:30:51 +0000 (UTC)
	(envelope-from mexas@bristol.ac.uk)
Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78])
	by mx1.freebsd.org (Postfix) with ESMTP id CA5B78FC12
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Jul 2012 00:30:50 +0000 (UTC)
Received: from ncsc.bris.ac.uk ([137.222.10.41])
	by dirj.bris.ac.uk with esmtp (Exim 4.72)
	(envelope-from <mexas@bristol.ac.uk>)
	id 1Sqvga-00044j-JT
	for FreeBSD-gnats-submit@freebsd.org; Tue, 17 Jul 2012 01:30:44 +0100
Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241])
	by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.72)
	(envelope-from <mexas@bris.ac.uk>)
	id 1Sqvga-0006nT-9f
	for FreeBSD-gnats-submit@freebsd.org; Tue, 17 Jul 2012 01:30:44 +0100
Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1])
	by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5) with ESMTP id q6H0UhqR045043
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Jul 2012 01:30:43 +0100 (BST)
	(envelope-from mexas@mech-cluster241.men.bris.ac.uk)
Received: (from mexas@localhost)
	by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5/Submit) id q6H0UhdS045042;
	Tue, 17 Jul 2012 01:30:43 +0100 (BST)
	(envelope-from mexas)
Message-Id: <201207170030.q6H0UhdS045042@mech-cluster241.men.bris.ac.uk>
Date: Tue, 17 Jul 2012 01:30:43 +0100 (BST)
From: Anton Shterenlikht <mexas@bristol.ac.uk>
Reply-To: Anton Shterenlikht <mexas@bristol.ac.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ia64] netstat -r: kvm_read: Bad address
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         169926
>Category:       ia64
>Synopsis:       [ia64] netstat -r: kvm_read: Bad address
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ia64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 17 00:40:08 UTC 2012
>Closed-Date:    Sun Dec 08 03:43:08 UTC 2013
>Last-Modified:  Sun Dec 08 03:43:08 UTC 2013
>Originator:     Anton Shterenlikht
>Release:        FreeBSD 10.0-CURRENT ia64
>Organization:
University of Bristol
>Environment:
System: FreeBSD mech-cluster241.men.bris.ac.uk 10.0-CURRENT FreeBSD 10.0-CURRENT #6 r237134: Mon Jun 18 09:02:17 BST 2012 root@mech-cluster241.men.bris.ac.uk:/usr/obj/usr/src/sys/TZAV ia64


	
>Description:

On ia64 netstat -r broke some time
between 8.1-release, and r237134.

mech-as221# uname -a
FreeBSD mech-as221.men.bris.ac.uk 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Sun Jul 18 18:31:37 UTC 2010     root@pluto1.freebsd.org:/usr/obj/usr/src/sys/GENERIC  ia64
mech-as221# netstat -r
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            enlib-gw.bris.ac.u UGS        38   219979   bge0
10.10.10.0         link#1             U           0        0   fxp0
10.10.10.13        link#1             UHS         0        0    lo0
localhost          link#3             UH          0       54    lo0
137.222.187.0      link#2             U           0       18   bge0
mech-as221         link#2             UHS         0        0    lo0

Internet6:
Destination        Gateway            Flags      Netif Expire
localhost          localhost          UH          lo0
fe80::%lo0         link#3             U           lo0
fe80::1%lo0        link#3             UHS         lo0
ff01:3::           fe80::1%lo0        U           lo0
ff02::%lo0         fe80::1%lo0        U           lo0
mech-as221#

However, in -current:

# uname -a
FreeBSD mech-cluster241.men.bris.ac.uk 10.0-CURRENT FreeBSD 10.0-CURRENT #6 r237134: Mon Jun 18 09:02:17 BST 2012     root@mech-cluster241.men.bris.ac.uk:/usr/obj/usr/src/sys/TZAV  ia64
# netstat -r
Routing tables
netstat: kvm_read: Bad address
#

	
>How-To-Repeat:
	
>Fix:

	
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: marcel 
State-Changed-When: Mon Feb 25 02:49:55 UTC 2013 
State-Changed-Why:  
Fixed in 10-CURRENT. Awaiting MFC to 9-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169926 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ia64/169926: commit references a PR
Date: Mon, 25 Feb 2013 02:41:47 +0000 (UTC)

 Author: marcel
 Date: Mon Feb 25 02:41:38 2013
 New Revision: 247251
 URL: http://svnweb.freebsd.org/changeset/base/247251
 
 Log:
   kernacc() expects all KVAs to be covered in the kernel map. With the
   introduction of the PBVM, this stopped being the case. Redefine the
   VM parameters so that the PBVM is included in the kernel map. In
   particular this introduces VM_INIT_KERNEL_ADDRESS to point to the base
   of region 5 now that VM_MIN_KERNEL_ADDRESS points to the base of
   region 4 to include the PBVM.
   While here define KERNBASE to the actual link address of the kernel as
   is intended.
   
   PR:		169926
 
 Modified:
   head/sys/ia64/ia64/pmap.c
   head/sys/ia64/include/vmparam.h
 
 Modified: head/sys/ia64/ia64/pmap.c
 ==============================================================================
 --- head/sys/ia64/ia64/pmap.c	Mon Feb 25 01:50:04 2013	(r247250)
 +++ head/sys/ia64/ia64/pmap.c	Mon Feb 25 02:41:38 2013	(r247251)
 @@ -387,7 +387,7 @@ pmap_bootstrap()
  	 */
  	ia64_kptdir = ia64_physmem_alloc(PAGE_SIZE, PAGE_SIZE);
  	nkpt = 0;
 -	kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
 +	kernel_vm_end = VM_INIT_KERNEL_ADDRESS;
  
  	/*
  	 * Determine a valid (mappable) VHPT size.
 @@ -425,7 +425,7 @@ pmap_bootstrap()
  	ia64_set_pta(base + (1 << 8) + (pmap_vhpt_log2size << 2) + 1);
  	ia64_srlz_i();
  
 -	virtual_avail = VM_MIN_KERNEL_ADDRESS;
 +	virtual_avail = VM_INIT_KERNEL_ADDRESS;
  	virtual_end = VM_MAX_KERNEL_ADDRESS;
  
  	/*
 @@ -1383,7 +1383,7 @@ pmap_kextract(vm_offset_t va)
  	/* Region 5 is our KVA. Bail out if the VA is beyond our limits. */
  	if (va >= kernel_vm_end)
  		goto err_out;
 -	if (va >= VM_MIN_KERNEL_ADDRESS) {
 +	if (va >= VM_INIT_KERNEL_ADDRESS) {
  		pte = pmap_find_kpte(va);
  		pa = pmap_present(pte) ? pmap_ppn(pte) | (va & PAGE_MASK) : 0;
  		goto out;
 @@ -2746,7 +2746,7 @@ DB_COMMAND(kpte, db_kpte)
  		db_printf("usage: kpte <kva>\n");
  		return;
  	}
 -	if (addr < VM_MIN_KERNEL_ADDRESS) {
 +	if (addr < VM_INIT_KERNEL_ADDRESS) {
  		db_printf("kpte: error: invalid <kva>\n");
  		return;
  	}
 
 Modified: head/sys/ia64/include/vmparam.h
 ==============================================================================
 --- head/sys/ia64/include/vmparam.h	Mon Feb 25 01:50:04 2013	(r247250)
 +++ head/sys/ia64/include/vmparam.h	Mon Feb 25 02:41:38 2013	(r247251)
 @@ -181,12 +181,13 @@
  /* user/kernel map constants */
  #define	VM_MIN_ADDRESS		0
  #define	VM_MAXUSER_ADDRESS	IA64_RR_BASE(IA64_VM_MINKERN_REGION)
 -#define	VM_MIN_KERNEL_ADDRESS	IA64_RR_BASE(IA64_VM_MINKERN_REGION + 1)
 -#define	VM_MAX_KERNEL_ADDRESS	\
 -		(VM_MIN_KERNEL_ADDRESS + IA64_REGION_GAP_START - 1)
 +#define	VM_MIN_KERNEL_ADDRESS	VM_MAXUSER_ADDRESS
 +#define	VM_INIT_KERNEL_ADDRESS	IA64_RR_BASE(IA64_VM_MINKERN_REGION + 1)
 +#define	VM_MAX_KERNEL_ADDRESS	(IA64_RR_BASE(IA64_VM_MINKERN_REGION + 2) - 1)
  #define	VM_MAX_ADDRESS		~0UL
  
 -#define	KERNBASE		VM_MAXUSER_ADDRESS
 +/* We link the kernel at IA64_PBVM_BASE. */
 +#define	KERNBASE		IA64_PBVM_BASE
  
  /*
   * USRSTACK is the top (end) of the user stack.  Immediately above the user
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: marcel 
State-Changed-When: Sun Dec 8 03:41:53 UTC 2013 
State-Changed-Why:  
10-current is now 10-stable and 10.0 is about to be released. The MFC 
to 9-stable is pretty much obsolete by events. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169926 
>Unformatted:
