svn commit: r259161 - head/sys/mips/cavium/octe

2013-12-10 Thread Juli Mallett
Author: jmallett
Date: Tue Dec 10 09:38:18 2013
New Revision: 259161
URL: http://svnweb.freebsd.org/changeset/base/259161

Log:
  Add missing includes.

Modified:
  head/sys/mips/cavium/octe/cavium-ethernet.h
  head/sys/mips/cavium/octe/ethernet-mv88e61xx.c

Modified: head/sys/mips/cavium/octe/cavium-ethernet.h
==
--- head/sys/mips/cavium/octe/cavium-ethernet.h Tue Dec 10 09:14:11 2013
(r259160)
+++ head/sys/mips/cavium/octe/cavium-ethernet.h Tue Dec 10 09:38:18 2013
(r259161)
@@ -38,7 +38,9 @@ AND WITH ALL FAULTS AND CAVIUM  NETWORKS
 #ifndef CAVIUM_ETHERNET_H
 #define CAVIUM_ETHERNET_H
 
+#include 
 #include 
+#include 
 
 /**
  * This is the definition of the Ethernet driver's private

Modified: head/sys/mips/cavium/octe/ethernet-mv88e61xx.c
==
--- head/sys/mips/cavium/octe/ethernet-mv88e61xx.c  Tue Dec 10 09:14:11 
2013(r259160)
+++ head/sys/mips/cavium/octe/ethernet-mv88e61xx.c  Tue Dec 10 09:38:18 
2013(r259161)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include "wrapper-cvmx-includes.h"
 #include "ethernet-headers.h"
___
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: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken

2013-12-10 Thread Ed Schouten
2013/12/10 Aleksandr Rybalko :
> Thanks to Ed, [...]

No, thanks to you! Thanks a lot for pushing forward something that I
should have done years ago. Can't wait to buy you a beer.

-- 
Ed Schouten 
___
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: r259168 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-12-10 Thread Alexander Motin
Author: mav
Date: Tue Dec 10 12:36:44 2013
New Revision: 259168
URL: http://svnweb.freebsd.org/changeset/base/259168

Log:
  Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE
  (64MB).  Even if we would find one somehow, ZFS kernel code rejects such
  devices.  It is funny to look on attempts to read 4 256K vdev labels from
  1.44MB floppy, though it is not very practical and quite slow.

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Dec 
10 11:47:38 2013(r259167)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Dec 
10 12:36:44 2013(r259168)
@@ -995,10 +995,10 @@ nozpool_all_slices(avl_tree_t *r, const 
 #endif /* sun */
 }
 
+#ifdef sun
 static void
 check_slices(avl_tree_t *r, int fd, const char *sname)
 {
-#ifdef sun
struct extvtoc vtoc;
struct dk_gpt *gpt;
char diskname[MAXNAMELEN];
@@ -1028,8 +1028,8 @@ check_slices(avl_tree_t *r, int fd, cons
check_one_slice(r, diskname, i, 0, 1);
efi_free(gpt);
}
-#endif /* sun */
 }
+#endif /* sun */
 
 static void
 zpool_open_func(void *arg)
@@ -1059,6 +1059,7 @@ zpool_open_func(void *arg)
return;
}
/* this file is too small to hold a zpool */
+#ifdef sun
if (S_ISREG(statbuf.st_mode) &&
statbuf.st_size < SPA_MINDEVSIZE) {
(void) close(fd);
@@ -1070,6 +1071,12 @@ zpool_open_func(void *arg)
 */
check_slices(rn->rn_avl, fd, rn->rn_name);
}
+#else  /* !sun */
+   if (statbuf.st_size < SPA_MINDEVSIZE) {
+   (void) close(fd);
+   return;
+   }
+#endif /* sun */
 
if ((zpool_read_label(fd, &config)) != 0) {
(void) close(fd);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 
10 11:47:38 2013(r259167)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 
10 12:36:44 2013(r259168)
@@ -401,10 +401,16 @@ vdev_geom_attach_taster(struct g_consume
 
if (pp->flags & G_PF_WITHER)
return (EINVAL);
-   if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize))
-   return (EINVAL);
g_attach(cp, pp);
error = g_access(cp, 1, 0, 0);
+   if (error == 0) {
+   if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize))
+   error = EINVAL;
+   else if (pp->mediasize < SPA_MINDEVSIZE)
+   error = EINVAL;
+   if (error != 0)
+   g_access(cp, -1, 0, 0);
+   }
if (error != 0)
g_detach(cp);
return (error);
___
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: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken

2013-12-10 Thread Luiz Otavio O Souza
On Dec 10, 2013, at 9:30 AM, Ed Schouten  wrote:
> 2013/12/10 Aleksandr Rybalko :
>> Thanks to Ed, [...]
> 
> No, thanks to you! […]
> Can't wait to buy you a beer.

+1
___
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: r259169 - head/usr.sbin/ndp

2013-12-10 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec 10 13:14:54 2013
New Revision: 259169
URL: http://svnweb.freebsd.org/changeset/base/259169

Log:
  Ansify function definitions.

Modified:
  head/usr.sbin/ndp/ndp.c

Modified: head/usr.sbin/ndp/ndp.c
==
--- head/usr.sbin/ndp/ndp.c Tue Dec 10 12:36:44 2013(r259168)
+++ head/usr.sbin/ndp/ndp.c Tue Dec 10 13:14:54 2013(r259169)
@@ -168,9 +168,7 @@ int mode = 0;
 char *arg = NULL;
 
 int
