svn commit: r262525 - head/usr.bin/iscsictl

2014-02-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Feb 26 09:06:57 2014
New Revision: 262525
URL: http://svnweb.freebsd.org/changeset/base/262525

Log:
  There is no need to prevent iscsictl from adding iSER session when there
  is no iSER support in ctld and/or kernel; should the user make that mistake,
  the output from iscsictl -L is enough to determine what the problem is.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/iscsictl/iscsictl.c

Modified: head/usr.bin/iscsictl/iscsictl.c
==
--- head/usr.bin/iscsictl/iscsictl.cWed Feb 26 06:25:36 2014
(r262524)
+++ head/usr.bin/iscsictl/iscsictl.cWed Feb 26 09:06:57 2014
(r262525)
@@ -242,11 +242,6 @@ conf_verify(struct conf *conf)
}
if (targ-t_protocol == PROTOCOL_UNSPECIFIED)
targ-t_protocol = PROTOCOL_ISCSI;
-#ifndef ICL_KERNEL_PROXY
-   if (targ-t_protocol == PROTOCOL_ISER)
-   errx(1, iSER support requires ICL_KERNEL_PROXY; 
-   see iscsi(4) for details);
-#endif
if (targ-t_address == NULL)
errx(1, missing TargetAddress for target \%s\,
targ-t_nickname);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262480 - head/sys/dev/syscons

2014-02-26 Thread Slawa Olhovchenkov
On Tue, Feb 25, 2014 at 01:48:05PM +, Julio Merino wrote:

 Author: jmmv
 Date: Tue Feb 25 13:48:05 2014
 New Revision: 262480
 URL: http://svnweb.freebsd.org/changeset/base/262480
 
 Log:
   Increase maximum number of columns to support 1980x1200 displays.

What about support 4K display?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262530 - in head/contrib/openpam: . lib/libpam t

2014-02-26 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Feb 26 17:14:02 2014
New Revision: 262530
URL: http://svnweb.freebsd.org/changeset/base/262530

Log:
  MFV (r262529): fix is_upper() predicate
  
  MFC after:1 week

Added:
  head/contrib/openpam/t/t_openpam_ctype.c
 - copied unchanged from r262529, vendor/openpam/dist/t/t_openpam_ctype.c
Modified:
  head/contrib/openpam/CREDITS
  head/contrib/openpam/lib/libpam/openpam_ctype.h
  head/contrib/openpam/t/Makefile.am
Directory Properties:
  head/contrib/openpam/   (props changed)

Modified: head/contrib/openpam/CREDITS
==
--- head/contrib/openpam/CREDITSWed Feb 26 17:06:54 2014
(r262529)
+++ head/contrib/openpam/CREDITSWed Feb 26 17:14:02 2014
(r262530)
@@ -29,9 +29,9 @@ ideas:
Hubert Feyrer hub...@feyrer.de
Jason Evans jas...@freebsd.org
Joe Marcus Clarke mar...@freebsd.org
-   Juli Mallett jmall...@freebsd.org
-   Ankita Pal pal.ankita.ank...@gmail.com
Jörg Sonnenberger jo...@britannica.bec.de
+   Juli Mallett jmall...@freebsd.org
+   Larry Baird l...@gta.com
Maëlle Lesage lesage.mae...@gmail.com
Mark Murray ma...@freebsd.org
Matthias Drochner droch...@netbsd.org

Modified: head/contrib/openpam/lib/libpam/openpam_ctype.h
==
--- head/contrib/openpam/lib/libpam/openpam_ctype.h Wed Feb 26 17:06:54 
2014(r262529)
+++ head/contrib/openpam/lib/libpam/openpam_ctype.h Wed Feb 26 17:14:02 
2014(r262530)
@@ -39,10 +39,18 @@
(ch = '0'  ch = '9')
 
 /*
+ * Evaluates to non-zero if the argument is a hex digit.
+ */
+#define is_xdigit(ch)  \
+   ((ch = '0'  ch = '9') ||\
+(ch = 'a'  ch = 'f') ||\
+(ch = 'A'  ch = 'F'))
+
+/*
  * Evaluates to non-zero if the argument is an uppercase letter.
  */
 #define is_upper(ch)   \
-   (ch = 'A'  ch = 'A')
+   (ch = 'A'  ch = 'Z')
 
 /*
  * Evaluates to non-zero if the argument is a lowercase letter.

Modified: head/contrib/openpam/t/Makefile.am
==
--- head/contrib/openpam/t/Makefile.am  Wed Feb 26 17:06:54 2014
(r262529)
+++ head/contrib/openpam/t/Makefile.am  Wed Feb 26 17:14:02 2014
(r262530)
@@ -6,6 +6,7 @@ noinst_HEADERS = t.h
 
 # tests
 TESTS =
+TESTS += t_openpam_ctype
 TESTS += t_openpam_readword
 TESTS += t_openpam_readlinev
 check_PROGRAMS = $(TESTS)

Copied: head/contrib/openpam/t/t_openpam_ctype.c (from r262529, 
vendor/openpam/dist/t/t_openpam_ctype.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/openpam/t/t_openpam_ctype.cWed Feb 26 17:14:02 2014
(r262530, copy of r262529, vendor/openpam/dist/t/t_openpam_ctype.c)
@@ -0,0 +1,122 @@
+/*-
+ * Copyright (c) 2014 Dag-Erling Smørgrav
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ *products derived from this software without specific prior written
+ *permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+# include config.h
+#endif
+
+#include stdio.h
+#include string.h
+
+#include openpam_ctype.h
+
+#include t.h
+
+#define OC_DIGIT   0123456789
+#define OC_XDIGIT  OC_DIGIT ABCDEFabcdef
+#define OC_UPPER   ABCDEFGHIJKLMNOPQRSTUVWXYZ
+#define OC_LOWER   abcdefghijklmnopqrstuvwxyz
+#define OC_LETTER  OC_UPPER OC_LOWER
+#define OC_LWS

Re: svn commit: r262466 - head/sys/cddl/dev/systrace

2014-02-26 Thread Justin Hibbits
On Tue, Feb 25, 2014 at 5:35 PM, Mark Johnston ma...@freebsd.org wrote:
 On Tue, Feb 25, 2014 at 03:17:56PM -0800, Justin Hibbits wrote:
 I think this broke powerpc building.  I see the following build failure:

 cc1: warnings being treated as errors
 /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:
 In function 'systrace_probe':
 /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218:
 warning: function called through a non-compatible type
 /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218:
 note: if this code is reached, the program will abort


 Hi Justin,

 Sorry about this. I've reverted the commit.

 I realize that the change introduced undefined behaviour, but a similar
 trick is used elsewhere in the DTrace code to pass extra arguments at a
 probe site. Calling dtrace_probe() through a function pointer (patch
 below) makes the warning go away, but I don't really understand why.
 clang doesn't emit warnings in either case.

 Thanks,
 -Mark

 diff --git a/sys/cddl/dev/systrace/systrace.c 
 b/sys/cddl/dev/systrace/systrace.c
 index 83f0793..5f4b82f 100644
 --- a/sys/cddl/dev/systrace/systrace.c
 +++ b/sys/cddl/dev/systrace/systrace.c
 @@ -168,8 +168,8 @@ static dtrace_pops_t systrace_pops = {
  static struct cdev *systrace_cdev;
  static dtrace_provider_id_tsystrace_id;

 -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t,
 -uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
 +typedef void (*systrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, 
 uintptr_t,
 +uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);

  #if !defined(LINUX_SYSTRACE)
  /*
 @@ -214,8 +214,9 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent 
 *sysent, void *params,
 }

 /* Process the probe using the converted argments. */
 -   ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1],
 -   uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]);
 +   systrace_probe_t probe = (systrace_probe_t)dtrace_probe;
 +   probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4],
 +   uargs[5], uargs[6], uargs[7]);
  }

  #endif


