Re: svn commit: r259896 - head/sys/dev/cxgb/common

2013-12-26 Thread Dimitry Andric
On 26 Dec 2013, at 02:51, Adrian Chadd adr...@freebsd.org wrote:
 I'd prefer you didn't remove unused code in drivers like this. If you
 must, #if 0 them out.

I don't mind either way, but some other people are very much opposed to
littering code with #if 0'd sections.  So, how do to determine what is
right in each situation? :-)


 Future people hacking on the driver may find it nice to have as much
 code in there which talks to the hardware. It may not be currently
 called, but it's at least there.

In this particular case, the code has never been used, even when the
file was originally committed, so I would say the chances of it ever
being used again are near zero.  (And even after deletion, the old
versions are available in our repository.)

For more active drivers, I will certainly just use #if, or simply turn
off the -Wunused-function warning.  And hope the code gets used
eventually. :-)

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r259913 - in head: lib/libstand sys/boot/ficl sys/boot/i386 sys/boot/i386/boot2 sys/boot/pc98 sys/boot/usb sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs

2013-12-26 Thread Dimitry Andric
Author: dim
Date: Thu Dec 26 11:32:39 2013
New Revision: 259913
URL: http://svnweb.freebsd.org/changeset/base/259913

Log:
  For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.
  
  MFC after:3 days
  X-MFC-With:   r259730

Modified:
  head/lib/libstand/Makefile
  head/sys/boot/ficl/Makefile
  head/sys/boot/i386/Makefile.inc
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/pc98/Makefile.inc
  head/sys/boot/usb/Makefile
  head/sys/boot/usb/Makefile.test
  head/sys/boot/userboot/ficl/Makefile
  head/sys/boot/userboot/libstand/Makefile
  head/sys/boot/zfs/Makefile

Modified: head/lib/libstand/Makefile
==
--- head/lib/libstand/Makefile  Thu Dec 26 10:45:17 2013(r259912)
+++ head/lib/libstand/Makefile  Thu Dec 26 11:32:39 2013(r259913)
@@ -21,7 +21,7 @@ CFLAGS+= -ffreestanding -Wformat
 CFLAGS+= -I${.CURDIR}
 
 .if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
-CFLAGS+=   -mpreferred-stack-boundary=2
+CFLAGS.gcc+=   -mpreferred-stack-boundary=2
 CFLAGS+=   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
 .endif
 .if ${MACHINE} == pc98

Modified: head/sys/boot/ficl/Makefile
==
--- head/sys/boot/ficl/Makefile Thu Dec 26 10:45:17 2013(r259912)
+++ head/sys/boot/ficl/Makefile Thu Dec 26 11:32:39 2013(r259913)
@@ -17,7 +17,7 @@ CFLAGS+=  -ffreestanding
 .if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
 .if !defined(FICL64)
 CFLAGS+=   -march=i386
-CFLAGS+=   -mpreferred-stack-boundary=2
+CFLAGS.gcc+=   -mpreferred-stack-boundary=2
 .endif
 CFLAGS+=   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
 .endif

Modified: head/sys/boot/i386/Makefile.inc
==
--- head/sys/boot/i386/Makefile.inc Thu Dec 26 10:45:17 2013
(r259912)
+++ head/sys/boot/i386/Makefile.inc Thu Dec 26 11:32:39 2013
(r259913)
@@ -5,8 +5,9 @@
 BINDIR?=   /boot
 
 LOADER_ADDRESS?=0x20
-CFLAGS+=   -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \
-   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+=   -march=i386 -ffreestanding
+CFLAGS.gcc+=   -mpreferred-stack-boundary=2
+CFLAGS+=   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
 LDFLAGS+=  -nostdlib
 
 .if ${MACHINE_CPUARCH} == amd64

Modified: head/sys/boot/i386/boot2/Makefile
==
--- head/sys/boot/i386/boot2/Makefile   Thu Dec 26 10:45:17 2013
(r259912)
+++ head/sys/boot/i386/boot2/Makefile   Thu Dec 26 11:32:39 2013
(r259913)
@@ -23,10 +23,7 @@ BOOT2_UFS?=  UFS1_AND_UFS2
 #BOOT2_UFS?=   UFS1_ONLY
 
 CFLAGS=-Os \
-   -fno-guess-branch-probability \
-fomit-frame-pointer \
-   -fno-unit-at-a-time \
-   -mno-align-long-strings \
-mrtd \
-mregparm=3 \
-DUSE_XREAD \
@@ -43,6 +40,10 @@ CFLAGS=  -Os \
-Winline --param max-inline-insns-single=100 \
${CLANG_OPT_SMALL}
 
+CFLAGS.gcc+=   -fno-guess-branch-probability \
+   -fno-unit-at-a-time \
+   -mno-align-long-strings \
+
 LDFLAGS=-static -N --gc-sections
 
 # Pick up ../Makefile.inc early.

Modified: head/sys/boot/pc98/Makefile.inc
==
--- head/sys/boot/pc98/Makefile.inc Thu Dec 26 10:45:17 2013
(r259912)
+++ head/sys/boot/pc98/Makefile.inc Thu Dec 26 11:32:39 2013
(r259913)
@@ -5,8 +5,9 @@
 BINDIR?=   /boot
 
 LOADER_ADDRESS?=0x20
-CFLAGS+=   -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \
-   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+=   -march=i386 -ffreestanding
+CFLAGS.gcc+=   -mpreferred-stack-boundary=2
+CFLAGS+=   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
 CFLAGS+=   -Os -DPC98
 LDFLAGS+=  -nostdlib
 

Modified: head/sys/boot/usb/Makefile
==
--- head/sys/boot/usb/Makefile  Thu Dec 26 10:45:17 2013(r259912)
+++ head/sys/boot/usb/Makefile  Thu Dec 26 11:32:39 2013(r259913)
@@ -53,7 +53,7 @@ CFLAGS+=  -g
 
 .if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
 CFLAGS+=   -march=i386
-CFLAGS+=   -mpreferred-stack-boundary=2
+CFLAGS.gcc+=   -mpreferred-stack-boundary=2
 .endif
 .if ${MACHINE_CPUARCH} == amd64
 CFLAGS+=   -m32

Modified: head/sys/boot/usb/Makefile.test
==
--- head/sys/boot/usb/Makefile.test Thu Dec 26 10:45:17 2013
(r259912)
+++ head/sys/boot/usb/Makefile.test Thu Dec 26 11:32:39 2013

svn commit: r259914 - head/usr.bin/rpcgen

2013-12-26 Thread Doug Rabson
Author: dfr
Date: Thu Dec 26 11:38:33 2013
New Revision: 259914
URL: http://svnweb.freebsd.org/changeset/base/259914

Log:
  Generate client sample code which compiles without warnings.
  For 'rpcgen -a', generate a makefile where 'make clean all' works.

Modified:
  head/usr.bin/rpcgen/rpc_main.c