-main(argc, argv)
-   int argc;
-   char **argv;
+main(int argc, char **argv)
 {
int ch;
 
@@ -320,8 +318,7 @@ main(argc, argv)
  * Process a file to set standard ndp entries
  */
 int
-file(name)
-   char *name;
+file(char *name)
 {
FILE *fp;
int i, retval;
@@ -378,9 +375,7 @@ struct  {
  * Set an individual neighbor cache entry
  */
 int
-set(argc, argv)
-   int argc;
-   char **argv;
+set(int argc, char **argv)
 {
register struct sockaddr_in6 *sin = &sin_m;
register struct sockaddr_dl *sdl;
@@ -455,8 +450,7 @@ overwrite:
  * Display an individual neighbor cache entry
  */
 void
-get(host)
-   char *host;
+get(char *host)
 {
struct sockaddr_in6 *sin = &sin_m;
struct addrinfo hints, *res;
@@ -486,8 +480,7 @@ get(host)
  * Delete a neighbor cache entry
  */
 int
-delete(host)
-   char *host;
+delete(char *host)
 {
struct sockaddr_in6 *sin = &sin_m;
register struct rt_msghdr *rtm = &m_rtmsg.m_rtm;
@@ -555,9 +548,7 @@ delete:
  * Dump the entire neighbor cache
  */
 void
-dump(addr, cflag)
-   struct in6_addr *addr;
-   int cflag;
+dump(struct in6_addr *addr, int cflag)
 {
int mib[6];
size_t needed;
@@ -762,10 +753,7 @@ again:;
 }
 
 static struct in6_nbrinfo *
-getnbrinfo(addr, ifindex, warning)
-   struct in6_addr *addr;
-   int ifindex;
-   int warning;
+getnbrinfo(struct in6_addr *addr, int ifindex, int warning)
 {
static struct in6_nbrinfo nbi;
int s;
@@ -806,9 +794,7 @@ ether_str(struct sockaddr_dl *sdl)
 }
 
 int
-ndp_ether_aton(a, n)
-   char *a;
-   u_char *n;
+ndp_ether_aton(char *a, u_char *n)
 {
int i, o[6];
 
@@ -840,8 +826,7 @@ usage()
 }
 
 int
-rtmsg(cmd)
-   int cmd;
+rtmsg(int cmd)
 {
static int seq;
int rlen;
@@ -906,10 +891,7 @@ doit:
 }
 
 void
-ifinfo(ifname, argc, argv)
-   char *ifname;
-   int argc;
-   char **argv;
+ifinfo(char *ifname, int argc, char **argv)
 {
struct in6_ndireq nd;
int i, s;
@@ -1478,8 +1460,7 @@ harmonize_rtr()
 
 #ifdef SIOCSDEFIFACE_IN6   /* XXX: check SIOCGDEFIFACE_IN6 as well? */
 static void
-setdefif(ifname)
-   char *ifname;
+setdefif(char *ifname)
 {
struct in6_ndifreq ndifreq;
unsigned int ifindex;
@@ -1532,8 +1513,7 @@ getdefif()
 #endif
 
 static char *
-sec2str(total)
-   time_t total;
+sec2str(time_t total)
 {
static char result[256];
int days, hours, mins, secs;
@@ -1578,8 +1558,7 @@ sec2str(total)
  * from tcpdump/util.c
  */
 static void
-ts_print(tvp)
-   const struct timeval *tvp;
+ts_print(const struct timeval *tvp)
 {
int s;
 
___
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: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken

2013-12-10 Thread Aleksandr Rybalko
On Sun, 08 Dec 2013 22:45:09 +0100
Andreas Tobler  wrote:

> Hi Aleksandr,
> 
> On 08.12.13 00:59, Aleksandr Rybalko wrote:
> > Andreas Tobler  написав(ла):
> >> On 05.12.13 23:38, Aleksandr Rybalko wrote:
> >>> Author: ray
> >>> Date: Thu Dec  5 22:38:53 2013
> >>> New Revision: 259016
> >>> URL: http://svnweb.freebsd.org/changeset/base/259016
> >>>
> >>> Log:
> >>>   Merge VT(9) project (a.k.a. newcons).
> >>>   
> >>>   Reviewed by:nwhitehorn
> >>>   MFC_to_10_after:re approval
> >>>   
> >>>   Sponsored by:   The FreeBSD Foundation
> >>
> >> Great! Thanks, gives a new look & feel on the console :)
> >> Have it running on amd64/i386 and PowerMac(32/64-bit).
> >> The only thing I need to figure is the mapping of the AltGr or in Mac
> >> world, the alt key mapping. Iow, the third level mapping of the keys.
> >> e.g. the @ here is on altgr-2...
> >>
> >> Again, thanks!
> >> Andreas
> > 
> 
> > I'm glad to fix that, but I've to understand how it is should work :-)
> 
> Hehe :)
> 
> So do I. I was playing a bit while comparing to syscons.c
> 
> And with the below diff I'm able to get what I want. At least when I
> press RALT (Altgr)  I get the third symbol printed on my keyboard.
> I have a couple of Thinkpads here where I play with. (The PowerMac's are
> currently to loud)
> 
> For example, on the '2' I have the '"' as the second symbol and the '@'
> as third symbol. Yeah, these are european keyboards
> 
> Now I do not prepend the 0x1b and then my RALT behaves as used to, at
> least for me.
> 
> I do not know the fine details but LALT and RALT are different.
> 
> What do you think, others?
> 
> For me this is a really important thing since all the 'special' keys are
> not accesible w/o the 'hack' below. If I want the pipe (|), or writing
> code ({}, [], ...) I have to remote login to get the characters I need.
> But I guess I do not need to explain that ;)
> 
> TIA,
> Andreas

Hi Andreas!

That keyboards have no Shift key for that? :)
I will be glad to apply your changes, but I have to know how it should
be controlled.

RU and UA PC keyboards have same 3 symbols '2', '"', '@'
To get '2' i have to press only '2'
To get '@' I have to press Shift+'2'
To get '"' I have to switch to UA or RU and press Shift+'2'

Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary
lang switch. Which commonly mapped to one of Alt. Right?
So R-Alt+Shift+'2'?

> 
> Index: vt_core.c
> ===
> --- vt_core.c (revision 259095)
> +++ vt_core.c (working copy)
> @@ -408,6 +408,7 @@
>   } else {
>   switch (c & ~RELKEY) {
>   case (SPCLKEY | RALT):
> + break;
>   case (SPCLKEY | LALT):
>   vd->vd_kbstate |= ALKED;
>   }


-- 
Aleksandr Rybalko 
___
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: r259171 - head/usr.sbin/ndp

2013-12-10 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec 10 13:34:28 2013
New Revision: 259171
URL: http://svnweb.freebsd.org/changeset/base/259171

Log:
  Remove unused macro ADVANCE() and replace ROUNDUP() macro with ALIGN().
  They aren't the same, but in our use cases ALIGN gives the same results.

Modified:
  head/usr.sbin/ndp/ndp.c

Modified: head/usr.sbin/ndp/ndp.c
==
--- head/usr.sbin/ndp/ndp.c Tue Dec 10 13:33:56 2013(r259170)
+++ head/usr.sbin/ndp/ndp.c Tue Dec 10 13:34:28 2013(r259171)
@@ -109,11 +109,6 @@
 #include 
 #include "gmt2local.h"
 
-/* packing rule for routing socket */
-#define ROUNDUP(a) \
-   ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
 #define NEXTADDR(w, s) \
if (rtm->rtm_addrs & (w)) { \
bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);}
@@ -421,7 +416,7 @@ set(int argc, char **argv)
/* NOTREACHED */
}
sin = (struct sockaddr_in6 *)(rtm + 1);
-   sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin);
+   sdl = (struct sockaddr_dl *)(ALIGN(sin->sin6_len) + (char *)sin);
if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) {
if (sdl->sdl_family == AF_LINK &&
!(rtm->rtm_flags & RTF_GATEWAY)) {
@@ -508,7 +503,7 @@ delete(char *host)
/* NOTREACHED */
}
sin = (struct sockaddr_in6 *)(rtm + 1);
-   sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin);
+   sdl = (struct sockaddr_dl *)(ALIGN(sin->sin6_len) + (char *)sin);
if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) {
if (sdl->sdl_family == AF_LINK &&
!(rtm->rtm_flags & RTF_GATEWAY)) {
@@ -598,7 +593,7 @@ again:;
 
rtm = (struct rt_msghdr *)next;
sin = (struct sockaddr_in6 *)(rtm + 1);
-   sdl = (struct sockaddr_dl *)((char *)sin + 
ROUNDUP(sin->sin6_len));
+   sdl = (struct sockaddr_dl *)((char *)sin + 
ALIGN(sin->sin6_len));
 
/*
 * Some OSes can produce a route that has the LINK flag but
___
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: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken

2013-12-10 Thread Tijl Coosemans
On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote:
> That keyboards have no Shift key for that? :)
> I will be glad to apply your changes, but I have to know how it should
> be controlled.
> 
> RU and UA PC keyboards have same 3 symbols '2', '"', '@'
> To get '2' i have to press only '2'
> To get '@' I have to press Shift+'2'
> To get '"' I have to switch to UA or RU and press Shift+'2'
> 
> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary
> lang switch. Which commonly mapped to one of Alt. Right?
> So R-Alt+Shift+'2'?

https://en.wikipedia.org/wiki/AltGr
___
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: r259176 - head/usr.sbin/ndp

2013-12-10 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec 10 14:17:07 2013
New Revision: 259176
URL: http://svnweb.freebsd.org/changeset/base/259176

Log:
  Change the type of addr argument in dump() function to be able
  disambiguate link-local addresses from different zones.

Modified:
  head/usr.sbin/ndp/ndp.c

Modified: head/usr.sbin/ndp/ndp.c
==
--- head/usr.sbin/ndp/ndp.c Tue Dec 10 13:42:59 2013(r259175)
+++ head/usr.sbin/ndp/ndp.c Tue Dec 10 14:17:07 2013(r259176)
@@ -131,7 +131,7 @@ void getsocket(void);
 int set(int, char **);
 void get(char *);
 int delete(char *);
-void dump(struct in6_addr *, int);
+void dump(struct sockaddr_in6 *, int);
 static struct in6_nbrinfo *getnbrinfo(struct in6_addr *, int, int);
 static char *ether_str(struct sockaddr_dl *);
 int ndp_ether_aton(char *, u_char *);
@@ -461,7 +461,9 @@ get(char *host)
return;
}
sin->sin6_addr = ((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
-   dump(&sin->sin6_addr, 0);
+   sin->sin6_scope_id =
+   ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id;
+   dump(sin, 0);
if (found_entry == 0) {
getnameinfo((struct sockaddr *)sin, sin->sin6_len, host_buf,
sizeof(host_buf), NULL ,0,
@@ -543,7 +545,7 @@ delete:
  * Dump the entire neighbor cache
  */
 void
-dump(struct in6_addr *addr, int cflag)
+dump(struct sockaddr_in6 *addr, int cflag)
 {
int mib[6];
size_t needed;
@@ -615,7 +617,9 @@ again:;
continue;
 
if (addr) {
-   if (!IN6_ARE_ADDR_EQUAL(addr, &sin->sin6_addr))
+   if (IN6_ARE_ADDR_EQUAL(&addr->sin6_addr,
+   &sin->sin6_addr) == 0 ||
+   addr->sin6_scope_id != sin->sin6_scope_id)
continue;
found_entry = 1;
} else if (IN6_IS_ADDR_MULTICAST(&sin->sin6_addr))
___
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: r259178 - in head/sys: conf dev/vt

2013-12-10 Thread Aleksandr Rybalko
Author: ray
Date: Tue Dec 10 15:36:29 2013
New Revision: 259178
URL: http://svnweb.freebsd.org/changeset/base/259178

Log:
  Break build with error in case when both syscons and newcons are enabled.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/options
  head/sys/dev/vt/vt.h

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Tue Dec 10 14:54:11 2013(r259177)
+++ head/sys/conf/options   Tue Dec 10 15:36:29 2013(r259178)
@@ -757,6 +757,9 @@ SC_NORM_REV_ATTRopt_syscons.h
 SC_PIXEL_MODE  opt_syscons.h
 SC_RENDER_DEBUGopt_syscons.h
 SC_TWOBUTTON_MOUSE opt_syscons.h
+DEV_SC opt_syscons.h
+DEV_VT opt_syscons.h
+
 
 # teken terminal emulator options
 TEKEN_CONS25   opt_teken.h

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hTue Dec 10 14:54:11 2013(r259177)
+++ head/sys/dev/vt/vt.hTue Dec 10 15:36:29 2013(r259178)
@@ -49,6 +49,11 @@
 #include "opt_syscons.h"
 #include "opt_splash.h"
 
+#ifdef DEV_SC
+#error "Build with both syscons and vt is not supported. Please enable only \
+one 'device sc' or 'device vt'"
+#endif
+
 #ifndefVT_MAXWINDOWS
 #ifdef MAXCONS
 #defineVT_MAXWINDOWS   MAXCONS
___
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: r259179 - in head/sys: dev/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms

2013-12-10 Thread Aleksandr Rybalko
Author: ray
Date: Tue Dec 10 15:53:00 2013
New Revision: 259179
URL: http://svnweb.freebsd.org/changeset/base/259179

Log:
  Disable error message about failed attempt to attach fbd when drm2 built with
  syscons.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/drm2/drmP.h
  head/sys/dev/drm2/drm_fb_helper.c
  head/sys/modules/drm2/drm2/Makefile
  head/sys/modules/drm2/i915kms/Makefile
  head/sys/modules/drm2/radeonkms/Makefile

Modified: head/sys/dev/drm2/drmP.h
==
--- head/sys/dev/drm2/drmP.hTue Dec 10 15:36:29 2013(r259178)
+++ head/sys/dev/drm2/drmP.hTue Dec 10 15:53:00 2013(r259179)
@@ -113,6 +113,7 @@ struct drm_device;
 
 #include "opt_compat.h"
 #include "opt_drm.h"
+#include "opt_syscons.h"
 #ifdef DRM_DEBUG
 #undef DRM_DEBUG
 #define DRM_DEBUG_DEFAULT_ON 1

Modified: head/sys/dev/drm2/drm_fb_helper.c
==
--- head/sys/dev/drm2/drm_fb_helper.c   Tue Dec 10 15:36:29 2013
(r259178)
+++ head/sys/dev/drm2/drm_fb_helper.c   Tue Dec 10 15:53:00 2013
(r259179)
@@ -1044,8 +1044,10 @@ int drm_fb_helper_single_fb_probe(struct
kdev = fb_helper->dev->device;
fbd = device_add_child(kdev, "fbd", device_get_unit(kdev));
ret = device_probe_and_attach(fbd);
+#ifdef DEV_VT
if (ret != 0)
DRM_ERROR("Failed to attach fbd device: %d\n", ret);
+#endif
}
 #else
if (new_fb) {

Modified: head/sys/modules/drm2/drm2/Makefile
==
--- head/sys/modules/drm2/drm2/Makefile Tue Dec 10 15:36:29 2013
(r259178)
+++ head/sys/modules/drm2/drm2/Makefile Tue Dec 10 15:53:00 2013
(r259179)
@@ -54,6 +54,6 @@ SRCS  += drm_ioc32.c
 .endif
 
 SRCS   +=device_if.h bus_if.h pci_if.h device_if.h iicbus_if.h opt_drm.h \
-   opt_vm.h opt_compat.h
+   opt_vm.h opt_compat.h opt_syscons.h
 
 .include 

Modified: head/sys/modules/drm2/i915kms/Makefile
==
--- head/sys/modules/drm2/i915kms/Makefile  Tue Dec 10 15:36:29 2013
(r259178)
+++ head/sys/modules/drm2/i915kms/Makefile  Tue Dec 10 15:53:00 2013
(r259179)
@@ -35,6 +35,6 @@ SRCS  += i915_ioc32.c
 .endif
 
 SRCS   += device_if.h fb_if.h bus_if.h pci_if.h iicbus_if.h iicbb_if.h \
-opt_drm.h opt_compat.h
+opt_drm.h opt_compat.h opt_syscons.h
 
 .include 

Modified: head/sys/modules/drm2/radeonkms/Makefile
==
--- head/sys/modules/drm2/radeonkms/MakefileTue Dec 10 15:36:29 2013
(r259178)
+++ head/sys/modules/drm2/radeonkms/MakefileTue Dec 10 15:53:00 2013
(r259179)
@@ -94,6 +94,7 @@ SRCS  +=  
\
opt_acpi.h  \
opt_compat.h\
opt_drm.h   \
+   opt_syscons.h   \
acpi_if.h   \
bus_if.h\
fb_if.h \
___
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: r259180 - head/sys/dev/hyperv/netvsc

2013-12-10 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue Dec 10 17:16:13 2013
New Revision: 259180
URL: http://svnweb.freebsd.org/changeset/base/259180

Log:
  Fix missing new line after:
  
Netvsc initializing...
  
  during boot.

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Dec 10 15:53:00 
2013(r259179)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Dec 10 17:16:13 
2013(r259180)
@@ -190,6 +190,7 @@ netvsc_init(void)
if (!cold && !g_netvsc_drv.drv_inited) {
g_netvsc_drv.drv_inited = 1;
netvsc_drv_init();
+   printf("done!\n");
} else {
printf("Already initialized!\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: r259182 - head/usr.sbin/ctld

2013-12-10 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Dec 10 17:27:11 2013
New Revision: 259182
URL: http://svnweb.freebsd.org/changeset/base/259182

Log:
  Fix handling for empty auth-groups.  Without it, ctld child process
  would either exit on assertion, or, if assertions are not enabled,
  fail to authenticate the target.
  
  MFC after:2 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/login.c

Modified: head/usr.sbin/ctld/login.c
==
--- head/usr.sbin/ctld/login.c  Tue Dec 10 17:26:52 2013(r259181)
+++ head/usr.sbin/ctld/login.c  Tue Dec 10 17:27:11 2013(r259182)
@@ -1007,6 +1007,14 @@ login(struct connection *conn)
return;
}
 
+   if (ag->ag_type == AG_TYPE_UNKNOWN) {
+   /*
+* This can happen with empty auth-group.
+*/
+   login_send_error(request, 0x02, 0x01);
+   log_errx(1, "auth-group type not set, denying access");
+   }
+
log_debugx("CHAP authentication required");
 
auth_method = keys_find(request_keys, "AuthMethod");
___
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: r259183 - head/sys/dev/iscsi

2013-12-10 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Dec 10 18:18:39 2013
New Revision: 259183
URL: http://svnweb.freebsd.org/changeset/base/259183

Log:
  Properly refuse handoff requests on already connected sessions.  Previously
  this would result in dropping the session.
  
  MFC after:2 days
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Tue Dec 10 17:27:11 2013(r259182)
+++ head/sys/dev/iscsi/iscsi.c  Tue Dec 10 18:18:39 2013(r259183)
@@ -1247,6 +1247,18 @@ iscsi_ioctl_daemon_handoff(struct iscsi_
sx_sunlock(&sc->sc_lock);
return (EINVAL);
}
+   if (is->is_connected) {
+   /*
+* This might have happened because another iscsid(8)
+* instance handed off the connection in the meantime.
+* Just return.
+*/
+   ISCSI_SESSION_WARN(is, "handoff on already connected "
+   "session");
+   ISCSI_SESSION_UNLOCK(is);
+   sx_sunlock(&sc->sc_lock);
+   return (EBUSY);
+   }
 
strlcpy(is->is_target_alias, handoff->idh_target_alias,
sizeof(is->is_target_alias));
___
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: r259186 - head/share/man/man4

2013-12-10 Thread Joel Dahl
Author: joel (doc committer)
Date: Tue Dec 10 19:15:26 2013
New Revision: 259186
URL: http://svnweb.freebsd.org/changeset/base/259186

Log:
  Minor mdoc fixes.

Modified:
  head/share/man/man4/netmap.4

Modified: head/share/man/man4/netmap.4
==
--- head/share/man/man4/netmap.4Tue Dec 10 19:14:19 2013
(r259185)
+++ head/share/man/man4/netmap.4Tue Dec 10 19:15:26 2013
(r259186)
@@ -77,7 +77,6 @@ sockets or BPF/pcap).
 For a list of devices with native
 .Nm
 support, see the end of this manual page.
-.Pp
 .Sh OPERATION - THE NETMAP API
 .Nm
 clients must first
@@ -99,7 +98,6 @@ interface or on a port of a
 switch, as indicated below. Additional fields in the
 .Pa struct nmreq
 control the details of operation.
-.Pp
 .Bl -tag -width 
 .It Dv Interface name (e.g. 'em0', 'eth1', ... )
 The data path of the interface is disconnected from the host stack.
@@ -237,7 +235,6 @@ accordingly, as shown in the figure belo
 |-- avail --|   (before syscall)
cur
 .Ed
-
 In receive rings, after a system call 'cur' indicates
 the first slot that contains a valid packet,
 and 'avail' reports how many of them are available.
@@ -289,7 +286,6 @@ are normally fixed size (2 Kbyte) buffer
 that contain packet data. Buffers addresses are computed through
 macros.
 .El
-.Pp
 .Bl -tag -width XXX
 Some macros support the access to objects in the shared memory
 region. In particular,
___
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: r259150 - head/sys/dev/cxgbe

2013-12-10 Thread Gleb Smirnoff
On Tue, Dec 10, 2013 at 12:07:04AM +, Adrian Chadd wrote:
A> Author: adrian
A> Date: Tue Dec 10 00:07:04 2013
A> New Revision: 259150
A> URL: http://svnweb.freebsd.org/changeset/base/259150
A> 
A> Log:
A>   Print out the full PCIe link negotiation during dmesg.
A>   
A>   I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot
A>   or not.
A>   
A>   Reviewed by:   np
A>   Sponsored by:  Netflix, inc.

Shouldn't this be done with common code for all drivers
on PCI bus(es)?

This is definitely useful for all devices, not to cxgbe(4) only.


-- 
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: r259150 - head/sys/dev/cxgbe

2013-12-10 Thread John Baldwin
On Tuesday, December 10, 2013 2:26:50 pm Gleb Smirnoff wrote:
> On Tue, Dec 10, 2013 at 12:07:04AM +, Adrian Chadd wrote:
> A> Author: adrian
> A> Date: Tue Dec 10 00:07:04 2013
> A> New Revision: 259150
> A> URL: http://svnweb.freebsd.org/changeset/base/259150
> A> 
> A> Log:
> A>   Print out the full PCIe link negotiation during dmesg.
> A>   
> A>   I found this useful when checking whether a NIC is in a PCIE 3.0 8x 
slot
> A>   or not.
> A>   
> A>   Reviewed by: np
> A>   Sponsored by:Netflix, inc.
> 
> Shouldn't this be done with common code for all drivers
> on PCI bus(es)?
> 
> This is definitely useful for all devices, not to cxgbe(4) only.

It's already done in pciconf -lc which is the right place to put this instead 
of adding more noise to dmesg.

-- 
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: r259150 - head/sys/dev/cxgbe

2013-12-10 Thread Alexander Motin

On 10.12.2013 21:26, Gleb Smirnoff wrote:

On Tue, Dec 10, 2013 at 12:07:04AM +, Adrian Chadd wrote:
A> Author: adrian
A> Date: Tue Dec 10 00:07:04 2013
A> New Revision: 259150
A> URL: http://svnweb.freebsd.org/changeset/base/259150
A>
A> Log:
A>   Print out the full PCIe link negotiation during dmesg.
A>
A>   I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot
A>   or not.
A>
A>   Reviewed by:np
A>   Sponsored by:   Netflix, inc.

Shouldn't this be done with common code for all drivers
on PCI bus(es)?

This is definitely useful for all devices, not to cxgbe(4) only.


Why not just read `pciconf -lc` output for that?

--
Alexander Motin
___
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: r259189 - head/games/fortune/datfiles

2013-12-10 Thread Gavin Atkinson
Author: gavin
Date: Tue Dec 10 19:42:35 2013
New Revision: 259189
URL: http://svnweb.freebsd.org/changeset/base/259189

Log:
  Fix typo in fortune (go -> to)

Modified:
  head/games/fortune/datfiles/fortunes

Modified: head/games/fortune/datfiles/fortunes
==
--- head/games/fortune/datfiles/fortunesTue Dec 10 19:22:02 2013
(r259188)
+++ head/games/fortune/datfiles/fortunesTue Dec 10 19:42:35 2013
(r259189)
@@ -46677,7 +46677,7 @@ they had just discovered that he lived i
 taken another one of those damned Vermont winters!"
 %
 THE OLD POOL SHOOTER had won many a game in his life. But now it was time
-to hang up the cue. When he did, all the other cues came crashing go the
+to hang up the cue. When he did, all the other cues came crashing to the
 floor.
 
 "Sorry," he said with a smile.
___
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: r259191 - head/sbin/hastd

2013-12-10 Thread Mikolaj Golub
Author: trociny
Date: Tue Dec 10 19:56:26 2013
New Revision: 259191
URL: http://svnweb.freebsd.org/changeset/base/259191

Log:
  For memsync replication, hio_countdown is used not only as an
  indication when a request can be moved to done queue, but also for
  detecting the current state of memsync request.
  
  This approach has problems, e.g. leaking a request if memsynk ack from
  the secondary failed, or racy usage of write_complete, which should be
  called only once per write request, but for memsync can be entered by
  local_send_thread and ggate_send_thread simultaneously.
  
  So the following approach is implemented instead:
  
  1) Use hio_countdown only for counting components we waiting to
 complete, i.e. initially it is always 2 for any replication mode.
  
  2) To distinguish between "memsync ack" and "memsync fin" responses
 from the secondary, add and use hio_memsyncacked field.
  
  3) write_complete() in component threads is called only before
 releasing hio_countdown (i.e. before the hio may be returned to the
 done queue).
  
  4) Add and use hio_writecount refcounter to detect when
 write_complete() can be called in memsync case.
  
  Reported by:  Pete French petefrench ingresso.co.uk
  Tested by:Pete French petefrench ingresso.co.uk
  MFC after:2 weeks

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Tue Dec 10 19:48:48 2013(r259190)
+++ head/sbin/hastd/primary.c   Tue Dec 10 19:56:26 2013(r259191)
@@ -94,6 +94,15 @@ struct hio {
 */
bool hio_done;
/*
+* Number of components we are still waiting before sending write
+* completion ack to GEOM Gate. Used for memsync.
+*/
+   refcnt_t hio_writecount;
+   /*
+* Memsync request was acknowleged by remote.
+*/
+   bool hio_memsyncacked;
+   /*
 * Remember replication from the time the request was initiated,
 * so we won't get confused when replication changes on reload.
 */
@@ -231,6 +240,9 @@ static pthread_mutex_t metadata_lock;
 #defineISSYNCREQ(hio)  ((hio)->hio_ggio.gctl_unit == -1)
 #defineSYNCREQDONE(hio)do { (hio)->hio_ggio.gctl_unit = -2; } 
while (0)
 #defineISSYNCREQDONE(hio)  ((hio)->hio_ggio.gctl_unit == -2)
+#define ISMEMSYNCWRITE(hio)\
+   (((hio)->hio_replication == HAST_REPLICATION_MEMSYNC && \
+   (hio)->hio_ggio.gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio)))
 
 static struct hast_resource *gres;
 
