Re: svn commit: r258328 - head/sys/net

2013-11-23 Thread Robert Watson

On Wed, 20 Nov 2013, Adrian Chadd wrote:

We should migrate drivers to use a multi-input method where it's 
appropriate. It's the same pain as if_transmit() is/was.


I'd really like to avoid having hacky solutions like mbufs with magic types. 
If we're going down that path, we should create a correct inline messaging 
mechanism that includes arbitrary messages in the stream, where some may or 
may not be mbufs. Magic mbufs just makes me want to tear out my eyes a 
little.


So, the reason I'd like to back it out is because we should be doing it via 
a multi method with some type that represents an mbuf list. If George 
doesn't mind, I'll add a multi input method, move this stuff into it, and 
make ether_input just be single frames.


My worry here is that the failure modes for easy oversights and bugs are quite 
subtle ones: mbuf leakage and data corruption.  Our goal should be to shift as 
many as possible of those bugs to compiler-detected events (e.g., due to type 
checking), or where not possible, run-time detected events (e.g., due to 
easily detected non-NULL pointers).  I'm OK with the current change staying in 
the tree for a few weeks on the path there, but I much prefer the world in 
which we use different symbols for different types.  This is especially 
important if we will have device driver vendors maintaining drivers across 
many versions (which we do): we really don't want a driver using ether_input 
for queue handoff in 11.x to just mysteriously leak mbufs in 10.x.  Instead, 
the driver should fail to compile.


Robert
___
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-unsubscr...@freebsd.org


Re: svn commit: r258328 - head/sys/net

2013-11-23 Thread Robert Watson

On Wed, 20 Nov 2013, Julian Elischer wrote:

After that it'd be nice to write a set of mbuf list macros for abstract the 
whole queue, dequeue, concat, iterate, etc (like sys/queue.h, but for 
mbufs.)


What do people think?

(I've been doing it for m-next chained things, but not m-m_nextpkt 
things..)


I was thinking: new interfaces.. (your -multi names sound good). macros for 
handling said lists so that people don't screw them up Old drivers run with 
no change.


To me, the name multi is ambiguous: could be multicast.  If we call the new 
datastructure mbqueue or mqueue, then we should name the method 
ether_input_mbqueue or ether_input_mqueue.


Robert










-adrian


On 18 November 2013 14:58, George V. Neville-Neil g...@freebsd.org wrote:

Author: gnn
Date: Mon Nov 18 22:58:14 2013
New Revision: 258328
URL: http://svnweb.freebsd.org/changeset/base/258328

Log:
   Allow ethernet drivers to pass in packets connected via the nextpkt 
pointer.
   Handling packets in this way allows drivers to amortize work during 
packet reception.


   Submitted by: Vijay Singh
   Sponsored by: NetApp