Hi Mark,

I think this patch works because it circumvents gcc's variable
tracking.  With the first patch, gcc knew the function that was being
called, and knew it was undefined behavior.  With the second patch, it
only knows at that time that you're calling through a function
pointer.  It's completely forgotten that the function pointer is
pointing to that function.  Just a guess.  I'll give it a go and let
you know if it still complains.

Thanks!

- Justin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262531 - head/sys/arm/freescale/imx

2014-02-26 Thread Ian Lepore
Author: ian
Date: Wed Feb 26 18:29:14 2014
New Revision: 262531
URL: http://svnweb.freebsd.org/changeset/base/262531

Log:
  Minor tweaks to the imx GPT timer...
   - Don't use spaces or dots in the eventtimer or timecounter names.
 They turn into sysctl node names, and it's just confusing.
   - Use comparator #3 instead of #1 for one-shot events.  There's an
 extra 1-cycle penalty in the hardware for accessing the registers
 for comparator 1, no point in paying that penalty.
   - Lower the quality of the eventtimer from 1000 to 800, because the
 device can't support PERCPU timers and some other device in the system
 may be able to provide that.

Modified:
  head/sys/arm/freescale/imx/imx_gpt.c

Modified: head/sys/arm/freescale/imx/imx_gpt.c
==
--- head/sys/arm/freescale/imx/imx_gpt.cWed Feb 26 17:14:02 2014
(r262530)
+++ head/sys/arm/freescale/imx/imx_gpt.cWed Feb 26 18:29:14 2014
(r262531)
@@ -75,7 +75,7 @@ static int imx_gpt_probe(device_t);
 static int imx_gpt_attach(device_t);
 
 static struct timecounter imx_gpt_timecounter = {
-   .tc_name   = i.MX GPT Timecounter,
+   .tc_name   = iMXGPT,
.tc_get_timecount  = imx_gpt_get_timecount,
.tc_counter_mask   = ~0u,
.tc_frequency  = 0,
@@ -244,9 +244,9 @@ imx_gpt_attach(device_t dev)
}
 