Modified: head/usr.bin/rpcgen/rpc_main.c
==
--- head/usr.bin/rpcgen/rpc_main.c  Thu Dec 26 11:32:39 2013
(r259913)
+++ head/usr.bin/rpcgen/rpc_main.c  Thu Dec 26 11:38:33 2013
(r259914)
@@ -776,6 +776,8 @@ clnt_output(const char *infile, const ch
free(include);
} else
f_print(fout, #include rpc/rpc.h\n);
+   f_print(fout, #include stdio.h\n);
+   f_print(fout, #include stdlib.h\n);
tell = ftell(fout);
while ( (def = get_definition()) ) {
has_program += write_sample_clnt(def);
@@ -863,6 +865,10 @@ $(TARGETS_SVC.c:%%.c=%%.o) );
f_print(fout, all : $(CLIENT) $(SERVER)\n\n);
f_print(fout, $(TARGETS) : $(SOURCES.x) \n);
f_print(fout, \trpcgen $(RPCGENFLAGS) $(SOURCES.x)\n\n);
+   if (allfiles) {
+   f_print(fout, \trpcgen -Sc $(RPCGENFLAGS) $(SOURCES.x) -o 
%s\n\n, clientname);
+   f_print(fout, \trpcgen -Ss $(RPCGENFLAGS) $(SOURCES.x) -o 
%s\n\n, servername);
+   }
f_print(fout, $(OBJECTS_CLNT) : $(SOURCES_CLNT.c) $(SOURCES_CLNT.h) \
 $(TARGETS_CLNT.c) \n\n);
 
___
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: r259915 - head/sys/dev/vt

2013-12-26 Thread Aleksandr Rybalko
Author: ray
Date: Thu Dec 26 14:25:37 2013
New Revision: 259915
URL: http://svnweb.freebsd.org/changeset/base/259915

Log:
  Fix AltGr, we should not only skip RAlt key release if enable_altgr is set, 
but
  also process RAlt key press same way.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Thu Dec 26 11:38:33 2013(r259914)
+++ head/sys/dev/vt/vt_core.c   Thu Dec 26 14:25:37 2013(r259915)
@@ -417,6 +417,8 @@ vt_processkey(keyboard_t *kbd, struct vt
} else {
switch (c  ~RELKEY) {
case (SPCLKEY | RALT):
+   if (vt_enable_altgr != 0)
+   break;
case (SPCLKEY | LALT):
vd-vd_kbstate |= ALKED;
}
___
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: r259916 - head/sbin/pfctl

2013-12-26 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Dec 26 15:51:14 2013
New Revision: 259916
URL: http://svnweb.freebsd.org/changeset/base/259916

Log:
  Use feature_present(3) to determine whether to open an INET or an
  INET6 socket when needed to allow pfctl to work on noinet and noinet6
  kernels (and try to provide a fallback using AF_LINK as best effort).
  Adjust the Makefile to also respect relevant src.conf(5) options
  for compile time decisions on INET and INET6 support.
  
  Reviewed by:  glebius (no objections)
  MFC after:1 week

Modified:
  head/sbin/pfctl/Makefile
  head/sbin/pfctl/pfctl_altq.c
  head/sbin/pfctl/pfctl_parser.c
  head/sbin/pfctl/pfctl_parser.h

Modified: head/sbin/pfctl/Makefile
==
--- head/sbin/pfctl/MakefileThu Dec 26 14:25:37 2013(r259915)
+++ head/sbin/pfctl/MakefileThu Dec 26 15:51:14 2013(r259916)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include bsd.own.mk
+
 # pf_ruleset.c is shared between kernel and pfctl
 .PATH: ${.CURDIR}/../../sys/netpfil/pf
 
@@ -16,6 +18,14 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wno
 CFLAGS+= -Wstrict-prototypes
 CFLAGS+= -DENABLE_ALTQ -I${.CURDIR}
 
+# Need to use WITH_ prefix to not conflict with the l/y INET/INET6 keywords
+.if ${MK_INET6_SUPPORT} != no
+CFLAGS+= -DWITH_INET6
+.endif
+.if ${MK_INET_SUPPORT} != no
+CFLAGS+= -DWITH_INET
+.endif
+
 YFLAGS=
 
 LDADD+=-lm -lmd

Modified: head/sbin/pfctl/pfctl_altq.c
==
--- head/sbin/pfctl/pfctl_altq.cThu Dec 26 14:25:37 2013
(r259915)
+++ head/sbin/pfctl/pfctl_altq.cThu Dec 26 15:51:14 2013
(r259916)
@@ -1122,7 +1122,7 @@ getifspeed(char *ifname)
struct ifreqifr;
struct if_data  ifrdat;
 
-   if ((s = socket(AF_INET, SOCK_DGRAM, 0))  0)
+   if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0))  0)
err(1, socket);
bzero(ifr, sizeof(ifr));
if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) =
@@ -1143,7 +1143,7 @@ getifmtu(char *ifname)
int s;
struct ifreqifr;
 
-   if ((s = socket(AF_INET, SOCK_DGRAM, 0))  0)
+   if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0))  0)
err(1, socket);
bzero(ifr, sizeof(ifr));
if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) =

Modified: head/sbin/pfctl/pfctl_parser.c
==
--- head/sbin/pfctl/pfctl_parser.c  Thu Dec 26 14:25:37 2013
(r259915)
+++ head/sbin/pfctl/pfctl_parser.c  Thu Dec 26 15:51:14 2013
(r259916)
@@ -1231,6 +1231,26 @@ ifa_load(void)
freeifaddrs(ifap);
 }
 
+int
+get_socket_domain(void)
+{
+   int sdom;
+
+   sdom = AF_UNSPEC;
+#ifdef WITH_INET6
+   if (sdom == AF_UNSPEC  feature_present(inet6))
+   sdom = AF_INET6;
+#endif
+#ifdef WITH_INET
+   if (sdom == AF_UNSPEC  feature_present(inet))
+   sdom = AF_INET;
+#endif
+   if (sdom == AF_UNSPEC)
+   sdom = AF_LINK;
+
+   return (sdom);
+}
+
 struct node_host *
 ifa_exists(const char *ifa_name)
 {
@@ -1242,7 +1262,7 @@ ifa_exists(const char *ifa_name)
ifa_load();
 
/* check wether this is a group */
-   if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+   if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) == -1)
err(1, socket);
bzero(ifgr, sizeof(ifgr));
strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name));
@@ -1273,7 +1293,7 @@ ifa_grouplookup(const char *ifa_name, in
int  s, len;
struct node_host*n, *h = NULL;
 
-   if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+   if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) == -1)
err(1, socket);
bzero(ifgr, sizeof(ifgr));
strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name));