Modified:
   head/sys/net/if_ethersubr.c

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013(r258327)
+++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013(r258328)
@@ -708,13 +708,25 @@ static void
  ether_input(struct ifnet *ifp, struct mbuf *m)
  {

+   struct mbuf *mn;
+
 /*
-* We will rely on rcvif being set properly in the deferred 
context,

-* so assert it is correct here.
+* The drivers are allowed to pass in a chain of packets linked 
with

+* m_nextpkt. We split them up into separate packets here and pass
+* them up. This allows the drivers to amortize the receive lock.
  */
-   KASSERT(m-m_pkthdr.rcvif == ifp, (%s: ifnet mismatch, 
__func__));

+   while (m) {
+   mn = m-m_nextpkt;
+   m-m_nextpkt = NULL;

-   netisr_dispatch(NETISR_ETHER, m);
+   /*
+* We will rely on rcvif being set properly in the 
deferred context,

+* so assert it is correct here.
+*/
+   KASSERT(m-m_pkthdr.rcvif == ifp, (%s: ifnet mismatch, 
__func__));

+   netisr_dispatch(NETISR_ETHER, m);
+   m = mn;
+   }
  }

  /*




___
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-unsubscr...@freebsd.org


svn commit: r258495 - head/release/doc/en_US.ISO8859-1/hardware

2013-11-23 Thread Alexander Motin
Author: mav
Date: Sat Nov 23 11:46:13 2013
New Revision: 258495
URL: http://svnweb.freebsd.org/changeset/base/258495

Log:
  MFreleng/8.4 r251256 (by hrs):
  Update description of logical CPU handling in the latest releases and
  remove obsolete sysctl variable machdep.hlt_logical_cpus.
  
  MFC after:3 days

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.xml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml
==
--- head/release/doc/en_US.ISO8859-1/hardware/article.xml   Sat Nov 23 
03:56:03 2013(r258494)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.xml   Sat Nov 23 
11:46:13 2013(r258495)
@@ -177,16 +177,13 @@
bugs may generate some problems.  Perusal of the archives of
the a.smp; may yield some clues./para
 
-  paraos; will take advantage of HyperThreading (HTT) support
-   on intel; CPUs that support this feature.  The
-   default os; scheduler treats the logical processors the same
-   as additional physical processors; in other words, no attempt
-   is made to optimize scheduling decisions given the shared
-   resources between logical processors within the same CPU.
-   Because this naive scheduling can result in suboptimal
-   performance, under certain circumstances it may be useful to
-   disable the logical processors with the
-   varnamemachdep.hyperthreading_allowed/varname tunable.
+  paraos; will take advantage of SMT (Symmetric MultiThreading,
+   also known as HyperThreading on intel; CPUs) on the supported
+   CPUs.  The filenameGENERIC/filename kernel which is
+   installed by default will automatically detect the additional
+   logical processors.  The default os; scheduler recognizes
+   processor topology on the system and selects logical and
+   physical processors to obtain optimal performance.
The man.smp.4; manual page has more details./para
 
   paraos; will take advantage of Physical Address Extensions
___
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-unsubscr...@freebsd.org


svn commit: r258496 - stable/10/lib/libiconv_modules/UTF7

2013-11-23 Thread Tijl Coosemans
Author: tijl
Date: Sat Nov 23 12:17:05 2013
New Revision: 258496
URL: http://svnweb.freebsd.org/changeset/base/258496

Log:
  MFC r258316:
  
  Bug fixes in iconv(3) UTF-7 support.
  
  - Add ' to the list of directly encoded characters and * to the list of
optionally directly encoded characters as per RFC 2152.
  
  - In _citrus_UTF7_mbtoutf16 on end of input when the next output character
has only been partially decoded, save a copy of the buffer of input
characters (not just its length).  On the next call with more input
characters this buffer is reprocessed together with the new input to
form a fully decoded output character.
  
  - At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT)
by decrementing psenc-chlen and i.  This is needed to make room in
psenc-ch (input buffer) in case the next input character starts a new
base64 encoded sequence.  And also, if this is the end of input and no
output character can be returned, this brings the encoder in the initial
state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which
is used by the caller to distinguish between no output and partial
output.
  
  - In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer)
directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0).  This way s
is updated correctly in case of errors.
  
  - In _citrus_UTF7_mbrtowc_priv when called with psenc-surrogate set
(previous call did not have enough input), retrieve the previously
decoded UTF-16 character from (psenc-cache  psenc-bits) instead of
(psenc-cache  2).
  
  Approved by:  re (kib)

Modified:
  stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c
Directory Properties:
  stable/10/lib/libiconv_modules/   (props changed)

Modified: stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c
==
--- stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c   Sat Nov 23 11:46:13 
2013(r258495)
+++ stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c   Sat Nov 23 12:17:05 
2013(r258496)
@@ -113,9 +113,9 @@ static const char base64[] =
 static const char direct[] =
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
-   0123456789(),-./:?;
+   0123456789'(),-./:?;
 
-static const char option[] = !\#$%';=@[]^_`{|};
+static const char option[] = !\#$%*;=@[]^_`{|};
 static const char spaces[] =  \t\r\n;
 
 #defineBASE64_BIT  6
@@ -165,6 +165,7 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo
*nresult = (size_t)-2;
*s = s0;
sv.chlen = psenc-chlen;
+   memcpy(sv.ch, psenc-ch, sizeof(sv.ch));
*psenc = sv;
return (0);
}
@@ -202,6 +203,9 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo
goto ilseq;
*u16 = (uint16_t)psenc-ch[i];
done = 1;
+   } else {
+   psenc-chlen--;
+   i--;
}
} else {
psenc-cache =
@@ -241,7 +245,6 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI
 wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
 _UTF7State * __restrict psenc, size_t * __restrict nresult)
 {
-   const char *s0;
uint32_t u32;
uint16_t hi, lo;
size_t nr, siz;
@@ -252,14 +255,13 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI
*nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT;
return (0);
}
-   s0 = *s;
if (psenc-surrogate) {
-   hi = (psenc-cache  2)  UTF16_MAX;
+   hi = (psenc-cache  psenc-bits)  UTF16_MAX;
if (hi  HISRG_MIN || hi  HISRG_MAX)
return (EINVAL);
siz = 0;
} else {
-   err = _citrus_UTF7_mbtoutf16(ei, hi, s0, n, psenc, nr);
+   err = _citrus_UTF7_mbtoutf16(ei, hi, s, n, psenc, nr);
if (nr == (size_t)-1 || nr == (size_t)-2) {
*nresult = nr;
return (err);
@@ -274,7 +276,7 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI
}
psenc-surrogate = 1;
}
-   err = _citrus_UTF7_mbtoutf16(ei, lo, s0, n, psenc, nr);
+   err = _citrus_UTF7_mbtoutf16(ei, lo, s, n, psenc, nr);
if (nr == (size_t)-1 || nr == (size_t)-2) {
*nresult = nr;
return (err);
@@ -286,7 +288,6 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI
u32 = (hi  10 | lo) + SRG_BASE;
siz += nr;
 done:
-   *s = s0;
if (pwc != NULL)
*pwc = 

svn commit: r258497 - head/sys/vm

2013-11-23 Thread Alexander Motin
Author: mav
Date: Sat Nov 23 13:42:56 2013
New Revision: 258497
URL: http://svnweb.freebsd.org/changeset/base/258497

Log:
  When purging per-CPU UMA caches do not return empty buckets into the global
  full bucket cache to not trigger assertion if allocation happen before that
  global cache get purged.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Sat Nov 23 12:17:05 2013(r258496)
+++ head/sys/vm/uma_core.c  Sat Nov 23 13:42:56 2013(r258497)
@@ -701,25 +701,37 @@ static void
 cache_drain_safe_cpu(uma_zone_t zone)
 {
uma_cache_t cache;
+   uma_bucket_t b1, b2;
 
if (zone-uz_flags  UMA_ZFLAG_INTERNAL)
return;
 
+   b1 = b2 = NULL;
ZONE_LOCK(zone);
critical_enter();
cache = zone-uz_cpu[curcpu];
if (cache-uc_allocbucket) {
-   LIST_INSERT_HEAD(zone-uz_buckets, cache-uc_allocbucket,
-   ub_link);
+   if (cache-uc_allocbucket-ub_cnt != 0)
+   LIST_INSERT_HEAD(zone-uz_buckets,
+   cache-uc_allocbucket, ub_link);
+   else
+   b1 = cache-uc_allocbucket;
cache-uc_allocbucket = NULL;
}
if (cache-uc_freebucket) {
-   LIST_INSERT_HEAD(zone-uz_buckets, cache-uc_freebucket,
-   ub_link);
+   if (cache-uc_freebucket-ub_cnt != 0)
+   LIST_INSERT_HEAD(zone-uz_buckets,
+   cache-uc_freebucket, ub_link);
+   else
+   b2 = cache-uc_freebucket;
cache-uc_freebucket = NULL;
}
critical_exit();
ZONE_UNLOCK(zone);
+   if (b1)
+   bucket_free(zone, b1, NULL);
+   if (b2)
+   bucket_free(zone, b2, NULL);
 }
 
 /*
___
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-unsubscr...@freebsd.org


Re: svn commit: r258497 - head/sys/vm

2013-11-23 Thread Mark Robert Vaughan Murray

On 23 Nov 2013, at 13:42, Alexander Motin m...@freebsd.org wrote:

 Author: mav
 Date: Sat Nov 23 13:42:56 2013
 New Revision: 258497
 URL: http://svnweb.freebsd.org/changeset/base/258497
 
 Log:
  When purging per-CPU UMA caches do not return empty buckets into the global
  full bucket cache to not trigger assertion if allocation happen before that
  global cache get purged.

Thanks - this one has been getting me!

M
-- 
Mark R V Murray



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r258499 - head/lib/libthr/thread

2013-11-23 Thread Konstantin Belousov
Author: kib
Date: Sat Nov 23 15:48:17 2013
New Revision: 258499
URL: http://svnweb.freebsd.org/changeset/base/258499

Log:
  If check_deferred_signal() execution needs binding of PLT symbol,
  unlocking the rtld bind lock results in the processing of ast and
  recursing into the check_deferred_signal().  Nested execution of
  check_deferred_signal() delivers the signal to user code and clears
  si_signo.  On return, top-level check_deferred_signal() frame
  continues delivering the same signal one more time, but now with zero
  si_signo.
  
  Fix this by adding a flag to indicate that deferred delivery is
  running, so check_deferred_signal() should avoid doing anything. Since
  user signal handler is allowed to modify the passed machine context to
  make return from the signal handler to cause arbitrary jump, or do
  longjmp(). For this case, also clear the flag in thr_sighandler(),
  since kernel signal delivery means that nested delivery code should
  not run right now.
  
  Reported by:  Vitaly Magerya vmage...@gmail.com
  Reviewed by:  davidxu, jilles
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libthr/thread/thr_private.h
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_private.h
==
--- head/lib/libthr/thread/thr_private.hSat Nov 23 14:54:20 2013
(r258498)
+++ head/lib/libthr/thread/thr_private.hSat Nov 23 15:48:17 2013
(r258499)
@@ -433,6 +433,9 @@ struct pthread {
/* the sigaction should be used for deferred signal. */
struct sigactiondeferred_sigact;
 