/* Register as an eventtimer. */
-   sc-et.et_name = i.MXxxx GPT Eventtimer;
+   sc-et.et_name = iMXGPT;
sc-et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERIODIC;
-   sc-et.et_quality = 1000;
+   sc-et.et_quality = 800;
sc-et.et_frequency = sc-clkfreq;
sc-et.et_min_period = (MIN_ET_PERIOD  32) / sc-et.et_frequency;
sc-et.et_max_period = (0xfffeLLU  32) / sc-et.et_frequency;
@@ -286,9 +286,9 @@ imx_gpt_timer_start(struct eventtimer *e
/* Do not disturb, otherwise event will be lost */
spinlock_enter();
/* Set expected value */
-   WRITE4(sc, IMX_GPT_OCR1, READ4(sc, IMX_GPT_CNT) + ticks);
+   WRITE4(sc, IMX_GPT_OCR3, READ4(sc, IMX_GPT_CNT) + ticks);
/* Enable compare register 1 Interrupt */
-   SET4(sc, IMX_GPT_IR, GPT_IR_OF1);
+   SET4(sc, IMX_GPT_IR, GPT_IR_OF3);
/* Now everybody can relax */
spinlock_exit();
return (0);
@@ -349,7 +349,7 @@ imx_gpt_intr(void *arg)
WRITE4(sc, IMX_GPT_SR, status);
 
/* Handle one-shot timer events. */
-   if (status  GPT_IR_OF1) {
+   if (status  GPT_IR_OF3) {
if (sc-et.et_active) {
sc-et.et_event_cb(sc-et, sc-et.et_arg);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262532 - head/usr.sbin/bhyve

2014-02-26 Thread Neel Natu
Author: neel
Date: Wed Feb 26 19:14:54 2014
New Revision: 262532
URL: http://svnweb.freebsd.org/changeset/base/262532

Log:
  Document the -a and -x options to match the changes in r262236.
  
  Reviewed by:  grehan

Modified:
  head/usr.sbin/bhyve/bhyve.8

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Wed Feb 26 18:29:14 2014(r262531)
+++ head/usr.sbin/bhyve/bhyve.8 Wed Feb 26 19:14:54 2014(r262532)
@@ -32,7 +32,7 @@
 .Nd run a guest operating system inside a virtual machine
 .Sh SYNOPSIS
 .Nm
-.Op Fl aehwAHPW
+.Op Fl aehwxAHPW
 .Op Fl c Ar numcpus
 .Op Fl g Ar gdbport
 .Op Fl p Ar pinnedcpu
@@ -58,7 +58,10 @@ exit is detected.
 .Sh OPTIONS
 .Bl -tag -width 10n
 .It Fl a
-Disallow use of the local APIC in X2APIC mode.
+The guest's local APIC is configured in xAPIC mode.
+
+The xAPIC mode is the default setting so this option is redundant. It will be
+deprecated in a future version.
 .It Fl A
 Generate ACPI tables.
 Required for
@@ -229,6 +232,8 @@ to exit when a guest issues an access to
 This is intended for debug purposes.
 .It Fl w
 Ignore accesses to unimplemented Model Specific Registers (MSRs). This is 
intended for debug purposes.
+.It Fl x
+The guest's local APIC is configured in x2APIC mode.
 .It Fl h
 Print help message and exit.
 .It Ar vmname
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262309 - head/sys/kern

2014-02-26 Thread Mateusz Guzik
On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote:
 On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote:
  Author: mjg
  Date: Fri Feb 21 22:29:09 2014
  New Revision: 262309
  URL: http://svnweb.freebsd.org/changeset/base/262309
  
  Log:
Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading
to use-after-free.

fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but
kern_proc_{o,}filedesc_out only checked for hold count.
 
 Can you describe the race in more detail?  The kern_* routines hold
 FILEDESC_SLOCK() while they read the file which should prevent
 fdescfree() from free'ing any files.  Note that fdfree() (called
 under FILEDESC_XLOCK() clears the file pointer to NULL via the
 bzero(), so the sysctl handler should only see non-NULL pointers
 for files that are not yet free'd.
 

oops, you are right. I somehow misread the code.

Still, the change is harmless and matches other loop which iterates the
table (see sysctl_kern_file), so I think it can stay.

Other thing is that with that change in place we can get rid of
XLOCK/XUNLOCK around fdfree in fdescfree.

-- 
Mateusz Guzik mjguzik gmail.com
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262309 - head/sys/kern

2014-02-26 Thread John Baldwin
On Wednesday, February 26, 2014 2:23:48 pm Mateusz Guzik wrote:
 On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote:
  On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote:
   Author: mjg
   Date: Fri Feb 21 22:29:09 2014
   New Revision: 262309
   URL: http://svnweb.freebsd.org/changeset/base/262309
   
   Log:
 Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading
 to use-after-free.
 
 fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but
 kern_proc_{o,}filedesc_out only checked for hold count.
  
  Can you describe the race in more detail?  The kern_* routines hold
  FILEDESC_SLOCK() while they read the file which should prevent
  fdescfree() from free'ing any files.  Note that fdfree() (called
  under FILEDESC_XLOCK() clears the file pointer to NULL via the
  bzero(), so the sysctl handler should only see non-NULL pointers
  for files that are not yet free'd.
  
 
 oops, you are right. I somehow misread the code.
 
 Still, the change is harmless and matches other loop which iterates the
 table (see sysctl_kern_file), so I think it can stay.

Actually, I think that should be undone.  That was a hacky workaround for
a long time ago when the FILEDESC locking wasn't a simple sx lock but was
a mtx + sleep lock combo thing that had fast and slow variants.

 Other thing is that with that change in place we can get rid of
 XLOCK/XUNLOCK around fdfree in fdescfree.

I would rather remove the fd_refcnt checks, or do them differently (not
in the loop).  Right now a reader might be confused to think that
fd_refcnt can change within the loop when it cannot and then worry about
unhandled races that don't exist (i.e. if fd_refcnt can change within
the loop, what prevents the individual file objects from being freed out
from under the loop?)

I originally thought just that when I saw this commit and was going to
note that your change was not a true fix and still left the race open
until I found upon further investigation that your change was just
noise since there wasn't a race to begin with.  In the interest of
clarity, please either remove the fd_refcnt checks from these loops
(including sysctl_kern_file) or fix all three of them to do a single
check after the SLOCK() but before the for loop itself.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262466 - head/sys/cddl/dev/systrace

2014-02-26 Thread Justin Hibbits
On Wed, Feb 26, 2014 at 9:52 AM, Justin Hibbits jhibb...@freebsd.org wrote:
 On Tue, Feb 25, 2014 at 5:35 PM, Mark Johnston ma...@freebsd.org wrote:
 On Tue, Feb 25, 2014 at 03:17:56PM -0800, Justin Hibbits wrote:
 I think this broke powerpc building.  I see the following build failure:

 cc1: warnings being treated as errors
 /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:
 In function 'systrace_probe':
 /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218:
 warning: function called through a non-compatible type
 /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218:
 note: if this code is reached, the program will abort


 Hi Justin,

 Sorry about this. I've reverted the commit.

 I realize that the change introduced undefined behaviour, but a similar
 trick is used elsewhere in the DTrace code to pass extra arguments at a
 probe site. Calling dtrace_probe() through a function pointer (patch
 below) makes the warning go away, but I don't really understand why.
 clang doesn't emit warnings in either case.

 Thanks,
 -Mark

 diff --git a/sys/cddl/dev/systrace/systrace.c 
 b/sys/cddl/dev/systrace/systrace.c
 index 83f0793..5f4b82f 100644
 --- a/sys/cddl/dev/systrace/systrace.c
 +++ b/sys/cddl/dev/systrace/systrace.c
 @@ -168,8 +168,8 @@ static dtrace_pops_t systrace_pops = {
  static struct cdev *systrace_cdev;
  static dtrace_provider_id_tsystrace_id;

 -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t,
 -uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
 +typedef void (*systrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, 
 uintptr_t,
 +uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);

  #if !defined(LINUX_SYSTRACE)
  /*
 @@ -214,8 +214,9 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent 
 *sysent, void *params,
 }

 /* Process the probe using the converted argments. */
 -   ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1],
 -   uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]);
 +   systrace_probe_t probe = (systrace_probe_t)dtrace_probe;
 +   probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4],
 +   uargs[5], uargs[6], uargs[7]);
  }

  #endif


 Hi Mark,

 I think this patch works because it circumvents gcc's variable
 tracking.  With the first patch, gcc knew the function that was being
 called, and knew it was undefined behavior.  With the second patch, it
 only knows at that time that you're calling through a function
 pointer.  It's completely forgotten that the function pointer is
 pointing to that function.  Just a guess.  I'll give it a go and let
 you know if it still complains.

 Thanks!

 - Justin

Just tested and confirmed it builds successfully.

- Justin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262309 - head/sys/kern

2014-02-26 Thread Mateusz Guzik
On Wed, Feb 26, 2014 at 03:29:31PM -0500, John Baldwin wrote:
 On Wednesday, February 26, 2014 2:23:48 pm Mateusz Guzik wrote:
  On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote:
   On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote:
Author: mjg
Date: Fri Feb 21 22:29:09 2014
New Revision: 262309
URL: http://svnweb.freebsd.org/changeset/base/262309