Modified: head/sbin/pfctl/pfctl_parser.h
==
--- head/sbin/pfctl/pfctl_parser.h  Thu Dec 26 14:25:37 2013
(r259915)
+++ head/sbin/pfctl/pfctl_parser.h  Thu Dec 26 15:51:14 2013
(r259916)
@@ -294,6 +294,7 @@ void set_ipmask(struct node_host *, 
u
 int check_netmask(struct node_host *, sa_family_t);
 int unmask(struct pf_addr *, sa_family_t);
 voidifa_load(void);
+int get_socket_domain(void);
 struct node_host   *ifa_exists(const char *);
 struct node_host   *ifa_lookup(const char *, int);
 struct node_host   *host(const char *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to 

Re: svn commit: r259859 - head/sys/netinet/libalias

2013-12-26 Thread John Baldwin
On Tuesday, December 24, 2013 10:24:20 pm Gleb Smirnoff wrote:
 Author: glebius
 Date: Wed Dec 25 03:24:20 2013
 New Revision: 259859
 URL: http://svnweb.freebsd.org/changeset/base/259859
 
 Log:
   Cleanup alias module handler register/unregister.
   
   - Remove locking, since all module(9) events are running under Giant.

Eh, at some point that will go away.

-- 
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: r259881 - head/release

2013-12-26 Thread John Baldwin
On Wednesday, December 25, 2013 1:25:58 pm Julio Merino wrote:
 Author: jmmv
 Date: Wed Dec 25 18:25:58 2013
 New Revision: 259881
 URL: http://svnweb.freebsd.org/changeset/base/259881
 
 Log:
   Put the release objdir inside the chroot.

Hmm in my local releases of 10 this was already true that the release bits 
ended up in ${CHROOTDIR}/usr/obj/usr/src/release and not 
/usr/obj/usr/src/release.

-- 
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


svn commit: r259920 - in head/contrib/gcc: . doc

2013-12-26 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Dec 26 18:09:16 2013
New Revision: 259920
URL: http://svnweb.freebsd.org/changeset/base/259920

Log:
  gcc: Implement -Wmost for compatibility with clang.
  
  This is equivalent to -Wall -Wno-parentheses.
  
  Obtained from:Apple GCC 4.2 - 5531
  MFC after:1 week

Modified:
  head/contrib/gcc/c-opts.c
  head/contrib/gcc/c.opt
  head/contrib/gcc/doc/invoke.texi

Modified: head/contrib/gcc/c-opts.c
==
--- head/contrib/gcc/c-opts.c   Thu Dec 26 16:59:50 2013(r259919)
+++ head/contrib/gcc/c-opts.c   Thu Dec 26 18:09:16 2013(r259920)
@@ -385,12 +385,17 @@ c_common_handle_option (size_t scode, co
   break;
 
 case OPT_Wall:
+  /* APPLE LOCAL -Wmost */
+case OPT_Wmost:
   set_Wunused (value);
   set_Wformat (value);
   set_Wimplicit (value);
   warn_char_subscripts = value;
   warn_missing_braces = value;
-  warn_parentheses = value;
+  /* APPLE LOCAL begin -Wmost --dpatel */
+  if (code != OPT_Wmost) 
+   warn_parentheses = value;
+  /* APPLE LOCAL end -Wmost --dpatel */
   warn_return_type = value;
   warn_sequence_point = value; /* Was C only.  */
   if (c_dialect_cxx ())

Modified: head/contrib/gcc/c.opt
==
--- head/contrib/gcc/c.opt  Thu Dec 26 16:59:50 2013(r259919)
+++ head/contrib/gcc/c.opt  Thu Dec 26 18:09:16 2013(r259920)
@@ -284,6 +284,12 @@ Wmissing-prototypes
 C ObjC Var(warn_missing_prototypes)
 Warn about global functions without prototypes
 
+; APPLE LOCAL begin -Wmost
+Wmost
+C ObjC C++ ObjC++ 
+Like -Wall but without -Wparentheses
+; APPLE LOCAL end -Wmost
+
 Wmultichar
 C ObjC C++ ObjC++
 Warn about use of multi-character character constants

Modified: head/contrib/gcc/doc/invoke.texi
==
--- head/contrib/gcc/doc/invoke.texiThu Dec 26 16:59:50 2013
(r259919)
+++ head/contrib/gcc/doc/invoke.texiThu Dec 26 18:09:16 2013
(r259920)
@@ -222,6 +222,8 @@ in the following sections.
 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
 -Wmissing-noreturn @gol
+@c APPLE LOCAL -Wmost
+-Wmost (APPLE ONLY) @gol
 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
 -Woverlength-strings  -Wpacked  -Wpadded @gol
 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
@@ -2652,7 +2654,12 @@ warnings about constructions that some u
 that are easy to avoid (or modify to prevent the warning), even in
 conjunction with macros.  This also enables some language-specific
 warnings described in @ref{C++ Dialect Options}.
+@c APPLE LOCAL begin -Wmost
+@item -Wmost
+@opindex Wmost
+This is equivalent to -Wall -Wno-parentheses.  (Apple compatible)
 @end table
+@c APPLE LOCAL end -Wmost
 
 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
 Some of them warn about constructions that users generally do not
___
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: r259881 - head/release

2013-12-26 Thread Julio Merino
On Thu, Dec 26, 2013 at 11:14 AM, John Baldwin j...@freebsd.org wrote:

 On Wednesday, December 25, 2013 1:25:58 pm Julio Merino wrote:
  Author: jmmv
  Date: Wed Dec 25 18:25:58 2013
  New Revision: 259881
  URL: http://svnweb.freebsd.org/changeset/base/259881
 
  Log:
Put the release objdir inside the chroot.

 Hmm in my local releases of 10 this was already true that the release bits
 ended up in ${CHROOTDIR}/usr/obj/usr/src/release and not
 /usr/obj/usr/src/release.


Note that make is invoked *both* from inside and outside the chroot. This
means that you indeed have stuff in CHROOTDIR/usr/obj -- but that's not
all.  I suspect you can also see stuff in /usr/obj/scratch/.

-- 
Julio Merino / @jmmv
___
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: r259921 - head/lib/libc/sys

2013-12-26 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Dec 26 19:16:30 2013
New Revision: 259921
URL: http://svnweb.freebsd.org/changeset/base/259921

Log:
  Provide the manual page for aio_fsync(2).
  
  Reviewed by:  davidxu
  MFC after:1 week

Added:
  head/lib/libc/sys/aio_fsync.2   (contents, props changed)
Modified:
  head/lib/libc/sys/Makefile.inc

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Thu Dec 26 18:09:16 2013
(r259920)
+++ head/lib/libc/sys/Makefile.inc  Thu Dec 26 19:16:30 2013
(r259921)
@@ -85,6 +85,7 @@ MAN+= abort2.2 \
adjtime.2 \
aio_cancel.2 \
aio_error.2 \
+   aio_fsync.2 \
aio_mlock.2 \
aio_read.2 \
aio_return.2 \

Added: head/lib/libc/sys/aio_fsync.2
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/sys/aio_fsync.2   Thu Dec 26 19:16:30 2013
(r259921)
@@ -0,0 +1,152 @@
+.\ Copyright (c) 2013 Sergey Kandaurov
+.\ 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.
+.\
+.\ 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.
+.\
+.\ $FreeBSD$
+.\
+.Dd May 4, 2013
+.Dt AIO_FSYNC 2
+.Os
+.Sh NAME
+.Nm aio_fsync
+.Nd asynchronous file synchronization (REALTIME)
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In aio.h
+.Ft int
+.Fn aio_fsync int op struct aiocb *iocb
+.Sh DESCRIPTION
+The
+.Fn aio_fsync
+system call allows the calling process to move all modified data
+associated with the descriptor
+.Fa iocb-aio_fildes
+to a permanent storage device.
+The call returns immediately after the synchronization request has been
+enqueued to the descriptor; the synchronization may or may not have
+completed at the time the call returns.
+.Pp
+The
+.Fa op
+argument could be set only to
+.Dv O_SYNC
+to cause all currently queued I/O operations to be completed
+as if by a call to
+.Xr fsync 2 .
+.Pp
+If _POSIX_PRIORITIZED_IO is defined, and the descriptor supports it,
+then the enqueued operation is submitted at a priority equal to that
+of the calling process minus
+.Fa iocb-aio_reqprio .
+.Pp
+The
+.Fa iocb
+pointer may be subsequently used as an argument to
+.Fn aio_return
+and
+.Fn aio_error
+in order to determine return or error status for the enqueued operation
+while it is in progress.
+.Pp
+If the request could not be enqueued (generally due to invalid arguments),
+the call returns without having enqueued the request.
+.Sh RETURN VALUES
+.Rv -std aio_fsync
+.Sh ERRORS
+The
+.Fn aio_fsync
+system call will fail if:
+.Bl -tag -width Er
+.It Bq Er EAGAIN
+The request was not queued because of system resource limitations.
+.It Bq Er ENOSYS
+The
+.Fn aio_fsync
+system call is not supported.
+.It Bq Er EINVAL
+A value of the
+.Fa op
+argument is not set to
+.Dv O_SYNC .
+.El
+.Pp
+The following conditions may be synchronously detected when the
+.Fn aio_fsync
+system call is made, or asynchronously, at any time thereafter.
+If they are detected at call time,
+.Fn aio_fsync
+returns -1 and sets
+.Va errno
+appropriately; otherwise the
+.Fn aio_return
+system call must be called, and will return -1, and
+.Fn aio_error
+must be called to determine the actual value that would have been
+returned in
+.Va errno .
+.Bl -tag -width Er
+.It Bq Er EBADF
+The
+.Fa iocb-aio_fildes
+is invalid for writing.
+.It Bq Er EINVAL
+This implementation does not support synchronized I/O for this file.
+.El
+.Pp
+If the request is successfully enqueued, but subsequently cancelled
+or an error occurs, the value returned by the
+.Fn aio_return
+system call is per the
+.Xr read 2
+and
+.Xr write 2
+system calls, and the value returned by the
+.Fn 

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

2013-12-26 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Dec 26 19:18:43 2013
New Revision: 259922
URL: http://svnweb.freebsd.org/changeset/base/259922

Log:
  Fix an apparent typo.
  
  MFC after:3 days

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

Modified: head/lib/libc/sys/aio_mlock.2
==
--- head/lib/libc/sys/aio_mlock.2   Thu Dec 26 19:16:30 2013
(r259921)
+++ head/lib/libc/sys/aio_mlock.2   Thu Dec 26 19:18:43 2013
(r259922)
@@ -87,7 +87,7 @@ request has completed, are not allowed.
 .Rv -std aio_mlock
 .Sh ERRORS
 The
-.Fn aio_read
+.Fn aio_mlock
 system call will fail if:
 .Bl -tag -width Er
 .It Bq Er EAGAIN
___
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: r259924 - head/sys/amd64/vmm/io

2013-12-26 Thread Neel Natu
Author: neel
Date: Thu Dec 26 19:58:30 2013
New Revision: 259924
URL: http://svnweb.freebsd.org/changeset/base/259924

Log:
  Modify handling of writes to the vlapic ID, LDR and DFR registers.
  
  The handlers are now called after the register value is updated in the virtual
  APIC page. This will make it easier to handle APIC-write VM-exits with APIC
  register virtualization turned on.
  
  Additionally, we need to ensure that the value of these registers is always
  correctly reflected in the virtual APIC page, because there is no VM exit
  when the guest reads these registers with APIC register virtualization.

Modified:
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/amd64/vmm/io/vlapic.h

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Thu Dec 26 19:39:23 2013
(r259923)
+++ head/sys/amd64/vmm/io/vlapic.c  Thu Dec 26 19:58:30 2013
(r259924)
@@ -125,72 +125,71 @@ vlapic_get_id(struct vlapic *vlapic)
return (vlapic-vcpuid  24);
 }
 
-static __inline uint32_t
-vlapic_get_ldr(struct vlapic *vlapic)
+static uint32_t
+x2apic_ldr(struct vlapic *vlapic)
 {
-   struct LAPIC *lapic;
int apicid;
uint32_t ldr;
 
-   lapic = vlapic-apic_page;
-   if (x2apic(vlapic)) {
-   apicid = vlapic_get_id(vlapic);
-   ldr = 1  (apicid  0xf);
-   ldr |= (apicid  0x0)  12;
-   return (ldr);
-   } else
-   return (lapic-ldr);
+   apicid = vlapic_get_id(vlapic);
+   ldr = 1  (apicid  0xf);
+   ldr |= (apicid  0x0)  12;
+   return (ldr);
 }
 
-static __inline uint32_t
-vlapic_get_dfr(struct vlapic *vlapic)
+void
+vlapic_dfr_write_handler(struct vlapic *vlapic)
 {
struct LAPIC *lapic;
 
lapic = vlapic-apic_page;
-   if (x2apic(vlapic))
-   return (0);
-   else
-   return (lapic-dfr);
-}
-
-static void
-vlapic_set_dfr(struct vlapic *vlapic, uint32_t data)
-{
-   uint32_t dfr;
-   struct LAPIC *lapic;
-   
if (x2apic(vlapic)) {
-   VM_CTR1(vlapic-vm, write to DFR in x2apic mode: %#x, data);
+   VM_CTR1(vlapic-vm, ignoring write to DFR in x2apic mode: %#x,
+   lapic-dfr);
+   lapic-dfr = 0;
return;
}
 
-   lapic = vlapic-apic_page;
-   dfr = (lapic-dfr  APIC_DFR_RESERVED) | (data  APIC_DFR_MODEL_MASK);
-   if ((dfr  APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT)
+   lapic-dfr = APIC_DFR_MODEL_MASK;
+   lapic-dfr |= APIC_DFR_RESERVED;
+
+   if ((lapic-dfr  APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT)
VLAPIC_CTR0(vlapic, vlapic DFR in Flat Model);
-   else if ((dfr  APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER)
+   else if ((lapic-dfr  APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER)
VLAPIC_CTR0(vlapic, vlapic DFR in Cluster Model);
else
-   VLAPIC_CTR1(vlapic, vlapic DFR in Unknown Model %#x, dfr);
-
-   lapic-dfr = dfr;
+   VLAPIC_CTR1(vlapic, DFR in Unknown Model %#x, lapic-dfr);
 }
 
-static void
-vlapic_set_ldr(struct vlapic *vlapic, uint32_t data)
+void
+vlapic_ldr_write_handler(struct vlapic *vlapic)
 {
struct LAPIC *lapic;
 
+   lapic = vlapic-apic_page;
+
/* LDR is read-only in x2apic mode */
if (x2apic(vlapic)) {
-   VLAPIC_CTR1(vlapic, write to LDR in x2apic mode: %#x, data);
-   return;
+   VLAPIC_CTR1(vlapic, ignoring write to LDR in x2apic mode: %#x,
+   lapic-ldr);
+   lapic-ldr = x2apic_ldr(vlapic);
+   } else {
+   lapic-ldr = ~APIC_LDR_RESERVED;
+   VLAPIC_CTR1(vlapic, vlapic LDR set to %#x, lapic-ldr);
}
+}
 
+void
+vlapic_id_write_handler(struct vlapic *vlapic)
+{
+   struct LAPIC *lapic;
+   
+   /*
+* We don't allow the ID register to be modified so reset it back to
+* its default value.
+*/
lapic = vlapic-apic_page;
-   lapic-ldr = data  ~APIC_LDR_RESERVED;
-   VLAPIC_CTR1(vlapic, vlapic LDR set to %#x, lapic-ldr);
+   lapic-id = vlapic_get_id(vlapic);
 }
 
 static int
@@ -314,6 +313,7 @@ vlapic_reset(struct vlapic *vlapic)
lapic = vlapic-apic_page;
bzero(lapic, sizeof(struct LAPIC));
 
+   lapic-id = vlapic_get_id(vlapic);
lapic-version = VLAPIC_VERSION;
lapic-version |= (VLAPIC_MAXLVT_ENTRIES  MAXLVTSHIFT);
lapic-dfr = 0x;
@@ -843,8 +843,8 @@ vlapic_calcdest(struct vm *vm, cpuset_t 
CPU_CLR(vcpuid, amask);
 
vlapic = vm_lapic(vm, vcpuid);
-   dfr = vlapic_get_dfr(vlapic);
-   ldr = vlapic_get_ldr(vlapic);
+   dfr = vlapic-apic_page-dfr;
+   ldr = 

Re: svn commit: r259859 - head/sys/netinet/libalias

2013-12-26 Thread Gleb Smirnoff
On Thu, Dec 26, 2013 at 11:04:54AM -0500, John Baldwin wrote:
J On Tuesday, December 24, 2013 10:24:20 pm Gleb Smirnoff wrote:
J  Author: glebius
J  Date: Wed Dec 25 03:24:20 2013
J  New Revision: 259859
J  URL: http://svnweb.freebsd.org/changeset/base/259859
J  
J  Log:
JCleanup alias module handler register/unregister.
J
J- Remove locking, since all module(9) events are running under Giant.
J 
J Eh, at some point that will go away.

Are they going to be serialized by default?

-- 
Totus tuus, Glebius.
___
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: r259921 - head/lib/libc/sys

2013-12-26 Thread Jilles Tjoelker
On Thu, Dec 26, 2013 at 07:16:31PM +, Sergey Kandaurov wrote:
 Author: pluknet
 Date: Thu Dec 26 19:16:30 2013
 New Revision: 259921
 URL: http://svnweb.freebsd.org/changeset/base/259921

 Log:
   Provide the manual page for aio_fsync(2).

   Reviewed by:davidxu
   MFC after:  1 week

 Added: head/lib/libc/sys/aio_fsync.2
 ==
 --- /dev/null 00:00:00 1970   (empty, because file is newly added)
 +++ head/lib/libc/sys/aio_fsync.2 Thu Dec 26 19:16:30 2013
 (r259921)
 @@ -0,0 +1,152 @@
 [snip]
 +The
 +.Fa op
 +argument could be set only to

I suppose the op argument must be set to O_SYNC, rather than could
only be set to O_SYNC. Alternatively, it can only be set to O_SYNC.

 +.Dv O_SYNC
 +to cause all currently queued I/O operations to be completed
 +as if by a call to
 +.Xr fsync 2 .
 +.Pp
 [snip]
 +.Bl -tag -width Er
 +.It Bq Er EBADF
 +The
 +.Fa iocb-aio_fildes
 +is invalid for writing.

This is what current POSIX standards say, but it does not make sense and
does not work that way. Any open file descriptor is sufficient, since
the access mode does not affect whether there are pending I/O operations
on the underlying file. See http://austingroupbugs.net/view.php?id=671
which FreeBSD already implements (from reading the code).

The text from fsync(2) can be used:

.It Bq Er EBADF
The
.Fa iocb-aio_fildes
argument
is not a valid descriptor.

 [snip]
 +.Pp
 +If the request is successfully enqueued, but subsequently cancelled
 +or an error occurs, the value returned by the
 +.Fn aio_return
 +system call is per the
 +.Xr read 2
 +and
 +.Xr write 2
 +system calls, and the value returned by the
 +.Fn aio_error
 +system call is one of the error returns from the
 +.Xr read 2
 +or
 +.Xr write 2
 +system calls.

The reference to read() and write() is in fact correct, and is missing
from the fsync(2) page. For example, [EDQUOT] or [ENOSPC] may be seen on
a network filesystem.

 [snip]

-- 
Jilles Tjoelker
___
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: r259925 - in head/sys: geom/part sys

2013-12-26 Thread Dmitry Morozovsky
Author: marck (doc committer)
Date: Thu Dec 26 21:06:12 2013
New Revision: 259925
URL: http://svnweb.freebsd.org/changeset/base/259925

Log:
  Add GPT UUID for VMware vSAN meta-data partition.
  
  Approved by:  ae
  MFC after:2 weeks

Modified:
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part.h
  head/sys/geom/part/g_part_gpt.c
  head/sys/sys/gpt.h

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Thu Dec 26 19:58:30 2013(r259924)
+++ head/sys/geom/part/g_part.c Thu Dec 26 21:06:12 2013(r259925)
@@ -107,6 +107,7 @@ struct g_part_alias_list {
{ vmware-vmfs, G_PART_ALIAS_VMFS },
{ vmware-vmkdiag, G_PART_ALIAS_VMKDIAG },
{ vmware-reserved, G_PART_ALIAS_VMRESERVED },
+   { vmware-vsanhdr, G_PART_ALIAS_VMVSANHDR },
 };
 
 SYSCTL_DECL(_kern_geom);

Modified: head/sys/geom/part/g_part.h
==
--- head/sys/geom/part/g_part.h Thu Dec 26 19:58:30 2013(r259924)
+++ head/sys/geom/part/g_part.h Thu Dec 26 21:06:12 2013(r259925)
@@ -74,6 +74,7 @@ enum g_part_alias {
G_PART_ALIAS_VMFS,  /* A VMware VMFS partition entry */
G_PART_ALIAS_VMKDIAG,   /* A VMware vmkDiagnostic partition 
entry */
G_PART_ALIAS_VMRESERVED,/* A VMware reserved partition entry */
+   G_PART_ALIAS_VMVSANHDR, /* A VMware vSAN header partition entry 
*/
/* Keep the following last */
G_PART_ALIAS_COUNT
 };

Modified: head/sys/geom/part/g_part_gpt.c
==
--- head/sys/geom/part/g_part_gpt.c Thu Dec 26 19:58:30 2013
(r259924)
+++ head/sys/geom/part/g_part_gpt.c Thu Dec 26 21:06:12 2013
(r259925)
@@ -167,6 +167,7 @@ static struct uuid gpt_uuid_linux_swap =
 static struct uuid gpt_uuid_vmfs = GPT_ENT_TYPE_VMFS;
 static struct uuid gpt_uuid_vmkdiag = GPT_ENT_TYPE_VMKDIAG;
 static struct uuid gpt_uuid_vmreserved = GPT_ENT_TYPE_VMRESERVED;
+static struct uuid gpt_uuid_vmvsanhdr = GPT_ENT_TYPE_VMVSANHDR;
 static struct uuid gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
 static struct uuid gpt_uuid_ms_reserved = GPT_ENT_TYPE_MS_RESERVED;
 static struct uuid gpt_uuid_ms_ldm_data = GPT_ENT_TYPE_MS_LDM_DATA;
@@ -208,6 +209,7 @@ static struct g_part_uuid_alias {
{ gpt_uuid_vmfs,   G_PART_ALIAS_VMFS,   0 },
{ gpt_uuid_vmkdiag,G_PART_ALIAS_VMKDIAG,0 },
{ gpt_uuid_vmreserved, G_PART_ALIAS_VMRESERVED, 0 },
+   { gpt_uuid_vmvsanhdr,  G_PART_ALIAS_VMVSANHDR,  0 },
{ gpt_uuid_mbr,G_PART_ALIAS_MBR,0 },
{ gpt_uuid_ms_basic_data,  G_PART_ALIAS_MS_BASIC_DATA,  0x0b },
{ gpt_uuid_ms_ldm_data,G_PART_ALIAS_MS_LDM_DATA,0 },

Modified: head/sys/sys/gpt.h
==
--- head/sys/sys/gpt.h  Thu Dec 26 19:58:30 2013(r259924)
+++ head/sys/sys/gpt.h  Thu Dec 26 21:06:12 2013(r259925)
@@ -128,6 +128,8 @@ struct gpt_ent {
{0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}}
 #defineGPT_ENT_TYPE_VMRESERVED \
{0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}}
+#defineGPT_ENT_TYPE_VSANHDR
+   {0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}}
 
 #defineGPT_ENT_TYPE_APPLE_BOOT \
{0x426F6F74,0x,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
___
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: r259926 - head/sys/sys

2013-12-26 Thread Dimitry Andric
Author: dim
Date: Thu Dec 26 22:28:15 2013
New Revision: 259926
URL: http://svnweb.freebsd.org/changeset/base/259926

Log:
  In sys/sys/gpt.h, add a missing backslash at the end of the
  GPT_ENT_TYPE_VSANHDR define.
  
  Pointy hat to:marck
  MFC after:2 weeks
  X-MFC-With:   r259925

Modified:
  head/sys/sys/gpt.h

Modified: head/sys/sys/gpt.h
==
--- head/sys/sys/gpt.h  Thu Dec 26 21:06:12 2013(r259925)
+++ head/sys/sys/gpt.h  Thu Dec 26 22:28:15 2013(r259926)
@@ -128,7 +128,7 @@ struct gpt_ent {
{0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}}
 #defineGPT_ENT_TYPE_VMRESERVED \
{0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}}
-#defineGPT_ENT_TYPE_VSANHDR
+#defineGPT_ENT_TYPE_VSANHDR\
{0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}}
 
 #defineGPT_ENT_TYPE_APPLE_BOOT \
___
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: r259927 - head/sys/boot/pc98/boot2

2013-12-26 Thread Dimitry Andric
Author: dim
Date: Thu Dec 26 22:31:47 2013
New Revision: 259927
URL: http://svnweb.freebsd.org/changeset/base/259927

Log:
  Fix pc98 build, by also forcing COMPILER_TYPE in sys/boot/pc98/boot2's
  Makefile.
  
  Pointy hat to:dim
  MFC after:3 days
  X-MFC-With:   r259730

Modified:
  head/sys/boot/pc98/boot2/Makefile

Modified: head/sys/boot/pc98/boot2/Makefile
==
--- head/sys/boot/pc98/boot2/Makefile   Thu Dec 26 22:28:15 2013
(r259926)
+++ head/sys/boot/pc98/boot2/Makefile   Thu Dec 26 22:31:47 2013
(r259927)
@@ -4,6 +4,7 @@
 
 # XXX: clang can compile the boot code just fine, but boot2 gets too big
 CC:=   gcc
+COMPILER_TYPE:=gcc
 
 FILES= boot boot1 boot2
 
___
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: r259928 - head/sys/dev/bxe

2013-12-26 Thread Dimitry Andric
Author: dim
Date: Thu Dec 26 22:42:11 2013
New Revision: 259928
URL: http://svnweb.freebsd.org/changeset/base/259928

Log:
  In sys/dev/bxe/bxe.c, remove static function bxe_has_tx_work_unload(),
  which has never been used.
  
  Reviewed by:  edavis
  MFC after:3 days

Modified:
  head/sys/dev/bxe/bxe.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Thu Dec 26 22:31:47 2013(r259927)
+++ head/sys/dev/bxe/bxe.c  Thu Dec 26 22:42:11 2013(r259928)
@@ -2745,13 +2745,6 @@ bxe_drv_pulse(struct bxe_softc *sc)
  sc-fw_drv_pulse_wr_seq);
 }
 
-static inline int
-bxe_has_tx_work_unload(struct bxe_fastpath *fp)
-{
-mb(); /* consumer and producer can change */
-return (fp-tx_pkt_prod != fp-tx_pkt_cons);
-}
-
 static inline uint16_t
 bxe_tx_avail(struct bxe_softc *sc,
  struct bxe_fastpath *fp)
___
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: r259929 - in head: sbin/geom/class/mirror sys/geom/mirror

2013-12-26 Thread Andrey V. Elsukov
Author: ae
Date: Fri Dec 27 02:43:53 2013
New Revision: 259929
URL: http://svnweb.freebsd.org/changeset/base/259929

Log:
  Add an ability to stop gmirror and clear its metadata in one command.
  This fixes the problem, when gmirror starts again just after stop.
  
  The problem occurs when gmirror's component has geom label with equal size.
  E.g. gpt and gptid have the same size as partition, diskid has the same
  size as entire disk. When gmirror's geom has been destroyed, glabel
  creates its providers and this initiate retaste.
  
  Now gmirror destroy command is available. It destroys geom and also
  erases gmirror's metadata.
  
  MFC after:2 weeks

Modified:
  head/sbin/geom/class/mirror/geom_mirror.c
  head/sbin/geom/class/mirror/gmirror.8
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/mirror/g_mirror.h
  head/sys/geom/mirror/g_mirror_ctl.c

Modified: head/sbin/geom/class/mirror/geom_mirror.c
==
--- head/sbin/geom/class/mirror/geom_mirror.c   Thu Dec 26 22:42:11 2013
(r259928)
+++ head/sbin/geom/class/mirror/geom_mirror.c   Fri Dec 27 02:43:53 2013
(r259929)
@@ -82,6 +82,13 @@ struct g_command class_commands[] = {
{ deactivate, G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
[-v] name prov ...
},
+   { destroy, G_FLAG_VERBOSE, NULL,
+   {
+   { 'f', force, NULL, G_TYPE_BOOL },
+   G_OPT_SENTINEL
+   },
+   [-fv] name ...
+   },
{ dump, 0, mirror_main, G_NULL_OPTS,
prov ...
},

Modified: head/sbin/geom/class/mirror/gmirror.8
==
--- head/sbin/geom/class/mirror/gmirror.8   Thu Dec 26 22:42:11 2013
(r259928)
+++ head/sbin/geom/class/mirror/gmirror.8   Fri Dec 27 02:43:53 2013
(r259929)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 20, 2013
+.Dd December 27, 2013
 .Dt GMIRROR 8
 .Os
 .Sh NAME
@@ -86,6 +86,10 @@
 .Ar name
 .Ar prov ...
 .Nm
+.Cm destroy
+.Op Fl fv
+.Ar name ...
+.Nm
 .Cm forget
 .Op Fl v
 .Ar name ...
@@ -227,6 +231,14 @@ Activate the given component(s), which w
 .It Cm deactivate
 Mark the given component(s) as inactive, so it will not be automatically
 connected to the mirror.
+.It Cm destroy
+Stop the given mirror and clear metadata on all its components.
+.Pp
+Additional options include:
+.Bl -tag -width .Fl f
+.It Fl f
+Stop the given mirror even if it is opened.
+.El
 .It Cm forget
 Forget about components which are not connected.
 This command is useful when a disk has failed and cannot be reconnected, 
preventing the

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Thu Dec 26 22:42:11 2013
(r259928)
+++ head/sys/geom/mirror/g_mirror.c Fri Dec 27 02:43:53 2013
(r259929)
@@ -642,7 +642,8 @@ g_mirror_write_metadata(struct g_mirror_
length = cp-provider-sectorsize;
offset = cp-provider-mediasize - length;
sector = malloc((size_t)length, M_MIRROR, M_WAITOK | M_ZERO);
-   if (md != NULL) {
+   if (md != NULL 
+   (sc-sc_flags  G_MIRROR_DEVICE_FLAG_WIPE) == 0) {
/*
 * Handle the case, when the size of parent provider reduced.
 */
@@ -749,7 +750,8 @@ g_mirror_update_metadata(struct g_mirror
sc = disk-d_softc;
sx_assert(sc-sc_lock, SX_LOCKED);
 
-   g_mirror_fill_metadata(sc, disk, md);
+   if ((sc-sc_flags  G_MIRROR_DEVICE_FLAG_WIPE) == 0)
+   g_mirror_fill_metadata(sc, disk, md);
error = g_mirror_write_metadata(disk, md);
if (error == 0) {
G_MIRROR_DEBUG(2, Metadata on %s updated.,

Modified: head/sys/geom/mirror/g_mirror.h
==
--- head/sys/geom/mirror/g_mirror.h Thu Dec 26 22:42:11 2013
(r259928)
+++ head/sys/geom/mirror/g_mirror.h Fri Dec 27 02:43:53 2013
(r259929)
@@ -160,6 +160,7 @@ struct g_mirror_event {
 #defineG_MIRROR_DEVICE_FLAG_WAIT   0x0200ULL
 #defineG_MIRROR_DEVICE_FLAG_DESTROYING 0x0400ULL
 #defineG_MIRROR_DEVICE_FLAG_TASTING0x0800ULL
+#defineG_MIRROR_DEVICE_FLAG_WIPE   0x1000ULL
 
 #defineG_MIRROR_DEVICE_STATE_STARTING  0
 #defineG_MIRROR_DEVICE_STATE_RUNNING   1

Modified: head/sys/geom/mirror/g_mirror_ctl.c
==
--- head/sys/geom/mirror/g_mirror_ctl.c Thu Dec 26 22:42:11 2013
(r259928)
+++ head/sys/geom/mirror/g_mirror_ctl.c Fri Dec 27 02:43:53 2013
(r259929)
@@ -797,7 +797,7 @@ g_mirror_ctl_forget(struct gctl_req *req
 }
 
 static void
-g_mirror_ctl_stop(struct gctl_req *req, 

svn commit: r259936 - head/sys/arm/arm

2013-12-26 Thread Adrian Chadd
Author: adrian
Date: Fri Dec 27 05:01:13 2013
New Revision: 259936
URL: http://svnweb.freebsd.org/changeset/base/259936

Log:
  Revert r252694 - which attempted to fix bit emulation for armv6/armv7.
  
  This seems to cause issues with jemalloc + {dhclient, sshd}.
  
  Thus, revert this for now until the root cause can be found and
  fixed.
  
  This should quieten some runtime problems with the Raspberry Pi.
  
  PR: kern/185046
  MFC after: 3 days

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Fri Dec 27 04:30:32 2013(r259935)
+++ head/sys/arm/arm/pmap-v6.c  Fri Dec 27 05:01:13 2013(r259936)
@@ -3094,21 +3094,16 @@ validate:
if ((m-oflags  VPO_UNMANAGED) == 0) {
vm_page_aflag_set(m, PGA_WRITEABLE);
/*
-* Enable write permission if the access type
-* indicates write intention. Emulate modified
-* bit otherwise.
+* XXX: Skip modified bit emulation for now.
+*  The emulation reveals problems
+*  that result in random failures
+*  during memory allocation on some
+*  platforms.
+*  Therefore, the page is marked RW
+*  immediately.
 */
-   if ((access  VM_PROT_WRITE) != 0) {
-   npte = ~(L2_APX);
-   /*
-* The access type and permissions
-* indicate that the page will be
-* written as soon as returned from
-* fault service.
-* Mark it dirty from the outset.
-*/
-   vm_page_dirty(m);
-   }
+   npte = ~(L2_APX);
+   vm_page_dirty(m);
} else
npte = ~(L2_APX);
}
___
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: r259937 - head/sys/amd64/vmm/io

2013-12-26 Thread Neel Natu
Author: neel
Date: Fri Dec 27 07:01:42 2013
New Revision: 259937
URL: http://svnweb.freebsd.org/changeset/base/259937

Log:
  Modify handling of write to the vlapic SVR register.
  
  The handler is now called after the register value is updated in the virtual
  APIC page. This will make it easier to handle APIC-write VM-exits with APIC
  register virtualization turned on.
  
  Additionally, mask all the LVT entries when the vlapic is software-disabled.

Modified:
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/amd64/vmm/io/vlapic.h
  head/sys/amd64/vmm/io/vlapic_priv.h

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Fri Dec 27 05:01:13 2013
(r259936)
+++ head/sys/amd64/vmm/io/vlapic.c  Fri Dec 27 07:01:42 2013
(r259937)
@@ -218,13 +218,17 @@ vlapic_timer_divisor(uint32_t dcr)
 }
 
 static void
-vlapic_mask_lvts(uint32_t *lvts, int num_lvt)
+vlapic_mask_lvts(struct vlapic *vlapic)
 {
-   int i;
-   for (i = 0; i  num_lvt; i++) {
-   *lvts |= APIC_LVT_M;
-   lvts += 4;
-   }
+   struct LAPIC *lapic = vlapic-apic_page;
+
+   lapic-lvt_cmci |= APIC_LVT_M;
+   lapic-lvt_timer |= APIC_LVT_M;
+   lapic-lvt_thermal |= APIC_LVT_M;
+   lapic-lvt_pcint |= APIC_LVT_M;
+   lapic-lvt_lint0 |= APIC_LVT_M;
+   lapic-lvt_lint1 |= APIC_LVT_M;
+   lapic-lvt_error |= APIC_LVT_M;
 }
 
 #if 0
@@ -318,14 +322,15 @@ vlapic_reset(struct vlapic *vlapic)
lapic-version |= (VLAPIC_MAXLVT_ENTRIES  MAXLVTSHIFT);
lapic-dfr = 0x;
lapic-svr = APIC_SVR_VECTOR;
-   vlapic_mask_lvts(lapic-lvt_timer, 6);
-   vlapic_mask_lvts(lapic-lvt_cmci, 1);
+   vlapic_mask_lvts(vlapic);
vlapic_set_dcr(vlapic, 0);
 
if (vlapic-vcpuid == 0)
vlapic-boot_state = BS_RUNNING;/* BSP */
else
vlapic-boot_state = BS_INIT;   /* AP */
+
+   vlapic-svr_last = lapic-svr;
 }
 
 void
@@ -1052,24 +1057,30 @@ vlapic_intr_accepted(struct vlapic *vlap
vlapic_update_ppr(vlapic);
 }
 
-static void
-lapic_set_svr(struct vlapic *vlapic, uint32_t new)
+void
+vlapic_svr_write_handler(struct vlapic *vlapic)
 {
struct LAPIC *lapic;
-   uint32_t old, changed;
+   uint32_t old, new, changed;
 
lapic = vlapic-apic_page;
-   old = lapic-svr;
+
+   new = lapic-svr;
+   old = vlapic-svr_last;
+   vlapic-svr_last = new;
+
changed = old ^ new;
if ((changed  APIC_SVR_ENABLE) != 0) {
if ((new  APIC_SVR_ENABLE) == 0) {
/*
-* The apic is now disabled so stop the apic timer.
+* The apic is now disabled so stop the apic timer
+* and mask all the LVT entries.
 */
VLAPIC_CTR0(vlapic, vlapic is software-disabled);
VLAPIC_TIMER_LOCK(vlapic);
callout_stop(vlapic-callout);
VLAPIC_TIMER_UNLOCK(vlapic);
+   vlapic_mask_lvts(vlapic);
} else {
/*
 * The apic is now enabled so restart the apic timer
@@ -1080,7 +1091,6 @@ lapic_set_svr(struct vlapic *vlapic, uin
vlapic_set_icr_timer(vlapic, lapic-icr_timer);
}
}
-   lapic-svr = new;
 }
 
 int
@@ -1210,7 +1220,8 @@ vlapic_write(struct vlapic *vlapic, uint
vlapic_dfr_write_handler(vlapic);
break;
case APIC_OFFSET_SVR:
-   lapic_set_svr(vlapic, data);
+   lapic-svr = data;
+   vlapic_svr_write_handler(vlapic);
break;
case APIC_OFFSET_ICR_LOW: 
if (!x2apic(vlapic)) {

Modified: head/sys/amd64/vmm/io/vlapic.h
==
--- head/sys/amd64/vmm/io/vlapic.h  Fri Dec 27 05:01:13 2013
(r259936)
+++ head/sys/amd64/vmm/io/vlapic.h  Fri Dec 27 07:01:42 2013
(r259937)
@@ -75,4 +75,5 @@ void vlapic_post_intr(struct vlapic *vla
 void vlapic_id_write_handler(struct vlapic *vlapic);
 void vlapic_ldr_write_handler(struct vlapic *vlapic);
 void vlapic_dfr_write_handler(struct vlapic *vlapic);
+void vlapic_svr_write_handler(struct vlapic *vlapic);
 #endif /* _VLAPIC_H_ */

Modified: head/sys/amd64/vmm/io/vlapic_priv.h
==
--- head/sys/amd64/vmm/io/vlapic_priv.h Fri Dec 27 05:01:13 2013
(r259936)
+++ head/sys/amd64/vmm/io/vlapic_priv.h Fri Dec 27 07:01:42 2013
(r259937)
@@ -116,6 +116,7 @@ struct vlapic {
 
uint64_tmsr_apicbase;
enum 

svn commit: r259938 - head/sys/sys

2013-12-26 Thread Tai-hwa Liang
Author: avatar
Date: Fri Dec 27 07:02:07 2013
New Revision: 259938
URL: http://svnweb.freebsd.org/changeset/base/259938

Log:
  Fixing build bustage.

Modified:
  head/sys/sys/gpt.h

Modified: head/sys/sys/gpt.h
==
--- head/sys/sys/gpt.h  Fri Dec 27 07:01:42 2013(r259937)
+++ head/sys/sys/gpt.h  Fri Dec 27 07:02:07 2013(r259938)
@@ -128,7 +128,7 @@ struct gpt_ent {
{0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}}
 #defineGPT_ENT_TYPE_VMRESERVED \
{0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}}
-#defineGPT_ENT_TYPE_VSANHDR\
+#defineGPT_ENT_TYPE_VMVSANHDR  \
{0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}}
 
 #defineGPT_ENT_TYPE_APPLE_BOOT \
___
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