+   /* deferred signal delivery is performed, do not reenter. */
+   int deferred_run;
+
/* Force new thread to exit. */
int force_exit;
 

Modified: head/lib/libthr/thread/thr_sig.c
==
--- head/lib/libthr/thread/thr_sig.cSat Nov 23 14:54:20 2013
(r258498)
+++ head/lib/libthr/thread/thr_sig.cSat Nov 23 15:48:17 2013
(r258499)
@@ -162,6 +162,7 @@ thr_sighandler(int sig, siginfo_t *info,
act = _thr_sigact[sig-1].sigact;
_thr_rwl_unlock(_thr_sigact[sig-1].lock);
errno = err;
+   curthread-deferred_run = 0;
 
/*
 * if a thread is in critical region, for example it holds low level 
locks,
@@ -320,14 +321,18 @@ check_deferred_signal(struct pthread *cu
siginfo_t info;
int uc_len;
 
-   if (__predict_true(curthread-deferred_siginfo.si_signo == 0))
+   if (__predict_true(curthread-deferred_siginfo.si_signo == 0 ||
+   curthread-deferred_run))
return;
 
+   curthread-deferred_run = 1;
uc_len = __getcontextx_size();
uc = alloca(uc_len);
getcontext(uc);
-   if (curthread-deferred_siginfo.si_signo == 0)
+   if (curthread-deferred_siginfo.si_signo == 0) {
+   curthread-deferred_run = 0;
return;
+   }
__fillcontextx2((char *)uc);
act = curthread-deferred_sigact;
uc-uc_sigmask = curthread-deferred_sigmask;
___
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-unsubscr...@freebsd.org


svn commit: r258501 - in head/contrib: gcc gcc/cp gcc/doc gcclibs/libcpp gcclibs/libcpp/include libstdc++/include/ext

2013-11-23 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Nov 23 18:32:53 2013
New Revision: 258501
URL: http://svnweb.freebsd.org/changeset/base/258501

Log:
  gcc: Bring updates from Google's enhanced gcc-4.2.1.
  
  Google released and enhanced version of gcc-4.2.1 plus their local
  patches for Android[1].
  
  The patches are owned by Google and the license hasn't been changed
  from  the original GPLv2. We are only bringing a subset of the
  available patches that may be helpful in FreeBSD. Changes specific
  to android are not included.
  
  From the README.google file[1].
  
  Patches applied to google_vendor_src_branch/gcc/gcc-4.2.1:
  
  gcc/Makefile.in
  gcc/c-common.c
  gcc/c-common.h
  gcc/c-opts.c
  gcc/c-typeck.c
  gcc/cp/typeck.c
  gcc/doc/invoke.texi
  gcc/flags.h
  gcc/opts.c
  gcc/tree-flow.h
  gcc/tree-ssa-alias-warnings.c
  gcc/tree-ssa-alias.c
  
   Backport of -Wstrict-aliasing from mainline.
Silvius Rus r...@google.com
  
  gcc/coverage.c:
Patch coverage_checksum_string for PR 25351.
Seongbae Park sp...@google.com
Not yet submitted to FSF.
  
  gcc/c-opts.c
  gcc/c-ppoutput.c
  gcc/c.opt
  gcc/doc/cppopts.texi
  libcpp/Makefile.in
  libcpp/directives-only.c
  libcpp/directives.c
  libcpp/files.c
  libcpp/include/cpplib.h
  libcpp/init.c
  libcpp/internal.h
  libcpp/macro.c
Support for -fdirectives-only.
Ollie Wild a...@google.com.
Submitted to FSF but not yet approved.
  
  libstdc++-v3/include/ext/hashtable.h
http://b/742065
http://b/629994
Reduce min size of hashtable for hash_map, hash_set from 53 to 5
  
  libstdc++-v3/include/ext/hashtable.h
http://b/629994
Do not iterate over buckets if hashtable is empty.
  
  gcc/common.opt
  gcc/doc/invoke.texi
  gcc/flags.h
  gcc/gimplify.c
  gcc/opts.c
Add Saito's patch for -finstrument-functions-exclude-* options.
  
  gcc/common.opt
  gcc/doc/invoke.texi
  gcc/final.c
  gcc/flags.h
  gcc/opts.c
  gcc/testsuite/gcc.dg/Wframe-larger-than.c
Add a new flag -Wframe-larger-than- which enables a new warning
when a frame size of a function is larger than specified.
This patch hasn't been integrated into gcc mainline yet.
  
  gcc/tree-vrp.c
Add a hack to avoid using ivopts information for pointers starting
at constant values.
  
  Reference:
  
  [1]
  https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.2.1/
  
  Obtained from:Google Inc.
  MFC after:3 weeks

Added:
  head/contrib/gcc/tree-ssa-alias-warnings.c   (contents, props changed)
  head/contrib/gcclibs/libcpp/directives-only.c   (contents, props changed)
Modified:
  head/contrib/gcc/c-common.c
  head/contrib/gcc/c-common.h
  head/contrib/gcc/c-opts.c
  head/contrib/gcc/c-ppoutput.c
  head/contrib/gcc/c-typeck.c
  head/contrib/gcc/c.opt
  head/contrib/gcc/common.opt
  head/contrib/gcc/coverage.c
  head/contrib/gcc/cp/typeck.c
  head/contrib/gcc/doc/cppopts.texi
  head/contrib/gcc/doc/invoke.texi
  head/contrib/gcc/final.c
  head/contrib/gcc/flags.h
  head/contrib/gcc/gimplify.c
  head/contrib/gcc/opts.c
  head/contrib/gcc/tree-flow.h
  head/contrib/gcc/tree-ssa-alias.c
  head/contrib/gcc/tree-vrp.c
  head/contrib/gcclibs/libcpp/Makefile.in
  head/contrib/gcclibs/libcpp/directives.c
  head/contrib/gcclibs/libcpp/files.c
  head/contrib/gcclibs/libcpp/include/cpplib.h
  head/contrib/gcclibs/libcpp/init.c
  head/contrib/gcclibs/libcpp/internal.h
  head/contrib/gcclibs/libcpp/macro.c
  head/contrib/libstdc++/include/ext/hashtable.h

Modified: head/contrib/gcc/c-common.c
==
--- head/contrib/gcc/c-common.c Sat Nov 23 17:20:24 2013(r258500)
+++ head/contrib/gcc/c-common.c Sat Nov 23 18:32:53 2013(r258501)
@@ -983,35 +983,67 @@ unsigned_conversion_warning (tree result
strict aliasing mode is in effect. OTYPE is the original
TREE_TYPE of EXPR, and TYPE the type we're casting to. */
 
-void
+bool
 strict_aliasing_warning (tree otype, tree type, tree expr)
 {
-  if (flag_strict_aliasing  warn_strict_aliasing
-   POINTER_TYPE_P (type)  POINTER_TYPE_P (otype)
-   TREE_CODE (expr) == ADDR_EXPR
+  if (!(flag_strict_aliasing  POINTER_TYPE_P (type) 
+ POINTER_TYPE_P (otype)  !VOID_TYPE_P (TREE_TYPE (type
+return false;
+
+  if ((warn_strict_aliasing  1)  TREE_CODE (expr) == ADDR_EXPR
(DECL_P (TREE_OPERAND (expr, 0))
-  || handled_component_p (TREE_OPERAND (expr, 0)))
-   !VOID_TYPE_P (TREE_TYPE (type)))
+  || handled_component_p (TREE_OPERAND (expr, 0
 {
   /* Casting the address of an object to non void pointer. Warn
  if the cast breaks type based aliasing.  */
-  if (!COMPLETE_TYPE_P (TREE_TYPE (type)))
-warning (OPT_Wstrict_aliasing, type-punning to incomplete type 
- might break strict-aliasing rules);
+  if (!COMPLETE_TYPE_P (TREE_TYPE (type))  warn_strict_aliasing == 2)
+   {
+ warning (OPT_Wstrict_aliasing, type-punning to 

svn commit: r258502 - in head/lib/libc: powerpc powerpc64

2013-11-23 Thread Andreas Tobler
Author: andreast
Date: Sat Nov 23 18:50:43 2013
New Revision: 258502
URL: http://svnweb.freebsd.org/changeset/base/258502

Log:
  Get rid of the CONCAT macro.

Modified:
  head/lib/libc/powerpc/SYS.h
  head/lib/libc/powerpc64/SYS.h

Modified: head/lib/libc/powerpc/SYS.h
==
--- head/lib/libc/powerpc/SYS.h Sat Nov 23 18:32:53 2013(r258501)
+++ head/lib/libc/powerpc/SYS.h Sat Nov 23 18:50:43 2013(r258502)
@@ -36,24 +36,24 @@
 #define_SYSCALL(name)  \
.text;  \
.align 2;   \
-   li  0,(__CONCAT(SYS_, name));   \
+   li  0,(SYS_##name); \
sc
 
 #defineSYSCALL(name)   \
.text;  \
.align 2;   \
 2: b   PIC_PLT(CNAME(HIDENAME(cerror)));   \
-ENTRY(__CONCAT(__sys_, name)); \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), name);   \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
+ENTRY(__sys_##name);   \
+   WEAK_REFERENCE(__sys_##name, name); \
+   WEAK_REFERENCE(__sys_##name, _##name);  \
_SYSCALL(name); \
bso 2b
 
 #definePSEUDO(name)\
.text;  \
.align 2;   \
-ENTRY(__CONCAT(__sys_, name)); \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
+ENTRY(__sys_##name);   \
+   WEAK_REFERENCE(__sys_##name, _##name);  \
_SYSCALL(name); \
bnslr;  \
b   PIC_PLT(CNAME(HIDENAME(cerror)))
@@ -62,9 +62,9 @@ ENTRY(__CONCAT(__sys_, name));
\
.text;  \
.align 2;   \
 2: b   PIC_PLT(CNAME(HIDENAME(cerror)));   \
-ENTRY(__CONCAT(__sys_, name)); \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), name);   \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
+ENTRY(__sys_##name);   \
+   WEAK_REFERENCE(__sys_##name, name); \
+   WEAK_REFERENCE(__sys_##name, _##name);  \
_SYSCALL(name); \
bnslr;  \
b   PIC_PLT(CNAME(HIDENAME(cerror)))

Modified: head/lib/libc/powerpc64/SYS.h
==
--- head/lib/libc/powerpc64/SYS.h   Sat Nov 23 18:32:53 2013
(r258501)
+++ head/lib/libc/powerpc64/SYS.h   Sat Nov 23 18:50:43 2013
(r258502)
@@ -36,7 +36,7 @@
 #define_SYSCALL(name)  \
.text;  \
.align 2;   \
-   li  0,(__CONCAT(SYS_, name));   \
+   li  0,(SYS_##name); \
sc
 
 #defineSYSCALL(name)   \
@@ -51,17 +51,17 @@
ld  %r0,16(%r1);\
mtlr%r0;\
blr;\
-ENTRY(__CONCAT(__sys_, name)); \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), name);   \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));  \
-   _SYSCALL(name); \
+ENTRY(__sys_##name);   \
+   WEAK_REFERENCE(__sys_##name, name); \
+   WEAK_REFERENCE(__sys_##name, _##name);  \
+   _SYSCALL(name); \
bso 2b
 
 #definePSEUDO(name)\
.text;  \
.align 2;   \
-ENTRY(__CONCAT(__sys_, name)); \
-   WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));   \

svn commit: r258503 - head/sys/powerpc/pseries

2013-11-23 Thread Andreas Tobler
Author: andreast
Date: Sat Nov 23 18:52:14 2013
New Revision: 258503
URL: http://svnweb.freebsd.org/changeset/base/258503

Log:
  Limit the large page size to 16MB for now.
  
  MFC after:1 week

Modified:
  head/sys/powerpc/pseries/mmu_phyp.c

Modified: head/sys/powerpc/pseries/mmu_phyp.c
==
--- head/sys/powerpc/pseries/mmu_phyp.c Sat Nov 23 18:50:43 2013
(r258502)
+++ head/sys/powerpc/pseries/mmu_phyp.c Sat Nov 23 18:52:14 2013
(r258503)
@@ -165,6 +165,11 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t 
nptlp--;
}
}
+
+   /* For now we allow shift only to be = 0x18. */
+   if (shift = 0x18)
+   shift = 0x18;
+
moea64_large_page_shift = shift;
moea64_large_page_size = 1ULL  shift;
}
___
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-unsubscr...@freebsd.org


svn commit: r258504 - in head/sys/powerpc: aim include ofw

2013-11-23 Thread Andreas Tobler
Author: andreast
Date: Sat Nov 23 18:58:17 2013
New Revision: 258504
URL: http://svnweb.freebsd.org/changeset/base/258504

Log:
  Save and restore the trap vectors when doing OF calls on pSeries machines.
  
  It turned out that on pSeries machines the call into OF modified the trap
  vectors and this made further behaviour unpredictable.
  
  With this commit I'm now able to boot multi user on a network booted
  environment on my IntelliStation 285. This is a POWER5+ machine.
  
  Discussed with:   nwhitehorn
  MFC after:1 week

Modified:
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/include/ofw_machdep.h
  head/sys/powerpc/ofw/ofw_machdep.c

Modified: head/sys/powerpc/aim/machdep.c
==
--- head/sys/powerpc/aim/machdep.c  Sat Nov 23 18:52:14 2013
(r258503)
+++ head/sys/powerpc/aim/machdep.c  Sat Nov 23 18:58:17 2013
(r258504)
@@ -123,6 +123,7 @@ __FBSDID($FreeBSD$);
 #include machine/spr.h
 #include machine/trap.h
 #include machine/vmparam.h
+#include machine/ofw_machdep.h
 
 #include ddb/ddb.h
 
@@ -249,6 +250,7 @@ extern void *dblow, *dbsize;
 extern void*imisstrap, *imisssize;
 extern void*dlmisstrap, *dlmisssize;
 extern void*dsmisstrap, *dsmisssize;
+char   save_trap_init[0x2f00]; /* EXC_LAST */
 
 uintptr_t
 powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
@@ -273,6 +275,9 @@ powerpc_init(vm_offset_t startkernel, vm
trap_offset = 0;
cacheline_warn = 0;
 
+   /* Save trap vectors. */
+   ofw_save_trap_vec(save_trap_init);
+
 #ifdef WII
/*
 * The Wii loader doesn't pass us any environment so, mdp

Modified: head/sys/powerpc/include/ofw_machdep.h
==
--- head/sys/powerpc/include/ofw_machdep.h  Sat Nov 23 18:52:14 2013
(r258503)
+++ head/sys/powerpc/include/ofw_machdep.h  Sat Nov 23 18:58:17 2013
(r258504)
@@ -47,5 +47,6 @@ void OF_reboot(void);
 
 void ofw_mem_regions(struct mem_region **, int *, struct mem_region **, int *);
 void ofw_quiesce(void); /* Must be called before VM is up! */
+void ofw_save_trap_vec(char *);
 
 #endif /* _MACHINE_OFW_MACHDEP_H_ */

Modified: head/sys/powerpc/ofw/ofw_machdep.c
==
--- head/sys/powerpc/ofw/ofw_machdep.c  Sat Nov 23 18:52:14 2013
(r258503)
+++ head/sys/powerpc/ofw/ofw_machdep.c  Sat Nov 23 18:58:17 2013
(r258504)
@@ -59,6 +59,7 @@ __FBSDID($FreeBSD$);
 #include machine/md_var.h
 #include machine/platform.h
 #include machine/ofw_machdep.h
+#include machine/trap.h
 
 static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ];
 static struct mem_region OFfree[PHYS_AVAIL_SZ];
@@ -70,10 +71,31 @@ extern register_t ofmsr[5];
 extern void*openfirmware_entry;
 static void*fdt;
 intofw_real_mode;
+extern char save_trap_init[0x2f00];  /* EXC_LAST */
+charsave_trap_of[0x2f00];/* EXC_LAST */
 
 intofwcall(void *);
 static int openfirmware(void *args);
 
+__inline void
+ofw_save_trap_vec(char *save_trap_vec)
+{
+   if (apple_hacks)
+return;
+
+   bcopy((void *)EXC_RST, save_trap_vec, EXC_LAST - EXC_RST);
+}
+
+static __inline void
+ofw_restore_trap_vec(char *restore_trap_vec)
+{
+   if (apple_hacks)
+return;
+
+   bcopy(restore_trap_vec, (void *)EXC_RST, EXC_LAST - EXC_RST);
+   __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD);
+}
+
 /*
  * Saved SPRG0-3 from OpenFirmware. Will be restored prior to the callback.
  */
@@ -524,6 +546,12 @@ openfirmware_core(void *args)
 
ofw_sprg_prepare();
 
+   /* Save trap vectors */
+   ofw_save_trap_vec(save_trap_of);
+
+   /* Restore initially saved trap vectors */
+   ofw_restore_trap_vec(save_trap_init);
+
 #if defined(AIM)  !defined(__powerpc64__)
/*
 * Clear battable[] translations
@@ -535,6 +563,10 @@ openfirmware_core(void *args)
 #endif
 
result = ofwcall(args);
+
+   /* Restore trap vecotrs */
+   ofw_restore_trap_vec(save_trap_of);
+
ofw_sprg_restore();
 
intr_restore(oldmsr);
___
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-unsubscr...@freebsd.org


svn commit: r258505 - stable/10/sys/geom/nop

2013-11-23 Thread Mateusz Guzik
Author: mjg
Date: Sat Nov 23 23:54:38 2013
New Revision: 258505
URL: http://svnweb.freebsd.org/changeset/base/258505

Log:
  MFC r256951:
  gnop: make sure that newly allocated memory for softc is zeroed
  
  This prevents mtx_init from encountering non-zeros and panicking
  the kernel as a result.
  
  Approved by:  re

Modified:
  stable/10/sys/geom/nop/g_nop.c
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/geom/nop/g_nop.c
==
--- stable/10/sys/geom/nop/g_nop.c  Sat Nov 23 18:58:17 2013
(r258504)
+++ stable/10/sys/geom/nop/g_nop.c  Sat Nov 23 23:54:38 2013
(r258505)
@@ -214,7 +214,7 @@ g_nop_create(struct gctl_req *req, struc
}
}
gp = g_new_geomf(mp, %s, name);
-   sc = g_malloc(sizeof(*sc), M_WAITOK);
+   sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
sc-sc_offset = offset;
sc-sc_explicitsize = explicitsize;
sc-sc_error = ioerror;
___
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-unsubscr...@freebsd.org


svn commit: r258507 - in head/gnu/usr.bin/cc: cc_int libcpp

2013-11-23 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Nov 24 04:08:47 2013
New Revision: 258507
URL: http://svnweb.freebsd.org/changeset/base/258507

Log:
  gcc: Missing makefile changes for r258501.
  
  pointyhat:me

Modified:
  head/gnu/usr.bin/cc/cc_int/Makefile
  head/gnu/usr.bin/cc/libcpp/Makefile

Modified: head/gnu/usr.bin/cc/cc_int/Makefile
==
--- head/gnu/usr.bin/cc/cc_int/Makefile Sun Nov 24 00:15:57 2013
(r258506)
+++ head/gnu/usr.bin/cc/cc_int/Makefile Sun Nov 24 04:08:47 2013
(r258507)
@@ -24,6 +24,7 @@ OBJS-common = \
  tree-outof-ssa.o tree-ssa-ccp.o tree-vn.o tree-ssa-uncprop.o \
  tree-ssa-dce.o  tree-ssa-copy.o tree-nrv.o tree-ssa-copyrename.o \
  tree-ssa-pre.o tree-ssa-live.o tree-ssa-operands.o tree-ssa-alias.o   \
+ tree-ssa-alias-warnings.o\
  tree-ssa-phiopt.o tree-ssa-forwprop.o tree-nested.o tree-ssa-dse.o   \
  tree-ssa-dom.o domwalk.o tree-tailcall.o gimple-low.o tree-iterator.o\
  omp-low.o tree-phinodes.o tree-ssanames.o tree-sra.o tree-complex.o  \

Modified: head/gnu/usr.bin/cc/libcpp/Makefile
==
--- head/gnu/usr.bin/cc/libcpp/Makefile Sun Nov 24 00:15:57 2013
(r258506)
+++ head/gnu/usr.bin/cc/libcpp/Makefile Sun Nov 24 04:08:47 2013
(r258507)
@@ -11,9 +11,9 @@ CFLAGS+=  -I${.CURDIR} -I.
 
 LIB=   cpp
 SRCS=  localedir.h
-SRCS+= charset.c directives.c errors.c expr.c files.c \
-   identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \
-   pch.c symtab.c traditional.c
+SRCS+= charset.c directives.c directives-only.c errors.c expr.c \
+   files.c identifiers.c init.c lex.c line-map.c macro.c \
+   mkdeps.c pch.c symtab.c traditional.c
 INTERNALLIB=
 WARNS?=1
 
___
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-unsubscr...@freebsd.org


Re: svn commit: r258507 - in head/gnu/usr.bin/cc: cc_int libcpp

2013-11-23 Thread Pedro Giffuni

On 23.11.2013 23:08, Pedro F. Giffuni wrote:

Author: pfg
Date: Sun Nov 24 04:08:47 2013
New Revision: 258507
URL: http://svnweb.freebsd.org/changeset/base/258507

Log:
   gcc: Missing makefile changes for r258501.
   
   pointyhat:	me


Modified:
   head/gnu/usr.bin/cc/cc_int/Makefile
   head/gnu/usr.bin/cc/libcpp/Makefile




Seems like I forgot to include the gnu directory in the initial commit.

I also forgot to give credit for this report:

Thanks to Michael Butler for reporting the breakage.

Pedro.
___
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-unsubscr...@freebsd.org