Log:
  Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading
  to use-after-free.
  
  fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but
  kern_proc_{o,}filedesc_out only checked for hold count.
   
   Can you describe the race in more detail?  The kern_* routines hold
   FILEDESC_SLOCK() while they read the file which should prevent
   fdescfree() from free'ing any files.  Note that fdfree() (called
   under FILEDESC_XLOCK() clears the file pointer to NULL via the
   bzero(), so the sysctl handler should only see non-NULL pointers
   for files that are not yet free'd.
   
  
  oops, you are right. I somehow misread the code.
  
  Still, the change is harmless and matches other loop which iterates the
  table (see sysctl_kern_file), so I think it can stay.
 
 Actually, I think that should be undone.  That was a hacky workaround for
 a long time ago when the FILEDESC locking wasn't a simple sx lock but was
 a mtx + sleep lock combo thing that had fast and slow variants.
 
  Other thing is that with that change in place we can get rid of
  XLOCK/XUNLOCK around fdfree in fdescfree.
 
 I would rather remove the fd_refcnt checks, or do them differently (not
 in the loop).  Right now a reader might be confused to think that
 fd_refcnt can change within the loop when it cannot and then worry about
 unhandled races that don't exist (i.e. if fd_refcnt can change within
 the loop, what prevents the individual file objects from being freed out
 from under the loop?)
 

But it can change.

kern_proc_filedesc_out calls export_fd_to_sb which drops the lock for
each fp and sysctl_kern_proc_ofiledesc drops the lock when dealing with
vnodes.

As far as I can say all this is safe - either data is refed (vref on a
vnode) or the lock is still held while the data is being read, so by the
time fp can be freed it is no longer used.

 I originally thought just that when I saw this commit and was going to
 note that your change was not a true fix and still left the race open
 until I found upon further investigation that your change was just
 noise since there wasn't a race to begin with.  In the interest of
 clarity, please either remove the fd_refcnt checks from these loops
 (including sysctl_kern_file) or fix all three of them to do a single
 check after the SLOCK() but before the for loop itself.

My original misread of the code was that fdescfree can proceed to free
files and functions I modified would encounter a stale fp once lock was
taken.

A side effect of my change is that if we happen to catch exiting process,
we may end up giving up instead of checking for mostly now-null pointers.

-- 
Mateusz Guzik mjguzik gmail.com
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262480 - head/sys/dev/syscons

2014-02-26 Thread Dimitry Andric
On 26 Feb 2014, at 13:19, Slawa Olhovchenkov s...@zxy.spb.ru wrote:
 On Tue, Feb 25, 2014 at 01:48:05PM +, Julio Merino wrote:
 
 Author: jmmv
 Date: Tue Feb 25 13:48:05 2014
 New Revision: 262480
 URL: http://svnweb.freebsd.org/changeset/base/262480
 
 Log:
  Increase maximum number of columns to support 1980x1200 displays.
 
 What about support 4K display?

No problem, just send us a few, so we can properly implement it! ;-)

-Dimitry




signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r262533 - head/bin/sh

2014-02-26 Thread Jilles Tjoelker
Author: jilles
Date: Wed Feb 26 21:38:42 2014
New Revision: 262533
URL: http://svnweb.freebsd.org/changeset/base/262533

Log:
  sh: Make expari() static.

Modified:
  head/bin/sh/expand.c
  head/bin/sh/expand.h

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cWed Feb 26 19:14:54 2014(r262532)
+++ head/bin/sh/expand.cWed Feb 26 21:38:42 2014(r262533)
@@ -100,6 +100,7 @@ static struct arglist exparg;   /* holds 
 
 static void argstr(char *, int);
 static char *exptilde(char *, int);
+static void expari(int);
 static void expbackq(union node *, int, int);
 static int subevalvar(char *, char *, int, int, int, int, int);
 static char *evalvar(char *, int);
@@ -390,7 +391,7 @@ removerecordregions(int endoff)
  * Expand arithmetic expression.  Backup to start of expression,
  * evaluate, place result in (backed up) result, adjust string position.
  */
