From nobody@FreeBSD.org  Thu Jun 10 17:40:28 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0B3C106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Jun 2010 17:40:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A0C148FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Jun 2010 17:40:28 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AHeSCp091241
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Jun 2010 17:40:28 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o5AHeRaa091239;
	Thu, 10 Jun 2010 17:40:27 GMT
	(envelope-from nobody)
Message-Id: <201006101740.o5AHeRaa091239@www.freebsd.org>
Date: Thu, 10 Jun 2010 17:40:27 GMT
From: Michael Moll <kvedulv@kvedulv.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 'ifconfig epair0 create' hangs the whole system
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         147769
>Category:       kern
>Synopsis:       [epair] 'ifconfig epair0 create' hangs the whole system
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bz
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 10 17:50:00 UTC 2010
>Closed-Date:    Sun Oct 17 17:05:39 UTC 2010
>Last-Modified:  Sun Oct 17 17:05:39 UTC 2010
>Originator:     Michael Moll
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD fujisan.kvedulv.de 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Thu Jun 10 18:09:12 CEST 2010     root@fujisan.kvedulv.de:/usr/obj/usr/src/sys/VIMAGE  sparc64
>Description:
This might be specific to sparc64 - or a general VImage problem.

I use r208975 and the following kernel config:
<snip>
include GENERIC
ident VIMAGE
nooptions SCTP
options VIMAGE
options BREAK_TO_DEBUGGER
</snip>

When doing a 'ifconfig epair0 create' the whole machine hangs (no I/O, no ping). A backtrace after breaking shows:

db> bt
Tracing pid 2135 tid 100124 td 0xfffff800045f9270
uart_intr() at uart_intr+0x1ac
intr_event_handle() at intr_event_handle+0x5c
intr_execute_handlers() at intr_execute_handlers+0x8
intr_fast() at intr_fast+0x68
-- interrupt level=0xc pil=0 %o7=0xc0088ff8 --
-- fast data access mmu miss tar=0x127d2a000 %o7=0xc03d7d40 --
mtx_init() at mtx_init+0x134
epair_modevent() at epair_modevent+0xe4
module_register_init() at module_register_init+0xdc
linker_load_module() at linker_load_module+0xbd8
kern_kldload() at kern_kldload+0xd0
kldload() at kldload+0x60
syscallenter() at syscallenter+0x268
syscall() at syscall+0x74
-- syscall (304, FreeBSD ELF64, kldload) %o7=0x102fe0 --
userland() at 0x408c2028
user trace: trap %o7=0x102fe0
pc 0x408c2028, sp 0x7fdffffd8e1
pc 0x104504, sp 0x7fdffffda11
pc 0x102510, sp 0x7fdffffe291
pc 0x40226f54, sp 0x7fdffffe351
done

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bz 
Responsible-Changed-By: bz 
Responsible-Changed-When: Thu Jun 10 17:59:41 UTC 2010 
Responsible-Changed-Why:  
epair(4) is mine. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/147769: commit references a PR
Date: Wed, 22 Sep 2010 12:52:21 +0000 (UTC)

 Author: kib
 Date: Wed Sep 22 12:52:12 2010
 New Revision: 212998
 URL: http://svn.freebsd.org/changeset/base/212998
 
 Log:
   For sparc64 relocations that directly put bits of the symbol value into
   the location, apply elf_relocaddr to the symbol value to have right
   values for the symbols from dpcpu segment.
   
   PR:	kern/147769
   Discussed with:	avg
   Tested by:	marius
   MFC after:	2 weeks
 
 Modified:
   head/sys/sparc64/sparc64/elf_machdep.c
 
 Modified: head/sys/sparc64/sparc64/elf_machdep.c
 ==============================================================================
 --- head/sys/sparc64/sparc64/elf_machdep.c	Wed Sep 22 11:32:22 2010	(r212997)
 +++ head/sys/sparc64/sparc64/elf_machdep.c	Wed Sep 22 12:52:12 2010	(r212998)
 @@ -155,6 +155,7 @@ elf64_dump_thread(struct thread *td __un
  #define _RF_G		0x10000000		/* GOT offset */
  #define _RF_B		0x08000000		/* Load address relative */
  #define _RF_U		0x04000000		/* Unaligned */
 +#define	_RF_X		0x02000000		/* Bare symbols, needs proc */
  #define _RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
  #define _RF_RS(s)	( (s) & 0xff)		/* right shift */
  static const int reloc_target_flags[] = {
 @@ -167,10 +168,10 @@ static const int reloc_target_flags[] = 
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* DISP_32 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP_30 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP_22 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* HI22 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 22 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 13 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LO10 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(10),	/* HI22 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 22 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 13 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* LO10 */
  	_RF_G|			_RF_SZ(32) | _RF_RS(0),		/* GOT10 */
  	_RF_G|			_RF_SZ(32) | _RF_RS(0),		/* GOT13 */
  	_RF_G|			_RF_SZ(32) | _RF_RS(10),	/* GOT22 */
 @@ -189,29 +190,29 @@ static const int reloc_target_flags[] = 
  	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* PCPLT32 */
  	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(10),	/* PCPLT22 */
  	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* PCPLT10 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 10 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 11 */
 -	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* 64 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 10 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 11 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(64) | _RF_RS(0),		/* 64 */
  	_RF_S|_RF_A|/*extra*/	_RF_SZ(32) | _RF_RS(0),		/* OLO10 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(42),	/* HH22 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(32),	/* HM10 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* LM22 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(42),	/* HH22 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(32),	/* HM10 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(10),	/* LM22 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(42),	/* PC_HH22 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(32),	/* PC_HM10 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(10),	/* PC_LM22 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP16 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP19 */
  	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* GLOB_JMP */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 7 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 5 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 6 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 7 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 5 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 6 */
  	_RF_S|_RF_A|_RF_P|	_RF_SZ(64) | _RF_RS(0),		/* DISP64 */
  	      _RF_A|		_RF_SZ(64) | _RF_RS(0),		/* PLT64 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* HIX22 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LOX10 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(22),	/* H44 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(12),	/* M44 */
 -	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* L44 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(10),	/* HIX22 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* LOX10 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(22),	/* H44 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(12),	/* M44 */
 +	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* L44 */
  	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* REGISTER */
  	_RF_S|_RF_A|	_RF_U|	_RF_SZ(64) | _RF_RS(0),		/* UA64 */
  	_RF_S|_RF_A|	_RF_U|	_RF_SZ(16) | _RF_RS(0),		/* UA16 */
 @@ -238,6 +239,7 @@ static const char *reloc_names[] = {
  #define RELOC_BASE_RELATIVE(t)		((reloc_target_flags[t] & _RF_B) != 0)
  #define RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
  #define RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
 +#define	RELOC_BARE_SYMBOL(t)		((reloc_target_flags[t] & _RF_X) != 0)
  #define RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
  #define RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
  
 @@ -334,6 +336,8 @@ elf_reloc(linker_file_t lf, Elf_Addr rel
  		if (addr == 0)
  			return (-1);
  		value += addr;
 +		if (RELOC_BARE_SYMBOL(rtype))
 +			value = elf_relocaddr(lf, value);
  	}
  
  	if (rtype == R_SPARC_OLO10)
 _______________________________________________
 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"
 

From: Michael Moll <kvedulv@kvedulv.de>
To: bug-followup@FreeBSD.org
Cc: bz@freebsd.org, marius@freebsd.org, kib@freebsd.org
Subject: Re: kern/147769: 'ifconfig epair0 create' hangs the whole system
Date: Thu, 23 Sep 2010 16:00:02 +0200

 Hi,
 
 with r212998 in place, this bug is fixed for me.
 
 Thanks!
 -- 
 Michael Moll
State-Changed-From-To: open->patched 
State-Changed-By: bz 
State-Changed-When: Thu Oct 14 16:10:35 UTC 2010 
State-Changed-Why:  
kib comitted a MD fix for at least sparc.  There might still 
be other archs suffering from this but it's not epair specific 
at all, much rather it's a problem that came with dpcpu + MI/MD code. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147769 
State-Changed-From-To: patched->closed 
State-Changed-By: bz 
State-Changed-When: Sun Oct 17 17:05:02 UTC 2010 
State-Changed-Why:  
The change was MFCed with r213478. 
Thanks for reporting and testing. 

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