@@ -1344,6 +1356,10 @@ ggate_recv_thread(void *arg)
} else {
mtx_unlock(&res->hr_amp_lock);
}
+   if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) {
+   hio->hio_memsyncacked = false;
+   refcnt_init(&hio->hio_writecount, ncomps);
+   }
break;
case BIO_DELETE:
res->hr_stat_delete++;
@@ -1354,13 +1370,7 @@ ggate_recv_thread(void *arg)
}
pjdlog_debug(2,
"ggate_recv: (%p) Moving request to the send queues.", hio);
-   if (hio->hio_replication == HAST_REPLICATION_MEMSYNC &&
-   ggio->gctl_cmd == BIO_WRITE) {
-   /* Each remote request needs two responses in memsync. 
*/
-   refcnt_init(&hio->hio_countdown, ncomps + 1);
-   } else {
-   refcnt_init(&hio->hio_countdown, ncomps);
-   }
+   refcnt_init(&hio->hio_countdown, ncomps);
for (ii = ncomp; ii < ncomps; ii++)
QUEUE_INSERT1(hio, send, ii);
}
@@ -1470,42 +1480,13 @@ local_send_thread(void *arg)
}
break;
}
-
-   if (hio->hio_replication != HAST_REPLICATION_MEMSYNC ||
-   ggio->gctl_cmd != BIO_WRITE || ISSYNCREQ(hio)) {
-   if (refcnt_release(&hio->hio_countdown) > 0)
-   continue;
-   } else {
-   /*
-* Depending on hio_countdown value, requests finished
-* in the following order:
-* 0: remote memsync, remote final, local write
-* 1: remote memsync, local write, (remote final)
-* 2: local write, (remote memsync), (remote final)
-*/
-   switch (refcnt_release(&hio->hio_countdown)) {
-   case 0:
-   /*
-* Local write fi

svn commit: r259192 - head/sbin/hastd

2013-12-10 Thread Mikolaj Golub
Author: trociny
Date: Tue Dec 10 19:58:10 2013
New Revision: 259192
URL: http://svnweb.freebsd.org/changeset/base/259192

Log:
  Add some macros to make the code more readable (no functional chages).
  
  MFC after:2 weeks

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Tue Dec 10 19:56:26 2013(r259191)
+++ head/sbin/hastd/primary.c   Tue Dec 10 19:58:10 2013(r259192)
@@ -233,6 +233,10 @@ static pthread_mutex_t metadata_lock;
mtx_unlock(&hio_##name##_list_lock);\
 } while (0)
 
+#define ISFULLSYNC(hio)((hio)->hio_replication == 
HAST_REPLICATION_FULLSYNC)
+#define ISMEMSYNC(hio) ((hio)->hio_replication == HAST_REPLICATION_MEMSYNC)
+#define ISASYNC(hio)   ((hio)->hio_replication == HAST_REPLICATION_ASYNC)
+
 #defineSYNCREQ(hio)do {
\
(hio)->hio_ggio.gctl_unit = -1; \
(hio)->hio_ggio.gctl_seq = 1;   \
@@ -240,9 +244,9 @@ static pthread_mutex_t metadata_lock;
 #defineISSYNCREQ(hio)  ((hio)->hio_ggio.gctl_unit == -1)
 #defineSYNCREQDONE(hio)do { (hio)->hio_ggio.gctl_unit = -2; } 
while (0)
 #defineISSYNCREQDONE(hio)  ((hio)->hio_ggio.gctl_unit == -2)
-#define ISMEMSYNCWRITE(hio)\
-   (((hio)->hio_replication == HAST_REPLICATION_MEMSYNC && \
-   (hio)->hio_ggio.gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio)))
+
+#define ISMEMSYNCWRITE(hio)(ISMEMSYNC(hio) &&  \
+   (hio)->hio_ggio.gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio))
 
 static struct hast_resource *gres;
 
@@ -1356,7 +1360,7 @@ ggate_recv_thread(void *arg)
} else {
mtx_unlock(&res->hr_amp_lock);
}
-   if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) {
+   if (ISMEMSYNC(hio)) {
hio->hio_memsyncacked = false;
refcnt_init(&hio->hio_writecount, ncomps);
}
@@ -1441,8 +1445,7 @@ local_send_thread(void *arg)
ret, (intmax_t)ggio->gctl_length);
} else {
hio->hio_errors[ncomp] = 0;
-   if (hio->hio_replication ==
-   HAST_REPLICATION_ASYNC) {
+   if (ISASYNC(hio)) {
ggio->gctl_error = 0;
write_complete(res, hio);
}
___
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: r259193 - head/sbin/hastd

2013-12-10 Thread Mikolaj Golub
Author: trociny
Date: Tue Dec 10 20:02:09 2013
New Revision: 259193
URL: http://svnweb.freebsd.org/changeset/base/259193

Log:
  Fix compiler warnings.
  
  MFC after:2 weeks

Modified:
  head/sbin/hastd/nv.c
  head/sbin/hastd/proto.c

Modified: head/sbin/hastd/nv.c
==
--- head/sbin/hastd/nv.cTue Dec 10 19:58:10 2013(r259192)
+++ head/sbin/hastd/nv.cTue Dec 10 20:02:09 2013(r259193)
@@ -566,7 +566,7 @@ nv_get_string(struct nv *nv, const char 
return (NULL);
PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST);
PJDLOG_ASSERT(nvh->nvh_dsize >= 1);
-   str = NVH_DATA(nvh);
+   str = (char *)NVH_DATA(nvh);
PJDLOG_ASSERT(str[nvh->nvh_dsize - 1] == '\0');
PJDLOG_ASSERT(strlen(str) == nvh->nvh_dsize - 1);
return (str);

Modified: head/sbin/hastd/proto.c
==
--- head/sbin/hastd/proto.c Tue Dec 10 19:58:10 2013(r259192)
+++ head/sbin/hastd/proto.c Tue Dec 10 20:02:09 2013(r259193)
@@ -298,8 +298,8 @@ proto_connection_send(const struct proto
protoname = mconn->pc_proto->prt_name;
PJDLOG_ASSERT(protoname != NULL);
 
-   ret = conn->pc_proto->prt_send(conn->pc_ctx, protoname,
-   strlen(protoname) + 1, fd);
+   ret = conn->pc_proto->prt_send(conn->pc_ctx,
+   (const unsigned char *)protoname, strlen(protoname) + 1, fd);
proto_close(mconn);
if (ret != 0) {
errno = ret;
@@ -325,7 +325,7 @@ proto_connection_recv(const struct proto
 
bzero(protoname, sizeof(protoname));
 
-   ret = conn->pc_proto->prt_recv(conn->pc_ctx, protoname,
+   ret = conn->pc_proto->prt_recv(conn->pc_ctx, (unsigned char *)protoname,
sizeof(protoname) - 1, &fd);
if (ret != 0) {
errno = ret;
___
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: r259194 - head/sbin/hastd

2013-12-10 Thread Mikolaj Golub
Author: trociny
Date: Tue Dec 10 20:05:07 2013
New Revision: 259194
URL: http://svnweb.freebsd.org/changeset/base/259194

Log:
  In remote_send_thread, if sending a request fails don't take the
  request back from the receive queue -- it might already be processed
  by remote_recv_thread, which lead to crashes like below:
  
(primary) Unable to receive reply header: Connection reset by peer.
(primary) Unable to send request (Connection reset by peer):
WRITE(954662912, 131072).
(primary) Disconnected from kopusha:7772.
(primary) Increasing localcnt to 1.
(primary) Assertion failed: (old > 0), function refcnt_release,
file refcnt.h, line 62.
  
  Taking the request back was not necessary (it would properly be
  processed by the remote_recv_thread) and only complicated things.
  
  MFC after:2 weeks

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Tue Dec 10 20:02:09 2013(r259193)
+++ head/sbin/hastd/primary.c   Tue Dec 10 20:05:07 2013(r259194)
@@ -1656,18 +1656,9 @@ remote_send_thread(void *arg)
"Unable to send request (%s): ",
strerror(hio->hio_errors[ncomp]));
remote_close(res, ncomp);
-   /*
-* Take request back from the receive queue and move
-* it immediately to the done queue.
-*/
-   mtx_lock(&hio_recv_list_lock[ncomp]);
-   TAILQ_REMOVE(&hio_recv_list[ncomp], hio,
-   hio_next[ncomp]);
-   hio_recv_list_size[ncomp]--;
-   mtx_unlock(&hio_recv_list_lock[ncomp]);
-   goto done_queue;
+   } else {
+   rw_unlock(&hio_remote_lock[ncomp]);
}
-   rw_unlock(&hio_remote_lock[ncomp]);
nv_free(nv);
if (wakeup)
cv_signal(&hio_recv_list_cond[ncomp]);
___
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: r259195 - head/sbin/hastd

2013-12-10 Thread Mikolaj Golub
Author: trociny
Date: Tue Dec 10 20:06:41 2013
New Revision: 259195
URL: http://svnweb.freebsd.org/changeset/base/259195

Log:
  Send wakeup to threads waiting on empty queue before releasing the
  lock to decrease spurious wakeups.
  
  Submitted by: davidxu
  MFC after:2 weeks

Modified:
  head/sbin/hastd/primary.c
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Tue Dec 10 20:05:07 2013(r259194)
+++ head/sbin/hastd/primary.c   Tue Dec 10 20:06:41 2013(r259195)
@@ -180,27 +180,21 @@ static pthread_mutex_t metadata_lock;
((res)->hr_remotein != NULL && (res)->hr_remoteout != NULL)
 
 #defineQUEUE_INSERT1(hio, name, ncomp) do {
\
-   bool _wakeup;   \
-   \
mtx_lock(&hio_##name##_list_lock[(ncomp)]); \
-   _wakeup = TAILQ_EMPTY(&hio_##name##_list[(ncomp)]); \
+   if (TAILQ_EMPTY(&hio_##name##_list[(ncomp)]))   \
+   cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \
TAILQ_INSERT_TAIL(&hio_##name##_list[(ncomp)], (hio),   \
hio_next[(ncomp)]); \
hio_##name##_list_size[(ncomp)]++;  \
-   mtx_unlock(&hio_##name##_list_lock[ncomp]); \
-   if (_wakeup)\
-   cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \
+   mtx_unlock(&hio_##name##_list_lock[(ncomp)]);   \
 } while (0)
 #defineQUEUE_INSERT2(hio, name)do {
\
-   bool _wakeup;   \
-   \
mtx_lock(&hio_##name##_list_lock);  \
-   _wakeup = TAILQ_EMPTY(&hio_##name##_list);  \
+   if (TAILQ_EMPTY(&hio_##name##_list))\
+   cv_broadcast(&hio_##name##_list_cond);  \
TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\
hio_##name##_list_size++;   \
mtx_unlock(&hio_##name##_list_lock);\
-   if (_wakeup)\
-   cv_broadcast(&hio_##name##_list_cond);  \
 } while (0)
 #defineQUEUE_TAKE1(hio, name, ncomp, timeout)  do {
\
bool _last; \

Modified: head/sbin/hastd/secondary.c
==
--- head/sbin/hastd/secondary.c Tue Dec 10 20:05:07 2013(r259194)
+++ head/sbin/hastd/secondary.c Tue Dec 10 20:06:41 2013(r259195)
@@ -110,15 +110,12 @@ static void *disk_thread(void *arg);
 static void *send_thread(void *arg);
 
 #defineQUEUE_INSERT(name, hio) do {
\
-   bool _wakeup;   \
-   \
mtx_lock(&hio_##name##_list_lock);  \
-   _wakeup = TAILQ_EMPTY(&hio_##name##_list);  \
+   if (TAILQ_EMPTY(&hio_##name##_list))\
+   cv_broadcast(&hio_##name##_list_cond);  \
TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \
hio_##name##_list_size++;   \
mtx_unlock(&hio_##name##_list_lock);\
-   if (_wakeup)\
-   cv_broadcast(&hio_##name##_list_cond);  \
 } while (0)
 #defineQUEUE_TAKE(name, hio)   do {
\
mtx_lock(&hio_##name##_list_lock);  \
___
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: r259196 - head/sbin/hastd

2013-12-10 Thread Mikolaj Golub
Author: trociny
Date: Tue Dec 10 20:09:49 2013
New Revision: 259196
URL: http://svnweb.freebsd.org/changeset/base/259196

Log:
  Check remote protocol version only for the first connection (when it
  is actually sent by the remote node).
  
  Otherwise it generated confusing "Negotiated protocol version 1" debug
  messages when processing the second connection.
  
  MFC after:2 weeks

Modified:
  head/sbin/hastd/hastd.c

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Tue Dec 10 20:06:41 2013(r259195)
+++ head/sbin/hastd/hastd.c Tue Dec 10 20:09:49 2013(r259196)
@@ -806,12 +806,6 @@ listen_accept(struct hastd_listen *lst)
 */
version = 1;
}
-   if (version > HAST_PROTO_VERSION) {
-   pjdlog_info("Remote protocol version %hhu is not supported, 
falling back to version %hhu.",
-   version, (unsigned char)HAST_PROTO_VERSION);
-   version = HAST_PROTO_VERSION;
-   }
-   pjdlog_debug(1, "Negotiated protocol version %hhu.", version);
token = nv_get_uint8_array(nvin, &size, "token");
/*
 * NULL token means that this is first connection.
@@ -925,6 +919,12 @@ listen_accept(struct hastd_listen *lst)
 */
 
if (token == NULL) {
+   if (version > HAST_PROTO_VERSION) {
+   pjdlog_info("Remote protocol version %hhu is not 
supported, falling back to version %hhu.",
+   version, (unsigned char)HAST_PROTO_VERSION);
+   version = HAST_PROTO_VERSION;
+   }
+   pjdlog_debug(1, "Negotiated protocol version %hhu.", version);
res->hr_version = version;
arc4random_buf(res->hr_token, sizeof(res->hr_token));
nvout = nv_alloc();
___
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: r259197 - head/sys/x86/cpufreq

2013-12-10 Thread Alexander Motin
Author: mav
Date: Tue Dec 10 20:25:43 2013
New Revision: 259197
URL: http://svnweb.freebsd.org/changeset/base/259197

Log:
  Do not DELAY() for P-state transition unless we want to see the result.
  
  Intel manual says: "If a transition is already in progress, transition to
  a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
  the last targeted operating point."  So seems it should be fine to just
  trigger wanted transition and go.  Linux does the same.
  
  MFC after:1 month

Modified:
  head/sys/x86/cpufreq/est.c

Modified: head/sys/x86/cpufreq/est.c
==
--- head/sys/x86/cpufreq/est.c  Tue Dec 10 20:09:49 2013(r259196)
+++ head/sys/x86/cpufreq/est.c  Tue Dec 10 20:25:43 2013(r259197)
@@ -1288,10 +1288,9 @@ est_set_id16(device_t dev, uint16_t id16
msr = (msr & ~0x) | id16;
wrmsr(MSR_PERF_CTL, msr);
 
-   /* Wait a short while for the new setting.  XXX Is this necessary? */
-   DELAY(EST_TRANS_LAT);
-
if  (need_check) {
+   /* Wait a short while and read the new status. */
+   DELAY(EST_TRANS_LAT);
est_get_id16(&new_id16);
if (new_id16 != id16) {
if (bootverbose)
___
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: r259198 - head/sys/dev/md

2013-12-10 Thread Konstantin Belousov
Author: kib
Date: Tue Dec 10 20:52:31 2013
New Revision: 259198
URL: http://svnweb.freebsd.org/changeset/base/259198

Log:
  Only assert the length of the passed bio in the mdstart_vnode() when
  the bio is unmapped, so we must map the bio pages into pbuf.  This
  works around the geom classes which do not follow the MAXPHYS limit on
  the i/o size, since such classes do not know about unmapped bios
  either.
  
  Reported by:  Paolo Pinto 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cTue Dec 10 20:25:43 2013(r259197)
+++ head/sys/dev/md/md.cTue Dec 10 20:52:31 2013(r259198)
@@ -746,12 +746,12 @@ mdstart_vnode(struct md_s *sc, struct bi
return (error);
}
 
-   KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd",
-   (uintmax_t)bp->bio_length));
if ((bp->bio_flags & BIO_UNMAPPED) == 0) {
pb = NULL;
aiov.iov_base = bp->bio_data;
} else {
+   KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd",
+   (uintmax_t)bp->bio_length));
pb = getpbuf(&md_vnode_pbuf_freecnt);
pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n);
aiov.iov_base = (void *)((vm_offset_t)pb->b_data +
___
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: r259199 - head/sys/dev/ofw

2013-12-10 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Dec 10 21:01:28 2013
New Revision: 259199
URL: http://svnweb.freebsd.org/changeset/base/259199

Log:
  Return the correct IEEE 1275 code for "nextprop".

Modified:
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/ofw/ofw_fdt.c
==
--- head/sys/dev/ofw/ofw_fdt.c  Tue Dec 10 20:52:31 2013(r259198)
+++ head/sys/dev/ofw/ofw_fdt.c  Tue Dec 10 21:01:28 2013(r259199)
@@ -267,8 +267,10 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac
 }
 
 /*
- * Get the next property of a package. Return the actual len of retrieved
- * prop name.
+ * Get the next property of a package. Return values:
+ *  -1: package or previous property does not exist
+ *   0: no more properties
+ *   1: success
  */
 static int
 ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf,
@@ -310,7 +312,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa
 
strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size);
 
-   return (strlen(buf));
+   return (1);
 }
 
 /* Set the value of a property of a package. */
___
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: r259200 - head/sys/kern

2013-12-10 Thread Konstantin Belousov
Author: kib
Date: Tue Dec 10 21:15:18 2013
New Revision: 259200
URL: http://svnweb.freebsd.org/changeset/base/259200

Log:
  Fix detection of EOF in kern_physio().  If bio_length was clipped by
  the excess code in g_io_check(), bio_resid is also truncated by
  g_io_deliver().  As result, bufdonebio() assigns truncated value to
  the buffer b_resid field.
  
  Use the residual bio_completed to calculate buffer b_resid from
  b_bcount in bufdonebio(), instead of bio_resid, calculated from
  bio_length in g_io_deliver().
  
  The issue is seemingly caused by the code rearrange into g_io_check(),
  which is not present in stable/10.  The change still looks as the
  useful change to have in 10 nevertheless.
  
  Reported by:  Stefan Hegnauer 
  Tested by:pho, Stefan Hegnauer 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Dec 10 21:01:28 2013(r259199)
+++ head/sys/kern/vfs_bio.c Tue Dec 10 21:15:18 2013(r259200)
@@ -3679,7 +3679,6 @@ bufdonebio(struct bio *bip)
 
bp = bip->bio_caller2;
bp->b_resid = bp->b_bcount - bip->bio_completed;
-   bp->b_resid = bip->bio_resid;   /* XXX: remove */
bp->b_ioflags = bip->bio_flags;
bp->b_error = bip->bio_error;
if (bp->b_error)
___
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: r259202 - in head/sys/arm: arm versatile xilinx

2013-12-10 Thread John Baldwin
Author: jhb
Date: Tue Dec 10 22:13:36 2013
New Revision: 259202
URL: http://svnweb.freebsd.org/changeset/base/259202

Log:
  Correct license statements to reflect the fact that these files were all
  derived from sys/arm/mv/bus_space.c.
  
  Approved by:  core

Modified:
  head/sys/arm/arm/bus_space-v6.c
  head/sys/arm/versatile/bus_space.c
  head/sys/arm/xilinx/zy7_bus_space.c

Modified: head/sys/arm/arm/bus_space-v6.c
==
--- head/sys/arm/arm/bus_space-v6.c Tue Dec 10 22:03:59 2013
(r259201)
+++ head/sys/arm/arm/bus_space-v6.c Tue Dec 10 22:13:36 2013
(r259202)
@@ -1,7 +1,9 @@
 /*-
- * Copyright (c) 2012 Damjan Marion 
+ * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
  * All rights reserved.
  *
+ * Developed by Semihalf.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -10,11 +12,14 @@
  * 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. Neither the name of MARVELL nor the names of contributors
+ *may 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
+ * THIS SOFTWARE IS PROVIDED BY 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
+ * ARE DISCLAIMED.  IN NO EVENT SHALL 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)

Modified: head/sys/arm/versatile/bus_space.c
==
--- head/sys/arm/versatile/bus_space.c  Tue Dec 10 22:03:59 2013
(r259201)
+++ head/sys/arm/versatile/bus_space.c  Tue Dec 10 22:13:36 2013
(r259202)
@@ -1,7 +1,9 @@
 /*-
- * Copyright (C) 2012 FreeBSD Foundation
+ * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
  * All rights reserved.
  *
+ * Developed by Semihalf.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:

Modified: head/sys/arm/xilinx/zy7_bus_space.c
==
--- head/sys/arm/xilinx/zy7_bus_space.c Tue Dec 10 22:03:59 2013
(r259201)
+++ head/sys/arm/xilinx/zy7_bus_space.c Tue Dec 10 22:13:36 2013
(r259202)
@@ -1,7 +1,9 @@
 /*-
- * Copyright (C) 2012 FreeBSD Foundation
+ * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
  * All rights reserved.
  *
+ * Developed by Semihalf.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
___
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: r259203 - head/sys/dev/vt

2013-12-10 Thread Konstantin Belousov
Author: kib
Date: Tue Dec 10 22:33:02 2013
New Revision: 259203
URL: http://svnweb.freebsd.org/changeset/base/259203

Log:
  The opt_*.h headers must be included before any system header, except
  sys/cdefs.h.  In particular, in case of COMPAT_43, param.h includes
  sys/types.h, which includes sys/select.h, which includes
  sys/_sigset.h.  The _sigset.h customizes the provided definions based
  on COMPAT_43, eliminating osigset_t if symbol is not defined.  The
  sys/proc.h is included after opt_compat.h and needs osigset_t.
  
  Move opt_compat.h inclusion into the right place.
  
  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   Tue Dec 10 22:13:36 2013(r259202)
+++ head/sys/dev/vt/vt_core.c   Tue Dec 10 22:33:02 2013(r259203)
@@ -33,10 +33,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-
 #include "opt_compat.h"
 
+#include 
 #include 
 #include 
 #include 
___
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: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken

2013-12-10 Thread Andreas Tobler
On 10.12.13 14:43, Tijl Coosemans wrote:
> On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote:
>> That keyboards have no Shift key for that? :)
>> I will be glad to apply your changes, but I have to know how it should
>> be controlled.
>>
>> RU and UA PC keyboards have same 3 symbols '2', '"', '@'
>> To get '2' i have to press only '2'
>> To get '@' I have to press Shift+'2'
>> To get '"' I have to switch to UA or RU and press Shift+'2'
>>
>> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary
>> lang switch. Which commonly mapped to one of Alt. Right?
>> So R-Alt+Shift+'2'?
> 
> https://en.wikipedia.org/wiki/AltGr

Thanks Tijl!

To get the @ I have to press AltGr + '2'.
There are combinations where I have to press AltGr+Shift. e.g to get the
'broken bar, ¦', AltGr+Shift+'7'.

Andreas

___
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: r259205 - in head/sys/amd64/vmm: . intel io

2013-12-10 Thread Neel Natu
Author: neel
Date: Tue Dec 10 22:56:51 2013
New Revision: 259205
URL: http://svnweb.freebsd.org/changeset/base/259205

Log:
  Fix x2apic support in bhyve.
  
  When the guest is bringing up the APs in the x2APIC mode a write to the
  ICR register will now trigger a return to userspace with an exitcode of
  VM_EXITCODE_SPINUP_AP. This gets SMP guests working again with x2APIC.
  
  Change the vlapic timer lock to be a spinlock because the vlapic can be
  accessed from within a critical section (vm run loop) when guest is using
  x2apic mode.
  
  Reviewed by:  grehan@

Modified:
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/amd64/vmm/io/vlapic.h
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_lapic.c
  head/sys/amd64/vmm/vmm_lapic.h
  head/sys/amd64/vmm/vmm_msr.c
  head/sys/amd64/vmm/vmm_msr.h

Modified: head/sys/amd64/vmm/intel/vmx.c
==
--- head/sys/amd64/vmm/intel/vmx.c  Tue Dec 10 22:55:22 2013
(r259204)
+++ head/sys/amd64/vmm/intel/vmx.c  Tue Dec 10 22:56:51 2013
(r259205)
@@ -1337,6 +1337,7 @@ vmx_exit_process(struct vmx *vmx, int vc
struct vmxctx *vmxctx;
uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason;
uint64_t qual, gpa, rflags;
+   bool retu;
 
handled = 0;
vmcs = &vmx->vmcs[vcpu];
@@ -1382,27 +1383,39 @@ vmx_exit_process(struct vmx *vmx, int vc
break;
case EXIT_REASON_RDMSR:
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1);
+   retu = false;
ecx = vmxctx->guest_rcx;
-   error = emulate_rdmsr(vmx->vm, vcpu, ecx);
+   error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu);
if (error) {
vmexit->exitcode = VM_EXITCODE_RDMSR;
vmexit->u.msr.code = ecx;
-   } else
+   } else if (!retu) {
handled = 1;
+   } else {
+   /* Return to userspace with a valid exitcode */
+   KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS,
+   ("emulate_wrmsr retu with bogus exitcode"));
+   }
break;
case EXIT_REASON_WRMSR:
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_WRMSR, 1);
+   retu = false;
eax = vmxctx->guest_rax;
ecx = vmxctx->guest_rcx;
edx = vmxctx->guest_rdx;
error = emulate_wrmsr(vmx->vm, vcpu, ecx,
-   (uint64_t)edx << 32 | eax);
+   (uint64_t)edx << 32 | eax, &retu);
if (error) {
vmexit->exitcode = VM_EXITCODE_WRMSR;
vmexit->u.msr.code = ecx;
vmexit->u.msr.wval = (uint64_t)edx << 32 | eax;
-   } else
+   } else if (!retu) {
handled = 1;
+   } else {
+   /* Return to userspace with a valid exitcode */
+   KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS,
+   ("emulate_wrmsr retu with bogus exitcode"));
+   }
break;
case EXIT_REASON_HLT:
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1);

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Tue Dec 10 22:55:22 2013
(r259204)
+++ head/sys/amd64/vmm/io/vlapic.c  Tue Dec 10 22:56:51 2013
(r259205)
@@ -139,8 +139,8 @@ struct vlapic {
  * Note that the vlapic_callout_handler() does not write to any of these
  * registers so they can be safely read from the vcpu context without locking.
  */
-#defineVLAPIC_TIMER_LOCK(vlapic)   mtx_lock(&((vlapic)->timer_mtx))
-#defineVLAPIC_TIMER_UNLOCK(vlapic) 
mtx_unlock(&((vlapic)->timer_mtx))
+#defineVLAPIC_TIMER_LOCK(vlapic)   
mtx_lock_spin(&((vlapic)->timer_mtx))
+#defineVLAPIC_TIMER_UNLOCK(vlapic) 
mtx_unlock_spin(&((vlapic)->timer_mtx))
 #defineVLAPIC_TIMER_LOCKED(vlapic) 
mtx_owned(&((vlapic)->timer_mtx))
 
 #define VLAPIC_BUS_FREQtsc_freq
@@ -613,7 +613,7 @@ vlapic_set_icr_timer(struct vlapic *vlap
 static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu");
 
 static int
-lapic_process_icr(struct vlapic *vlapic, uint64_t icrval)
+lapic_process_icr(struct vlapic *vlapic, uint64_t icrval, bool *retu)
 {
int i;
cpuset_t dmask;
@@ -688,17 +688,18 @@ lapic_process_icr(struct vlapic *vlapic,
if (vlapic2->boot_state != BS_SIPI)
return (0);
 
-   vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid);
-   vmexit->exitcode = VM_EXITCODE_SPINUP_AP;
- 

svn commit: r259208 - head/share/mk

2013-12-10 Thread Julio Merino
Author: jmmv
Date: Wed Dec 11 03:39:50 2013
New Revision: 259208
URL: http://svnweb.freebsd.org/changeset/base/259208

Log:
  Add tap.test.mk.
  
  This file provides support to build test programs that comply with the
  Test Anything Protocol.  Its main goal is to support the painless
  integration of existing tests from tools/regression/ into the Kyua-based
  test suite.
  
  Approved by:  rpaulo (mentor)

Added:
  head/share/mk/tap.test.mk   (contents, props changed)
Modified:
  head/share/mk/Makefile

Modified: head/share/mk/Makefile
==
--- head/share/mk/Makefile  Wed Dec 11 00:39:56 2013(r259207)
+++ head/share/mk/Makefile  Wed Dec 11 03:39:50 2013(r259208)
@@ -46,6 +46,7 @@ FILESDIR= ${BINDIR}/mk
 .if ${MK_TESTS} != "no"
 FILES+=atf.test.mk
 FILES+=plain.test.mk
+FILES+=tap.test.mk
 .endif
 
 .include 

Added: head/share/mk/tap.test.mk
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/mk/tap.test.mk   Wed Dec 11 03:39:50 2013(r259208)
@@ -0,0 +1,64 @@
+# $FreeBSD$
+#
+# Logic to build and install TAP-compliant test programs.
+#
+# This is provided to support existing tests in the FreeBSD source tree
+# (particularly those coming from tools/regression/) that comply with the
+# Test Anything Protocol.  It should not be used for new tests.
+
+.include 
+
+# List of C, C++ and shell test programs to build.
+#
+# Programs listed here are built according to the semantics of bsd.prog.mk for
+# PROGS, PROGS_CXX and SCRIPTS, respectively.
+#
+# Test programs registered in this manner are set to be installed into TESTSDIR
+# (which should be overriden by the Makefile) and are not required to provide a
+# manpage.
+TAP_TESTS_C?=
+TAP_TESTS_CXX?=
+TAP_TESTS_SH?=
+
+.if !empty(TAP_TESTS_C)
+PROGS+= ${TAP_TESTS_C}
+_TESTS+= ${TAP_TESTS_C}
+.for _T in ${TAP_TESTS_C}
+BINDIR.${_T}= ${TESTSDIR}
+MAN.${_T}?= # empty
+SRCS.${_T}?= ${_T}.c
+TEST_INTERFACE.${_T}= tap
+.endfor
+.endif
+
+.if !empty(TAP_TESTS_CXX)
+PROGS_CXX+= ${TAP_TESTS_CXX}
+_TESTS+= ${TAP_TESTS_CXX}
+.for _T in ${TAP_TESTS_CXX}
+BINDIR.${_T}= ${TESTSDIR}
+MAN.${_T}?= # empty
+SRCS.${_T}?= ${_T}.cc
+TEST_INTERFACE.${_T}= tap
+.endfor
+.endif
+
+.if !empty(TAP_TESTS_SH)
+SCRIPTS+= ${TAP_TESTS_SH}
+_TESTS+= ${TAP_TESTS_SH}
+.for _T in ${TAP_TESTS_SH}
+SCRIPTSDIR_${_T}= ${TESTSDIR}
+TEST_INTERFACE.${_T}= tap
+CLEANFILES+= ${_T} ${_T}.tmp
+# TODO(jmmv): It seems to me that this SED and SRC functionality should
+# exist in bsd.prog.mk along the support for SCRIPTS.  Move it there if
+# this proves to be useful within the tests.
+TAP_TESTS_SH_SED_${_T}?= # empty
+TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh
+${_T}: ${TAP_TESTS_SH_SRC_${_T}}
+   cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
+   chmod +x ${.TARGET}.tmp
+   mv ${.TARGET}.tmp ${.TARGET}
+.endfor
+.endif
+
+.include 
___
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: r259209 - head/share/mk

2013-12-10 Thread Julio Merino
Author: jmmv
Date: Wed Dec 11 03:41:07 2013
New Revision: 259209
URL: http://svnweb.freebsd.org/changeset/base/259209

Log:
  Make bsd.progs.mk work in directories with SCRIPTS but no PROGS.
  
  This change fixes some cases where bsd.progs.mk would fail to handle
  directories with SCRIPTS but no PROGS.  In particular, "install" did
  not handle such scripts nor dependent files when bsd.subdir.mk was
  added to the mix.
  
  This is "make tinderbox" clean.
  
  Reviewed by:  freebsd-testing
  Approved by:  rpaulo (mentor)

Modified:
  head/share/mk/bsd.progs.mk

Modified: head/share/mk/bsd.progs.mk
==
--- head/share/mk/bsd.progs.mk  Wed Dec 11 03:39:50 2013(r259208)
+++ head/share/mk/bsd.progs.mk  Wed Dec 11 03:41:07 2013(r259209)
@@ -73,7 +73,7 @@ UPDATE_DEPENDFILE = NO
 # handle being called [bsd.]progs.mk
 .include 
 
-.ifndef PROG
+.ifndef _RECURSING_PROGS
 # tell progs.mk we might want to install things
 PROGS_TARGETS+= cleandepend cleandir cleanobj depend install
 
@@ -84,11 +84,13 @@ x.$p= PROG_CXX=$p
 .endif
 
 $p ${p}_p: .PHONY .MAKE
-   (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} PROG=$p ${x.$p})
+   (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
+   SUBDIR= PROG=$p ${x.$p})
 
 .for t in ${PROGS_TARGETS:O:u}
 $p.$t: .PHONY .MAKE
-   (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} PROG=$p ${x.$p} ${@:E})
+   (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
+   SUBDIR= PROG=$p ${x.$p} ${@:E})
 .endfor
 .endfor
 
@@ -96,4 +98,18 @@ $p.$t: .PHONY .MAKE
 $t: ${PROGS:%=%.$t}
 .endfor
 
+SCRIPTS_TARGETS+= cleandepend cleandir cleanobj depend install
+
+.for p in ${SCRIPTS}
+.for t in ${SCRIPTS_TARGETS:O:u}
+$p.$t: .PHONY .MAKE
+   (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
+   SUBDIR= SCRIPT=$p ${x.$p} ${@:E})
+.endfor
+.endfor
+
+.for t in ${SCRIPTS_TARGETS:O:u}
+$t: ${SCRIPTS:%=%.$t}
+.endfor
+
 .endif
___
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: r259210 - in head: bin bin/date bin/date/tests bin/mv bin/mv/tests bin/pax bin/pax/tests bin/sh bin/sh/tests bin/sh/tests/builtins bin/sh/tests/errors bin/sh/tests/execution bin/sh/test...

2013-12-10 Thread Julio Merino
Author: jmmv
Date: Wed Dec 11 04:09:17 2013
New Revision: 259210
URL: http://svnweb.freebsd.org/changeset/base/259210

Log:
  Migrate tools/regression/bin/ tests to the new layout.
  
  This change is a proof of concept on how to easily integrate existing
  tests from the tools/regression/ hierarchy into the /usr/tests/ test
  suite and on how to adapt them to the new layout for src.
  
  To achieve these goals, this change:
  
  - Moves tests from tools/regression/bin// to bin//tests/.
  - Renames the previous regress.sh files to legacy_test.sh.
  - Adds Makefiles to build and install the tests and all their supporting
data files into /usr/tests/bin/.
  - Plugs the legacy_test test programs into the test suite using the new
TAP backend for Kyua (appearing in 0.8) so that the code of the test
programs does not have to change.
  - Registers the new directories in the BSD.test.dist mtree file.
  
  Reviewed by:  freebsd-testing
  Approved by:  rpaulo (mentor)

Added:
  head/bin/date/tests/
  head/bin/date/tests/Makefile   (contents, props changed)
  head/bin/date/tests/legacy_test.sh
 - copied unchanged from r259205, head/tools/regression/bin/date/regress.sh
  head/bin/mv/tests/
  head/bin/mv/tests/Makefile   (contents, props changed)
  head/bin/mv/tests/legacy_test.sh
 - copied unchanged from r258552, head/tools/regression/bin/mv/regress.sh
  head/bin/pax/tests/
  head/bin/pax/tests/Makefile   (contents, props changed)
 - copied unchanged from r258552, head/tools/regression/bin/pax/regress.t
  head/bin/sh/tests/
  head/bin/sh/tests/Makefile   (contents, props changed)
  head/bin/sh/tests/builtins/
 - copied from r258552, head/tools/regression/bin/sh/builtins/
  head/bin/sh/tests/builtins/Makefile   (contents, props changed)
  head/bin/sh/tests/errors/
 - copied from r258552, head/tools/regression/bin/sh/errors/
  head/bin/sh/tests/errors/Makefile   (contents, props changed)
  head/bin/sh/tests/execution/
 - copied from r258552, head/tools/regression/bin/sh/execution/
  head/bin/sh/tests/execution/Makefile   (contents, props changed)
  head/bin/sh/tests/expansion/
 - copied from r258552, head/tools/regression/bin/sh/expansion/
  head/bin/sh/tests/expansion/Makefile   (contents, props changed)
  head/bin/sh/tests/legacy_test.sh
 - copied, changed from r258552, head/tools/regression/bin/sh/regress.sh
  head/bin/sh/tests/parameters/
 - copied from r258552, head/tools/regression/bin/sh/parameters/
  head/bin/sh/tests/parameters/Makefile   (contents, props changed)
  head/bin/sh/tests/parser/
 - copied from r258552, head/tools/regression/bin/sh/parser/
  head/bin/sh/tests/parser/Makefile   (contents, props changed)
  head/bin/sh/tests/set-e/
 - copied from r258552, head/tools/regression/bin/sh/set-e/
  head/bin/sh/tests/set-e/Makefile   (contents, props changed)
  head/bin/test/tests/
  head/bin/test/tests/Makefile   (contents, props changed)
  head/bin/test/tests/legacy_test.sh
 - copied unchanged from r258552, head/tools/regression/bin/test/regress.sh
  head/bin/tests/
  head/bin/tests/Makefile   (contents, props changed)
Directory Properties:
  head/bin/pax/tests/legacy_test.sh   (props changed)
Deleted:
  head/tools/regression/bin/
Modified:
  head/bin/Makefile
  head/bin/date/Makefile
  head/bin/mv/Makefile
  head/bin/pax/Makefile
  head/bin/sh/Makefile
  head/bin/test/Makefile
  head/etc/mtree/BSD.tests.dist

Modified: head/bin/Makefile
==
--- head/bin/Makefile   Wed Dec 11 03:41:07 2013(r259209)
+++ head/bin/Makefile   Wed Dec 11 04:09:17 2013(r259210)
@@ -52,6 +52,10 @@ SUBDIR+= rmail
 SUBDIR+=   csh
 .endif
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=   tests
+.endif
+
 .include 
 
 SUBDIR:=   ${SUBDIR:O}

Modified: head/bin/date/Makefile
==
--- head/bin/date/Makefile  Wed Dec 11 03:41:07 2013(r259209)
+++ head/bin/date/Makefile  Wed Dec 11 04:09:17 2013(r259210)
@@ -1,7 +1,13 @@
 #  @(#)Makefile8.1 (Berkeley) 5/31/93
 # $FreeBSD$
 
+.include 
+
 PROG=  date
 SRCS=  date.c netdate.c vary.c
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=tests
+.endif
+
 .include 

Added: head/bin/date/tests/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/date/tests/MakefileWed Dec 11 04:09:17 2013
(r259210)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.include 
+
+TESTSDIR=  ${TESTSBASE}/bin/date
+
+TAP_TESTS_SH=  legacy_test
+
+.include 

Copied: head/bin/date/tests/legacy_test.sh (from r259205, 
head/tools/regression/bin/date/regress.sh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/date/tests/legacy_test.sh  Wed Dec 11 04:0

svn commit: r259211 - in head/sys/cddl/contrib/opensolaris/uts: intel/dtrace powerpc/dtrace

2013-12-10 Thread Mark Johnston
Author: markj
Date: Wed Dec 11 04:31:40 2013
New Revision: 259211
URL: http://svnweb.freebsd.org/changeset/base/259211

Log:
  Correct the check for errors from proc_rwmem().
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Wed Dec 
11 04:09:17 2013(r259210)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Wed Dec 
11 04:31:40 2013(r259211)
@@ -75,7 +75,7 @@ proc_ops(int op, proc_t *p, void *kaddr,
uio.uio_td = curthread;
uio.uio_rw = op;
PHOLD(p);
-   if (proc_rwmem(p, &uio) < 0) {
+   if (proc_rwmem(p, &uio) != 0) {
PRELE(p);
return (-1);
}

Modified: head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Dec 
11 04:09:17 2013(r259210)
+++ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Dec 
11 04:31:40 2013(r259211)
@@ -60,7 +60,7 @@ proc_ops(int op, proc_t *p, void *kaddr,
uio.uio_td = curthread;
uio.uio_rw = op;
PHOLD(p);
-   if (proc_rwmem(p, &uio) < 0) {
+   if (proc_rwmem(p, &uio) != 0) {
PRELE(p);
return (-1);
}
___
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: r259212 - head/sys/arm/at91

2013-12-10 Thread Warner Losh
Author: imp
Date: Wed Dec 11 05:32:29 2013
New Revision: 259212
URL: http://svnweb.freebsd.org/changeset/base/259212

Log:
  Fix one race and one fence post error. When the TX buffer was
  completely full, we'd not complete any of the mbufs due to the fence
  post error (this creates a large leak). When this is fixed, we still
  leak, but at a much smaller rate due to a race between ateintr and
  atestart_locked as well as an asymmetry where atestart_locked is
  called from elsewhere.  Ensure that we free in-flight packets that
  have completed there as well. Also remove needless check for NULL on
  mb, checked earlier in the loop and simplify a redundant if.
  
  MFC after:3 days

Modified:
  head/sys/arm/at91/if_ate.c

Modified: head/sys/arm/at91/if_ate.c
==
--- head/sys/arm/at91/if_ate.c  Wed Dec 11 04:31:40 2013(r259211)
+++ head/sys/arm/at91/if_ate.c  Wed Dec 11 05:32:29 2013(r259212)
@@ -947,10 +947,8 @@ ate_intr(void *xsc)
 
} while (!done);
 
-   if (mb != NULL) {
-   ifp->if_ipackets++;
-   (*ifp->if_input)(ifp, mb);
-   }
+   ifp->if_ipackets++;
+   (*ifp->if_input)(ifp, mb);
}
}
 
@@ -974,16 +972,14 @@ ate_intr(void *xsc)
sc->tx_descs[sc->txtail + 1].status |= 
ETHB_TX_USED;
}
 
-   while (sc->txtail != sc->txhead &&
-   sc->tx_descs[sc->txtail].status & ETHB_TX_USED ) {
-
+   while ((sc->tx_descs[sc->txtail].status & ETHB_TX_USED) &&
+   sc->sent_mbuf[sc->txtail] != NULL) {
bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txtail],
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]);
m_freem(sc->sent_mbuf[sc->txtail]);
sc->tx_descs[sc->txtail].addr = 0;
sc->sent_mbuf[sc->txtail] = NULL;
-
ifp->if_opackets++;
sc->txtail = NEXT_TX_IDX(sc, sc->txtail);
}
@@ -1118,12 +1114,10 @@ atestart_locked(struct ifnet *ifp)
 * xmit packets.  We use OACTIVE to indicate "we can stuff more
 * into our buffers (clear) or not (set)."
 */
-   if (!sc->is_emacb) {
-   /* RM9200 has only two hardware entries */
-   if (!sc->is_emacb && (RD4(sc, ETH_TSR) & ETH_TSR_BNQ) 
== 0) {
-   ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-   return;
-   }
+   /* RM9200 has only two hardware entries */
+   if (!sc->is_emacb && (RD4(sc, ETH_TSR) & ETH_TSR_BNQ) == 0) {
+   ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+   return;
}
 
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
@@ -1146,6 +1140,21 @@ atestart_locked(struct ifnet *ifp)
m_freem(m);
continue;
}
+
+   /*
+* There's a small race between the loop in ate_intr finishing
+* and the check above to see if the packet was finished, as 
well
+* as when atestart gets called via other paths. Loose the race
+* gracefully and free the mbuf...
+*/
+   if (sc->sent_mbuf[sc->txhead] != NULL) {
+   bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txtail],
+   BUS_DMASYNC_POSTWRITE);
+   bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]);
+   m_free(sc->sent_mbuf[sc->txhead]);
+   ifp->if_opackets++;
+   }
+   
sc->sent_mbuf[sc->txhead] = m;
 
bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txhead],
___
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: r259213 - head/sys/amd64/vmm/io

2013-12-10 Thread Neel Natu
Author: neel
Date: Wed Dec 11 06:28:44 2013
New Revision: 259213
URL: http://svnweb.freebsd.org/changeset/base/259213

Log:
  Fix typo when initializing the vlapic version register ('<<' instead of '<').

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

Modified: head/sys/amd64/vmm/io/vlapic.c
==
--- head/sys/amd64/vmm/io/vlapic.c  Wed Dec 11 05:32:29 2013
(r259212)
+++ head/sys/amd64/vmm/io/vlapic.c  Wed Dec 11 06:28:44 2013
(r259213)
@@ -260,7 +260,7 @@ vlapic_init_ipi(struct vlapic *vlapic)
 {
struct LAPIC*lapic = &vlapic->apic;
lapic->version = VLAPIC_VERSION;
-   lapic->version |= (VLAPIC_MAXLVT_ENTRIES < MAXLVTSHIFT);
+   lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT);
lapic->dfr = 0x;
lapic->svr = APIC_SVR_VECTOR;
vlapic_mask_lvts(&lapic->lvt_timer, VLAPIC_MAXLVT_ENTRIES+1);
___
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"