-void
+static void
 expari(int flag)
 {
char *p, *q, *start;

Modified: head/bin/sh/expand.h
==
--- head/bin/sh/expand.hWed Feb 26 19:14:54 2014(r262532)
+++ head/bin/sh/expand.hWed Feb 26 21:38:42 2014(r262533)
@@ -58,6 +58,5 @@ struct arglist {
 
 union node;
 void expandarg(union node *, struct arglist *, int);
-void expari(int);
 void rmescapes(char *);
 int casematch(union node *, const char *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262534 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv ti/am335x

2014-02-26 Thread Ian Lepore
Author: ian
Date: Wed Feb 26 22:06:10 2014
New Revision: 262534
URL: http://svnweb.freebsd.org/changeset/base/262534

Log:
  Replace many pasted identical definitions of cpu_initclocks() with a common
  implementation in arm/machdep.c.  Most arm platforms either don't need to
  do anything, or just need to call the standard eventtimer init routines.
  A generic implementation that does that is now provided via weak linkage.
  Any platform that needs to do something different can provide a its own
  implementation to override the generic one.

Modified:
  head/sys/arm/allwinner/timer.c
  head/sys/arm/arm/generic_timer.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/arm/mpcore_timer.c
  head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c
  head/sys/arm/freescale/imx/imx_gpt.c
  head/sys/arm/include/machdep.h
  head/sys/arm/lpc/lpc_timer.c
  head/sys/arm/mv/timer.c
  head/sys/arm/ti/am335x/am335x_dmtimer.c

Modified: head/sys/arm/allwinner/timer.c
==
--- head/sys/arm/allwinner/timer.c  Wed Feb 26 21:38:42 2014
(r262533)
+++ head/sys/arm/allwinner/timer.c  Wed Feb 26 22:06:10 2014
(r262534)
@@ -295,12 +295,6 @@ a10_timer_get_timerfreq(struct a10_timer
return (sc-timer0_freq);
 }
 
-void
-cpu_initclocks(void)
-{
-   cpu_initclocks_bsp();
-}
-
 static int
 a10_timer_hardclock(void *arg)
 {

Modified: head/sys/arm/arm/generic_timer.c
==
--- head/sys/arm/arm/generic_timer.cWed Feb 26 21:38:42 2014
(r262533)
+++ head/sys/arm/arm/generic_timer.cWed Feb 26 22:06:10 2014
(r262534)
@@ -332,16 +332,6 @@ static devclass_t arm_tmr_devclass;
 DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0);
 
 void
-cpu_initclocks(void)
-{
-
-   if (PCPU_GET(cpuid) == 0)
-   cpu_initclocks_bsp();
-   else
-   cpu_initclocks_ap();
-}
-
-void
 DELAY(int usec)
 {
int32_t counts, counts_per_usec;

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Wed Feb 26 21:38:42 2014(r262533)
+++ head/sys/arm/arm/machdep.c  Wed Feb 26 22:06:10 2014(r262534)
@@ -456,6 +456,30 @@ cpu_idle_wakeup(int cpu)
return (0);
 }
 
+/*
+ * Most ARM platforms don't need to do anything special to init their clocks
+ * (they get intialized during normal device attachment), and by not defining a
+ * cpu_initclocks() function they get this generic one.  Any platform that 
needs
+ * to do something special can just provide their own implementation, which 
will
+ * override this one due to the weak linkage.
+ */
+void
+arm_generic_initclocks(void)
+{
+
+#ifndef NO_EVENTTIMERS
+#ifdef SMP
+   if (PCPU_GET(cpuid) == 0)
+   cpu_initclocks_bsp();
+   else
+   cpu_initclocks_ap();
+#else
+   cpu_initclocks_bsp();
+#endif
+#endif
+}
+__weak_reference(arm_generic_initclocks, cpu_initclocks);
+
 int
 fill_regs(struct thread *td, struct reg *regs)
 {

Modified: head/sys/arm/arm/mpcore_timer.c
==
--- head/sys/arm/arm/mpcore_timer.c Wed Feb 26 21:38:42 2014
(r262533)
+++ head/sys/arm/arm/mpcore_timer.c Wed Feb 26 22:06:10 2014
(r262534)
@@ -359,25 +359,6 @@ static devclass_t arm_tmr_devclass;
 DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0);
 
 /**
- * cpu_initclocks - called by system to initialise the cpu clocks
- *
- * This is a boilerplat function, most of the setup has already been done
- * when the driver was attached.  Therefore this function must only be 
called
- * after the driver is attached.
- *
- * RETURNS
- * nothing
- */
-void
-cpu_initclocks(void)
-{
-   if (PCPU_GET(cpuid) == 0)
-   cpu_initclocks_bsp();
-   else
-   cpu_initclocks_ap();
-}
-
-/**
  * DELAY - Delay for at least usec microseconds.
  * @usec: number of microseconds to delay by
  *

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.cWed Feb 26 21:38:42 
2014(r262533)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.cWed Feb 26 22:06:10 
2014(r262534)
@@ -278,12 +278,6 @@ static devclass_t bcm_systimer_devclass;
 DRIVER_MODULE(bcm_systimer, simplebus, bcm_systimer_driver, 
bcm_systimer_devclass, 0, 0);
 
 void
-cpu_initclocks(void)
-{
-   cpu_initclocks_bsp();
-}
-
-void
 DELAY(int usec)
 {
int32_t counts;

Modified: head/sys/arm/freescale/imx/imx_gpt.c
==
--- head/sys/arm/freescale/imx/imx_gpt.cWed Feb 26 21:38:42 2014
(r262533)
+++ 

svn commit: r262539 - in head: sys/compat/linprocfs usr.bin/makewhatis

2014-02-26 Thread Eitan Adler
Author: eadler
Date: Thu Feb 27 00:43:10 2014
New Revision: 262539
URL: http://svnweb.freebsd.org/changeset/base/262539

Log:
  linprocfs: add support for /sys/kernel/random/uuid
  
  PR:   kern/186187
  Submitted by: Fernando fernando.apesteg...@gmail.com
  MFC After:2 weeks

Modified:
  head/sys/compat/linprocfs/linprocfs.c
  head/usr.bin/makewhatis/makewhatis.1
  head/usr.bin/makewhatis/makewhatis.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Wed Feb 26 23:03:10 2014
(r262538)
+++ head/sys/compat/linprocfs/linprocfs.c   Thu Feb 27 00:43:10 2014
(r262539)
@@ -72,6 +72,7 @@ __FBSDID($FreeBSD$);
 #include sys/time.h
 #include sys/tty.h
 #include sys/user.h
+#include sys/uuid.h
 #include sys/vmmeter.h
 #include sys/vnode.h
 #include sys/bus.h
@@ -1337,6 +1338,22 @@ linprocfs_dofdescfs(PFS_FILL_ARGS)
return (0);
 }
 
+
+/*
+ * Filler function for proc/sys/kernel/random/uuid
+ */
+static int
+linprocfs_douuid(PFS_FILL_ARGS)
+{
+   struct uuid uuid;
+
+   kern_uuidgen(uuid, 1);
+   sbuf_printf_uuid(sb, uuid);
+   sbuf_printf(sb, \n);
+   return(0);
+}
+
+
 /*
  * Constructor
  */
@@ -1436,6 +1453,11 @@ linprocfs_init(PFS_INIT_ARGS)
pfs_create_file(dir, sem, linprocfs_dosem,
NULL, NULL, NULL, PFS_RD);
 
+   /* /proc/sys/kernel/random/... */
+   dir = pfs_create_dir(dir, random, NULL, NULL, NULL, 0);
+   pfs_create_file(dir, uuid, linprocfs_douuid,
+   NULL, NULL, NULL, PFS_RD);
+
return (0);
 }
 

Modified: head/usr.bin/makewhatis/makewhatis.1
==
--- head/usr.bin/makewhatis/makewhatis.1Wed Feb 26 23:03:10 2014
(r262538)
+++ head/usr.bin/makewhatis/makewhatis.1Thu Feb 27 00:43:10 2014
(r262539)
@@ -24,12 +24,12 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 3, 2005
-.Dt MAKEWHATIS 1
+.Dd December 8, 2013
+.Dt MAKEWHATIS 8
 .Os
 .Sh NAME
 .Nm makewhatis
-.Nd create whatis database
+.Nd create whatis database
 .Sh SYNOPSIS
 .Nm
 .Op Fl a
@@ -98,9 +98,6 @@ option is used.
 .It Ev MACHINE
 If set, its value is used to override the current
 machine type when searching machine specific subdirectories.
-.It Ev MACHINE_ARCH
-If set, its value is used to override the current
-architecture when searching architecture specific subdirectories.
 .It Ev MANPATH
 Determines the set of directories to be processed if none are given on
 the command line.
@@ -133,4 +130,6 @@ program was originally written in Perl a
 The current version of
 .Nm
 was rewritten in C by
-.An John Rochester .
+.An John Rochester
+with additional contributions by
+.An Franco Fichtner Aq Mt fra...@lastsummer.de .

Modified: head/usr.bin/makewhatis/makewhatis.c
==
--- head/usr.bin/makewhatis/makewhatis.cWed Feb 26 23:03:10 2014
(r262538)
+++ head/usr.bin/makewhatis/makewhatis.cThu Feb 27 00:43:10 2014
(r262539)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2002 John Rochester
+ * Copyright (c) 2013 Franco Fichtner fra...@lastsummer.de
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,21 +25,19 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
  */
 
-#include sys/cdefs.h
-__FBSDID($FreeBSD$);
-
+#include sys/tree.h
 #include sys/types.h
-#include sys/stat.h
 #include sys/param.h
 #include sys/queue.h
-#include sys/utsname.h
+#include sys/stat.h
 
 #include ctype.h
 #include dirent.h
 #include err.h
-#include stddef.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -52,16 +51,56 @@ __FBSDID($FreeBSD$);
 static char blank[] =  ;
 
 /*
- * Information collected about each man page in a section.
+ * Information collected about each man page alias.
+ */
+struct page_alias {
+   RB_ENTRY(page_alias) entry;
+   char *filename;
+   char *name;
+   char *suffix;
+   int gzipped;
+};
+
+/*
+ * Information collected about each unique man page.
  */
 struct page_info {
-   char *  filename;
-   char *  name;
-   char *  suffix;
-   int gzipped;
-   ino_t   inode;
+   RB_HEAD(page_alias_tree, page_alias) head;
+   RB_ENTRY(page_info) entry;
+   ino_t inode;
 };
 
+static RB_HEAD(page_info_tree, page_info) page_head = 
RB_INITIALIZER(page_head);
+
+/*
+ * Sorts page info by inode number.
+ */
+static int
+infosort(const struct page_info *a, const struct page_info *b)
+{
+   return (memcmp(a-inode, b-inode, sizeof(a-inode)));
+}
+
+RB_PROTOTYPE(page_info_tree, page_info, entry, infosort);
+RB_GENERATE(page_info_tree, 

svn commit: r262540 - head/usr.bin/makewhatis

2014-02-26 Thread Eitan Adler
Author: eadler
Date: Thu Feb 27 00:52:34 2014
New Revision: 262540
URL: http://svnweb.freebsd.org/changeset/base/262540

Log:
  I had some unrelated (wrong) changes to makewhatis.  Undo them.

Modified:
  head/usr.bin/makewhatis/makewhatis.1
  head/usr.bin/makewhatis/makewhatis.c

Modified: head/usr.bin/makewhatis/makewhatis.1
==
--- head/usr.bin/makewhatis/makewhatis.1Thu Feb 27 00:43:10 2014
(r262539)
+++ head/usr.bin/makewhatis/makewhatis.1Thu Feb 27 00:52:34 2014
(r262540)
@@ -24,12 +24,12 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 8, 2013
-.Dt MAKEWHATIS 8
+.Dd December 3, 2005
+.Dt MAKEWHATIS 1
 .Os
 .Sh NAME
 .Nm makewhatis
-.Nd create whatis database
+.Nd create whatis database
 .Sh SYNOPSIS
 .Nm
 .Op Fl a
@@ -98,6 +98,9 @@ option is used.
 .It Ev MACHINE
 If set, its value is used to override the current
 machine type when searching machine specific subdirectories.
+.It Ev MACHINE_ARCH
+If set, its value is used to override the current
+architecture when searching architecture specific subdirectories.
 .It Ev MANPATH
 Determines the set of directories to be processed if none are given on
 the command line.
@@ -130,6 +133,4 @@ program was originally written in Perl a
 The current version of
 .Nm
 was rewritten in C by
-.An John Rochester
-with additional contributions by
-.An Franco Fichtner Aq Mt fra...@lastsummer.de .
+.An John Rochester .

Modified: head/usr.bin/makewhatis/makewhatis.c
==
--- head/usr.bin/makewhatis/makewhatis.cThu Feb 27 00:43:10 2014
(r262539)
+++ head/usr.bin/makewhatis/makewhatis.cThu Feb 27 00:52:34 2014
(r262540)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2002 John Rochester
- * Copyright (c) 2013 Franco Fichtner fra...@lastsummer.de
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,19 +24,21 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
-#include sys/tree.h
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
 #include sys/types.h
+#include sys/stat.h
 #include sys/param.h
 #include sys/queue.h
-#include sys/stat.h
+#include sys/utsname.h
 
 #include ctype.h
 #include dirent.h
 #include err.h
+#include stddef.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -51,56 +52,16 @@
 static char blank[] =  ;
 
 /*
- * Information collected about each man page alias.
- */
-struct page_alias {
-   RB_ENTRY(page_alias) entry;
-   char *filename;
-   char *name;
-   char *suffix;
-   int gzipped;
-};
-
-/*
- * Information collected about each unique man page.
+ * Information collected about each man page in a section.
  */
 struct page_info {
-   RB_HEAD(page_alias_tree, page_alias) head;
-   RB_ENTRY(page_info) entry;
-   ino_t inode;
+   char *  filename;
+   char *  name;
+   char *  suffix;
+   int gzipped;
+   ino_t   inode;
 };
 
-static RB_HEAD(page_info_tree, page_info) page_head = 
RB_INITIALIZER(page_head);
-
-/*
- * Sorts page info by inode number.
- */
-static int
-infosort(const struct page_info *a, const struct page_info *b)
-{
-   return (memcmp(a-inode, b-inode, sizeof(a-inode)));
-}
-
-RB_PROTOTYPE(page_info_tree, page_info, entry, infosort);
-RB_GENERATE(page_info_tree, page_info, entry, infosort);
-
-/*
- * Sorts page alias first by suffix, then name.
- */
-static int
-aliassort(const struct page_alias *a, const struct page_alias *b)
-{
-   int ret = strcmp(a-suffix, b-suffix);
-   if (ret) {
-   return (ret);
-   }
-
-   return (strcmp(a-name, b-name));
-}
-
-RB_PROTOTYPE(page_alias_tree, page_alias, entry, aliassort);
-RB_GENERATE(page_alias_tree, page_alias, entry, aliassort);
-
 /*
  * An entry kept for each visited directory.
  */
@@ -139,7 +100,7 @@ static const char *whatis_name=whatis;
 static char *common_output;/* -o option: the single output file */
 static char *locale;   /* user's locale if -L is used */
 static char *lang_locale;  /* short form of locale */
-static const char *machine;
+static const char *machine, *machine_arch;
 
 static int exit_code;  /* exit code to use when finished */
 static SLIST_HEAD(, visited_dir) visited_dirs =
@@ -171,66 +132,62 @@ static char mdoc_commands[] = ArDvErEvF
 static void
 free_page_info(struct page_info *info)
 {
-   struct page_alias *alias;
-
-   while ((alias = RB_ROOT(info-head))) {
-   RB_REMOVE(page_alias_tree, info-head, alias);
-   free(alias-filename);
-   free(alias-suffix);
-   free(alias-name);
-   free(alias);
-   }

Re: svn commit: r262539 - in head: sys/compat/linprocfs usr.bin/makewhatis

2014-02-26 Thread Eitan Adler
On Wed, Feb 26, 2014 at 7:43 PM, Eitan Adler ead...@freebsd.org wrote:
 Author: eadler
 Date: Thu Feb 27 00:43:10 2014
 New Revision: 262539
 URL: http://svnweb.freebsd.org/changeset/base/262539
...

   head/usr.bin/makewhatis/makewhatis.1
   head/usr.bin/makewhatis/makewhatis.c

Please ignore these.  These were unrelated changes I forgot I had in
this branch.


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262542 - in head: cddl/lib/libdtrace sys/cddl/contrib/opensolaris/uts/intel/dtrace sys/cddl/dev/dtrace/amd64 sys/cddl/dev/dtrace/i386 sys/cddl/dev/dtrace/x86 sys/modules/dtrace/dtrace

2014-02-26 Thread Mark Johnston
Author: markj
Date: Thu Feb 27 01:04:35 2014
New Revision: 262542
URL: http://svnweb.freebsd.org/changeset/base/262542

Log:
  Move some files that are identical on i386 and amd64 to an x86 subdirectory
  rather than keeping duplicate copies.
  
  Discussed with:   avg
  MFC after:1 week

Added:
  head/sys/cddl/dev/dtrace/x86/
  head/sys/cddl/dev/dtrace/x86/dis_tables.c
 - copied unchanged from r262521, 
head/sys/cddl/dev/dtrace/amd64/dis_tables.c
  head/sys/cddl/dev/dtrace/x86/dis_tables.h
 - copied unchanged from r262521, 
head/sys/cddl/dev/dtrace/amd64/dis_tables.h
  head/sys/cddl/dev/dtrace/x86/regset.h
 - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/regset.h
Deleted:
  head/sys/cddl/dev/dtrace/amd64/dis_tables.c
  head/sys/cddl/dev/dtrace/amd64/dis_tables.h
  head/sys/cddl/dev/dtrace/amd64/regset.h
  head/sys/cddl/dev/dtrace/i386/dis_tables.c
  head/sys/cddl/dev/dtrace/i386/dis_tables.h
  head/sys/cddl/dev/dtrace/i386/regset.h
Modified:
  head/cddl/lib/libdtrace/Makefile
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  head/sys/modules/dtrace/dtrace/Makefile

Modified: head/cddl/lib/libdtrace/Makefile
==
--- head/cddl/lib/libdtrace/MakefileThu Feb 27 01:01:02 2014
(r262541)
+++ head/cddl/lib/libdtrace/MakefileThu Feb 27 01:04:35 2014
(r262542)
@@ -69,9 +69,11 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \
 #CFLAGS+=  -DYYDEBUG
 
 .if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
+CFLAGS+=   -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86
 CFLAGS+=   -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386
 .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86
 .elif ${MACHINE_CPUARCH} == sparc64
 CFLAGS+=   -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Feb 
27 01:01:02 2014(r262541)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Thu Feb 
27 01:04:35 2014(r262542)
@@ -47,7 +47,7 @@
 #include sys/types.h
 #include sys/proc.h
 #include sys/dtrace_bsd.h
-#include cddl/dev/dtrace/i386/regset.h
+#include cddl/dev/dtrace/x86/regset.h
 #include machine/segments.h
 #include machine/reg.h
 #include machine/pcb.h

Copied: head/sys/cddl/dev/dtrace/x86/dis_tables.c (from r262521, 
head/sys/cddl/dev/dtrace/amd64/dis_tables.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/cddl/dev/dtrace/x86/dis_tables.c   Thu Feb 27 01:04:35 2014
(r262542, copy of r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.c)
@@ -0,0 +1,4841 @@
+/*
+ *
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the License).
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets [] replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/*
+ * Copyright (c) 2010, Intel Corporation.
+ * All rights reserved.
+ */
+
+/* Copyright (c) 1988 ATT */
+/*   All Rights Reserved   */
+
+/*
+ * $FreeBSD$
+ */
+
+#include   dis_tables.h
+
+/* BEGIN CSTYLED */
+
+/*
+ * Disassembly begins in dis_distable, which is equivalent to the One-byte
+ * Opcode Map in the Intel IA32 ISA Reference (page A-6 in my copy).  The
+ * decoding loops then traverse out through the other tables as necessary to
+ * decode a given instruction.
+ *
+ * The behavior of this file can be controlled by one of the following flags:
+ *
+ * DIS_TEXTInclude text for disassembly
+ * DIS_MEM Include memory-size calculations
+ *
+ * Either or both of these can be defined.
+ *
+ * This file is not, and will never be, cstyled.  If anything, the tables 
should
+ * be taken out another tab stop or two so nothing overlaps.
+ */
+
+/*
+ * These 

svn commit: r262543 - head/sys/cddl/dev/dtrace/x86

2014-02-26 Thread Mark Johnston
Author: markj
Date: Thu Feb 27 01:24:47 2014
New Revision: 262543
URL: http://svnweb.freebsd.org/changeset/base/262543

Log:
  Fix the struct reg mappings for i386 and amd64, which differ between illumos
  and FreeBSD.
  
  Submitted by: Prashanth Kumar pra_ud...@yahoo.co.in
  MFC after:2 weeks

Modified:
  head/sys/cddl/dev/dtrace/x86/regset.h

Modified: head/sys/cddl/dev/dtrace/x86/regset.h
==
--- head/sys/cddl/dev/dtrace/x86/regset.h   Thu Feb 27 01:04:35 2014
(r262542)
+++ head/sys/cddl/dev/dtrace/x86/regset.h   Thu Feb 27 01:24:47 2014
(r262543)
@@ -61,6 +61,7 @@ extern C {
 
 #defineREG_GSBASE  27
 #defineREG_FSBASE  26
+#if defined(sun)
 #defineREG_DS  25
 #defineREG_ES  24
 
@@ -88,11 +89,40 @@ extern C {
 #defineREG_R13 2
 #defineREG_R14 1
 #defineREG_R15 0
+#else
+#defineREG_SS  25
+#defineREG_RSP 24
+#defineREG_RFL 23
+#defineREG_CS  22
+#defineREG_RIP 21
+#defineREG_DS  20
+#defineREG_ES  19
+#defineREG_ERR 18
+#defineREG_GS  17
+#defineREG_FS  16
+#defineREG_TRAPNO  15
+#defineREG_RAX 14
+#defineREG_RCX 13
+#defineREG_RDX 12
+#defineREG_RBX 11
+#defineREG_RBP 10
+#defineREG_RSI 9
+#defineREG_RDI 8
+#defineREG_R8  7
+#defineREG_R9  6
+#defineREG_R10 5
+#defineREG_R11 4
+#defineREG_R12 3
+#defineREG_R13 2
+#defineREG_R14 1
+#defineREG_R15 0
+#endif
 
 /*
  * The names and offsets defined here are specified by i386 ABI suppl.
  */
 
+#if defined(sun)
 #defineSS  18  /* only stored on a privilege 
transition */
 #defineUESP17  /* only stored on a privilege 
transition */
 #defineEFL 16
@@ -112,6 +142,27 @@ extern C {
 #defineES  2
 #defineFS  1
 #defineGS  0
+#else
+#defineGS  18
+#defineSS  17  /* only stored on a privilege 
transition */
+#defineUESP16  /* only stored on a privilege 
transition */
+#defineEFL 15
+#defineCS  14
+#defineEIP 13
+#defineERR 12
+#defineTRAPNO  11
+#defineEAX 10
+#defineECX 9
+#defineEDX 8
+#defineEBX 7
+#defineESP 6
+#defineEBP 5
+#defineESI 4
+#defineEDI 3
+#defineDS  2
+#defineES  1
+#defineFS  0
+#endif
 
 #define REG_PC  EIP
 #define REG_FP  EBP
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262546 - head/lib/libc/sys

2014-02-26 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Thu Feb 27 04:06:34 2014
New Revision: 262546
URL: http://svnweb.freebsd.org/changeset/base/262546

Log:
  syncer(4) is a kernel process, not a user process
  
  Noticed by: Geoffrey Thomas gtho...@mokafive.com
  Approved by:  hrs (mentor)

Modified:
  head/lib/libc/sys/sync.2

Modified: head/lib/libc/sys/sync.2
==
--- head/lib/libc/sys/sync.2Thu Feb 27 02:41:41 2014(r262545)
+++ head/lib/libc/sys/sync.2Thu Feb 27 04:06:34 2014(r262546)
@@ -52,7 +52,7 @@ As information in the cache is lost afte
 .Fn sync
 system call is issued
 frequently
-by the user process
+by the kernel process
 .Xr syncer 4
 (about every 30 seconds).
 .Pp
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r262547 - head/sys/dev/hwpmc

2014-02-26 Thread Justin Hibbits
Author: jhibbits
Date: Thu Feb 27 04:45:29 2014
New Revision: 262547
URL: http://svnweb.freebsd.org/changeset/base/262547

Log:
  Fix callchain capture for hwpmc(4).  While here, some style(9) fixes, too.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/hwpmc/hwpmc_powerpc.c

Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c
==
--- head/sys/dev/hwpmc/hwpmc_powerpc.c  Thu Feb 27 04:06:34 2014
(r262546)
+++ head/sys/dev/hwpmc/hwpmc_powerpc.c  Thu Feb 27 04:45:29 2014
(r262547)
@@ -32,6 +32,7 @@ __FBSDID($FreeBSD$);
 #include sys/param.h
 #include sys/pmc.h
 #include sys/pmckern.h
+#include sys/sysent.h
 #include sys/systm.h
 
 #include machine/pmc_mdep.h
@@ -60,10 +61,14 @@ pmc_save_kernel_callchain(uintptr_t *cc,
cc[frames++] = PMC_TRAPFRAME_TO_PC(tf);
sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf);
 
-   for (frames = 1; frames  maxsamples; frames++) {
+   for (; frames  maxsamples; frames++) {
if (!INKERNEL(sp))
break;
+#ifdef __powerpc64__
+   cc[frames++] = sp[2];
+#else
cc[frames++] = sp[1];
+#endif
sp = (uintptr_t *)*sp;
}
return (frames);
@@ -72,12 +77,14 @@ pmc_save_kernel_callchain(uintptr_t *cc,
 static int
 powerpc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp)
 {
+
return (0);
 }
 
 static int
 powerpc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp)
 {
+
return (0);
 }
 
@@ -111,6 +118,7 @@ powerpc_describe(int cpu, int ri, struct
 int
 powerpc_get_config(int cpu, int ri, struct pmc **ppm)
 {
+
*ppm = powerpc_pcpu[cpu]-pc_ppcpmcs[ri].phw_pmc;
 
return (0);
@@ -182,11 +190,23 @@ pmc_save_user_callchain(uintptr_t *cc, i
cc[frames++] = PMC_TRAPFRAME_TO_PC(tf);
sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf);
 
-   for (frames = 1; frames  maxsamples; frames++) {
+   for (; frames  maxsamples; frames++) {
if (!INUSER(sp))
break;
-   cc[frames++] = fuword(sp + 1);
-   sp = (uintptr_t *)fuword(sp);
+#ifdef __powerpc64__
+   /* Check if 32-bit mode. */
+   if (!(tf-srr1  PSL_SF)) {
+   cc[frames++] = fuword32((uint32_t *)sp + 1);
+   sp = (uintptr_t *)(uintptr_t)fuword32(sp);
+   } else {
+   cc[frames++] = fuword(sp + 2);
+   sp = (uintptr_t *)fuword(sp);
+   }
+#else
+   cc[frames++] = fuword32((uint32_t *)sp + 1);
+   sp = (uintptr_t *)fuword32(sp);
+#endif
}
+
return (frames);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org