From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 01:36:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DF3106566C; Sun, 24 Jul 2011 01:36:02 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F22968FC08; Sun, 24 Jul 2011 01:36:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6O1a1mH085013; Sun, 24 Jul 2011 01:36:01 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6O1a1uc085004; Sun, 24 Jul 2011 01:36:01 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201107240136.p6O1a1uc085004@svn.freebsd.org> From: Brian Somers Date: Sun, 24 Jul 2011 01:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224285 - stable/8/usr.sbin/ppp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 01:36:02 -0000 Author: brian Date: Sun Jul 24 01:36:01 2011 New Revision: 224285 URL: http://svn.freebsd.org/changeset/base/224285 Log: MFC r218397: Add "iface name" and "iface description" commands. PR: 151400 Submitted by: Aragon Gouveia - aragon at phat dot za dot net Modified: stable/8/usr.sbin/ppp/bundle.c stable/8/usr.sbin/ppp/command.c stable/8/usr.sbin/ppp/iface.c stable/8/usr.sbin/ppp/iface.h stable/8/usr.sbin/ppp/log.c stable/8/usr.sbin/ppp/log.h stable/8/usr.sbin/ppp/main.c stable/8/usr.sbin/ppp/ppp.8.m4 Directory Properties: stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/usr.sbin/ppp/bundle.c ============================================================================== --- stable/8/usr.sbin/ppp/bundle.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/bundle.c Sun Jul 24 01:36:01 2011 (r224285) @@ -758,7 +758,7 @@ bundle_Create(const char *prefix, int ty return NULL; } - log_SetTun(bundle.unit); + log_SetTun(bundle.unit, NULL); ifname = strrchr(bundle.dev.Name, '/'); if (ifname == NULL) @@ -849,7 +849,7 @@ bundle_Create(const char *prefix, int ty bundle.links = datalink_Create("deflink", &bundle, type); if (bundle.links == NULL) { log_Printf(LogALERT, "Cannot create data link: %s\n", strerror(errno)); - iface_Destroy(bundle.iface); + iface_Free(bundle.iface); bundle.iface = NULL; close(bundle.dev.fd); return NULL; Modified: stable/8/usr.sbin/ppp/command.c ============================================================================== --- stable/8/usr.sbin/ppp/command.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/command.c Sun Jul 24 01:36:01 2011 (r224285) @@ -184,6 +184,7 @@ static int DeleteCommand(struct cmdargs static int NegotiateCommand(struct cmdargs const *); static int ClearCommand(struct cmdargs const *); static int RunListCommand(struct cmdargs const *); +static int IfaceNameCommand(struct cmdargs const *arg); static int IfaceAddCommand(struct cmdargs const *); static int IfaceDeleteCommand(struct cmdargs const *); static int IfaceClearCommand(struct cmdargs const *); @@ -823,6 +824,10 @@ static struct cmdtab const IfaceCommands "Delete iface address", "iface delete addr", (void *)1}, {NULL, "delete!", IfaceDeleteCommand, LOCAL_AUTH, "Delete iface address", "iface delete addr", (void *)1}, + {"name", NULL, IfaceNameCommand, LOCAL_AUTH, + "Set iface name", "iface name name", NULL}, + {"description", NULL, iface_Descr, LOCAL_AUTH, + "Set iface description", "iface description text", NULL}, {"show", NULL, iface_Show, LOCAL_AUTH, "Show iface address(es)", "iface show", NULL}, {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, @@ -3176,6 +3181,21 @@ RunListCommand(struct cmdargs const *arg } static int +IfaceNameCommand(struct cmdargs const *arg) +{ + int n = arg->argn; + + if (arg->argc != n + 1) + return -1; + + if (!iface_Name(arg->bundle->iface, arg->argv[n])) + return 1; + + log_SetTun(arg->bundle->unit, arg->bundle->iface->name); + return 0; +} + +static int IfaceAddCommand(struct cmdargs const *arg) { struct ncpaddr peer, addr; Modified: stable/8/usr.sbin/ppp/iface.c ============================================================================== --- stable/8/usr.sbin/ppp/iface.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/iface.c Sun Jul 24 01:36:01 2011 (r224285) @@ -151,6 +151,7 @@ iface_Create(const char *name) return NULL; } iface->name = strdup(name); + iface->descr = NULL; iface->index = ifm->ifm_index; iface->flags = ifm->ifm_flags; iface->mtu = 0; @@ -369,6 +370,103 @@ iface_addr_Add(const char *name, struct return res != -1; } +int +iface_Name(struct iface *iface, const char *name) +{ + struct ifreq ifr; + int s; + char *newname; + + if ((newname = strdup(name)) == NULL) { + log_Printf(LogWARN, "iface name: strdup failed: %s\n", strerror(errno)); + return 0; + } + + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { + log_Printf(LogERROR, "iface name: socket(): %s\n", strerror(errno)); + free(newname); + return 0; + } + + strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); + ifr.ifr_data = newname; + if (ID0ioctl(s, SIOCSIFNAME, (caddr_t)&ifr) < 0) { + log_Printf(LogWARN, "iface name: ioctl(SIOCSIFNAME, %s -> %s): %s\n", + name, newname, strerror(errno)); + free(newname); + return 0; + } + + free(iface->name); + iface->name = newname; + + return 1; +} + +int +iface_Descr(struct cmdargs const *arg) +{ + struct ifreq ifr; + struct iface *iface; + size_t sz, len; + int s, n, ifdescr_maxlen; + char *descr; + + sz = sizeof(int); + if (sysctlbyname("net.ifdescr_maxlen", &ifdescr_maxlen, &sz, NULL, 0) < 0) { + log_Printf(LogERROR, "iface descr: sysctl failed: %s\n", strerror(errno)); + return 1; + } + + if (ifdescr_maxlen < 1) { + log_Printf(LogERROR, "iface descr: sysctl net.ifdescr_maxlen < 1\n"); + return 1; + } + + sz = sizeof(char) * ifdescr_maxlen; + if ((descr = malloc(sz)) == NULL) { + log_Printf(LogERROR, "iface descr: malloc failed: %s\n", strerror(errno)); + return 1; + } + + *descr = '\0'; + n = arg->argn; + while (n < arg->argc) { + if (n > arg->argn && (len = strlcat(descr, " ", sz)) >= sz) + break; + if ((len = strlcat(descr, arg->argv[n], sz)) >= sz) + break; + ++n; + } + if (len >= sz) { + log_Printf(LogERROR, "iface descr: description exceeds maximum (%d)\n", + ifdescr_maxlen-1); + free(descr); + return 1; + } + + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { + log_Printf(LogERROR, "iface descr: socket(): %s\n", strerror(errno)); + free(descr); + return 1; + } + + iface = arg->bundle->iface; + strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); + ifr.ifr_buffer.length = strlen(descr) + 1; + ifr.ifr_buffer.buffer = descr; + if (ID0ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0) { + log_Printf(LogWARN, "iface descr: ioctl(SIOCSIFDESCR, %s): %s\n", + descr, strerror(errno)); + free(descr); + return 1; + } + + free(iface->descr); + iface->descr = descr; + + return 0; +} void iface_Clear(struct iface *iface, struct ncp *ncp, int family, int how) @@ -608,18 +706,30 @@ iface_ClearFlags(const char *ifname, int } void -iface_Destroy(struct iface *iface) +iface_Free(struct iface *iface) { - /* - * iface_Clear(iface, IFACE_CLEAR_ALL) must be called manually - * if that's what the user wants. It's better to leave the interface - * allocated so that existing connections can continue to work. - */ - - if (iface != NULL) { free(iface->name); + free(iface->descr); free(iface->addr); free(iface); +} + +void +iface_Destroy(struct iface *iface) +{ + struct ifreq ifr; + int s; + + if (iface != NULL) { + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { + log_Printf(LogERROR, "iface_Destroy: socket(): %s\n", strerror(errno)); + } else { + strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); + if (ID0ioctl(s, SIOCIFDESTROY, (caddr_t)&ifr) < 0) + log_Printf(LogWARN, "iface_Destroy: ioctl(SIOCIFDESTROY, %s): %s\n", + iface->name, strerror(errno)); + } + iface_Free(iface); } } @@ -661,7 +771,7 @@ iface_Show(struct cmdargs const *arg) current = iface_Create(iface->name); flags = iface->flags = current->flags; - iface_Destroy(current); + iface_Free(current); prompt_Printf(arg->prompt, "%s (idx %d) <", iface->name, iface->index); for (f = 0; f < sizeof if_flags / sizeof if_flags[0]; f++) Modified: stable/8/usr.sbin/ppp/iface.h ============================================================================== --- stable/8/usr.sbin/ppp/iface.h Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/iface.h Sun Jul 24 01:36:01 2011 (r224285) @@ -36,6 +36,7 @@ struct iface_addr { struct iface { char *name; /* Interface name (malloc'd) */ + char *descr; /* Interface description (malloc'd) */ int index; /* Interface index */ int flags; /* Interface flags (IFF_*) */ unsigned long mtu; /* struct tuninfo MTU */ @@ -55,11 +56,14 @@ struct iface { extern struct iface *iface_Create(const char *name); extern void iface_Clear(struct iface *, struct ncp *, int, int); +extern int iface_Name(struct iface *, const char *); +extern int iface_Descr(struct cmdargs const *); extern int iface_Add(struct iface *, struct ncp *, const struct ncprange *, const struct ncpaddr *, int); extern int iface_Delete(struct iface *, struct ncp *, const struct ncpaddr *); extern int iface_Show(struct cmdargs const *); extern int iface_SetFlags(const char *, int); extern int iface_ClearFlags(const char *, int); +extern void iface_Free(struct iface *); extern void iface_Destroy(struct iface *); extern void iface_ParseHdr(struct ifa_msghdr *, struct sockaddr *[RTAX_MAX]); Modified: stable/8/usr.sbin/ppp/log.c ============================================================================== --- stable/8/usr.sbin/ppp/log.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/log.c Sun Jul 24 01:36:01 2011 (r224285) @@ -75,6 +75,7 @@ static const char *const LogNames[] = { static u_long LogMask = MSK(LogPHASE); static u_long LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN); static int LogTunno = -1; +static const char *LogIfaceName; static struct prompt *promptlist; /* Where to log local stuff */ struct prompt *log_PromptContext; int log_PromptListChanged; @@ -296,9 +297,10 @@ log_Open(const char *Name) } void -log_SetTun(int tunno) +log_SetTun(int tunno, const char *ifaceName) { LogTunno = tunno; + LogIfaceName = ifaceName; } void @@ -306,6 +308,7 @@ log_Close() { closelog(); LogTunno = -1; + LogIfaceName = NULL; } void @@ -319,10 +322,14 @@ log_Printf(int lev, const char *fmt,...) va_start(ap, fmt); if (promptlist && (log_IsKept(lev) & LOG_KEPT_LOCAL)) { - if ((log_IsKept(LogTUN) & LOG_KEPT_LOCAL) && LogTunno != -1) - snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, + if ((log_IsKept(LogTUN) & LOG_KEPT_LOCAL) && LogTunno != -1) { + if (LogIfaceName) + snprintf(nfmt, sizeof nfmt, "%s%d(%s): %s: %s", TUN_NAME, + LogTunno, LogIfaceName, log_Name(lev), fmt); + else + snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, LogTunno, log_Name(lev), fmt); - else + } else snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt); if (log_PromptContext && lev == LogWARN) @@ -337,10 +344,14 @@ log_Printf(int lev, const char *fmt,...) va_start(ap, fmt); if ((log_IsKept(lev) & LOG_KEPT_SYSLOG) && (lev != LogWARN || !log_PromptContext)) { - if ((log_IsKept(LogTUN) & LOG_KEPT_SYSLOG) && LogTunno != -1) - snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, + if ((log_IsKept(LogTUN) & LOG_KEPT_SYSLOG) && LogTunno != -1) { + if (LogIfaceName) + snprintf(nfmt, sizeof nfmt, "%s%d(%s): %s: %s", TUN_NAME, + LogTunno, LogIfaceName, log_Name(lev), fmt); + else + snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, LogTunno, log_Name(lev), fmt); - else + } else snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt); vsyslog(syslogLevel(lev), nfmt, ap); } Modified: stable/8/usr.sbin/ppp/log.h ============================================================================== --- stable/8/usr.sbin/ppp/log.h Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/log.h Sun Jul 24 01:36:01 2011 (r224285) @@ -76,7 +76,7 @@ extern void log_DiscardAllLocal(u_long * extern int log_IsKept(int); extern int log_IsKeptLocal(int, u_long); extern void log_Open(const char *); -extern void log_SetTun(int); +extern void log_SetTun(int, const char *); extern void log_Close(void); #ifdef __GNUC__ extern void log_Printf(int, const char *,...) Modified: stable/8/usr.sbin/ppp/main.c ============================================================================== --- stable/8/usr.sbin/ppp/main.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/main.c Sun Jul 24 01:36:01 2011 (r224285) @@ -386,11 +386,6 @@ main(int argc, char **argv) /* NOTE: We may now have changed argv[1] via a ``set proctitle'' */ - if (prompt) { - prompt->bundle = bundle; /* couldn't do it earlier */ - if (!sw.quiet) - prompt_Printf(prompt, "Using interface: %s\n", bundle->iface->name); - } SignalBundle = bundle; bundle->NatEnabled = sw.nat; if (sw.nat) @@ -430,6 +425,12 @@ main(int argc, char **argv) AbortProgram(EX_START); } + if (prompt) { + prompt->bundle = bundle; /* couldn't do it earlier */ + if (!sw.quiet) + prompt_Printf(prompt, "Using interface: %s\n", bundle->iface->name); + } + if (sw.mode != PHYS_INTERACTIVE) { if (sw.mode != PHYS_DIRECT) { if (!sw.fg) { Modified: stable/8/usr.sbin/ppp/ppp.8.m4 ============================================================================== --- stable/8/usr.sbin/ppp/ppp.8.m4 Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/ppp.8.m4 Sun Jul 24 01:36:01 2011 (r224285) @@ -3924,6 +3924,13 @@ If the .Dq !\& is used, no error is given if the address is not currently assigned to the interface (and no deletion takes place). +.It iface name Ar name +Renames the interface to +.Ar name . +.It iface description Ar description +Sets the interface description to +.Ar description . +Useful if you have many interfaces on your system. .It iface show Shows the current state and current addresses for the interface. It is much the same as running From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 03:34:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6C73106564A; Sun, 24 Jul 2011 03:34:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6EEF8FC12; Sun, 24 Jul 2011 03:34:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6O3YcZT088758; Sun, 24 Jul 2011 03:34:38 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6O3YcTh088756; Sun, 24 Jul 2011 03:34:38 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107240334.p6O3YcTh088756@svn.freebsd.org> From: Glen Barber Date: Sun, 24 Jul 2011 03:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224286 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 03:34:38 -0000 Author: gjb (doc committer) Date: Sun Jul 24 03:34:38 2011 New Revision: 224286 URL: http://svn.freebsd.org/changeset/base/224286 Log: Document the potential for jail escape. Submitted by: Vedad KAJTAZ (vedad % kajtaz net) PR: 142341 Reviewed by: bz, rwatson Rewording by: rwatson Approved by: re (kensmith) MFC after: 3 days Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Jul 24 01:36:01 2011 (r224285) +++ head/usr.sbin/jail/jail.8 Sun Jul 24 03:34:38 2011 (r224286) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -907,3 +907,10 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. +.Sh NOTES +Great care should be taken when managing directories visible within the jail. +For example, if a jailed process has its current working directory set to a +directory that is moved out of the jail's chroot, then the process may gain +access to the file space outside of the jail. +It is recommended that directories always be copied, rather than moved, out +of a jail. From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 09:43:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25FFB1065672; Sun, 24 Jul 2011 09:43:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145CD8FC1A; Sun, 24 Jul 2011 09:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6O9hii0099584; Sun, 24 Jul 2011 09:43:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6O9hitl099581; Sun, 24 Jul 2011 09:43:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201107240943.p6O9hitl099581@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 24 Jul 2011 09:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224287 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 09:43:45 -0000 Author: hselasky Date: Sun Jul 24 09:43:44 2011 New Revision: 224287 URL: http://svn.freebsd.org/changeset/base/224287 Log: MFC r224239: Add new USB ID to u3g driver. Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sun Jul 24 03:34:38 2011 (r224286) +++ stable/8/sys/dev/usb/serial/u3g.c Sun Jul 24 09:43:44 2011 (r224287) @@ -293,6 +293,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), U3G_DEV(LONGCHEER, DISK, U3GINIT_TCT), U3G_DEV(LONGCHEER, W14, 0), + U3G_DEV(LONGCHEER, XSSTICK, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Jul 24 03:34:38 2011 (r224286) +++ stable/8/sys/dev/usb/usbdevs Sun Jul 24 09:43:44 2011 (r224287) @@ -2106,6 +2106,7 @@ product LOGITEC RT2870_3 0x0164 RT2870 /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA product LONGCHEER W14 0x9603 Mobilcom W14 +product LONGCHEER XSSTICK 0x9605 4G Systems XSStick P14 product LONGCHEER DISK 0xf000 Driver disk From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 11:56:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4981065672; Sun, 24 Jul 2011 11:56:39 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 515468FC19; Sun, 24 Jul 2011 11:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OBudVJ004750; Sun, 24 Jul 2011 11:56:39 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OBudqc004749; Sun, 24 Jul 2011 11:56:39 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <201107241156.p6OBudqc004749@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Sun, 24 Jul 2011 11:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224288 - in stable/8/sys: amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 11:56:39 -0000 Author: sanpei Date: Sun Jul 24 11:56:39 2011 New Revision: 224288 URL: http://svn.freebsd.org/changeset/base/224288 Log: Fix svn:mergeinfo for merge of r216057 Approved by: imp(menter) Modified: Directory Properties: stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 12:31:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 051F6106564A; Sun, 24 Jul 2011 12:31:21 +0000 (UTC) (envelope-from sanpei@sanpei.org) Received: from mail2.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by mx1.freebsd.org (Postfix) with ESMTP id C58378FC0C; Sun, 24 Jul 2011 12:31:20 +0000 (UTC) Received: from cherry2.sanpei.org (j069113.ppp.asahi-net.or.jp [61.213.69.113]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id 51B9BED99D; Sun, 24 Jul 2011 21:13:49 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by cherry2.sanpei.org (8.14.4/8.14.3) with ESMTP id p6OCDm0w015897; Sun, 24 Jul 2011 21:13:48 +0900 (JST) (envelope-from sanpei@sanpei.org) Date: Sun, 24 Jul 2011 21:13:48 +0900 (JST) Message-Id: <20110724.211348.1305564732068179438.sanpei@sanpei.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org From: MIHIRA Sanpei Yoshiro X-Mailer: Mew version 6.3 on Emacs 23.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (cherry2.sanpei.org [127.0.0.1]); Sun, 24 Jul 2011 21:13:49 +0900 (JST) Cc: Subject: svn commit: r224146 - in stable/8: share/man/man4 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 12:31:21 -0000 Oops, hrs-san already commited this mergeinfo. sorry. >Log: > Fix svn:mergeinfo for merge of r216057 > > Approved by: imp(menter) > >Modified: >Directory Properties: > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) --- MIHIRA, Sanpei Yoshiro Tokyo, Japan. From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 17:24:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89912106564A; Sun, 24 Jul 2011 17:24:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7861B8FC08; Sun, 24 Jul 2011 17:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OHOQd2017464; Sun, 24 Jul 2011 17:24:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OHOQTa017462; Sun, 24 Jul 2011 17:24:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107241724.p6OHOQTa017462@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Jul 2011 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224289 - stable/8/usr.bin/printf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 17:24:26 -0000 Author: jilles Date: Sun Jul 24 17:24:26 2011 New Revision: 224289 URL: http://svn.freebsd.org/changeset/base/224289 Log: MFC r212374,r221026: printf(1): Document need for "--" before format strings starting with "-". Also move the remark that hexadecimal escapes are not provided to the new CAVEATS section. PR: 158846 Modified: stable/8/usr.bin/printf/printf.1 Directory Properties: stable/8/usr.bin/printf/ (props changed) Modified: stable/8/usr.bin/printf/printf.1 ============================================================================== --- stable/8/usr.bin/printf/printf.1 Sun Jul 24 11:56:39 2011 (r224288) +++ stable/8/usr.bin/printf/printf.1 Sun Jul 24 17:24:26 2011 (r224289) @@ -332,6 +332,16 @@ command appeared in It is modeled after the standard library function, .Xr printf 3 . +.Sh CAVEATS +.Tn ANSI +hexadecimal character constants were deliberately not provided. +.Pp +Trying to print a dash ("-") as the first character causes +.Nm +to interpret the dash as a program argument. +.Nm -- +must be used before +.Ar format . .Sh BUGS Since the floating point numbers are translated from .Tn ASCII @@ -343,9 +353,6 @@ The .Cm L modifier may produce additional precision, depending on the hardware platform.) .Pp -.Tn ANSI -hexadecimal character constants were deliberately not provided. -.Pp The escape sequence \e000 is the string terminator. When present in the argument for the .Cm b From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 17:43:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B13A106564A; Sun, 24 Jul 2011 17:43:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6FC8FC0A; Sun, 24 Jul 2011 17:43:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OHh9eK018061; Sun, 24 Jul 2011 17:43:09 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OHh9po018053; Sun, 24 Jul 2011 17:43:09 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201107241743.p6OHh9po018053@svn.freebsd.org> From: Kirk McKusick Date: Sun, 24 Jul 2011 17:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224290 - in head/sys: fs/cd9660 fs/msdosfs fs/ntfs fs/smbfs kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 17:43:10 -0000 Author: mckusick Date: Sun Jul 24 17:43:09 2011 New Revision: 224290 URL: http://svn.freebsd.org/changeset/base/224290 Log: This update changes the mnt_flag field in the mount structure from 32 bits to 64 bits and eliminates the unused mnt_xflag field. The existing mnt_flag field is completely out of bits, so this update gives us room to expand. Note that the f_flags field in the statfs structure is already 64 bits, so the expanded mnt_flag field can be exported without having to make any changes in the statfs structure. Approved by: re (bz) Modified: head/sys/fs/cd9660/iso.h head/sys/fs/msdosfs/msdosfsmount.h head/sys/fs/ntfs/ntfs.h head/sys/fs/smbfs/smbfs.h head/sys/kern/kern_jail.c head/sys/kern/vfs_mount.c head/sys/sys/mount.h Modified: head/sys/fs/cd9660/iso.h ============================================================================== --- head/sys/fs/cd9660/iso.h Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/fs/cd9660/iso.h Sun Jul 24 17:43:09 2011 (r224290) @@ -220,7 +220,7 @@ enum ISO_FTYPE { ISO_FTYPE_DEFAULT, ISO_ #endif struct iso_mnt { - int im_flags; + uint64_t im_flags; struct mount *im_mountp; struct cdev *im_dev; Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/fs/msdosfs/msdosfsmount.h Sun Jul 24 17:43:09 2011 (r224290) @@ -103,7 +103,7 @@ struct msdosfsmount { u_int pm_fatdiv; /* offset computation */ u_int pm_curfat; /* current fat for FAT32 (0 otherwise) */ u_int *pm_inusemap; /* ptr to bitmap of in-use clusters */ - u_int pm_flags; /* see below */ + uint64_t pm_flags; /* see below */ void *pm_u2w; /* Local->Unicode iconv handle */ void *pm_w2u; /* Unicode->Local iconv handle */ void *pm_u2d; /* Unicode->DOS iconv handle */ Modified: head/sys/fs/ntfs/ntfs.h ============================================================================== --- head/sys/fs/ntfs/ntfs.h Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/fs/ntfs/ntfs.h Sun Jul 24 17:43:09 2011 (r224290) @@ -250,7 +250,7 @@ struct ntfsmount { uid_t ntm_uid; gid_t ntm_gid; mode_t ntm_mode; - u_int ntm_flag; + uint64_t ntm_flag; cn_t ntm_cfree; struct ntvattrdef *ntm_ad; int ntm_adnum; Modified: head/sys/fs/smbfs/smbfs.h ============================================================================== --- head/sys/fs/smbfs/smbfs.h Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/fs/smbfs/smbfs.h Sun Jul 24 17:43:09 2011 (r224290) @@ -80,7 +80,7 @@ struct smbmount { struct mount * sm_mp; struct smbnode * sm_root; struct ucred * sm_owner; - u_int sm_flags; + uint64_t sm_flags; long sm_nextino; struct smb_share * sm_share; /* struct simplelock sm_npslock;*/ Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/kern/kern_jail.c Sun Jul 24 17:43:09 2011 (r224290) @@ -540,8 +540,8 @@ kern_jail_set(struct thread *td, struct #ifdef INET6 int ip6s, redo_ip6; #endif - unsigned pr_flags, ch_flags; - unsigned pr_allow, ch_allow, tallow; + uint64_t pr_allow, ch_allow, pr_flags, ch_flags; + unsigned tallow; char numbuf[12]; error = priv_check(td, PRIV_JAIL_SET); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/kern/vfs_mount.c Sun Jul 24 17:43:09 2011 (r224290) @@ -1496,7 +1496,8 @@ vfs_getopts(struct vfsoptlist *opts, con } int -vfs_flagopt(struct vfsoptlist *opts, const char *name, u_int *w, u_int val) +vfs_flagopt(struct vfsoptlist *opts, const char *name, uint64_t *w, + uint64_t val) { struct vfsopt *opt; Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Jul 24 17:24:26 2011 (r224289) +++ head/sys/sys/mount.h Sun Jul 24 17:43:09 2011 (r224290) @@ -166,8 +166,7 @@ struct mount { int mnt_nvnodelistsize; /* (i) # of vnodes */ int mnt_writeopcount; /* (i) write syscalls pending */ int mnt_kern_flag; /* (i) kernel only flags */ - u_int mnt_flag; /* (i) flags shared with user */ - u_int mnt_xflag; /* (i) more flags shared with user */ + uint64_t mnt_flag; /* (i) flags shared with user */ u_int mnt_noasync; /* (i) # noasync overrides */ struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ @@ -224,43 +223,43 @@ void __mnt_vnode_markerfree(str /* * User specifiable flags, stored in mnt_flag. */ -#define MNT_RDONLY 0x00000001 /* read only filesystem */ -#define MNT_SYNCHRONOUS 0x00000002 /* filesystem written synchronously */ -#define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */ -#define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ -#define MNT_UNION 0x00000020 /* union with underlying filesystem */ -#define MNT_ASYNC 0x00000040 /* filesystem written asynchronously */ -#define MNT_SUIDDIR 0x00100000 /* special handling of SUID on dirs */ -#define MNT_SOFTDEP 0x00200000 /* soft updates being done */ -#define MNT_NOSYMFOLLOW 0x00400000 /* do not follow symlinks */ -#define MNT_GJOURNAL 0x02000000 /* GEOM journal support enabled */ -#define MNT_MULTILABEL 0x04000000 /* MAC support for individual objects */ -#define MNT_ACLS 0x08000000 /* ACL support enabled */ -#define MNT_NOATIME 0x10000000 /* disable update of file access time */ -#define MNT_NOCLUSTERR 0x40000000 /* disable cluster read */ -#define MNT_NOCLUSTERW 0x80000000 /* disable cluster write */ -#define MNT_NFS4ACLS 0x00000010 +#define MNT_RDONLY 0x0000000000000001ULL /* read only filesystem */ +#define MNT_SYNCHRONOUS 0x0000000000000002ULL /* fs written synchronously */ +#define MNT_NOEXEC 0x0000000000000004ULL /* can't exec from filesystem */ +#define MNT_NOSUID 0x0000000000000008ULL /* don't honor setuid fs bits */ +#define MNT_NFS4ACLS 0x0000000000000010ULL /* enable NFS version 4 ACLs */ +#define MNT_UNION 0x0000000000000020ULL /* union with underlying fs */ +#define MNT_ASYNC 0x0000000000000040ULL /* fs written asynchronously */ +#define MNT_SUIDDIR 0x0000000000100000ULL /* special SUID dir handling */ +#define MNT_SOFTDEP 0x0000000000200000ULL /* using soft updates */ +#define MNT_NOSYMFOLLOW 0x0000000000400000ULL /* do not follow symlinks */ +#define MNT_GJOURNAL 0x0000000002000000ULL /* GEOM journal support enabled */ +#define MNT_MULTILABEL 0x0000000004000000ULL /* MAC support for objects */ +#define MNT_ACLS 0x0000000008000000ULL /* ACL support enabled */ +#define MNT_NOATIME 0x0000000010000000ULL /* dont update file access time */ +#define MNT_NOCLUSTERR 0x0000000040000000ULL /* disable cluster read */ +#define MNT_NOCLUSTERW 0x0000000080000000ULL /* disable cluster write */ /* * NFS export related mount flags. */ -#define MNT_EXRDONLY 0x00000080 /* exported read only */ -#define MNT_EXPORTED 0x00000100 /* filesystem is exported */ -#define MNT_DEFEXPORTED 0x00000200 /* exported to the world */ -#define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */ -#define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */ -#define MNT_EXPUBLIC 0x20000000 /* public export (WebNFS) */ +#define MNT_EXRDONLY 0x0000000000000080ULL /* exported read only */ +#define MNT_EXPORTED 0x0000000000000100ULL /* filesystem is exported */ +#define MNT_DEFEXPORTED 0x0000000000000200ULL /* exported to the world */ +#define MNT_EXPORTANON 0x0000000000000400ULL /* anon uid mapping for all */ +#define MNT_EXKERB 0x0000000000000800ULL /* exported with Kerberos */ +#define MNT_EXPUBLIC 0x0000000020000000ULL /* public export (WebNFS) */ /* * Flags set by internal operations, * but visible to the user. * XXX some of these are not quite right.. (I've never seen the root flag set) */ -#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */ -#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */ -#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */ -#define MNT_USER 0x00008000 /* mounted by a user */ -#define MNT_IGNORE 0x00800000 /* do not show entry in df */ +#define MNT_LOCAL 0x0000000000001000ULL /* filesystem is stored locally */ +#define MNT_QUOTA 0x0000000000002000ULL /* quotas are enabled on fs */ +#define MNT_ROOTFS 0x0000000000004000ULL /* identifies the root fs */ +#define MNT_USER 0x0000000000008000ULL /* mounted by a user */ +#define MNT_IGNORE 0x0000000000800000ULL /* do not show entry in df */ /* * Mask of flags that are visible to statfs(). @@ -293,12 +292,12 @@ void __mnt_vnode_markerfree(str * XXX: MNT_BYFSID collides with MNT_ACLS, but because MNT_ACLS is only used for * mount(2) and MNT_BYFSID is only used for unmount(2) it's harmless. */ -#define MNT_UPDATE 0x00010000 /* not a real mount, just an update */ -#define MNT_DELEXPORT 0x00020000 /* delete export host lists */ -#define MNT_RELOAD 0x00040000 /* reload filesystem data */ -#define MNT_FORCE 0x00080000 /* force unmount or readonly change */ -#define MNT_SNAPSHOT 0x01000000 /* snapshot the filesystem */ -#define MNT_BYFSID 0x08000000 /* specify filesystem by ID. */ +#define MNT_UPDATE 0x0000000000010000ULL /* not real mount, just update */ +#define MNT_DELEXPORT 0x0000000000020000ULL /* delete export host lists */ +#define MNT_RELOAD 0x0000000000040000ULL /* reload filesystem data */ +#define MNT_FORCE 0x0000000000080000ULL /* force unmount or readonly */ +#define MNT_SNAPSHOT 0x0000000001000000ULL /* snapshot the filesystem */ +#define MNT_BYFSID 0x0000000008000000ULL /* specify filesystem by ID. */ #define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ MNT_FORCE | MNT_SNAPSHOT | MNT_BYFSID) /* @@ -715,7 +714,8 @@ void vfs_event_signal(fsid_t *, u_int32_ void vfs_freeopts(struct vfsoptlist *opts); void vfs_deleteopt(struct vfsoptlist *opts, const char *name); int vfs_buildopts(struct uio *auio, struct vfsoptlist **options); -int vfs_flagopt(struct vfsoptlist *opts, const char *name, u_int *w, u_int val); +int vfs_flagopt(struct vfsoptlist *opts, const char *name, uint64_t *w, + uint64_t val); int vfs_getopt(struct vfsoptlist *, const char *, void **, int *); int vfs_getopt_pos(struct vfsoptlist *opts, const char *name); char *vfs_getopts(struct vfsoptlist *, const char *, int *error); From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 17:52:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20020106568A; Sun, 24 Jul 2011 17:52:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C91DF8FC1C; Sun, 24 Jul 2011 17:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OHqZZW018392; Sun, 24 Jul 2011 17:52:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OHqZBj018390; Sun, 24 Jul 2011 17:52:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107241752.p6OHqZBj018390@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Jul 2011 17:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224291 - stable/8/usr.bin/printf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 17:52:36 -0000 Author: jilles Date: Sun Jul 24 17:52:35 2011 New Revision: 224291 URL: http://svn.freebsd.org/changeset/base/224291 Log: MFC r221013: printf(1): Mention effect of '#' modifier on other conversions. Modified: stable/8/usr.bin/printf/printf.1 Directory Properties: stable/8/usr.bin/printf/ (props changed) Modified: stable/8/usr.bin/printf/printf.1 ============================================================================== --- stable/8/usr.bin/printf/printf.1 Sun Jul 24 17:43:09 2011 (r224290) +++ stable/8/usr.bin/printf/printf.1 Sun Jul 24 17:52:35 2011 (r224291) @@ -35,7 +35,7 @@ .\" @(#)printf.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd September 5, 2010 +.Dd April 25, 2011 .Dt PRINTF 1 .Os .Sh NAME @@ -129,9 +129,9 @@ in the following order: A `#' character specifying that the value should be printed in an ``alternate form''. For -.Cm c , d , +.Cm b , c , d , s and -.Cm s , +.Cm u formats, this option has no effect. For the .Cm o @@ -145,9 +145,9 @@ format, a non-zero result has the string .Pq Li 0X prepended to it. For -.Cm e , E , f , g , +.Cm a , A , e , E , f , F , g and -.Cm G , +.Cm G formats, the result will always contain a decimal point, even if no digits follow the point (normally, a decimal point only appears in the results of those formats if a digit follows the decimal point). From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 18:03:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B941065673; Sun, 24 Jul 2011 18:03:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA62A8FC13; Sun, 24 Jul 2011 18:03:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OI32qA018758; Sun, 24 Jul 2011 18:03:02 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OI32ST018756; Sun, 24 Jul 2011 18:03:02 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107241803.p6OI32ST018756@svn.freebsd.org> From: Maxim Sobolev Date: Sun, 24 Jul 2011 18:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224292 - stable/8/sbin/natd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 18:03:03 -0000 Author: sobomax Date: Sun Jul 24 18:03:02 2011 New Revision: 224292 URL: http://svn.freebsd.org/changeset/base/224292 Log: MFC: 220736, 220806, 220808 If we can retrieve interface address sleep for one second and try again. This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. Do this only in background, dynamic mode. Reminded by: brian Modified: stable/8/sbin/natd/natd.c Directory Properties: stable/8/sbin/natd/ (props changed) Modified: stable/8/sbin/natd/natd.c ============================================================================== --- stable/8/sbin/natd/natd.c Sun Jul 24 17:52:35 2011 (r224291) +++ stable/8/sbin/natd/natd.c Sun Jul 24 18:03:02 2011 (r224292) @@ -111,7 +111,7 @@ static void Usage (void); static char* FormatPacket (struct ip*); static void PrintPacket (struct ip*); static void SyslogPacket (struct ip*, int priority, const char *label); -static void SetAliasAddressFromIfName (const char *ifName); +static int SetAliasAddressFromIfName (const char *ifName); static void InitiateShutdown (int); static void Shutdown (int); static void RefreshAddr (int); @@ -156,6 +156,7 @@ int main (int argc, char** argv) struct sockaddr_in addr; fd_set readMask; int fdMax; + int rval; /* * Initialize packet aliasing software. * Done already here to be able to alter option bits @@ -301,8 +302,17 @@ int main (int argc, char** argv) mip->assignAliasAddr = 1; } - else - SetAliasAddressFromIfName (mip->ifName); + else { + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) + sleep(1); + } while (rval == EAGAIN); + if (rval != 0) + exit(1); + } } } @@ -531,7 +541,8 @@ static void DoGlobal (int fd) #if 0 if (mip->assignAliasAddr) { - SetAliasAddressFromIfName (mip->ifName); + if (SetAliasAddressFromIfName (mip->ifName) != 0) + exit(1); mip->assignAliasAddr = 0; } #endif @@ -634,10 +645,18 @@ static void DoAliasing (int fd, int dire socklen_t addrSize; struct ip* ip; char msgBuf[80]; + int rval; if (mip->assignAliasAddr) { - - SetAliasAddressFromIfName (mip->ifName); + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) + sleep(1); + } while (rval == EAGAIN); + if (rval != 0) + exit(1); mip->assignAliasAddr = 0; } /* @@ -867,7 +886,7 @@ static char* FormatPacket (struct ip* ip return buf; } -static void +static int SetAliasAddressFromIfName(const char *ifn) { size_t needed; @@ -951,14 +970,19 @@ SetAliasAddressFromIfName(const char *if } } } - if (sin == NULL) - errx(1, "%s: cannot get interface address", ifn); + if (sin == NULL) { + warnx("%s: cannot get interface address", ifn); + free(buf); + return EAGAIN; + } LibAliasSetAddress(mla, sin->sin_addr); syslog(LOG_INFO, "Aliasing to %s, mtu %d bytes", inet_ntoa(sin->sin_addr), mip->ifMTU); free(buf); + + return 0; } void Quit (const char* msg) From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 18:27:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DE2B1065670; Sun, 24 Jul 2011 18:27:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C06F8FC20; Sun, 24 Jul 2011 18:27:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OIR9pl019531; Sun, 24 Jul 2011 18:27:09 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OIR9Tj019524; Sun, 24 Jul 2011 18:27:09 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201107241827.p6OIR9Tj019524@svn.freebsd.org> From: Kirk McKusick Date: Sun, 24 Jul 2011 18:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224294 - in head: sbin/mount sys/kern sys/sys sys/ufs/ffs sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 18:27:10 -0000 Author: mckusick Date: Sun Jul 24 18:27:09 2011 New Revision: 224294 URL: http://svn.freebsd.org/changeset/base/224294 Log: Move the MNTK_SUJ flag in mnt_kern_flag to MNT_SUJ in mnt_flag so that it is visible to userland programs. This change enables the `mount' command with no arguments to be able to show if a filesystem is mounted using journaled soft updates as opposed to just normal soft updates. Approved by: re (bz) Modified: head/sbin/mount/mount.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/inode.h Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sun Jul 24 18:16:14 2011 (r224293) +++ head/sbin/mount/mount.c Sun Jul 24 18:27:09 2011 (r224294) @@ -109,6 +109,7 @@ static struct opt { { MNT_NOCLUSTERW, "noclusterw" }, { MNT_SUIDDIR, "suiddir" }, { MNT_SOFTDEP, "soft-updates" }, + { MNT_SUJ, "journaled soft-updates" }, { MNT_MULTILABEL, "multilabel" }, { MNT_ACLS, "acls" }, { MNT_NFS4ACLS, "nfsv4acls" }, @@ -316,7 +317,7 @@ main(int argc, char *argv[]) rval = 0; switch (argc) { case 0: - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) + if ((mntsize = getmntinfo(&mntbuf, MNT_WAIT)) == 0) err(1, "getmntinfo"); if (all) { while ((fs = getfsent()) != NULL) { @@ -665,7 +666,7 @@ getmntpt(const char *name) struct statfs *mntbuf; int i, mntsize; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + mntsize = getmntinfo(&mntbuf, MNT_WAIT); for (i = mntsize - 1; i >= 0; i--) { if (strcmp(mntbuf[i].f_mntfromname, name) == 0 || strcmp(mntbuf[i].f_mntonname, name) == 0) Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jul 24 18:16:14 2011 (r224293) +++ head/sys/kern/vfs_subr.c Sun Jul 24 18:27:09 2011 (r224294) @@ -2841,6 +2841,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_ASYNC); MNT_FLAG(MNT_SUIDDIR); MNT_FLAG(MNT_SOFTDEP); + MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_NOSYMFOLLOW); MNT_FLAG(MNT_GJOURNAL); MNT_FLAG(MNT_MULTILABEL); @@ -2866,7 +2867,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_FORCE); MNT_FLAG(MNT_SNAPSHOT); MNT_FLAG(MNT_BYFSID); - MNT_FLAG(MNT_SOFTDEP); #undef MNT_FLAG if (flags != 0) { if (buf[0] != '\0') @@ -2894,7 +2894,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); - MNT_KERN_FLAG(MNTK_SUJ); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); MNT_KERN_FLAG(MNTK_SUSPEND); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Jul 24 18:16:14 2011 (r224293) +++ head/sys/sys/mount.h Sun Jul 24 18:27:09 2011 (r224294) @@ -239,6 +239,7 @@ void __mnt_vnode_markerfree(str #define MNT_NOATIME 0x0000000010000000ULL /* dont update file access time */ #define MNT_NOCLUSTERR 0x0000000040000000ULL /* disable cluster read */ #define MNT_NOCLUSTERW 0x0000000080000000ULL /* disable cluster write */ +#define MNT_SUJ 0x0000000100000000ULL /* using journaled soft updates */ /* * NFS export related mount flags. @@ -267,7 +268,7 @@ void __mnt_vnode_markerfree(str * but the 'mount' program may need changing to handle this. */ #define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | \ - MNT_NOSUID | MNT_UNION | \ + MNT_NOSUID | MNT_UNION | MNT_SUJ | \ MNT_ASYNC | MNT_EXRDONLY | MNT_EXPORTED | \ MNT_DEFEXPORTED | MNT_EXPORTANON| MNT_EXKERB | \ MNT_LOCAL | MNT_USER | MNT_QUOTA | \ @@ -324,7 +325,6 @@ void __mnt_vnode_markerfree(str #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ -#define MNTK_SUJ 0x00000100 /* Softdep journaling enabled */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Jul 24 18:16:14 2011 (r224293) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Jul 24 18:27:09 2011 (r224294) @@ -2423,11 +2423,11 @@ softdep_unmount(mp) MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_SOFTDEP; - if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) { + if ((mp->mnt_flag & MNT_SUJ) == 0) { MNT_IUNLOCK(mp); return; } - mp->mnt_kern_flag &= ~MNTK_SUJ; + mp->mnt_flag &= ~MNT_SUJ; MNT_IUNLOCK(mp); journal_unmount(mp); } @@ -2637,7 +2637,7 @@ journal_mount(mp, fs, cred) out: if (error == 0) { MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_SUJ; + mp->mnt_flag |= MNT_SUJ; MNT_IUNLOCK(mp); /* * Only validate the journal contents if the @@ -3060,7 +3060,7 @@ softdep_flushjournal(mp) struct jblocks *jblocks; struct ufsmount *ump; - if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) + if ((mp->mnt_flag & MNT_SUJ) == 0) return; ump = VFSTOUFS(mp); jblocks = ump->softdep_jblocks; @@ -3096,7 +3096,7 @@ softdep_process_journal(mp, needwk, flag int off; int devbsize; - if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) + if ((mp->mnt_flag & MNT_SUJ) == 0) return; ump = VFSTOUFS(mp); fs = ump->um_fs; @@ -3827,7 +3827,7 @@ newfreework(ump, freeblks, parent, lbn, freework->fw_blkno = nb; freework->fw_frags = frags; freework->fw_indir = NULL; - freework->fw_ref = ((UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ) == 0 || + freework->fw_ref = ((UFSTOVFS(ump)->mnt_flag & MNT_SUJ) == 0 || lbn >= -NXADDR) ? 0 : NINDIR(ump->um_fs) + 1; freework->fw_start = freework->fw_off = off; if (journal) @@ -4681,7 +4681,7 @@ softdep_setup_inomapdep(bp, ip, newinum, * Allocate the journal reference add structure so that the bitmap * can be dependent on it. */ - if (mp->mnt_kern_flag & MNTK_SUJ) { + if (mp->mnt_flag & MNT_SUJ) { jaddref = newjaddref(ip, newinum, 0, 0, mode); jaddref->ja_state |= NEWBLOCK; } @@ -4734,7 +4734,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno * Add it to the dependency list for the buffer holding * the cylinder group map from which it was allocated. */ - if (mp->mnt_kern_flag & MNTK_SUJ) { + if (mp->mnt_flag & MNT_SUJ) { jnewblk = malloc(sizeof(*jnewblk), M_JNEWBLK, M_SOFTDEP_FLAGS); workitem_alloc(&jnewblk->jn_list, D_JNEWBLK, mp); jnewblk->jn_jsegdep = newjsegdep(&jnewblk->jn_list); @@ -5199,7 +5199,7 @@ newfreefrag(ip, blkno, size, lbn) freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; - if ((ip->i_ump->um_mountp->mnt_kern_flag & MNTK_SUJ) != 0) { + if ((ip->i_ump->um_mountp->mnt_flag & MNT_SUJ) != 0) { freefrag->ff_jdep = (struct worklist *) newjfreefrag(freefrag, ip, blkno, size, lbn); } else { @@ -7254,7 +7254,7 @@ freework_freeblock(freework) freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; - needj = freeblks->fb_list.wk_mp->mnt_kern_flag & MNTK_SUJ; + needj = (freeblks->fb_list.wk_mp->mnt_flag & MNT_SUJ) != 0; bsize = lfragtosize(fs, freework->fw_frags); LIST_INIT(&wkhd); /* @@ -7674,7 +7674,7 @@ indir_trunc(freework, dbn, lbn) ufs1fmt = 0; } level = lbn_level(lbn); - needj = UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ; + needj = (UFSTOVFS(ump)->mnt_flag & MNT_SUJ) != 0; lbnadd = lbn_offset(fs, level); nblocks = btodb(fs->fs_bsize); nfreework = freework; @@ -7860,7 +7860,7 @@ setup_newdir(dap, newinum, dinum, newdir mkdir2->md_state = ATTACHED | MKDIR_PARENT; mkdir2->md_diradd = dap; mkdir2->md_jaddref = NULL; - if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) { + if ((mp->mnt_flag & MNT_SUJ) == 0) { mkdir1->md_state |= DEPCOMPLETE; mkdir2->md_state |= DEPCOMPLETE; } @@ -7900,7 +7900,7 @@ setup_newdir(dap, newinum, dinum, newdir * been satisfied and mkdir2 can be freed. */ inodedep_lookup(mp, dinum, 0, &inodedep); - if (mp->mnt_kern_flag & MNTK_SUJ) { + if (mp->mnt_flag & MNT_SUJ) { if (inodedep == NULL) panic("setup_newdir: Lost parent."); jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -8031,7 +8031,7 @@ softdep_setup_directory_add(bp, dp, diro * written place it on the bufwait list, otherwise do the post-inode * write processing to put it on the id_pendinghd list. */ - if (mp->mnt_kern_flag & MNTK_SUJ) { + if (mp->mnt_flag & MNT_SUJ) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, inoreflst); KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, @@ -8047,7 +8047,7 @@ softdep_setup_directory_add(bp, dp, diro * Add the journal entries for . and .. links now that the primary * link is written. */ - if (mkdir1 != NULL && mp->mnt_kern_flag & MNTK_SUJ) { + if (mkdir1 != NULL && (mp->mnt_flag & MNT_SUJ)) { jaddref = (struct jaddref *)TAILQ_PREV(&jaddref->ja_ref, inoreflst, if_deps); KASSERT(jaddref != NULL && @@ -8144,7 +8144,7 @@ softdep_change_directoryentry_offset(bp, * determine if any affected adds or removes are present in the * journal. */ - if (mp->mnt_kern_flag & MNTK_SUJ) { + if (mp->mnt_flag & MNT_SUJ) { flags = DEPALLOC; jmvref = newjmvref(dp, de->d_ino, dp->i_offset + (oldloc - base), @@ -8865,7 +8865,7 @@ softdep_setup_directory_change(bp, dp, i * processing to put it on the id_pendinghd list. */ inodedep_lookup(mp, newinum, DEPALLOC, &inodedep); - if (mp->mnt_kern_flag & MNTK_SUJ) { + if (mp->mnt_flag & MNT_SUJ) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, inoreflst); KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, @@ -8928,7 +8928,7 @@ softdep_setup_sbupdate(ump, fs, bp) struct sbdep *sbdep; struct worklist *wk; - if ((ump->um_mountp->mnt_kern_flag & MNTK_SUJ) == 0) + if ((ump->um_mountp->mnt_flag & MNT_SUJ) == 0) return; LIST_FOREACH(wk, &bp->b_dep, wk_list) if (wk->wk_type == D_SBDEP) @@ -9046,7 +9046,7 @@ unlinked_inodedep(mp, inodedep) { struct ufsmount *ump; - if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) + if ((mp->mnt_flag & MNT_SUJ) == 0) return; ump = VFSTOUFS(mp); ump->um_fs->fs_fmod = 1; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Jul 24 18:16:14 2011 (r224293) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Jul 24 18:27:09 2011 (r224294) @@ -1389,6 +1389,9 @@ ffs_statfs(mp, sbp) fs = ump->um_fs; if (fs->fs_magic != FS_UFS1_MAGIC && fs->fs_magic != FS_UFS2_MAGIC) panic("ffs_statfs"); + /* Don't export MNT_SOFTDEP when MNT_SUJ is in use */ + if ((sbp->f_flags & (MNT_SOFTDEP | MNT_SUJ)) == (MNT_SOFTDEP | MNT_SUJ)) + sbp->f_flags &= ~MNT_SOFTDEP; sbp->f_version = STATFS_VERSION; sbp->f_bsize = fs->fs_fsize; sbp->f_iosize = fs->fs_bsize; Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Sun Jul 24 18:16:14 2011 (r224293) +++ head/sys/ufs/ufs/inode.h Sun Jul 24 18:27:09 2011 (r224294) @@ -176,7 +176,7 @@ struct indir { /* Determine if soft dependencies are being done */ #define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & MNT_SOFTDEP) #define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) -#define DOINGSUJ(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_SUJ) +#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) /* This overlays the fid structure (see mount.h). */ struct ufid { From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 19:13:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F3A91065670; Sun, 24 Jul 2011 19:13:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E87D8FC13; Sun, 24 Jul 2011 19:13:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OJDsK2021010; Sun, 24 Jul 2011 19:13:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OJDse4021008; Sun, 24 Jul 2011 19:13:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201107241913.p6OJDse4021008@svn.freebsd.org> From: Ed Schouten Date: Sun, 24 Jul 2011 19:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224295 - stable/8/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 19:13:55 -0000 Author: ed Date: Sun Jul 24 19:13:54 2011 New Revision: 224295 URL: http://svn.freebsd.org/changeset/base/224295 Log: MFC r223744: Improve portability of config(8). - Use strlen(dp->d_name) instead of the unportable dp->d_namlen. Rename i to len to make it slightly more descriptive and prevent negative indexing of the array. - Replace index() by strchr(). This supposedly fixes compilation on GNU systems. Submitted by: Robert Millan (original patch) Modified: stable/8/usr.sbin/config/main.c Directory Properties: stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) Modified: stable/8/usr.sbin/config/main.c ============================================================================== --- stable/8/usr.sbin/config/main.c Sun Jul 24 18:27:09 2011 (r224294) +++ stable/8/usr.sbin/config/main.c Sun Jul 24 19:13:54 2011 (r224295) @@ -604,7 +604,7 @@ cleanheaders(char *p) struct dirent *dp; struct file_list *fl; struct hdr_list *hl; - int i; + size_t len; remember("y.tab.h"); remember("setdefs.h"); @@ -618,12 +618,13 @@ cleanheaders(char *p) if ((dirp = opendir(p)) == NULL) err(EX_OSERR, "opendir %s", p); while ((dp = readdir(dirp)) != NULL) { - i = dp->d_namlen - 2; + len = strlen(dp->d_name); /* Skip non-headers */ - if (dp->d_name[i] != '.' || dp->d_name[i + 1] != 'h') + if (len < 2 || dp->d_name[len - 2] != '.' || + dp->d_name[len - 1] != 'h') continue; /* Skip special stuff, eg: bus_if.h, but check opt_*.h */ - if (index(dp->d_name, '_') && + if (strchr(dp->d_name, '_') && strncmp(dp->d_name, "opt_", 4) != 0) continue; /* Check if it is a target file */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 19:19:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950F0106564A; Sun, 24 Jul 2011 19:19:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 847FC8FC16; Sun, 24 Jul 2011 19:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OJJocK021243; Sun, 24 Jul 2011 19:19:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OJJomX021241; Sun, 24 Jul 2011 19:19:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201107241919.p6OJJomX021241@svn.freebsd.org> From: Ed Schouten Date: Sun, 24 Jul 2011 19:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224296 - stable/8/usr.bin/lock X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 19:19:50 -0000 Author: ed Date: Sun Jul 24 19:19:50 2011 New Revision: 224296 URL: http://svn.freebsd.org/changeset/base/224296 Log: MFC r216696 and r216737: Slightly improve output of lock(1). - Remove the /dev/ portion of the TTY name. - In case we use lock -p, print the username that was used to obtain the password hash. Modified: stable/8/usr.bin/lock/lock.c Directory Properties: stable/8/usr.bin/lock/ (props changed) Modified: stable/8/usr.bin/lock/lock.c ============================================================================== --- stable/8/usr.bin/lock/lock.c Sun Jul 24 19:13:54 2011 (r224295) +++ stable/8/usr.bin/lock/lock.c Sun Jul 24 19:19:50 2011 (r224296) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -102,6 +103,7 @@ main(int argc, char **argv) openlog("lock", LOG_ODELAY, LOG_AUTH); sectimeout = TIMEOUT; + pw = NULL; mypw = NULL; usemine = 0; no_timeout = 0; @@ -137,6 +139,8 @@ main(int argc, char **argv) gethostname(hostname, sizeof(hostname)); if (!(ttynam = ttyname(0))) errx(1, "not a terminal?"); + if (strncmp(ttynam, _PATH_DEV, strlen(_PATH_DEV)) == 0) + ttynam += strlen(_PATH_DEV); if (gettimeofday(&timval, (struct timezone *)NULL)) err(1, "gettimeofday"); nexttime = timval.tv_sec + (sectimeout * 60); @@ -196,7 +200,11 @@ main(int argc, char **argv) } /* header info */ - (void)printf("lock: %s on %s.", ttynam, hostname); + if (pw != NULL) + (void)printf("lock: %s using %s on %s.", pw->pw_name, + ttynam, hostname); + else + (void)printf("lock: %s on %s.", ttynam, hostname); if (no_timeout) (void)printf(" no timeout."); else From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 20:09:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6992F106566B; Sun, 24 Jul 2011 20:09:43 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573308FC1A; Sun, 24 Jul 2011 20:09:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6OK9hYx022788; Sun, 24 Jul 2011 20:09:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6OK9hMg022774; Sun, 24 Jul 2011 20:09:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107242009.p6OK9hMg022774@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Jul 2011 20:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224297 - in stable/8: lib/libc/gen lib/libc/sys usr.bin/lastcomm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 20:09:43 -0000 Author: jilles Date: Sun Jul 24 20:09:42 2011 New Revision: 224297 URL: http://svn.freebsd.org/changeset/base/224297 Log: MFC r207735: Update xrefs from 4.3BSD to modern signal functions in various man pages. sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2). Some legacy man pages still refer to them, that is OK. Modified: stable/8/lib/libc/gen/alarm.3 stable/8/lib/libc/gen/siginterrupt.3 stable/8/lib/libc/gen/ualarm.3 stable/8/lib/libc/sys/execve.2 stable/8/lib/libc/sys/fcntl.2 stable/8/lib/libc/sys/getitimer.2 stable/8/lib/libc/sys/getrlimit.2 stable/8/lib/libc/sys/sigaction.2 stable/8/lib/libc/sys/sigreturn.2 stable/8/lib/libc/sys/vfork.2 stable/8/usr.bin/lastcomm/lastcomm.1 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) Modified: stable/8/lib/libc/gen/alarm.3 ============================================================================== --- stable/8/lib/libc/gen/alarm.3 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/gen/alarm.3 Sun Jul 24 20:09:42 2011 (r224297) @@ -76,8 +76,7 @@ If no alarm is currently set, the return .Sh SEE ALSO .Xr setitimer 2 , .Xr sigaction 2 , -.Xr sigpause 2 , -.Xr sigvec 2 , +.Xr sigsuspend 2 , .Xr signal 3 , .Xr sleep 3 , .Xr ualarm 3 , Modified: stable/8/lib/libc/gen/siginterrupt.3 ============================================================================== --- stable/8/lib/libc/gen/siginterrupt.3 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/gen/siginterrupt.3 Sun Jul 24 20:09:42 2011 (r224297) @@ -109,9 +109,8 @@ is not a valid signal number. .El .Sh SEE ALSO .Xr sigaction 2 , -.Xr sigblock 2 , -.Xr sigpause 2 , -.Xr sigsetmask 2 , +.Xr sigprocmask 2 , +.Xr sigsuspend 2 , .Xr signal 3 .Sh HISTORY The Modified: stable/8/lib/libc/gen/ualarm.3 ============================================================================== --- stable/8/lib/libc/gen/ualarm.3 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/gen/ualarm.3 Sun Jul 24 20:09:42 2011 (r224297) @@ -84,8 +84,8 @@ A microsecond is 0.000001 seconds. .Sh SEE ALSO .Xr getitimer 2 , .Xr setitimer 2 , -.Xr sigpause 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , +.Xr sigsuspend 2 , .Xr alarm 3 , .Xr signal 3 , .Xr sleep 3 , Modified: stable/8/lib/libc/sys/execve.2 ============================================================================== --- stable/8/lib/libc/sys/execve.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/execve.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -189,8 +189,8 @@ the calling process: .It interval timers Ta see Xr getitimer 2 .It resource limits Ta see Xr getrlimit 2 .It file mode mask Ta see Xr umask 2 -.It signal mask Ta see Xr sigvec 2 , -.Xr sigsetmask 2 +.It signal mask Ta see Xr sigaction 2 , +.Xr sigprocmask 2 .El .Pp When a program is executed as a result of an Modified: stable/8/lib/libc/sys/fcntl.2 ============================================================================== --- stable/8/lib/libc/sys/fcntl.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/fcntl.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -618,7 +618,7 @@ for the reasons as stated in .Xr flock 2 , .Xr getdtablesize 2 , .Xr open 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr lockf 3 , .Xr tcgetpgrp 3 , .Xr tcsetpgrp 3 Modified: stable/8/lib/libc/sys/getitimer.2 ============================================================================== --- stable/8/lib/libc/sys/getitimer.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/getitimer.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -171,7 +171,7 @@ to be handled. .Sh SEE ALSO .Xr gettimeofday 2 , .Xr select 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr clocks 7 .Sh HISTORY The Modified: stable/8/lib/libc/sys/getrlimit.2 ============================================================================== --- stable/8/lib/libc/sys/getrlimit.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/getrlimit.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -193,7 +193,7 @@ raised the maximum limit value, and the .Xr quota 1 , .Xr quotactl 2 , .Xr sigaltstack 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr sysctl 3 , .Xr ulimit 3 .Sh HISTORY Modified: stable/8/lib/libc/sys/sigaction.2 ============================================================================== --- stable/8/lib/libc/sys/sigaction.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/sigaction.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -609,13 +609,9 @@ or .Xr kill 2 , .Xr ptrace 2 , .Xr sigaltstack 2 , -.Xr sigblock 2 , -.Xr sigpause 2 , .Xr sigpending 2 , .Xr sigprocmask 2 , -.Xr sigsetmask 2 , .Xr sigsuspend 2 , -.Xr sigvec 2 , .Xr wait 2 , .Xr fpsetmask 3 , .Xr setjmp 3 , Modified: stable/8/lib/libc/sys/sigreturn.2 ============================================================================== --- stable/8/lib/libc/sys/sigreturn.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/sigreturn.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -83,7 +83,7 @@ The process status longword is invalid o raise the privilege level of the process. .El .Sh SEE ALSO -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr setjmp 3 , .Xr ucontext 3 .Sh HISTORY Modified: stable/8/lib/libc/sys/vfork.2 ============================================================================== --- stable/8/lib/libc/sys/vfork.2 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/lib/libc/sys/vfork.2 Sun Jul 24 20:09:42 2011 (r224297) @@ -104,7 +104,7 @@ Same as for .Xr _exit 2 , .Xr fork 2 , .Xr rfork 2 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr wait 2 , .Xr exit 3 .Sh HISTORY Modified: stable/8/usr.bin/lastcomm/lastcomm.1 ============================================================================== --- stable/8/usr.bin/lastcomm/lastcomm.1 Sun Jul 24 19:19:50 2011 (r224296) +++ stable/8/usr.bin/lastcomm/lastcomm.1 Sun Jul 24 20:09:42 2011 (r224297) @@ -168,7 +168,7 @@ while will print details of each terminating command. .Sh SEE ALSO .Xr last 1 , -.Xr sigvec 2 , +.Xr sigaction 2 , .Xr acct 5 , .Xr core 5 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 23:43:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67AAB1065672; Sun, 24 Jul 2011 23:43:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56E7D8FC1B; Sun, 24 Jul 2011 23:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ONhebp029102; Sun, 24 Jul 2011 23:43:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ONhexX029100; Sun, 24 Jul 2011 23:43:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107242343.p6ONhexX029100@svn.freebsd.org> From: Doug Barton Date: Sun, 24 Jul 2011 23:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224299 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 23:43:40 -0000 Author: dougb Date: Sun Jul 24 23:43:40 2011 New Revision: 224299 URL: http://svn.freebsd.org/changeset/base/224299 Log: MFC r197728: Add OpenVPN IANA assigned port number. Modified: stable/8/etc/services Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/services ============================================================================== --- stable/8/etc/services Sun Jul 24 23:02:24 2011 (r224298) +++ stable/8/etc/services Sun Jul 24 23:43:40 2011 (r224299) @@ -1533,6 +1533,8 @@ cisco-ipsla 1167/sctp #Cisco IP SLAs Co cisco-ipsla 1167/tcp #Cisco IP SLAs Control Protocol cisco-ipsla 1167/udp #Cisco IP SLAs Control Protocol skkserv 1178/tcp #SKK (kanji input) +openvpn 1194/tcp #OpenVPN +openvpn 1194/udp #OpenVPN lupa 1212/tcp lupa 1212/udp nerv 1222/tcp #SNI R&D network From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 23:44:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15751065674; Sun, 24 Jul 2011 23:44:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0BC58FC0C; Sun, 24 Jul 2011 23:44:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ONiG7R029188; Sun, 24 Jul 2011 23:44:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ONiG3S029186; Sun, 24 Jul 2011 23:44:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107242344.p6ONiG3S029186@svn.freebsd.org> From: Doug Barton Date: Sun, 24 Jul 2011 23:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224300 - stable/7/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 23:44:17 -0000 Author: dougb Date: Sun Jul 24 23:44:16 2011 New Revision: 224300 URL: http://svn.freebsd.org/changeset/base/224300 Log: MFC r197728: Add OpenVPN IANA assigned port number. Modified: stable/7/etc/services Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/services ============================================================================== --- stable/7/etc/services Sun Jul 24 23:43:40 2011 (r224299) +++ stable/7/etc/services Sun Jul 24 23:44:16 2011 (r224300) @@ -1521,6 +1521,8 @@ nfa 1155/tcp #Network File Access nfa 1155/udp #Network File Access phone 1167/udp #conference calling skkserv 1178/tcp #SKK (kanji input) +openvpn 1194/tcp #OpenVPN +openvpn 1194/udp #OpenVPN lupa 1212/tcp lupa 1212/udp nerv 1222/tcp #SNI R&D network From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 00:17:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D877C1065670; Mon, 25 Jul 2011 00:17:20 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C752C8FC12; Mon, 25 Jul 2011 00:17:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P0HK8g030183; Mon, 25 Jul 2011 00:17:20 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P0HKTf030181; Mon, 25 Jul 2011 00:17:20 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107250017.p6P0HKTf030181@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 25 Jul 2011 00:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224301 - stable/8/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 00:17:21 -0000 Author: sobomax Date: Mon Jul 25 00:17:20 2011 New Revision: 224301 URL: http://svn.freebsd.org/changeset/base/224301 Log: MFC: Strip any leading slashes before feeding the label to the geom_label code. Some linux distros put mount point into the ext2fs labels, such as '/', or '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code. Modified: stable/8/sys/geom/label/g_label_ext2fs.c Directory Properties: stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/label/g_label_ext2fs.c ============================================================================== --- stable/8/sys/geom/label/g_label_ext2fs.c Sun Jul 24 23:44:16 2011 (r224300) +++ stable/8/sys/geom/label/g_label_ext2fs.c Mon Jul 25 00:17:20 2011 (r224301) @@ -53,6 +53,7 @@ g_label_ext2fs_taste(struct g_consumer * { struct g_provider *pp; e2sb_t *fs; + char *s_volume_name; g_topology_assert_not(); pp = cp->provider; @@ -74,13 +75,18 @@ g_label_ext2fs_taste(struct g_consumer * goto exit_free; } + s_volume_name = fs->s_volume_name; + /* Terminate label */ + s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; + + if (s_volume_name[0] == '/') + s_volume_name += 1; + /* Check for volume label */ - if (fs->s_volume_name[0] == '\0') + if (s_volume_name[0] == '\0') goto exit_free; - /* Terminate label */ - fs->s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; - strlcpy(label, fs->s_volume_name, size); + strlcpy(label, s_volume_name, size); exit_free: g_free(fs); From owner-svn-src-all@FreeBSD.ORG Sun Jul 24 21:35:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EFB0106566B; Sun, 24 Jul 2011 21:35:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9708FC18; Sun, 24 Jul 2011 21:35:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LOU00000XAS4H00@smtpauth2.wiscmail.wisc.edu>; Sun, 24 Jul 2011 16:35:16 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.68.180]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LOU00CH9XAR6620@smtpauth2.wiscmail.wisc.edu>; Sun, 24 Jul 2011 16:35:15 -0500 (CDT) Date: Sun, 24 Jul 2011 16:35:14 -0500 From: Nathan Whitehorn In-reply-to: <201107191241.p6JCfvqw072816@svn.freebsd.org> To: Attilio Rao Message-id: <4E2C9012.602@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.68.180 X-Spam-PmxInfo: Server=avs-11, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.7.24.212414, SenderIP=76.210.68.180 References: <201107191241.p6JCfvqw072816@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110704 Thunderbird/5.0 X-Mailman-Approved-At: Mon, 25 Jul 2011 00:38:55 +0000 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, FreeBSD Release Engineering Team Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 21:35:17 -0000 On 07/19/11 07:41, Attilio Rao wrote: > Author: attilio > Date: Tue Jul 19 12:41:57 2011 > New Revision: 224216 > URL: http://svn.freebsd.org/changeset/base/224216 > > Log: > On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes > storage. > Fix the sintrcnt/sintrnames specification. > > No MFC is previewed for this patch. > These also need to be .long on 32-bit PowerPC, otherwise this change triggers kernel panics and faults in sysctl. Please change it as quickly as possible. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 01:42:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6334B106566C; Mon, 25 Jul 2011 01:42:52 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 386CF8FC12; Mon, 25 Jul 2011 01:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P1gqq3032693; Mon, 25 Jul 2011 01:42:52 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P1gq5t032691; Mon, 25 Jul 2011 01:42:52 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107250142.p6P1gq5t032691@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 25 Jul 2011 01:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224302 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 01:42:52 -0000 Author: sobomax Date: Mon Jul 25 01:42:51 2011 New Revision: 224302 URL: http://svn.freebsd.org/changeset/base/224302 Log: MFC: re-work dump progress indicator to work better with more than few gigs of RAM. Modified: stable/8/sys/amd64/amd64/minidump_machdep.c Modified: stable/8/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/minidump_machdep.c Mon Jul 25 00:17:20 2011 (r224301) +++ stable/8/sys/amd64/amd64/minidump_machdep.c Mon Jul 25 01:42:51 2011 (r224302) @@ -69,7 +69,7 @@ static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress; +static size_t counter, progress, dumpsize; CTASSERT(sizeof(*vm_page_dump) == 8); @@ -101,6 +101,40 @@ blk_flush(struct dumperinfo *di) return (error); } +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < 10; i++) { + if (sofar < progress_track[i].min_per || sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -137,7 +171,7 @@ blk_write(struct dumperinfo *di, char *p counter += len; progress -= len; if (counter >> 24) { - printf(" %ld", PG2MB(progress >> PAGE_SHIFT)); + report_progress(progress, dumpsize); counter &= (1<<24) - 1; } #ifdef SW_WATCHDOG @@ -180,7 +214,6 @@ static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { - uint64_t dumpsize; uint32_t pmapsize; vm_offset_t va; int error; @@ -300,8 +333,8 @@ minidumpsys(struct dumperinfo *di) mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump leader */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 02:27:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5FA91065670; Mon, 25 Jul 2011 02:27:38 +0000 (UTC) (envelope-from prvs=1180d2598a=brian@Awfulhak.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 723E88FC0C; Mon, 25 Jul 2011 02:27:38 +0000 (UTC) Received: from pd6ml2no-ssvc.prod.shaw.ca ([10.0.153.163]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 24 Jul 2011 20:12:36 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=Mj7okGGiyvljez8nourwAOSCyIXzraNcHEi86Qy5a+Y= c=1 sm=1 a=wom5GMh1gUkA:10 a=J1aGlPMB6iMA:10 a=dBRESv0yCI8A:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=cmB/9TsswV7PJ0tytqGp1Q==:17 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=3pS6OY6mvVe0ZjVZ7A4A:9 a=CjuIK1q_8ugA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=MmZFRhEyO09k63mk:21 a=sJ8ujE9dZp4tHHAS:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.183.1]) by pd6ml2no-dmz.prod.shaw.ca with ESMTP; 24 Jul 2011 20:12:36 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 2AE11C433AB_E2CD114B; Mon, 25 Jul 2011 02:12:36 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 2AFFDC46106_E2CD112F; Mon, 25 Jul 2011 02:12:34 +0000 (GMT) Received: from thong.lan.Awfulhak.org (thong.lan.Awfulhak.org [172.16.0.31]) by gw.Awfulhak.org (8.14.5/8.14.5) with ESMTP id p6P2CY9e035062; Sun, 24 Jul 2011 19:12:34 -0700 (PDT) (envelope-from brian@lan.Awfulhak.org) Received: from thong.lan.Awfulhak.org (localhost [127.0.0.1]) by thong.lan.Awfulhak.org (8.14.5/8.14.5) with ESMTP id p6P2CXYW005777; Sun, 24 Jul 2011 19:12:33 -0700 (PDT) (envelope-from brian@thong.lan.Awfulhak.org) Received: (from brian@localhost) by thong.lan.Awfulhak.org (8.14.5/8.14.5/Submit) id p6P2CXjV005776; Sun, 24 Jul 2011 19:12:33 -0700 (PDT) (envelope-from brian) Date: Sun, 24 Jul 2011 19:12:33 -0700 From: Brian Somers To: Maxim Sobolev Message-ID: <20110725021233.GA2047@thong.lan.Awfulhak.org> References: <201107241803.p6OI32ST018756@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107241803.p6OI32ST018756@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224292 - stable/8/sbin/natd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 02:27:39 -0000 On Sun, Jul 24, 2011 at 06:03:02PM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Sun Jul 24 18:03:02 2011 > New Revision: 224292 > URL: http://svn.freebsd.org/changeset/base/224292 > > Log: > MFC: 220736, 220806, 220808 > > If we can retrieve interface address sleep for one second and try again. > This can happen during start-up, when natd starts before dhclient has a > chance to receive IP address from the upstream provider. Do this only in > background, dynamic mode. > > Reminded by: brian [.....] Thanks :*) -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 07:45:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 984CF106564A; Mon, 25 Jul 2011 07:45:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 865158FC0A; Mon, 25 Jul 2011 07:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P7jM49043715; Mon, 25 Jul 2011 07:45:22 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P7jMQX043712; Mon, 25 Jul 2011 07:45:22 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201107250745.p6P7jMQX043712@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 25 Jul 2011 07:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224306 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 07:45:22 -0000 Author: sobomax Date: Mon Jul 25 07:45:22 2011 New Revision: 224306 URL: http://svn.freebsd.org/changeset/base/224306 Log: MFC: Add new modifier - "R", path to executable to run after rotatiion instead of sending signal. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 25 07:14:59 2011 (r224305) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 25 07:45:22 2011 (r224306) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); /* process when trimming this file. */ #define CE_CREATE 0x0100 /* Create the log file if it does not exist. */ #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ +#define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -154,7 +155,7 @@ const struct compress_types compress_typ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ - char *pid_file; /* PID file */ + char *pid_cmd_file; /* PID or command file */ char *r_reason; /* The reason this file is being rotated */ int firstcreate; /* Creating log for the first time (-C). */ int rotate; /* Non-zero if this file should be rotated */ @@ -178,7 +179,8 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_t sw_pid; /* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - char sw_fname[1]; /* file the PID was read from */ + int run_cmd; /* run command or send PID to signal */ + char sw_fname[1]; /* file the PID was read from or shell cmd */ }; struct zipwork_entry { @@ -384,9 +386,9 @@ init_entry(const char *fname, struct con err(1, "strdup for %s", fname); if (src_entry != NULL) { - tempwork->pid_file = NULL; - if (src_entry->pid_file) - tempwork->pid_file = strdup(src_entry->pid_file); + tempwork->pid_cmd_file = NULL; + if (src_entry->pid_cmd_file) + tempwork->pid_cmd_file = strdup(src_entry->pid_cmd_file); tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -406,7 +408,7 @@ init_entry(const char *fname, struct con tempwork->def_cfg = src_entry->def_cfg; } else { /* Initialize as a "do-nothing" entry */ - tempwork->pid_file = NULL; + tempwork->pid_cmd_file = NULL; tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -441,9 +443,9 @@ free_entry(struct conf_entry *ent) ent->log = NULL; } - if (ent->pid_file != NULL) { - free(ent->pid_file); - ent->pid_file = NULL; + if (ent->pid_cmd_file != NULL) { + free(ent->pid_cmd_file); + ent->pid_cmd_file = NULL; } if (ent->r_reason != NULL) { @@ -1291,6 +1293,9 @@ no_trimat: case 'n': working->flags |= CE_NOSIGNAL; break; + case 'r': + working->flags |= CE_PID2CMD; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; @@ -1324,10 +1329,10 @@ no_trimat: *parse = '\0'; } - working->pid_file = NULL; + working->pid_cmd_file = NULL; if (q && *q) { if (*q == '/') - working->pid_file = strdup(q); + working->pid_cmd_file = strdup(q); else if (isdigit(*q)) goto got_sig; else @@ -1364,16 +1369,16 @@ no_trimat: if ((working->flags & CE_NOSIGNAL) == CE_NOSIGNAL) { /* * This config-entry specified 'n' for nosignal, - * see if it also specified an explicit pid_file. + * see if it also specified an explicit pid_cmd_file. * This would be a pretty pointless combination. */ - if (working->pid_file != NULL) { + if (working->pid_cmd_file != NULL) { warnx("Ignoring '%s' because flag 'n' was specified in line:\n%s", - working->pid_file, errline); - free(working->pid_file); - working->pid_file = NULL; + working->pid_cmd_file, errline); + free(working->pid_cmd_file); + working->pid_cmd_file = NULL; } - } else if (working->pid_file == NULL) { + } else if (working->pid_cmd_file == NULL) { /* * This entry did not specify the 'n' flag, which * means it should signal syslogd unless it had @@ -1388,7 +1393,7 @@ no_trimat: working->flags &= ~CE_SIGNALGROUP; } if (needroot) - working->pid_file = strdup(path_syslogpid); + working->pid_cmd_file = strdup(path_syslogpid); } /* @@ -1795,7 +1800,7 @@ do_rotate(const struct conf_entry *ent) * multiple log files had to be rotated. */ swork = NULL; - if (ent->pid_file != NULL) + if (ent->pid_cmd_file != NULL) swork = save_sigwork(ent); if (ent->numlogs > 0 && ent->compress > COMPRESS_NONE) { /* @@ -1814,6 +1819,7 @@ do_sigwork(struct sigwork_entry *swork) { struct sigwork_entry *nextsig; int kres, secs; + char *tmp; if (!(swork->sw_pidok) || swork->sw_pid == 0) return; /* no work to do... */ @@ -1856,6 +1862,24 @@ do_sigwork(struct sigwork_entry *swork) return; } + if (swork->run_cmd) { + asprintf(&tmp, "%s %d", swork->sw_fname, swork->sw_signum); + if (tmp == NULL) { + warn("can't allocate memory to run %s", + swork->sw_fname); + return; + } + if (verbose) + printf("Run command: %s\n", tmp); + kres = system(tmp); + if (kres) { + warnx("%s: returned non-zero exit code: %d", + tmp, kres); + } + free(tmp); + return; + } + kres = kill(swork->sw_pid, swork->sw_signum); if (kres != 0) { /* @@ -1984,7 +2008,7 @@ save_sigwork(const struct conf_entry *en sprev = NULL; ndiff = 1; SLIST_FOREACH(stmp, &swhead, sw_nextp) { - ndiff = strcmp(ent->pid_file, stmp->sw_fname); + ndiff = strcmp(ent->pid_cmd_file, stmp->sw_fname); if (ndiff > 0) break; if (ndiff == 0) { @@ -2000,11 +2024,18 @@ save_sigwork(const struct conf_entry *en if (stmp != NULL && ndiff == 0) return (stmp); - tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_file) + 1; + tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - set_swpid(stmp, ent); + + stmp->run_cmd = 0; + /* If this is a command to run we just set the flag and run command */ + if (ent->flags & CE_PID2CMD) { + stmp->run_cmd = 1; + } else { + set_swpid(stmp, ent); + } stmp->sw_signum = ent->sig; - strcpy(stmp->sw_fname, ent->pid_file); + strcpy(stmp->sw_fname, ent->pid_cmd_file); if (sprev == NULL) SLIST_INSERT_HEAD(&swhead, stmp, sw_nextp); else @@ -2081,7 +2112,7 @@ set_swpid(struct sigwork_entry *swork, c swork->sw_pidtype = "process-group"; } - f = fopen(ent->pid_file, "r"); + f = fopen(ent->pid_cmd_file, "r"); if (f == NULL) { if (errno == ENOENT && enforcepid == 0) { /* @@ -2092,9 +2123,9 @@ set_swpid(struct sigwork_entry *swork, c * files that the process would have been using. */ swork->sw_pidok = 1; - warnx("pid file doesn't exist: %s", ent->pid_file); + warnx("pid file doesn't exist: %s", ent->pid_cmd_file); } else - warn("can't open pid file: %s", ent->pid_file); + warn("can't open pid file: %s", ent->pid_cmd_file); return; } @@ -2107,9 +2138,9 @@ set_swpid(struct sigwork_entry *swork, c */ if (feof(f) && enforcepid == 0) { swork->sw_pidok = 1; - warnx("pid file is empty: %s", ent->pid_file); + warnx("pid/cmd file is empty: %s", ent->pid_cmd_file); } else - warn("can't read from pid file: %s", ent->pid_file); + warn("can't read from pid file: %s", ent->pid_cmd_file); (void)fclose(f); return; } @@ -2122,10 +2153,10 @@ set_swpid(struct sigwork_entry *swork, c rval = strtol(linep, &endp, 10); if (*endp != '\0' && !isspacech(*endp)) { warnx("pid file does not start with a valid number: %s", - ent->pid_file); + ent->pid_cmd_file); } else if (rval < minok || rval > maxok) { warnx("bad value '%ld' for process number in %s", - rval, ent->pid_file); + rval, ent->pid_cmd_file); if (verbose) warnx("\t(expecting value between %ld and %ld)", minok, maxok); Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Jul 25 07:14:59 2011 (r224305) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Jul 25 07:45:22 2011 (r224306) @@ -301,9 +301,16 @@ log file using .It Cm N indicates that there is no process which needs to be signaled when this log file is rotated. +.It Cm R +if this flag is set the +.Xr newsyslog 8 +will run executable defined in +.Ar path_to_pid_cmd_file +after rotation instead of trying to send signal to a process id +stored in the file. .It Cm U indicates that the file specified by -.Ar path_to_pid_file +.Ar path_to_pid_cmd_file will contain the ID for a process group instead of a process. This option also requires that the first line in that file be a negative value to distinguish it from a process ID. @@ -319,7 +326,7 @@ can be used as a placeholder to create a .Ar flags field when you need to specify any of the following fields. .El -.It Ar path_to_pid_file +.It Ar path_to_pid_cmd_file This optional field specifies the file name containing a daemon's process ID or to find a group process ID if the .Cm U @@ -340,6 +347,12 @@ switch. This field must start with .Ql / in order to be recognized properly. +When used with the +.Cm R +flag, the file is treated as a path to a binary to be executed +by the +.Xr newsyslog 8 +after rotation instead of sending the signal out. .It Ar signal_number This optional field specifies the signal number that will be sent to the daemon process (or to all processes in a process group, if the From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 09:12:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D495106566B; Mon, 25 Jul 2011 09:12:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 632D08FC15; Mon, 25 Jul 2011 09:12:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6P9CnnL046306; Mon, 25 Jul 2011 09:12:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6P9Cn0m046298; Mon, 25 Jul 2011 09:12:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107250912.p6P9Cn0m046298@svn.freebsd.org> From: Andriy Gapon Date: Mon, 25 Jul 2011 09:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224307 - in head/sys: conf kern netgraph sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 09:12:49 -0000 Author: avg Date: Mon Jul 25 09:12:48 2011 New Revision: 224307 URL: http://svn.freebsd.org/changeset/base/224307 Log: remove RESTARTABLE_PANICS option This is done per request/suggestion from John Baldwin who introduced the option. Trying to resume normal system operation after a panic is very unpredictable and dangerous. It will become even more dangerous when we allow a thread in panic(9) to penetrate all lock contexts. I understand that the only purpose of this option was for testing scenarios potentially resulting in panic. Suggested by: jhb Reviewed by: attilio, jhb X-MFC-After: never Approved by: re (kib) Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_shutdown.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_mppc.c head/sys/netgraph/ng_parse.c head/sys/sys/systm.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/conf/NOTES Mon Jul 25 09:12:48 2011 (r224307) @@ -499,16 +499,6 @@ options DIAGNOSTIC options REGRESSION # -# RESTARTABLE_PANICS allows one to continue from a panic as if it were -# a call to the debugger to continue from a panic as instead. It is only -# useful if a kernel debugger is present. To restart from a panic, reset -# the panicstr variable to NULL and continue execution. This option is -# for development use only and should NOT be used in production systems -# to "workaround" a panic. -# -#options RESTARTABLE_PANICS - -# # This option lets some drivers co-exist that can't co-exist in a running # system. This is used to be able to compile all kernel code in one go for # quality assurance purposes (like this file, which the option takes it name Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/conf/options Mon Jul 25 09:12:48 2011 (r224307) @@ -579,7 +579,6 @@ LOCK_PROFILING opt_global.h LOCK_PROFILING_FAST opt_global.h MSIZE opt_global.h REGRESSION opt_global.h -RESTARTABLE_PANICS opt_global.h RWLOCK_NOINLINE opt_global.h SX_NOINLINE opt_global.h VFS_BIO_DEBUG opt_global.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/kern/kern_shutdown.c Mon Jul 25 09:12:48 2011 (r224307) @@ -585,15 +585,6 @@ panic(const char *fmt, ...) kdb_backtrace(); if (debugger_on_panic) kdb_enter(KDB_WHY_PANIC, "panic"); -#ifdef RESTARTABLE_PANICS - /* See if the user aborted the panic, in which case we continue. */ - if (panicstr == NULL) { -#ifdef SMP - atomic_store_rel_int(&panic_cpu, NOCPU); -#endif - return; - } -#endif #endif /*thread_lock(td); */ td->td_flags |= TDF_INPANIC; Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/netgraph/ng_ether.c Mon Jul 25 09:12:48 2011 (r224307) @@ -604,9 +604,6 @@ ng_ether_rcvdata(hook_p hook, item_p ite NG_FREE_ITEM(item); panic("%s: weird hook", __func__); -#ifdef RESTARTABLE_PANICS /* so we don't get an error msg in LINT */ - return (0); -#endif } /* Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/netgraph/ng_mppc.c Mon Jul 25 09:12:48 2011 (r224307) @@ -404,9 +404,6 @@ ng_mppc_rcvdata(hook_p hook, item_p item /* Oops */ panic("%s: unknown hook", __func__); -#ifdef RESTARTABLE_PANICS - return (EINVAL); -#endif } /* Modified: head/sys/netgraph/ng_parse.c ============================================================================== --- head/sys/netgraph/ng_parse.c Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/netgraph/ng_parse.c Mon Jul 25 09:12:48 2011 (r224307) @@ -374,9 +374,6 @@ ng_int8_unparse(const struct ng_parse_ty break; default: panic("%s: unknown type", __func__); -#ifdef RESTARTABLE_PANICS - return(0); -#endif } if ((error = ng_parse_append(&cbuf, &cbuflen, fmt, fval)) != 0) return (error); @@ -473,9 +470,6 @@ ng_int16_unparse(const struct ng_parse_t break; default: panic("%s: unknown type", __func__); -#ifdef RESTARTABLE_PANICS - return(0); -#endif } if ((error = ng_parse_append(&cbuf, &cbuflen, fmt, fval)) != 0) return (error); @@ -575,9 +569,6 @@ ng_int32_unparse(const struct ng_parse_t break; default: panic("%s: unknown type", __func__); -#ifdef RESTARTABLE_PANICS - return(0); -#endif } if ((error = ng_parse_append(&cbuf, &cbuflen, fmt, fval)) != 0) return (error); @@ -673,9 +664,6 @@ ng_int64_unparse(const struct ng_parse_t break; default: panic("%s: unknown type", __func__); -#ifdef RESTARTABLE_PANICS - return(0); -#endif } if ((error = ng_parse_append(&cbuf, &cbuflen, fmt, fval)) != 0) return (error); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon Jul 25 07:45:22 2011 (r224306) +++ head/sys/sys/systm.h Mon Jul 25 09:12:48 2011 (r224307) @@ -160,11 +160,7 @@ void *hashinit_flags(int count, struct m void *phashinit(int count, struct malloc_type *type, u_long *nentries); void g_waitidle(void); -#ifdef RESTARTABLE_PANICS -void panic(const char *, ...) __printflike(1, 2); -#else void panic(const char *, ...) __dead2 __printflike(1, 2); -#endif void cpu_boot(int); void cpu_flush_dcache(void *, size_t); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 13:50:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35BB0106567D; Mon, 25 Jul 2011 13:50:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BC38FC26; Mon, 25 Jul 2011 13:50:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PDosxc057234; Mon, 25 Jul 2011 13:50:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PDosEb057226; Mon, 25 Jul 2011 13:50:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107251350.p6PDosEb057226@svn.freebsd.org> From: Martin Matuska Date: Mon, 25 Jul 2011 13:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224308 - in stable/8: contrib/xz contrib/xz/po contrib/xz/src/common contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/delta contrib/xz/src/liblzma/l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 13:50:56 -0000 Author: mm Date: Mon Jul 25 13:50:54 2011 New Revision: 224308 URL: http://svn.freebsd.org/changeset/base/224308 Log: MFC r223935: Update xz to git snapshot of v5.0 branch as of 20110711 (post-5.0.3) For architectures with __NO_STRICT_ALIGNMENT define TUKLIB_FAST_UNALIGNED_ACCESS Added: stable/8/contrib/xz/po/fr.po - copied unchanged from r223935, head/contrib/xz/po/fr.po stable/8/contrib/xz/po/pl.po - copied unchanged from r223935, head/contrib/xz/po/pl.po Modified: stable/8/contrib/xz/ChangeLog (contents, props changed) stable/8/contrib/xz/FREEBSD-Xlist (contents, props changed) stable/8/contrib/xz/FREEBSD-upgrade (contents, props changed) stable/8/contrib/xz/THANKS (contents, props changed) stable/8/contrib/xz/po/LINGUAS stable/8/contrib/xz/po/it.po stable/8/contrib/xz/src/common/tuklib_open_stdxxx.c stable/8/contrib/xz/src/liblzma/api/lzma/block.h stable/8/contrib/xz/src/liblzma/api/lzma/container.h stable/8/contrib/xz/src/liblzma/api/lzma/filter.h stable/8/contrib/xz/src/liblzma/api/lzma/version.h stable/8/contrib/xz/src/liblzma/common/alone_decoder.c stable/8/contrib/xz/src/liblzma/common/alone_encoder.c stable/8/contrib/xz/src/liblzma/common/block_buffer_encoder.c stable/8/contrib/xz/src/liblzma/common/block_encoder.c stable/8/contrib/xz/src/liblzma/common/common.c stable/8/contrib/xz/src/liblzma/common/common.h stable/8/contrib/xz/src/liblzma/common/filter_common.c stable/8/contrib/xz/src/liblzma/common/index.c stable/8/contrib/xz/src/liblzma/common/index_decoder.c stable/8/contrib/xz/src/liblzma/common/index_encoder.c stable/8/contrib/xz/src/liblzma/common/stream_buffer_encoder.c stable/8/contrib/xz/src/liblzma/common/stream_encoder.c stable/8/contrib/xz/src/liblzma/delta/delta_encoder.c stable/8/contrib/xz/src/liblzma/lz/lz_decoder.c stable/8/contrib/xz/src/liblzma/lz/lz_encoder.c stable/8/contrib/xz/src/liblzma/lz/lz_encoder_hash.h stable/8/contrib/xz/src/liblzma/lzma/lzma2_decoder.c stable/8/contrib/xz/src/liblzma/lzma/lzma2_encoder.c stable/8/contrib/xz/src/liblzma/simple/arm.c stable/8/contrib/xz/src/liblzma/simple/armthumb.c stable/8/contrib/xz/src/liblzma/simple/ia64.c stable/8/contrib/xz/src/liblzma/simple/powerpc.c stable/8/contrib/xz/src/liblzma/simple/simple_coder.c stable/8/contrib/xz/src/liblzma/simple/sparc.c stable/8/contrib/xz/src/lzmainfo/lzmainfo.c stable/8/contrib/xz/src/xz/coder.c stable/8/contrib/xz/src/xz/file_io.c stable/8/contrib/xz/src/xz/hardware.h stable/8/contrib/xz/src/xz/list.c stable/8/contrib/xz/src/xz/message.c stable/8/contrib/xz/src/xz/message.h stable/8/contrib/xz/src/xz/options.c stable/8/contrib/xz/src/xz/signals.c stable/8/contrib/xz/src/xz/suffix.c stable/8/contrib/xz/src/xz/util.h stable/8/contrib/xz/src/xz/xz.1 stable/8/contrib/xz/src/xzdec/xzdec.c stable/8/lib/liblzma/config.h Directory Properties: stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/lib/liblzma/ (props changed) Modified: stable/8/contrib/xz/ChangeLog ============================================================================== --- stable/8/contrib/xz/ChangeLog Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/ChangeLog Mon Jul 25 13:50:54 2011 (r224308) @@ -1,3 +1,328 @@ +commit edf339227a966f24aebe1845fcca9429b8f6e318 +Author: Anders F Bjorklund +Date: Fri Nov 5 12:56:11 2010 +0100 + + add build script for macosx universal + +commit 7fcc6334ea8923550ba6b5347ff99dc8432234b0 +Author: Lasse Collin +Date: Thu Jun 16 12:15:29 2011 +0300 + + liblzma: Remove unneeded semicolon. + +commit 631f4d3ae6adfda84d1a110781d9402c12e16cfc +Author: Lasse Collin +Date: Sat May 28 16:43:26 2011 +0300 + + Don't call close(-1) in tuklib_open_stdxxx() on error. + + Thanks to Jim Meyering. + +commit c89faf4c9e5970e7f7f8a25521ed9aa62d1a2d9a +Author: Lasse Collin +Date: Sat May 28 09:47:56 2011 +0300 + + Translations: Update Italian translation. + + Thanks to Milo Casagrande. + +commit 6fe2fc9b6ab5bf6848140823e9536370834f42fb +Author: Lasse Collin +Date: Sat May 28 08:46:04 2011 +0300 + + Tests: Add a test file for the bug in the previous commit. + +commit 6c4d4db2bc8d8b682bd927144d37daa2ab21a6d6 +Author: Lasse Collin +Date: Fri May 27 22:25:44 2011 +0300 + + xz: Fix error handling in xz -lvv. + + It could do an invalid free() and read past the end + of the uninitialized filters array. + +commit 844f84fcad9670c543550edf7c7e42630c8f7715 +Author: Lasse Collin +Date: Fri May 27 22:09:49 2011 +0300 + + liblzma: Handle allocation failures correctly in lzma_index_init(). + + Thanks to Jim Meyering. + +commit 240e8b9791df597063a3b68d04ffcb3aa4f2de6a +Author: Lasse Collin +Date: Mon May 23 18:30:30 2011 +0300 + + Build: Set GZIP_ENV=-9n in top-level Makefile.am. + +commit e32cb264ea72a4459810f30abad70dae5a4fa17d +Author: Lasse Collin +Date: Sat May 21 16:59:22 2011 +0300 + + Bump version and soname for 5.0.3. + +commit 65cff45f8fd1c250491557157cce0f5f38481082 +Author: Lasse Collin +Date: Sat May 21 16:56:53 2011 +0300 + + Update NEWS for 5.0.3. + +commit 316c67ffdae1f811ac95e838d5290a013bff4ca7 +Author: Lasse Collin +Date: Sat May 21 16:28:44 2011 +0300 + + Add French translation. + + It is known that the BCJ filter --help text is only + partially translated. + +commit 1931175eea6d09c0845d6e8e334a7333647f11c0 +Author: Lasse Collin +Date: Sat May 21 15:12:10 2011 +0300 + + xz: Translate also the string used to print the program name. + + French needs a space before a colon, e.g. "xz : foo error". + +commit 841dc1f891b48b23f84c0f0e0c86c7c4e4bdcdf5 +Author: Lasse Collin +Date: Tue May 17 12:26:28 2011 +0300 + + Update THANKS. + +commit 0f7e2d36240ebf1159d5fb85d8cd7422337a0d3f +Author: Lasse Collin +Date: Tue May 17 12:21:33 2011 +0300 + + Update INSTALL with a note about linker problem on OpenSolaris x86. + +commit 793d857e01e1725f16fc0c8af8172c91a9e38617 +Author: Lasse Collin +Date: Tue May 17 12:01:37 2011 +0300 + + Build: Fix initialization of enable_check_* variables in configure.ac. + + This doesn't matter much in practice since it is unlikely + that anyone would have such environment variable names. + + Thanks to Wim Lewis. + +commit afcff45cee04c5c7d9c333504046ffb63d1418b5 +Author: Lasse Collin +Date: Tue May 17 11:54:38 2011 +0300 + + Add underscores to attributes (__attribute((__foo__))). + +commit 22159c6ba2300a006f2e46ce85ae132e2d2f7d57 +Author: Lasse Collin +Date: Mon Apr 18 19:35:49 2011 +0300 + + Update THANKS. + +commit 5e3499059515033d1ce44b6fb0fa49183c7ac633 +Author: Martin Väth +Date: Fri Apr 15 04:54:49 2011 -0400 + + xzgrep: fix typo in $0 parsing + + Reported-by: Diego Elio Pettenò + Signed-off-by: Martin Väth + Signed-off-by: Mike Frysinger + +commit 1125611b9b8d4a209b6a73d2c76e1b39c065972a +Author: Lasse Collin +Date: Tue Apr 12 11:59:49 2011 +0300 + + Remove doubled words from documentation and comments. + + Spot candidates by running these commands: + git ls-files |xargs perl -0777 -n \ + -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \ + -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}' + + Thanks to Jim Meyering for the original patch. + +commit 3f8fa53837bae8b44f3addf19923e26401336c3d +Author: Lasse Collin +Date: Mon Apr 11 21:04:13 2011 +0300 + + liblzma: Document lzma_easy_(enc|dec)oder_memusage() better too. + +commit 320d734c20d0776e3eb80f6b5984ddeb494715b5 +Author: Lasse Collin +Date: Mon Apr 11 20:59:07 2011 +0300 + + liblzma: Document lzma_raw_(enc|dec)oder_memusage() better. + + It didn't mention the return value that is used if + an error occurs. + +commit 2ee4edeffc8d9734bf68230df31b20ac6a94c9b5 +Author: Lasse Collin +Date: Mon Apr 11 13:59:50 2011 +0300 + + liblzma: Don't create an empty Block in lzma_stream_buffer_encode(). + + Empty Block was created if the input buffer was empty. + Empty Block wastes a few bytes of space, but more importantly + it triggers a bug in XZ Utils 5.0.1 and older when trying + to decompress such a file. 5.0.1 and older consider such + files to be corrupt. I thought that no encoder creates empty + Blocks when releasing 5.0.2 but I was wrong. + +commit 73f56fb87d54091d0c4fd22d70e6f042902e3b63 +Author: Lasse Collin +Date: Mon Apr 11 13:28:40 2011 +0300 + + liblzma: Fix API docs to mention LZMA_UNSUPPORTED_CHECK. + + This return value was missing from the API comments of + four functions. + +commit 4ce1cf97a88ae1640a380dd19cbc255d729f966b +Author: Lasse Collin +Date: Mon Apr 11 13:21:28 2011 +0300 + + liblzma: Validate encoder arguments better. + + The biggest problem was that the integrity check type + wasn't validated, and e.g. lzma_easy_buffer_encode() + would create a corrupt .xz Stream if given an unsupported + Check ID. Luckily applications don't usually try to use + an unsupport Check ID, so this bug is unlikely to cause + many real-world problems. + +commit 972f05d7a4268dbe42573701f83faa45d03249eb +Author: Lasse Collin +Date: Sat Apr 9 18:29:30 2011 +0300 + + Update THANKS. + +commit 28154eeaf6e3442cd1e174f4e81266d60c4dac60 +Author: Lasse Collin +Date: Sat Apr 9 18:28:58 2011 +0300 + + liblzma: Add missing #ifdefs to filter_common.c. + + Passing --disable-decoders to configure broke a few + encoders due to missing #ifdefs in filter_common.c. + + Thanks to Jason Gorski for the patch. + +commit aa95516d3d509c6b7895ee519004afcf500a0759 +Author: Lasse Collin +Date: Sat Apr 2 14:49:56 2011 +0300 + + liblzma: Fix a memory leak in stream_encoder.c. + + It leaks old filter options structures (hundred bytes or so) + every time the lzma_stream is reinitialized. With the xz tool, + this happens when compressing multiple files. + +commit 58f52c72f49562a08042da9a2f4bbdf4dd162d0c +Author: Lasse Collin +Date: Fri Apr 1 08:47:46 2011 +0300 + + Bumped version and liblzma soname to 5.0.2. + +commit 162779682e01d15f0ce386ef7f40d1be05ad0053 +Author: Lasse Collin +Date: Fri Apr 1 08:47:20 2011 +0300 + + Updated NEWS for 5.0.2. + +commit 45553f9b4b0175c292023010dc41520347004852 +Author: Lasse Collin +Date: Thu Mar 31 15:06:58 2011 +0300 + + Update INSTALL with another note about IRIX. + +commit af9d48d5515eadef689b1ce9ffb91e4dbcbc7f35 +Author: Lasse Collin +Date: Thu Mar 31 12:22:55 2011 +0300 + + Tests: Add a new file to test empty LZMA2 streams. + +commit d099ef9f517b59ab8e3b6f6aa0543c3643983470 +Author: Lasse Collin +Date: Thu Mar 31 11:54:48 2011 +0300 + + liblzma: Fix decoding of LZMA2 streams having no uncompressed data. + + The decoder considered empty LZMA2 streams to be corrupt. + This shouldn't matter much with .xz files, because no encoder + creates empty LZMA2 streams in .xz. This bug is more likely + to cause problems in applications that use raw LZMA2 streams. + +commit df87249b26e79a75fd91041e85512944fc247b57 +Author: Lasse Collin +Date: Thu Mar 24 01:42:49 2011 +0200 + + Scripts: Better fix for xzgrep. + + Now it uses "grep -q". + + Thanks to Gregory Margo. + +commit 68c453e1c7b09dc9c7d2ef9d994c46f5b367f5d3 +Author: Lasse Collin +Date: Thu Mar 24 01:22:18 2011 +0200 + + Updated THANKS. + +commit b441d39855516ae618faffd5156261b8b413394f +Author: Lasse Collin +Date: Thu Mar 24 01:21:32 2011 +0200 + + Scripts: Fix xzgrep -l. + + It didn't work at all. It tried to use the -q option + for grep, but it appended it after "--". This works + around it by redirecting to /dev/null. The downside + is that this can be slower with big files compared + to proper use of "grep -q". + + Thanks to Gregory Margo. + +commit 82d5164839517f55daeadd9ee88c76425db30224 +Author: Lasse Collin +Date: Fri Feb 4 22:49:31 2011 +0200 + + xz: Clean up suffix.c. + + struct suffix_pair isn't needed in compresed_name() + so get rid of it there. + +commit 6decc8b41882c2250f0450eb87b83c9fbf495e95 +Author: Lasse Collin +Date: Fri Feb 4 11:29:47 2011 +0200 + + xz: Check if the file already has custom suffix when compressing. + + Now "xz -S .test foo.test" refuses to compress the + file because it already has the suffix .test. The man + page had it documented this way already. + +commit ecda90061df8d39399e707e5c76c2ec0a0f400e5 +Author: Lasse Collin +Date: Wed Feb 2 23:01:51 2011 +0200 + + Updated THANKS. + +commit 0fda1ae5b1aa0a5c629a09e5228db8ba1cd0dd5f +Author: Lasse Collin +Date: Wed Feb 2 23:00:33 2011 +0200 + + Translations: Add Polish translation. + + Thanks to Jakub Bogusz. + +commit 00be32978fedc5038748438bf685ac1713d1db83 +Author: Lasse Collin +Date: Wed Feb 2 22:24:00 2011 +0200 + + Updated THANKS. + commit 7232fcf96bf4bd5f9cd4fc6c93ca2912c665e004 Author: Lasse Collin Date: Fri Jan 28 20:26:38 2011 +0200 Modified: stable/8/contrib/xz/FREEBSD-Xlist ============================================================================== --- stable/8/contrib/xz/FREEBSD-Xlist Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/FREEBSD-Xlist Mon Jul 25 13:50:54 2011 (r224308) @@ -28,6 +28,7 @@ dos/ extra/ lib/ m4/ +macosx/ makefile.am src/*/*.rc src/liblzma/liblzma.pc.in Modified: stable/8/contrib/xz/FREEBSD-upgrade ============================================================================== --- stable/8/contrib/xz/FREEBSD-upgrade Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/FREEBSD-upgrade Mon Jul 25 13:50:54 2011 (r224308) @@ -4,7 +4,7 @@ xz The source code is pulled with git: - git clone http://git.tukaani.org/xz.git xz + git clone --branch=v5.0 http://git.tukaani.org/xz.git xz ChangeLog is generated with: @@ -25,4 +25,4 @@ To make local changes to xz, simply patc branch (aka HEAD). Never make local changes on the vendor branch. mm@FreeBSD.org -10-May-2010 +11-July-2011 Modified: stable/8/contrib/xz/THANKS ============================================================================== --- stable/8/contrib/xz/THANKS Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/THANKS Mon Jul 25 13:50:54 2011 (r224308) @@ -10,6 +10,9 @@ has been important. :-) In alphabetical - Karl Berry - Anders F. Björklund - Emmanuel Blot + - Martin Blumenstingl + - Jakub Bogusz + - Maarten Bosmans - Trent W. Buck - David Burklund - Daniel Mealha Cabrita @@ -22,6 +25,7 @@ has been important. :-) In alphabetical - Gilles Espinasse - Denis Excoffier - Mike Frysinger + - Jason Gorski - Juan Manuel Guerrero - Joachim Henke - Peter Ivanov @@ -34,7 +38,9 @@ has been important. :-) In alphabetical - Peter Lawler - Hin-Tak Leung - Andraž 'ruskie' Levstik + - Wim Lewis - Lorenzo De Liso + - Gregory Margo - Jim Meyering - RafaÅ‚ MużyÅ‚o - Adrien Nader @@ -43,6 +49,7 @@ has been important. :-) In alphabetical - Andre Noll - Peter O'Gorman - Igor Pavlov + - Diego Elio Pettenò - Elbert Pol - Mikko Pouru - Robert Readman @@ -55,10 +62,12 @@ has been important. :-) In alphabetical - Dan Shechter - Stuart Shelton - Jonathan Stott + - Dan Stromberg - Paul Townsend - Mohammed Adnène Trojette - Alexey Tourbin - Patrick J. Volkerding + - Martin Väth - Christian Weisgerber - Bert Wesarg - Ralf Wildenhues Modified: stable/8/contrib/xz/po/LINGUAS ============================================================================== --- stable/8/contrib/xz/po/LINGUAS Mon Jul 25 09:12:48 2011 (r224307) +++ stable/8/contrib/xz/po/LINGUAS Mon Jul 25 13:50:54 2011 (r224308) @@ -1,3 +1,5 @@ cs de +fr it +pl Copied: stable/8/contrib/xz/po/fr.po (from r223935, head/contrib/xz/po/fr.po) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/contrib/xz/po/fr.po Mon Jul 25 13:50:54 2011 (r224308, copy of r223935, head/contrib/xz/po/fr.po) @@ -0,0 +1,864 @@ +# XZ Utils French Translation +# This file is put in the public domain. +# Adrien Nader , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: xz-utils\n" +"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" +"POT-Creation-Date: 2011-05-21 14:35+0200\n" +"PO-Revision-Date: 2010-09-24 21;12+0200\n" +"Last-Translator: Adrien Nader \n" +"Language-Team: None\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n" + +#: src/xz/args.c:338 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s : Format de fichier inconnu" + +#: src/xz/args.c:361 src/xz/args.c:369 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s : Type de vérification d'intégrité inconnu" + +#: src/xz/args.c:396 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Un seul fichier peut être spécifié avec `--files' ou `--files0'." + +#: src/xz/args.c:459 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La variable d'environnement %s contient trop d'arguments" + +#: src/xz/coder.c:105 +msgid "Maximum number of filters is four" +msgstr "Le nombre maximal de filtres est quatre" + +#: src/xz/coder.c:118 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "La limite d'utilisation mémoire est trop basse pour la configuration de filtres donnée." + +#: src/xz/coder.c:148 +msgid "Using a preset in raw mode is discouraged." +msgstr "Utiliser un préréglage en mode `raw' est déconseillé." + +#: src/xz/coder.c:150 +msgid "The exact options of the presets may vary between software versions." +msgstr "Le détail des préréglages peut varier entre différentes versions du logiciel." + +#: src/xz/coder.c:176 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Le format .lzma ne prend en charge que le filtre LZMA1" + +#: src/xz/coder.c:184 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "Le filtre LZMA1 ne peut être utilisé avec le format .xz" + +#: src/xz/coder.c:203 +#, c-format +msgid "Using up to % threads." +msgstr "Jusqu'à % threads seront utilisés." + +#: src/xz/coder.c:216 +msgid "Unsupported filter chain or filter options" +msgstr "Enchaînement ou options de filtres non pris en charge" + +#: src/xz/coder.c:224 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "La décompression nécessitera %s MiB de mémoire." + +#: src/xz/coder.c:259 +#, c-format +msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Nombre de threads réduit de %s à %s pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#: src/xz/coder.c:313 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Taille du dictionnaire LZMA%c réduite de %s MiB à %s MiB pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:136 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s : Le fichier a apparemment été déplacé, suppression annulée" + +#: src/xz/file_io.c:143 src/xz/file_io.c:635 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s : Impossible de supprimer : %s" + +#: src/xz/file_io.c:168 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s : Impossible de modifier le propriétaire du fichier : %s" + +#: src/xz/file_io.c:174 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s : Impossible de modifier le groupe propriétaire du fichier : %s" + +#: src/xz/file_io.c:193 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s : Impossible de modifier les permissions du fichier : %s" + +#: src/xz/file_io.c:340 src/xz/file_io.c:423 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s est un lien symbolique : ignoré" + +#: src/xz/file_io.c:468 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s est un répertoire : ignoré" + +#: src/xz/file_io.c:474 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s n'est pas un fichier régulier : ignoré" + +#: src/xz/file_io.c:491 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s : Le fichier possède les bits `setuid' ou `setgid' : ignoré" + +#: src/xz/file_io.c:498 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s : Le fichier possède le bit `sticky' : ignoré" + +#: src/xz/file_io.c:505 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s : Le fichier d'entrée a plus d'un lien matériel : ignoré" + +#: src/xz/file_io.c:761 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Impossible de rétablir le drapeau O_APPEND sur la sortie standard : %s" + +#: src/xz/file_io.c:773 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s : Impossible de fermer le fichier : %s" + +#: src/xz/file_io.c:809 src/xz/file_io.c:1008 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s : Impossible de se déplacer dans le fichier pour créer un 'sparse file' : %s" + +#: src/xz/file_io.c:883 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s : Erreur d'écriture : %s" + +#: src/xz/file_io.c:906 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s : Impossible de se déplacer dans le fichier : %s" + +#: src/xz/file_io.c:916 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s : Fin de fichier inattendue" + +#: src/xz/file_io.c:966 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s : Erreur d'écriture : %s" + +#: src/xz/hardware.c:101 +msgid "Disabled" +msgstr "Désactivé" + +#. TRANSLATORS: Test with "xz --info-memory" to see if +#. the alignment looks nice. +#: src/xz/hardware.c:120 +msgid "Total amount of physical memory (RAM): " +msgstr "Quantité totale de mémoire physique (RAM) : " + +#: src/xz/hardware.c:122 +msgid "Memory usage limit for compression: " +msgstr "Limite d'utilisation pour la compression : " + +#: src/xz/hardware.c:124 +msgid "Memory usage limit for decompression: " +msgstr "Limite d'utilisation pour la décompression : " + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables, so the width must not +#. exceed ten columns with a fixed-width font. +#: src/xz/list.c:62 +msgid "None" +msgstr "Aucune" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). This and other "Unknown-N" +#. strings are used in tables, so the width must not exceed ten +#. columns with a fixed-width font. It's OK to omit the dash if +#. you need space for one extra letter, but don't use spaces. +#: src/xz/list.c:69 +msgid "Unknown-2" +msgstr "Inconnue-2" + +#: src/xz/list.c:70 +msgid "Unknown-3" +msgstr "Inconnue-3" + +#: src/xz/list.c:72 +msgid "Unknown-5" +msgstr "Inconnue-5" + +#: src/xz/list.c:73 +msgid "Unknown-6" +msgstr "Inconnue-6" + +#: src/xz/list.c:74 +msgid "Unknown-7" +msgstr "Inconnue-7" + +#: src/xz/list.c:75 +msgid "Unknown-8" +msgstr "Inconnue-8" + +#: src/xz/list.c:76 +msgid "Unknown-9" +msgstr "Inconnue-9" + +#: src/xz/list.c:78 +msgid "Unknown-11" +msgstr "Inconnue-11" + +#: src/xz/list.c:79 +msgid "Unknown-12" +msgstr "Inconnue-12" + +#: src/xz/list.c:80 +msgid "Unknown-13" +msgstr "Inconnue-13" + +#: src/xz/list.c:81 +msgid "Unknown-14" +msgstr "Inconnue-14" + +#: src/xz/list.c:82 +msgid "Unknown-15" +msgstr "Inconnue-15" + +#: src/xz/list.c:126 +#, c-format +msgid "%s: File is empty" +msgstr "%s : Le fichier est vide" + +#: src/xz/list.c:131 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s : Trop petit pour être un fichier xz valide." + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:612 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Flux Blocs Compressé Décompressé Ratio Vérif Nom de fichier" + +#: src/xz/list.c:652 +#, c-format +msgid " Streams: %s\n" +msgstr " Flux : %s\n" + +#: src/xz/list.c:654 +#, c-format +msgid " Blocks: %s\n" +msgstr " Blocs : %s\n" + +#: src/xz/list.c:656 +#, c-format +msgid " Compressed size: %s\n" +msgstr " Taille compressé : %s\n" + +#: src/xz/list.c:659 +#, c-format +msgid " Uncompressed size: %s\n" +msgstr " Taille décompressé : %s\n" + +#: src/xz/list.c:662 +#, c-format +msgid " Ratio: %s\n" +msgstr " Ratio : %s\n" + +#: src/xz/list.c:664 +#, c-format +msgid " Check: %s\n" +msgstr " Vérification : %s\n" + +#: src/xz/list.c:665 +#, c-format +msgid " Stream padding: %s\n" +msgstr " Octets de rembourrage du flux : %s\n" + +#. TRANSLATORS: The second line is column headings. All except +#. Check are right aligned; Check is left aligned. Test with +#. "xz -lv foo.xz". +#: src/xz/list.c:693 +msgid "" +" Streams:\n" +" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +msgstr "" +" Flux :\n" +" Flux Blocs PositionComp PositionDécomp TailleComp TailleDécomp Ratio Vérif. Bourrage" + +#. TRANSLATORS: The second line is column headings. All +#. except Check are right aligned; Check is left aligned. +#: src/xz/list.c:748 +#, c-format +msgid "" +" Blocks:\n" +" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +msgstr "" +" Blocs :\n" +" Flux Bloc PositionComp PositionDécomp TailleTot TailleDécomp Ratio Vérif." + +#. TRANSLATORS: These are additional column headings +#. for the most verbose listing mode. CheckVal +#. (Check value), Flags, and Filters are left aligned. +#. Header (Block Header Size), CompSize, and MemUsage +#. are right aligned. %*s is replaced with 0-120 +#. spaces to make the CheckVal column wide enough. +#. Test with "xz -lvv foo.xz". +#: src/xz/list.c:760 +#, c-format +msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +msgstr " ValVérif %*sEn-tête Drapeaux TailleComp UtilMém Filtres" + +#: src/xz/list.c:838 src/xz/list.c:1007 +#, c-format +msgid " Memory needed: %s MiB\n" +msgstr " Mémoire nécessaire : %s MiB\n" + +#: src/xz/list.c:840 src/xz/list.c:1009 +#, c-format +msgid " Sizes in headers: %s\n" +msgstr " Tailles stockées dans l'en-tête : %s\n" + +#: src/xz/list.c:841 src/xz/list.c:1010 +msgid "Yes" +msgstr "Oui" + +#: src/xz/list.c:841 src/xz/list.c:1010 +msgid "No" +msgstr "Non" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:986 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fichier\n" +msgstr[1] "%s fichiers\n" + +#: src/xz/list.c:999 +msgid "Totals:" +msgstr "Totaux :" + +#: src/xz/list.c:1000 +#, c-format +msgid " Number of files: %s\n" +msgstr " Nombre de fichiers : %s\n" + +#: src/xz/list.c:1072 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list ne marche que sur les fichiers .xz (--format=xz ou --format=auto)" + +#: src/xz/list.c:1078 +msgid "--list does not support reading from standard input" +msgstr "--list est incompatible avec la lecture sur l'entrée standard" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s : Erreur lors de la lecture des noms de fichiers : %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s : Fin des données inattendue lors de la lecture des noms de fichiers" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s : Caractère NULL détecté lors de la lecture des noms de fichiers ; peut-être pensiez-vous à `--files0' plutot qu'a `--files' ?" + +#: src/xz/main.c:174 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "La compression et la décompression ne marchent pas encore avec --robot." + +#: src/xz/main.c:231 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Impossible de lire à la fois les données et les noms de fichiers depuis l'entrée standard" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:733 +#, c-format +msgid "%s: " +msgstr "%s : " + +#: src/xz/message.c:796 src/xz/message.c:846 +msgid "Internal error (bug)" +msgstr "Erreur interne (bug)" + +#: src/xz/message.c:803 +msgid "Cannot establish signal handlers" +msgstr "Impossible d'installer le gestionnaire de signaux" + +#: src/xz/message.c:812 +msgid "No integrity check; not verifying file integrity" +msgstr "Pas de données de vérification d'intégrité ; vérification non effectuée" + +#: src/xz/message.c:815 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Méthode de vérification d'intégrité non prise en charge ; vérification non effectuée" + +#: src/xz/message.c:822 +msgid "Memory usage limit reached" +msgstr "Limite d'utilisation mémoire atteinte" + +#: src/xz/message.c:825 +msgid "File format not recognized" +msgstr "Format de fichier inconnu" + +#: src/xz/message.c:828 +msgid "Unsupported options" +msgstr "Options non prises en charge" + +#: src/xz/message.c:831 +msgid "Compressed data is corrupt" +msgstr "Les données compressées sont corrompues" + +#: src/xz/message.c:834 +msgid "Unexpected end of input" +msgstr "Fin des données inattendue " + +#: src/xz/message.c:885 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB de mémoire sont nécessaires, la limite étant %s." + +#: src/xz/message.c:1052 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s : Enchaînement de filtres : %s\n" + +#: src/xz/message.c:1062 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Utilisez `%s --help' pour plus d'informations." + +#: src/xz/message.c:1088 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Utilisation : %s [OPTION]... [FICHIER]...\n" +"Compresse ou decompresse FICHIER(s) au format .xz.\n" +"\n" + +#: src/xz/message.c:1095 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Les arguments obligatoires pour les options longues le sont aussi pour les\n" +"options courtes.\n" + +#: src/xz/message.c:1099 +msgid " Operation mode:\n" +msgstr " Mode d'opération :\n" + +#: src/xz/message.c:1102 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress forcer la compression\n" +" -d, --decompress forcer la décompression\n" +" -t, --test tester l'intégrité du fichier compressé\n" +" -l, --list lister les informations à propos des fichiers .xz" + +#: src/xz/message.c:1108 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modifictauers :\n" + +#: src/xz/message.c:1111 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep ne pas supprimer les fichiers d'entrée (\"keep\")\n" +" -f, --force forcer l'écrasement du fichier de sortie et\n" +" (dé)compresser les liens\n" +" -c, --stdout écrire sur la sortie standard et ne pas supprimer les\n" +" fichiers d'entrée" + +#: src/xz/message.c:1117 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream décompresser uniquement le premier flux et ignorer\n" +" silenciseusement les données éventuellement restantes" + +#: src/xz/message.c:1120 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse ne pas créer de 'sparse file' lors de la décompression\n" +" -S, --suffix=.SUF utiliser le suffixe `.SUF' pour les fichiers compressés\n" +" --files[=FILE] lire les fichiers sur lesquels opérer depuis FILE ; si\n" +" FILE est omis, ceux-ci sont lus depuis l'entrée standard\n" +" et doivent être suivis d'un caractère de retour à la ligne\n" +" --files0[=FILE] comme --files mais avec un caractère null comme séparateur" + +#: src/xz/message.c:1129 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Options basiques de format de fichier et de compression :\n" + +#: src/xz/message.c:1131 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT format de fichier à encoder ou décoder ; les possibilités\n" +" sont : `auto' (par défaut), `xz', `lzma' et `raw'\n" +" -C, --check=CHECK type de vérification d'intégrité : `none' (à utiliser avec\n" +" précaution), `crc32', `crc64' (par défaut) ou `sha256'" + +#: src/xz/message.c:1138 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 préréglage de compression ; 6 par défaut ; pensez à\n" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:30:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3458F106564A; Mon, 25 Jul 2011 14:30:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C888FC08; Mon, 25 Jul 2011 14:30:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEUj0n060017; Mon, 25 Jul 2011 14:30:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEUjYM060015; Mon, 25 Jul 2011 14:30:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251430.p6PEUjYM060015@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224309 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:30:45 -0000 Author: marius Date: Mon Jul 25 14:30:44 2011 New Revision: 224309 URL: http://svn.freebsd.org/changeset/base/224309 Log: MFC: r216016 Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64. Modified: stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 13:50:54 2011 (r224308) +++ stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 14:30:44 2011 (r224309) @@ -226,6 +226,14 @@ #endif /* + * Ceiling on amount of kmem_map kva space. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + +/* * Initial pagein size of beginning of executable file. */ #ifndef VM_INITIAL_PAGEIN From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:33:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 663DF1065673; Mon, 25 Jul 2011 14:33:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54F898FC19; Mon, 25 Jul 2011 14:33:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEXbBK060287; Mon, 25 Jul 2011 14:33:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEXbh0060285; Mon, 25 Jul 2011 14:33:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251433.p6PEXbh0060285@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224310 - stable/7/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:33:37 -0000 Author: marius Date: Mon Jul 25 14:33:37 2011 New Revision: 224310 URL: http://svn.freebsd.org/changeset/base/224310 Log: MFC: r216016 Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64. Modified: stable/7/sys/sparc64/include/vmparam.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 14:30:44 2011 (r224309) +++ stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 14:33:37 2011 (r224310) @@ -230,6 +230,14 @@ #endif /* + * Ceiling on amount of kmem_map kva space. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + +/* * Initial pagein size of beginning of executable file. */ #ifndef VM_INITIAL_PAGEIN From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:34:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0704B106566B; Mon, 25 Jul 2011 14:34:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9A418FC13; Mon, 25 Jul 2011 14:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEYUif060395; Mon, 25 Jul 2011 14:34:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEYUYv060393; Mon, 25 Jul 2011 14:34:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251434.p6PEYUYv060393@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224311 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:34:31 -0000 Author: marius Date: Mon Jul 25 14:34:30 2011 New Revision: 224311 URL: http://svn.freebsd.org/changeset/base/224311 Log: MFC: r219782 On Serengeti-class machines the OFW root isn't the parent of the CPU nodes. Modified: stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 14:33:37 2011 (r224310) +++ stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 14:34:30 2011 (r224311) @@ -118,8 +118,8 @@ cpu_initclocks(void) sclock = 0; if (PCPU_GET(impl) == CPU_IMPL_SPARC64V || PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCIII) { - if (OF_getprop(OF_parent(PCPU_GET(node)), "stick-frequency", - &sclock, sizeof(sclock)) == -1) { + if (OF_getprop(OF_peer(0), "stick-frequency", &sclock, + sizeof(sclock)) == -1) { panic("%s: could not determine STICK frequency", __func__); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:39:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E94106566C; Mon, 25 Jul 2011 14:39:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26F638FC17; Mon, 25 Jul 2011 14:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEdNrV060580; Mon, 25 Jul 2011 14:39:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEdNIV060578; Mon, 25 Jul 2011 14:39:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251439.p6PEdNIV060578@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224312 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:39:23 -0000 Author: marius Date: Mon Jul 25 14:39:22 2011 New Revision: 224312 URL: http://svn.freebsd.org/changeset/base/224312 Log: MFC: r220931 - Use the streaming cache unless BUS_DMA_COHERENT is specified. Since r220375 (MFC'ed to stable/8 in r221191) all drivers enabled in the sparc64 GENERIC should be either correctly using bus_dmamap_sync(9) calls or supply BUS_DMA_COHERENT when appropriate or as a workaround for missing bus_dmamap_sync(9) calls (sound(4) drivers and partially sym(4)). In at least some configurations taking advantage of the streaming cache results in a modest performance improvement. - Remove the memory barrier for BUS_DMASYNC_PREREAD which as the comment already suggested is bogus. - Add my copyright for having implemented several things like support for the Fire and Oberon IOMMUs, taking over PROM IOMMU mappings etc. Modified: stable/8/sys/sparc64/sparc64/iommu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/iommu.c Mon Jul 25 14:34:30 2011 (r224311) +++ stable/8/sys/sparc64/sparc64/iommu.c Mon Jul 25 14:39:22 2011 (r224312) @@ -28,6 +28,7 @@ /*- * Copyright (c) 1999-2002 Eduardo Horvath * Copyright (c) 2001-2003 Thomas Moestl + * Copyright (c) 2007, 2009 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,7 +78,6 @@ __FBSDID("$FreeBSD$"); * - When running out of DVMA space, return EINPROGRESS in the non- * BUS_DMA_NOWAIT case and delay the callback until sufficient space * becomes available. - * - Use the streaming cache unless BUS_DMA_COHERENT is specified. */ #include "opt_iommu.h" @@ -564,17 +564,8 @@ static __inline int iommu_use_streaming(struct iommu_state *is, bus_dmamap_t map, bus_size_t size) { - /* - * This cannot be enabled yet, as many driver are still missing - * bus_dmamap_sync() calls. As soon as there is a BUS_DMA_STREAMING - * flag, this should be reenabled conditionally on it. - */ -#ifdef notyet return (size >= IOMMU_STREAM_THRESH && IOMMU_HAS_SB(is) && (map->dm_flags & DMF_COHERENT) == 0); -#else - return (0); -#endif } /* @@ -1182,9 +1173,6 @@ iommu_dvmamap_sync(bus_dma_tag_t dt, bus if ((map->dm_flags & DMF_LOADED) == 0) return; - /* XXX This is probably bogus. */ - if ((op & BUS_DMASYNC_PREREAD) != 0) - membar(Sync); if ((map->dm_flags & DMF_STREAMED) != 0 && ((op & BUS_DMASYNC_POSTREAD) != 0 || (op & BUS_DMASYNC_PREWRITE) != 0)) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:42:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8751A106566B; Mon, 25 Jul 2011 14:42:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75D2B8FC13; Mon, 25 Jul 2011 14:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEgYkn060720; Mon, 25 Jul 2011 14:42:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEgYNn060718; Mon, 25 Jul 2011 14:42:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251442.p6PEgYNn060718@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224313 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:42:34 -0000 Author: marius Date: Mon Jul 25 14:42:34 2011 New Revision: 224313 URL: http://svn.freebsd.org/changeset/base/224313 Log: MFC: r221750 Add an ATOMIC_CLEAR_LONG. Modified: stable/8/sys/sparc64/include/asmacros.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/asmacros.h ============================================================================== --- stable/8/sys/sparc64/include/asmacros.h Mon Jul 25 14:39:22 2011 (r224312) +++ stable/8/sys/sparc64/include/asmacros.h Mon Jul 25 14:42:34 2011 (r224313) @@ -90,6 +90,17 @@ bne,pn %icc, 9b ; \ mov r3, r2 +/* + * Atomically clear a number of bits of an u_long in memory. + */ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + #define PCPU(member) PCPU_REG + PC_ ## member #define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:43:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB0B1065673; Mon, 25 Jul 2011 14:43:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38D728FC17; Mon, 25 Jul 2011 14:43:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEhqEX060823; Mon, 25 Jul 2011 14:43:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEhqJl060814; Mon, 25 Jul 2011 14:43:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251443.p6PEhqJl060814@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224314 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:43:52 -0000 Author: marius Date: Mon Jul 25 14:43:51 2011 New Revision: 224314 URL: http://svn.freebsd.org/changeset/base/224314 Log: MFC: r220938 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/mii/brgphyreg.h stable/8/sys/dev/mii/ciphyreg.h stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/e1000phyreg.h stable/8/sys/dev/mii/mii_physubr.c stable/8/sys/dev/mii/miivar.h stable/8/sys/dev/mii/rgephyreg.h stable/8/sys/dev/mii/xmphyreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/8/sys/dev/mii/brgphyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/brgphyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -59,7 +59,7 @@ #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define BRGPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define BRGPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define BRGPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define BRGPHY_BMSR_LINK 0x0004 /* Link status */ #define BRGPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/8/sys/dev/mii/ciphyreg.h ============================================================================== --- stable/8/sys/dev/mii/ciphyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/ciphyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -68,7 +68,7 @@ #define CIPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define CIPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define CIPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define CIPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define CIPHY_BMSR_LINK 0x0004 /* Link status */ #define CIPHY_BMSR_JABBER 0x0002 /* Jabber detected */ @@ -170,7 +170,7 @@ /* Vendor-specific PHY registers */ -/* 100baseTX status extention register */ +/* 100baseTX status extension register */ #define CIPHY_MII_100STS 0x10 #define CIPHY_100STS_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_100STS_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -181,7 +181,7 @@ #define CIPHY_100STS_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_100STS_ESDERR 0x0100 /* premature end of stream error */ -/* 1000BT status extention register #2 */ +/* 1000BT status extension register #2 */ #define CIPHY_MII_1000STS2 0x11 #define CIPHY_1000STS2_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_1000STS2_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -191,7 +191,7 @@ #define CIPHY_1000STS2_TXERR 0x0400 /* transmit error detected */ #define CIPHY_1000STS2_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_1000STS2_ESDERR 0x0100 /* premature end of stream error */ -#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extention err detected */ +#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extension err detected */ #define CIPHY_1000STS2_BCM5400 0x0040 /* non-complient BCM5400 detected */ /* Bypass control register */ @@ -332,7 +332,7 @@ #define CIPHY_LED_LINKACTBLINK 0x0004 /* enable link/activity LED blink */ #define CIPHY_LED_BLINKRATE 0x0002 /* blink rate 0=10hz, 1=5hz */ -/* Auxilliary control and status register */ +/* Auxiliary control and status register */ #define CIPHY_MII_AUXCSR 0x1C #define CIPHY_AUXCSR_ANEGDONE 0x8000 /* Autoneg complete */ #define CIPHY_AUXCSR_ANEGOFF 0x4000 /* Autoneg disabled */ Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/e1000phy.c Mon Jul 25 14:43:51 2011 (r224314) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/8/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/8/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/8/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/8/sys/dev/mii/mii_physubr.c Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/mii_physubr.c Mon Jul 25 14:43:51 2011 (r224314) @@ -109,7 +109,7 @@ mii_phy_setmedia(struct mii_softc *sc) /* * Force renegotiation if MIIF_DOPAUSE or MIIF_FORCEANEG. * The former is necessary as we might switch from flow- - * control advertisment being off to on or vice versa. + * control advertisement being off to on or vice versa. */ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || (sc->mii_flags & (MIIF_DOPAUSE | MIIF_FORCEANEG)) != 0) Modified: stable/8/sys/dev/mii/miivar.h ============================================================================== --- stable/8/sys/dev/mii/miivar.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/miivar.h Mon Jul 25 14:43:51 2011 (r224314) @@ -134,7 +134,7 @@ typedef struct mii_softc mii_softc_t; #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ #define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ -#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisment */ +#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisement */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ #define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ #define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ Modified: stable/8/sys/dev/mii/rgephyreg.h ============================================================================== --- stable/8/sys/dev/mii/rgephyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/rgephyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -66,7 +66,7 @@ #define RGEPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define RGEPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define RGEPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define RGEPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define RGEPHY_BMSR_LINK 0x0004 /* Link status */ #define RGEPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/8/sys/dev/mii/xmphyreg.h ============================================================================== --- stable/8/sys/dev/mii/xmphyreg.h Mon Jul 25 14:42:34 2011 (r224313) +++ stable/8/sys/dev/mii/xmphyreg.h Mon Jul 25 14:43:51 2011 (r224314) @@ -51,7 +51,7 @@ #define XMPHY_MII_BMSR 0x01 #define XMPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define XMPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define XMPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define XMPHY_BMSR_LINK 0x0004 /* Link status */ #define XMPHY_BMSR_EXT 0x0001 /* Extended capability */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:44:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E8B6106566B; Mon, 25 Jul 2011 14:44:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB618FC12; Mon, 25 Jul 2011 14:44:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEi1eH060874; Mon, 25 Jul 2011 14:44:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEi0XM060865; Mon, 25 Jul 2011 14:44:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251444.p6PEi0XM060865@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224315 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:44:01 -0000 Author: marius Date: Mon Jul 25 14:44:00 2011 New Revision: 224315 URL: http://svn.freebsd.org/changeset/base/224315 Log: MFC: r220938 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/mii/brgphyreg.h stable/7/sys/dev/mii/ciphyreg.h stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/e1000phyreg.h stable/7/sys/dev/mii/mii_physubr.c stable/7/sys/dev/mii/miivar.h stable/7/sys/dev/mii/rgephyreg.h stable/7/sys/dev/mii/xmphyreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/7/sys/dev/mii/brgphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/brgphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -59,7 +59,7 @@ #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define BRGPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define BRGPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define BRGPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define BRGPHY_BMSR_LINK 0x0004 /* Link status */ #define BRGPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/7/sys/dev/mii/ciphyreg.h ============================================================================== --- stable/7/sys/dev/mii/ciphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/ciphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -68,7 +68,7 @@ #define CIPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define CIPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define CIPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define CIPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define CIPHY_BMSR_LINK 0x0004 /* Link status */ #define CIPHY_BMSR_JABBER 0x0002 /* Jabber detected */ @@ -170,7 +170,7 @@ /* Vendor-specific PHY registers */ -/* 100baseTX status extention register */ +/* 100baseTX status extension register */ #define CIPHY_MII_100STS 0x10 #define CIPHY_100STS_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_100STS_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -181,7 +181,7 @@ #define CIPHY_100STS_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_100STS_ESDERR 0x0100 /* premature end of stream error */ -/* 1000BT status extention register #2 */ +/* 1000BT status extension register #2 */ #define CIPHY_MII_1000STS2 0x11 #define CIPHY_1000STS2_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_1000STS2_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -191,7 +191,7 @@ #define CIPHY_1000STS2_TXERR 0x0400 /* transmit error detected */ #define CIPHY_1000STS2_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_1000STS2_ESDERR 0x0100 /* premature end of stream error */ -#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extention err detected */ +#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extension err detected */ #define CIPHY_1000STS2_BCM5400 0x0040 /* non-complient BCM5400 detected */ /* Bypass control register */ @@ -332,7 +332,7 @@ #define CIPHY_LED_LINKACTBLINK 0x0004 /* enable link/activity LED blink */ #define CIPHY_LED_BLINKRATE 0x0002 /* blink rate 0=10hz, 1=5hz */ -/* Auxilliary control and status register */ +/* Auxiliary control and status register */ #define CIPHY_MII_AUXCSR 0x1C #define CIPHY_AUXCSR_ANEGDONE 0x8000 /* Autoneg complete */ #define CIPHY_AUXCSR_ANEGOFF 0x4000 /* Autoneg disabled */ Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/e1000phy.c Mon Jul 25 14:44:00 2011 (r224315) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/7/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/7/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/7/sys/dev/mii/mii_physubr.c Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/mii_physubr.c Mon Jul 25 14:44:00 2011 (r224315) @@ -109,7 +109,7 @@ mii_phy_setmedia(struct mii_softc *sc) /* * Force renegotiation if MIIF_DOPAUSE or MIIF_FORCEANEG. * The former is necessary as we might switch from flow- - * control advertisment being off to on or vice versa. + * control advertisement being off to on or vice versa. */ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || (sc->mii_flags & (MIIF_DOPAUSE | MIIF_FORCEANEG)) != 0) Modified: stable/7/sys/dev/mii/miivar.h ============================================================================== --- stable/7/sys/dev/mii/miivar.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/miivar.h Mon Jul 25 14:44:00 2011 (r224315) @@ -134,7 +134,7 @@ typedef struct mii_softc mii_softc_t; #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ #define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ -#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisment */ +#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisement */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ #define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ #define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ Modified: stable/7/sys/dev/mii/rgephyreg.h ============================================================================== --- stable/7/sys/dev/mii/rgephyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/rgephyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -66,7 +66,7 @@ #define RGEPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define RGEPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define RGEPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define RGEPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define RGEPHY_BMSR_LINK 0x0004 /* Link status */ #define RGEPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/7/sys/dev/mii/xmphyreg.h ============================================================================== --- stable/7/sys/dev/mii/xmphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/xmphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -51,7 +51,7 @@ #define XMPHY_MII_BMSR 0x01 #define XMPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define XMPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define XMPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define XMPHY_BMSR_LINK 0x0004 /* Link status */ #define XMPHY_BMSR_EXT 0x0001 /* Extended capability */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:45:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A26D1065670; Mon, 25 Jul 2011 14:45:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC0078FC0C; Mon, 25 Jul 2011 14:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEjD40061000; Mon, 25 Jul 2011 14:45:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEjDC4060993; Mon, 25 Jul 2011 14:45:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251445.p6PEjDC4060993@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224316 - in stable/7/sys/sparc64: include sbus sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:45:14 -0000 Author: marius Date: Mon Jul 25 14:45:13 2011 New Revision: 224316 URL: http://svn.freebsd.org/changeset/base/224316 Log: MFC: r220939 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/sparc64/include/cpufunc.h stable/7/sys/sparc64/sbus/lsi64854.c stable/7/sys/sparc64/sbus/ofw_sbus.h stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/7/sys/sparc64/include/cpufunc.h Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:13 2011 (r224316) @@ -187,7 +187,7 @@ int fasword32(u_long asi, void *addr, ui /* * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that - * can cause these writes to fail under certain condidtions which in turn + * can cause these writes to fail under certain conditions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE * register back immediately after writing to it with these two instructions * aligned to a quadword boundary in order to ensure that I$ misses won't Modified: stable/7/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/7/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:13 2011 (r224316) @@ -528,7 +528,7 @@ lsi64854_scsi_intr(void *arg) } trans = sc->sc_dmasize - resid; - if (trans < 0) { /* transfered < 0? */ + if (trans < 0) { /* transferred < 0? */ #if 0 /* * This situation can happen in perfectly normal operation @@ -718,7 +718,7 @@ lsi64854_pp_intr(void *arg) sc->sc_active = 0; trans = sc->sc_dmasize - resid; - if (trans < 0) /* transfered < 0? */ + if (trans < 0) /* transferred < 0? */ trans = sc->sc_dmasize; *sc->sc_dmalen -= trans; *sc->sc_dmaaddr += trans; Modified: stable/7/sys/sparc64/sbus/ofw_sbus.h ============================================================================== --- stable/7/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:13 2011 (r224316) @@ -41,7 +41,7 @@ struct sbus_regs { u_int32_t sbr_size; }; -/* Address translation accross busses */ +/* Address translation across busses */ struct sbus_ranges { u_int32_t cspace; /* Client space */ u_int32_t coffset; /* Client offset */ Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:13 2011 (r224316) @@ -377,7 +377,7 @@ END(rsf_fatal) * Due to its size a trap table is an inherently hard thing to represent in * code in a clean way. There are approximately 1024 vectors, of 8 or 32 * instructions each, many of which are identical. The way that this is - * layed out is the instructions (8 or 32) for the actual trap vector appear + * laid out is the instructions (8 or 32) for the actual trap vector appear * as an AS macro. In general this code branches to tl0_trap or tl1_trap, * but if not supporting code can be placed just after the definition of the * macro. The macros are then instantiated in a different section (.trap), @@ -2405,7 +2405,7 @@ ENTRY(tl0_ret) * Check for pending asts atomically with returning. We must raise * the PIL before checking, and if no asts are found the PIL must * remain raised until the retry is executed, or we risk missing asts - * caused by interrupts occuring after the test. If the PIL is + * caused by interrupts occurring after the test. If the PIL is * lowered, as it is when we call ast, the check must be re-executed. */ wrpr %g0, PIL_TICK, %pil Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:13 2011 (r224316) @@ -557,7 +557,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * is necessary in order to set obp-control-relinquished to true * within the PROM so obtaining /virtual-memory/translations doesn't * trigger a fatal reset error or worse things further down the road. - * XXX it should be possible to use this soley instead of writing + * XXX it should be possible to use this solely instead of writing * %tba in cpu_setregs(). Doing so causes a hang however. */ sun4u_set_traptable(tl0_base); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:13 2011 (r224316) @@ -930,7 +930,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) /* * Map a wired page into kernel virtual address space. This additionally - * takes a flag argument wich is or'ed to the TTE data. This is used by + * takes a flag argument which is or'ed to the TTE data. This is used by * sparc64_bus_mem_map(). * NOTE: if the mapping is non-cacheable, it's the caller's responsibility * to flush entries that might still be in the cache, if applicable. From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:45:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 315981065676; Mon, 25 Jul 2011 14:45:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3C38FC1C; Mon, 25 Jul 2011 14:45:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEjIra061035; Mon, 25 Jul 2011 14:45:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEjHZj061028; Mon, 25 Jul 2011 14:45:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251445.p6PEjHZj061028@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224317 - in stable/8/sys/sparc64: include sbus sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:45:18 -0000 Author: marius Date: Mon Jul 25 14:45:17 2011 New Revision: 224317 URL: http://svn.freebsd.org/changeset/base/224317 Log: MFC: r220939 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/sparc64/include/cpufunc.h stable/8/sys/sparc64/sbus/lsi64854.c stable/8/sys/sparc64/sbus/ofw_sbus.h stable/8/sys/sparc64/sparc64/exception.S stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/8/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:17 2011 (r224317) @@ -187,7 +187,7 @@ int fasword32(u_long asi, void *addr, ui /* * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that - * can cause these writes to fail under certain condidtions which in turn + * can cause these writes to fail under certain conditions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE * register back immediately after writing to it with these two instructions * aligned to a quadword boundary in order to ensure that I$ misses won't Modified: stable/8/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/8/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:17 2011 (r224317) @@ -521,7 +521,7 @@ lsi64854_scsi_intr(void *arg) } trans = sc->sc_dmasize - resid; - if (trans < 0) { /* transfered < 0? */ + if (trans < 0) { /* transferred < 0? */ #if 0 /* * This situation can happen in perfectly normal operation @@ -711,7 +711,7 @@ lsi64854_pp_intr(void *arg) sc->sc_active = 0; trans = sc->sc_dmasize - resid; - if (trans < 0) /* transfered < 0? */ + if (trans < 0) /* transferred < 0? */ trans = sc->sc_dmasize; *sc->sc_dmalen -= trans; *sc->sc_dmaaddr += trans; Modified: stable/8/sys/sparc64/sbus/ofw_sbus.h ============================================================================== --- stable/8/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:17 2011 (r224317) @@ -41,7 +41,7 @@ struct sbus_regs { u_int32_t sbr_size; }; -/* Address translation accross busses */ +/* Address translation across busses */ struct sbus_ranges { u_int32_t cspace; /* Client space */ u_int32_t coffset; /* Client offset */ Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:17 2011 (r224317) @@ -381,7 +381,7 @@ END(rsf_fatal) * Due to its size a trap table is an inherently hard thing to represent in * code in a clean way. There are approximately 1024 vectors, of 8 or 32 * instructions each, many of which are identical. The way that this is - * layed out is the instructions (8 or 32) for the actual trap vector appear + * laid out is the instructions (8 or 32) for the actual trap vector appear * as an AS macro. In general this code branches to tl0_trap or tl1_trap, * but if not supporting code can be placed just after the definition of the * macro. The macros are then instantiated in a different section (.trap), @@ -2486,7 +2486,7 @@ ENTRY(tl0_ret) * Check for pending asts atomically with returning. We must raise * the PIL before checking, and if no asts are found the PIL must * remain raised until the retry is executed, or we risk missing asts - * caused by interrupts occuring after the test. If the PIL is + * caused by interrupts occurring after the test. If the PIL is * lowered, as it is when we call ast, the check must be re-executed. */ wrpr %g0, PIL_TICK, %pil Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:17 2011 (r224317) @@ -565,7 +565,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * is necessary in order to set obp-control-relinquished to true * within the PROM so obtaining /virtual-memory/translations doesn't * trigger a fatal reset error or worse things further down the road. - * XXX it should be possible to use this soley instead of writing + * XXX it should be possible to use this solely instead of writing * %tba in cpu_setregs(). Doing so causes a hang however. */ sun4u_set_traptable(tl0_base); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:13 2011 (r224316) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:17 2011 (r224317) @@ -1058,7 +1058,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) /* * Map a wired page into kernel virtual address space. This additionally - * takes a flag argument wich is or'ed to the TTE data. This is used by + * takes a flag argument which is or'ed to the TTE data. This is used by * sparc64_bus_mem_map(). * NOTE: if the mapping is non-cacheable, it's the caller's responsibility * to flush entries that might still be in the cache, if applicable. From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:46:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55ACC1065673; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC5B8FC1E; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEkPKb061161; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEkPuO061158; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251446.p6PEkPuO061158@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224318 - stable/8/sys/dev/hme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:46:25 -0000 Author: marius Date: Mon Jul 25 14:46:24 2011 New Revision: 224318 URL: http://svn.freebsd.org/changeset/base/224318 Log: MFC: r220940 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/hme/if_hme.c stable/8/sys/dev/hme/if_hmereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/hme/if_hme.c ============================================================================== --- stable/8/sys/dev/hme/if_hme.c Mon Jul 25 14:45:17 2011 (r224317) +++ stable/8/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224318) @@ -203,7 +203,7 @@ hme_config(struct hme_softc *sc) * the DMA bus tag: * sc_dmatag * - * the bus handles, tags and offsets (splitted for SBus compatability): + * the bus handles, tags and offsets (splitted for SBus compatibility): * sc_seb{t,h,o} (Shared Ethernet Block registers) * sc_erx{t,h,o} (Receiver Unit registers) * sc_etx{t,h,o} (Transmitter Unit registers) @@ -1559,7 +1559,7 @@ hme_mediachange_locked(struct hme_softc * If both PHYs are present reset them. This is required for * unisolating the previously isolated PHY when switching PHYs. * As the above hme_mifinit() call will set the MII drivers in - * the XIF configuration register accoring to the currently + * the XIF configuration register according to the currently * selected media, there should be no window during which the * data paths of both transceivers are open at the same time, * even if the PHY device drivers use MIIF_NOISOLATE. Modified: stable/8/sys/dev/hme/if_hmereg.h ============================================================================== --- stable/8/sys/dev/hme/if_hmereg.h Mon Jul 25 14:45:17 2011 (r224317) +++ stable/8/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224318) @@ -79,7 +79,7 @@ #define HME_SEB_STAT_TXEACK 0x04000000 /* error during tx DMA */ #define HME_SEB_STAT_TXLERR 0x08000000 /* late error during tx DMA */ #define HME_SEB_STAT_TXPERR 0x10000000 /* parity error during tx DMA */ -#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error durig tx DMA */ +#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error during tx DMA */ #define HME_SEB_STAT_SLVERR 0x40000000 /* pio access error */ #define HME_SEB_STAT_SLVPERR 0x80000000 /* pio access parity error */ #define HME_SEB_STAT_BITS "\177\020" \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:46:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 762B8106564A; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B72A8FC1F; Mon, 25 Jul 2011 14:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEkPdW061166; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEkPkp061163; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251446.p6PEkPkp061163@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224319 - stable/7/sys/dev/hme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:46:25 -0000 Author: marius Date: Mon Jul 25 14:46:24 2011 New Revision: 224319 URL: http://svn.freebsd.org/changeset/base/224319 Log: MFC: r220940 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/hme/if_hme.c stable/7/sys/dev/hme/if_hmereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hme/if_hme.c ============================================================================== --- stable/7/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224318) +++ stable/7/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224319) @@ -203,7 +203,7 @@ hme_config(struct hme_softc *sc) * the DMA bus tag: * sc_dmatag * - * the bus handles, tags and offsets (splitted for SBus compatability): + * the bus handles, tags and offsets (splitted for SBus compatibility): * sc_seb{t,h,o} (Shared Ethernet Block registers) * sc_erx{t,h,o} (Receiver Unit registers) * sc_etx{t,h,o} (Transmitter Unit registers) @@ -1559,7 +1559,7 @@ hme_mediachange_locked(struct hme_softc * If both PHYs are present reset them. This is required for * unisolating the previously isolated PHY when switching PHYs. * As the above hme_mifinit() call will set the MII drivers in - * the XIF configuration register accoring to the currently + * the XIF configuration register according to the currently * selected media, there should be no window during which the * data paths of both transceivers are open at the same time, * even if the PHY device drivers use MIIF_NOISOLATE. Modified: stable/7/sys/dev/hme/if_hmereg.h ============================================================================== --- stable/7/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224318) +++ stable/7/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224319) @@ -79,7 +79,7 @@ #define HME_SEB_STAT_TXEACK 0x04000000 /* error during tx DMA */ #define HME_SEB_STAT_TXLERR 0x08000000 /* late error during tx DMA */ #define HME_SEB_STAT_TXPERR 0x10000000 /* parity error during tx DMA */ -#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error durig tx DMA */ +#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error during tx DMA */ #define HME_SEB_STAT_SLVERR 0x40000000 /* pio access error */ #define HME_SEB_STAT_SLVPERR 0x80000000 /* pio access parity error */ #define HME_SEB_STAT_BITS "\177\020" \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 14:59:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50920106566C; Mon, 25 Jul 2011 14:59:58 +0000 (UTC) (envelope-from vadim@nuclight.avtf.net) Received: from nuclight.avtf.net (208.88.188.90.adsl.tomsknet.ru [90.188.88.208]) by mx1.freebsd.org (Postfix) with ESMTP id 967528FC08; Mon, 25 Jul 2011 14:59:56 +0000 (UTC) Received: from kernblitz.nuclight.avtf.net (vadim@localhost [127.0.0.1]) by nuclight.avtf.net (8.14.4/8.14.4) with ESMTP id p6PExpkJ073766; Mon, 25 Jul 2011 21:59:51 +0700 (NOVST) (envelope-from vadim@kernblitz.nuclight.avtf.net) Received: (from vadim@localhost) by kernblitz.nuclight.avtf.net (8.14.4/8.14.4/Submit) id p6PExnOn073763; Mon, 25 Jul 2011 21:59:49 +0700 (NOVST) (envelope-from vadim) Message-Id: <201107251459.p6PExnOn073763@kernblitz.nuclight.avtf.net> To: Nathan Whitehorn From: Vadim Goncharov In-Reply-To: <4E230876.5050400@freebsd.org> References: <201107092301.p69N1sUp019626__19145.5060652972$1310252550$gmane$org@svn.freebsd.org> <201107121004.p6CA4apj070450@kernblitz.nuclight.avtf.net> <4E1C4955.7010206@freebsd.org> <201107151416.p6FEGQgQ018154@kernblitz.nuclight.avtf.net> <4E2054AF.2040701__44463.8588619002$1310741734$gmane$org@freebsd.org> <201107171242.p6HCgknb028607@kernblitz.nuclight.avtf.net> <4E230876.5050400@freebsd.org> X-Comment-To: Nathan Whitehorn Date: Mon, 25 Jul 2011 21:59:48 +0700 User-Agent: slrn/0.9.9p1 (FreeBSD) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: doceng@freebsd.org, svn-src-all@freebsd.org, Team , FreeBSD Subject: Re: svn commit: r223897 - in head: release usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vadim_nuclight@mail.ru List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:59:58 -0000 Hi Nathan Whitehorn! On Sun, 17 Jul 2011 11:06:14 -0500; Nathan Whitehorn wrote: >>> as well as letting >>> people try out the operating system and expanding the range of system >>> functionality available to the installer. This takes space. Some of that >>> space is at the expense of other things, but I personally believe that >>> trade-off is very much worth while. >> This shouldn't trade off really. Is that stuff using geom_uzip(4) to save >> space? This is just as simple as doing mkuzip -v mfs_root.md and tweaking >> loader.conf for vfs.root.mountfrom, mfsroot_name and module loading. > The installation disks are also straight ISO9660 now. There is no > mdroot, so none of this is possible. Why? The mdroot has benefits, like of being able to switch disks, for example. And, the base system could be installed directly by copying LiveCD files from gzipped mdroot, not wasting space for another archive of the same files. >>> the release scripts and the installer. Presumably, the release will also >>> include a second CD (or DVD) full of packages, which will contain the >>> full handbook. >> That's also a variant, but the commit says about requirement to have network, >> not CD2, or am I missing something? > There isn't a CD2 anymore. Also, because there is no MDROOT, you can't > use a CD2 from the installer without two CD drives. But you write below "There will be on the second packages disk". How this could be if there is no CD2 ? Also, in the future there will arise need for DVD1 and DVD2, thus scheme with several disks chould be done sooner, with CDs. >>> The complication for the release building scripts is that >>> they generate finished ISOs, so anything that goes on the image must be >>> available to the script. The scripts no longer build packages of any >>> kind, and so building even one package substantially adds to their >>> complication. >> That's sounds strange - installation disks always included some packages. >> How it is done, then? > Package installation is treated as a post-install issue. With the > specific exception of the documentation installation, the installer > doesn't know anything about packages and can't install them. This sounds even more strange. How does it work, at all? Is there any publicly available docs about the new installer? Installing of packages have always been conceptually a part of installation process (though it should be availiable to run it any time later, too), so why installer can't do this? >>> I also personally think it's not required or even important to provide a >>> way to install the handbook from disc1. The main documentation format >>> for it is HTML, for which we package no readers on disc1. Additionally, >> There was also a .txt version earlier days. What about .txt version? Is it generated nowadays? >>> I'm guessing that basically all of our users read it on www.freebsd.org >>> these days instead of from /usr/local/share, which potentially makes it >>> superfluous to package it at all. Further, without the handbook, how >>> would a new user know to look for it at that path? >> The typical path is that user has heard about Handbook and even looked >> into a chapter or two on the site. Nobody reads entire Handbook before >> install, however (this is just impractical and boring), so he proceeds >> and then founds that there is no network in FreeBSD out-of-box for his >> particular ISP and he needs to read Handbook (and use mpd5 package) - >> but now there will be no Handbook, alas. > There will be on the second packages disk. The user may also have > another computer, have printed out bits of the handbook, be dual-booting > etc. Don't force user to do expensive things like printing, having another computer, etc. You have no right to do this. That's not an option, as it shrinks our userbase. Given current conditions - as there is 9.0 too soon - we are stuck with docs on the second packages disk (or DVD), as the only really available solution. This situation should be resolved before next release. > I know I've never used the installed handbook before (preferring > the online one), and didn't even know where it had installed itself to > until starting to work on the release-building code. Don't expect novice user to be like you. And I have actually used handbook from /usr/share in my first installation (and Internet there was only available via dial-up by winmodem not available in 4.x). -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight] From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:01:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30E39106566C; Mon, 25 Jul 2011 15:01:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F7068FC1A; Mon, 25 Jul 2011 15:01:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF1cVc061731; Mon, 25 Jul 2011 15:01:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF1c0D061729; Mon, 25 Jul 2011 15:01:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251501.p6PF1c0D061729@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224320 - stable/8/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:01:38 -0000 Author: marius Date: Mon Jul 25 15:01:37 2011 New Revision: 224320 URL: http://svn.freebsd.org/changeset/base/224320 Log: MFC: r220941 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/gem/if_gem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 14:46:24 2011 (r224319) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 15:01:37 2011 (r224320) @@ -1069,7 +1069,7 @@ gem_init_locked(struct gem_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ GEM_BANK1_WRITE_4(sc, GEM_RX_KICK, GEM_NRXDESC - 4); ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:01:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C86F106564A; Mon, 25 Jul 2011 15:01:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3B78FC0A; Mon, 25 Jul 2011 15:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF1ewf061766; Mon, 25 Jul 2011 15:01:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF1eqf061764; Mon, 25 Jul 2011 15:01:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251501.p6PF1eqf061764@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224321 - stable/7/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:01:40 -0000 Author: marius Date: Mon Jul 25 15:01:40 2011 New Revision: 224321 URL: http://svn.freebsd.org/changeset/base/224321 Log: MFC: r220941 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/gem/if_gem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 15:01:37 2011 (r224320) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 15:01:40 2011 (r224321) @@ -1069,7 +1069,7 @@ gem_init_locked(struct gem_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ GEM_BANK1_WRITE_4(sc, GEM_RX_KICK, GEM_NRXDESC - 4); ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:05:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A51D7106564A; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B208FC1E; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF5bHB061988; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF5bv4061986; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251505.p6PF5bv4061986@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224322 - stable/7/sys/dev/cas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:05:37 -0000 Author: marius Date: Mon Jul 25 15:05:37 2011 New Revision: 224322 URL: http://svn.freebsd.org/changeset/base/224322 Log: MFC: r220943 Correct spelling in a comment. Submitted by: brucec Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Mon Jul 25 15:01:40 2011 (r224321) +++ stable/7/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224322) @@ -1153,7 +1153,7 @@ cas_init_locked(struct cas_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ CAS_WRITE_4(sc, CAS_RX_KICK, CAS_NRXDESC - 4); CAS_WRITE_4(sc, CAS_RX_COMP_TAIL, 0); if ((sc->sc_flags & CAS_REG_PLUS) != 0) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:05:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 099A01065676; Mon, 25 Jul 2011 15:05:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB908FC1F; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PF5bbW062003; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF5b53062001; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251505.p6PF5b53062001@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224323 - stable/8/sys/dev/cas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:05:38 -0000 Author: marius Date: Mon Jul 25 15:05:37 2011 New Revision: 224323 URL: http://svn.freebsd.org/changeset/base/224323 Log: MFC: r220943 Correct spelling in a comment. Submitted by: brucec Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224322) +++ stable/8/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224323) @@ -1153,7 +1153,7 @@ cas_init_locked(struct cas_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ CAS_WRITE_4(sc, CAS_RX_KICK, CAS_NRXDESC - 4); CAS_WRITE_4(sc, CAS_RX_COMP_TAIL, 0); if ((sc->sc_flags & CAS_REG_PLUS) != 0) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:10:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DB4A106566C; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB378FC1A; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PFArMr062276; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFArYG062271; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251510.p6PFArYG062271@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224324 - stable/8/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:10:53 -0000 Author: marius Date: Mon Jul 25 15:10:52 2011 New Revision: 224324 URL: http://svn.freebsd.org/changeset/base/224324 Log: MFC: r220944, r220950 - Correct spelling. [1] - Remove variables which are unused besides initialization. [2] Submitted by: brucec, N.J. Mann [1], Christoph Mallon [2] Modified: stable/8/sys/dev/sym/README.sym stable/8/sys/dev/sym/sym_fw1.h stable/8/sys/dev/sym/sym_fw2.h stable/8/sys/dev/sym/sym_hipd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/sym/README.sym ============================================================================== --- stable/8/sys/dev/sym/README.sym Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/README.sym Mon Jul 25 15:10:52 2011 (r224324) @@ -70,7 +70,7 @@ using `man sym' for driver usage and fea I haven't removed this README file from the repository since I may have to provide additional documentation to people interested in understanding the driver sources and/or in helping -driver development and maintainance. +driver development and maintenance. As a result, this file is now under reconstruction. :-) Modified: stable/8/sys/dev/sym/sym_fw1.h ============================================================================== --- stable/8/sys/dev/sym/sym_fw1.h Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:52 2011 (r224324) @@ -1027,7 +1027,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -1051,7 +1051,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ RADDR_1 (dsa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1352,7 +1352,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1461,7 +1461,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_COPY (1), Modified: stable/8/sys/dev/sym/sym_fw2.h ============================================================================== --- stable/8/sys/dev/sym/sym_fw2.h Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:52 2011 (r224324) @@ -945,7 +945,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -957,7 +957,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ offsetof(struct sym_lcb, head.itlq_tbl_sa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1213,7 +1213,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1320,7 +1320,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_STORE_REL (scratcha, 1), Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Mon Jul 25 15:05:37 2011 (r224323) +++ stable/8/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:52 2011 (r224324) @@ -366,7 +366,7 @@ static void MDELAY(int ms) { while (ms-- * from the SCRIPTS code. In addition, cache line alignment * is guaranteed for power of 2 cache line size. * - * This allocator has been developped for the Linux sym53c8xx + * This allocator has been developed for the Linux sym53c8xx * driver, since this O/S does not provide naturally aligned * allocations. * It has the advantage of allowing the driver to use private @@ -1959,10 +1959,8 @@ static void sym_fw1_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw1a_scr *scripta0; - struct sym_fw1b_scr *scriptb0; scripta0 = (struct sym_fw1a_scr *) np->scripta0; - scriptb0 = (struct sym_fw1b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -1983,10 +1981,8 @@ static void sym_fw2_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw2a_scr *scripta0; - struct sym_fw2b_scr *scriptb0; scripta0 = (struct sym_fw2a_scr *) np->scripta0; - scriptb0 = (struct sym_fw2b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -2294,7 +2290,7 @@ static void sym_nvram_setup_target (hcb_ static int sym_read_nvram (hcb_p np, struct sym_nvram *nvp); /* - * Print something which allows to retrieve the controler type, + * Print something which allows to retrieve the controller type, * unit, target, lun concerned by a kernel message. */ static void PRINT_TARGET (hcb_p np, int target) @@ -4300,7 +4296,7 @@ static void sym_int_ma (hcb_p np) } /* - * The data in the dma fifo has not been transfered to + * The data in the dma fifo has not been transferred to * the target -> add the amount to the rest * and clear the data. * Check the sstat2 register in case of wide transfer. @@ -7520,7 +7516,7 @@ static void sym_action(struct cam_sim *s } /* - * Retreive the target and lun descriptors. + * Retrieve the target and lun descriptors. */ tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:10:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9B081065673; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7B168FC1C; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PFArc2062294; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFArgw062289; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251510.p6PFArgw062289@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224325 - stable/7/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:10:53 -0000 Author: marius Date: Mon Jul 25 15:10:53 2011 New Revision: 224325 URL: http://svn.freebsd.org/changeset/base/224325 Log: MFC: r220944, r220950 - Correct spelling. [1] - Remove variables which are unused besides initialization. [2] Submitted by: brucec, N.J. Mann [1], Christoph Mallon [2] Modified: stable/7/sys/dev/sym/README.sym stable/7/sys/dev/sym/sym_fw1.h stable/7/sys/dev/sym/sym_fw2.h stable/7/sys/dev/sym/sym_hipd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sym/README.sym ============================================================================== --- stable/7/sys/dev/sym/README.sym Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/README.sym Mon Jul 25 15:10:53 2011 (r224325) @@ -70,7 +70,7 @@ using `man sym' for driver usage and fea I haven't removed this README file from the repository since I may have to provide additional documentation to people interested in understanding the driver sources and/or in helping -driver development and maintainance. +driver development and maintenance. As a result, this file is now under reconstruction. :-) Modified: stable/7/sys/dev/sym/sym_fw1.h ============================================================================== --- stable/7/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:53 2011 (r224325) @@ -1027,7 +1027,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -1051,7 +1051,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ RADDR_1 (dsa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1352,7 +1352,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1461,7 +1461,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_COPY (1), Modified: stable/7/sys/dev/sym/sym_fw2.h ============================================================================== --- stable/7/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:53 2011 (r224325) @@ -945,7 +945,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -957,7 +957,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ offsetof(struct sym_lcb, head.itlq_tbl_sa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1213,7 +1213,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1320,7 +1320,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_STORE_REL (scratcha, 1), Modified: stable/7/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/7/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:53 2011 (r224325) @@ -366,7 +366,7 @@ static void MDELAY(int ms) { while (ms-- * from the SCRIPTS code. In addition, cache line alignment * is guaranteed for power of 2 cache line size. * - * This allocator has been developped for the Linux sym53c8xx + * This allocator has been developed for the Linux sym53c8xx * driver, since this O/S does not provide naturally aligned * allocations. * It has the advantage of allowing the driver to use private @@ -1959,10 +1959,8 @@ static void sym_fw1_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw1a_scr *scripta0; - struct sym_fw1b_scr *scriptb0; scripta0 = (struct sym_fw1a_scr *) np->scripta0; - scriptb0 = (struct sym_fw1b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -1983,10 +1981,8 @@ static void sym_fw2_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw2a_scr *scripta0; - struct sym_fw2b_scr *scriptb0; scripta0 = (struct sym_fw2a_scr *) np->scripta0; - scriptb0 = (struct sym_fw2b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -2294,7 +2290,7 @@ static void sym_nvram_setup_target (hcb_ static int sym_read_nvram (hcb_p np, struct sym_nvram *nvp); /* - * Print something which allows to retrieve the controler type, + * Print something which allows to retrieve the controller type, * unit, target, lun concerned by a kernel message. */ static void PRINT_TARGET (hcb_p np, int target) @@ -4300,7 +4296,7 @@ static void sym_int_ma (hcb_p np) } /* - * The data in the dma fifo has not been transfered to + * The data in the dma fifo has not been transferred to * the target -> add the amount to the rest * and clear the data. * Check the sstat2 register in case of wide transfer. @@ -7520,7 +7516,7 @@ static void sym_action(struct cam_sim *s } /* - * Retreive the target and lun descriptors. + * Retrieve the target and lun descriptors. */ tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 15:14:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B635106564A; Mon, 25 Jul 2011 15:14:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A10A8FC12; Mon, 25 Jul 2011 15:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PFE4xQ062461; Mon, 25 Jul 2011 15:14:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFE466062459; Mon, 25 Jul 2011 15:14:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107251514.p6PFE466062459@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Jul 2011 15:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224326 - stable/8/contrib/pf/ftp-proxy X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:14:04 -0000 Author: bz Date: Mon Jul 25 15:14:03 2011 New Revision: 224326 URL: http://svn.freebsd.org/changeset/base/224326 Log: Flush output buffers before closing TCP session. Fixes the case where the proxy would eat the 221 response coming from the server towards the client. This is a commit as HEAD got the change with the entire pf45 import. PR: bin/154469 Obtained from: OpenBSD r1.18 MFC after: 2 weeks Modified: stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Modified: stable/8/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Mon Jul 25 15:10:53 2011 (r224325) +++ stable/8/contrib/pf/ftp-proxy/ftp-proxy.c Mon Jul 25 15:14:03 2011 (r224326) @@ -273,6 +273,12 @@ end_session(struct session *s) logmsg(LOG_INFO, "#%d ending session", s->id); + /* Flush output buffers. */ + if (s->client_bufev && s->client_fd != -1) + evbuffer_write(s->client_bufev->output, s->client_fd); + if (s->server_bufev && s->server_fd != -1) + evbuffer_write(s->server_bufev->output, s->server_fd); + if (s->client_fd != -1) close(s->client_fd); if (s->server_fd != -1) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:11:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E080D106566C; Mon, 25 Jul 2011 16:11:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB488FC1A; Mon, 25 Jul 2011 16:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGBqka064184; Mon, 25 Jul 2011 16:11:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGBq7O064179; Mon, 25 Jul 2011 16:11:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251611.p6PGBq7O064179@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224327 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:11:53 -0000 Author: marius Date: Mon Jul 25 16:11:52 2011 New Revision: 224327 URL: http://svn.freebsd.org/changeset/base/224327 Log: MFC: r198262 Use callout_init_mtx on FreeBSD versions recent enough. This closes the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:11:52 2011 (r224327) @@ -1239,7 +1239,6 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); - mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); @@ -2252,6 +2251,7 @@ mpt_core_attach(struct mpt_softc *mpt) for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { request_t *req = &mpt->request_pool[val]; req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); mpt_free_request(mpt, req); } MPT_UNLOCK(mpt); @@ -2335,10 +2335,18 @@ mpt_core_shutdown(struct mpt_softc *mpt) void mpt_core_detach(struct mpt_softc *mpt) { + int val; + /* * XXX: FREE MEMORY */ mpt_disable_ints(mpt); + + /* Make sure no request has pending timeouts. */ + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + mpt_callout_drain(mpt, &req->callout); + } } int Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:11:52 2011 (r224327) @@ -303,13 +303,6 @@ void mpt_map_rquest(void *, bus_dma_segm kthread_exit(status) #endif -/****************************** Timer Facilities ******************************/ -#if __FreeBSD_version > 500000 -#define mpt_callout_init(c) callout_init(c, /*mpsafe*/1); -#else -#define mpt_callout_init(c) callout_init(c); -#endif - /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) #define MPT_2_HOST32(ptr, tag) ptr->tag = le32toh(ptr->tag) @@ -897,6 +890,10 @@ mpt_sleep(struct mpt_softc *mpt, void *i callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c) +#define mpt_callout_drain(mpt, c) \ + callout_stop(c) #else #if 1 @@ -919,9 +916,13 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); + callout_reset(&(req)->callout, (ticks), (func), (arg)) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init_mtx(c, &(mpt)->mpt_lock, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) #else @@ -934,18 +935,18 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define MPTLOCK_2_CAMLOCK(mpt) #define CAMLOCK_2_MPTLOCK(mpt) +#define mpt_req_timeout(req, ticks, func, arg) \ + callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_req_untimeout(req, func, arg) \ + callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) + static __inline int mpt_sleep(struct mpt_softc *, void *, int, const char *, int); -#define mpt_ccb_timeout(ccb, ticks, func, arg) \ - do { \ - (ccb)->ccb_h.timeout_ch = timeout((func), (arg), (ticks)); \ - } while (0) -#define mpt_ccb_untimeout(ccb, func, arg) \ - untimeout((func), (arg), (ccb)->ccb_h.timeout_ch) -#define mpt_ccb_timeout_init(ccb) \ - callout_handle_init(&(ccb)->ccb_h.timeout_ch) - static __inline int mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) { Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:11:52 2011 (r224327) @@ -1250,7 +1250,10 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, req->serno, ccb, req->ccb); @@ -1261,7 +1264,9 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } /* Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:11:52 2011 (r224327) @@ -271,7 +271,7 @@ mpt_raid_attach(struct mpt_softc *mpt) mpt_handler_t handler; int error; - mpt_callout_init(&mpt->raid_timer); + mpt_callout_init(mpt, &mpt->raid_timer); error = mpt_spawn_raid_thread(mpt); if (error != 0) { @@ -320,10 +320,10 @@ mpt_raid_detach(struct mpt_softc *mpt) struct ccb_setasync csa; mpt_handler_t handler; - callout_stop(&mpt->raid_timer); + mpt_callout_drain(mpt, &mpt->raid_timer); + MPT_LOCK(mpt); mpt_terminate_raid_thread(mpt); - handler.reply_handler = mpt_raid_reply_handler; mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, raid_handler_id); @@ -1570,9 +1570,14 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } void From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:14:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C361065692; Mon, 25 Jul 2011 16:14:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057548FC12; Mon, 25 Jul 2011 16:14:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGEajT064313; Mon, 25 Jul 2011 16:14:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGEaHl064311; Mon, 25 Jul 2011 16:14:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251614.p6PGEaHl064311@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224328 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:14:37 -0000 Author: marius Date: Mon Jul 25 16:14:36 2011 New Revision: 224328 URL: http://svn.freebsd.org/changeset/base/224328 Log: MFC: r207543 Print IR_RESYNC updates informatively. Obtained from: pluknet Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:11:52 2011 (r224327) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:14:36 2011 (r224328) @@ -2574,6 +2574,10 @@ mpt_cam_event(struct mpt_softc *mpt, req CAMLOCK_2_MPTLOCK(mpt); break; } + case MPI_EVENT_IR_RESYNC_UPDATE: + mpt_prt(mpt, "IR resync update %d completed\n", + (data0 >> 16) & 0xff); + break; case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:20:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA481106566C; Mon, 25 Jul 2011 16:20:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5788FC08; Mon, 25 Jul 2011 16:20:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGK088064551; Mon, 25 Jul 2011 16:20:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGK0x8064549; Mon, 25 Jul 2011 16:20:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251620.p6PGK0x8064549@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224329 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:20:00 -0000 Author: marius Date: Mon Jul 25 16:20:00 2011 New Revision: 224329 URL: http://svn.freebsd.org/changeset/base/224329 Log: MFC: r210943 Figure which is the IO and MEM bars- do not assume that they are in a fixed order. PR: 149220 Obtained from: John Baldwin Modified: stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:14:36 2011 (r224328) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:00 2011 (r224329) @@ -194,8 +194,6 @@ __FBSDID("$FreeBSD$"); #endif -#define MPT_IO_BAR 0 -#define MPT_MEM_BAR 1 static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); @@ -420,6 +418,7 @@ mpt_pci_attach(device_t dev) struct mpt_softc *mpt; int iqd; uint32_t data, cmd; + int mpt_io_bar, mpt_mem_bar; /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); @@ -505,11 +504,25 @@ mpt_pci_attach(device_t dev) } /* + * Figure out which are the I/O and MEM Bars + */ + data = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(data)) { + /* BAR0 is IO, BAR1 is memory */ + mpt_io_bar = 0; + mpt_mem_bar = 1; + } else { + /* BAR0 is memory, BAR1 is IO */ + mpt_mem_bar = 0; + mpt_io_bar = 1; + } + + /* * Set up register access. PIO mode is required for * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); + mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { @@ -520,7 +533,7 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); + mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:20:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3820106564A; Mon, 25 Jul 2011 16:20:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8EA28FC13; Mon, 25 Jul 2011 16:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGK2ce064583; Mon, 25 Jul 2011 16:20:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGK2HM064582; Mon, 25 Jul 2011 16:20:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251620.p6PGK2HM064582@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224330 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:20:02 -0000 Author: marius Date: Mon Jul 25 16:20:02 2011 New Revision: 224330 URL: http://svn.freebsd.org/changeset/base/224330 Log: MFC: r210943 Figure which is the IO and MEM bars- do not assume that they are in a fixed order. PR: 149220 Obtained from: John Baldwin Modified: stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:00 2011 (r224329) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:02 2011 (r224330) @@ -194,8 +194,6 @@ __FBSDID("$FreeBSD$"); #endif -#define MPT_IO_BAR 0 -#define MPT_MEM_BAR 1 static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); @@ -420,6 +418,7 @@ mpt_pci_attach(device_t dev) struct mpt_softc *mpt; int iqd; uint32_t data, cmd; + int mpt_io_bar, mpt_mem_bar; /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); @@ -505,11 +504,25 @@ mpt_pci_attach(device_t dev) } /* + * Figure out which are the I/O and MEM Bars + */ + data = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(data)) { + /* BAR0 is IO, BAR1 is memory */ + mpt_io_bar = 0; + mpt_mem_bar = 1; + } else { + /* BAR0 is memory, BAR1 is IO */ + mpt_mem_bar = 0; + mpt_io_bar = 1; + } + + /* * Set up register access. PIO mode is required for * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); + mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { @@ -520,7 +533,7 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); + mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:24:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C99D2106566B; Mon, 25 Jul 2011 16:24:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B85578FC1A; Mon, 25 Jul 2011 16:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGORYj064771; Mon, 25 Jul 2011 16:24:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGORJT064768; Mon, 25 Jul 2011 16:24:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251624.p6PGORJT064768@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224331 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:24:27 -0000 Author: marius Date: Mon Jul 25 16:24:27 2011 New Revision: 224331 URL: http://svn.freebsd.org/changeset/base/224331 Log: MFC: r203484 Do not release device, when changing number of openings. Modified: stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:20:02 2011 (r224330) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:24:27 2011 (r224331) @@ -2563,6 +2563,7 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = pqf->CurrentDepth - 1; xpt_action((union ccb *)&crs); Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:20:02 2011 (r224330) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:24:27 2011 (r224331) @@ -1062,6 +1062,7 @@ mpt_adjust_queue_depth(struct mpt_softc xpt_setup_ccb(&crs.ccb_h, path, /*priority*/5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = mpt->raid_queue_depth; xpt_action((union ccb *)&crs); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:45:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB031065670; Mon, 25 Jul 2011 16:45:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D45B8FC15; Mon, 25 Jul 2011 16:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGjDTm065506; Mon, 25 Jul 2011 16:45:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGjC1i065500; Mon, 25 Jul 2011 16:45:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251645.p6PGjC1i065500@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224332 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:45:13 -0000 Author: marius Date: Mon Jul 25 16:45:12 2011 New Revision: 224332 URL: http://svn.freebsd.org/changeset/base/224332 Log: MFC: r209599 (partial), r209960: r209960 | marius - Make the maxsize parameter of the data buffer DMA tag match maxio, which was missed in r209599. Reported and tested by: Michael Moll - Declare mpt_dma_buf_alloc() static just like mpt_dma_buf_free(), both are used in mpt.c only. Reviewed by: ken MFC after: r209599 r209599 | ken Change the mpt driver to allow larger I/O sizes. The mpt driver previously didn't report a 'maxio' size to CAM, and so the da(4) driver limited I/O sizes to DFLTPHYS (64K) by default. The number of scatter gather segments allowed, as reported to busdma, was (128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages. Change things around so that we wait until we've determined how many segments the adapter can support before creating the busdma tag used for buffers, so we can potentially support more S/G segments and therefore larger I/O sizes. Also, fix some things that were broken about the module unload path. It still gets hung up inside CAM, though. mpt.c: Move some busdma initialization calls in here, and call them just after we've gotten the IOCFacts, and know how many S/G segments this adapter can support. mpt.h: Add max_cam_seg_cnt. mpt_cam.c: Fix the locking in mpt_cam_detach(). mpt_pci.c: Pull some busdma initialization and teardown out and put it in mpt.c. We now delay it until we know many scatter gather segments the adapter can support, and therefore how to setup our busdma tags. mpt_raid.c: Make sure we wake up the right wait channel to get the raid thread to wake up when we're trying to shut it down. Reviewed by: gibbs, mjacob MFC after: 2 weeks Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_pci.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:45:12 2011 (r224332) @@ -128,6 +128,8 @@ static void mpt_send_event_ack(struct mp static int mpt_send_event_request(struct mpt_softc *mpt, int onoff); static int mpt_soft_reset(struct mpt_softc *mpt); static void mpt_hard_reset(struct mpt_softc *mpt); +static int mpt_dma_buf_alloc(struct mpt_softc *mpt); +static void mpt_dma_buf_free(struct mpt_softc *mpt); static int mpt_configure_ioc(struct mpt_softc *mpt, int, int); static int mpt_enable_ioc(struct mpt_softc *mpt, int); @@ -2247,14 +2249,6 @@ mpt_core_attach(struct mpt_softc *mpt) TAILQ_INIT(&mpt->request_pending_list); TAILQ_INIT(&mpt->request_free_list); TAILQ_INIT(&mpt->request_timeout_list); - MPT_LOCK(mpt); - for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { - request_t *req = &mpt->request_pool[val]; - req->state = REQ_STATE_ALLOCATED; - mpt_callout_init(mpt, &req->callout); - mpt_free_request(mpt, req); - } - MPT_UNLOCK(mpt); for (val = 0; val < MPT_MAX_LUNS; val++) { STAILQ_INIT(&mpt->trt[val].atios); STAILQ_INIT(&mpt->trt[val].inots); @@ -2347,6 +2341,8 @@ mpt_core_detach(struct mpt_softc *mpt) request_t *req = &mpt->request_pool[val]; mpt_callout_drain(mpt, &req->callout); } + + mpt_dma_buf_free(mpt); } int @@ -2481,6 +2477,105 @@ mpt_download_fw(struct mpt_softc *mpt) return (0); } +static int +mpt_dma_buf_alloc(struct mpt_softc *mpt) +{ + struct mpt_map_info mi; + uint8_t *vptr; + uint32_t pptr, end; + int i, error; + + /* Create a child tag for data buffers */ + if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE, + mpt->max_cam_seg_cnt, BUS_SPACE_MAXSIZE_32BIT, 0, + &mpt->buffer_dmat) != 0) { + mpt_prt(mpt, "cannot create a dma tag for data buffers\n"); + return (1); + } + + /* Create a child tag for request buffers */ + if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, + &mpt->request_dmat) != 0) { + mpt_prt(mpt, "cannot create a dma tag for requests\n"); + return (1); + } + + /* Allocate some DMA accessable memory for requests */ + if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, + BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", + MPT_REQ_MEM_SIZE(mpt)); + return (1); + } + + mi.mpt = mpt; + mi.error = 0; + + /* Load and lock it into "bus space" */ + bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request, + MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0); + + if (mi.error) { + mpt_prt(mpt, "error %d loading dma map for DMA request queue\n", + mi.error); + return (1); + } + mpt->request_phys = mi.phys; + + /* + * Now create per-request dma maps + */ + i = 0; + pptr = mpt->request_phys; + vptr = mpt->request; + end = pptr + MPT_REQ_MEM_SIZE(mpt); + while(pptr < end) { + request_t *req = &mpt->request_pool[i]; + req->index = i++; + + /* Store location of Request Data */ + req->req_pbuf = pptr; + req->req_vbuf = vptr; + + pptr += MPT_REQUEST_AREA; + vptr += MPT_REQUEST_AREA; + + req->sense_pbuf = (pptr - MPT_SENSE_SIZE); + req->sense_vbuf = (vptr - MPT_SENSE_SIZE); + + error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap); + if (error) { + mpt_prt(mpt, "error %d creating per-cmd DMA maps\n", + error); + return (1); + } + } + + return (0); +} + +static void +mpt_dma_buf_free(struct mpt_softc *mpt) +{ + int i; + if (mpt->request_dmat == 0) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n"); + return; + } + for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) { + bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap); + } + bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap); + bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap); + bus_dma_tag_destroy(mpt->request_dmat); + mpt->request_dmat = 0; + bus_dma_tag_destroy(mpt->buffer_dmat); +} + /* * Allocate/Initialize data structures for the controller. Called * once at instance startup. @@ -2489,7 +2584,7 @@ static int mpt_configure_ioc(struct mpt_softc *mpt, int tn, int needreset) { PTR_MSG_PORT_FACTS_REPLY pfp; - int error, port; + int error, port, val; size_t len; if (tn == MPT_MAX_TRYS) { @@ -2549,7 +2644,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* limited by the number of chain areas the card will support */ if (mpt->max_seg_cnt > mpt->ioc_facts.MaxChainDepth) { - mpt_lprt(mpt, MPT_PRT_DEBUG, + mpt_lprt(mpt, MPT_PRT_INFO, "chain depth limited to %u (from %u)\n", mpt->ioc_facts.MaxChainDepth, mpt->max_seg_cnt); mpt->max_seg_cnt = mpt->ioc_facts.MaxChainDepth; @@ -2558,17 +2653,37 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* converted to the number of simple sges in chain segments. */ mpt->max_seg_cnt *= (MPT_NSGL(mpt) - 1); - mpt_lprt(mpt, MPT_PRT_DEBUG, "Maximum Segment Count: %u\n", - mpt->max_seg_cnt); - mpt_lprt(mpt, MPT_PRT_DEBUG, "MsgLength=%u IOCNumber = %d\n", + /* + * Use this as the basis for reporting the maximum I/O size to CAM. + */ + mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + + error = mpt_dma_buf_alloc(mpt); + if (error != 0) { + mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n"); + return (EIO); + } + + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); + mpt_free_request(mpt, req); + } + + mpt_lprt(mpt, MPT_PRT_INFO, "Maximum Segment Count: %u, Maximum " + "CAM Segment Count: %u\n", mpt->max_seg_cnt, + mpt->max_cam_seg_cnt); + + mpt_lprt(mpt, MPT_PRT_INFO, "MsgLength=%u IOCNumber = %d\n", mpt->ioc_facts.MsgLength, mpt->ioc_facts.IOCNumber); - mpt_lprt(mpt, MPT_PRT_DEBUG, + mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: GlobalCredits=%d BlockSize=%u bytes " "Request Frame Size %u bytes Max Chain Depth %u\n", mpt->ioc_facts.GlobalCredits, mpt->ioc_facts.BlockSize, mpt->ioc_facts.RequestFrameSize << 2, mpt->ioc_facts.MaxChainDepth); - mpt_lprt(mpt, MPT_PRT_DEBUG, "IOCFACTS: Num Ports %d, FWImageSize %d, " + mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: Num Ports %d, FWImageSize %d, " "Flags=%#x\n", mpt->ioc_facts.NumberOfPorts, mpt->ioc_facts.FWImageSize, mpt->ioc_facts.Flags); @@ -2758,7 +2873,7 @@ mpt_enable_ioc(struct mpt_softc *mpt, in mpt_send_event_request(mpt, 1); if (mpt_send_port_enable(mpt, 0) != MPT_OK) { - mpt_prt(mpt, "failed to enable port 0\n"); + mpt_prt(mpt, "%s: failed to enable port 0\n", __func__); return (ENXIO); } } Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:45:12 2011 (r224332) @@ -743,6 +743,7 @@ struct mpt_softc { bus_addr_t request_phys; /* BusAddr of request memory */ uint32_t max_seg_cnt; /* calculated after IOC facts */ + uint32_t max_cam_seg_cnt;/* calculated from MAXPHYS*/ /* * Hardware management Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:45:12 2011 (r224332) @@ -1205,25 +1205,21 @@ mpt_cam_detach(struct mpt_softc *mpt) free(mpt->sas_portinfo, M_DEVBUF); mpt->sas_portinfo = NULL; } - MPT_UNLOCK(mpt); if (mpt->sim != NULL) { xpt_free_path(mpt->path); - MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->sim)); - MPT_UNLOCK(mpt); cam_sim_free(mpt->sim, TRUE); mpt->sim = NULL; } if (mpt->phydisk_sim != NULL) { xpt_free_path(mpt->phydisk_path); - MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->phydisk_sim)); - MPT_UNLOCK(mpt); cam_sim_free(mpt->phydisk_sim, TRUE); mpt->phydisk_sim = NULL; } + MPT_UNLOCK(mpt); } /* This routine is used after a system crash to dump core onto the swap device. @@ -3586,6 +3582,10 @@ mpt_action(struct cam_sim *sim, union cc cpi->target_sprt = 0; cpi->hba_eng_cnt = 0; cpi->max_target = mpt->port_facts[0].MaxDevices - 1; +#if 0 + cpi->maxio = (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE; +#endif + /* * FC cards report MAX_DEVICES of 512, but * the MSG_SCSI_IO_REQUEST target id field @@ -4226,7 +4226,7 @@ mpt_fc_post_els(struct mpt_softc *mpt, r /* * Okay, set up ELS buffer pointers. ELS buffer pointers * consist of a TE SGL element (with details length of zero) - * followe by a SIMPLE SGL element which holds the address + * followed by a SIMPLE SGL element which holds the address * of the buffer. */ Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:45:12 2011 (r224332) @@ -733,9 +733,6 @@ mpt_pci_shutdown(device_t dev) static int mpt_dma_mem_alloc(struct mpt_softc *mpt) { - int i, error, nsegs; - uint8_t *vptr; - uint32_t pptr, end; size_t len; struct mpt_map_info mi; @@ -808,82 +805,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) } mpt->reply_phys = mi.phys; - /* Create a child tag for data buffers */ - - /* - * XXX: we should say that nsegs is 'unrestricted, but that - * XXX: tickles a horrible bug in the busdma code. Instead, - * XXX: we'll derive a reasonable segment limit from MAXPHYS - */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, - 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, - NULL, NULL, MAXBSIZE, nsegs, BUS_SPACE_MAXSIZE_32BIT, 0, - &mpt->buffer_dmat) != 0) { - mpt_prt(mpt, "cannot create a dma tag for data buffers\n"); - return (1); - } - - /* Create a child tag for request buffers */ - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, - NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, - &mpt->request_dmat) != 0) { - mpt_prt(mpt, "cannot create a dma tag for requests\n"); - return (1); - } - - /* Allocate some DMA accessable memory for requests */ - if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { - mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", - MPT_REQ_MEM_SIZE(mpt)); - return (1); - } - - mi.mpt = mpt; - mi.error = 0; - - /* Load and lock it into "bus space" */ - bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request, - MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0); - - if (mi.error) { - mpt_prt(mpt, "error %d loading dma map for DMA request queue\n", - mi.error); - return (1); - } - mpt->request_phys = mi.phys; - - /* - * Now create per-request dma maps - */ - i = 0; - pptr = mpt->request_phys; - vptr = mpt->request; - end = pptr + MPT_REQ_MEM_SIZE(mpt); - while(pptr < end) { - request_t *req = &mpt->request_pool[i]; - req->index = i++; - - /* Store location of Request Data */ - req->req_pbuf = pptr; - req->req_vbuf = vptr; - - pptr += MPT_REQUEST_AREA; - vptr += MPT_REQUEST_AREA; - - req->sense_pbuf = (pptr - MPT_SENSE_SIZE); - req->sense_vbuf = (vptr - MPT_SENSE_SIZE); - - error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap); - if (error) { - mpt_prt(mpt, "error %d creating per-cmd DMA maps\n", - error); - return (1); - } - } - return (0); } @@ -894,7 +815,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) static void mpt_dma_mem_free(struct mpt_softc *mpt) { - int i; /* Make sure we aren't double destroying */ if (mpt->reply_dmat == 0) { @@ -902,13 +822,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) return; } - for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) { - bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap); - } - bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap); - bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap); - bus_dma_tag_destroy(mpt->request_dmat); - bus_dma_tag_destroy(mpt->buffer_dmat); bus_dmamap_unload(mpt->reply_dmat, mpt->reply_dmap); bus_dmamem_free(mpt->reply_dmat, mpt->reply, mpt->reply_dmap); bus_dma_tag_destroy(mpt->reply_dmat); Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:45:12 2011 (r224332) @@ -647,7 +647,7 @@ mpt_terminate_raid_thread(struct mpt_sof return; } mpt->shutdwn_raid = 1; - wakeup(mpt->raid_volumes); + wakeup(&mpt->raid_volumes); /* * Sleep on a slightly different location * for this interlock just for added safety. From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:54:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F01106566B; Mon, 25 Jul 2011 16:54:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDDD38FC12; Mon, 25 Jul 2011 16:54:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGsVh9065901; Mon, 25 Jul 2011 16:54:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGsVp9065899; Mon, 25 Jul 2011 16:54:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251654.p6PGsVp9065899@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224334 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:54:32 -0000 Author: marius Date: Mon Jul 25 16:54:31 2011 New Revision: 224334 URL: http://svn.freebsd.org/changeset/base/224334 Log: MFC: r195274 Change explicit maximium numbers to the defined macro MPT_MAX_LUNS. Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:45:47 2011 (r224333) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:54:31 2011 (r224334) @@ -2158,7 +2158,7 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->TargetID = tgt; /* We assume a single level LUN type */ - if (ccb->ccb_h.target_lun >= 256) { + if (ccb->ccb_h.target_lun >= MPT_MAX_LUNS) { mpt_req->LUN[0] = 0x40 | ((ccb->ccb_h.target_lun >> 8) & 0x3f); mpt_req->LUN[1] = ccb->ccb_h.target_lun & 0xff; } else { @@ -4043,7 +4043,7 @@ mpt_scsi_send_tmf(struct mpt_softc *mpt, tmf_req->MsgFlags = flags; tmf_req->MsgContext = htole32(mpt->tmf_req->index | scsi_tmf_handler_id); - if (lun > 256) { + if (lun > MPT_MAX_LUNS) { tmf_req->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); tmf_req->LUN[1] = lun & 0xff; } else { @@ -4517,7 +4517,7 @@ mpt_target_start_io(struct mpt_softc *mp ta->Function = MPI_FUNCTION_TARGET_ASSIST; ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id); ta->ReplyWord = htole32(tgt->reply_desc); - if (csio->ccb_h.target_lun > 256) { + if (csio->ccb_h.target_lun > MPT_MAX_LUNS) { ta->LUN[0] = 0x40 | ((csio->ccb_h.target_lun >> 8) & 0x3f); ta->LUN[1] = csio->ccb_h.target_lun & 0xff; @@ -4669,7 +4669,7 @@ mpt_scsi_tgt_local(struct mpt_softc *mpt ta->Function = MPI_FUNCTION_TARGET_ASSIST; ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id); ta->ReplyWord = htole32(tgt->reply_desc); - if (lun > 256) { + if (lun > MPT_MAX_LUNS) { ta->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); ta->LUN[1] = lun & 0xff; } else { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 16:59:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 065A51065673; Mon, 25 Jul 2011 16:59:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C648FC19; Mon, 25 Jul 2011 16:59:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGxfbZ066096; Mon, 25 Jul 2011 16:59:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGxfas066092; Mon, 25 Jul 2011 16:59:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251659.p6PGxfas066092@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224335 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:59:42 -0000 Author: marius Date: Mon Jul 25 16:59:41 2011 New Revision: 224335 URL: http://svn.freebsd.org/changeset/base/224335 Log: MFC: r219335 - Allocate the DMA memory shared between the host and the controller as coherent. - Add some missing bus_dmamap_sync() calls. This includes putting such calls before calling reply handlers instead of calling bus_dmamap_sync() for the request queue from individual reply handlers as these handlers generally read back updates by the controller. Tested on amd64 and sparc64. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_user.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:59:41 2011 (r224335) @@ -718,15 +718,16 @@ mpt_intr(void *arg) uint32_t ctxt_idx; u_int cb_index; u_int req_index; + u_int offset; int free_rf; req = NULL; reply_frame = NULL; reply_baddr = 0; + offset = 0; if ((reply_desc & MPI_ADDRESS_REPLY_A_BIT) != 0) { - u_int offset; /* - * Insure that the reply frame is coherent. + * Ensure that the reply frame is coherent. */ reply_baddr = MPT_REPLY_BADDR(reply_desc); offset = reply_baddr - (mpt->reply_phys & 0xFFFFFFFF); @@ -808,10 +809,15 @@ mpt_intr(void *arg) " 0x%x)\n", req_index, reply_desc); } + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); free_rf = mpt_reply_handlers[cb_index](mpt, req, reply_desc, reply_frame); if (reply_frame != NULL && free_rf) { + bus_dmamap_sync_range(mpt->reply_dmat, + mpt->reply_dmap, offset, MPT_REPLY_SIZE, + BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -844,6 +850,8 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; @@ -1167,7 +1175,7 @@ mpt_free_request(struct mpt_softc *mpt, { request_t *nxt; struct mpt_evtf_record *record; - uint32_t reply_baddr; + uint32_t offset, reply_baddr; if (req == NULL || req != &mpt->request_pool[req->index]) { panic("mpt_free_request bad req ptr\n"); @@ -1216,8 +1224,10 @@ mpt_free_request(struct mpt_softc *mpt, req->state = REQ_STATE_ALLOCATED; mpt_assign_serno(mpt, req); mpt_send_event_ack(mpt, req, &record->reply, record->context); - reply_baddr = (uint32_t)((uint8_t *)record - mpt->reply) - + (mpt->reply_phys & 0xFFFFFFFF); + offset = (uint32_t)((uint8_t *)record - mpt->reply); + reply_baddr = offset + (mpt->reply_phys & 0xFFFFFFFF); + bus_dmamap_sync_range(mpt->reply_dmat, mpt->reply_dmap, offset, + MPT_REPLY_SIZE, BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -1257,7 +1267,7 @@ mpt_send_cmd(struct mpt_softc *mpt, requ mpt_dump_request(mpt, req); } bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); req->state |= REQ_STATE_QUEUED; KASSERT(mpt_req_on_free_list(mpt, req) == 0, ("req %p:%u func %x on freelist list in mpt_send_cmd", @@ -1696,8 +1706,6 @@ mpt_read_extcfg_page(struct mpt_softc *m mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(buf, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -1795,8 +1803,6 @@ mpt_read_cfg_page(struct mpt_softc *mpt, mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(hdr, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -2383,10 +2389,12 @@ mpt_upload_fw(struct mpt_softc *mpt) flags <<= MPI_SGE_FLAGS_SHIFT; sge->FlagsLength = htole32(flags | mpt->fw_image_size); sge->Address = htole32(mpt->fw_phys); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREREAD); error = mpt_send_handshake_cmd(mpt, sizeof(fw_req_buf), &fw_req_buf); if (error) return(error); error = mpt_recv_handshake_reply(mpt, sizeof(fw_reply), &fw_reply); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTREAD); return (error); } @@ -2431,8 +2439,10 @@ mpt_download_fw(struct mpt_softc *mpt) MPI_DIAG_RW_ENABLE|MPI_DIAG_DISABLE_ARM); fw_hdr = (MpiFwHeader_t *)mpt->fw_image; + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, fw_hdr->LoadStartAddress, (uint32_t*)fw_hdr, fw_hdr->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTWRITE); ext_offset = fw_hdr->NextImageHeaderOffset; while (ext_offset != 0) { @@ -2440,9 +2450,12 @@ mpt_download_fw(struct mpt_softc *mpt) ext = (MpiExtImageHeader_t *)((uintptr_t)fw_hdr + ext_offset); ext_offset = ext->NextImageHeaderOffset; - + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, ext->LoadStartAddress, (uint32_t*)ext, ext->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_POSTWRITE); } if (mpt->is_sas) { @@ -2506,7 +2519,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) /* Allocate some DMA accessable memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", MPT_REQ_MEM_SIZE(mpt)); return (1); @@ -2714,11 +2727,12 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image_size, 1, mpt->fw_image_size, 0, &mpt->fw_dmat); if (error != 0) { - mpt_prt(mpt, "cannot create firmwarew dma tag\n"); + mpt_prt(mpt, "cannot create firmware dma tag\n"); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, - (void **)&mpt->fw_image, BUS_DMA_NOWAIT, &mpt->fw_dmap); + (void **)&mpt->fw_image, BUS_DMA_NOWAIT | + BUS_DMA_COHERENT, &mpt->fw_dmap); if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:59:41 2011 (r224335) @@ -3585,7 +3585,6 @@ mpt_action(struct cam_sim *sim, union cc #if 0 cpi->maxio = (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE; #endif - /* * FC cards report MAX_DEVICES of 512, but * the MSG_SCSI_IO_REQUEST target id field @@ -5026,15 +5025,6 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, uint8_t *cdbp; /* - * First, DMA sync the received command- - * which is in the *request* * phys area. - * - * XXX: We could optimize this for a range - */ - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); - - /* * Stash info for the current command where we can get at it later. */ vbuf = req->req_vbuf; Modified: stable/7/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_user.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt_user.c Mon Jul 25 16:59:41 2011 (r224335) @@ -204,7 +204,7 @@ mpt_alloc_buffer(struct mpt_softc *mpt, if (error) return (error); error = bus_dmamem_alloc(page_mem->tag, &page_mem->vaddr, - BUS_DMA_NOWAIT, &page_mem->map); + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &page_mem->map); if (error) { bus_dma_tag_destroy(page_mem->tag); return (error); @@ -302,6 +302,8 @@ mpt_user_read_cfg_page(struct mpt_softc params.PageNumber = hdr->PageNumber; params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK; params.PageAddress = le32toh(page_req->page_address); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(page_req->len), TRUE, 5000); if (error != 0) { @@ -312,7 +314,7 @@ mpt_user_read_cfg_page(struct mpt_softc page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -390,6 +392,8 @@ mpt_user_read_extcfg_page(struct mpt_sof params.PageAddress = le32toh(ext_page_req->page_address); params.ExtPageType = hdr->ExtPageType; params.ExtPageLength = hdr->ExtPageLength; + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(ext_page_req->len), TRUE, 5000); if (error != 0) { @@ -400,7 +404,7 @@ mpt_user_read_extcfg_page(struct mpt_sof ext_page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -435,7 +439,8 @@ mpt_user_write_cfg_page(struct mpt_softc if (req == NULL) return (ENOMEM); - bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); /* * There isn't any point in restoring stripped out attributes @@ -462,6 +467,8 @@ mpt_user_write_cfg_page(struct mpt_softc } page_req->ioc_status = htole16(req->IOCStatus); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -477,8 +484,6 @@ mpt_user_reply_handler(struct mpt_softc return (TRUE); if (reply_frame != NULL) { - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); reply = (MSG_RAID_ACTION_REPLY *)reply_frame; req->IOCStatus = le16toh(reply->IOCStatus); res = (struct mpt_user_raid_action_result *) @@ -535,7 +540,7 @@ mpt_user_raid_action(struct mpt_softc *m se = (SGE_SIMPLE32 *)&rap->ActionDataSGE; if (mpt_page->vaddr != NULL && raid_act->len != 0) { bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); se->Address = htole32(mpt_page->paddr); MPI_pSGE_SET_LENGTH(se, le32toh(raid_act->len)); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | @@ -574,7 +579,7 @@ mpt_user_raid_action(struct mpt_softc *m sizeof(res->action_data)); if (mpt_page->vaddr != NULL) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:01:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C10106568A; Mon, 25 Jul 2011 17:01:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5326C8FC1B; Mon, 25 Jul 2011 17:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PH1Eeh066251; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PH1ENt066240; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251701.p6PH1ENt066240@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224336 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:01:14 -0000 Author: marius Date: Mon Jul 25 17:01:13 2011 New Revision: 224336 URL: http://svn.freebsd.org/changeset/base/224336 Log: MFC: r220945 Correct spelling. Submitted by: brucec Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_debug.c stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt.c Mon Jul 25 17:01:13 2011 (r224336) @@ -304,28 +304,28 @@ mpt_modevent(module_t mod, int type, voi int mpt_stdload(struct mpt_personality *pers) { - /* Load is always successfull. */ + /* Load is always successful. */ return (0); } int mpt_stdprobe(struct mpt_softc *mpt) { - /* Probe is always successfull. */ + /* Probe is always successful. */ return (0); } int mpt_stdattach(struct mpt_softc *mpt) { - /* Attach is always successfull. */ + /* Attach is always successful. */ return (0); } int mpt_stdenable(struct mpt_softc *mpt) { - /* Enable is always successfull. */ + /* Enable is always successful. */ return (0); } @@ -361,7 +361,7 @@ mpt_stddetach(struct mpt_softc *mpt) int mpt_stdunload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -659,7 +659,7 @@ mpt_core_event(struct mpt_softc *mpt, re { int i; - /* Some error occured that LSI wants logged */ + /* Some error occurred that LSI wants logged */ mpt_prt(mpt, "EvtLogData: IOCLogInfo: 0x%08x\n", msg->IOCLogInfo); mpt_prt(mpt, "\tEvtLogData: Event Data:"); @@ -2354,7 +2354,7 @@ mpt_core_detach(struct mpt_softc *mpt) int mpt_core_unload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -2517,7 +2517,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for requests */ + /* Allocate some DMA accessible memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", @@ -2715,7 +2715,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* * In some configurations, the IOC's firmware is * stored in a shared piece of system NVRAM that - * is only accessable via the BIOS. In this + * is only accessible via the BIOS. In this * case, the firmware keeps a copy of firmware in * RAM until the OS driver retrieves it. Once * retrieved, we are responsible for re-downloading Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt.h Mon Jul 25 17:01:13 2011 (r224336) @@ -371,7 +371,7 @@ struct req_entry { mpt_req_state_t state; /* Request State Information */ uint16_t index; /* Index of this entry */ uint16_t IOCStatus; /* Completion status */ - uint16_t ResponseCode; /* TMF Reponse Code */ + uint16_t ResponseCode; /* TMF Response Code */ uint16_t serno; /* serial number */ union ccb *ccb; /* CAM request */ void *req_vbuf; /* Virtual Address of Entry */ @@ -714,7 +714,7 @@ struct mpt_softc { */ int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ - void * ih; /* Interupt handle */ + void * ih; /* Interrupt handle */ struct mpt_pci_cfg pci_cfg; /* saved PCI conf registers */ /* @@ -1052,7 +1052,7 @@ mpt_pop_reply_queue(struct mpt_softc *mp void mpt_complete_request_chain(struct mpt_softc *, struct req_queue *, u_int); -/************************** Scatter Gather Managment **************************/ +/************************** Scatter Gather Management **************************/ /* MPT_RQSL- size of request frame, in bytes */ #define MPT_RQSL(mpt) (mpt->ioc_facts.RequestFrameSize << 2) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:13 2011 (r224336) @@ -3015,7 +3015,7 @@ mpt_fc_els_reply_handler(struct mpt_soft elsbuf[1] = htobe32((ox_id << 16) | rx_id); elsbuf[2] = htobe32(0x000ffff); /* - * Dork with the reply frame so that the reponse to it + * Dork with the reply frame so that the response to it * will be correct. */ rp->Rctl_Did += ((BA_ACC - ABTS) << MPI_FC_RCTL_SHIFT); @@ -3142,7 +3142,7 @@ XXXX mpt_set_ccb_status(ccb, CAM_AUTOSENSE_FAIL); } else if ((sstate & MPI_SCSI_STATE_RESPONSE_INFO_VALID) != 0) { - /* XXX Handle SPI-Packet and FCP-2 reponse info. */ + /* XXX Handle SPI-Packet and FCP-2 response info. */ mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); } else mpt_set_ccb_status(ccb, CAM_REQ_CMP); Modified: stable/8/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_debug.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:13 2011 (r224336) @@ -119,15 +119,15 @@ static const struct Error_Map IOC_Status { MPI_IOCSTATUS_TARGET_NO_CONNECTION, "SCSI Target: No Connection" }, { MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH,"SCSI Target: Transfer Count Mismatch" }, { MPI_IOCSTATUS_TARGET_FC_ABORTED, "FC: Aborted" }, -{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Recieve ID Invalid" }, -{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Recieve DID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Receive ID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Receive DID Invalid" }, { MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT,"FC: Node Logged Out" }, { MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND, "LAN: Device Not Found" }, { MPI_IOCSTATUS_LAN_DEVICE_FAILURE, "LAN: Device Not Failure" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ERROR, "LAN: Transmit Error" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED, "LAN: Transmit Aborted" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Recieve Error" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Recieve Aborted" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Receive Error" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Receive Aborted" }, { MPI_IOCSTATUS_LAN_PARTIAL_PACKET, "LAN: Partial Packet" }, { MPI_IOCSTATUS_LAN_CANCELED, "LAN: Canceled" }, { -1, 0}, Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:59:41 2011 (r224335) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:13 2011 (r224336) @@ -783,7 +783,7 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for replies */ + /* Allocate some DMA accessible memory for replies */ if (bus_dmamem_alloc(mpt->reply_dmat, (void **)&mpt->reply, BUS_DMA_NOWAIT, &mpt->reply_dmap) != 0) { mpt_prt(mpt, "cannot allocate %lu bytes of reply memory\n", From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:01:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0062F106568D; Mon, 25 Jul 2011 17:01:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E30B88FC23; Mon, 25 Jul 2011 17:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PH1EIM066271; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PH1EJY066265; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251701.p6PH1EJY066265@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224337 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:01:15 -0000 Author: marius Date: Mon Jul 25 17:01:14 2011 New Revision: 224337 URL: http://svn.freebsd.org/changeset/base/224337 Log: MFC: r220945 Correct spelling. Submitted by: brucec Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_debug.c stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 17:01:14 2011 (r224337) @@ -304,28 +304,28 @@ mpt_modevent(module_t mod, int type, voi int mpt_stdload(struct mpt_personality *pers) { - /* Load is always successfull. */ + /* Load is always successful. */ return (0); } int mpt_stdprobe(struct mpt_softc *mpt) { - /* Probe is always successfull. */ + /* Probe is always successful. */ return (0); } int mpt_stdattach(struct mpt_softc *mpt) { - /* Attach is always successfull. */ + /* Attach is always successful. */ return (0); } int mpt_stdenable(struct mpt_softc *mpt) { - /* Enable is always successfull. */ + /* Enable is always successful. */ return (0); } @@ -361,7 +361,7 @@ mpt_stddetach(struct mpt_softc *mpt) int mpt_stdunload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -659,7 +659,7 @@ mpt_core_event(struct mpt_softc *mpt, re { int i; - /* Some error occured that LSI wants logged */ + /* Some error occurred that LSI wants logged */ mpt_prt(mpt, "EvtLogData: IOCLogInfo: 0x%08x\n", msg->IOCLogInfo); mpt_prt(mpt, "\tEvtLogData: Event Data:"); @@ -2354,7 +2354,7 @@ mpt_core_detach(struct mpt_softc *mpt) int mpt_core_unload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -2517,7 +2517,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for requests */ + /* Allocate some DMA accessible memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", @@ -2715,7 +2715,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* * In some configurations, the IOC's firmware is * stored in a shared piece of system NVRAM that - * is only accessable via the BIOS. In this + * is only accessible via the BIOS. In this * case, the firmware keeps a copy of firmware in * RAM until the OS driver retrieves it. Once * retrieved, we are responsible for re-downloading Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 17:01:14 2011 (r224337) @@ -371,7 +371,7 @@ struct req_entry { mpt_req_state_t state; /* Request State Information */ uint16_t index; /* Index of this entry */ uint16_t IOCStatus; /* Completion status */ - uint16_t ResponseCode; /* TMF Reponse Code */ + uint16_t ResponseCode; /* TMF Response Code */ uint16_t serno; /* serial number */ union ccb *ccb; /* CAM request */ void *req_vbuf; /* Virtual Address of Entry */ @@ -714,7 +714,7 @@ struct mpt_softc { */ int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ - void * ih; /* Interupt handle */ + void * ih; /* Interrupt handle */ struct mpt_pci_cfg pci_cfg; /* saved PCI conf registers */ /* @@ -1052,7 +1052,7 @@ mpt_pop_reply_queue(struct mpt_softc *mp void mpt_complete_request_chain(struct mpt_softc *, struct req_queue *, u_int); -/************************** Scatter Gather Managment **************************/ +/************************** Scatter Gather Management **************************/ /* MPT_RQSL- size of request frame, in bytes */ #define MPT_RQSL(mpt) (mpt->ioc_facts.RequestFrameSize << 2) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:14 2011 (r224337) @@ -3015,7 +3015,7 @@ mpt_fc_els_reply_handler(struct mpt_soft elsbuf[1] = htobe32((ox_id << 16) | rx_id); elsbuf[2] = htobe32(0x000ffff); /* - * Dork with the reply frame so that the reponse to it + * Dork with the reply frame so that the response to it * will be correct. */ rp->Rctl_Did += ((BA_ACC - ABTS) << MPI_FC_RCTL_SHIFT); @@ -3142,7 +3142,7 @@ XXXX mpt_set_ccb_status(ccb, CAM_AUTOSENSE_FAIL); } else if ((sstate & MPI_SCSI_STATE_RESPONSE_INFO_VALID) != 0) { - /* XXX Handle SPI-Packet and FCP-2 reponse info. */ + /* XXX Handle SPI-Packet and FCP-2 response info. */ mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); } else mpt_set_ccb_status(ccb, CAM_REQ_CMP); Modified: stable/7/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:14 2011 (r224337) @@ -119,15 +119,15 @@ static const struct Error_Map IOC_Status { MPI_IOCSTATUS_TARGET_NO_CONNECTION, "SCSI Target: No Connection" }, { MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH,"SCSI Target: Transfer Count Mismatch" }, { MPI_IOCSTATUS_TARGET_FC_ABORTED, "FC: Aborted" }, -{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Recieve ID Invalid" }, -{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Recieve DID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Receive ID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Receive DID Invalid" }, { MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT,"FC: Node Logged Out" }, { MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND, "LAN: Device Not Found" }, { MPI_IOCSTATUS_LAN_DEVICE_FAILURE, "LAN: Device Not Failure" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ERROR, "LAN: Transmit Error" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED, "LAN: Transmit Aborted" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Recieve Error" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Recieve Aborted" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Receive Error" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Receive Aborted" }, { MPI_IOCSTATUS_LAN_PARTIAL_PACKET, "LAN: Partial Packet" }, { MPI_IOCSTATUS_LAN_CANCELED, "LAN: Canceled" }, { -1, 0}, Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:14 2011 (r224337) @@ -783,7 +783,7 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for replies */ + /* Allocate some DMA accessible memory for replies */ if (bus_dmamem_alloc(mpt->reply_dmat, (void **)&mpt->reply, BUS_DMA_NOWAIT, &mpt->reply_dmap) != 0) { mpt_prt(mpt, "cannot allocate %lu bytes of reply memory\n", From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:12:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 687281065674; Mon, 25 Jul 2011 17:12:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57D8C8FC08; Mon, 25 Jul 2011 17:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHCr0c066682; Mon, 25 Jul 2011 17:12:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHCqkR066679; Mon, 25 Jul 2011 17:12:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251712.p6PHCqkR066679@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224338 - stable/8/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:12:53 -0000 Author: marius Date: Mon Jul 25 17:12:52 2011 New Revision: 224338 URL: http://svn.freebsd.org/changeset/base/224338 Log: MFC: r220951 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/esp/ncr53c9x.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/8/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:01:14 2011 (r224337) +++ stable/8/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:52 2011 (r224338) @@ -2560,7 +2560,7 @@ again: * XXX This will cause a chip reset and will * prevent us from finding out the real * problem with the device. However, it's - * neccessary until a way can be found to + * necessary until a way can be found to * safely cancel the DMA that is in * progress. */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:12:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12855106564A; Mon, 25 Jul 2011 17:12:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 020238FC1A; Mon, 25 Jul 2011 17:12:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHCtQD066715; Mon, 25 Jul 2011 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHCt0A066713; Mon, 25 Jul 2011 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251712.p6PHCt0A066713@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224339 - stable/7/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:12:56 -0000 Author: marius Date: Mon Jul 25 17:12:55 2011 New Revision: 224339 URL: http://svn.freebsd.org/changeset/base/224339 Log: MFC: r220951 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/esp/ncr53c9x.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/7/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:52 2011 (r224338) +++ stable/7/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:55 2011 (r224339) @@ -2560,7 +2560,7 @@ again: * XXX This will cause a chip reset and will * prevent us from finding out the real * problem with the device. However, it's - * neccessary until a way can be found to + * necessary until a way can be found to * safely cancel the DMA that is in * progress. */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:14:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 647941065670; Mon, 25 Jul 2011 17:14:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 541548FC0C; Mon, 25 Jul 2011 17:14:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHEnJB066831; Mon, 25 Jul 2011 17:14:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHEnq3066829; Mon, 25 Jul 2011 17:14:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251714.p6PHEnq3066829@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224340 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:14:49 -0000 Author: marius Date: Mon Jul 25 17:14:49 2011 New Revision: 224340 URL: http://svn.freebsd.org/changeset/base/224340 Log: MFC: r221344 Correct spelling in comments. Submitted by: brucec Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jul 25 17:12:55 2011 (r224339) +++ stable/8/sys/dev/bge/if_bge.c Mon Jul 25 17:14:49 2011 (r224340) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); * * The Broadcom BCM5700 is based on technology originally developed by * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet - * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has + * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo * frames, highly configurable RX filtering, and 16 RX and TX queues @@ -3513,7 +3513,7 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, sc->bge_pcixcap + PCIXR_COMMAND, devctl, 2); } - /* Re-enable MSI, if neccesary, and enable the memory arbiter. */ + /* Re-enable MSI, if necessary, and enable the memory arbiter. */ if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:14:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C43E0106576B; Mon, 25 Jul 2011 17:14:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C298FC15; Mon, 25 Jul 2011 17:14:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHEtBw066870; Mon, 25 Jul 2011 17:14:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHEt3J066868; Mon, 25 Jul 2011 17:14:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251714.p6PHEt3J066868@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224341 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:14:57 -0000 Author: marius Date: Mon Jul 25 17:14:55 2011 New Revision: 224341 URL: http://svn.freebsd.org/changeset/base/224341 Log: MFC: r221344 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Jul 25 17:14:49 2011 (r224340) +++ stable/7/sys/dev/bge/if_bge.c Mon Jul 25 17:14:55 2011 (r224341) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); * * The Broadcom BCM5700 is based on technology originally developed by * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet - * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has + * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo * frames, highly configurable RX filtering, and 16 RX and TX queues @@ -3513,7 +3513,7 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, sc->bge_pcixcap + PCIXR_COMMAND, devctl, 2); } - /* Re-enable MSI, if neccesary, and enable the memory arbiter. */ + /* Re-enable MSI, if necessary, and enable the memory arbiter. */ if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:18:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9232F106566B; Mon, 25 Jul 2011 17:18:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 819578FC0A; Mon, 25 Jul 2011 17:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHIkAs067050; Mon, 25 Jul 2011 17:18:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHIkVe067048; Mon, 25 Jul 2011 17:18:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251718.p6PHIkVe067048@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224342 - stable/8/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:18:46 -0000 Author: marius Date: Mon Jul 25 17:18:46 2011 New Revision: 224342 URL: http://svn.freebsd.org/changeset/base/224342 Log: MFC: r221954 When setting media always and not just in case of switching to IFM_AUTO clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. Modified: stable/8/sbin/ifconfig/ifmedia.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/8/sbin/ifconfig/ifmedia.c Mon Jul 25 17:14:55 2011 (r224341) +++ stable/8/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:46 2011 (r224342) @@ -272,13 +272,9 @@ setmedia(const char *val, int d, int s, subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = (ifmr->ifm_current & ~(IFM_NMASK|IFM_TMASK)) | + ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; - if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); - } - ifmr->ifm_current = ifr.ifr_media; callback_register(setifmediacallback, (void *)ifmr); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:18:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54AA21065673; Mon, 25 Jul 2011 17:18:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 444658FC12; Mon, 25 Jul 2011 17:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHImwY067085; Mon, 25 Jul 2011 17:18:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHIm88067083; Mon, 25 Jul 2011 17:18:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251718.p6PHIm88067083@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224343 - stable/7/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:18:48 -0000 Author: marius Date: Mon Jul 25 17:18:47 2011 New Revision: 224343 URL: http://svn.freebsd.org/changeset/base/224343 Log: MFC: r221954 When setting media always and not just in case of switching to IFM_AUTO clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. Modified: stable/7/sbin/ifconfig/ifmedia.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/7/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:46 2011 (r224342) +++ stable/7/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:47 2011 (r224343) @@ -263,13 +263,9 @@ setmedia(const char *val, int d, int s, subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = (ifmr->ifm_current & ~(IFM_NMASK|IFM_TMASK)) | + ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; - if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); - } - ifmr->ifm_current = ifr.ifr_media; callback_register(setifmediacallback, (void *)ifmr); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:20:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 963F51065675; Mon, 25 Jul 2011 17:20:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CCDB8FC1C; Mon, 25 Jul 2011 17:20:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHKXid067208; Mon, 25 Jul 2011 17:20:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHKX1a067206; Mon, 25 Jul 2011 17:20:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251720.p6PHKX1a067206@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224344 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:20:33 -0000 Author: marius Date: Mon Jul 25 17:20:33 2011 New Revision: 224344 URL: http://svn.freebsd.org/changeset/base/224344 Log: MFC: r221955 - Add 10baseT as an alias for 10baseT/UTP. - Add shorthand aliases for common media+option combinations as announced by miibus(4) so that one can actually supply the media strings found in the dmesg output to ifconfig(8). Obtained from: NetBSD (in principle) Modified: stable/7/sys/net/if_media.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_media.h ============================================================================== --- stable/7/sys/net/if_media.h Mon Jul 25 17:18:47 2011 (r224343) +++ stable/7/sys/net/if_media.h Mon Jul 25 17:20:33 2011 (r224344) @@ -369,6 +369,7 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ + { IFM_10_T, "10baseT" }, \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ @@ -388,6 +389,23 @@ struct ifmedia_description { { IFM_1000_T, "1000TX" }, \ { IFM_1000_T, "1000T" }, \ { IFM_2500_SX, "2500SX" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ + { IFM_10_T | IFM_FDX | IFM_FLOW, "10baseT-FDX-flow" }, \ + { IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ + { IFM_100_TX | IFM_FDX | IFM_FLOW, "100baseTX-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW, "1000baseT-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \ + "1000baseT-FDX-flow-master" }, \ + { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER, \ + "1000baseT-FDX-master" }, \ + { IFM_1000_T | IFM_ETH_MASTER, "1000baseT-master" }, \ + \ { 0, NULL }, \ } @@ -580,6 +598,13 @@ struct ifmedia_description { #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_AUTO | IFM_FLOW, "auto-flow" }, \ + \ { 0, NULL }, \ } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:20:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7220106566C; Mon, 25 Jul 2011 17:20:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6CE28FC08; Mon, 25 Jul 2011 17:20:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHKaPS067239; Mon, 25 Jul 2011 17:20:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHKaJF067237; Mon, 25 Jul 2011 17:20:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251720.p6PHKaJF067237@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224345 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:20:36 -0000 Author: marius Date: Mon Jul 25 17:20:36 2011 New Revision: 224345 URL: http://svn.freebsd.org/changeset/base/224345 Log: MFC: r221955 - Add 10baseT as an alias for 10baseT/UTP. - Add shorthand aliases for common media+option combinations as announced by miibus(4) so that one can actually supply the media strings found in the dmesg output to ifconfig(8). Obtained from: NetBSD (in principle) Modified: stable/8/sys/net/if_media.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/net/if_media.h ============================================================================== --- stable/8/sys/net/if_media.h Mon Jul 25 17:20:33 2011 (r224344) +++ stable/8/sys/net/if_media.h Mon Jul 25 17:20:36 2011 (r224345) @@ -370,6 +370,7 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ + { IFM_10_T, "10baseT" }, \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ @@ -389,6 +390,23 @@ struct ifmedia_description { { IFM_1000_T, "1000TX" }, \ { IFM_1000_T, "1000T" }, \ { IFM_2500_SX, "2500SX" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ + { IFM_10_T | IFM_FDX | IFM_FLOW, "10baseT-FDX-flow" }, \ + { IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ + { IFM_100_TX | IFM_FDX | IFM_FLOW, "100baseTX-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW, "1000baseT-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \ + "1000baseT-FDX-flow-master" }, \ + { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER, \ + "1000baseT-FDX-master" }, \ + { IFM_1000_T | IFM_ETH_MASTER, "1000baseT-master" }, \ + \ { 0, NULL }, \ } @@ -582,6 +600,13 @@ struct ifmedia_description { #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_AUTO | IFM_FLOW, "auto-flow" }, \ + \ { 0, NULL }, \ } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:31:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEBCC1065674; Mon, 25 Jul 2011 17:31:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE38D8FC21; Mon, 25 Jul 2011 17:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHV9cp067637; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHV9me067633; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251731.p6PHV9me067633@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224346 - stable/8/sys/dev/mk48txx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:31:10 -0000 Author: marius Date: Mon Jul 25 17:31:09 2011 New Revision: 224346 URL: http://svn.freebsd.org/changeset/base/224346 Log: MFC: r221957 Add support for MK48T37. Modified: stable/8/sys/dev/mk48txx/mk48txx.c stable/8/sys/dev/mk48txx/mk48txxreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:20:36 2011 (r224345) +++ stable/8/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224346) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines + * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip + * subroutines */ #include @@ -67,6 +68,7 @@ static const struct { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, + { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, }; Modified: stable/8/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/8/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:20:36 2011 (r224345) +++ stable/8/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224346) @@ -152,5 +152,8 @@ #define MK48T18_CLKSZ 8192 #define MK48T18_CLKOFF 0x1ff0 +#define MK48T37_CLKSZ 32768 +#define MK48T37_CLKOFF 0x1ff0 + #define MK48T59_CLKSZ 8192 #define MK48T59_CLKOFF 0x1ff0 From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:31:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233C41065675; Mon, 25 Jul 2011 17:31:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12B278FC12; Mon, 25 Jul 2011 17:31:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHV9md067644; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHV9tc067641; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251731.p6PHV9tc067641@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224347 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:31:10 -0000 Author: marius Date: Mon Jul 25 17:31:09 2011 New Revision: 224347 URL: http://svn.freebsd.org/changeset/base/224347 Log: MFC: r221957 Add support for MK48T37. Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224346) +++ stable/7/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224347) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines + * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip + * subroutines */ #include @@ -67,6 +68,7 @@ static const struct { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, + { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, }; Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224346) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224347) @@ -152,5 +152,8 @@ #define MK48T18_CLKSZ 8192 #define MK48T18_CLKOFF 0x1ff0 +#define MK48T37_CLKSZ 32768 +#define MK48T37_CLKOFF 0x1ff0 + #define MK48T59_CLKSZ 8192 #define MK48T59_CLKOFF 0x1ff0 From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:32:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A534B106566C; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94C428FC15; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHWM4u067771; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHWM5A067766; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251732.p6PHWM5A067766@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224348 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:32:22 -0000 Author: marius Date: Mon Jul 25 17:32:22 2011 New Revision: 224348 URL: http://svn.freebsd.org/changeset/base/224348 Log: MFC: r221958 Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/8/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/8/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:31:09 2011 (r224347) +++ stable/8/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224348) @@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { + const char *name; - if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { + name = ofw_bus_get_name(dev); + if (strcmp(name, "eeprom") == 0 || + strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:32:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D19A81065670; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C10278FC1A; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHWMjK067777; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHWMi6067775; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251732.p6PHWMi6067775@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224349 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:32:22 -0000 Author: marius Date: Mon Jul 25 17:32:22 2011 New Revision: 224349 URL: http://svn.freebsd.org/changeset/base/224349 Log: MFC: r221958 Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/7/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/7/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224348) +++ stable/7/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224349) @@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { + const char *name; - if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { + name = ofw_bus_get_name(dev); + if (strcmp(name, "eeprom") == 0 || + strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:37:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B065D106566B; Mon, 25 Jul 2011 17:37:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 869B98FC16; Mon, 25 Jul 2011 17:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHbrE3068057; Mon, 25 Jul 2011 17:37:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHbrMA068054; Mon, 25 Jul 2011 17:37:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251737.p6PHbrMA068054@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224350 - in stable/8/sys/dev: scc uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:37:53 -0000 Author: marius Date: Mon Jul 25 17:37:53 2011 New Revision: 224350 URL: http://svn.freebsd.org/changeset/base/224350 Log: MFC: r221960 Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/8/sys/dev/scc/scc_bfe_ebus.c stable/8/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/scc/scc_bfe_ebus.c ============================================================================== --- stable/8/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:32:22 2011 (r224349) +++ stable/8/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:53 2011 (r224350) @@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { + if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || + !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); Modified: stable/8/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/8/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:32:22 2011 (r224349) +++ stable/8/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:53 2011 (r224350) @@ -230,7 +230,8 @@ uart_cpu_getdev(int devtype, struct uart di->bas.regshft = 0; di->bas.rclk = 0; class = NULL; - if (!strcmp(buf, "se") || !strcmp(compat, "sab82532")) { + if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || + !strcmp(compat, "sab82532")) { class = &uart_sab82532_class; /* SAB82532 are only known to be used for TTYs. */ if ((di->bas.chan = uart_cpu_channel(dev)) == 0) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:37:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EFE1065672; Mon, 25 Jul 2011 17:37:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C076C8FC1D; Mon, 25 Jul 2011 17:37:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHbsaY068088; Mon, 25 Jul 2011 17:37:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHbs3I068085; Mon, 25 Jul 2011 17:37:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251737.p6PHbs3I068085@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224351 - in stable/7/sys/dev: scc uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:37:54 -0000 Author: marius Date: Mon Jul 25 17:37:54 2011 New Revision: 224351 URL: http://svn.freebsd.org/changeset/base/224351 Log: MFC: r221960 Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/7/sys/dev/scc/scc_bfe_ebus.c stable/7/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/scc/scc_bfe_ebus.c ============================================================================== --- stable/7/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:53 2011 (r224350) +++ stable/7/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:54 2011 (r224351) @@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { + if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || + !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); Modified: stable/7/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/7/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:53 2011 (r224350) +++ stable/7/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:54 2011 (r224351) @@ -230,7 +230,8 @@ uart_cpu_getdev(int devtype, struct uart di->bas.regshft = 0; di->bas.rclk = 0; class = NULL; - if (!strcmp(buf, "se") || !strcmp(compat, "sab82532")) { + if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || + !strcmp(compat, "sab82532")) { class = &uart_sab82532_class; /* SAB82532 are only known to be used for TTYs. */ if ((di->bas.chan = uart_cpu_channel(dev)) == 0) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:54:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DC9106564A; Mon, 25 Jul 2011 17:54:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C66C8FC08; Mon, 25 Jul 2011 17:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHs5i2068640; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHs5qj068633; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251754.p6PHs5qj068633@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224352 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:54:05 -0000 Author: marius Date: Mon Jul 25 17:54:04 2011 New Revision: 224352 URL: http://svn.freebsd.org/changeset/base/224352 Log: MFC: r222828 (partial) - Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C version does. - Initialize global registers early in the MP startup code so PCPU can be used. Modified: stable/8/sys/sparc64/include/ktr.h stable/8/sys/sparc64/sparc64/mp_locore.S stable/8/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/ktr.h ============================================================================== --- stable/8/sys/sparc64/include/ktr.h Mon Jul 25 17:37:54 2011 (r224351) +++ stable/8/sys/sparc64/include/ktr.h Mon Jul 25 17:54:04 2011 (r224352) @@ -82,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - lduw [PCPU(MID)], r1 ; \ + lduw [PCPU(CPUID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:37:54 2011 (r224351) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:04 2011 (r224352) @@ -269,13 +269,17 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp + /* Initialize global registers. */ + call cpu_setregs + mov %l1, %o0 + #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) - lduw [%l1 + PC_CPUID], %g2 + lduw [PCPU(CPUID)], %g2 stx %g2, [%g1 + KTR_PARM1] - lduw [%l1 + PC_MID], %g2 + lduw [PCPU(MID)], %g2 stx %g2, [%g1 + KTR_PARM2] stx %l1, [%g1 + KTR_PARM3] stx %sp, [%g1 + KTR_PARM5] Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:37:54 2011 (r224351) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:04 2011 (r224352) @@ -451,9 +451,6 @@ cpu_mp_bootstrap(struct pcpu *pc) */ tlb_flush_nonlocked(); - /* Initialize global registers. */ - cpu_setregs(pc); - /* * Enable interrupts. * Note that the PIL we be lowered indirectly via sched_throw(NULL) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:54:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1631065672; Mon, 25 Jul 2011 17:54:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04E378FC13; Mon, 25 Jul 2011 17:54:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHs5H6068670; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHs5Hw068666; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251754.p6PHs5Hw068666@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224353 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:54:06 -0000 Author: marius Date: Mon Jul 25 17:54:05 2011 New Revision: 224353 URL: http://svn.freebsd.org/changeset/base/224353 Log: MFC: r222828 (partial) - Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C version does. - Initialize global registers early in the MP startup code so PCPU can be used. Modified: stable/7/sys/sparc64/include/ktr.h stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/ktr.h ============================================================================== --- stable/7/sys/sparc64/include/ktr.h Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/include/ktr.h Mon Jul 25 17:54:05 2011 (r224353) @@ -82,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - lduw [PCPU(MID)], r1 ; \ + lduw [PCPU(CPUID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:05 2011 (r224353) @@ -269,13 +269,17 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp + /* Initialize global registers. */ + call cpu_setregs + mov %l1, %o0 + #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) - lduw [%l1 + PC_CPUID], %g2 + lduw [PCPU(CPUID)], %g2 stx %g2, [%g1 + KTR_PARM1] - lduw [%l1 + PC_MID], %g2 + lduw [PCPU(MID)], %g2 stx %g2, [%g1 + KTR_PARM2] stx %l1, [%g1 + KTR_PARM3] stx %sp, [%g1 + KTR_PARM5] Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:05 2011 (r224353) @@ -438,9 +438,6 @@ cpu_mp_bootstrap(struct pcpu *pc) */ tlb_flush_nonlocked(); - /* Initialize global registers. */ - cpu_setregs(pc); - /* * Enable interrupts. * Note that the PIL we be lowered indirectly via sched_throw(NULL) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:56:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6D1F1065672; Mon, 25 Jul 2011 17:56:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C647F8FC17; Mon, 25 Jul 2011 17:56:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHu6xw068819; Mon, 25 Jul 2011 17:56:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHu6fV068817; Mon, 25 Jul 2011 17:56:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251756.p6PHu6fV068817@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224354 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:56:07 -0000 Author: marius Date: Mon Jul 25 17:56:06 2011 New Revision: 224354 URL: http://svn.freebsd.org/changeset/base/224354 Log: MFC: r222840 - For the case when tl1_align(_trap) is used to call rsf_fatal via RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just like tl1_data_excptn(_trap) does. This is more or less cosmetic because in case RSF_FATAL is called we're already heading south. - Correct an END(). - Read the window state from the correct register for a CATR(). Modified: stable/8/sys/sparc64/sparc64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 17:54:05 2011 (r224353) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224354) @@ -1280,6 +1280,7 @@ ENTRY(tl1_data_excptn_trap) END(tl1_data_excptn_trap) .macro tl1_align + wrpr %g0, PSTATE_ALT, %pstate ba,a %xcc, tl1_align_trap nop .align 32 @@ -1289,7 +1290,7 @@ ENTRY(tl1_align_trap) RESUME_SPILLFILL_ALIGN ba %xcc, tl1_sfsr_trap mov T_MEM_ADDRESS_NOT_ALIGNED | T_KERNEL, %g2 -END(tl1_data_excptn_trap) +END(tl1_align_trap) ENTRY(tl1_sfsr_trap) wr %g0, ASI_DMMU, %asi @@ -2697,7 +2698,7 @@ tl0_ret_fill_end: , %l0, %l1, %l2, 7, 8, 9) rdpr %pstate, %l1 stx %l1, [%l0 + KTR_PARM1] - stx %l5, [%l0 + KTR_PARM2] + stx %l6, [%l0 + KTR_PARM2] stx %sp, [%l0 + KTR_PARM3] 9: #endif From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 17:56:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F99D1065675; Mon, 25 Jul 2011 17:56:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF678FC08; Mon, 25 Jul 2011 17:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHu7ql068841; Mon, 25 Jul 2011 17:56:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHu7aJ068839; Mon, 25 Jul 2011 17:56:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251756.p6PHu7aJ068839@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224355 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:56:07 -0000 Author: marius Date: Mon Jul 25 17:56:06 2011 New Revision: 224355 URL: http://svn.freebsd.org/changeset/base/224355 Log: MFC: r222840 - For the case when tl1_align(_trap) is used to call rsf_fatal via RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just like tl1_data_excptn(_trap) does. This is more or less cosmetic because in case RSF_FATAL is called we're already heading south. - Correct an END(). - Read the window state from the correct register for a CATR(). Modified: stable/7/sys/sparc64/sparc64/exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224354) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224355) @@ -1276,6 +1276,7 @@ ENTRY(tl1_data_excptn_trap) END(tl1_data_excptn_trap) .macro tl1_align + wrpr %g0, PSTATE_ALT, %pstate ba,a %xcc, tl1_align_trap nop .align 32 @@ -1285,7 +1286,7 @@ ENTRY(tl1_align_trap) RESUME_SPILLFILL_ALIGN ba %xcc, tl1_sfsr_trap mov T_MEM_ADDRESS_NOT_ALIGNED | T_KERNEL, %g2 -END(tl1_data_excptn_trap) +END(tl1_align_trap) ENTRY(tl1_sfsr_trap) wr %g0, ASI_DMMU, %asi @@ -2616,7 +2617,7 @@ tl0_ret_fill_end: , %l0, %l1, %l2, 7, 8, 9) rdpr %pstate, %l1 stx %l1, [%l0 + KTR_PARM1] - stx %l5, [%l0 + KTR_PARM2] + stx %l6, [%l0 + KTR_PARM2] stx %sp, [%l0 + KTR_PARM3] 9: #endif From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:17:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68939106566B; Mon, 25 Jul 2011 18:17:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE368FC18; Mon, 25 Jul 2011 18:17:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIHBt8069475; Mon, 25 Jul 2011 18:17:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIHBSn069473; Mon, 25 Jul 2011 18:17:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251817.p6PIHBSn069473@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224356 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:17:11 -0000 Author: marius Date: Mon Jul 25 18:17:11 2011 New Revision: 224356 URL: http://svn.freebsd.org/changeset/base/224356 Log: MFC: r223126 (partial) Don't include curcpu in the mask which is used as the IPI cookie as we have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. Modified: stable/8/sys/sparc64/include/smp.h Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Mon Jul 25 17:56:06 2011 (r224355) +++ stable/8/sys/sparc64/include/smp.h Mon Jul 25 18:17:11 2011 (r224356) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2007 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -164,9 +165,9 @@ ipi_dcache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -180,9 +181,9 @@ ipi_icache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -196,7 +197,7 @@ ipi_rd(u_int cpu, void *func, u_long *va sched_pin(); ira = &ipi_rd_args; mtx_lock_spin(&ipi_mtx); - ira->ira_mask = 1 << cpu | PCPU_GET(cpumask); + ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); return (&ira->ira_mask); @@ -217,7 +218,7 @@ ipi_tlb_context_demap(struct pmap *pm) } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, (u_long)ita); @@ -239,7 +240,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita); @@ -261,7 +262,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; ita->ita_end = end; @@ -276,7 +277,6 @@ ipi_wait(void *cookie) volatile cpumask_t *mask; if ((mask = cookie) != NULL) { - atomic_clear_int(mask, PCPU_GET(cpumask)); while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:17:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9CE106564A; Mon, 25 Jul 2011 18:17:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114518FC08; Mon, 25 Jul 2011 18:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIHCxO069509; Mon, 25 Jul 2011 18:17:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIHCug069507; Mon, 25 Jul 2011 18:17:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251817.p6PIHCug069507@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224357 - stable/7/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:17:13 -0000 Author: marius Date: Mon Jul 25 18:17:12 2011 New Revision: 224357 URL: http://svn.freebsd.org/changeset/base/224357 Log: MFC: r223126 (partial) Don't include curcpu in the mask which is used as the IPI cookie as we have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. Modified: stable/7/sys/sparc64/include/smp.h Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Mon Jul 25 18:17:11 2011 (r224356) +++ stable/7/sys/sparc64/include/smp.h Mon Jul 25 18:17:12 2011 (r224357) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2007 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -156,9 +157,9 @@ ipi_dcache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -172,9 +173,9 @@ ipi_icache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -188,7 +189,7 @@ ipi_rd(u_int cpu, void *func, u_long *va sched_pin(); ira = &ipi_rd_args; mtx_lock_spin(&ipi_mtx); - ira->ira_mask = 1 << cpu | PCPU_GET(cpumask); + ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); return (&ira->ira_mask); @@ -209,7 +210,7 @@ ipi_tlb_context_demap(struct pmap *pm) } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, (u_long)ita); @@ -231,7 +232,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita); @@ -253,7 +254,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; ita->ita_end = end; @@ -268,7 +269,6 @@ ipi_wait(void *cookie) volatile u_int *mask; if ((mask = cookie) != NULL) { - atomic_clear_int(mask, PCPU_GET(cpumask)); while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:23:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEC061065687; Mon, 25 Jul 2011 18:23:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49348FC0C; Mon, 25 Jul 2011 18:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PINOdO069792; Mon, 25 Jul 2011 18:23:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PINO4f069790; Mon, 25 Jul 2011 18:23:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251823.p6PINO4f069790@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224358 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:23:25 -0000 Author: marius Date: Mon Jul 25 18:23:24 2011 New Revision: 224358 URL: http://svn.freebsd.org/changeset/base/224358 Log: MFC: r223235 - As with stray vector interrupts limit the reporting of stray level interrupts. Bringup on additional machine models repeatedly reveals firmware that enables interrupts behind our back, causing the console to be flooded otherwise. - As with the regular interrupt counters using uint16_t instead of u_long for counting the stray vector interrupts should be more than sufficient. - Cache the interrupt vector in intr_stray_vector(). Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:17:12 2011 (r224357) +++ stable/8/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:23:24 2011 (r224358) @@ -83,10 +83,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struc ih_func_t *intr_handlers[PIL_MAX]; uint16_t pil_countp[PIL_MAX]; +static uint16_t pil_stray_count[PIL_MAX]; struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; -static u_long intr_stray_count[IV_MAX]; +static uint16_t intr_stray_count[IV_MAX]; static const char *const pil_names[] = { "stray", @@ -198,22 +199,32 @@ intr_setup(int pri, ih_func_t *ihf, int static void intr_stray_level(struct trapframe *tf) { + uint64_t level; - printf("stray level interrupt %ld\n", tf->tf_level); + level = tf->tf_level; + if (pil_stray_count[level] < MAX_STRAY_LOG) { + printf("stray level interrupt %ld\n", level); + pil_stray_count[level]++; + if (pil_stray_count[level] >= MAX_STRAY_LOG) + printf("got %d stray level interrupt %ld's: not " + "logging anymore\n", MAX_STRAY_LOG, level); + } } static void intr_stray_vector(void *cookie) { struct intr_vector *iv; + u_int vec; iv = cookie; - if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) { - printf("stray vector interrupt %d\n", iv->iv_vec); - intr_stray_count[iv->iv_vec]++; - if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG) - printf("got %d stray interrupt %d's: not logging " - "anymore\n", MAX_STRAY_LOG, iv->iv_vec); + vec = iv->iv_vec; + if (intr_stray_count[vec] < MAX_STRAY_LOG) { + printf("stray vector interrupt %d\n", vec); + intr_stray_count[vec]++; + if (intr_stray_count[vec] >= MAX_STRAY_LOG) + printf("got %d stray vector interrupt %d's: not " + "logging anymore\n", MAX_STRAY_LOG, vec); } } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:24:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F346E106566C; Mon, 25 Jul 2011 18:24:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C91E38FC0A; Mon, 25 Jul 2011 18:24:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIOHQT069858; Mon, 25 Jul 2011 18:24:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIOHxP069856; Mon, 25 Jul 2011 18:24:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251824.p6PIOHxP069856@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224359 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:24:18 -0000 Author: marius Date: Mon Jul 25 18:24:17 2011 New Revision: 224359 URL: http://svn.freebsd.org/changeset/base/224359 Log: MFC: r223235 - As with stray vector interrupts limit the reporting of stray level interrupts. Bringup on additional machine models repeatedly reveals firmware that enables interrupts behind our back, causing the console to be flooded otherwise. - As with the regular interrupt counters using uint16_t instead of u_long for counting the stray vector interrupts should be more than sufficient. - Cache the interrupt vector in intr_stray_vector(). Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:23:24 2011 (r224358) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:24:17 2011 (r224359) @@ -84,10 +84,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struc ih_func_t *intr_handlers[PIL_MAX]; uint16_t pil_countp[PIL_MAX]; +static uint16_t pil_stray_count[PIL_MAX]; struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; -static u_long intr_stray_count[IV_MAX]; +static uint16_t intr_stray_count[IV_MAX]; static const char *const pil_names[] = { "stray", @@ -199,22 +200,32 @@ intr_setup(int pri, ih_func_t *ihf, int static void intr_stray_level(struct trapframe *tf) { + uint64_t level; - printf("stray level interrupt %ld\n", tf->tf_level); + level = tf->tf_level; + if (pil_stray_count[level] < MAX_STRAY_LOG) { + printf("stray level interrupt %ld\n", level); + pil_stray_count[level]++; + if (pil_stray_count[level] >= MAX_STRAY_LOG) + printf("got %d stray level interrupt %ld's: not " + "logging anymore\n", MAX_STRAY_LOG, level); + } } static void intr_stray_vector(void *cookie) { struct intr_vector *iv; + u_int vec; iv = cookie; - if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) { - printf("stray vector interrupt %d\n", iv->iv_vec); - intr_stray_count[iv->iv_vec]++; - if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG) - printf("got %d stray interrupt %d's: not logging " - "anymore\n", MAX_STRAY_LOG, iv->iv_vec); + vec = iv->iv_vec; + if (intr_stray_count[vec] < MAX_STRAY_LOG) { + printf("stray vector interrupt %d\n", vec); + intr_stray_count[vec]++; + if (intr_stray_count[vec] >= MAX_STRAY_LOG) + printf("got %d stray vector interrupt %d's: not " + "logging anymore\n", MAX_STRAY_LOG, vec); } } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:25:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB856106566C; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BACC48FC08; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIPU7X069988; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIPUGT069986; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251825.p6PIPUGT069986@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224360 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:25:30 -0000 Author: marius Date: Mon Jul 25 18:25:30 2011 New Revision: 224360 URL: http://svn.freebsd.org/changeset/base/224360 Log: MFC: r223347 As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:24:17 2011 (r224359) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224360) @@ -1988,11 +1988,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2000,17 +1999,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; pm->pm_active |= PCPU_GET(cpumask); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } vm_offset_t From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:25:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC1E1065672; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9F258FC0A; Mon, 25 Jul 2011 18:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIPUI4069994; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIPUgf069991; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251825.p6PIPUgf069991@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224361 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:25:31 -0000 Author: marius Date: Mon Jul 25 18:25:30 2011 New Revision: 224361 URL: http://svn.freebsd.org/changeset/base/224361 Log: MFC: r223347 As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224360) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224361) @@ -2136,11 +2136,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2148,17 +2147,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; pm->pm_active |= PCPU_GET(cpumask); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } void From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:26:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39945106566B; Mon, 25 Jul 2011 18:26:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 290EF8FC15; Mon, 25 Jul 2011 18:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIQt1F070087; Mon, 25 Jul 2011 18:26:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIQt92070085; Mon, 25 Jul 2011 18:26:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251826.p6PIQt92070085@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224362 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:26:55 -0000 Author: marius Date: Mon Jul 25 18:26:54 2011 New Revision: 224362 URL: http://svn.freebsd.org/changeset/base/224362 Log: MFC: r223377 On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space increase the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224361) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:26:54 2011 (r224362) @@ -384,11 +384,12 @@ pmap_bootstrap(u_int cpu_impl) * public documentation is available for these, the latter just might * not support it, yet. */ - virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) + cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) { tsb_kernel_ldd_phys = 1; - else { + virtsz = roundup(5 / 3 * physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); + } else { dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { data = dtlb_get_data(i); @@ -401,6 +402,8 @@ pmap_bootstrap(u_int cpu_impl) if (cpu_impl >= CPU_IMPL_ULTRASPARCI && cpu_impl < CPU_IMPL_ULTRASPARCIII) dtlb_slots_avail /= 2; + virtsz = roundup(physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); virtsz = MIN(virtsz, (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:28:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 783E6106564A; Mon, 25 Jul 2011 18:28:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677618FC1C; Mon, 25 Jul 2011 18:28:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PISCbL070172; Mon, 25 Jul 2011 18:28:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PISCuU070169; Mon, 25 Jul 2011 18:28:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251828.p6PISCuU070169@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224363 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:28:12 -0000 Author: marius Date: Mon Jul 25 18:28:12 2011 New Revision: 224363 URL: http://svn.freebsd.org/changeset/base/224363 Log: MFC: r223378 On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory. Modified: stable/8/sys/sparc64/include/tsb.h stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/tsb.h ============================================================================== --- stable/8/sys/sparc64/include/tsb.h Mon Jul 25 18:26:54 2011 (r224362) +++ stable/8/sys/sparc64/include/tsb.h Mon Jul 25 18:28:12 2011 (r224363) @@ -50,7 +50,6 @@ extern struct tte *tsb_kernel; extern vm_size_t tsb_kernel_mask; extern vm_size_t tsb_kernel_size; extern vm_paddr_t tsb_kernel_phys; -extern u_int tsb_kernel_ldd_phys; static __inline struct tte * tsb_vpntobucket(pmap_t pm, vm_offset_t vpn) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:26:54 2011 (r224362) +++ stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:28:12 2011 (r224363) @@ -222,7 +222,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) #endif /* @@ -242,6 +242,7 @@ #define UMA_MD_SMALL_ALLOC +extern u_int tsb_kernel_ldd_phys; extern vm_offset_t vm_max_kernel_address; #endif /* !_MACHINE_VMPARAM_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:29:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C7E1065677; Mon, 25 Jul 2011 18:29:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B91368FC0A; Mon, 25 Jul 2011 18:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PITZeU070292; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PITZmP070290; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251829.p6PITZmP070290@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224364 - stable/7/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:29:35 -0000 Author: marius Date: Mon Jul 25 18:29:35 2011 New Revision: 224364 URL: http://svn.freebsd.org/changeset/base/224364 Log: MFC: r223379 Fix whitespace Modified: stable/7/sys/sparc64/include/vmparam.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 18:28:12 2011 (r224363) +++ stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224364) @@ -85,7 +85,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -144,13 +144,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:29:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 077F3106567A; Mon, 25 Jul 2011 18:29:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB13C8FC1B; Mon, 25 Jul 2011 18:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PITZUG070306; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PITZNK070304; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251829.p6PITZNK070304@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224365 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:29:36 -0000 Author: marius Date: Mon Jul 25 18:29:35 2011 New Revision: 224365 URL: http://svn.freebsd.org/changeset/base/224365 Log: MFC: r223379 Fix whitespace Modified: stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224364) +++ stable/8/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224365) @@ -81,7 +81,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -140,13 +140,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:32:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BA34106566B; Mon, 25 Jul 2011 18:32:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29D498FC0A; Mon, 25 Jul 2011 18:32:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIWt0n070498; Mon, 25 Jul 2011 18:32:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIWtLD070495; Mon, 25 Jul 2011 18:32:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251832.p6PIWtLD070495@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224366 - stable/7/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:32:55 -0000 Author: marius Date: Mon Jul 25 18:32:54 2011 New Revision: 224366 URL: http://svn.freebsd.org/changeset/base/224366 Log: MFC: r223648, r223949 - In gem_reset_rx() also reset the RX MAC which is necessary in order to get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW. - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the its old content. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the GEM datasheet the RX MAC should also be disabled in gem_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. In joint forces with: yongari Modified: stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gemvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:29:35 2011 (r224365) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:32:54 2011 (r224366) @@ -705,7 +705,7 @@ gem_reset_rx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_rx(sc); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -715,7 +715,7 @@ gem_reset_rx(struct gem_softc *sc) /* Wait 5ms extra. */ DELAY(5000); - /* Finally, reset the ERX. */ + /* Reset the ERX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -724,6 +724,16 @@ gem_reset_rx(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } + + /* Finally, reset RX MAC. */ + GEM_BANK1_WRITE_4(sc, GEM_MAC_RXRESET, 1); + GEM_BANK1_BARRIER(sc, GEM_MAC_RXRESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RXRESET, 1, 0)) { + device_printf(sc->sc_dev, "cannot reset RX MAC\n"); + return (1); + } + return (0); } @@ -759,7 +769,7 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -770,8 +780,11 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, - GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE); + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); } static int @@ -782,7 +795,7 @@ gem_reset_tx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_tx(sc); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -812,8 +825,10 @@ gem_disable_rx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) & ~GEM_MAC_RX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + return (0); } static int @@ -824,8 +839,10 @@ gem_disable_tx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG) & ~GEM_MAC_TX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + return (0); } static int @@ -960,7 +977,6 @@ gem_init_locked(struct gem_softc *sc) gem_init_regs(sc); /* step 5. RX MAC registers & counters */ - gem_setladrf(sc); /* step 6 & 7. Program Descriptor Ring Base Addresses. */ /* NOTE: we use only 32-bit DMA addresses here. */ @@ -1032,7 +1048,7 @@ gem_init_locked(struct gem_softc *sc) (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -1049,22 +1065,19 @@ gem_init_locked(struct gem_softc *sc) /* step 12. RX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - v |= GEM_MAC_RX_ENABLE | GEM_MAC_RX_STRIP_CRC; - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure RX MAC\n"); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + v &= ~GEM_MAC_RX_ENABLE; + v |= GEM_MAC_RX_STRIP_CRC; + sc->sc_mac_rxcfg = v; + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, v); /* step 14. Issue Transmit Pending command. */ @@ -1588,7 +1601,7 @@ gem_rint(struct gem_softc *sc) * the buffer that's already attached to this descriptor. */ if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; } @@ -2028,8 +2041,8 @@ gem_mii_statchg(device_t dev) * the GEM Gigabit Ethernet ASIC Specification. */ - rxcfg = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - rxcfg &= ~(GEM_MAC_RX_CARR_EXTEND | GEM_MAC_RX_ENABLE); + rxcfg = sc->sc_mac_rxcfg; + rxcfg &= ~GEM_MAC_RX_CARR_EXTEND; txcfg = GEM_MAC_TX_ENA_IPG0 | GEM_MAC_TX_NGU | GEM_MAC_TX_NGU_LIMIT; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0) txcfg |= GEM_MAC_TX_IGN_CARRIER | GEM_MAC_TX_IGN_COLLIS; @@ -2037,17 +2050,9 @@ gem_mii_statchg(device_t dev) rxcfg |= GEM_MAC_RX_CARR_EXTEND; txcfg |= GEM_MAC_TX_CARR_EXTEND; } - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, txcfg); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, rxcfg); v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) & @@ -2092,6 +2097,7 @@ gem_mii_statchg(device_t dev) v |= GEM_MAC_XIF_FDPLX_LED; GEM_BANK1_WRITE_4(sc, GEM_MAC_XIF_CONFIG, v); + sc->sc_mac_rxcfg = rxcfg; if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & GEM_LINK) != 0) { GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, @@ -2164,7 +2170,8 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: GEM_LOCK(sc); - gem_setladrf(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + gem_setladrf(sc); GEM_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2199,24 +2206,20 @@ gem_setladrf(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); - /* Get the current RX configuration. */ - v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - /* - * Turn off promiscuous mode, promiscuous group mode (all multicast), - * and hash filter. Depending on the case, the right bit will be - * enabled. + * Turn off the RX MAC and the hash filter as required by the Sun GEM + * programming restrictions. */ - v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_HASH_FILTER | - GEM_MAC_RX_PROMISC_GRP); - + v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER; GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER, - 0)) - device_printf(sc->sc_dev, "cannot disable RX hash filter\n"); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER | + GEM_MAC_RX_ENABLE, 0)) + device_printf(sc->sc_dev, + "cannot disable RX MAC or hash filter\n"); + v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_PROMISC_GRP); if ((ifp->if_flags & IFF_PROMISC) != 0) { v |= GEM_MAC_RX_PROMISCUOUS; goto chipit; @@ -2262,5 +2265,6 @@ gem_setladrf(struct gem_softc *sc) hash[i]); chipit: - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + sc->sc_mac_rxcfg = v; + GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v | GEM_MAC_RX_ENABLE); } Modified: stable/7/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/7/sys/dev/gem/if_gemvar.h Mon Jul 25 18:29:35 2011 (r224365) +++ stable/7/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:54 2011 (r224366) @@ -173,6 +173,8 @@ struct gem_softc { u_int sc_rxptr; /* next ready RX descriptor/state */ u_int sc_rxfifosize; /* RX FIFO size (bytes) */ + uint32_t sc_mac_rxcfg; /* RX MAC conf. % GEM_MAC_RX_ENABLE */ + int sc_ifflags; u_long sc_csum_features; }; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:32:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E95E106564A; Mon, 25 Jul 2011 18:32:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7B788FC0C; Mon, 25 Jul 2011 18:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIWuLD070530; Mon, 25 Jul 2011 18:32:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIWu9l070527; Mon, 25 Jul 2011 18:32:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251832.p6PIWu9l070527@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224367 - stable/8/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:32:57 -0000 Author: marius Date: Mon Jul 25 18:32:56 2011 New Revision: 224367 URL: http://svn.freebsd.org/changeset/base/224367 Log: MFC: r223648, r223949 - In gem_reset_rx() also reset the RX MAC which is necessary in order to get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW. - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the its old content. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the GEM datasheet the RX MAC should also be disabled in gem_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. In joint forces with: yongari Modified: stable/8/sys/dev/gem/if_gem.c stable/8/sys/dev/gem/if_gemvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:32:54 2011 (r224366) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:32:56 2011 (r224367) @@ -705,7 +705,7 @@ gem_reset_rx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_rx(sc); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -715,7 +715,7 @@ gem_reset_rx(struct gem_softc *sc) /* Wait 5ms extra. */ DELAY(5000); - /* Finally, reset the ERX. */ + /* Reset the ERX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -724,6 +724,16 @@ gem_reset_rx(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } + + /* Finally, reset RX MAC. */ + GEM_BANK1_WRITE_4(sc, GEM_MAC_RXRESET, 1); + GEM_BANK1_BARRIER(sc, GEM_MAC_RXRESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RXRESET, 1, 0)) { + device_printf(sc->sc_dev, "cannot reset RX MAC\n"); + return (1); + } + return (0); } @@ -759,7 +769,7 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -770,8 +780,11 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, - GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE); + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); } static int @@ -782,7 +795,7 @@ gem_reset_tx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_tx(sc); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -812,8 +825,10 @@ gem_disable_rx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) & ~GEM_MAC_RX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + return (0); } static int @@ -824,8 +839,10 @@ gem_disable_tx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG) & ~GEM_MAC_TX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + return (0); } static int @@ -960,7 +977,6 @@ gem_init_locked(struct gem_softc *sc) gem_init_regs(sc); /* step 5. RX MAC registers & counters */ - gem_setladrf(sc); /* step 6 & 7. Program Descriptor Ring Base Addresses. */ /* NOTE: we use only 32-bit DMA addresses here. */ @@ -1032,7 +1048,7 @@ gem_init_locked(struct gem_softc *sc) (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -1049,22 +1065,19 @@ gem_init_locked(struct gem_softc *sc) /* step 12. RX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - v |= GEM_MAC_RX_ENABLE | GEM_MAC_RX_STRIP_CRC; - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure RX MAC\n"); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + v &= ~GEM_MAC_RX_ENABLE; + v |= GEM_MAC_RX_STRIP_CRC; + sc->sc_mac_rxcfg = v; + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, v); /* step 14. Issue Transmit Pending command. */ @@ -1588,7 +1601,7 @@ gem_rint(struct gem_softc *sc) * the buffer that's already attached to this descriptor. */ if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; } @@ -2028,8 +2041,8 @@ gem_mii_statchg(device_t dev) * the GEM Gigabit Ethernet ASIC Specification. */ - rxcfg = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - rxcfg &= ~(GEM_MAC_RX_CARR_EXTEND | GEM_MAC_RX_ENABLE); + rxcfg = sc->sc_mac_rxcfg; + rxcfg &= ~GEM_MAC_RX_CARR_EXTEND; txcfg = GEM_MAC_TX_ENA_IPG0 | GEM_MAC_TX_NGU | GEM_MAC_TX_NGU_LIMIT; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0) txcfg |= GEM_MAC_TX_IGN_CARRIER | GEM_MAC_TX_IGN_COLLIS; @@ -2037,17 +2050,9 @@ gem_mii_statchg(device_t dev) rxcfg |= GEM_MAC_RX_CARR_EXTEND; txcfg |= GEM_MAC_TX_CARR_EXTEND; } - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, txcfg); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, rxcfg); v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) & @@ -2092,6 +2097,7 @@ gem_mii_statchg(device_t dev) v |= GEM_MAC_XIF_FDPLX_LED; GEM_BANK1_WRITE_4(sc, GEM_MAC_XIF_CONFIG, v); + sc->sc_mac_rxcfg = rxcfg; if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & GEM_LINK) != 0) { GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, @@ -2164,7 +2170,8 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: GEM_LOCK(sc); - gem_setladrf(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + gem_setladrf(sc); GEM_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2199,24 +2206,20 @@ gem_setladrf(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); - /* Get the current RX configuration. */ - v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - /* - * Turn off promiscuous mode, promiscuous group mode (all multicast), - * and hash filter. Depending on the case, the right bit will be - * enabled. + * Turn off the RX MAC and the hash filter as required by the Sun GEM + * programming restrictions. */ - v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_HASH_FILTER | - GEM_MAC_RX_PROMISC_GRP); - + v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER; GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER, - 0)) - device_printf(sc->sc_dev, "cannot disable RX hash filter\n"); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER | + GEM_MAC_RX_ENABLE, 0)) + device_printf(sc->sc_dev, + "cannot disable RX MAC or hash filter\n"); + v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_PROMISC_GRP); if ((ifp->if_flags & IFF_PROMISC) != 0) { v |= GEM_MAC_RX_PROMISCUOUS; goto chipit; @@ -2262,5 +2265,6 @@ gem_setladrf(struct gem_softc *sc) hash[i]); chipit: - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + sc->sc_mac_rxcfg = v; + GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v | GEM_MAC_RX_ENABLE); } Modified: stable/8/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/8/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:54 2011 (r224366) +++ stable/8/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:56 2011 (r224367) @@ -173,6 +173,8 @@ struct gem_softc { u_int sc_rxptr; /* next ready RX descriptor/state */ u_int sc_rxfifosize; /* RX FIFO size (bytes) */ + uint32_t sc_mac_rxcfg; /* RX MAC conf. % GEM_MAC_RX_ENABLE */ + int sc_ifflags; u_long sc_csum_features; }; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:34:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675B01065673; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56F7B8FC13; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIYgmc070687; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIYgWk070685; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251834.p6PIYgWk070685@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224368 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:34:42 -0000 Author: marius Date: Mon Jul 25 18:34:42 2011 New Revision: 224368 URL: http://svn.freebsd.org/changeset/base/224368 Log: MFC: r223718 Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to merge the two. Modified: stable/7/sys/sparc64/sparc64/exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:32:56 2011 (r224367) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224368) @@ -365,11 +365,18 @@ ENTRY(rsf_fatal) sir END(rsf_fatal) - .comm intrnames, IV_MAX * (MAXCOMLEN + 1) - .comm eintrnames, 0 + .data + _ALIGN_DATA + .globl intrnames, eintrnames +intrnames: + .space IV_MAX * (MAXCOMLEN + 1) +eintrnames: + .globl intrcnt, eintrcnt +intrcnt: + .space IV_MAX * 8 +eintrcnt: - .comm intrcnt, IV_MAX * 8 - .comm eintrcnt, 0 + .text /* * Trap table and associated macros From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:34:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711511065674; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6072F8FC14; Mon, 25 Jul 2011 18:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIYg1R070691; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIYgkV070689; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251834.p6PIYgkV070689@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224369 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:34:42 -0000 Author: marius Date: Mon Jul 25 18:34:42 2011 New Revision: 224369 URL: http://svn.freebsd.org/changeset/base/224369 Log: MFC: r223718 Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to merge the two. Modified: stable/8/sys/sparc64/sparc64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224368) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224369) @@ -369,11 +369,18 @@ ENTRY(rsf_fatal) sir END(rsf_fatal) - .comm intrnames, IV_MAX * (MAXCOMLEN + 1) - .comm eintrnames, 0 + .data + _ALIGN_DATA + .globl intrnames, eintrnames +intrnames: + .space IV_MAX * (MAXCOMLEN + 1) +eintrnames: + .globl intrcnt, eintrcnt +intrcnt: + .space IV_MAX * 8 +eintrcnt: - .comm intrcnt, IV_MAX * 8 - .comm eintrcnt, 0 + .text /* * Trap table and associated macros From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:41:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2454B106566B; Mon, 25 Jul 2011 18:41:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11CCF8FC14; Mon, 25 Jul 2011 18:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIfrlQ070957; Mon, 25 Jul 2011 18:41:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIfqND070945; Mon, 25 Jul 2011 18:41:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251841.p6PIfqND070945@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224370 - in stable/8/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:41:53 -0000 Author: marius Date: Mon Jul 25 18:41:52 2011 New Revision: 224370 URL: http://svn.freebsd.org/changeset/base/224370 Log: MFC: r223719 - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Modified: stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/sparc64/include/cache.h stable/8/sys/sparc64/include/cpu.h stable/8/sys/sparc64/include/tlb.h stable/8/sys/sparc64/sparc64/cache.c stable/8/sys/sparc64/sparc64/cheetah.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/mp_machdep.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sparc64/sparc64/spitfire.c stable/8/sys/sparc64/sparc64/zeus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/boot/sparc64/loader/main.c Mon Jul 25 18:41:52 2011 (r224370) @@ -96,10 +96,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(u_int); +static inline u_long dtlb_get_data_sun4u(u_int, u_int); static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(u_int); +static inline u_long itlb_get_data_sun4u(u_int, u_int); static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); @@ -140,6 +140,7 @@ u_int itlb_slot; static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; +static u_int tlb_locked; /* sun4v */ static struct tlb_entry *tlb_store; @@ -413,42 +414,55 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(u_int slot) +dtlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static inline u_long -itlb_get_data_sun4u(u_int slot) +itlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t va) { u_long pstate, reg; - int i; + u_int i, tlb; pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < dtlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = dtlb_get_data_sun4u(i); + reg = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -469,10 +483,11 @@ itlb_va_to_pa_sun4u(vm_offset_t va) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < itlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = itlb_get_data_sun4u(i); + reg = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -516,14 +531,14 @@ itlb_relocate_locked0_sun4u(void) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); - data = itlb_get_data_sun4u(0); + data = itlb_get_data_sun4u(tlb_locked, 0); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { wrpr(pstate, pstate, 0); return; } /* Flush the mapping of slot 0. */ - tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG); stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); flush(0); /* The USIII-family ignores the address. */ @@ -533,11 +548,12 @@ itlb_relocate_locked0_sun4u(void) * that formerly were in slot 0. */ for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) + if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0) continue; stxa(AA_IMMU_TAR, ASI_IMMU, tag); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG, + data); flush(0); /* The USIII-family ignores the address. */ break; } @@ -750,6 +766,26 @@ tlb_init_sun4u(void) phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + tlb_locked = TLB_DAR_T32; + break; + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + tlb_locked = TLB_DAR_T16; + break; + case CPU_IMPL_SPARC64V: + tlb_locked = TLB_DAR_FTLB; + break; + } bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); @@ -936,21 +972,23 @@ pmap_print_tlb_sun4u(void) pstate = rdpr(pstate); for (i = 0; i < itlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = itlb_get_data_sun4u(i); + tte = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); printf("iTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } for (i = 0; i < dtlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = dtlb_get_data_sun4u(i); + tte = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); printf("dTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } Modified: stable/8/sys/sparc64/include/cache.h ============================================================================== --- stable/8/sys/sparc64/include/cache.h Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/include/cache.h Mon Jul 25 18:41:52 2011 (r224370) @@ -110,15 +110,16 @@ cache_flush_t spitfire_cache_flush; dcache_page_inval_t spitfire_dcache_page_inval; icache_page_inval_t spitfire_icache_page_inval; +cache_enable_t zeus_cache_enable; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + extern cache_enable_t *cache_enable; extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; -cache_flush_t zeus_cache_flush; -dcache_page_inval_t zeus_dcache_page_inval; -icache_page_inval_t zeus_icache_page_inval; - #endif /* KERNEL */ #endif /* !LOCORE */ Modified: stable/8/sys/sparc64/include/cpu.h ============================================================================== --- stable/8/sys/sparc64/include/cpu.h Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/include/cpu.h Mon Jul 25 18:41:52 2011 (r224370) @@ -57,6 +57,7 @@ void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *v); +void zeus_init(u_int cpu_impl); static __inline u_int64_t get_cyclecount(void) Modified: stable/8/sys/sparc64/include/tlb.h ============================================================================== --- stable/8/sys/sparc64/include/tlb.h Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/include/tlb.h Mon Jul 25 18:41:52 2011 (r224370) @@ -44,7 +44,17 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ +#define TLB_DAR_STLB (2) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) @@ -156,6 +166,9 @@ tlb_flush_user_t cheetah_tlb_flush_user; tlb_flush_nonlocked_t spitfire_tlb_flush_nonlocked; tlb_flush_user_t spitfire_tlb_flush_user; +tlb_flush_nonlocked_t zeus_tlb_flush_nonlocked; +tlb_flush_user_t zeus_tlb_flush_user; + extern tlb_flush_nonlocked_t *tlb_flush_nonlocked; extern tlb_flush_user_t *tlb_flush_user; Modified: stable/8/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cache.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/cache.c Mon Jul 25 18:41:52 2011 (r224370) @@ -169,12 +169,12 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { - cache_enable = cheetah_cache_enable; + cache_enable = zeus_cache_enable; cache_flush = zeus_cache_flush; dcache_page_inval = zeus_dcache_page_inval; icache_page_inval = zeus_icache_page_inval; - tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; - tlb_flush_user = cheetah_tlb_flush_user; + tlb_flush_nonlocked = zeus_tlb_flush_nonlocked; + tlb_flush_user = zeus_tlb_flush_user; } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; Modified: stable/8/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:41:52 2011 (r224370) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005, 2008, 2010 Marius Strobl + * Copyright (c) 2005 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_pmap.h" - #include #include #include @@ -45,17 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #define CHEETAH_ICACHE_TAG_LOWER 0x30 +#define CHEETAH_T16_ENTRIES 16 +#define CHEETAH_DT512_ENTRIES 512 +#define CHEETAH_IT128_ENTRIES 128 +#define CHEETAH_IT512_ENTRIES 512 /* - * CPU-specific initialization - this is used for both the Sun Cheetah and - * later as well as the Fujitsu Zeus and later CPUs. + * CPU-specific initialization for Sun Cheetah and later CPUs */ void cheetah_init(u_int cpu_impl) @@ -78,14 +78,6 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); - if (cpu_impl == CPU_IMPL_SPARC64V) { - /* Ensure MCNTL_JPS1_TSBP is 0. */ - val = ldxa(AA_MCNTL, ASI_MCNTL); - val &= ~MCNTL_JPS1_TSBP; - stxa(AA_MCNTL, ASI_MCNTL, val); - return; - } - /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -223,33 +215,92 @@ cheetah_icache_page_inval(vm_paddr_t pa } -#define cheetah_dmap_all() do { \ - stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); \ - stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); \ - flush(KERNBASE); \ -} while (0) - /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void cheetah_tlb_flush_nonlocked(void) { - cheetah_dmap_all(); + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void -cheetah_tlb_flush_user() +cheetah_tlb_flush_user(void) { + u_long data, tag; + register_t s; + u_int i, slot; /* - * Just use cheetah_dmap_all() and accept somes TLB misses - * rather than searching all 1040 D-TLB and 144 I-TLB slots - * for non-kernel mappings. + * We read ASI_{D,I}TLB_DATA_ACCESS_REG twice back-to-back in order + * to work around errata of USIII and beyond. */ - cheetah_dmap_all(); + for (i = 0; i < CHEETAH_T16_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_T16, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < CHEETAH_DT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_DT512_0, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_DT512_1, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + } + if (PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIVp) { + for (i = 0; i < CHEETAH_IT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT512, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } else { + for (i = 0; i < CHEETAH_IT128_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT128, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + intr_restore(s); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } } Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:41:52 2011 (r224370) @@ -347,9 +347,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); + else if (cpu_impl == CPU_IMPL_SPARC64V) + zeus_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:41:52 2011 (r224370) @@ -424,9 +424,11 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl == CPU_IMPL_SPARC64V || - pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + else if (pc->pc_impl == CPU_IMPL_SPARC64V) + zeus_init(pc->pc_impl); + /* * Enable the caches. Note that his may include applying workarounds. */ Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:41:52 2011 (r224370) @@ -247,7 +247,7 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); -static inline u_long dtlb_get_data(u_int slot); +static inline u_long dtlb_get_data(u_int tlb, u_int slot); /* * Quick sort callout for comparing memory regions @@ -288,15 +288,21 @@ om_cmp(const void *a, const void *b) } static inline u_long -dtlb_get_data(u_int slot) +dtlb_get_data(u_int tlb, u_int slot) { + u_long data; + register_t s; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + return (data); } /* @@ -392,7 +398,9 @@ pmap_bootstrap(u_int cpu_impl) } else { dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { - data = dtlb_get_data(i); + data = dtlb_get_data(cpu_impl == + CPU_IMPL_ULTRASPARCIII ? TLB_DAR_T16 : + TLB_DAR_T32, i); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) dtlb_slots_avail++; } Modified: stable/8/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/8/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:41:52 2011 (r224370) @@ -140,47 +140,45 @@ spitfire_icache_page_inval(vm_paddr_t pa } /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void spitfire_tlb_flush_nonlocked(void) { - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - if ((ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - if ((ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + if ((ldxa(slot, ASI_DTLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + if ((ldxa(slot, ASI_ITLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void spitfire_tlb_flush_user(void) { u_long data; u_long tag; - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - data = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - data = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } Modified: stable/8/sys/sparc64/sparc64/zeus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:34:42 2011 (r224369) +++ stable/8/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:41:52 2011 (r224370) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Marius Strobl + * Copyright (c) 2010 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,64 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include +#include + +#define ZEUS_FTLB_ENTRIES 32 +#define ZEUS_STLB_ENTRIES 2048 + +/* + * CPU-specific initialization for Fujitsu Zeus CPUs + */ +void +zeus_init(u_int cpu_impl) +{ + u_long val; + + /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ + + stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0); + membar(Sync); + + stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0); + /* + * NB: the secondary context was removed from the iMMU. + */ + membar(Sync); + + stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); + membar(Sync); + + val = ldxa(AA_MCNTL, ASI_MCNTL); + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val &= ~MCNTL_JPS1_TSBP; + /* + * Ensure 4-Mbyte page entries are stored in the 1024-entry, 2-way set + * associative TLB. + */ + val = (val & ~MCNTL_RMD_MASK) | MCNTL_RMD_1024; + stxa(AA_MCNTL, ASI_MCNTL, val); +} + +/* + * Enable level 1 caches. + */ +void +zeus_cache_enable(u_int cpu_impl) +{ + u_long lsu; + + lsu = ldxa(0, ASI_LSU_CTL_REG); + stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); + flush(KERNBASE); +} /* * Flush all lines from the level 1 caches. @@ -63,3 +120,52 @@ zeus_icache_page_inval(vm_paddr_t pa __u { } + +/* + * Flush all non-locked mappings from the TLBs. + */ +void +zeus_tlb_flush_nonlocked(void) +{ + + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); +} + +/* + * Flush all user mappings from the TLBs. + */ +void +zeus_tlb_flush_user(void) +{ + u_long data, tag; + u_int i, slot; + + for (i = 0; i < ZEUS_FTLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_FTLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < ZEUS_STLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_STLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } +} From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:42:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20D61065670; Mon, 25 Jul 2011 18:42:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF91A8FC08; Mon, 25 Jul 2011 18:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIgjrg071043; Mon, 25 Jul 2011 18:42:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIgjC1071031; Mon, 25 Jul 2011 18:42:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251842.p6PIgjC1071031@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224371 - in stable/7/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:42:46 -0000 Author: marius Date: Mon Jul 25 18:42:45 2011 New Revision: 224371 URL: http://svn.freebsd.org/changeset/base/224371 Log: MFC: r223719 - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Modified: stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/sparc64/include/cache.h stable/7/sys/sparc64/include/cpu.h stable/7/sys/sparc64/include/tlb.h stable/7/sys/sparc64/sparc64/cache.c stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/spitfire.c stable/7/sys/sparc64/sparc64/zeus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/boot/sparc64/loader/main.c Mon Jul 25 18:42:45 2011 (r224371) @@ -96,10 +96,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(u_int); +static inline u_long dtlb_get_data_sun4u(u_int, u_int); static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(u_int); +static inline u_long itlb_get_data_sun4u(u_int, u_int); static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); @@ -140,6 +140,7 @@ u_int itlb_slot; static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; +static u_int tlb_locked; /* sun4v */ static struct tlb_entry *tlb_store; @@ -414,42 +415,55 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(u_int slot) +dtlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static inline u_long -itlb_get_data_sun4u(u_int slot) +itlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t va) { u_long pstate, reg; - int i; + u_int i, tlb; pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < dtlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = dtlb_get_data_sun4u(i); + reg = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -470,10 +484,11 @@ itlb_va_to_pa_sun4u(vm_offset_t va) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < itlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = itlb_get_data_sun4u(i); + reg = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -517,14 +532,14 @@ itlb_relocate_locked0_sun4u(void) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); - data = itlb_get_data_sun4u(0); + data = itlb_get_data_sun4u(tlb_locked, 0); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { wrpr(pstate, pstate, 0); return; } /* Flush the mapping of slot 0. */ - tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG); stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); flush(0); /* The USIII-family ignores the address. */ @@ -534,11 +549,12 @@ itlb_relocate_locked0_sun4u(void) * that formerly were in slot 0. */ for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) + if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0) continue; stxa(AA_IMMU_TAR, ASI_IMMU, tag); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG, + data); flush(0); /* The USIII-family ignores the address. */ break; } @@ -751,6 +767,26 @@ tlb_init_sun4u(void) phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + tlb_locked = TLB_DAR_T32; + break; + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + tlb_locked = TLB_DAR_T16; + break; + case CPU_IMPL_SPARC64V: + tlb_locked = TLB_DAR_FTLB; + break; + } bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); @@ -937,21 +973,23 @@ pmap_print_tlb_sun4u(void) pstate = rdpr(pstate); for (i = 0; i < itlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = itlb_get_data_sun4u(i); + tte = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); printf("iTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } for (i = 0; i < dtlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = dtlb_get_data_sun4u(i); + tte = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); printf("dTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } Modified: stable/7/sys/sparc64/include/cache.h ============================================================================== --- stable/7/sys/sparc64/include/cache.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/cache.h Mon Jul 25 18:42:45 2011 (r224371) @@ -110,15 +110,16 @@ cache_flush_t spitfire_cache_flush; dcache_page_inval_t spitfire_dcache_page_inval; icache_page_inval_t spitfire_icache_page_inval; +cache_enable_t zeus_cache_enable; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + extern cache_enable_t *cache_enable; extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; -cache_flush_t zeus_cache_flush; -dcache_page_inval_t zeus_dcache_page_inval; -icache_page_inval_t zeus_icache_page_inval; - #endif /* KERNEL */ #endif /* !LOCORE */ Modified: stable/7/sys/sparc64/include/cpu.h ============================================================================== --- stable/7/sys/sparc64/include/cpu.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/cpu.h Mon Jul 25 18:42:45 2011 (r224371) @@ -57,6 +57,7 @@ void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *v); +void zeus_init(u_int cpu_impl); static __inline u_int64_t get_cyclecount(void) Modified: stable/7/sys/sparc64/include/tlb.h ============================================================================== --- stable/7/sys/sparc64/include/tlb.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/tlb.h Mon Jul 25 18:42:45 2011 (r224371) @@ -44,7 +44,17 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ +#define TLB_DAR_STLB (2) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) @@ -156,6 +166,9 @@ tlb_flush_user_t cheetah_tlb_flush_user; tlb_flush_nonlocked_t spitfire_tlb_flush_nonlocked; tlb_flush_user_t spitfire_tlb_flush_user; +tlb_flush_nonlocked_t zeus_tlb_flush_nonlocked; +tlb_flush_user_t zeus_tlb_flush_user; + extern tlb_flush_nonlocked_t *tlb_flush_nonlocked; extern tlb_flush_user_t *tlb_flush_user; Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/cache.c Mon Jul 25 18:42:45 2011 (r224371) @@ -169,12 +169,12 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { - cache_enable = cheetah_cache_enable; + cache_enable = zeus_cache_enable; cache_flush = zeus_cache_flush; dcache_page_inval = zeus_dcache_page_inval; icache_page_inval = zeus_icache_page_inval; - tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; - tlb_flush_user = cheetah_tlb_flush_user; + tlb_flush_nonlocked = zeus_tlb_flush_nonlocked; + tlb_flush_user = zeus_tlb_flush_user; } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:42:45 2011 (r224371) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005, 2008, 2010 Marius Strobl + * Copyright (c) 2005 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_pmap.h" - #include #include #include @@ -45,17 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #define CHEETAH_ICACHE_TAG_LOWER 0x30 +#define CHEETAH_T16_ENTRIES 16 +#define CHEETAH_DT512_ENTRIES 512 +#define CHEETAH_IT128_ENTRIES 128 +#define CHEETAH_IT512_ENTRIES 512 /* - * CPU-specific initialization - this is used for both the Sun Cheetah and - * later as well as the Fujitsu Zeus and later CPUs. + * CPU-specific initialization for Sun Cheetah and later CPUs */ void cheetah_init(u_int cpu_impl) @@ -78,14 +78,6 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); - if (cpu_impl == CPU_IMPL_SPARC64V) { - /* Ensure MCNTL_JPS1_TSBP is 0. */ - val = ldxa(AA_MCNTL, ASI_MCNTL); - val &= ~MCNTL_JPS1_TSBP; - stxa(AA_MCNTL, ASI_MCNTL, val); - return; - } - /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -223,33 +215,92 @@ cheetah_icache_page_inval(vm_paddr_t pa } -#define cheetah_dmap_all() do { \ - stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); \ - stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); \ - flush(KERNBASE); \ -} while (0) - /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void cheetah_tlb_flush_nonlocked(void) { - cheetah_dmap_all(); + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void -cheetah_tlb_flush_user() +cheetah_tlb_flush_user(void) { + u_long data, tag; + register_t s; + u_int i, slot; /* - * Just use cheetah_dmap_all() and accept somes TLB misses - * rather than searching all 1040 D-TLB and 144 I-TLB slots - * for non-kernel mappings. + * We read ASI_{D,I}TLB_DATA_ACCESS_REG twice back-to-back in order + * to work around errata of USIII and beyond. */ - cheetah_dmap_all(); + for (i = 0; i < CHEETAH_T16_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_T16, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < CHEETAH_DT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_DT512_0, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_DT512_1, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + } + if (PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIVp) { + for (i = 0; i < CHEETAH_IT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT512, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } else { + for (i = 0; i < CHEETAH_IT128_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT128, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + intr_restore(s); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } } Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:42:45 2011 (r224371) @@ -347,9 +347,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); + else if (cpu_impl == CPU_IMPL_SPARC64V) + zeus_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:42:45 2011 (r224371) @@ -415,9 +415,11 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl == CPU_IMPL_SPARC64V || - pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + else if (pc->pc_impl == CPU_IMPL_SPARC64V) + zeus_init(pc->pc_impl); + /* * Enable the caches. Note that his may include applying workarounds. */ Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:42:45 2011 (r224371) @@ -236,7 +236,7 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); -static inline u_long dtlb_get_data(u_int slot); +static inline u_long dtlb_get_data(u_int tlb, u_int slot); /* * Quick sort callout for comparing memory regions @@ -277,15 +277,21 @@ om_cmp(const void *a, const void *b) } static inline u_long -dtlb_get_data(u_int slot) +dtlb_get_data(u_int tlb, u_int slot) { + u_long data; + register_t s; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + return (data); } /* @@ -362,7 +368,8 @@ pmap_bootstrap(u_int cpu_impl) */ dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { - data = dtlb_get_data(i); + data = dtlb_get_data(cpu_impl == CPU_IMPL_ULTRASPARCIII ? + TLB_DAR_T16 : TLB_DAR_T32, i); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) dtlb_slots_avail++; } Modified: stable/7/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/7/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:42:45 2011 (r224371) @@ -140,47 +140,45 @@ spitfire_icache_page_inval(vm_paddr_t pa } /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void spitfire_tlb_flush_nonlocked(void) { - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - if ((ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - if ((ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + if ((ldxa(slot, ASI_DTLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + if ((ldxa(slot, ASI_ITLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void spitfire_tlb_flush_user(void) { u_long data; u_long tag; - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - data = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - data = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } Modified: stable/7/sys/sparc64/sparc64/zeus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:42:45 2011 (r224371) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Marius Strobl + * Copyright (c) 2010 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,64 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include +#include + +#define ZEUS_FTLB_ENTRIES 32 +#define ZEUS_STLB_ENTRIES 2048 + +/* + * CPU-specific initialization for Fujitsu Zeus CPUs + */ +void +zeus_init(u_int cpu_impl) +{ + u_long val; + + /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ + + stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0); + membar(Sync); + + stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0); + /* + * NB: the secondary context was removed from the iMMU. + */ + membar(Sync); + + stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); + membar(Sync); + + val = ldxa(AA_MCNTL, ASI_MCNTL); + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val &= ~MCNTL_JPS1_TSBP; + /* + * Ensure 4-Mbyte page entries are stored in the 1024-entry, 2-way set + * associative TLB. + */ + val = (val & ~MCNTL_RMD_MASK) | MCNTL_RMD_1024; + stxa(AA_MCNTL, ASI_MCNTL, val); +} + +/* + * Enable level 1 caches. + */ +void +zeus_cache_enable(u_int cpu_impl) +{ + u_long lsu; + + lsu = ldxa(0, ASI_LSU_CTL_REG); + stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); + flush(KERNBASE); +} /* * Flush all lines from the level 1 caches. @@ -63,3 +120,52 @@ zeus_icache_page_inval(vm_paddr_t pa __u { } + +/* + * Flush all non-locked mappings from the TLBs. + */ +void +zeus_tlb_flush_nonlocked(void) +{ + + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); +} + +/* + * Flush all user mappings from the TLBs. + */ +void +zeus_tlb_flush_user(void) +{ + u_long data, tag; + u_int i, slot; + + for (i = 0; i < ZEUS_FTLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_FTLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < ZEUS_STLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_STLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } +} From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:43:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68D110656D5; Mon, 25 Jul 2011 18:43:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D60E38FC20; Mon, 25 Jul 2011 18:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIhOxH071119; Mon, 25 Jul 2011 18:43:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIhO5V071117; Mon, 25 Jul 2011 18:43:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251843.p6PIhO5V071117@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224372 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:43:25 -0000 Author: marius Date: Mon Jul 25 18:43:24 2011 New Revision: 224372 URL: http://svn.freebsd.org/changeset/base/224372 Log: MFC: r223720 Don't waste a delay slot. Modified: stable/7/sys/sparc64/sparc64/mp_exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:42:45 2011 (r224371) +++ stable/7/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:24 2011 (r224372) @@ -235,8 +235,8 @@ ENTRY(tl_ipi_tlb_range_demap) ldx [%g5 + ITA_START], %g1 ldx [%g5 + ITA_END], %g2 -1: or %g1, %g3, %g4 sethi %hi(KERNBASE), %g6 +1: or %g1, %g3, %g4 stxa %g0, [%g4] ASI_DMMU_DEMAP stxa %g0, [%g4] ASI_IMMU_DEMAP flush %g6 @@ -245,7 +245,7 @@ ENTRY(tl_ipi_tlb_range_demap) add %g1, %g6, %g1 cmp %g1, %g2 blt,a,pt %xcc, 1b - nop + sethi %hi(KERNBASE), %g6 IPI_DONE(%g5, %g1, %g2, %g3) retry From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:43:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29D210656D7; Mon, 25 Jul 2011 18:43:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1ED58FC13; Mon, 25 Jul 2011 18:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIhPiD071150; Mon, 25 Jul 2011 18:43:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIhP3O071147; Mon, 25 Jul 2011 18:43:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251843.p6PIhP3O071147@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224373 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:43:25 -0000 Author: marius Date: Mon Jul 25 18:43:25 2011 New Revision: 224373 URL: http://svn.freebsd.org/changeset/base/224373 Log: MFC: r223720 Don't waste a delay slot. Modified: stable/8/sys/sparc64/sparc64/mp_exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:24 2011 (r224372) +++ stable/8/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:25 2011 (r224373) @@ -235,8 +235,8 @@ ENTRY(tl_ipi_tlb_range_demap) ldx [%g5 + ITA_START], %g1 ldx [%g5 + ITA_END], %g2 -1: or %g1, %g3, %g4 sethi %hi(KERNBASE), %g6 +1: or %g1, %g3, %g4 stxa %g0, [%g4] ASI_DMMU_DEMAP stxa %g0, [%g4] ASI_IMMU_DEMAP flush %g6 @@ -245,7 +245,7 @@ ENTRY(tl_ipi_tlb_range_demap) add %g1, %g6, %g1 cmp %g1, %g2 blt,a,pt %xcc, 1b - nop + sethi %hi(KERNBASE), %g6 IPI_DONE(%g5, %g1, %g2, %g3) retry From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:44:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387ED106564A; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8278FC1A; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIikqG071289; Mon, 25 Jul 2011 18:44:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIik2H071286; Mon, 25 Jul 2011 18:44:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251844.p6PIik2H071286@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224374 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:44:47 -0000 Author: marius Date: Mon Jul 25 18:44:46 2011 New Revision: 224374 URL: http://svn.freebsd.org/changeset/base/224374 Log: MFC: r223721 UltraSPARC-IV CPUs seem to be affected by a not publicly documented erratum causing them to trigger stray vector interrupts accompanied by a state in which they even fault on locked TLB entries. Just retrying the instruction in that case gets the CPU back on track though. OpenSolaris also just ignores a certain number of stray vector interrupts. While at it, implement the stray vector interrupt handling for SPARC64-VI which use these for indicating uncorrectable errors in interrupt packets. Modified: stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:43:25 2011 (r224373) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224374) @@ -581,7 +581,8 @@ END(tl0_sfsr_trap) andcc %g1, IRSR_BUSY, %g0 bnz,a,pt %xcc, intr_vector nop - sir + ba,a,pt %xcc, intr_vector_stray + nop .align 32 .endm Modified: stable/7/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/7/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:43:25 2011 (r224373) +++ stable/7/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224374) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -153,6 +154,29 @@ ENTRY(intr_vector) retry END(intr_vector) +ENTRY(intr_vector_stray) + /* + * SPARC64-VI trigger stray vector interrupts in order to indicate + * uncorrectable errors in interrupt packets, which still need to be + * acknowledged though. + * US-IV occasionally trigger stray vector interrupts for reasons + * unknown accompanied by a state in which they even fault on locked + * TLB entries so we can't even log these here. Just retrying the + * instruction in that case gets the CPU back on track. + */ + rdpr %ver, %g1 + srlx %g1, VER_IMPL_SHIFT, %g1 + sll %g1, VER_IMPL_SIZE, %g1 + srl %g1, VER_IMPL_SIZE, %g1 + cmp %g1, CPU_IMPL_SPARC64VI + bne,a,pn %icc, 1f + nop + stxa %g0, [%g0] ASI_INTR_RECEIVE + membar #Sync + +1: retry +END(intr_vector_stray) + ENTRY(intr_fast) save %sp, -CCFSZ, %sp From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:44:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7986C1065674; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F24C8FC08; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIilhu071304; Mon, 25 Jul 2011 18:44:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIil1R071301; Mon, 25 Jul 2011 18:44:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251844.p6PIil1R071301@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224375 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:44:47 -0000 Author: marius Date: Mon Jul 25 18:44:46 2011 New Revision: 224375 URL: http://svn.freebsd.org/changeset/base/224375 Log: MFC: r223721 UltraSPARC-IV CPUs seem to be affected by a not publicly documented erratum causing them to trigger stray vector interrupts accompanied by a state in which they even fault on locked TLB entries. Just retrying the instruction in that case gets the CPU back on track though. OpenSolaris also just ignores a certain number of stray vector interrupts. While at it, implement the stray vector interrupt handling for SPARC64-VI which use these for indicating uncorrectable errors in interrupt packets. Modified: stable/8/sys/sparc64/sparc64/exception.S stable/8/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224374) +++ stable/8/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224375) @@ -585,7 +585,8 @@ END(tl0_sfsr_trap) andcc %g1, IRSR_BUSY, %g0 bnz,a,pt %xcc, intr_vector nop - sir + ba,a,pt %xcc, intr_vector_stray + nop .align 32 .endm Modified: stable/8/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/8/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224374) +++ stable/8/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224375) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -153,6 +154,29 @@ ENTRY(intr_vector) retry END(intr_vector) +ENTRY(intr_vector_stray) + /* + * SPARC64-VI trigger stray vector interrupts in order to indicate + * uncorrectable errors in interrupt packets, which still need to be + * acknowledged though. + * US-IV occasionally trigger stray vector interrupts for reasons + * unknown accompanied by a state in which they even fault on locked + * TLB entries so we can't even log these here. Just retrying the + * instruction in that case gets the CPU back on track. + */ + rdpr %ver, %g1 + srlx %g1, VER_IMPL_SHIFT, %g1 + sll %g1, VER_IMPL_SIZE, %g1 + srl %g1, VER_IMPL_SIZE, %g1 + cmp %g1, CPU_IMPL_SPARC64VI + bne,a,pn %icc, 1f + nop + stxa %g0, [%g0] ASI_INTR_RECEIVE + membar #Sync + +1: retry +END(intr_vector_stray) + ENTRY(intr_fast) save %sp, -CCFSZ, %sp From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:46:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC6B106564A; Mon, 25 Jul 2011 18:46:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 934398FC19; Mon, 25 Jul 2011 18:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIkstX071495; Mon, 25 Jul 2011 18:46:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIksDM071492; Mon, 25 Jul 2011 18:46:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251846.p6PIksDM071492@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224376 - in stable/8/sys: kern sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:46:54 -0000 Author: marius Date: Mon Jul 25 18:46:54 2011 New Revision: 224376 URL: http://svn.freebsd.org/changeset/base/224376 Log: MFC: r223795 Call pmap_qremove() before freeing or unwiring the pages, otherwise there's a window during which a page can be re-used before its previous mapping is removed. Reviewed by: alc Modified: stable/8/sys/kern/vfs_bio.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Mon Jul 25 18:44:46 2011 (r224375) +++ stable/8/sys/kern/vfs_bio.c Mon Jul 25 18:46:54 2011 (r224376) @@ -1602,6 +1602,7 @@ vfs_vmio_release(struct buf *bp) int i; vm_page_t m; + pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { @@ -1638,7 +1639,6 @@ vfs_vmio_release(struct buf *bp) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); if (bp->b_bufsize) { bufspacewakeup(); @@ -2995,6 +2995,10 @@ allocbuf(struct buf *bp, int size) if (desiredpages < bp->b_npages) { vm_page_t m; + pmap_qremove((vm_offset_t)trunc_page( + (vm_offset_t)bp->b_data) + + (desiredpages << PAGE_SHIFT), + (bp->b_npages - desiredpages)); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = desiredpages; i < bp->b_npages; i++) { @@ -3014,8 +3018,6 @@ allocbuf(struct buf *bp, int size) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) + - (desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages)); bp->b_npages = desiredpages; } } else if (size > bp->b_bcount) { Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:44:46 2011 (r224375) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:54 2011 (r224376) @@ -1290,6 +1290,7 @@ pmap_release(pmap_t pm) pc->pc_pmap = NULL; mtx_unlock_spin(&sched_lock); + pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); obj = pm->pm_tsb_obj; VM_OBJECT_LOCK(obj); KASSERT(obj->ref_count == 1, ("pmap_release: tsbobj ref count != 1")); @@ -1307,7 +1308,6 @@ pmap_release(pmap_t pm) vm_page_unlock_queues(); } VM_OBJECT_UNLOCK(obj); - pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); PMAP_LOCK_DESTROY(pm); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:46:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0D7106566C; Mon, 25 Jul 2011 18:46:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71BEF8FC16; Mon, 25 Jul 2011 18:46:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIkuV8071527; Mon, 25 Jul 2011 18:46:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIkuM0071524; Mon, 25 Jul 2011 18:46:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251846.p6PIkuM0071524@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224377 - in stable/7/sys: kern sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:46:56 -0000 Author: marius Date: Mon Jul 25 18:46:56 2011 New Revision: 224377 URL: http://svn.freebsd.org/changeset/base/224377 Log: MFC: r223795 Call pmap_qremove() before freeing or unwiring the pages, otherwise there's a window during which a page can be re-used before its previous mapping is removed. Reviewed by: alc Modified: stable/7/sys/kern/vfs_bio.c stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_bio.c ============================================================================== --- stable/7/sys/kern/vfs_bio.c Mon Jul 25 18:46:54 2011 (r224376) +++ stable/7/sys/kern/vfs_bio.c Mon Jul 25 18:46:56 2011 (r224377) @@ -1574,6 +1574,7 @@ vfs_vmio_release(struct buf *bp) int i; vm_page_t m; + pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { @@ -1610,7 +1611,6 @@ vfs_vmio_release(struct buf *bp) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); if (bp->b_bufsize) { bufspacewakeup(); @@ -2950,6 +2950,10 @@ allocbuf(struct buf *bp, int size) if (desiredpages < bp->b_npages) { vm_page_t m; + pmap_qremove((vm_offset_t)trunc_page( + (vm_offset_t)bp->b_data) + + (desiredpages << PAGE_SHIFT), + (bp->b_npages - desiredpages)); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = desiredpages; i < bp->b_npages; i++) { @@ -2969,8 +2973,6 @@ allocbuf(struct buf *bp, int size) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) + - (desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages)); bp->b_npages = desiredpages; } } else if (size > bp->b_bcount) { Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:54 2011 (r224376) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:56 2011 (r224377) @@ -1158,6 +1158,7 @@ pmap_release(pmap_t pm) pc->pc_pmap = NULL; mtx_unlock_spin(&sched_lock); + pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); obj = pm->pm_tsb_obj; VM_OBJECT_LOCK(obj); KASSERT(obj->ref_count == 1, ("pmap_release: tsbobj ref count != 1")); @@ -1175,7 +1176,6 @@ pmap_release(pmap_t pm) vm_page_unlock_queues(); } VM_OBJECT_UNLOCK(obj); - pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); PMAP_LOCK_DESTROY(pm); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:51:57 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5C41065675; Mon, 25 Jul 2011 18:51:57 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id B27178FC12; Mon, 25 Jul 2011 18:51:56 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id p6PIeino001810; Mon, 25 Jul 2011 20:40:45 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4E2DB8AC.3000703@FreeBSD.org> Date: Mon, 25 Jul 2011 20:40:44 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Nathan Whitehorn References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> In-Reply-To: <4E2C9012.602@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: Attilio Rao , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, FreeBSD Release Engineering Team Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:51:57 -0000 On 24.07.11 23:35, Nathan Whitehorn wrote: > On 07/19/11 07:41, Attilio Rao wrote: >> Author: attilio >> Date: Tue Jul 19 12:41:57 2011 >> New Revision: 224216 >> URL: http://svn.freebsd.org/changeset/base/224216 >> >> Log: >> On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes >> storage. >> Fix the sintrcnt/sintrnames specification. >> >> No MFC is previewed for this patch. >> > > These also need to be .long on 32-bit PowerPC, otherwise this change > triggers kernel panics and faults in sysctl. Please change it as quickly > as possible. Like the below? I'll test and I could commit if ok. (Build and approval) Gruss, Andreas Index: locore32.S =================================================================== --- locore32.S (revision 224326) +++ locore32.S (working copy) @@ -91,13 +91,13 @@ GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 GLOBAL(sintrnames) - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 GLOBAL(sintrcnt) - .word INTRCNT_COUNT * 4 * 2 + .long INTRCNT_COUNT * 4 * 2 .text .globl btext From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:52:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B7E106566C; Mon, 25 Jul 2011 18:52:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B6A58FC1A; Mon, 25 Jul 2011 18:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIqnIR071768; Mon, 25 Jul 2011 18:52:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIqnnt071765; Mon, 25 Jul 2011 18:52:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251852.p6PIqnnt071765@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224378 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:52:49 -0000 Author: marius Date: Mon Jul 25 18:52:49 2011 New Revision: 224378 URL: http://svn.freebsd.org/changeset/base/224378 Log: MFC: r223800 - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c so static'ize them. - Correct a typo. Modified: stable/8/sys/sparc64/include/pmap.h stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/include/pmap.h ============================================================================== --- stable/8/sys/sparc64/include/pmap.h Mon Jul 25 18:46:56 2011 (r224377) +++ stable/8/sys/sparc64/include/pmap.h Mon Jul 25 18:52:49 2011 (r224378) @@ -89,12 +89,9 @@ void pmap_kremove_flags(vm_offset_t va); boolean_t pmap_page_is_mapped(vm_page_t m); int pmap_cache_enter(vm_page_t m, vm_offset_t va); -void pmap_cache_remove(vm_page_t m, vm_offset_t va); int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, vm_offset_t va); -int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, - vm_offset_t va); void pmap_map_tsb(void); void pmap_set_kctx(void); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:56 2011 (r224377) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:52:49 2011 (r224378) @@ -152,6 +152,9 @@ struct pmap kernel_pmap_store; static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); static void pmap_bootstrap_set_tte(struct tte *tp, u_long vpn, u_long data); +static void pmap_cache_remove(vm_page_t m, vm_offset_t va); +static int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, + struct tte *tp, vm_offset_t va); /* * Map the given physical page at the specified virtual address in the @@ -952,7 +955,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ return (0); } -void +static void pmap_cache_remove(vm_page_t m, vm_offset_t va) { struct tte *tp; @@ -1414,7 +1417,7 @@ pmap_remove_all(vm_page_t m) vm_page_flag_clear(m, PG_WRITEABLE); } -int +static int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, vm_offset_t va) { @@ -1971,7 +1974,7 @@ pmap_page_wired_mappings(vm_page_t m) /* * Remove all pages from specified address space, this aids process exit - * speeds. This is much faster than pmap_remove n the case of running down + * speeds. This is much faster than pmap_remove in the case of running down * an entire address space. Only works for the current pmap. */ void From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:53:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0D21065678; Mon, 25 Jul 2011 18:53:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7FFA8FC20; Mon, 25 Jul 2011 18:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIrN0T071822; Mon, 25 Jul 2011 18:53:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIrNck071819; Mon, 25 Jul 2011 18:53:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251853.p6PIrNck071819@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224379 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:53:24 -0000 Author: marius Date: Mon Jul 25 18:53:23 2011 New Revision: 224379 URL: http://svn.freebsd.org/changeset/base/224379 Log: MFC: r223800 - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c so static'ize them. - Correct a typo. Modified: stable/7/sys/sparc64/include/pmap.h stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/pmap.h ============================================================================== --- stable/7/sys/sparc64/include/pmap.h Mon Jul 25 18:52:49 2011 (r224378) +++ stable/7/sys/sparc64/include/pmap.h Mon Jul 25 18:53:23 2011 (r224379) @@ -89,12 +89,9 @@ void pmap_kremove_flags(vm_offset_t va); boolean_t pmap_page_is_mapped(vm_page_t m); int pmap_cache_enter(vm_page_t m, vm_offset_t va); -void pmap_cache_remove(vm_page_t m, vm_offset_t va); int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, vm_offset_t va); -int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, - vm_offset_t va); void pmap_map_tsb(void); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:52:49 2011 (r224378) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:53:23 2011 (r224379) @@ -156,6 +156,10 @@ struct pmap kernel_pmap_store; */ static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); +static void pmap_cache_remove(vm_page_t m, vm_offset_t va); +static int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, + struct tte *tp, vm_offset_t va); + /* * Map the given physical page at the specified virtual address in the * target pmap with the protection requested. If specified the page @@ -819,7 +823,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ return (0); } -void +static void pmap_cache_remove(vm_page_t m, vm_offset_t va) { struct tte *tp; @@ -1282,7 +1286,7 @@ pmap_remove_all(vm_page_t m) vm_page_flag_clear(m, PG_WRITEABLE); } -int +static int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, vm_offset_t va) { @@ -1819,7 +1823,7 @@ pmap_page_exists_quick(pmap_t pm, vm_pag /* * Remove all pages from specified address space, this aids process exit - * speeds. This is much faster than pmap_remove n the case of running down + * speeds. This is much faster than pmap_remove in the case of running down * an entire address space. Only works for the current pmap. */ void From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:54:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C15071065730; Mon, 25 Jul 2011 18:54:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B08A98FC0A; Mon, 25 Jul 2011 18:54:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIsSGS071920; Mon, 25 Jul 2011 18:54:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIsS8W071918; Mon, 25 Jul 2011 18:54:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251854.p6PIsS8W071918@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224380 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:54:28 -0000 Author: marius Date: Mon Jul 25 18:54:28 2011 New Revision: 224380 URL: http://svn.freebsd.org/changeset/base/224380 Log: MFC: r223801 It can be useful to know which page still has mappings. Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:53:23 2011 (r224379) +++ stable/8/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:28 2011 (r224380) @@ -525,7 +525,7 @@ uma_small_alloc(uma_zone_t zone, int byt pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { KASSERT(m->md.colors[0] == 0 && m->md.colors[1] == 0, - ("uma_small_alloc: free page still has mappings!")); + ("uma_small_alloc: free page %p still has mappings!", m)); PMAP_STATS_INC(uma_nsmall_alloc_oc); m->md.color = DCACHE_COLOR(pa); dcache_page_inval(pa); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:54:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DA71065777; Mon, 25 Jul 2011 18:54:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 085818FC1D; Mon, 25 Jul 2011 18:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIsTWU071951; Mon, 25 Jul 2011 18:54:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIsTJB071949; Mon, 25 Jul 2011 18:54:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251854.p6PIsTJB071949@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224381 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:54:30 -0000 Author: marius Date: Mon Jul 25 18:54:29 2011 New Revision: 224381 URL: http://svn.freebsd.org/changeset/base/224381 Log: MFC: r223801 It can be useful to know which page still has mappings. Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:28 2011 (r224380) +++ stable/7/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:29 2011 (r224381) @@ -494,7 +494,7 @@ uma_small_alloc(uma_zone_t zone, int byt pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { KASSERT(m->md.colors[0] == 0 && m->md.colors[1] == 0, - ("uma_small_alloc: free page still has mappings!")); + ("uma_small_alloc: free page %p still has mappings!", m)); PMAP_STATS_INC(uma_nsmall_alloc_oc); m->md.color = DCACHE_COLOR(pa); dcache_page_inval(pa); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:57:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65858106564A; Mon, 25 Jul 2011 18:57:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 546908FC0C; Mon, 25 Jul 2011 18:57:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIvoMt072130; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIvo77072123; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251857.p6PIvo77072123@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224382 - stable/8/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:57:50 -0000 Author: marius Date: Mon Jul 25 18:57:49 2011 New Revision: 224382 URL: http://svn.freebsd.org/changeset/base/224382 Log: MFC: r223944 According to the OpenSolaris source the PCI latency and the cache line size should be set for Sun ERI. Tested by: yongari Modified: stable/8/sys/dev/gem/if_gem.c stable/8/sys/dev/gem/if_gem_pci.c stable/8/sys/dev/gem/if_gemreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:54:29 2011 (r224381) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 18:57:49 2011 (r224382) @@ -626,7 +626,9 @@ gem_reset(struct gem_softc *sc) gem_reset_tx(sc); /* Do a full reset. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) @@ -716,11 +718,12 @@ gem_reset_rx(struct gem_softc *sc) DELAY(5000); /* Reset the ERX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } @@ -806,11 +809,12 @@ gem_reset_tx(struct gem_softc *sc) DELAY(5000); /* Finally, reset the ETX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } Modified: stable/8/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/8/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:54:29 2011 (r224381) +++ stable/8/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:49 2011 (r224382) @@ -177,6 +177,10 @@ gem_pci_attach(device_t dev) if (pci_get_intpin(dev) == 0) pci_set_intpin(dev, 1); + /* Set the PCI latency timer for Sun ERIs. */ + if (sc->sc_variant == GEM_SUN_ERI) + pci_write_config(dev, PCIR_LATTIMER, GEM_ERI_LATENCY_TIMER, 1); + sc->sc_dev = dev; sc->sc_flags |= GEM_PCI; Modified: stable/8/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/8/sys/dev/gem/if_gemreg.h Mon Jul 25 18:54:29 2011 (r224381) +++ stable/8/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:49 2011 (r224382) @@ -35,7 +35,7 @@ /* register definitions for Apple GMAC, Sun ERI and Sun GEM */ /* - * First bank: this registers live at the start of the PCI + * First bank: these registers live at the start of the PCI * mapping, and at the start of the second bank of the SBus * version. */ @@ -93,7 +93,7 @@ "b\x10MAC_CONTROL\0b\x11MIF\0b\x12IBERR\0\0" /* - * Second bank: this registers live at offset 0x1000 of the PCI + * Second bank: these registers live at offset 0x1000 of the PCI * mapping, and at the start of the first bank of the SBus * version. */ @@ -128,7 +128,7 @@ /* GEM_PCI_BIF_DIAG register bits */ #define GEN_PCI_BIF_DIAG_BC_SM 0x007f0000 /* burst ctrl. state machine */ -#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ +#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ /* Bits in GEM_SBUS_CONFIG register */ #define GEM_SBUS_CFG_BURST_32 0x00000001 /* 32 byte bursts */ @@ -147,6 +147,8 @@ #define GEM_RESET_TX 0x00000001 /* Reset TX half. */ #define GEM_RESET_RX 0x00000002 /* Reset RX half. */ #define GEM_RESET_PCI_RSTOUT 0x00000004 /* Force PCI RSTOUT#. */ +#define GEM_RESET_CLSZ_MASK 0x00ff0000 /* ERI cache line size */ +#define GEM_RESET_CLSZ_SHFT 16 /* The rest of the registers live in the first bank again. */ @@ -586,6 +588,10 @@ #define GEM_PHYAD_INTERNAL 1 #define GEM_PHYAD_EXTERNAL 0 +/* Miscellaneous */ +#define GEM_ERI_CACHE_LINE_SIZE 16 +#define GEM_ERI_LATENCY_TIMER 64 + /* * descriptor table structures */ @@ -594,7 +600,11 @@ struct gem_desc { uint64_t gd_addr; }; -/* Transmit flags */ +/* + * Transmit flags + * GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_START, GEM_TD_CXSUM_STUFF and + * GEM_TD_INTERRUPT_ME only need to be set in the first descriptor of a group. + */ #define GEM_TD_BUFSIZE 0x0000000000007fffULL #define GEM_TD_CXSUM_START 0x00000000001f8000ULL /* Cxsum start offset */ #define GEM_TD_CXSUM_STARTSHFT 15 @@ -605,10 +615,6 @@ struct gem_desc { #define GEM_TD_START_OF_PACKET 0x0000000080000000ULL #define GEM_TD_INTERRUPT_ME 0x0000000100000000ULL /* Interrupt me now */ #define GEM_TD_NO_CRC 0x0000000200000000ULL /* do not insert crc */ -/* - * Only need to set GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_STUFF, - * GEM_TD_CXSUM_START, and GEM_TD_INTERRUPT_ME in 1st descriptor of a group. - */ /* Receive flags */ #define GEM_RD_CHECKSUM 0x000000000000ffffULL /* is the complement */ @@ -618,7 +624,6 @@ struct gem_desc { #define GEM_RD_HASH_PASS 0x1000000000000000ULL /* passed hash filter */ #define GEM_RD_ALTERNATE_MAC 0x2000000000000000ULL /* Alternate MAC adrs */ #define GEM_RD_BAD_CRC 0x4000000000000000ULL - #define GEM_RD_BUFSHIFT 16 #define GEM_RD_BUFLEN(x) (((x) & GEM_RD_BUFSIZE) >> GEM_RD_BUFSHIFT) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:57:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF0F106566B; Mon, 25 Jul 2011 18:57:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C9A8FC12; Mon, 25 Jul 2011 18:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIvokM072154; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIvoKM072150; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251857.p6PIvoKM072150@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224383 - stable/7/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:57:51 -0000 Author: marius Date: Mon Jul 25 18:57:50 2011 New Revision: 224383 URL: http://svn.freebsd.org/changeset/base/224383 Log: MFC: r223944 According to the OpenSolaris source the PCI latency and the cache line size should be set for Sun ERI. Tested by: yongari Modified: stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gem_pci.c stable/7/sys/dev/gem/if_gemreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:57:50 2011 (r224383) @@ -626,7 +626,9 @@ gem_reset(struct gem_softc *sc) gem_reset_tx(sc); /* Do a full reset. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) @@ -716,11 +718,12 @@ gem_reset_rx(struct gem_softc *sc) DELAY(5000); /* Reset the ERX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } @@ -806,11 +809,12 @@ gem_reset_tx(struct gem_softc *sc) DELAY(5000); /* Finally, reset the ETX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } Modified: stable/7/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/7/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:50 2011 (r224383) @@ -177,6 +177,10 @@ gem_pci_attach(device_t dev) if (pci_get_intpin(dev) == 0) pci_set_intpin(dev, 1); + /* Set the PCI latency timer for Sun ERIs. */ + if (sc->sc_variant == GEM_SUN_ERI) + pci_write_config(dev, PCIR_LATTIMER, GEM_ERI_LATENCY_TIMER, 1); + sc->sc_dev = dev; sc->sc_flags |= GEM_PCI; Modified: stable/7/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/7/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:50 2011 (r224383) @@ -35,7 +35,7 @@ /* register definitions for Apple GMAC, Sun ERI and Sun GEM */ /* - * First bank: this registers live at the start of the PCI + * First bank: these registers live at the start of the PCI * mapping, and at the start of the second bank of the SBus * version. */ @@ -93,7 +93,7 @@ "b\x10MAC_CONTROL\0b\x11MIF\0b\x12IBERR\0\0" /* - * Second bank: this registers live at offset 0x1000 of the PCI + * Second bank: these registers live at offset 0x1000 of the PCI * mapping, and at the start of the first bank of the SBus * version. */ @@ -128,7 +128,7 @@ /* GEM_PCI_BIF_DIAG register bits */ #define GEN_PCI_BIF_DIAG_BC_SM 0x007f0000 /* burst ctrl. state machine */ -#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ +#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ /* Bits in GEM_SBUS_CONFIG register */ #define GEM_SBUS_CFG_BURST_32 0x00000001 /* 32 byte bursts */ @@ -147,6 +147,8 @@ #define GEM_RESET_TX 0x00000001 /* Reset TX half. */ #define GEM_RESET_RX 0x00000002 /* Reset RX half. */ #define GEM_RESET_PCI_RSTOUT 0x00000004 /* Force PCI RSTOUT#. */ +#define GEM_RESET_CLSZ_MASK 0x00ff0000 /* ERI cache line size */ +#define GEM_RESET_CLSZ_SHFT 16 /* The rest of the registers live in the first bank again. */ @@ -586,6 +588,10 @@ #define GEM_PHYAD_INTERNAL 1 #define GEM_PHYAD_EXTERNAL 0 +/* Miscellaneous */ +#define GEM_ERI_CACHE_LINE_SIZE 16 +#define GEM_ERI_LATENCY_TIMER 64 + /* * descriptor table structures */ @@ -594,7 +600,11 @@ struct gem_desc { uint64_t gd_addr; }; -/* Transmit flags */ +/* + * Transmit flags + * GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_START, GEM_TD_CXSUM_STUFF and + * GEM_TD_INTERRUPT_ME only need to be set in the first descriptor of a group. + */ #define GEM_TD_BUFSIZE 0x0000000000007fffULL #define GEM_TD_CXSUM_START 0x00000000001f8000ULL /* Cxsum start offset */ #define GEM_TD_CXSUM_STARTSHFT 15 @@ -605,10 +615,6 @@ struct gem_desc { #define GEM_TD_START_OF_PACKET 0x0000000080000000ULL #define GEM_TD_INTERRUPT_ME 0x0000000100000000ULL /* Interrupt me now */ #define GEM_TD_NO_CRC 0x0000000200000000ULL /* do not insert crc */ -/* - * Only need to set GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_STUFF, - * GEM_TD_CXSUM_START, and GEM_TD_INTERRUPT_ME in 1st descriptor of a group. - */ /* Receive flags */ #define GEM_RD_CHECKSUM 0x000000000000ffffULL /* is the complement */ @@ -618,7 +624,6 @@ struct gem_desc { #define GEM_RD_HASH_PASS 0x1000000000000000ULL /* passed hash filter */ #define GEM_RD_ALTERNATE_MAC 0x2000000000000000ULL /* Alternate MAC adrs */ #define GEM_RD_BAD_CRC 0x4000000000000000ULL - #define GEM_RD_BUFSHIFT 16 #define GEM_RD_BUFLEN(x) (((x) & GEM_RD_BUFSIZE) >> GEM_RD_BUFSHIFT) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:58:09 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21C28106566B; Mon, 25 Jul 2011 18:58:09 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id BCC018FC17; Mon, 25 Jul 2011 18:58:08 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id F215E58135; Mon, 25 Jul 2011 13:58:07 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id sZ59Z806qkv3; Mon, 25 Jul 2011 13:58:07 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-128.icecube.wisc.edu [172.16.223.128]) by mail.icecube.wisc.edu (Postfix) with ESMTP id D26285811D; Mon, 25 Jul 2011 13:58:07 -0500 (CDT) Message-ID: <4E2DBCBF.2030402@freebsd.org> Date: Mon, 25 Jul 2011 13:58:07 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: Andreas Tobler References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> <4E2DB8AC.3000703@FreeBSD.org> In-Reply-To: <4E2DB8AC.3000703@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Attilio Rao , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, FreeBSD Release Engineering Team Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:58:09 -0000 On 07/25/11 13:40, Andreas Tobler wrote: > On 24.07.11 23:35, Nathan Whitehorn wrote: >> On 07/19/11 07:41, Attilio Rao wrote: >>> Author: attilio >>> Date: Tue Jul 19 12:41:57 2011 >>> New Revision: 224216 >>> URL: http://svn.freebsd.org/changeset/base/224216 >>> >>> Log: >>> On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes >>> storage. >>> Fix the sintrcnt/sintrnames specification. >>> >>> No MFC is previewed for this patch. >>> >> >> These also need to be .long on 32-bit PowerPC, otherwise this change >> triggers kernel panics and faults in sysctl. Please change it as quickly >> as possible. > > Like the below? > > I'll test and I could commit if ok. (Build and approval) > > Gruss, > Andreas > > Index: locore32.S > =================================================================== > --- locore32.S (revision 224326) > +++ locore32.S (working copy) > @@ -91,13 +91,13 @@ > GLOBAL(intrnames) > .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > GLOBAL(sintrnames) > - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > > .align 4 > GLOBAL(intrcnt) > .space INTRCNT_COUNT * 4 * 2 > GLOBAL(sintrcnt) > - .word INTRCNT_COUNT * 4 * 2 > + .long INTRCNT_COUNT * 4 * 2 > > .text > .globl btext Exactly like that. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:59:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A657106566B; Mon, 25 Jul 2011 18:59:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29EA58FC16; Mon, 25 Jul 2011 18:59:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIxina072274; Mon, 25 Jul 2011 18:59:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIxiN6072272; Mon, 25 Jul 2011 18:59:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251859.p6PIxiN6072272@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224384 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:59:44 -0000 Author: marius Date: Mon Jul 25 18:59:43 2011 New Revision: 224384 URL: http://svn.freebsd.org/changeset/base/224384 Log: MFC: r223959 - Add a missing shift in schizo_get_timecount(). This happened to be non-fatal as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the second counter in the upper 32 bits this would be required though as the MI timecounter code doesn't support 64-bit counters/counter registers. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Mon Jul 25 18:57:50 2011 (r224383) +++ stable/7/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:43 2011 (r224384) @@ -482,7 +482,6 @@ schizo_attach(device_t dev) if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = schizo_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = STX_CTRL_PERF_CNT_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -1521,6 +1520,7 @@ schizo_get_timecount(struct timecounter struct schizo_softc *sc; sc = tc->tc_priv; - return (SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & - (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)); + return ((SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & + (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)) >> + STX_CTRL_PERF_CNT_CNT0_SHIFT); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 18:59:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ABF3106566C; Mon, 25 Jul 2011 18:59:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0B28FC08; Mon, 25 Jul 2011 18:59:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIxjMr072305; Mon, 25 Jul 2011 18:59:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIxjhW072303; Mon, 25 Jul 2011 18:59:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251859.p6PIxjhW072303@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224385 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:59:45 -0000 Author: marius Date: Mon Jul 25 18:59:45 2011 New Revision: 224385 URL: http://svn.freebsd.org/changeset/base/224385 Log: MFC: r223959 - Add a missing shift in schizo_get_timecount(). This happened to be non-fatal as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the second counter in the upper 32 bits this would be required though as the MI timecounter code doesn't support 64-bit counters/counter registers. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:43 2011 (r224384) +++ stable/8/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:45 2011 (r224385) @@ -482,7 +482,6 @@ schizo_attach(device_t dev) if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = schizo_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = STX_CTRL_PERF_CNT_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -1521,6 +1520,7 @@ schizo_get_timecount(struct timecounter struct schizo_softc *sc; sc = tc->tc_priv; - return (SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & - (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)); + return ((SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & + (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)) >> + STX_CTRL_PERF_CNT_CNT0_SHIFT); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:01:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7683D106566C; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428738FC0A; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ1adA072464; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ1aW8072462; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251901.p6PJ1aW8072462@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224386 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:01:36 -0000 Author: marius Date: Mon Jul 25 19:01:35 2011 New Revision: 224386 URL: http://svn.freebsd.org/changeset/base/224386 Log: MFC: r223960 - Current testing shows that (ab)using the JBC performance counter in bus cycle mode as timecounter just works fine. My best guess is that a firmware update has fixed this, so check at run-time whether it advances and use a positive quality if it does. The latter will cause this timecounter to be used instead of the tick counter based one, which just sucks for SMP. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/7/sys/sparc64/pci/fire.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/fire.c ============================================================================== --- stable/7/sys/sparc64/pci/fire.c Mon Jul 25 18:59:45 2011 (r224385) +++ stable/7/sys/sparc64/pci/fire.c Mon Jul 25 19:01:35 2011 (r224386) @@ -663,9 +663,7 @@ fire_attach(device_t dev) /* * Setup JBC/UBC performance counter 0 in bus cycle counting - * mode as timecounter. Unfortunately, at least with Fire all - * JBus-driven performance counters just don't advance in bus - * cycle counting mode. + * mode as timecounter. */ if (device_get_unit(dev) == 0) { FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT0, 0); @@ -673,19 +671,10 @@ fire_attach(device_t dev) FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT_SEL, (FO_XBC_PRF_CNT_NONE << FO_XBC_PRF_CNT_CNT1_SHFT) | (FO_XBC_PRF_CNT_XB_CLK << FO_XBC_PRF_CNT_CNT0_SHFT)); -#ifdef FIRE_DEBUG - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); -#endif tc = malloc(sizeof(*tc), M_DEVBUF, M_NOWAIT | M_ZERO); if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = fire_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = TC_COUNTER_MAX_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -693,8 +682,16 @@ fire_attach(device_t dev) __func__); tc->tc_frequency = prop; tc->tc_name = strdup(device_get_nameunit(dev), M_DEVBUF); - tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc->tc_priv = sc; + /* + * Due to initial problems with the JBus-driven performance + * counters not advancing which might be firmware dependent + * ensure that it actually works. + */ + if (fire_get_timecount(tc) - fire_get_timecount(tc) != 0) + tc->tc_quality = FIRE_PERF_CNT_QLTY; + else + tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc_init(tc); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:01:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00EC1065670; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F098FC17; Mon, 25 Jul 2011 19:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ1aUa072479; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ1aaC072477; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251901.p6PJ1aaC072477@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224387 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:01:36 -0000 Author: marius Date: Mon Jul 25 19:01:36 2011 New Revision: 224387 URL: http://svn.freebsd.org/changeset/base/224387 Log: MFC: r223960 - Current testing shows that (ab)using the JBC performance counter in bus cycle mode as timecounter just works fine. My best guess is that a firmware update has fixed this, so check at run-time whether it advances and use a positive quality if it does. The latter will cause this timecounter to be used instead of the tick counter based one, which just sucks for SMP. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/8/sys/sparc64/pci/fire.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/pci/fire.c ============================================================================== --- stable/8/sys/sparc64/pci/fire.c Mon Jul 25 19:01:35 2011 (r224386) +++ stable/8/sys/sparc64/pci/fire.c Mon Jul 25 19:01:36 2011 (r224387) @@ -664,9 +664,7 @@ fire_attach(device_t dev) /* * Setup JBC/UBC performance counter 0 in bus cycle counting - * mode as timecounter. Unfortunately, at least with Fire all - * JBus-driven performance counters just don't advance in bus - * cycle counting mode. + * mode as timecounter. */ if (device_get_unit(dev) == 0) { FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT0, 0); @@ -674,19 +672,10 @@ fire_attach(device_t dev) FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT_SEL, (FO_XBC_PRF_CNT_NONE << FO_XBC_PRF_CNT_CNT1_SHFT) | (FO_XBC_PRF_CNT_XB_CLK << FO_XBC_PRF_CNT_CNT0_SHFT)); -#ifdef FIRE_DEBUG - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); -#endif tc = malloc(sizeof(*tc), M_DEVBUF, M_NOWAIT | M_ZERO); if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = fire_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = TC_COUNTER_MAX_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -694,8 +683,16 @@ fire_attach(device_t dev) __func__); tc->tc_frequency = prop; tc->tc_name = strdup(device_get_nameunit(dev), M_DEVBUF); - tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc->tc_priv = sc; + /* + * Due to initial problems with the JBus-driven performance + * counters not advancing which might be firmware dependent + * ensure that it actually works. + */ + if (fire_get_timecount(tc) - fire_get_timecount(tc) != 0) + tc->tc_quality = FIRE_PERF_CNT_QLTY; + else + tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc_init(tc); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:03:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3139106566C; Mon, 25 Jul 2011 19:03:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C24E48FC12; Mon, 25 Jul 2011 19:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ3jMH072603; Mon, 25 Jul 2011 19:03:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ3jNX072601; Mon, 25 Jul 2011 19:03:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251903.p6PJ3jNX072601@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224388 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:03:45 -0000 Author: marius Date: Mon Jul 25 19:03:45 2011 New Revision: 224388 URL: http://svn.freebsd.org/changeset/base/224388 Log: MFC: r223961 - Remove redundant timecounter masking from counter_get_timecount(). - Zero the timecounter when allocation so we don't need to initialize unused members and remove a now redundant NULL assignment. Submitted by: jkim Modified: stable/8/sys/sparc64/sparc64/counter.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/counter.c ============================================================================== --- stable/8/sys/sparc64/sparc64/counter.c Mon Jul 25 19:01:36 2011 (r224387) +++ stable/8/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:45 2011 (r224388) @@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, b bus_space_write_8(tag, handle, offset + CTR_CT1 + CTR_LIMIT, COUNTER_MASK); /* Register as a time counter. */ - tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK); + tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK | M_ZERO); sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); sc->sc_tag = tag; sc->sc_handle = handle; sc->sc_offset = offset + CTR_CT0; tc->tc_get_timecount = counter_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; tc->tc_name = strdup(name, M_DEVBUF); @@ -107,6 +106,5 @@ counter_get_timecount(struct timecounter struct ct_softc *sc; sc = tc->tc_priv; - return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset) & - COUNTER_MASK); + return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset)); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:03:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBF4106566B; Mon, 25 Jul 2011 19:03:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0B18FC0C; Mon, 25 Jul 2011 19:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ3o4Q072639; Mon, 25 Jul 2011 19:03:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ3oNg072637; Mon, 25 Jul 2011 19:03:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251903.p6PJ3oNg072637@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224389 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:03:50 -0000 Author: marius Date: Mon Jul 25 19:03:50 2011 New Revision: 224389 URL: http://svn.freebsd.org/changeset/base/224389 Log: MFC: r223961 - Remove redundant timecounter masking from counter_get_timecount(). - Zero the timecounter when allocation so we don't need to initialize unused members and remove a now redundant NULL assignment. Submitted by: jkim Modified: stable/7/sys/sparc64/sparc64/counter.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/counter.c ============================================================================== --- stable/7/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:45 2011 (r224388) +++ stable/7/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:50 2011 (r224389) @@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, b bus_space_write_8(tag, handle, offset + CTR_CT1 + CTR_LIMIT, COUNTER_MASK); /* Register as a time counter. */ - tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK); + tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK | M_ZERO); sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); sc->sc_tag = tag; sc->sc_handle = handle; sc->sc_offset = offset + CTR_CT0; tc->tc_get_timecount = counter_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; tc->tc_name = strdup(name, M_DEVBUF); @@ -107,6 +106,5 @@ counter_get_timecount(struct timecounter struct ct_softc *sc; sc = tc->tc_priv; - return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset) & - COUNTER_MASK); + return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset)); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:04:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AA7106564A; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 500F98FC18; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ4vv5072765; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ4vGA072763; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251904.p6PJ4vGA072763@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224390 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:04:57 -0000 Author: marius Date: Mon Jul 25 19:04:57 2011 New Revision: 224390 URL: http://svn.freebsd.org/changeset/base/224390 Log: MFC: r223962 Remove NULL assignments which are redundant for static timecounters. Submitted by: jkim Modified: stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Mon Jul 25 19:03:50 2011 (r224389) +++ stable/8/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224390) @@ -161,12 +161,10 @@ cpu_initclocks(void) * quality (S)TICK timers in the MP case. */ tick_tc.tc_get_timecount = tick_get_timecount_up; - tick_tc.tc_poll_pps = NULL; tick_tc.tc_counter_mask = ~0u; tick_tc.tc_frequency = clock; tick_tc.tc_name = "tick"; tick_tc.tc_quality = TICK_QUALITY_UP; - tick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { tick_tc.tc_get_timecount = tick_get_timecount_mp; @@ -176,12 +174,10 @@ cpu_initclocks(void) tc_init(&tick_tc); if (sclock != 0) { stick_tc.tc_get_timecount = stick_get_timecount_up; - stick_tc.tc_poll_pps = NULL; stick_tc.tc_counter_mask = ~0u; stick_tc.tc_frequency = sclock; stick_tc.tc_name = "stick"; stick_tc.tc_quality = TICK_QUALITY_UP; - stick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { stick_tc.tc_get_timecount = stick_get_timecount_mp; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:04:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D01106566C; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611F18FC0C; Mon, 25 Jul 2011 19:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ4vFg072769; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ4vCj072767; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251904.p6PJ4vCj072767@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224391 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:04:57 -0000 Author: marius Date: Mon Jul 25 19:04:57 2011 New Revision: 224391 URL: http://svn.freebsd.org/changeset/base/224391 Log: MFC: r223962 Remove NULL assignments which are redundant for static timecounters. Submitted by: jkim Modified: stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224390) +++ stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224391) @@ -161,12 +161,10 @@ cpu_initclocks(void) * quality (S)TICK timers in the MP case. */ tick_tc.tc_get_timecount = tick_get_timecount_up; - tick_tc.tc_poll_pps = NULL; tick_tc.tc_counter_mask = ~0u; tick_tc.tc_frequency = clock; tick_tc.tc_name = "tick"; tick_tc.tc_quality = TICK_QUALITY_UP; - tick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { tick_tc.tc_get_timecount = tick_get_timecount_mp; @@ -176,12 +174,10 @@ cpu_initclocks(void) tc_init(&tick_tc); if (sclock != 0) { stick_tc.tc_get_timecount = stick_get_timecount_up; - stick_tc.tc_poll_pps = NULL; stick_tc.tc_counter_mask = ~0u; stick_tc.tc_frequency = sclock; stick_tc.tc_name = "stick"; stick_tc.tc_quality = TICK_QUALITY_UP; - stick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { stick_tc.tc_get_timecount = stick_get_timecount_mp; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:06:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0E61065672; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 635958FC0C; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ6U8M072924; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ6U8f072919; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251906.p6PJ6U8f072919@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224392 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:06:30 -0000 Author: marius Date: Mon Jul 25 19:06:30 2011 New Revision: 224392 URL: http://svn.freebsd.org/changeset/base/224392 Log: MFC: r223981 Remove extra empty lines. Modified: stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:04:57 2011 (r224391) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224392) @@ -193,8 +193,6 @@ __FBSDID("$FreeBSD$"); #define PCIM_CMD_SERRESPEN 0x0100 #endif - - static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); static void mpt_free_bus_resources(struct mpt_softc *mpt); @@ -362,7 +360,6 @@ mpt_set_options(struct mpt_softc *mpt) mpt->cfg_role = tval; mpt->do_cfg_role = 1; } - tval = 0; mpt->msi_enable = 0; if (resource_int_value(device_get_name(mpt->dev), @@ -372,7 +369,6 @@ mpt_set_options(struct mpt_softc *mpt) } #endif - static void mpt_link_peer(struct mpt_softc *mpt) { @@ -411,7 +407,6 @@ mpt_unlink_peer(struct mpt_softc *mpt) } } - static int mpt_pci_attach(device_t dev) { @@ -687,7 +682,6 @@ mpt_free_bus_resources(struct mpt_softc MPT_LOCK_DESTROY(mpt); } - /* * Disconnect ourselves from the system. */ @@ -712,7 +706,6 @@ mpt_pci_detach(device_t dev) return(0); } - /* * Disable the hardware */ @@ -808,8 +801,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (0); } - - /* Deallocate memory that was allocated by mpt_dma_mem_alloc */ static void @@ -832,8 +823,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) } - - /* Reads modifiable (via PCI transactions) config registers */ static void mpt_read_config_regs(struct mpt_softc *mpt) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:06:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E5C31065673; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 649738FC12; Mon, 25 Jul 2011 19:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJ6UiC072925; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ6UfE072922; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251906.p6PJ6UfE072922@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224393 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:06:30 -0000 Author: marius Date: Mon Jul 25 19:06:30 2011 New Revision: 224393 URL: http://svn.freebsd.org/changeset/base/224393 Log: MFC: r223981 Remove extra empty lines. Modified: stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224392) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224393) @@ -193,8 +193,6 @@ __FBSDID("$FreeBSD$"); #define PCIM_CMD_SERRESPEN 0x0100 #endif - - static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); static void mpt_free_bus_resources(struct mpt_softc *mpt); @@ -362,7 +360,6 @@ mpt_set_options(struct mpt_softc *mpt) mpt->cfg_role = tval; mpt->do_cfg_role = 1; } - tval = 0; mpt->msi_enable = 0; if (resource_int_value(device_get_name(mpt->dev), @@ -372,7 +369,6 @@ mpt_set_options(struct mpt_softc *mpt) } #endif - static void mpt_link_peer(struct mpt_softc *mpt) { @@ -411,7 +407,6 @@ mpt_unlink_peer(struct mpt_softc *mpt) } } - static int mpt_pci_attach(device_t dev) { @@ -687,7 +682,6 @@ mpt_free_bus_resources(struct mpt_softc MPT_LOCK_DESTROY(mpt); } - /* * Disconnect ourselves from the system. */ @@ -712,7 +706,6 @@ mpt_pci_detach(device_t dev) return(0); } - /* * Disable the hardware */ @@ -808,8 +801,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (0); } - - /* Deallocate memory that was allocated by mpt_dma_mem_alloc */ static void @@ -832,8 +823,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) } - - /* Reads modifiable (via PCI transactions) config registers */ static void mpt_read_config_regs(struct mpt_softc *mpt) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:11:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B73C21065670; Mon, 25 Jul 2011 19:11:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6AC78FC0C; Mon, 25 Jul 2011 19:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJBTcu073164; Mon, 25 Jul 2011 19:11:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJBTX8073162; Mon, 25 Jul 2011 19:11:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251911.p6PJBTX8073162@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224394 - stable/8/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:11:29 -0000 Author: marius Date: Mon Jul 25 19:11:29 2011 New Revision: 224394 URL: http://svn.freebsd.org/changeset/base/224394 Log: MFC: r223984 PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI bridge is blacklisted. In that case just return from pci_alloc_msix_method(), otherwise we continue without a single MSI-X resource, causing subsequent attempts to use the seemingly available resource to fail or when booting verbose to NULL-dereference rle->start when trying to print the IRQ in pci_alloc_msix_method(). Reviewed by: jhb Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Mon Jul 25 19:06:30 2011 (r224393) +++ stable/8/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224394) @@ -1294,8 +1294,11 @@ pci_alloc_msix_method(device_t dev, devi for (i = 0; i < max; i++) { /* Allocate a message. */ error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq); - if (error) + if (error) { + if (i == 0) + return (error); break; + } resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:11:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A89E1065672; Mon, 25 Jul 2011 19:11:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49F5C8FC13; Mon, 25 Jul 2011 19:11:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJBUmq073187; Mon, 25 Jul 2011 19:11:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJBUW0073185; Mon, 25 Jul 2011 19:11:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251911.p6PJBUW0073185@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224395 - stable/7/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:11:30 -0000 Author: marius Date: Mon Jul 25 19:11:29 2011 New Revision: 224395 URL: http://svn.freebsd.org/changeset/base/224395 Log: MFC: r223984 PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI bridge is blacklisted. In that case just return from pci_alloc_msix_method(), otherwise we continue without a single MSI-X resource, causing subsequent attempts to use the seemingly available resource to fail or when booting verbose to NULL-dereference rle->start when trying to print the IRQ in pci_alloc_msix_method(). Reviewed by: jhb Modified: stable/7/sys/dev/pci/pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224394) +++ stable/7/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224395) @@ -1243,8 +1243,11 @@ pci_alloc_msix_method(device_t dev, devi for (i = 0; i < max; i++) { /* Allocate a message. */ error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq); - if (error) + if (error) { + if (i == 0) + return (error); break; + } resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:13:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8FC106566B; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8228FC0C; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJDpES073346; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJDplE073342; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251913.p6PJDplE073342@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224396 - stable/8/sys/dev/cas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:13:51 -0000 Author: marius Date: Mon Jul 25 19:13:51 2011 New Revision: 224396 URL: http://svn.freebsd.org/changeset/base/224396 Log: MFC: r223986 - Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout. - Just use ifp instead of sc->sc_ifp. Submitted by: jhb (mostly) Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Jul 25 19:11:29 2011 (r224395) +++ stable/8/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224396) @@ -203,7 +203,7 @@ cas_attach(struct cas_softc *sc) IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); - callout_init(&sc->sc_rx_ch, 1); + callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); /* Create local taskq. */ TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc); TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); @@ -1597,7 +1597,7 @@ cas_rint_timeout(void *arg) { struct cas_softc *sc = arg; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); cas_rint(sc); } @@ -1612,7 +1612,7 @@ cas_rint(struct cas_softc *sc) uint32_t rxhead; u_int idx, idx2, len, off, skip; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); callout_stop(&sc->sc_rx_ch); @@ -1740,7 +1740,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1836,7 +1838,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1874,7 +1878,7 @@ cas_free(void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; - u_int idx; + u_int idx, locked; #if __FreeBSD_version < 800016 rxds = arg2; @@ -1892,17 +1896,18 @@ cas_free(void *arg1, void *arg2) * NB: this function can be called via m_freem(9) within * this driver! */ - + if ((locked = CAS_LOCK_OWNED(sc)) == 0) + CAS_LOCK(sc); cas_add_rxdesc(sc, idx); + if (locked == 0) + CAS_UNLOCK(sc); } static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx) { - u_int locked; - if ((locked = CAS_LOCK_OWNED(sc)) == 0) - CAS_LOCK(sc); + CAS_LOCK_ASSERT(sc, MA_OWNED); bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap, BUS_DMASYNC_PREREAD); @@ -1920,9 +1925,6 @@ cas_add_rxdesc(struct cas_softc *sc, u_i CAS_WRITE_4(sc, CAS_RX_KICK, (sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK); } - - if (locked == 0) - CAS_UNLOCK(sc); } static void @@ -1930,7 +1932,7 @@ cas_eint(struct cas_softc *sc, u_int sta { struct ifnet *ifp = sc->sc_ifp; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); ifp->if_ierrors++; @@ -1947,7 +1949,7 @@ cas_eint(struct cas_softc *sc, u_int sta printf("\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - cas_init(sc); + cas_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } @@ -1984,6 +1986,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) goto done; + CAS_LOCK(sc); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", device_get_name(sc->sc_dev), __func__, @@ -2023,6 +2026,7 @@ cas_intr_task(void *arg, int pending __u (CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) { cas_eint(sc, status); + CAS_UNLOCK(sc); return; } @@ -2030,7 +2034,7 @@ cas_intr_task(void *arg, int pending __u status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS); if ((status2 & (CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0) - sc->sc_ifp->if_oerrors++; + ifp->if_oerrors++; else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); @@ -2039,7 +2043,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false(status & CAS_INTR_RX_MAC_INT)) { status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS); if ((status2 & CAS_MAC_RX_OVERFLOW) != 0) - sc->sc_ifp->if_ierrors++; + ifp->if_ierrors++; else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0) device_printf(sc->sc_dev, "MAC RX fault, status %x\n", status2); @@ -2059,16 +2063,15 @@ cas_intr_task(void *arg, int pending __u } if ((status & - (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) { - CAS_LOCK(sc); + (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) cas_tint(sc); - CAS_UNLOCK(sc); - } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + CAS_UNLOCK(sc); return; - else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + } else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); + CAS_UNLOCK(sc); status = CAS_READ_4(sc, CAS_STATUS_ALIAS); if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) { @@ -2408,7 +2411,7 @@ cas_mii_statchg(device_t dev) v |= CAS_MAC_XIF_CONF_FDXLED; CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v); - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & CAS_LINK) != 0) { CAS_WRITE_4(sc, CAS_MAC_TX_CONF, txcfg | CAS_MAC_TX_CONF_EN); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:13:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0076106566C; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF728FC12; Mon, 25 Jul 2011 19:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PJDpdj073348; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJDpkT073345; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251913.p6PJDpkT073345@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224397 - stable/7/sys/dev/cas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:13:51 -0000 Author: marius Date: Mon Jul 25 19:13:51 2011 New Revision: 224397 URL: http://svn.freebsd.org/changeset/base/224397 Log: MFC: r223986 - Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout. - Just use ifp instead of sc->sc_ifp. Submitted by: jhb (mostly) Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224396) +++ stable/7/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224397) @@ -203,7 +203,7 @@ cas_attach(struct cas_softc *sc) IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); - callout_init(&sc->sc_rx_ch, 1); + callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); /* Create local taskq. */ TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc); TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); @@ -1597,7 +1597,7 @@ cas_rint_timeout(void *arg) { struct cas_softc *sc = arg; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); cas_rint(sc); } @@ -1612,7 +1612,7 @@ cas_rint(struct cas_softc *sc) uint32_t rxhead; u_int idx, idx2, len, off, skip; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); callout_stop(&sc->sc_rx_ch); @@ -1740,7 +1740,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1836,7 +1838,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1874,7 +1878,7 @@ cas_free(void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; - u_int idx; + u_int idx, locked; #if __FreeBSD_version < 800016 rxds = arg2; @@ -1892,17 +1896,18 @@ cas_free(void *arg1, void *arg2) * NB: this function can be called via m_freem(9) within * this driver! */ - + if ((locked = CAS_LOCK_OWNED(sc)) == 0) + CAS_LOCK(sc); cas_add_rxdesc(sc, idx); + if (locked == 0) + CAS_UNLOCK(sc); } static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx) { - u_int locked; - if ((locked = CAS_LOCK_OWNED(sc)) == 0) - CAS_LOCK(sc); + CAS_LOCK_ASSERT(sc, MA_OWNED); bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap, BUS_DMASYNC_PREREAD); @@ -1920,9 +1925,6 @@ cas_add_rxdesc(struct cas_softc *sc, u_i CAS_WRITE_4(sc, CAS_RX_KICK, (sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK); } - - if (locked == 0) - CAS_UNLOCK(sc); } static void @@ -1930,7 +1932,7 @@ cas_eint(struct cas_softc *sc, u_int sta { struct ifnet *ifp = sc->sc_ifp; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); ifp->if_ierrors++; @@ -1947,7 +1949,7 @@ cas_eint(struct cas_softc *sc, u_int sta printf("\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - cas_init(sc); + cas_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } @@ -1984,6 +1986,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) goto done; + CAS_LOCK(sc); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", device_get_name(sc->sc_dev), __func__, @@ -2023,6 +2026,7 @@ cas_intr_task(void *arg, int pending __u (CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) { cas_eint(sc, status); + CAS_UNLOCK(sc); return; } @@ -2030,7 +2034,7 @@ cas_intr_task(void *arg, int pending __u status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS); if ((status2 & (CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0) - sc->sc_ifp->if_oerrors++; + ifp->if_oerrors++; else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); @@ -2039,7 +2043,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false(status & CAS_INTR_RX_MAC_INT)) { status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS); if ((status2 & CAS_MAC_RX_OVERFLOW) != 0) - sc->sc_ifp->if_ierrors++; + ifp->if_ierrors++; else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0) device_printf(sc->sc_dev, "MAC RX fault, status %x\n", status2); @@ -2059,16 +2063,15 @@ cas_intr_task(void *arg, int pending __u } if ((status & - (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) { - CAS_LOCK(sc); + (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) cas_tint(sc); - CAS_UNLOCK(sc); - } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + CAS_UNLOCK(sc); return; - else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + } else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); + CAS_UNLOCK(sc); status = CAS_READ_4(sc, CAS_STATUS_ALIAS); if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) { @@ -2408,7 +2411,7 @@ cas_mii_statchg(device_t dev) v |= CAS_MAC_XIF_CONF_FDXLED; CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v); - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & CAS_LINK) != 0) { CAS_WRITE_4(sc, CAS_MAC_TX_CONF, txcfg | CAS_MAC_TX_CONF_EN); From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 19:29:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 292EF106564A; Mon, 25 Jul 2011 19:29:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7815D8FC22; Mon, 25 Jul 2011 19:29:15 +0000 (UTC) Received: by gwb15 with SMTP id 15so3399003gwb.13 for ; Mon, 25 Jul 2011 12:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=P/p+1Hnu7obJmzr0VAbTWU5AMKNRcjeJFJUssc5EaHc=; b=k8RqDuTMVcB41AF2+9K4GgW/8NrqsYtUAEELei1GZSnufSj0FIMFXQJWrNC3NKazbl rl3maj5xeSOdt5yTAm0mz77E1BoOaD9YDo54uGA9o41aD+oxy69zzxS/wjIq4SskHGMj PVi+IASHL2LTsMimGsyu6HAUebQmWFIaxvNAE= MIME-Version: 1.0 Received: by 10.236.9.100 with SMTP id 64mr6452817yhs.339.1311622154832; Mon, 25 Jul 2011 12:29:14 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.108.129 with HTTP; Mon, 25 Jul 2011 12:29:14 -0700 (PDT) In-Reply-To: <4E2DBCBF.2030402@freebsd.org> References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> <4E2DB8AC.3000703@FreeBSD.org> <4E2DBCBF.2030402@freebsd.org> Date: Mon, 25 Jul 2011 21:29:14 +0200 X-Google-Sender-Auth: GhDILY6GDjb4uWHlMs1jaQ9Vra8 Message-ID: From: Attilio Rao To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, FreeBSD Release Engineering Team , Andreas Tobler Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:29:16 -0000 Guys, I'm a bit out of that for a couple of days, flying to another continent, I'm not entirely sure the patch is right because I think we need an unified approach for specifying a 32-bits value, but you can check-in as a showstopper for the moment, I will make a better one in a couple of days. Attilio 2011/7/25 Nathan Whitehorn : > On 07/25/11 13:40, Andreas Tobler wrote: >> >> On 24.07.11 23:35, Nathan Whitehorn wrote: >>> >>> On 07/19/11 07:41, Attilio Rao wrote: >>>> >>>> Author: attilio >>>> Date: Tue Jul 19 12:41:57 2011 >>>> New Revision: 224216 >>>> URL: http://svn.freebsd.org/changeset/base/224216 >>>> >>>> Log: >>>> On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes >>>> storage. >>>> Fix the sintrcnt/sintrnames specification. >>>> >>>> No MFC is previewed for this patch. >>>> >>> >>> These also need to be .long on 32-bit PowerPC, otherwise this change >>> triggers kernel panics and faults in sysctl. Please change it as quickly >>> as possible. >> >> Like the below? >> >> I'll test and I could commit if ok. (Build and approval) >> >> Gruss, >> Andreas >> >> Index: locore32.S >> =================================================================== >> --- locore32.S (revision 224326) >> +++ locore32.S (working copy) >> @@ -91,13 +91,13 @@ >> GLOBAL(intrnames) >> .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >> GLOBAL(sintrnames) >> - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >> + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >> >> .align 4 >> GLOBAL(intrcnt) >> .space INTRCNT_COUNT * 4 * 2 >> GLOBAL(sintrcnt) >> - .word INTRCNT_COUNT * 4 * 2 >> + .long INTRCNT_COUNT * 4 * 2 >> >> .text >> .globl btext > > Exactly like that. > -Nathan > -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 20:06:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5122E1065670; Mon, 25 Jul 2011 20:06:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F45F8FC08; Mon, 25 Jul 2011 20:06:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PK6Jtv074980; Mon, 25 Jul 2011 20:06:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PK6JKD074976; Mon, 25 Jul 2011 20:06:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252006.p6PK6JKD074976@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224398 - in stable/8/sys/dev/usb: . net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:06:19 -0000 Author: yongari Date: Mon Jul 25 20:06:18 2011 New Revision: 224398 URL: http://svn.freebsd.org/changeset/base/224398 Log: MFC r224020: Add initial support for AX88772B USB Fast Ethernet. AX88772B supports IPv4/IPv6 checksum offloading and VLAN tag insertion/ stripping as well as WOL. Because uether does not provide a way to announce driver specific offload capabilities to upper stack, checksum offloading support needs more work and will be done in future. Special thanks to ASIX for donating sample hardware. H/W donated by: ASIX Electronics Reviewed by: hselasky Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_axereg.h stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Mon Jul 25 19:13:51 2011 (r224397) +++ stable/8/sys/dev/usb/net/if_axe.c Mon Jul 25 20:06:18 2011 (r224398) @@ -142,6 +142,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(ASIX, AX88178, AXE_FLAG_178), AXE_DEV(ASIX, AX88772, AXE_FLAG_772), AXE_DEV(ASIX, AX88772A, AXE_FLAG_772A), + AXE_DEV(ASIX, AX88772B, AXE_FLAG_772B), AXE_DEV(ATEN, UC210T, 0), AXE_DEV(BELKIN, F5D5055, AXE_FLAG_178), AXE_DEV(BILLIONTON, USB2AR, 0), @@ -190,7 +191,9 @@ static void axe_ifmedia_sts(struct ifnet static int axe_cmd(struct axe_softc *, int, int, int, void *); static void axe_ax88178_init(struct axe_softc *); static void axe_ax88772_init(struct axe_softc *); +static void axe_ax88772_phywake(struct axe_softc *); static void axe_ax88772a_init(struct axe_softc *); +static void axe_ax88772b_init(struct axe_softc *); static int axe_get_phyno(struct axe_softc *, int); static const struct usb_config axe_config[AXE_N_TRANSFER] = { @@ -217,6 +220,17 @@ static const struct usb_config axe_confi }, }; +static const struct ax88772b_mfb ax88772b_mfb_table[] = { + { 0x8000, 0x8001, 2048 }, + { 0x8100, 0x8147, 4096}, + { 0x8200, 0x81EB, 6144}, + { 0x8300, 0x83D7, 8192}, + { 0x8400, 0x851E, 16384}, + { 0x8500, 0x8666, 20480}, + { 0x8600, 0x87AE, 24576}, + { 0x8700, 0x8A3D, 32768} +}; + static device_method_t axe_methods[] = { /* Device interface */ DEVMETHOD(device_probe, axe_probe), @@ -671,16 +685,11 @@ axe_ax88772_init(struct axe_softc *sc) } static void -axe_ax88772a_init(struct axe_softc *sc) +axe_ax88772_phywake(struct axe_softc *sc) { struct usb_ether *ue; - uint16_t eeprom; ue = &sc->sc_ue; - axe_cmd(sc, AXE_CMD_SROM_READ, 0, 0x0017, &eeprom); - eeprom = le16toh(eeprom); - /* Reload EEPROM. */ - AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); if (sc->sc_phyno == AXE_772_PHY_NO_EPHY) { /* Manually select internal(embedded) PHY - MAC mode. */ axe_cmd(sc, AXE_CMD_SW_PHY_SELECT, 0, AXE_SW_PHY_SELECT_SS_ENB | @@ -706,6 +715,55 @@ axe_ax88772a_init(struct axe_softc *sc) uether_pause(&sc->sc_ue, hz / 32); axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_SW_RESET_IPRL, NULL); uether_pause(&sc->sc_ue, hz / 32); +} + +static void +axe_ax88772a_init(struct axe_softc *sc) +{ + struct usb_ether *ue; + + ue = &sc->sc_ue; + /* Reload EEPROM. */ + AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); + axe_ax88772_phywake(sc); + /* Stop MAC. */ + axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); +} + +static void +axe_ax88772b_init(struct axe_softc *sc) +{ + struct usb_ether *ue; + uint16_t eeprom; + uint8_t *eaddr; + int i; + + ue = &sc->sc_ue; + /* Reload EEPROM. */ + AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); + /* + * Save PHY power saving configuration(high byte) and + * clear EEPROM checksum value(low byte). + */ + axe_cmd(sc, AXE_CMD_SROM_READ, 0, AXE_EEPROM_772B_PHY_PWRCFG, &eeprom); + sc->sc_pwrcfg = le16toh(eeprom) & 0xFF00; + + /* + * Auto-loaded default station address from internal ROM is + * 00:00:00:00:00:00 such that an explicit access to EEPROM + * is required to get real station address. + */ + eaddr = ue->ue_eaddr; + for (i = 0; i < ETHER_ADDR_LEN / 2; i++) { + axe_cmd(sc, AXE_CMD_SROM_READ, 0, AXE_EEPROM_772B_NODE_ID + i, + &eeprom); + eeprom = le16toh(eeprom); + *eaddr++ = (uint8_t)(eeprom & 0xFF); + *eaddr++ = (uint8_t)((eeprom >> 8) & 0xFF); + } + /* Wakeup PHY. */ + axe_ax88772_phywake(sc); + /* Stop MAC. */ axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); } @@ -734,6 +792,8 @@ axe_reset(struct axe_softc *sc) axe_ax88772_init(sc); else if (sc->sc_flags & AXE_FLAG_772A) axe_ax88772a_init(sc); + else if (sc->sc_flags & AXE_FLAG_772B) + axe_ax88772b_init(sc); } static void @@ -757,29 +817,29 @@ axe_attach_post(struct usb_ether *ue) sc->sc_phyno = 0; } + /* Initialize controller and get station address. */ if (sc->sc_flags & AXE_FLAG_178) { axe_ax88178_init(sc); sc->sc_tx_bufsz = 16 * 1024; + axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); } else if (sc->sc_flags & AXE_FLAG_772) { axe_ax88772_init(sc); sc->sc_tx_bufsz = 8 * 1024; + axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); } else if (sc->sc_flags & AXE_FLAG_772A) { axe_ax88772a_init(sc); sc->sc_tx_bufsz = 8 * 1024; - } - - /* - * Get station address. - */ - if (AXE_IS_178_FAMILY(sc)) axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); - else + } else if (sc->sc_flags & AXE_FLAG_772B) { + axe_ax88772b_init(sc); + sc->sc_tx_bufsz = 8 * 1024; + } else axe_cmd(sc, AXE_172_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); /* * Fetch IPG values. */ - if (sc->sc_flags & AXE_FLAG_772A) { + if (sc->sc_flags & (AXE_FLAG_772A | AXE_FLAG_772B)) { /* Set IPG values. */ sc->sc_ipgs[0] = 0x15; sc->sc_ipgs[1] = 0x16; @@ -1106,18 +1166,30 @@ axe_init(struct usb_ether *ue) axe_cmd(sc, AXE_172_CMD_WRITE_IPG2, 0, sc->sc_ipgs[2], NULL); } - /* Enable receiver, set RX mode */ + /* AX88772B uses different maximum frame burst configuration. */ + if (sc->sc_flags & AXE_FLAG_772B) + axe_cmd(sc, AXE_772B_CMD_RXCTL_WRITE_CFG, + ax88772b_mfb_table[AX88772B_MFB_16K].threshold, + ax88772b_mfb_table[AX88772B_MFB_16K].byte_cnt, NULL); + + /* Enable receiver, set RX mode. */ rxmode = (AXE_RXCMD_MULTICAST | AXE_RXCMD_ENABLE); if (AXE_IS_178_FAMILY(sc)) { -#if 0 - rxmode |= AXE_178_RXCMD_MFB_2048; /* chip default */ -#else - /* - * Default Rx buffer size is too small to get - * maximum performance. - */ - rxmode |= AXE_178_RXCMD_MFB_16384; -#endif + if (sc->sc_flags & AXE_FLAG_772B) { + /* + * Select RX header format type 1. Aligning IP + * header on 4 byte boundary is not needed + * because we always copy the received frame in + * RX handler. + */ + rxmode |= AXE_772B_RXCMD_HDR_TYPE_1; + } else { + /* + * Default Rx buffer size is too small to get + * maximum performance. + */ + rxmode |= AXE_178_RXCMD_MFB_16384; + } } else { rxmode |= AXE_172_RXCMD_UNICAST; } Modified: stable/8/sys/dev/usb/net/if_axereg.h ============================================================================== --- stable/8/sys/dev/usb/net/if_axereg.h Mon Jul 25 19:13:51 2011 (r224397) +++ stable/8/sys/dev/usb/net/if_axereg.h Mon Jul 25 20:06:18 2011 (r224398) @@ -96,6 +96,8 @@ #define AXE_CMD_READ_VLAN_CTRL 0x4027 #define AXE_CMD_WRITE_VLAN_CTRL 0x4028 +#define AXE_772B_CMD_RXCTL_WRITE_CFG 0x012A + #define AXE_SW_RESET_CLEAR 0x00 #define AXE_SW_RESET_RR 0x01 #define AXE_SW_RESET_RT 0x02 @@ -132,12 +134,18 @@ #define AXE_178_RXCMD_KEEP_INVALID_CRC 0x0004 #define AXE_RXCMD_BROADCAST 0x0008 #define AXE_RXCMD_MULTICAST 0x0010 +#define AXE_RXCMD_ACCEPT_RUNT 0x0040 /* AX88772B */ #define AXE_RXCMD_ENABLE 0x0080 #define AXE_178_RXCMD_MFB_MASK 0x0300 #define AXE_178_RXCMD_MFB_2048 0x0000 #define AXE_178_RXCMD_MFB_4096 0x0100 #define AXE_178_RXCMD_MFB_8192 0x0200 #define AXE_178_RXCMD_MFB_16384 0x0300 +#define AXE_772B_RXCMD_HDR_TYPE_0 0x0000 +#define AXE_772B_RXCMD_HDR_TYPE_1 0x0100 +#define AXE_772B_RXCMD_IPHDR_ALIGN 0x0200 +#define AXE_772B_RXCMD_ADD_CHKSUM 0x0400 +#define AXE_RXCMD_LOOPBACK 0x1000 /* AX88772A/AX88772B */ #define AXE_PHY_SEL_PRI 1 #define AXE_PHY_SEL_SEC 0 @@ -176,7 +184,7 @@ #define AXE_PHY_MODE_REALTEK_8251CL 0x0E #define AXE_PHY_MODE_ATTANSIC 0x40 -/* AX88772A only. */ +/* AX88772A/AX88772B only. */ #define AXE_SW_PHY_SELECT_EXT 0x0000 #define AXE_SW_PHY_SELECT_EMBEDDED 0x0001 #define AXE_SW_PHY_SELECT_AUTO 0x0002 @@ -199,6 +207,24 @@ #define AXE_CONFIG_IDX 0 /* config number 1 */ #define AXE_IFACE_IDX 0 +/* EEPROM Map. */ +#define AXE_EEPROM_772B_NODE_ID 0x04 +#define AXE_EEPROM_772B_PHY_PWRCFG 0x18 + +struct ax88772b_mfb { + int byte_cnt; + int threshold; + int size; +}; +#define AX88772B_MFB_2K 0 +#define AX88772B_MFB_4K 1 +#define AX88772B_MFB_6K 2 +#define AX88772B_MFB_8K 3 +#define AX88772B_MFB_16K 4 +#define AX88772B_MFB_20K 5 +#define AX88772B_MFB_24K 6 +#define AX88772B_MFB_32K 7 + struct axe_sframe_hdr { uint16_t len; uint16_t ilen; @@ -228,6 +254,7 @@ struct axe_softc { uint8_t sc_ipgs[3]; uint8_t sc_phyaddrs[2]; + uint16_t sc_pwrcfg; int sc_tx_bufsz; }; Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Jul 25 19:13:51 2011 (r224397) +++ stable/8/sys/dev/usb/usbdevs Mon Jul 25 20:06:18 2011 (r224398) @@ -1043,6 +1043,7 @@ product ASIX AX88172 0x1720 10/100 Ethe product ASIX AX88178 0x1780 AX88178 product ASIX AX88772 0x7720 AX88772 product ASIX AX88772A 0x772a AX88772A USB 2.0 10/100 Ethernet +product ASIX AX88772B 0x772b AX88772B USB 2.0 10/100 Ethernet /* ASUS products */ product ASUS2 USBN11 0x0b05 USB-N11 From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 20:09:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2C941065670; Mon, 25 Jul 2011 20:09:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1B4C8FC1A; Mon, 25 Jul 2011 20:09:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PK99mx075119; Mon, 25 Jul 2011 20:09:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PK99q0075117; Mon, 25 Jul 2011 20:09:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252009.p6PK99q0075117@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224399 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:09:09 -0000 Author: yongari Date: Mon Jul 25 20:09:09 2011 New Revision: 224399 URL: http://svn.freebsd.org/changeset/base/224399 Log: MFC r224023,224060: Document AX88772B and AX88760. AX88760 is treated as AX88772A in driver. Mention all ASIX USB controllers that are supported by axe(4). Reword media types and explicly mention AX88178 is the only controller that supports gigabit link. While I'm here use shorten model instead of showing all controller model numbers. Modified: stable/8/share/man/man4/axe.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Mon Jul 25 20:06:18 2011 (r224398) +++ stable/8/share/man/man4/axe.4 Mon Jul 25 20:09:09 2011 (r224399) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd July 14, 2011 .Dt AXE 4 .Os .Sh NAME .Nm axe -.Nd "ASIX Electronics AX88172/178/772 USB Ethernet driver" +.Nd "ASIX Electronics AX88x7x/760 USB Ethernet driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -59,12 +59,14 @@ if_axe_load="YES" The .Nm driver provides support for USB Ethernet adapters based on the ASIX -Electronics AX88172, AX88178 and AX88772 USB 2.0 chipsets. +Electronics AX88172, AX88178, AX88772, AX88772A, AX88772B and AX88760 +USB 2.0 chipsets. .Pp -The AX88172 and AX88178 are USB 2.0 devices that contain a 10/100 +The AX88172, AX88772, AX88772A, AX88772B and AX88760 contain a 10/100 Ethernet MAC with MII interface and are designed to work with both Ethernet and HomePNA transceivers. -The AX88772 will additionally support 10/100/1000 MACs. +The AX88178 has a 10/100/1000 Ethernet MAC with GMII/RGMII interface +for interfacing with Gigabit Ethernet PHY. .Pp These devices will operate with both USB 1.x and USB 2.0 controllers, however performance with 1.x @@ -85,43 +87,48 @@ driver supports the following media type .It Cm autoselect Enable autoselection of the media type and options. The user can manually override -the autoselected mode by adding media options to the -.Pa /etc/rc.conf -file. +the autoselected mode by adding media options to +.Xr rc.conf 5 . .It Cm 10baseT/UTP Set 10Mbps operation. The +.Xr ifconfig 8 .Cm mediaopt -option can also be used to enable -.Cm full-duplex -operation. -Not specifying +option can also be used to select either .Cm full-duplex -implies +or .Cm half-duplex -mode. +modes. .It Cm 100baseTX Set 100Mbps (Fast Ethernet) operation. The +.Xr ifconfig 8 .Cm mediaopt -option can also be used to enable +option can also be used to select either .Cm full-duplex -operation. -Not specifying +or +.Cm half-duplex +modes. +.It Cm 1000baseT +Set 1000Mbps (Gigabit Ethernet) operation (AX88178 only). +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either .Cm full-duplex -implies +or .Cm half-duplex -mode. +modes. .El .Pp The .Nm driver supports the following media options: -.Bl -tag -width ".Cm 10baseT/UTP" +.Bl -tag -width ".Cm full-duplex" .It Cm full-duplex Force full duplex operation. -The interface will operate in -half duplex mode if this media option is not specified. +.It Cm half-duplex +Force half duplex operation. .El .Pp For more information on configuring this device, see @@ -129,8 +136,8 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports ASIX Electronics AX88172/AX88178/AX88772 based USB Ethernet -adapters including: +driver supports ASIX Electronics AX88172/AX88178/AX88772/AX88772A/AX88772B/AX88760 +based USB Ethernet adapters including: .Pp AX88172: .Bl -bullet -compact @@ -139,6 +146,8 @@ AboCom UF200 .It Acer Communications EP1427X2 .It +ASIX AX88172 +.It ATen UC210T .It Billionton SnapPort @@ -167,6 +176,8 @@ System TALKS Inc.\& SGC-X2UL AX88178: .Bl -bullet -compact .It +ASIX AX88178 +.It Belkin F5D5055 .It Logitec LAN-GTJ/U2A @@ -181,9 +192,9 @@ Sitecom Europe LN-028 AX88772: .Bl -bullet -compact .It -Buffalo (Melco Inc.) LUA3-U2-ATX +ASIX AX88772 .It -Cisco-Linksys USB200Mv2 +Buffalo (Melco Inc.) LUA3-U2-ATX .It D-Link DUBE100B1 .It @@ -191,6 +202,26 @@ Planex UE-200TX-G .It Planex UE-200TX-G2 .El +.Pp +AX88772A: +.Bl -bullet -compact +.It +ASIX AX88772A +.It +Cisco-Linksys USB200Mv2 +.El +.Pp +AX88772B: +.Bl -bullet -compact +.It +ASIX AX88772B +.El +.Pp +AX88760: +.Bl -bullet -compact +.It +ASIX AX88760 +.El .Sh DIAGNOSTICS .Bl -diag .It "axe%d: watchdog timeout" @@ -209,7 +240,7 @@ The driver failed to allocate an mbuf fo .Xr rgephy 4 , .Xr ifconfig 8 .Rs -.%T "ASIX AX88172 AX88178 and AX88772 data sheets" +.%T "ASIX AX88x7x and AX88760 data sheets" .%O http://www.asix.com.tw .Re .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 20:10:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AEE8106566C; Mon, 25 Jul 2011 20:10:01 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AFAD8FC17; Mon, 25 Jul 2011 20:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PKA1R4075193; Mon, 25 Jul 2011 20:10:01 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PKA1ww075191; Mon, 25 Jul 2011 20:10:01 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201107252010.p6PKA1ww075191@svn.freebsd.org> From: Andreas Tobler Date: Mon, 25 Jul 2011 20:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224400 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:10:01 -0000 Author: andreast Date: Mon Jul 25 20:10:01 2011 New Revision: 224400 URL: http://svn.freebsd.org/changeset/base/224400 Log: This a follow up commit from r224216 for powerpc 32-bit. Increase the storage size for sintrcnt/sintrnames to .long. Reviewed by: nwhitehorn Approved by: re (kib) Modified: head/sys/powerpc/aim/locore32.S Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Mon Jul 25 20:09:09 2011 (r224399) +++ head/sys/powerpc/aim/locore32.S Mon Jul 25 20:10:01 2011 (r224400) @@ -91,13 +91,13 @@ GLOBAL(esym) GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 GLOBAL(sintrnames) - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 GLOBAL(sintrcnt) - .word INTRCNT_COUNT * 4 * 2 + .long INTRCNT_COUNT * 4 * 2 .text .globl btext From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 20:12:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE498106564A; Mon, 25 Jul 2011 20:12:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8968FC0A; Mon, 25 Jul 2011 20:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PKCVTF075334; Mon, 25 Jul 2011 20:12:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PKCVk1075332; Mon, 25 Jul 2011 20:12:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252012.p6PKCVk1075332@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224401 - stable/8/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:12:32 -0000 Author: yongari Date: Mon Jul 25 20:12:31 2011 New Revision: 224401 URL: http://svn.freebsd.org/changeset/base/224401 Log: MFC r224157: Revert r222135 by allowing controller reinitialization. Due to unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405 Modified: stable/8/sys/dev/gem/if_gem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Mon Jul 25 20:10:01 2011 (r224400) +++ stable/8/sys/dev/gem/if_gem.c Mon Jul 25 20:12:31 2011 (r224401) @@ -947,8 +947,10 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); +#ifdef notyet if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; +#endif #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 20:13:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1471106566B; Mon, 25 Jul 2011 20:13:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C07BF8FC12; Mon, 25 Jul 2011 20:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PKDZgf075400; Mon, 25 Jul 2011 20:13:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PKDZ48075398; Mon, 25 Jul 2011 20:13:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252013.p6PKDZ48075398@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224402 - stable/7/sys/dev/gem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:13:35 -0000 Author: yongari Date: Mon Jul 25 20:13:35 2011 New Revision: 224402 URL: http://svn.freebsd.org/changeset/base/224402 Log: MFC r224157: Revert r222135 by allowing controller reinitialization. Due to unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405 Modified: stable/7/sys/dev/gem/if_gem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 20:12:31 2011 (r224401) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 20:13:35 2011 (r224402) @@ -947,8 +947,10 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); +#ifdef notyet if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; +#endif #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:37:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06576106564A; Mon, 25 Jul 2011 21:37:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96718FC0C; Mon, 25 Jul 2011 21:37:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLbqQL077909; Mon, 25 Jul 2011 21:37:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLbqd3077907; Mon, 25 Jul 2011 21:37:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252137.p6PLbqd3077907@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224403 - stable/7/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:37:53 -0000 Author: marius Date: Mon Jul 25 21:37:52 2011 New Revision: 224403 URL: http://svn.freebsd.org/changeset/base/224403 Log: MFC: r192972 (partial) Some of the boot loader code only works on a ufs file system, but it uses the generic struct dirent, which happens to look identical to UFS's struct direct. If BSD ever changes dirent then this will be a problem. Submitted by: matthew dot fleming at isilon dot com Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 20:13:35 2011 (r224402) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:37:52 2011 (r224403) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase @@ -93,7 +94,7 @@ static __inline int fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; - struct dirent *d; + struct direct *d; char *s; ssize_t n; @@ -104,7 +105,7 @@ fsfind(const char *name, ino_t * ino) if (ls) printf("%s ", d->d_name); else if (!strcmp(name, d->d_name)) { - *ino = d->d_fileno; + *ino = d->d_ino; return d->d_type; } s += d->d_reclen; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:39:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CA51065670; Mon, 25 Jul 2011 21:39:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661FA8FC17; Mon, 25 Jul 2011 21:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLd9DS078002; Mon, 25 Jul 2011 21:39:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLd9jq078000; Mon, 25 Jul 2011 21:39:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252139.p6PLd9jq078000@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224404 - stable/7/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:39:09 -0000 Author: marius Date: Mon Jul 25 21:39:09 2011 New Revision: 224404 URL: http://svn.freebsd.org/changeset/base/224404 Log: MFC: r211747 Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:37:52 2011 (r224403) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:39:09 2011 (r224404) @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nb return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:41:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905011065670; Mon, 25 Jul 2011 21:41:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 662CF8FC18; Mon, 25 Jul 2011 21:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLfkKn078187; Mon, 25 Jul 2011 21:41:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLfkqt078184; Mon, 25 Jul 2011 21:41:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252141.p6PLfkqt078184@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224405 - in stable/7/sys/boot: common i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:41:46 -0000 Author: marius Date: Mon Jul 25 21:41:46 2011 New Revision: 224405 URL: http://svn.freebsd.org/changeset/base/224405 Log: MFC: r218713, r218716 Apply a few small optimizations to boot2's code, to make it shrink a little further. This gets us further on the way to be able to build it successfully with clang. Using in-tree gcc, this shrinks boot2.bin with 60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes. Submitted by: rdivacky Reviewed by: imp Modified: stable/7/sys/boot/common/ufsread.c stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:39:09 2011 (r224404) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:41:46 2011 (r224405) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + uint8_t dt; ino = ROOTINO; dt = DT_DIR; Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:39:09 2011 (r224404) +++ stable/7/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:41:46 2011 (r224405) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:44:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309771065670; Mon, 25 Jul 2011 21:44:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 062758FC12; Mon, 25 Jul 2011 21:44:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLiZAH078325; Mon, 25 Jul 2011 21:44:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLiZYx078322; Mon, 25 Jul 2011 21:44:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252144.p6PLiZYx078322@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224406 - in stable/8/sys/boot: common i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:44:36 -0000 Author: marius Date: Mon Jul 25 21:44:35 2011 New Revision: 224406 URL: http://svn.freebsd.org/changeset/base/224406 Log: MFC: r218713, r218716 Apply a few small optimizations to boot2's code, to make it shrink a little further. This gets us further on the way to be able to build it successfully with clang. Using in-tree gcc, this shrinks boot2.bin with 60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes. Submitted by: rdivacky Reviewed by: imp Modified: stable/8/sys/boot/common/ufsread.c stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Jul 25 21:41:46 2011 (r224405) +++ stable/8/sys/boot/common/ufsread.c Mon Jul 25 21:44:35 2011 (r224406) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + uint8_t dt; ino = ROOTINO; dt = DT_DIR; Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:41:46 2011 (r224405) +++ stable/8/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:44:35 2011 (r224406) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:52:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A6F106566C; Mon, 25 Jul 2011 21:52:18 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088AB8FC08; Mon, 25 Jul 2011 21:52:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLqHpv078644; Mon, 25 Jul 2011 21:52:17 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLqHjX078642; Mon, 25 Jul 2011 21:52:17 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201107252152.p6PLqHjX078642@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 25 Jul 2011 21:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224408 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:52:18 -0000 Author: rodrigc Date: Mon Jul 25 21:52:17 2011 New Revision: 224408 URL: http://svn.freebsd.org/changeset/base/224408 Log: Document the tftp.blksize variable added in src/lib/libstand/tftp.c. Approved by: re (kib) Requested by: maxim Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Mon Jul 25 21:47:56 2011 (r224407) +++ head/sys/boot/forth/loader.conf Mon Jul 25 21:52:17 2011 (r224408) @@ -55,6 +55,11 @@ module_path="/boot/modules" # Set the mo #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem +#tftp.blksize="1428" # Set the RFC 2348 TFTP block size. + # If the TFTP server does not support RFC 2348, + # the block size is set to 512. If the value + # is out of range ( < 8 || > 9008 ) an error is + # returned. ############################################################## From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:58:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B8F4106564A; Mon, 25 Jul 2011 21:58:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B0278FC16; Mon, 25 Jul 2011 21:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLwdSi078878; Mon, 25 Jul 2011 21:58:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLwdAl078876; Mon, 25 Jul 2011 21:58:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107252158.p6PLwdAl078876@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Jul 2011 21:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224409 - stable/8/share/skel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:58:39 -0000 Author: jilles Date: Mon Jul 25 21:58:39 2011 New Revision: 224409 URL: http://svn.freebsd.org/changeset/base/224409 Log: MFC r222932: skel/.shrc: Improve commented CDPATH example for POSIX requirements. POSIX says an empty entry in CDPATH shall not result in the new directory being printed, while any non-empty entry shall result in the new directory being printed, including ".". Therefore, the value of CDPATH should almost always start with a colon, not dot and colon. Our sh does not print the name for empty entries as well as "." entries. Modified: stable/8/share/skel/dot.shrc Directory Properties: stable/8/share/skel/ (props changed) Modified: stable/8/share/skel/dot.shrc ============================================================================== --- stable/8/share/skel/dot.shrc Mon Jul 25 21:52:17 2011 (r224408) +++ stable/8/share/skel/dot.shrc Mon Jul 25 21:58:39 2011 (r224409) @@ -44,4 +44,4 @@ alias g='egrep -i' # esac # search path for cd(1) -# CDPATH=.:$HOME +# CDPATH=:$HOME From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 22:32:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE42106566B; Mon, 25 Jul 2011 22:32:24 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 88D568FC0C; Mon, 25 Jul 2011 22:32:24 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 5231D35931A; Tue, 26 Jul 2011 00:32:23 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 3B7E117399; Tue, 26 Jul 2011 00:32:23 +0200 (CEST) Date: Tue, 26 Jul 2011 00:32:23 +0200 From: Jilles Tjoelker To: Kirk McKusick Message-ID: <20110725223223.GA29846@stack.nl> References: <201107241827.p6OIR9Tj019524@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107241827.p6OIR9Tj019524@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224294 - in head: sbin/mount sys/kern sys/sys sys/ufs/ffs sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 22:32:25 -0000 On Sun, Jul 24, 2011 at 06:27:09PM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Sun Jul 24 18:27:09 2011 > New Revision: 224294 > URL: http://svn.freebsd.org/changeset/base/224294 > Log: > Move the MNTK_SUJ flag in mnt_kern_flag to MNT_SUJ in mnt_flag > so that it is visible to userland programs. This change enables > the `mount' command with no arguments to be able to show if a > filesystem is mounted using journaled soft updates as opposed > to just normal soft updates. > Approved by: re (bz) [snip] > Modified: head/sbin/mount/mount.c > ============================================================================== > --- head/sbin/mount/mount.c Sun Jul 24 18:16:14 2011 (r224293) > +++ head/sbin/mount/mount.c Sun Jul 24 18:27:09 2011 (r224294) [snip good change] > @@ -316,7 +317,7 @@ main(int argc, char *argv[]) > rval = 0; > switch (argc) { > case 0: > - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) > + if ((mntsize = getmntinfo(&mntbuf, MNT_WAIT)) == 0) > err(1, "getmntinfo"); > if (all) { > while ((fs = getfsent()) != NULL) { > @@ -665,7 +666,7 @@ getmntpt(const char *name) > struct statfs *mntbuf; > int i, mntsize; > > - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); > + mntsize = getmntinfo(&mntbuf, MNT_WAIT); > for (i = mntsize - 1; i >= 0; i--) { > if (strcmp(mntbuf[i].f_mntfromname, name) == 0 || > strcmp(mntbuf[i].f_mntonname, name) == 0) These two hunks make it impossible (or at least very hard) to do 'mount', 'mount -p' or 'mount -u ' while there is a non-responsive NFS filesystem. The effect of the lines appears to be avoiding both "soft-updates" and "journaled soft-updates" texts in mount output. This is because the code in kern_getfsstat() in sys/kern/vfs_syscalls.c copies mp->mnt_flag and subsequently calls VFS_STATFS in the MNT_WAIT case: % /* % * Set these in case the underlying filesystem % * fails to do so. % */ % sp->f_version = STATFS_VERSION; % sp->f_namemax = NAME_MAX; % sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; followed by code that will call VFS_STATFS(mp, sp) in the MNT_WAIT case. Only in the latter case is MNT_SOFTDEP turned off if MNT_SUJ is on. I don't think kern_getfsstat() should know about MNT_SOFTDEP and MNT_SUJ, which would suggest giving up on preventing MNT_SOFTDEP-with-MNT_SUJ in userland. However, what I care about is mount(8) working while there are unrelated hung filesystems. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 23:01:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CE1106564A; Mon, 25 Jul 2011 23:01:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76B858FC0A; Mon, 25 Jul 2011 23:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PN18tM080863; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PN18tF080861; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252301.p6PN18tF080861@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 23:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224410 - stable/7/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 23:01:08 -0000 Author: marius Date: Mon Jul 25 23:01:08 2011 New Revision: 224410 URL: http://svn.freebsd.org/changeset/base/224410 Log: MFC: r223938 Since r219452 the alignment of __dmadat has changed, revealing that fsread() bogusly casts its contents around causing alignment faults on sparc64 and most likely also on at least powerpc. Fix this by copying the contents bytewise instead as partly already done here. Solving this the right way costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86 there are still some bytes left there though, and an acceptable hack which tricks the compiler into only using a 2-byte alignment instead of the native one when accessing the contents turned out to even take up more space that. Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:58:39 2011 (r224409) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224410) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can @@ -90,7 +91,7 @@ static ssize_t fsread(ino_t, void *, siz static int ls, dsk_meta; static uint32_t fs_off; -static __inline int +static __inline uint8_t fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; @@ -160,7 +161,7 @@ static int sblock_try[] = SBLOCKSEARCH; #elif defined(UFS1_ONLY) #define DIP(field) dp1.field #else -#define DIP(field) fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field +#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field #endif static ssize_t @@ -175,7 +176,7 @@ fsread(ino_t inode, void *buf, size_t nb static ino_t inomap; char *blkbuf; void *indbuf; - struct fs *fs; + struct fs fs; char *s; size_t n, nb, size, off, vboff; ufs_lbn_t lbn; @@ -183,30 +184,29 @@ fsread(ino_t inode, void *buf, size_t nb static ufs2_daddr_t blkmap, indmap; u_int u; - blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - fs = (struct fs *)dmadat->sbbuf; if (!dsk_meta) { inomap = 0; for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(fs, sblock_try[n] / DEV_BSIZE, + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (( #if defined(UFS1_ONLY) - fs->fs_magic == FS_UFS1_MAGIC + fs.fs_magic == FS_UFS1_MAGIC #elif defined(UFS2_ONLY) - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #else - fs->fs_magic == FS_UFS1_MAGIC || - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #endif ) && - fs->fs_bsize <= MAXBSIZE && - fs->fs_bsize >= sizeof(struct fs)) + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -214,12 +214,13 @@ fsread(ino_t inode, void *buf, size_t nb return -1; } dsk_meta++; - } + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (!inode) return 0; if (inomap != inode) { - n = IPERVBLK(fs); - if (dskread(blkbuf, INO_TO_VBA(fs, n, inode), DBPERVBLK)) + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) @@ -229,13 +230,12 @@ fsread(ino_t inode, void *buf, size_t nb memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) + if (fs.fs_magic == FS_UFS1_MAGIC) memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, sizeof(struct ufs1_dinode)); else memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); - #endif inomap = inode; fs_off = 0; @@ -248,15 +248,15 @@ fsread(ino_t inode, void *buf, size_t nb nbyte = n; nb = nbyte; while (nb) { - lbn = lblkno(fs, fs_off); - off = blkoff(fs, fs_off); + lbn = lblkno(&fs, fs_off); + off = blkoff(&fs, fs_off); if (lbn < NDADDR) { addr = DIP(di_db[lbn]); - } else if (lbn < NDADDR + NINDIR(fs)) { - n = INDIRPERVBLK(fs); + } else if (lbn < NDADDR + NINDIR(&fs)) { + n = INDIRPERVBLK(&fs); addr = DIP(di_ib[0]); u = (u_int)(lbn - NDADDR) / n * DBPERVBLK; - vbaddr = fsbtodb(fs, addr) + u; + vbaddr = fsbtodb(&fs, addr) + u; if (indmap != vbaddr) { if (dskread(indbuf, vbaddr, DBPERVBLK)) return -1; @@ -264,21 +264,25 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) - addr = ((ufs1_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); #elif defined(UFS2_ONLY) - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) - addr = ((ufs1_daddr_t *)indbuf)[n]; + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); else - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #endif } else { return -1; } - vbaddr = fsbtodb(fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; + vbaddr = fsbtodb(&fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 23:01:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2521F1065672; Mon, 25 Jul 2011 23:01:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 132F48FC12; Mon, 25 Jul 2011 23:01:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PN18sI080885; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PN189D080883; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252301.p6PN189D080883@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 23:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224411 - stable/8/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 23:01:09 -0000 Author: marius Date: Mon Jul 25 23:01:08 2011 New Revision: 224411 URL: http://svn.freebsd.org/changeset/base/224411 Log: MFC: r223938 Since r219452 the alignment of __dmadat has changed, revealing that fsread() bogusly casts its contents around causing alignment faults on sparc64 and most likely also on at least powerpc. Fix this by copying the contents bytewise instead as partly already done here. Solving this the right way costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86 there are still some bytes left there though, and an acceptable hack which tricks the compiler into only using a 2-byte alignment instead of the native one when accessing the contents turned out to even take up more space that. Modified: stable/8/sys/boot/common/ufsread.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224410) +++ stable/8/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224411) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can @@ -90,7 +91,7 @@ static ssize_t fsread(ino_t, void *, siz static int ls, dsk_meta; static uint32_t fs_off; -static __inline int +static __inline uint8_t fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; @@ -160,7 +161,7 @@ static int sblock_try[] = SBLOCKSEARCH; #elif defined(UFS1_ONLY) #define DIP(field) dp1.field #else -#define DIP(field) fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field +#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field #endif static ssize_t @@ -175,7 +176,7 @@ fsread(ino_t inode, void *buf, size_t nb static ino_t inomap; char *blkbuf; void *indbuf; - struct fs *fs; + struct fs fs; char *s; size_t n, nb, size, off, vboff; ufs_lbn_t lbn; @@ -183,30 +184,29 @@ fsread(ino_t inode, void *buf, size_t nb static ufs2_daddr_t blkmap, indmap; u_int u; - blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - fs = (struct fs *)dmadat->sbbuf; if (!dsk_meta) { inomap = 0; for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(fs, sblock_try[n] / DEV_BSIZE, + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (( #if defined(UFS1_ONLY) - fs->fs_magic == FS_UFS1_MAGIC + fs.fs_magic == FS_UFS1_MAGIC #elif defined(UFS2_ONLY) - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #else - fs->fs_magic == FS_UFS1_MAGIC || - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #endif ) && - fs->fs_bsize <= MAXBSIZE && - fs->fs_bsize >= sizeof(struct fs)) + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -214,12 +214,13 @@ fsread(ino_t inode, void *buf, size_t nb return -1; } dsk_meta++; - } + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (!inode) return 0; if (inomap != inode) { - n = IPERVBLK(fs); - if (dskread(blkbuf, INO_TO_VBA(fs, n, inode), DBPERVBLK)) + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) @@ -229,13 +230,12 @@ fsread(ino_t inode, void *buf, size_t nb memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) + if (fs.fs_magic == FS_UFS1_MAGIC) memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, sizeof(struct ufs1_dinode)); else memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); - #endif inomap = inode; fs_off = 0; @@ -248,15 +248,15 @@ fsread(ino_t inode, void *buf, size_t nb nbyte = n; nb = nbyte; while (nb) { - lbn = lblkno(fs, fs_off); - off = blkoff(fs, fs_off); + lbn = lblkno(&fs, fs_off); + off = blkoff(&fs, fs_off); if (lbn < NDADDR) { addr = DIP(di_db[lbn]); - } else if (lbn < NDADDR + NINDIR(fs)) { - n = INDIRPERVBLK(fs); + } else if (lbn < NDADDR + NINDIR(&fs)) { + n = INDIRPERVBLK(&fs); addr = DIP(di_ib[0]); u = (u_int)(lbn - NDADDR) / n * DBPERVBLK; - vbaddr = fsbtodb(fs, addr) + u; + vbaddr = fsbtodb(&fs, addr) + u; if (indmap != vbaddr) { if (dskread(indbuf, vbaddr, DBPERVBLK)) return -1; @@ -264,21 +264,25 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) - addr = ((ufs1_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); #elif defined(UFS2_ONLY) - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) - addr = ((ufs1_daddr_t *)indbuf)[n]; + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); else - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #endif } else { return -1; } - vbaddr = fsbtodb(fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; + vbaddr = fsbtodb(&fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 04:00:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0EC4106564A; Tue, 26 Jul 2011 04:00:00 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF4968FC17; Tue, 26 Jul 2011 04:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6Q400MY090282; Tue, 26 Jul 2011 04:00:00 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6Q400QC090279; Tue, 26 Jul 2011 04:00:00 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201107260400.p6Q400QC090279@svn.freebsd.org> From: Ken Smith Date: Tue, 26 Jul 2011 04:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224413 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 04:00:01 -0000 Author: kensmith Date: Tue Jul 26 04:00:00 2011 New Revision: 224413 URL: http://svn.freebsd.org/changeset/base/224413 Log: Looks like we're ready for 9.0-BETA1 builds. Approved by: re (implicit) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Tue Jul 26 01:06:44 2011 (r224412) +++ head/sys/conf/newvers.sh Tue Jul 26 04:00:00 2011 (r224413) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.0" -BRANCH="CURRENT" +BRANCH="BETA1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 04:33:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CBFC106566B; Tue, 26 Jul 2011 04:33:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11A518FC0C; Tue, 26 Jul 2011 04:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6Q4X0R2091370; Tue, 26 Jul 2011 04:33:00 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6Q4X05A091358; Tue, 26 Jul 2011 04:33:00 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107260433.p6Q4X05A091358@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 26 Jul 2011 04:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224414 - stable/8/sbin/newfs_msdos X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 04:33:01 -0000 Author: ae Date: Tue Jul 26 04:33:00 2011 New Revision: 224414 URL: http://svn.freebsd.org/changeset/base/224414 Log: MFC r223945: Add SIGINFO handler. Obtained from: NetBSD (partly) MFC r223946: Use NULL instead of 0 for third argument of sigaction(2). Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Jul 26 04:00:00 2011 (r224413) +++ stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Jul 26 04:33:00 2011 (r224414) @@ -44,6 +44,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -216,6 +217,9 @@ static const u_int8_t bootcode[] = { 0 }; +static volatile sig_atomic_t got_siginfo; +static void infohandler(int); + static void check_mounted(const char *, mode_t); static void getstdfmt(const char *, struct bpb *); static void getdiskinfo(int, const char *, const char *, int, @@ -243,6 +247,7 @@ main(int argc, char *argv[]) int opt_N = 0; int Iflag = 0, mflag = 0, oflag = 0; char buf[MAXPATHLEN]; + struct sigaction si_sa; struct stat sb; struct timeval tv; struct bpb bpb; @@ -604,7 +609,19 @@ main(int argc, char *argv[]) if (!(img = malloc(bpb.bpbBytesPerSec))) err(1, NULL); dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs) * bpb.bpbFATs; + memset(&si_sa, 0, sizeof(si_sa)); + si_sa.sa_handler = infohandler; + if (sigaction(SIGINFO, &si_sa, NULL) == -1) + err(1, "sigaction SIGINFO"); for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) { + if (got_siginfo) { + fprintf(stderr,"%s: writing sector %u of %u (%u%%)\n", + fname, lsn, + (dir + (fat == 32 ? bpb.bpbSecPerClust: rds)), + (lsn * 100) / (dir + + (fat == 32 ? bpb.bpbSecPerClust: rds))); + got_siginfo = 0; + } x = lsn; if (opt_B && fat == 32 && bpb.bpbBackup != MAXU16 && @@ -1017,3 +1034,10 @@ usage(void) "\t-u sectors/track\n"); exit(1); } + +static void +infohandler(int sig __unused) +{ + + got_siginfo = 1; +} From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 09:59:05 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A5F106566C; Tue, 26 Jul 2011 09:59:05 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 7B95A8FC0C; Tue, 26 Jul 2011 09:59:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.4/8.14.3) with ESMTP id p6Q9x2kO032944; Tue, 26 Jul 2011 13:59:02 +0400 (MSD) (envelope-from maxim.konovalov@gmail.com) Date: Tue, 26 Jul 2011 13:59:02 +0400 (MSD) From: Maxim Konovalov To: Craig Rodrigues In-Reply-To: <201107252152.p6PLqHjX078642@svn.freebsd.org> Message-ID: References: <201107252152.p6PLqHjX078642@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r224408 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 09:59:05 -0000 On Mon, 25 Jul 2011, 21:52-0000, Craig Rodrigues wrote: > Author: rodrigc > Date: Mon Jul 25 21:52:17 2011 > New Revision: 224408 > URL: http://svn.freebsd.org/changeset/base/224408 > > Log: > Document the tftp.blksize variable added in src/lib/libstand/tftp.c. > thanks! -- Maxim Konovalov From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 12:57:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3361065676; Tue, 26 Jul 2011 12:57:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 887B48FC18; Tue, 26 Jul 2011 12:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCvMZC008477; Tue, 26 Jul 2011 12:57:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCvMhI008475; Tue, 26 Jul 2011 12:57:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261257.p6QCvMhI008475@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224416 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:57:23 -0000 Author: marius Date: Tue Jul 26 12:57:22 2011 New Revision: 224416 URL: http://svn.freebsd.org/changeset/base/224416 Log: MFC: r212064, r212098 Use a cleaner expression to retrieve the memory size in pc98's boot2.c, which also avoids NULL pointer arithmetic, as suggested by jhb. The available space goes from 11 bytes to 7. Reviewed by: nyan Approved by: rpaulo (mentor) Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 10:50:33 2011 (r224415) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:22 2011 (r224416) @@ -187,9 +187,8 @@ xfsread(ino_t inode, void *buf, size_t n static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0); - - return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; + return (*(u_char *)PTOV(0x401) * 128 * 1024 + + *(uint16_t *)PTOV(0x594) * 1024 * 1024); } static inline void From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 12:57:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D11131065670; Tue, 26 Jul 2011 12:57:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C00768FC1E; Tue, 26 Jul 2011 12:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCvNu0008507; Tue, 26 Jul 2011 12:57:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCvNtk008505; Tue, 26 Jul 2011 12:57:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261257.p6QCvNtk008505@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224417 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:57:23 -0000 Author: marius Date: Tue Jul 26 12:57:23 2011 New Revision: 224417 URL: http://svn.freebsd.org/changeset/base/224417 Log: MFC: r212064, r212098 Use a cleaner expression to retrieve the memory size in pc98's boot2.c, which also avoids NULL pointer arithmetic, as suggested by jhb. The available space goes from 11 bytes to 7. Reviewed by: nyan Approved by: rpaulo (mentor) Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:22 2011 (r224416) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:23 2011 (r224417) @@ -187,9 +187,8 @@ xfsread(ino_t inode, void *buf, size_t n static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0); - - return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; + return (*(u_char *)PTOV(0x401) * 128 * 1024 + + *(uint16_t *)PTOV(0x594) * 1024 * 1024); } static inline void From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 12:58:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6E9106567A; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A5E28FC1F; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCwUoF008631; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCwUxq008629; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261258.p6QCwUxq008629@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224418 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:58:30 -0000 Author: marius Date: Tue Jul 26 12:58:29 2011 New Revision: 224418 URL: http://svn.freebsd.org/changeset/base/224418 Log: MFC: r214257 MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:23 2011 (r224417) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224418) @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 12:58:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B50E106567D; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428A98FC21; Tue, 26 Jul 2011 12:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCwUos008635; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCwUJk008633; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261258.p6QCwUJk008633@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224419 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:58:30 -0000 Author: marius Date: Tue Jul 26 12:58:29 2011 New Revision: 224419 URL: http://svn.freebsd.org/changeset/base/224419 Log: MFC: r214257 MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224418) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224419) @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:01:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9DB1065673; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC778FC12; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD1E4M008853; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD1EVl008850; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261301.p6QD1EVl008850@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224420 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:01:14 -0000 Author: marius Date: Tue Jul 26 13:01:14 2011 New Revision: 224420 URL: http://svn.freebsd.org/changeset/base/224420 Log: MFC: r218737, r218946 MFi386: revision 218713 Apply a few small optimizations to boot2's code, to make it shrink a little further. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224419) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224420) @@ -360,7 +360,7 @@ main(void) #ifdef GET_BIOSGEOM int i; #endif - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -457,7 +457,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:01:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87B21065674; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A794D8FC13; Tue, 26 Jul 2011 13:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD1EKK008867; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD1EJ1008865; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261301.p6QD1EJ1008865@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224421 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:01:14 -0000 Author: marius Date: Tue Jul 26 13:01:14 2011 New Revision: 224421 URL: http://svn.freebsd.org/changeset/base/224421 Log: MFC: r218737, r218946 MFi386: revision 218713 Apply a few small optimizations to boot2's code, to make it shrink a little further. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224420) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224421) @@ -360,7 +360,7 @@ main(void) #ifdef GET_BIOSGEOM int i; #endif - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -457,7 +457,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:04:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D53511065674; Tue, 26 Jul 2011 13:04:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3F2A8FC08; Tue, 26 Jul 2011 13:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD4hFg009026; Tue, 26 Jul 2011 13:04:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD4hU2009024; Tue, 26 Jul 2011 13:04:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261304.p6QD4hU2009024@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224422 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:04:44 -0000 Author: marius Date: Tue Jul 26 13:04:43 2011 New Revision: 224422 URL: http://svn.freebsd.org/changeset/base/224422 Log: MFC: r218842 MFi386: revision 218745 Remove reading of symbols from a.out loaded files. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224421) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:43 2011 (r224422) @@ -484,23 +484,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -532,8 +515,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:04:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3B5106566C; Tue, 26 Jul 2011 13:04:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2FE8FC0A; Tue, 26 Jul 2011 13:04:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD4mrE009063; Tue, 26 Jul 2011 13:04:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD4mB6009061; Tue, 26 Jul 2011 13:04:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261304.p6QD4mB6009061@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224423 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:04:48 -0000 Author: marius Date: Tue Jul 26 13:04:48 2011 New Revision: 224423 URL: http://svn.freebsd.org/changeset/base/224423 Log: MFC: r218842 MFi386: revision 218745 Remove reading of symbols from a.out loaded files. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:43 2011 (r224422) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:48 2011 (r224423) @@ -484,23 +484,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -532,8 +515,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:06:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAA42106564A; Tue, 26 Jul 2011 13:06:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF5D8FC1B; Tue, 26 Jul 2011 13:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD6KYm009180; Tue, 26 Jul 2011 13:06:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD6KNC009178; Tue, 26 Jul 2011 13:06:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261306.p6QD6KNC009178@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224424 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:06:20 -0000 Author: marius Date: Tue Jul 26 13:06:20 2011 New Revision: 224424 URL: http://svn.freebsd.org/changeset/base/224424 Log: MFC: r219225 MFi386: revision 219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:48 2011 (r224423) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:20 2011 (r224424) @@ -133,11 +133,11 @@ static struct dsk { unsigned start; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - return (*(u_char *)PTOV(0x401) * 128 * 1024 + - *(uint16_t *)PTOV(0x594) * 1024 * 1024); -} - static inline void getstr(void) { @@ -382,9 +374,6 @@ main(void) #endif bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -408,11 +397,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -427,7 +416,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -611,11 +600,7 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:06:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D211065670; Tue, 26 Jul 2011 13:06:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3753D8FC0A; Tue, 26 Jul 2011 13:06:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD6MtR009212; Tue, 26 Jul 2011 13:06:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD6Mp2009210; Tue, 26 Jul 2011 13:06:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261306.p6QD6Mp2009210@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224425 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:06:22 -0000 Author: marius Date: Tue Jul 26 13:06:21 2011 New Revision: 224425 URL: http://svn.freebsd.org/changeset/base/224425 Log: MFC: r219225 MFi386: revision 219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:20 2011 (r224424) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:21 2011 (r224425) @@ -133,11 +133,11 @@ static struct dsk { unsigned start; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - return (*(u_char *)PTOV(0x401) * 128 * 1024 + - *(uint16_t *)PTOV(0x594) * 1024 * 1024); -} - static inline void getstr(void) { @@ -382,9 +374,6 @@ main(void) #endif bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -408,11 +397,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -427,7 +416,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -611,11 +600,7 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:12:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4854106566B; Tue, 26 Jul 2011 13:12:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A11F8FC16; Tue, 26 Jul 2011 13:12:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDC8Z3009486; Tue, 26 Jul 2011 13:12:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDC8AO009484; Tue, 26 Jul 2011 13:12:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261312.p6QDC8AO009484@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224426 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:12:08 -0000 Author: marius Date: Tue Jul 26 13:12:08 2011 New Revision: 224426 URL: http://svn.freebsd.org/changeset/base/224426 Log: MFC: r219960 MFi386: the part of 219452 - bunch of variables are turned into uint8_t. - the setting and reading of "fmt" in load() is removed. - buf in printf() is made static to save space. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:21 2011 (r224425) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:08 2011 (r224426) @@ -137,7 +137,7 @@ static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -445,9 +445,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -456,15 +455,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -473,7 +465,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -505,7 +497,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -672,7 +668,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:12:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 066C9106564A; Tue, 26 Jul 2011 13:12:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D030A8FC14; Tue, 26 Jul 2011 13:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDC99d009519; Tue, 26 Jul 2011 13:12:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDC9Uw009517; Tue, 26 Jul 2011 13:12:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261312.p6QDC9Uw009517@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224427 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:12:10 -0000 Author: marius Date: Tue Jul 26 13:12:09 2011 New Revision: 224427 URL: http://svn.freebsd.org/changeset/base/224427 Log: MFC: r219960 MFi386: the part of 219452 - bunch of variables are turned into uint8_t. - the setting and reading of "fmt" in load() is removed. - buf in printf() is made static to save space. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:08 2011 (r224426) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:09 2011 (r224427) @@ -137,7 +137,7 @@ static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -445,9 +445,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -456,15 +455,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -473,7 +465,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -505,7 +497,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -672,7 +668,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:13:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4177106566B; Tue, 26 Jul 2011 13:13:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C32E78FC0C; Tue, 26 Jul 2011 13:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDDVMV009643; Tue, 26 Jul 2011 13:13:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDDVIk009641; Tue, 26 Jul 2011 13:13:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261313.p6QDDVIk009641@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224428 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:13:31 -0000 Author: marius Date: Tue Jul 26 13:13:31 2011 New Revision: 224428 URL: http://svn.freebsd.org/changeset/base/224428 Log: MFC: r220685 MFi386: revisions 220389 and 220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:09 2011 (r224427) +++ stable/8/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224428) @@ -150,7 +150,7 @@ static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -779,6 +779,18 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x18; + v86.eax = fn << 8; + v86int(); + if (fn) + return (v86.ebx >> 8) & 0x01; + else + return v86.eax & 0xff; +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -792,15 +804,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x18; - v86.eax = fn << 8; - v86int(); - if (fn) - return (v86.ebx >> 8) & 0x01; - else - return v86.eax & 0xff; -} From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:13:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A971065678; Tue, 26 Jul 2011 13:13:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34CC18FC13; Tue, 26 Jul 2011 13:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDDW4J009658; Tue, 26 Jul 2011 13:13:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDDWJ8009656; Tue, 26 Jul 2011 13:13:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261313.p6QDDWJ8009656@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224429 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:13:32 -0000 Author: marius Date: Tue Jul 26 13:13:31 2011 New Revision: 224429 URL: http://svn.freebsd.org/changeset/base/224429 Log: MFC: r220685 MFi386: revisions 220389 and 220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224428) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224429) @@ -150,7 +150,7 @@ static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -779,6 +779,18 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x18; + v86.eax = fn << 8; + v86int(); + if (fn) + return (v86.ebx >> 8) & 0x01; + else + return v86.eax & 0xff; +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -792,15 +804,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x18; - v86.eax = fn << 8; - v86int(); - if (fn) - return (v86.ebx >> 8) & 0x01; - else - return v86.eax & 0xff; -} From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:19:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD87A1065677; Tue, 26 Jul 2011 13:19:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845EC8FC1B; Tue, 26 Jul 2011 13:19:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDJvqK009950; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDJvPR009948; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261319.p6QDJvPR009948@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224430 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:20:02 -0000 Author: marius Date: Tue Jul 26 13:19:57 2011 New Revision: 224430 URL: http://svn.freebsd.org/changeset/base/224430 Log: MFC: r214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Approved by: rpaulo (mentor) Reviewed by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224429) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224430) @@ -349,7 +349,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -386,7 +386,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:20:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFC8B106567B; Tue, 26 Jul 2011 13:19:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B50F8FC1D; Tue, 26 Jul 2011 13:19:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDJvYi009956; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDJvgC009952; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261319.p6QDJvgC009952@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224431 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:20:03 -0000 Author: marius Date: Tue Jul 26 13:19:57 2011 New Revision: 224431 URL: http://svn.freebsd.org/changeset/base/224431 Log: MFC: r214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Approved by: rpaulo (mentor) Reviewed by: jhb Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224430) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224431) @@ -349,7 +349,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -386,7 +386,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:22:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F32EF106566C; Tue, 26 Jul 2011 13:22:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C90E68FC0C; Tue, 26 Jul 2011 13:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDMCHl010116; Tue, 26 Jul 2011 13:22:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDMC2C010114; Tue, 26 Jul 2011 13:22:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261322.p6QDMC2C010114@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224432 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:22:13 -0000 Author: marius Date: Tue Jul 26 13:22:12 2011 New Revision: 224432 URL: http://svn.freebsd.org/changeset/base/224432 Log: MFC: r218745 Remove reading of symbols from a.out loaded files. Since we are tight on space for clang and a.out support is only needed for /boot/loader, they are excess bytes that serve no useful purpose other than to support really old kernels (FreeBSD < 3.2 or so). Prefer clang support over support for these old kernels and remove this code. We gain about 100 bytes of space this way. Reviewed by: rdivacky@ Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224431) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:12 2011 (r224432) @@ -347,23 +347,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -395,8 +378,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:22:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A97CC1065670; Tue, 26 Jul 2011 13:22:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3438FC14; Tue, 26 Jul 2011 13:22:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDMDDA010139; Tue, 26 Jul 2011 13:22:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDMD3O010137; Tue, 26 Jul 2011 13:22:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261322.p6QDMD3O010137@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224433 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:22:13 -0000 Author: marius Date: Tue Jul 26 13:22:13 2011 New Revision: 224433 URL: http://svn.freebsd.org/changeset/base/224433 Log: MFC: r218745 Remove reading of symbols from a.out loaded files. Since we are tight on space for clang and a.out support is only needed for /boot/loader, they are excess bytes that serve no useful purpose other than to support really old kernels (FreeBSD < 3.2 or so). Prefer clang support over support for these old kernels and remove this code. We gain about 100 bytes of space this way. Reviewed by: rdivacky@ Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:12 2011 (r224432) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:13 2011 (r224433) @@ -347,23 +347,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -395,8 +378,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:23:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E391065670; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 102BC8FC26; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDNPj1010268; Tue, 26 Jul 2011 13:23:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDNPK4010265; Tue, 26 Jul 2011 13:23:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261323.p6QDNPK4010265@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224434 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:23:26 -0000 Author: marius Date: Tue Jul 26 13:23:25 2011 New Revision: 224434 URL: http://svn.freebsd.org/changeset/base/224434 Log: MFC: r218926 In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable from uint16_t back to uint32_t. The actual option bitmasks (RB_* and RBX_*) assume at least a 32 bit variable. Submitted by: rdivacky Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:13 2011 (r224433) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:25 2011 (r224434) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint16_t opts; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:23:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FDBA1065673; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1FE8FC27; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDNQCf010282; Tue, 26 Jul 2011 13:23:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDNQQr010280; Tue, 26 Jul 2011 13:23:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261323.p6QDNQQr010280@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224435 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:23:26 -0000 Author: marius Date: Tue Jul 26 13:23:26 2011 New Revision: 224435 URL: http://svn.freebsd.org/changeset/base/224435 Log: MFC: r218926 In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable from uint16_t back to uint32_t. The actual option bitmasks (RB_* and RBX_*) assume at least a 32 bit variable. Submitted by: rdivacky Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:25 2011 (r224434) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:26 2011 (r224435) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint16_t opts; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:24:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B76106566C; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73B468FC13; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDOqox010414; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDOqKC010412; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261324.p6QDOqKC010412@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224436 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:24:52 -0000 Author: marius Date: Tue Jul 26 13:24:52 2011 New Revision: 224436 URL: http://svn.freebsd.org/changeset/base/224436 Log: MFC: r219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array thus avoiding a couple of memcpy()s. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5 so that constant propagation can take place. o It changes the ticks overflow computation as suggested by bde@. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from bootinfo as it is unused. Reviewed by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:26 2011 (r224435) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224436) @@ -131,11 +131,11 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -144,7 +144,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -182,15 +181,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} - static inline void getstr(void) { @@ -245,9 +235,6 @@ main(void) dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -271,11 +258,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -290,7 +277,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -474,11 +461,7 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } @@ -630,7 +613,7 @@ keyhit(unsigned ticks) t1 = *(uint32_t *)PTOV(0x46c); if (!t0) t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) + if ((uint32_t)(t1 - t0) >= ticks) return 0; } } From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:24:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E1A21065670; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C1F8FC14; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDOqxb010418; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDOqMN010416; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261324.p6QDOqMN010416@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224437 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:24:52 -0000 Author: marius Date: Tue Jul 26 13:24:52 2011 New Revision: 224437 URL: http://svn.freebsd.org/changeset/base/224437 Log: MFC: r219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array thus avoiding a couple of memcpy()s. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5 so that constant propagation can take place. o It changes the ticks overflow computation as suggested by bde@. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from bootinfo as it is unused. Reviewed by: jhb Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224436) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224437) @@ -131,11 +131,11 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -144,7 +144,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -182,15 +181,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} - static inline void getstr(void) { @@ -245,9 +235,6 @@ main(void) dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -271,11 +258,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -290,7 +277,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -474,11 +461,7 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } @@ -630,7 +613,7 @@ keyhit(unsigned ticks) t1 = *(uint32_t *)PTOV(0x46c); if (!t0) t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) + if ((uint32_t)(t1 - t0) >= ticks) return 0; } } From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:26:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E2CE106566B; Tue, 26 Jul 2011 13:26:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB9D8FC28; Tue, 26 Jul 2011 13:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDQlrt010547; Tue, 26 Jul 2011 13:26:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDQkWZ010544; Tue, 26 Jul 2011 13:26:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261326.p6QDQkWZ010544@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224438 - in stable/8/sys/boot: common i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:26:47 -0000 Author: marius Date: Tue Jul 26 13:26:46 2011 New Revision: 224438 URL: http://svn.freebsd.org/changeset/base/224438 Log: MFC: r219452 Some more shrinking. o bunch of variables are turned into uint8_t o initial setting of namep[] in lookup() is removed as it's only overwritten a few lines down o kname is explicitly initialized in main() as BSS in boot2 is not zeroed o the setting and reading of "fmt" in load() is removed o buf in printf() is made static to save space Reviewed by: jhb Tested by: me and Fabian Keil Modified: stable/8/sys/boot/common/ufsread.c stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Tue Jul 26 13:24:52 2011 (r224437) +++ stable/8/sys/boot/common/ufsread.c Tue Jul 26 13:26:46 2011 (r224438) @@ -88,7 +88,7 @@ static struct dmadat *dmadat; static ino_t lookup(const char *); static ssize_t fsread(ino_t, void *, size_t); -static int ls, dsk_meta; +static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t @@ -127,8 +127,6 @@ lookup(const char *path) ino = ROOTINO; dt = DT_DIR; - name[0] = '/'; - name[1] = '\0'; for (;;) { if (*path == '/') path++; Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224437) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:46 2011 (r224438) @@ -125,17 +125,17 @@ static struct dsk { unsigned drive; unsigned type; unsigned unit; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; int init; } dsk; static char cmd[512], cmddup[512]; -static const char *kname = NULL; +static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -226,6 +226,7 @@ main(void) uint8_t autoboot; ino_t ino; + kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -306,9 +307,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -317,15 +317,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -334,7 +327,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -366,7 +359,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -474,7 +471,8 @@ dskread(void *buf, unsigned lba, unsigne struct dos_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; if (!dsk_meta) { sec = dmadat->secbuf; @@ -534,7 +532,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:26:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96F51065670; Tue, 26 Jul 2011 13:26:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AED5A8FC16; Tue, 26 Jul 2011 13:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDQpV9010584; Tue, 26 Jul 2011 13:26:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDQp5K010581; Tue, 26 Jul 2011 13:26:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261326.p6QDQp5K010581@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224439 - in stable/7/sys/boot: common i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:26:52 -0000 Author: marius Date: Tue Jul 26 13:26:51 2011 New Revision: 224439 URL: http://svn.freebsd.org/changeset/base/224439 Log: MFC: r219452 Some more shrinking. o bunch of variables are turned into uint8_t o initial setting of namep[] in lookup() is removed as it's only overwritten a few lines down o kname is explicitly initialized in main() as BSS in boot2 is not zeroed o the setting and reading of "fmt" in load() is removed o buf in printf() is made static to save space Reviewed by: jhb Tested by: me and Fabian Keil Modified: stable/7/sys/boot/common/ufsread.c stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Tue Jul 26 13:26:46 2011 (r224438) +++ stable/7/sys/boot/common/ufsread.c Tue Jul 26 13:26:51 2011 (r224439) @@ -88,7 +88,7 @@ static struct dmadat *dmadat; static ino_t lookup(const char *); static ssize_t fsread(ino_t, void *, size_t); -static int ls, dsk_meta; +static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t @@ -127,8 +127,6 @@ lookup(const char *path) ino = ROOTINO; dt = DT_DIR; - name[0] = '/'; - name[1] = '\0'; for (;;) { if (*path == '/') path++; Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:46 2011 (r224438) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:51 2011 (r224439) @@ -125,17 +125,17 @@ static struct dsk { unsigned drive; unsigned type; unsigned unit; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; int init; } dsk; static char cmd[512], cmddup[512]; -static const char *kname = NULL; +static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -226,6 +226,7 @@ main(void) uint8_t autoboot; ino_t ino; + kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -306,9 +307,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -317,15 +317,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -334,7 +327,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -366,7 +359,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -474,7 +471,8 @@ dskread(void *buf, unsigned lba, unsigne struct dos_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; if (!dsk_meta) { sec = dmadat->secbuf; @@ -534,7 +532,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:29:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBF9D106564A; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2C88FC18; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDTBWZ010770; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDTBIv010768; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261329.p6QDTBIv010768@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224440 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:29:11 -0000 Author: marius Date: Tue Jul 26 13:29:11 2011 New Revision: 224440 URL: http://svn.freebsd.org/changeset/base/224440 Log: MFC: r220389, r220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Approved by: jhb Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:51 2011 (r224439) +++ stable/8/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224440) @@ -148,7 +148,7 @@ static int drvread(void *, unsigned, uns static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -627,6 +627,15 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -640,12 +649,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); -} From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:29:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FC51065674; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C04AB8FC19; Tue, 26 Jul 2011 13:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDTBw5010774; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDTBAi010772; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261329.p6QDTBAi010772@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224441 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:29:12 -0000 Author: marius Date: Tue Jul 26 13:29:11 2011 New Revision: 224441 URL: http://svn.freebsd.org/changeset/base/224441 Log: MFC: r220389, r220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Approved by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224440) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224441) @@ -148,7 +148,7 @@ static int drvread(void *, unsigned, uns static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -627,6 +627,15 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -640,12 +649,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); -} From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:41:53 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C5A0106566B; Tue, 26 Jul 2011 13:41:53 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id 5F47A8FC15; Tue, 26 Jul 2011 13:41:52 +0000 (UTC) Received: from mail-gw11.york.ac.uk ([144.32.129.150]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.8.2.32) by TLS id 1203548846 for adrian@FreeBSD.org; e1b884cc25bd50d1; Tue, 26 Jul 2011 14:31:01 +0100 Received: from buffy-128.york.ac.uk ([144.32.128.160]:31623 helo=buffy.york.ac.uk) by mail-gw11.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Qlhiu-0001Zj-HN; Tue, 26 Jul 2011 14:31:00 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id p6QDV0VL034342; Tue, 26 Jul 2011 14:31:00 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id p6QDUxB9034341; Tue, 26 Jul 2011 14:30:59 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Adrian Chadd In-Reply-To: <201107220939.p6M9dnsR008517@svn.freebsd.org> References: <201107220939.p6M9dnsR008517@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Tue, 26 Jul 2011 14:30:58 +0100 Message-ID: <1311687058.3848.44.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224267 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:41:53 -0000 On Fri, 2011-07-22 at 09:39 +0000, Adrian Chadd wrote: > Author: adrian > Date: Fri Jul 22 09:39:49 2011 > New Revision: 224267 > URL: http://svn.freebsd.org/changeset/base/224267 >=20 > Log: > Implement a basic radar parameter API in the dfs_null module. > =20 > Since no actual radar data is ever handled, this won't > do anything. It's mostly here as a reference for those who > wish to experiment with radar detection. >=20 > Modified: > head/sys/dev/ath/ath_dfs/null/dfs_null.c [...] > + indata =3D malloc(insize, M_TEMP, M_NOWAIT); > + if (indata =3D=3D NULL) { > + error =3D ENOMEM; > + goto bad; Here you return positive errors to indicate a failure... > + case DFS_SET_THRESH: > + if (insize < sizeof(HAL_PHYERR_PARAM)) { > + error =3D -EINVAL; > + break; > + } [...] > + default: > + error =3D -EINVAL; > + } [...] > + if (outdata && copyout(outdata, ad->ad_out_data, ad->ad_out_size)) > + error =3D -EFAULT; And for these, you return negative error values. Is this inconsistency intentional? Thanks, Gavin From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:58:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7831C106564A; Tue, 26 Jul 2011 13:58:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6731F8FC12; Tue, 26 Jul 2011 13:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDw8vg011733; Tue, 26 Jul 2011 13:58:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDw8xF011731; Tue, 26 Jul 2011 13:58:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261358.p6QDw8xF011731@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224442 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:58:08 -0000 Author: marius Date: Tue Jul 26 13:58:08 2011 New Revision: 224442 URL: http://svn.freebsd.org/changeset/base/224442 Log: MFC: r203059 Correct copy-paste typo from previous option description. Modified: stable/8/usr.sbin/makefs/makefs.8 Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 13:29:11 2011 (r224441) +++ stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:08 2011 (r224442) @@ -159,7 +159,7 @@ free files (inodes) exist in the image. An optional .Ql % suffix may be provided to indicate that -.Ar free-blocks +.Ar free-files indicates a percentage of the calculated image size .It Fl F Ar specfile Use From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 13:58:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 153E8106566B; Tue, 26 Jul 2011 13:58:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 045458FC13; Tue, 26 Jul 2011 13:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDw9t9011768; Tue, 26 Jul 2011 13:58:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDw9Gi011766; Tue, 26 Jul 2011 13:58:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261358.p6QDw9Gi011766@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224443 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:58:10 -0000 Author: marius Date: Tue Jul 26 13:58:09 2011 New Revision: 224443 URL: http://svn.freebsd.org/changeset/base/224443 Log: MFC: r203059 Correct copy-paste typo from previous option description. Modified: stable/7/usr.sbin/makefs/makefs.8 Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:08 2011 (r224442) +++ stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:09 2011 (r224443) @@ -159,7 +159,7 @@ free files (inodes) exist in the image. An optional .Ql % suffix may be provided to indicate that -.Ar free-blocks +.Ar free-files indicates a percentage of the calculated image size .It Fl F Ar specfile Use From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 14:03:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47CC106566C; Tue, 26 Jul 2011 14:03:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38958FC12; Tue, 26 Jul 2011 14:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QE3oP7012097; Tue, 26 Jul 2011 14:03:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QE3odO012095; Tue, 26 Jul 2011 14:03:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261403.p6QE3odO012095@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224444 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:03:50 -0000 Author: marius Date: Tue Jul 26 14:03:50 2011 New Revision: 224444 URL: http://svn.freebsd.org/changeset/base/224444 Log: MFC: r210933 (partial) Fix typos and spelling mistakes. Modified: stable/8/usr.sbin/makefs/makefs.8 Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:09 2011 (r224443) +++ stable/8/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:50 2011 (r224444) @@ -204,7 +204,7 @@ If isn't provided, the current file flags will be used. Missing regular file entries will be created as zero-length files. .It Fl x -Exclude file system nodes not explcitly listed in the specfile. +Exclude file system nodes not explicitly listed in the specfile. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 14:03:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFF9106564A; Tue, 26 Jul 2011 14:03:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1178FC08; Tue, 26 Jul 2011 14:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QE3rnG012133; Tue, 26 Jul 2011 14:03:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QE3rID012131; Tue, 26 Jul 2011 14:03:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261403.p6QE3rID012131@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224445 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:03:53 -0000 Author: marius Date: Tue Jul 26 14:03:52 2011 New Revision: 224445 URL: http://svn.freebsd.org/changeset/base/224445 Log: MFC: r210933 (partial) Fix typos and spelling mistakes. Modified: stable/7/usr.sbin/makefs/makefs.8 Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:50 2011 (r224444) +++ stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:52 2011 (r224445) @@ -204,7 +204,7 @@ If isn't provided, the current file flags will be used. Missing regular file entries will be created as zero-length files. .It Fl x -Exclude file system nodes not explcitly listed in the specfile. +Exclude file system nodes not explicitly listed in the specfile. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 14:41:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2E8106566C; Tue, 26 Jul 2011 14:41:28 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637008FC15; Tue, 26 Jul 2011 14:41:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QEfSmJ013488; Tue, 26 Jul 2011 14:41:28 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfSv4013486; Tue, 26 Jul 2011 14:41:28 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201107261441.p6QEfSv4013486@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 26 Jul 2011 14:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224446 - stable/8/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:28 -0000 Author: maxim Date: Tue Jul 26 14:41:28 2011 New Revision: 224446 URL: http://svn.freebsd.org/changeset/base/224446 Log: MFC rr215733,217577,219024,219308,221118,221319: sync with head. Modified: stable/8/share/misc/bsd-family-tree (contents, props changed) Modified: stable/8/share/misc/bsd-family-tree ============================================================================== --- stable/8/share/misc/bsd-family-tree Tue Jul 26 14:03:52 2011 (r224445) +++ stable/8/share/misc/bsd-family-tree Tue Jul 26 14:41:28 2011 (r224446) @@ -228,20 +228,25 @@ FreeBSD 5.2 | | | FreeBSD 7.1 | | | | | | | | | DragonFly 2.2.0 | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | - | \ | | | | - | | | | | DragonFly 2.4.0 - | | | | OpenBSD 4.6 | - | | | | | | - *--FreeBSD | | | | | - | 8.0 | | | | | - | | FreeBSD | | | | - | | 7.3 | | | DragonFly 2.6.0 - | | | | OpenBSD 4.7 | - | FreeBSD | | | | - | 8.1 | | | | - | | | | | DragonFly 2.8.0 - | | | | OpenBSD 4.8 | - | V | | | | + | \ | | | | | + | | Mac OS X | | | | + | | 10.6 | | | | + | | | | | | DragonFly 2.4.0 + | | | | | OpenBSD 4.6 | + | | | | | | | + *--FreeBSD | | | | | | + | 8.0 | | | | | | + | | FreeBSD | | | | | + | | 7.3 | | | | DragonFly 2.6.0 + | | | | | | OpenBSD 4.7 | + | FreeBSD | | | | | | + | 8.1 | | | | | | + | | | | | | | DragonFly 2.8.2 + | | | | | | OpenBSD 4.8 | + | | | | | NetBSD 5.1 | | + | FreeBSD FreeBSD | | | | + | 8.2 7.4 | | | DragonFly 2.10.1 + | v | | OpenBSD 4.9 | | | | | | FreeBSD 9 -current | NetBSD -current OpenBSD -current | | | | | | @@ -514,6 +519,7 @@ DragonFly 2.2.0 2009-02-17 [DFB] NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] +Mac OS X 10.6 2009-06-08 [APL] DragonFly 2.4.0 2009-09-16 [DFB] OpenBSD 4.6 2009-10-18 [OBD] FreeBSD 8.0 2009-11-26 [FBD] @@ -521,8 +527,13 @@ FreeBSD 7.3 2010-03-23 [FBD] DragonFly 2.6.0 2010-03-28 [DFB] OpenBSD 4.7 2010-05-19 [OBD] FreeBSD 8.1 2010-07-24 [FBD] -DragonFly 2.8.0 2010-10-30 [DFB] +DragonFly 2.8.2 2010-10-30 [DFB] OpenBSD 4.8 2010-11-01 [OBD] +NetBSD 5.1 2010-11-19 [NBD] +FreeBSD 7.4 2011-02-24 [FBD] +FreeBSD 8.2 2011-02-24 [FBD] +DragonFly 2.10.1 2011-04-26 [DFB] +OpenBSD 4.9 2011-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 14:41:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED521106564A; Tue, 26 Jul 2011 14:41:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA7D28FC13; Tue, 26 Jul 2011 14:41:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QEfs0J013579; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfsHK013563; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261441.p6QEfsHK013563@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224447 - in stable/8/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:55 -0000 Author: marius Date: Tue Jul 26 14:41:54 2011 New Revision: 224447 URL: http://svn.freebsd.org/changeset/base/224447 Log: MFC: r214921, r219954, r219956, r221387, r221470, r221536, r222191 - Sync with the latest version from NetBSD. It notably addds ISO9660 support. - Add support for synthesizing an APM partition map to map Mac PowerPC bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's ability to mount the CD, while allowing us a way to provide HFS-ified bootstrap code for Open Firmware. - Add analogs to the -chrp-boot and -prep-boot options to mkisofs. Added: stable/8/usr.sbin/makefs/cd9660/ - copied from r214921, head/usr.sbin/makefs/cd9660/ stable/8/usr.sbin/makefs/cd9660.c - copied, changed from r214921, head/usr.sbin/makefs/cd9660.c stable/8/usr.sbin/makefs/cd9660.h - copied, changed from r214921, head/usr.sbin/makefs/cd9660.h stable/8/usr.sbin/makefs/compat/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/compat/Makefile.inc stable/8/usr.sbin/makefs/ffs.h - copied unchanged from r214921, head/usr.sbin/makefs/ffs.h stable/8/usr.sbin/makefs/ffs/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/ffs/Makefile.inc Modified: stable/8/usr.sbin/makefs/Makefile stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/8/usr.sbin/makefs/cd9660/cd9660_strings.c stable/8/usr.sbin/makefs/ffs.c stable/8/usr.sbin/makefs/ffs/buf.c stable/8/usr.sbin/makefs/ffs/ffs_alloc.c stable/8/usr.sbin/makefs/ffs/mkfs.c stable/8/usr.sbin/makefs/makefs.8 stable/8/usr.sbin/makefs/makefs.c stable/8/usr.sbin/makefs/makefs.h stable/8/usr.sbin/makefs/walk.c Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/Makefile ============================================================================== --- stable/8/usr.sbin/makefs/Makefile Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224447) @@ -1,22 +1,23 @@ # $FreeBSD$ PROG= makefs + +CFLAGS+=-I${.CURDIR} + +SRCS= cd9660.c ffs.c \ + getid.c \ + makefs.c \ + walk.c MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I${.CURDIR} -SRCS= ffs.c getid.c makefs.c walk.c +.include "${.CURDIR}/cd9660/Makefile.inc" +.include "${.CURDIR}/ffs/Makefile.inc" +.include "${.CURDIR}/compat/Makefile.inc" -.PATH: ${.CURDIR}/ffs -CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c - -.PATH: ${.CURDIR}/compat -CFLAGS+=-I${.CURDIR}/compat -SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree CFLAGS+=-I${.CURDIR}/../mtree Copied and modified: stable/8/usr.sbin/makefs/cd9660.c (from r214921, head/usr.sbin/makefs/cd9660.c) ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/8/usr.sbin/makefs/cd9660.c Tue Jul 26 14:41:54 2011 (r224447) @@ -207,6 +207,7 @@ cd9660_set_defaults(void) diskStructure.rr_moved_dir = 0; diskStructure.archimedes_enabled = 0; + diskStructure.chrp_boot = 0; diskStructure.include_padding_areas = 1; @@ -391,6 +392,8 @@ cd9660_parse_opts(const char *option, fs diskStructure.rock_ridge_enabled = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) diskStructure.archimedes_enabled = 1; + else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) + diskStructure.chrp_boot = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) diskStructure.keep_bad_images = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) Copied and modified: stable/8/usr.sbin/makefs/cd9660.h (from r214921, head/usr.sbin/makefs/cd9660.h) ============================================================================== --- head/usr.sbin/makefs/cd9660.h Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/8/usr.sbin/makefs/cd9660.h Tue Jul 26 14:41:54 2011 (r224447) @@ -285,6 +285,7 @@ typedef struct _iso9660_disk { cd9660node *rr_moved_dir; int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ u_char allow_deep_trees; Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c Tue Jul 26 14:41:54 2011 (r224447) @@ -31,6 +31,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ + +#include + #include "cd9660.h" #include "cd9660_eltorito.h" @@ -497,11 +500,79 @@ cd9660_setup_boot_volume_descriptor(volu return 1; } +static int +cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, + off_t nsectors, int type) +{ + uint8_t val; + uint32_t lba; + + fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + + val = 0x80; /* Bootable */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS begin */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + val = type; /* Part type */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS end */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + /* LBA extent */ + lba = htole32(sector_start); + fwrite(&lba, sizeof(lba), 1, fd); + lba = htole32(nsectors); + fwrite(&lba, sizeof(lba), 1, fd); + + return (0); +} + +static int +cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, + off_t sector_start, off_t nsectors, off_t sector_size, + const char *part_name, const char *part_type) +{ + uint32_t apm32; + uint16_t apm16; + + fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + + /* Signature */ + apm16 = htobe16(0x504d); + fwrite(&apm16, sizeof(apm16), 1, fd); + apm16 = 0; + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Total number of partitions */ + apm32 = htobe32(total_partitions); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Bounds */ + apm32 = htobe32(sector_start); + fwrite(&apm32, sizeof(apm32), 1, fd); + apm32 = htobe32(nsectors); + fwrite(&apm32, sizeof(apm32), 1, fd); + + fwrite(part_name, strlen(part_name) + 1, 1, fd); + fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR); + fwrite(part_type, strlen(part_type) + 1, 1, fd); + + return 0; +} + int cd9660_write_boot(FILE *fd) { struct boot_catalog_entry *e; struct cd9660_boot_image *t; + int apm_partitions = 0; + int mbr_partitions = 0; /* write boot catalog */ if (fseeko(fd, (off_t)diskStructure.boot_catalog_sector * @@ -533,7 +604,88 @@ cd9660_write_boot(FILE *fd) t->filename, t->sector); } cd9660_copy_file(fd, t->sector, t->filename); + + if (t->system == ET_SYS_MAC) + apm_partitions++; + if (t->system == ET_SYS_PPC) + mbr_partitions++; + } + + /* some systems need partition tables as well */ + if (mbr_partitions > 0 || diskStructure.chrp_boot) { + uint16_t sig; + + fseek(fd, 0x1fe, SEEK_SET); + sig = htole16(0xaa55); + fwrite(&sig, sizeof(sig), 1, fd); + + mbr_partitions = 0; + + /* Write ISO9660 descriptor, enclosing the whole disk */ + if (diskStructure.chrp_boot) + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + 0, diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 0x96); + + /* Write all partition entries */ + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_PPC) + continue; + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 0x41 /* PReP Boot */); + } + } + + if (apm_partitions > 0) { + /* Write DDR and global APM info */ + uint32_t apm32; + uint16_t apm16; + int total_parts; + + fseek(fd, 0, SEEK_SET); + apm16 = htobe16(0x4552); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block size */ + apm16 = htobe16(512); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block count */ + apm32 = htobe32(diskStructure.totalSectors * + (diskStructure.sectorSize / 512)); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Device type/id */ + apm16 = htobe16(1); + fwrite(&apm16, sizeof(apm16), 1, fd); + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Count total needed entries */ + total_parts = 2 + apm_partitions; /* Self + ISO9660 */ + + /* Write self-descriptor */ + cd9660_write_apm_partition_entry(fd, 0, total_parts, 1, + total_parts, 512, "Apple", "Apple_partition_map"); + + /* Write ISO9660 descriptor, enclosing the whole disk */ + cd9660_write_apm_partition_entry(fd, 1, total_parts, 0, + diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 512, "ISO9660", + "CD_ROM_Mode_1"); + + /* Write all partition entries */ + apm_partitions = 0; + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_MAC) + continue; + + cd9660_write_apm_partition_entry(fd, + 2 + apm_partitions++, total_parts, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 512, "CD Boot", "Apple_Bootstrap"); + } } return 0; } + Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_strings.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_strings.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_strings.c Tue Jul 26 14:41:54 2011 (r224447) @@ -55,19 +55,19 @@ cd9660_uppercase_characters(char *str, i } static inline int -cd9660_is_a_char(char c) +cd9660_is_d_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '0' && c <= '?')); + || (c >= '0' && c <= '9')); } static inline int -cd9660_is_d_char(char c) +cd9660_is_a_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '%' && c <= '9') + || (c >= '%' && c <= '?') || (c >= ' ' && c <= '\"')); } Copied: stable/8/usr.sbin/makefs/compat/Makefile.inc (from r214921, head/usr.sbin/makefs/compat/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/makefs/compat/Makefile.inc Tue Jul 26 14:41:54 2011 (r224447, copy of r214921, head/usr.sbin/makefs/compat/Makefile.inc) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/compat + +CFLAGS+= -I${.CURDIR}/compat + +SRCS+= pwcache.c strsuftoll.c Modified: stable/8/usr.sbin/makefs/ffs.c ============================================================================== --- stable/8/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224447) @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -76,17 +76,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include "makefs.h" +#include "ffs.h" + +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS +#include +#endif #include #include #include + #include "ffs/ufs_bswap.h" #include "ffs/ufs_inode.h" #include "ffs/newfs_extern.h" @@ -94,7 +101,7 @@ __FBSDID("$FreeBSD$"); #undef DIP #define DIP(dp, field) \ - ((fsopts->version == 1) ? \ + ((ffs_opts->version == 1) ? \ (dp)->ffs1_din.di_##field : (dp)->ffs2_din.di_##field) /* @@ -139,39 +146,71 @@ int sectorsize; /* XXX: for buf.c::getb /* publically visible functions */ +void +ffs_prep_opts(fsinfo_t *fsopts) +{ + ffs_opt_t *ffs_opts; + + if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) + err(1, "Allocating memory for ffs_options"); + + fsopts->fs_specific = ffs_opts; + + ffs_opts->bsize= -1; + ffs_opts->fsize= -1; + ffs_opts->cpg= -1; + ffs_opts->density= -1; + ffs_opts->minfree= -1; + ffs_opts->optimization= -1; + ffs_opts->maxcontig= -1; + ffs_opts->maxbpg= -1; + ffs_opts->avgfilesize= -1; + ffs_opts->avgfpdir= -1; + ffs_opts->version = 1; +} + +void +ffs_cleanup_opts(fsinfo_t *fsopts) +{ + if (fsopts->fs_specific) + free(fsopts->fs_specific); +} + int ffs_parse_opts(const char *option, fsinfo_t *fsopts) { + ffs_opt_t *ffs_opts = fsopts->fs_specific; + option_t ffs_options[] = { - { "bsize", &fsopts->bsize, 1, INT_MAX, + { "bsize", &ffs_opts->bsize, 1, INT_MAX, "block size" }, - { "fsize", &fsopts->fsize, 1, INT_MAX, + { "fsize", &ffs_opts->fsize, 1, INT_MAX, "fragment size" }, - { "density", &fsopts->density, 1, INT_MAX, + { "density", &ffs_opts->density, 1, INT_MAX, "bytes per inode" }, - { "minfree", &fsopts->minfree, 0, 99, + { "minfree", &ffs_opts->minfree, 0, 99, "minfree" }, - { "maxbpf", &fsopts->maxbpg, 1, INT_MAX, + { "maxbpf", &ffs_opts->maxbpg, 1, INT_MAX, "max blocks per file in a cg" }, - { "avgfilesize", &fsopts->avgfilesize, 1, INT_MAX, + { "avgfilesize", &ffs_opts->avgfilesize,1, INT_MAX, "expected average file size" }, - { "avgfpdir", &fsopts->avgfpdir, 1, INT_MAX, + { "avgfpdir", &ffs_opts->avgfpdir, 1, INT_MAX, "expected # of files per directory" }, - { "extent", &fsopts->maxbsize, 1, INT_MAX, + { "extent", &ffs_opts->maxbsize, 1, INT_MAX, "maximum # extent size" }, - { "maxbpcg", &fsopts->maxblkspercg, 1, INT_MAX, + { "maxbpcg", &ffs_opts->maxblkspercg,1, INT_MAX, "max # of blocks per group" }, - { "version", &fsopts->version, 1, 2, + { "version", &ffs_opts->version, 1, 2, "UFS version" }, - { NULL } + { .name = NULL } }; char *var, *val; int rv; - (void)&ffs_options; assert(option != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_PARSE_OPTS) printf("ffs_parse_opts: got `%s'\n", option); @@ -188,9 +227,9 @@ ffs_parse_opts(const char *option, fsinf if (strcmp(var, "optimization") == 0) { if (strcmp(val, "time") == 0) { - fsopts->optimization = FS_OPTTIME; + ffs_opts->optimization = FS_OPTTIME; } else if (strcmp(val, "space") == 0) { - fsopts->optimization = FS_OPTSPACE; + ffs_opts->optimization = FS_OPTSPACE; } else { warnx("Invalid optimization `%s'", val); goto leave_ffs_parse_opts; @@ -277,11 +316,12 @@ ffs_validate(const char *dir, fsnode *ro #if notyet int32_t spc, nspf, ncyl, fssize; #endif - off_t size; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: before defaults set:\n"); @@ -291,31 +331,31 @@ ffs_validate(const char *dir, fsnode *ro /* set FFS defaults */ if (fsopts->sectorsize == -1) fsopts->sectorsize = DFL_SECSIZE; - if (fsopts->fsize == -1) - fsopts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); - if (fsopts->bsize == -1) - fsopts->bsize = MIN(DFL_BLKSIZE, 8 * fsopts->fsize); - if (fsopts->cpg == -1) - fsopts->cpg = DFL_CYLSPERGROUP; + if (ffs_opts->fsize == -1) + ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); + if (ffs_opts->bsize == -1) + ffs_opts->bsize = MIN(DFL_BLKSIZE, 8 * ffs_opts->fsize); + if (ffs_opts->cpg == -1) + ffs_opts->cpg = DFL_CYLSPERGROUP; else - fsopts->cpgflg = 1; + ffs_opts->cpgflg = 1; /* fsopts->density is set below */ - if (fsopts->nsectors == -1) - fsopts->nsectors = DFL_NSECTORS; - if (fsopts->minfree == -1) - fsopts->minfree = MINFREE; - if (fsopts->optimization == -1) - fsopts->optimization = DEFAULTOPT; - if (fsopts->maxcontig == -1) - fsopts->maxcontig = - MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / fsopts->bsize); + if (ffs_opts->nsectors == -1) + ffs_opts->nsectors = DFL_NSECTORS; + if (ffs_opts->minfree == -1) + ffs_opts->minfree = MINFREE; + if (ffs_opts->optimization == -1) + ffs_opts->optimization = DEFAULTOPT; + if (ffs_opts->maxcontig == -1) + ffs_opts->maxcontig = + MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / ffs_opts->bsize); /* XXX ondisk32 */ - if (fsopts->maxbpg == -1) - fsopts->maxbpg = fsopts->bsize / sizeof(int32_t); - if (fsopts->avgfilesize == -1) - fsopts->avgfilesize = AVFILESIZ; - if (fsopts->avgfpdir == -1) - fsopts->avgfpdir = AFPDIR; + if (ffs_opts->maxbpg == -1) + ffs_opts->maxbpg = ffs_opts->bsize / sizeof(int32_t); + if (ffs_opts->avgfilesize == -1) + ffs_opts->avgfilesize = AVFILESIZ; + if (ffs_opts->avgfpdir == -1) + ffs_opts->avgfpdir = AFPDIR; /* calculate size of tree */ ffs_size_dir(root, fsopts); @@ -343,17 +383,19 @@ ffs_validate(const char *dir, fsnode *ro */ fsopts->size += (SBLOCK_UFS1 + SBLOCKSIZE) * ncg; /* add space needed to store inodes, x3 for blockmaps, etc */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) fsopts->size += ncg * DINODE1_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE1_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE1_SIZE); else fsopts->size += ncg * DINODE2_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE2_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE2_SIZE); /* add minfree */ - if (fsopts->minfree > 0) + if (ffs_opts->minfree > 0) fsopts->size = - fsopts->size * (100 + fsopts->minfree) / 100; + fsopts->size * (100 + ffs_opts->minfree) / 100; /* * XXX any other fs slop to add, such as csum's, bitmaps, etc ?? */ @@ -362,24 +404,11 @@ ffs_validate(const char *dir, fsnode *ro fsopts->size = fsopts->minsize; /* round up to the next block */ - size = roundup(fsopts->size, fsopts->bsize); - - /* now check calculated sizes vs requested sizes */ - if (fsopts->maxsize > 0 && size > fsopts->maxsize) { - if (debug & DEBUG_FS_VALIDATE) { - printf("%s: `%s' size of %lld is larger than the " - "maxsize of %lld; rounding down to %lld.", - __func__, dir, (long long)size, - (long long)fsopts->maxsize, - (long long) rounddown(fsopts->size, fsopts->bsize)); - } - size = rounddown(fsopts->size, fsopts->bsize); - } - fsopts->size = size; + fsopts->size = roundup(fsopts->size, ffs_opts->bsize); /* calculate density if necessary */ - if (fsopts->density == -1) - fsopts->density = fsopts->size / fsopts->inodes + 1; + if (ffs_opts->density == -1) + ffs_opts->density = fsopts->size / fsopts->inodes + 1; if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: after defaults set:\n"); @@ -388,6 +417,12 @@ ffs_validate(const char *dir, fsnode *ro dir, (long long)fsopts->size, (long long)fsopts->inodes); } sectorsize = fsopts->sectorsize; /* XXX - see earlier */ + + /* now check calculated sizes vs requested sizes */ + if (fsopts->maxsize > 0 && fsopts->size > fsopts->maxsize) { + errx(1, "`%s' size of %lld is larger than the maxsize of %lld.", + dir, (long long)fsopts->size, (long long)fsopts->maxsize); + } } @@ -395,6 +430,8 @@ static void ffs_dump_fsinfo(fsinfo_t *f) { + ffs_opt_t *fs = f->fs_specific; + printf("fsopts at %p\n", f); printf("\tsize %lld, inodes %lld, curinode %u\n", @@ -409,20 +446,20 @@ ffs_dump_fsinfo(fsinfo_t *f) printf("\tneedswap %d, sectorsize %d\n", f->needswap, f->sectorsize); printf("\tbsize %d, fsize %d, cpg %d, density %d\n", - f->bsize, f->fsize, f->cpg, f->density); + fs->bsize, fs->fsize, fs->cpg, fs->density); printf("\tnsectors %d, rpm %d, minfree %d\n", - f->nsectors, f->rpm, f->minfree); + fs->nsectors, fs->rpm, fs->minfree); printf("\tmaxcontig %d, maxbpg %d\n", - f->maxcontig, f->maxbpg); + fs->maxcontig, fs->maxbpg); printf("\toptimization %s\n", - f->optimization == FS_OPTSPACE ? "space" : "time"); + fs->optimization == FS_OPTSPACE ? "space" : "time"); } static int ffs_create_image(const char *image, fsinfo_t *fsopts) { -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS struct statvfs sfs; #endif struct fs *fs; @@ -434,18 +471,18 @@ ffs_create_image(const char *image, fsin assert (fsopts != NULL); /* create image */ - if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0777)) + if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) { warn("Can't open `%s' for writing", image); return (-1); } /* zero image */ -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS if (fstatvfs(fsopts->fd, &sfs) == -1) { #endif bufsize = 8192; -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS warn("can't fstatvfs `%s', using default %d byte chunk", image, bufsize); } else @@ -465,10 +502,12 @@ ffs_create_image(const char *image, fsin if (i == -1) { warn("zeroing image, %lld bytes to go", (long long)bufrem); + free(buf); return (-1); } bufrem -= i; } + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) @@ -492,7 +531,7 @@ ffs_create_image(const char *image, fsin warnx( "Image file `%s' has %lld free inodes; %lld are required.", image, - (long long)fs->fs_cstotal.cs_nifree + ROOTINO, + (long long)(fs->fs_cstotal.cs_nifree + ROOTINO), (long long)fsopts->inodes); return (-1); } @@ -506,9 +545,11 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso struct direct tmpdir; fsnode * node; int curdirsize, this; + ffs_opt_t *ffs_opts = fsopts->fs_specific; /* node may be NULL (empty directory) */ assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_SIZE_DIR) printf("ffs_size_dir: entry: bytes %lld inodes %lld\n", @@ -516,7 +557,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso #define ADDDIRENT(e) do { \ tmpdir.d_namlen = strlen((e)); \ - this = DIRSIZ_SWAP(0, &tmpdir, 0); \ + this = DIRSIZ_SWAP(0, &tmpdir, 0); \ if (debug & DEBUG_FS_SIZE_DIR_ADD_DIRENT) \ printf("ADDDIRENT: was: %s (%d) this %d cur %d\n", \ e, tmpdir.d_namlen, this, curdirsize); \ @@ -533,14 +574,12 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso * by indirect blocks, etc. */ #define ADDSIZE(x) do { \ - fsopts->size += roundup((x), fsopts->fsize); \ + fsopts->size += roundup((x), ffs_opts->fsize); \ } while (0); curdirsize = 0; for (node = root; node != NULL; node = node->next) { ADDDIRENT(node->name); - if (FSNODE_EXCLUDE_P(fsopts, node)) - continue; if (node == root) { /* we're at "." */ assert(strcmp(node->name, ".") == 0); ADDDIRENT(".."); @@ -558,7 +597,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso int slen; slen = strlen(node->symlink) + 1; - if (slen >= (fsopts->version == 1 ? + if (slen >= (ffs_opts->version == 1 ? MAXSYMLINKLEN_UFS1 : MAXSYMLINKLEN_UFS2)) ADDSIZE(slen); @@ -682,10 +721,12 @@ ffs_populate_dir(const char *dir, fsnode union dinode din; void *membuf; char path[MAXPATHLEN + 1]; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); (void)memset(&dirbuf, 0, sizeof(dirbuf)); @@ -696,8 +737,6 @@ ffs_populate_dir(const char *dir, fsnode * pass 1: allocate inode numbers, build directory `file' */ for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if ((cur->inode->flags & FI_ALLOCATED) == 0) { cur->inode->flags |= FI_ALLOCATED; if (cur == root && cur->parent != NULL) @@ -732,8 +771,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 2 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->inode->flags & FI_WRITTEN) continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; @@ -746,7 +783,7 @@ ffs_populate_dir(const char *dir, fsnode continue; /* child creates own inode */ /* build on-disk inode */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) membuf = ffs_build_dinode1(&din.ffs1_din, &dirbuf, cur, root, fsopts); else @@ -777,8 +814,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 3 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->child == NULL) continue; if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) @@ -804,16 +839,20 @@ ffs_write_file(union dinode *din, uint32 int isfile, ffd; char *fbuf, *p; off_t bufleft, chunk, offset; + ssize_t nread; struct inode in; struct buf * bp; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (din != NULL); assert (buf != NULL); assert (fsopts != NULL); + assert (ffs_opts != NULL); isfile = S_ISREG(DIP(din, mode)); fbuf = NULL; ffd = -1; + p = NULL; in.i_fs = (struct fs *)fsopts->superblock; @@ -830,7 +869,7 @@ ffs_write_file(union dinode *din, uint32 in.i_number = ino; in.i_size = DIP(din, size); - if (fsopts->version == 1) + if (ffs_opts->version == 1) memcpy(&in.i_din.ffs1_din, &din->ffs1_din, sizeof(in.i_din.ffs1_din)); else @@ -842,7 +881,7 @@ ffs_write_file(union dinode *din, uint32 goto write_inode_and_leave; /* mmm, cheating */ if (isfile) { - if ((fbuf = malloc(fsopts->bsize)) == NULL) + if ((fbuf = malloc(ffs_opts->bsize)) == NULL) err(1, "Allocating memory for write buffer"); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { warn("Can't open `%s' for reading", (char *)buf); @@ -854,13 +893,20 @@ ffs_write_file(union dinode *din, uint32 chunk = 0; for (bufleft = DIP(din, size); bufleft > 0; bufleft -= chunk) { - chunk = MIN(bufleft, fsopts->bsize); - if (isfile) { - if (read(ffd, fbuf, chunk) != chunk) - err(1, "Reading `%s', %lld bytes to go", - (char *)buf, (long long)bufleft); + chunk = MIN(bufleft, ffs_opts->bsize); + if (!isfile) + ; + else if ((nread = read(ffd, fbuf, chunk)) == -1) + err(EXIT_FAILURE, "Reading `%s', %lld bytes to go", + (char *)buf, (long long)bufleft); + else if (nread != chunk) + errx(EXIT_FAILURE, "Reading `%s', %lld bytes to go, " + "read %zd bytes, expected %ju bytes, does " + "metalog size= attribute mismatch source size?", + (char *)buf, (long long)bufleft, nread, + (uintmax_t)chunk); + else p = fbuf; - } offset = DIP(din, size) - bufleft; if (debug & DEBUG_FS_WRITE_FILE_BLOCK) printf( @@ -932,7 +978,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch { struct direct de, *dp; uint16_t llen, reclen; - char *newbuf; + u_char *newbuf; assert (dbuf != NULL); assert (name != NULL); @@ -969,7 +1015,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch dbuf->size += DIRBLKSIZ; memset(dbuf->buf + dbuf->size - DIRBLKSIZ, 0, DIRBLKSIZ); dbuf->cur = dbuf->size - DIRBLKSIZ; - } else { /* shrink end of previous */ + } else if (dp) { /* shrink end of previous */ dp->d_reclen = ufs_rw16(llen,needswap); dbuf->cur += llen; } @@ -993,10 +1039,12 @@ ffs_write_inode(union dinode *dp, uint32 daddr_t d; char sbbuf[FFS_MAXBSIZE]; int32_t initediblk; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (dp != NULL); assert (ino > 0); assert (fsopts != NULL); + assert (ffs_opts != NULL); fs = (struct fs *)fsopts->superblock; cg = ino_to_cg(fs, ino); @@ -1041,7 +1089,7 @@ ffs_write_inode(union dinode *dp, uint32 * Initialize inode blocks on the fly for UFS2. */ initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap); - if (fsopts->version == 2 && cgino + INOPB(fs) > initediblk && + if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk && initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; @@ -1065,14 +1113,14 @@ ffs_write_inode(union dinode *dp, uint32 d = fsbtodb(fs, ino_to_fsba(fs, ino)); ffs_rdfs(d, fs->fs_bsize, buf, fsopts); if (fsopts->needswap) { - if (fsopts->version == 1) + if (ffs_opts->version == 1) ffs_dinode1_swap(&dp->ffs1_din, &dp1[ino_to_fsbo(fs, ino)]); else ffs_dinode2_swap(&dp->ffs2_din, &dp2[ino_to_fsbo(fs, ino)]); } else { - if (fsopts->version == 1) + if (ffs_opts->version == 1) dp1[ino_to_fsbo(fs, ino)] = dp->ffs1_din; else dp2[ino_to_fsbo(fs, ino)] = dp->ffs2_din; Copied: stable/8/usr.sbin/makefs/ffs.h (from r214921, head/usr.sbin/makefs/ffs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/makefs/ffs.h Tue Jul 26 14:41:54 2011 (r224447, copy of r214921, head/usr.sbin/makefs/ffs.h) @@ -0,0 +1,66 @@ +/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */ + +/* + * Copyright (c) 2001-2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Luke Mewburn for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * 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$ + */ + +#ifndef _FFS_H +#define _FFS_H + +typedef struct { + int bsize; /* block size */ + int fsize; /* fragment size */ + int cpg; /* cylinders per group */ + int cpgflg; /* cpg was specified by user */ + int density; /* bytes per inode */ + int ntracks; /* number of tracks */ + int nsectors; /* number of sectors */ + int rpm; /* rpm */ + int minfree; /* free space threshold */ + int optimization; /* optimization (space or time) */ + int maxcontig; /* max contiguous blocks to allocate */ + int rotdelay; /* rotational delay between blocks */ + int maxbpg; /* maximum blocks per file in a cyl group */ + int nrpos; /* # of distinguished rotational positions */ + int avgfilesize; /* expected average file size */ + int avgfpdir; /* expected # of files per directory */ + int version; /* filesystem version (1 = FFS, 2 = UFS2) */ + int maxbsize; /* maximum extent size */ + int maxblkspercg; /* max # of blocks per cylinder group */ + /* XXX: support `old' file systems ? */ +} ffs_opt_t; + +#endif /* _FFS_H */ Copied: stable/8/usr.sbin/makefs/ffs/Makefile.inc (from r214921, head/usr.sbin/makefs/ffs/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/makefs/ffs/Makefile.inc Tue Jul 26 14:41:54 2011 (r224447, copy of r214921, head/usr.sbin/makefs/ffs/Makefile.inc) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/ffs ${.CURDIR}/../../sys/ufs/ffs + +CFLAGS+= -I${.CURDIR}/../../sys/ufs/ffs + +SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c +SRCS+= buf.c mkfs.c Modified: stable/8/usr.sbin/makefs/ffs/buf.c ============================================================================== --- stable/8/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224447) @@ -118,7 +118,7 @@ brelse(struct buf *bp) bp->b_bcount = 0; return; } - + TAILQ_REMOVE(&buftail, bp, b_tailq); free(bp->b_data); free(bp); @@ -160,7 +160,7 @@ bcleanup(void) * know why there's still some buffers lying around that * aren't brelse()d */ - + if (TAILQ_EMPTY(&buftail)) return; @@ -201,7 +201,7 @@ getblk(int fd, struct fs *fs, daddr_t bl if (bp == NULL) { if ((bp = calloc(1, sizeof(struct buf))) == NULL) err(1, "getblk: calloc"); - + bp->b_bufsize = 0; bp->b_blkno = bp->b_lblkno = blkno; bp->b_fd = fd; Modified: stable/8/usr.sbin/makefs/ffs/ffs_alloc.c ============================================================================== --- stable/8/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:28 2011 (r224446) +++ stable/8/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224447) @@ -87,7 +87,7 @@ static int32_t ffs_mapsearch(struct fs * * available block is located. */ int -ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, +ffs_alloc(struct inode *ip, daddr_t lbn __unused, daddr_t bpref, int size, daddr_t *bnp) { struct fs *fs = ip->i_fs; @@ -95,7 +95,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, int cg; *bnp = 0; - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if (size > fs->fs_bsize || fragoff(fs, size) != 0) { errx(1, "ffs_alloc: bad size: bsize %d size %d", fs->fs_bsize, size); } @@ -187,11 +187,7 @@ ffs_blkpref_ufs1(struct inode *ip, daddr } daddr_t -ffs_blkpref_ufs2(ip, lbn, indx, bap) - struct inode *ip; - daddr_t lbn; - int indx; - int64_t *bap; +ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) { struct fs *fs; int cg; @@ -385,11 +381,11 @@ ffs_alloccgblk(struct inode *ip, struct int32_t bno; struct fs *fs = ip->i_fs; const int needswap = UFS_FSNEEDSWAP(fs); - u_int8_t *blksfree; + u_int8_t *blksfree_swap; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 14:41:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C00106566B; Tue, 26 Jul 2011 14:41:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04C1E8FC1C; Tue, 26 Jul 2011 14:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QEftV9013593; Tue, 26 Jul 2011 14:41:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfsuF013575; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261441.p6QEfsuF013575@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224448 - in stable/7/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:55 -0000 Author: marius Date: Tue Jul 26 14:41:54 2011 New Revision: 224448 URL: http://svn.freebsd.org/changeset/base/224448 Log: MFC: r214921, r219954, r219956, r221387, r221470, r221536, r222191 - Sync with the latest version from NetBSD. It notably addds ISO9660 support. - Add support for synthesizing an APM partition map to map Mac PowerPC bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's ability to mount the CD, while allowing us a way to provide HFS-ified bootstrap code for Open Firmware. - Add analogs to the -chrp-boot and -prep-boot options to mkisofs. Added: stable/7/usr.sbin/makefs/cd9660/ - copied from r214921, head/usr.sbin/makefs/cd9660/ stable/7/usr.sbin/makefs/cd9660.c - copied, changed from r214921, head/usr.sbin/makefs/cd9660.c stable/7/usr.sbin/makefs/cd9660.h - copied, changed from r214921, head/usr.sbin/makefs/cd9660.h stable/7/usr.sbin/makefs/compat/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/compat/Makefile.inc stable/7/usr.sbin/makefs/ffs.h - copied unchanged from r214921, head/usr.sbin/makefs/ffs.h stable/7/usr.sbin/makefs/ffs/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/ffs/Makefile.inc Modified: stable/7/usr.sbin/makefs/Makefile stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c stable/7/usr.sbin/makefs/ffs.c stable/7/usr.sbin/makefs/ffs/buf.c stable/7/usr.sbin/makefs/ffs/ffs_alloc.c stable/7/usr.sbin/makefs/ffs/mkfs.c stable/7/usr.sbin/makefs/makefs.8 stable/7/usr.sbin/makefs/makefs.c stable/7/usr.sbin/makefs/makefs.h stable/7/usr.sbin/makefs/walk.c Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/Makefile ============================================================================== --- stable/7/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224448) @@ -1,22 +1,23 @@ # $FreeBSD$ PROG= makefs + +CFLAGS+=-I${.CURDIR} + +SRCS= cd9660.c ffs.c \ + getid.c \ + makefs.c \ + walk.c MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I${.CURDIR} -SRCS= ffs.c getid.c makefs.c walk.c +.include "${.CURDIR}/cd9660/Makefile.inc" +.include "${.CURDIR}/ffs/Makefile.inc" +.include "${.CURDIR}/compat/Makefile.inc" -.PATH: ${.CURDIR}/ffs -CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c - -.PATH: ${.CURDIR}/compat -CFLAGS+=-I${.CURDIR}/compat -SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree CFLAGS+=-I${.CURDIR}/../mtree Copied and modified: stable/7/usr.sbin/makefs/cd9660.c (from r214921, head/usr.sbin/makefs/cd9660.c) ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/7/usr.sbin/makefs/cd9660.c Tue Jul 26 14:41:54 2011 (r224448) @@ -207,6 +207,7 @@ cd9660_set_defaults(void) diskStructure.rr_moved_dir = 0; diskStructure.archimedes_enabled = 0; + diskStructure.chrp_boot = 0; diskStructure.include_padding_areas = 1; @@ -391,6 +392,8 @@ cd9660_parse_opts(const char *option, fs diskStructure.rock_ridge_enabled = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) diskStructure.archimedes_enabled = 1; + else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) + diskStructure.chrp_boot = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) diskStructure.keep_bad_images = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) Copied and modified: stable/7/usr.sbin/makefs/cd9660.h (from r214921, head/usr.sbin/makefs/cd9660.h) ============================================================================== --- head/usr.sbin/makefs/cd9660.h Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/7/usr.sbin/makefs/cd9660.h Tue Jul 26 14:41:54 2011 (r224448) @@ -285,6 +285,7 @@ typedef struct _iso9660_disk { cd9660node *rr_moved_dir; int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ u_char allow_deep_trees; Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c Tue Jul 26 14:41:54 2011 (r224448) @@ -31,6 +31,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ + +#include + #include "cd9660.h" #include "cd9660_eltorito.h" @@ -497,11 +500,79 @@ cd9660_setup_boot_volume_descriptor(volu return 1; } +static int +cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, + off_t nsectors, int type) +{ + uint8_t val; + uint32_t lba; + + fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + + val = 0x80; /* Bootable */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS begin */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + val = type; /* Part type */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS end */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + /* LBA extent */ + lba = htole32(sector_start); + fwrite(&lba, sizeof(lba), 1, fd); + lba = htole32(nsectors); + fwrite(&lba, sizeof(lba), 1, fd); + + return (0); +} + +static int +cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, + off_t sector_start, off_t nsectors, off_t sector_size, + const char *part_name, const char *part_type) +{ + uint32_t apm32; + uint16_t apm16; + + fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + + /* Signature */ + apm16 = htobe16(0x504d); + fwrite(&apm16, sizeof(apm16), 1, fd); + apm16 = 0; + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Total number of partitions */ + apm32 = htobe32(total_partitions); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Bounds */ + apm32 = htobe32(sector_start); + fwrite(&apm32, sizeof(apm32), 1, fd); + apm32 = htobe32(nsectors); + fwrite(&apm32, sizeof(apm32), 1, fd); + + fwrite(part_name, strlen(part_name) + 1, 1, fd); + fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR); + fwrite(part_type, strlen(part_type) + 1, 1, fd); + + return 0; +} + int cd9660_write_boot(FILE *fd) { struct boot_catalog_entry *e; struct cd9660_boot_image *t; + int apm_partitions = 0; + int mbr_partitions = 0; /* write boot catalog */ if (fseeko(fd, (off_t)diskStructure.boot_catalog_sector * @@ -533,7 +604,88 @@ cd9660_write_boot(FILE *fd) t->filename, t->sector); } cd9660_copy_file(fd, t->sector, t->filename); + + if (t->system == ET_SYS_MAC) + apm_partitions++; + if (t->system == ET_SYS_PPC) + mbr_partitions++; + } + + /* some systems need partition tables as well */ + if (mbr_partitions > 0 || diskStructure.chrp_boot) { + uint16_t sig; + + fseek(fd, 0x1fe, SEEK_SET); + sig = htole16(0xaa55); + fwrite(&sig, sizeof(sig), 1, fd); + + mbr_partitions = 0; + + /* Write ISO9660 descriptor, enclosing the whole disk */ + if (diskStructure.chrp_boot) + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + 0, diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 0x96); + + /* Write all partition entries */ + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_PPC) + continue; + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 0x41 /* PReP Boot */); + } + } + + if (apm_partitions > 0) { + /* Write DDR and global APM info */ + uint32_t apm32; + uint16_t apm16; + int total_parts; + + fseek(fd, 0, SEEK_SET); + apm16 = htobe16(0x4552); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block size */ + apm16 = htobe16(512); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block count */ + apm32 = htobe32(diskStructure.totalSectors * + (diskStructure.sectorSize / 512)); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Device type/id */ + apm16 = htobe16(1); + fwrite(&apm16, sizeof(apm16), 1, fd); + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Count total needed entries */ + total_parts = 2 + apm_partitions; /* Self + ISO9660 */ + + /* Write self-descriptor */ + cd9660_write_apm_partition_entry(fd, 0, total_parts, 1, + total_parts, 512, "Apple", "Apple_partition_map"); + + /* Write ISO9660 descriptor, enclosing the whole disk */ + cd9660_write_apm_partition_entry(fd, 1, total_parts, 0, + diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 512, "ISO9660", + "CD_ROM_Mode_1"); + + /* Write all partition entries */ + apm_partitions = 0; + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_MAC) + continue; + + cd9660_write_apm_partition_entry(fd, + 2 + apm_partitions++, total_parts, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 512, "CD Boot", "Apple_Bootstrap"); + } } return 0; } + Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_strings.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c Tue Jul 26 14:41:54 2011 (r224448) @@ -55,19 +55,19 @@ cd9660_uppercase_characters(char *str, i } static inline int -cd9660_is_a_char(char c) +cd9660_is_d_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '0' && c <= '?')); + || (c >= '0' && c <= '9')); } static inline int -cd9660_is_d_char(char c) +cd9660_is_a_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '%' && c <= '9') + || (c >= '%' && c <= '?') || (c >= ' ' && c <= '\"')); } Copied: stable/7/usr.sbin/makefs/compat/Makefile.inc (from r214921, head/usr.sbin/makefs/compat/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/compat/Makefile.inc Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/compat/Makefile.inc) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/compat + +CFLAGS+= -I${.CURDIR}/compat + +SRCS+= pwcache.c strsuftoll.c Modified: stable/7/usr.sbin/makefs/ffs.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224448) @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -76,17 +76,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include "makefs.h" +#include "ffs.h" + +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS +#include +#endif #include #include #include + #include "ffs/ufs_bswap.h" #include "ffs/ufs_inode.h" #include "ffs/newfs_extern.h" @@ -94,7 +101,7 @@ __FBSDID("$FreeBSD$"); #undef DIP #define DIP(dp, field) \ - ((fsopts->version == 1) ? \ + ((ffs_opts->version == 1) ? \ (dp)->ffs1_din.di_##field : (dp)->ffs2_din.di_##field) /* @@ -139,39 +146,71 @@ int sectorsize; /* XXX: for buf.c::getb /* publically visible functions */ +void +ffs_prep_opts(fsinfo_t *fsopts) +{ + ffs_opt_t *ffs_opts; + + if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) + err(1, "Allocating memory for ffs_options"); + + fsopts->fs_specific = ffs_opts; + + ffs_opts->bsize= -1; + ffs_opts->fsize= -1; + ffs_opts->cpg= -1; + ffs_opts->density= -1; + ffs_opts->minfree= -1; + ffs_opts->optimization= -1; + ffs_opts->maxcontig= -1; + ffs_opts->maxbpg= -1; + ffs_opts->avgfilesize= -1; + ffs_opts->avgfpdir= -1; + ffs_opts->version = 1; +} + +void +ffs_cleanup_opts(fsinfo_t *fsopts) +{ + if (fsopts->fs_specific) + free(fsopts->fs_specific); +} + int ffs_parse_opts(const char *option, fsinfo_t *fsopts) { + ffs_opt_t *ffs_opts = fsopts->fs_specific; + option_t ffs_options[] = { - { "bsize", &fsopts->bsize, 1, INT_MAX, + { "bsize", &ffs_opts->bsize, 1, INT_MAX, "block size" }, - { "fsize", &fsopts->fsize, 1, INT_MAX, + { "fsize", &ffs_opts->fsize, 1, INT_MAX, "fragment size" }, - { "density", &fsopts->density, 1, INT_MAX, + { "density", &ffs_opts->density, 1, INT_MAX, "bytes per inode" }, - { "minfree", &fsopts->minfree, 0, 99, + { "minfree", &ffs_opts->minfree, 0, 99, "minfree" }, - { "maxbpf", &fsopts->maxbpg, 1, INT_MAX, + { "maxbpf", &ffs_opts->maxbpg, 1, INT_MAX, "max blocks per file in a cg" }, - { "avgfilesize", &fsopts->avgfilesize, 1, INT_MAX, + { "avgfilesize", &ffs_opts->avgfilesize,1, INT_MAX, "expected average file size" }, - { "avgfpdir", &fsopts->avgfpdir, 1, INT_MAX, + { "avgfpdir", &ffs_opts->avgfpdir, 1, INT_MAX, "expected # of files per directory" }, - { "extent", &fsopts->maxbsize, 1, INT_MAX, + { "extent", &ffs_opts->maxbsize, 1, INT_MAX, "maximum # extent size" }, - { "maxbpcg", &fsopts->maxblkspercg, 1, INT_MAX, + { "maxbpcg", &ffs_opts->maxblkspercg,1, INT_MAX, "max # of blocks per group" }, - { "version", &fsopts->version, 1, 2, + { "version", &ffs_opts->version, 1, 2, "UFS version" }, - { NULL } + { .name = NULL } }; char *var, *val; int rv; - (void)&ffs_options; assert(option != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_PARSE_OPTS) printf("ffs_parse_opts: got `%s'\n", option); @@ -188,9 +227,9 @@ ffs_parse_opts(const char *option, fsinf if (strcmp(var, "optimization") == 0) { if (strcmp(val, "time") == 0) { - fsopts->optimization = FS_OPTTIME; + ffs_opts->optimization = FS_OPTTIME; } else if (strcmp(val, "space") == 0) { - fsopts->optimization = FS_OPTSPACE; + ffs_opts->optimization = FS_OPTSPACE; } else { warnx("Invalid optimization `%s'", val); goto leave_ffs_parse_opts; @@ -277,11 +316,12 @@ ffs_validate(const char *dir, fsnode *ro #if notyet int32_t spc, nspf, ncyl, fssize; #endif - off_t size; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: before defaults set:\n"); @@ -291,31 +331,31 @@ ffs_validate(const char *dir, fsnode *ro /* set FFS defaults */ if (fsopts->sectorsize == -1) fsopts->sectorsize = DFL_SECSIZE; - if (fsopts->fsize == -1) - fsopts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); - if (fsopts->bsize == -1) - fsopts->bsize = MIN(DFL_BLKSIZE, 8 * fsopts->fsize); - if (fsopts->cpg == -1) - fsopts->cpg = DFL_CYLSPERGROUP; + if (ffs_opts->fsize == -1) + ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); + if (ffs_opts->bsize == -1) + ffs_opts->bsize = MIN(DFL_BLKSIZE, 8 * ffs_opts->fsize); + if (ffs_opts->cpg == -1) + ffs_opts->cpg = DFL_CYLSPERGROUP; else - fsopts->cpgflg = 1; + ffs_opts->cpgflg = 1; /* fsopts->density is set below */ - if (fsopts->nsectors == -1) - fsopts->nsectors = DFL_NSECTORS; - if (fsopts->minfree == -1) - fsopts->minfree = MINFREE; - if (fsopts->optimization == -1) - fsopts->optimization = DEFAULTOPT; - if (fsopts->maxcontig == -1) - fsopts->maxcontig = - MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / fsopts->bsize); + if (ffs_opts->nsectors == -1) + ffs_opts->nsectors = DFL_NSECTORS; + if (ffs_opts->minfree == -1) + ffs_opts->minfree = MINFREE; + if (ffs_opts->optimization == -1) + ffs_opts->optimization = DEFAULTOPT; + if (ffs_opts->maxcontig == -1) + ffs_opts->maxcontig = + MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / ffs_opts->bsize); /* XXX ondisk32 */ - if (fsopts->maxbpg == -1) - fsopts->maxbpg = fsopts->bsize / sizeof(int32_t); - if (fsopts->avgfilesize == -1) - fsopts->avgfilesize = AVFILESIZ; - if (fsopts->avgfpdir == -1) - fsopts->avgfpdir = AFPDIR; + if (ffs_opts->maxbpg == -1) + ffs_opts->maxbpg = ffs_opts->bsize / sizeof(int32_t); + if (ffs_opts->avgfilesize == -1) + ffs_opts->avgfilesize = AVFILESIZ; + if (ffs_opts->avgfpdir == -1) + ffs_opts->avgfpdir = AFPDIR; /* calculate size of tree */ ffs_size_dir(root, fsopts); @@ -343,17 +383,19 @@ ffs_validate(const char *dir, fsnode *ro */ fsopts->size += (SBLOCK_UFS1 + SBLOCKSIZE) * ncg; /* add space needed to store inodes, x3 for blockmaps, etc */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) fsopts->size += ncg * DINODE1_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE1_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE1_SIZE); else fsopts->size += ncg * DINODE2_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE2_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE2_SIZE); /* add minfree */ - if (fsopts->minfree > 0) + if (ffs_opts->minfree > 0) fsopts->size = - fsopts->size * (100 + fsopts->minfree) / 100; + fsopts->size * (100 + ffs_opts->minfree) / 100; /* * XXX any other fs slop to add, such as csum's, bitmaps, etc ?? */ @@ -362,24 +404,11 @@ ffs_validate(const char *dir, fsnode *ro fsopts->size = fsopts->minsize; /* round up to the next block */ - size = roundup(fsopts->size, fsopts->bsize); - - /* now check calculated sizes vs requested sizes */ - if (fsopts->maxsize > 0 && size > fsopts->maxsize) { - if (debug & DEBUG_FS_VALIDATE) { - printf("%s: `%s' size of %lld is larger than the " - "maxsize of %lld; rounding down to %lld.", - __func__, dir, (long long)size, - (long long)fsopts->maxsize, - (long long) rounddown(fsopts->size, fsopts->bsize)); - } - size = rounddown(fsopts->size, fsopts->bsize); - } - fsopts->size = size; + fsopts->size = roundup(fsopts->size, ffs_opts->bsize); /* calculate density if necessary */ - if (fsopts->density == -1) - fsopts->density = fsopts->size / fsopts->inodes + 1; + if (ffs_opts->density == -1) + ffs_opts->density = fsopts->size / fsopts->inodes + 1; if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: after defaults set:\n"); @@ -388,6 +417,12 @@ ffs_validate(const char *dir, fsnode *ro dir, (long long)fsopts->size, (long long)fsopts->inodes); } sectorsize = fsopts->sectorsize; /* XXX - see earlier */ + + /* now check calculated sizes vs requested sizes */ + if (fsopts->maxsize > 0 && fsopts->size > fsopts->maxsize) { + errx(1, "`%s' size of %lld is larger than the maxsize of %lld.", + dir, (long long)fsopts->size, (long long)fsopts->maxsize); + } } @@ -395,6 +430,8 @@ static void ffs_dump_fsinfo(fsinfo_t *f) { + ffs_opt_t *fs = f->fs_specific; + printf("fsopts at %p\n", f); printf("\tsize %lld, inodes %lld, curinode %u\n", @@ -409,20 +446,20 @@ ffs_dump_fsinfo(fsinfo_t *f) printf("\tneedswap %d, sectorsize %d\n", f->needswap, f->sectorsize); printf("\tbsize %d, fsize %d, cpg %d, density %d\n", - f->bsize, f->fsize, f->cpg, f->density); + fs->bsize, fs->fsize, fs->cpg, fs->density); printf("\tnsectors %d, rpm %d, minfree %d\n", - f->nsectors, f->rpm, f->minfree); + fs->nsectors, fs->rpm, fs->minfree); printf("\tmaxcontig %d, maxbpg %d\n", - f->maxcontig, f->maxbpg); + fs->maxcontig, fs->maxbpg); printf("\toptimization %s\n", - f->optimization == FS_OPTSPACE ? "space" : "time"); + fs->optimization == FS_OPTSPACE ? "space" : "time"); } static int ffs_create_image(const char *image, fsinfo_t *fsopts) { -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS struct statvfs sfs; #endif struct fs *fs; @@ -434,18 +471,18 @@ ffs_create_image(const char *image, fsin assert (fsopts != NULL); /* create image */ - if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0777)) + if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) { warn("Can't open `%s' for writing", image); return (-1); } /* zero image */ -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS if (fstatvfs(fsopts->fd, &sfs) == -1) { #endif bufsize = 8192; -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS warn("can't fstatvfs `%s', using default %d byte chunk", image, bufsize); } else @@ -465,10 +502,12 @@ ffs_create_image(const char *image, fsin if (i == -1) { warn("zeroing image, %lld bytes to go", (long long)bufrem); + free(buf); return (-1); } bufrem -= i; } + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) @@ -492,7 +531,7 @@ ffs_create_image(const char *image, fsin warnx( "Image file `%s' has %lld free inodes; %lld are required.", image, - (long long)fs->fs_cstotal.cs_nifree + ROOTINO, + (long long)(fs->fs_cstotal.cs_nifree + ROOTINO), (long long)fsopts->inodes); return (-1); } @@ -506,9 +545,11 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso struct direct tmpdir; fsnode * node; int curdirsize, this; + ffs_opt_t *ffs_opts = fsopts->fs_specific; /* node may be NULL (empty directory) */ assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_SIZE_DIR) printf("ffs_size_dir: entry: bytes %lld inodes %lld\n", @@ -516,7 +557,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso #define ADDDIRENT(e) do { \ tmpdir.d_namlen = strlen((e)); \ - this = DIRSIZ_SWAP(0, &tmpdir, 0); \ + this = DIRSIZ_SWAP(0, &tmpdir, 0); \ if (debug & DEBUG_FS_SIZE_DIR_ADD_DIRENT) \ printf("ADDDIRENT: was: %s (%d) this %d cur %d\n", \ e, tmpdir.d_namlen, this, curdirsize); \ @@ -533,14 +574,12 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso * by indirect blocks, etc. */ #define ADDSIZE(x) do { \ - fsopts->size += roundup((x), fsopts->fsize); \ + fsopts->size += roundup((x), ffs_opts->fsize); \ } while (0); curdirsize = 0; for (node = root; node != NULL; node = node->next) { ADDDIRENT(node->name); - if (FSNODE_EXCLUDE_P(fsopts, node)) - continue; if (node == root) { /* we're at "." */ assert(strcmp(node->name, ".") == 0); ADDDIRENT(".."); @@ -558,7 +597,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso int slen; slen = strlen(node->symlink) + 1; - if (slen >= (fsopts->version == 1 ? + if (slen >= (ffs_opts->version == 1 ? MAXSYMLINKLEN_UFS1 : MAXSYMLINKLEN_UFS2)) ADDSIZE(slen); @@ -682,10 +721,12 @@ ffs_populate_dir(const char *dir, fsnode union dinode din; void *membuf; char path[MAXPATHLEN + 1]; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); (void)memset(&dirbuf, 0, sizeof(dirbuf)); @@ -696,8 +737,6 @@ ffs_populate_dir(const char *dir, fsnode * pass 1: allocate inode numbers, build directory `file' */ for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if ((cur->inode->flags & FI_ALLOCATED) == 0) { cur->inode->flags |= FI_ALLOCATED; if (cur == root && cur->parent != NULL) @@ -732,8 +771,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 2 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->inode->flags & FI_WRITTEN) continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; @@ -746,7 +783,7 @@ ffs_populate_dir(const char *dir, fsnode continue; /* child creates own inode */ /* build on-disk inode */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) membuf = ffs_build_dinode1(&din.ffs1_din, &dirbuf, cur, root, fsopts); else @@ -777,8 +814,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 3 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->child == NULL) continue; if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) @@ -804,16 +839,20 @@ ffs_write_file(union dinode *din, uint32 int isfile, ffd; char *fbuf, *p; off_t bufleft, chunk, offset; + ssize_t nread; struct inode in; struct buf * bp; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (din != NULL); assert (buf != NULL); assert (fsopts != NULL); + assert (ffs_opts != NULL); isfile = S_ISREG(DIP(din, mode)); fbuf = NULL; ffd = -1; + p = NULL; in.i_fs = (struct fs *)fsopts->superblock; @@ -830,7 +869,7 @@ ffs_write_file(union dinode *din, uint32 in.i_number = ino; in.i_size = DIP(din, size); - if (fsopts->version == 1) + if (ffs_opts->version == 1) memcpy(&in.i_din.ffs1_din, &din->ffs1_din, sizeof(in.i_din.ffs1_din)); else @@ -842,7 +881,7 @@ ffs_write_file(union dinode *din, uint32 goto write_inode_and_leave; /* mmm, cheating */ if (isfile) { - if ((fbuf = malloc(fsopts->bsize)) == NULL) + if ((fbuf = malloc(ffs_opts->bsize)) == NULL) err(1, "Allocating memory for write buffer"); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { warn("Can't open `%s' for reading", (char *)buf); @@ -854,13 +893,20 @@ ffs_write_file(union dinode *din, uint32 chunk = 0; for (bufleft = DIP(din, size); bufleft > 0; bufleft -= chunk) { - chunk = MIN(bufleft, fsopts->bsize); - if (isfile) { - if (read(ffd, fbuf, chunk) != chunk) - err(1, "Reading `%s', %lld bytes to go", - (char *)buf, (long long)bufleft); + chunk = MIN(bufleft, ffs_opts->bsize); + if (!isfile) + ; + else if ((nread = read(ffd, fbuf, chunk)) == -1) + err(EXIT_FAILURE, "Reading `%s', %lld bytes to go", + (char *)buf, (long long)bufleft); + else if (nread != chunk) + errx(EXIT_FAILURE, "Reading `%s', %lld bytes to go, " + "read %zd bytes, expected %ju bytes, does " + "metalog size= attribute mismatch source size?", + (char *)buf, (long long)bufleft, nread, + (uintmax_t)chunk); + else p = fbuf; - } offset = DIP(din, size) - bufleft; if (debug & DEBUG_FS_WRITE_FILE_BLOCK) printf( @@ -932,7 +978,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch { struct direct de, *dp; uint16_t llen, reclen; - char *newbuf; + u_char *newbuf; assert (dbuf != NULL); assert (name != NULL); @@ -969,7 +1015,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch dbuf->size += DIRBLKSIZ; memset(dbuf->buf + dbuf->size - DIRBLKSIZ, 0, DIRBLKSIZ); dbuf->cur = dbuf->size - DIRBLKSIZ; - } else { /* shrink end of previous */ + } else if (dp) { /* shrink end of previous */ dp->d_reclen = ufs_rw16(llen,needswap); dbuf->cur += llen; } @@ -993,10 +1039,12 @@ ffs_write_inode(union dinode *dp, uint32 daddr_t d; char sbbuf[FFS_MAXBSIZE]; int32_t initediblk; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (dp != NULL); assert (ino > 0); assert (fsopts != NULL); + assert (ffs_opts != NULL); fs = (struct fs *)fsopts->superblock; cg = ino_to_cg(fs, ino); @@ -1041,7 +1089,7 @@ ffs_write_inode(union dinode *dp, uint32 * Initialize inode blocks on the fly for UFS2. */ initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap); - if (fsopts->version == 2 && cgino + INOPB(fs) > initediblk && + if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk && initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; @@ -1065,14 +1113,14 @@ ffs_write_inode(union dinode *dp, uint32 d = fsbtodb(fs, ino_to_fsba(fs, ino)); ffs_rdfs(d, fs->fs_bsize, buf, fsopts); if (fsopts->needswap) { - if (fsopts->version == 1) + if (ffs_opts->version == 1) ffs_dinode1_swap(&dp->ffs1_din, &dp1[ino_to_fsbo(fs, ino)]); else ffs_dinode2_swap(&dp->ffs2_din, &dp2[ino_to_fsbo(fs, ino)]); } else { - if (fsopts->version == 1) + if (ffs_opts->version == 1) dp1[ino_to_fsbo(fs, ino)] = dp->ffs1_din; else dp2[ino_to_fsbo(fs, ino)] = dp->ffs2_din; Copied: stable/7/usr.sbin/makefs/ffs.h (from r214921, head/usr.sbin/makefs/ffs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/ffs.h Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/ffs.h) @@ -0,0 +1,66 @@ +/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */ + +/* + * Copyright (c) 2001-2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Luke Mewburn for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * 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$ + */ + +#ifndef _FFS_H +#define _FFS_H + +typedef struct { + int bsize; /* block size */ + int fsize; /* fragment size */ + int cpg; /* cylinders per group */ + int cpgflg; /* cpg was specified by user */ + int density; /* bytes per inode */ + int ntracks; /* number of tracks */ + int nsectors; /* number of sectors */ + int rpm; /* rpm */ + int minfree; /* free space threshold */ + int optimization; /* optimization (space or time) */ + int maxcontig; /* max contiguous blocks to allocate */ + int rotdelay; /* rotational delay between blocks */ + int maxbpg; /* maximum blocks per file in a cyl group */ + int nrpos; /* # of distinguished rotational positions */ + int avgfilesize; /* expected average file size */ + int avgfpdir; /* expected # of files per directory */ + int version; /* filesystem version (1 = FFS, 2 = UFS2) */ + int maxbsize; /* maximum extent size */ + int maxblkspercg; /* max # of blocks per cylinder group */ + /* XXX: support `old' file systems ? */ +} ffs_opt_t; + +#endif /* _FFS_H */ Copied: stable/7/usr.sbin/makefs/ffs/Makefile.inc (from r214921, head/usr.sbin/makefs/ffs/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/ffs/Makefile.inc Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/ffs/Makefile.inc) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/ffs ${.CURDIR}/../../sys/ufs/ffs + +CFLAGS+= -I${.CURDIR}/../../sys/ufs/ffs + +SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c +SRCS+= buf.c mkfs.c Modified: stable/7/usr.sbin/makefs/ffs/buf.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224448) @@ -118,7 +118,7 @@ brelse(struct buf *bp) bp->b_bcount = 0; return; } - + TAILQ_REMOVE(&buftail, bp, b_tailq); free(bp->b_data); free(bp); @@ -160,7 +160,7 @@ bcleanup(void) * know why there's still some buffers lying around that * aren't brelse()d */ - + if (TAILQ_EMPTY(&buftail)) return; @@ -201,7 +201,7 @@ getblk(int fd, struct fs *fs, daddr_t bl if (bp == NULL) { if ((bp = calloc(1, sizeof(struct buf))) == NULL) err(1, "getblk: calloc"); - + bp->b_bufsize = 0; bp->b_blkno = bp->b_lblkno = blkno; bp->b_fd = fd; Modified: stable/7/usr.sbin/makefs/ffs/ffs_alloc.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224448) @@ -87,7 +87,7 @@ static int32_t ffs_mapsearch(struct fs * * available block is located. */ int -ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, +ffs_alloc(struct inode *ip, daddr_t lbn __unused, daddr_t bpref, int size, daddr_t *bnp) { struct fs *fs = ip->i_fs; @@ -95,7 +95,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, int cg; *bnp = 0; - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if (size > fs->fs_bsize || fragoff(fs, size) != 0) { errx(1, "ffs_alloc: bad size: bsize %d size %d", fs->fs_bsize, size); } @@ -187,11 +187,7 @@ ffs_blkpref_ufs1(struct inode *ip, daddr } daddr_t -ffs_blkpref_ufs2(ip, lbn, indx, bap) - struct inode *ip; - daddr_t lbn; - int indx; - int64_t *bap; +ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) { struct fs *fs; int cg; @@ -385,11 +381,11 @@ ffs_alloccgblk(struct inode *ip, struct int32_t bno; struct fs *fs = ip->i_fs; const int needswap = UFS_FSNEEDSWAP(fs); - u_int8_t *blksfree; + u_int8_t *blksfree_swap; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 16:14:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01162106564A; Tue, 26 Jul 2011 16:14:58 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F538FC13; Tue, 26 Jul 2011 16:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QGEvOR016464; Tue, 26 Jul 2011 16:14:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QGEvRA016462; Tue, 26 Jul 2011 16:14:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107261614.p6QGEvRA016462@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 26 Jul 2011 16:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224449 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 16:14:58 -0000 Author: jh Date: Tue Jul 26 16:14:57 2011 New Revision: 224449 URL: http://svn.freebsd.org/changeset/base/224449 Log: MFC r219925: Recognize "ro", "rdonly", "norw", "rw" and "noro" as equal options in vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant occurrences of these options. It was possible that for example both "ro" and "rw" options became active concurrently. PR: kern/133614 MFC r220040: Fix some style issues in r219925. Modified: stable/7/sys/kern/vfs_mount.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Tue Jul 26 14:41:54 2011 (r224448) +++ stable/7/sys/kern/vfs_mount.c Tue Jul 26 16:14:57 2011 (r224449) @@ -195,6 +195,25 @@ vfs_deleteopt(struct vfsoptlist *opts, c } } +static int +vfs_isopt_ro(const char *opt) +{ + + if (strcmp(opt, "ro") == 0 || strcmp(opt, "rdonly") == 0 || + strcmp(opt, "norw") == 0) + return (1); + return (0); +} + +static int +vfs_isopt_rw(const char *opt) +{ + + if (strcmp(opt, "rw") == 0 || strcmp(opt, "noro") == 0) + return (1); + return (0); +} + /* * Check if options are equal (with or without the "no" prefix). */ @@ -211,6 +230,10 @@ vfs_equalopts(const char *opt1, const ch /* "opt" vs. "noopt" */ if (strncmp(opt2, "no", 2) == 0 && strcmp(opt1, opt2 + 2) == 0) return (1); + /* "ro" / "rdonly" / "norw" / "rw" / "noro" */ + if ((vfs_isopt_ro(opt1) || vfs_isopt_rw(opt1)) && + (vfs_isopt_ro(opt2) || vfs_isopt_rw(opt2))) + return (1); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:02:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95EE7106564A; Tue, 26 Jul 2011 17:02:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856258FC13; Tue, 26 Jul 2011 17:02:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QH2Ib6018134; Tue, 26 Jul 2011 17:02:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH2I29018132; Tue, 26 Jul 2011 17:02:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261702.p6QH2I29018132@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224450 - stable/8/usr.sbin/faithd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:02:18 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:02:17 2011 New Revision: 224450 URL: http://svn.freebsd.org/changeset/base/224450 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159138 Modified: stable/8/usr.sbin/faithd/faithd.8 Directory Properties: stable/8/usr.sbin/faithd/ (props changed) Modified: stable/8/usr.sbin/faithd/faithd.8 ============================================================================== --- stable/8/usr.sbin/faithd/faithd.8 Tue Jul 26 16:14:57 2011 (r224449) +++ stable/8/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:17 2011 (r224450) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2010 +.Dd July 23, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%O ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U http://www.ietf.org/rfc/rfc3142.txt .%D June 2001 .Re .\" From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:02:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33A92106566C; Tue, 26 Jul 2011 17:02:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07E328FC0C; Tue, 26 Jul 2011 17:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QH2rZV018190; Tue, 26 Jul 2011 17:02:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH2rmG018188; Tue, 26 Jul 2011 17:02:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261702.p6QH2rmG018188@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224451 - stable/7/usr.sbin/faithd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:02:54 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:02:53 2011 New Revision: 224451 URL: http://svn.freebsd.org/changeset/base/224451 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159138 Modified: stable/7/usr.sbin/faithd/faithd.8 Directory Properties: stable/7/usr.sbin/faithd/ (props changed) Modified: stable/7/usr.sbin/faithd/faithd.8 ============================================================================== --- stable/7/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:17 2011 (r224450) +++ stable/7/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:53 2011 (r224451) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2010 +.Dd July 23, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%O ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U http://www.ietf.org/rfc/rfc3142.txt .%D June 2001 .Re .\" From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:09:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B4601065670; Tue, 26 Jul 2011 17:09:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE818FC0A; Tue, 26 Jul 2011 17:09:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QH9jil018517; Tue, 26 Jul 2011 17:09:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH9jpQ018515; Tue, 26 Jul 2011 17:09:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261709.p6QH9jpQ018515@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224452 - stable/8/share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:09:45 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:09:44 2011 New Revision: 224452 URL: http://svn.freebsd.org/changeset/base/224452 Log: MFC 224284: Fix various broken links in manual pages. PR: 159137 Modified: stable/8/share/man/man8/crash.8 Directory Properties: stable/8/share/man/man8/ (props changed) Modified: stable/8/share/man/man8/crash.8 ============================================================================== --- stable/8/share/man/man8/crash.8 Tue Jul 26 17:02:53 2011 (r224451) +++ stable/8/share/man/man8/crash.8 Tue Jul 26 17:09:44 2011 (r224452) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 1996 +.Dd July 23, 2011 .Dt CRASH 8 .Os .Sh NAME @@ -207,7 +207,7 @@ the panic message is printed. For more details consult the chapter on kernel debugging in the .%B "FreeBSD Developers' Handbook" -.Pq Pa http://www.FreeBSD.org/ . +.Pq Pa http://www.freebsd.org/doc/en/books/developers-handbook/ . .Sh SEE ALSO .Xr kgdb 1 , .Xr dumpon 8 , From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:10:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECFBE106566B; Tue, 26 Jul 2011 17:10:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA438FC18; Tue, 26 Jul 2011 17:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHAPce018584; Tue, 26 Jul 2011 17:10:25 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHAPgx018582; Tue, 26 Jul 2011 17:10:25 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261710.p6QHAPgx018582@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224453 - stable/7/share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:10:26 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:10:25 2011 New Revision: 224453 URL: http://svn.freebsd.org/changeset/base/224453 Log: MFC 224284: Fix various broken links in manual pages. PR: 159137 Modified: stable/7/share/man/man8/crash.8 Directory Properties: stable/7/share/man/man8/ (props changed) Modified: stable/7/share/man/man8/crash.8 ============================================================================== --- stable/7/share/man/man8/crash.8 Tue Jul 26 17:09:44 2011 (r224452) +++ stable/7/share/man/man8/crash.8 Tue Jul 26 17:10:25 2011 (r224453) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 1996 +.Dd July 23, 2011 .Dt CRASH 8 .Os .Sh NAME @@ -207,7 +207,7 @@ the panic message is printed. For more details consult the chapter on kernel debugging in the .%B "FreeBSD Developers' Handbook" -.Pq Pa http://www.FreeBSD.org/ . +.Pq Pa http://www.freebsd.org/doc/en/books/developers-handbook/ . .Sh SEE ALSO .Xr kgdb 1 , .Xr dumpon 8 , From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:16:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FF95106564A; Tue, 26 Jul 2011 17:16:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3CD88FC14; Tue, 26 Jul 2011 17:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHGDEc018841; Tue, 26 Jul 2011 17:16:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHGDLL018839; Tue, 26 Jul 2011 17:16:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261716.p6QHGDLL018839@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224454 - stable/8/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:16:14 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:16:13 2011 New Revision: 224454 URL: http://svn.freebsd.org/changeset/base/224454 Log: MFC 224284: Fix various broken links in manual pages. PR: 159136 Modified: stable/8/share/man/man5/reiserfs.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/reiserfs.5 ============================================================================== --- stable/8/share/man/man5/reiserfs.5 Tue Jul 26 17:10:25 2011 (r224453) +++ stable/8/share/man/man5/reiserfs.5 Tue Jul 26 17:16:13 2011 (r224454) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd July 23, 2011 .Dt REISERFS 5 .Os .Sh NAME @@ -74,7 +74,6 @@ first appeared in .An -nosplit The ReiserFS kernel implementation was written by .An Hans Reiser -.Pq Pa http://www.namesys.com/ , and ported to .Fx by From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:16:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4644A106568A; Tue, 26 Jul 2011 17:16:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3626F8FC17; Tue, 26 Jul 2011 17:16:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHGu5R018896; Tue, 26 Jul 2011 17:16:56 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHGuqf018894; Tue, 26 Jul 2011 17:16:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261716.p6QHGuqf018894@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224455 - stable/7/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:16:56 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:16:55 2011 New Revision: 224455 URL: http://svn.freebsd.org/changeset/base/224455 Log: MFC 224284: Fix various broken links in manual pages. PR: 159136 Modified: stable/7/share/man/man5/reiserfs.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/reiserfs.5 ============================================================================== --- stable/7/share/man/man5/reiserfs.5 Tue Jul 26 17:16:13 2011 (r224454) +++ stable/7/share/man/man5/reiserfs.5 Tue Jul 26 17:16:55 2011 (r224455) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd July 23, 2011 .Dt REISERFS 5 .Os .Sh NAME @@ -74,7 +74,6 @@ first appeared in .An -nosplit The ReiserFS kernel implementation was written by .An Hans Reiser -.Pq Pa http://www.namesys.com/ , and ported to .Fx by From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:38:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910151065674; Tue, 26 Jul 2011 17:38:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5198FC19; Tue, 26 Jul 2011 17:38:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHcoY8019679; Tue, 26 Jul 2011 17:38:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHcnm3019640; Tue, 26 Jul 2011 17:38:49 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261738.p6QHcnm3019640@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224456 - in stable/8/share/man/man4: . man4.i386 man4.sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:38:50 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:38:49 2011 New Revision: 224456 URL: http://svn.freebsd.org/changeset/base/224456 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159130 159131 159132 159133 PR: 159134 159135 159144 Modified: stable/8/share/man/man4/acpi.4 stable/8/share/man/man4/acpi_asus.4 stable/8/share/man/man4/aue.4 stable/8/share/man/man4/axe.4 stable/8/share/man/man4/cdce.4 stable/8/share/man/man4/dc.4 stable/8/share/man/man4/gif.4 stable/8/share/man/man4/hme.4 stable/8/share/man/man4/lge.4 stable/8/share/man/man4/lmc.4 stable/8/share/man/man4/mac.4 stable/8/share/man/man4/man4.i386/vpd.4 stable/8/share/man/man4/man4.sparc64/ebus.4 stable/8/share/man/man4/mpt.4 stable/8/share/man/man4/ndis.4 stable/8/share/man/man4/nge.4 stable/8/share/man/man4/pcm.4 stable/8/share/man/man4/pcn.4 stable/8/share/man/man4/psm.4 stable/8/share/man/man4/ral.4 stable/8/share/man/man4/re.4 stable/8/share/man/man4/rl.4 stable/8/share/man/man4/rue.4 stable/8/share/man/man4/rum.4 stable/8/share/man/man4/sf.4 stable/8/share/man/man4/sis.4 stable/8/share/man/man4/sk.4 stable/8/share/man/man4/smbus.4 stable/8/share/man/man4/snd_uaudio.4 stable/8/share/man/man4/ste.4 stable/8/share/man/man4/stf.4 stable/8/share/man/man4/targ.4 stable/8/share/man/man4/udav.4 stable/8/share/man/man4/ural.4 stable/8/share/man/man4/urio.4 stable/8/share/man/man4/urtw.4 stable/8/share/man/man4/vr.4 stable/8/share/man/man4/wi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/acpi.4 ============================================================================== --- stable/8/share/man/man4/acpi.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/acpi.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -585,7 +585,7 @@ ACPI is only found and supported on i386 .%A "Toshiba Corporation" .%D August 25, 2003 .%T "Advanced Configuration and Power Interface Specification" -.%O http://acpi.info/spec.htm +.%U http://acpi.info/spec.htm .Re .Sh AUTHORS .An -nosplit Modified: stable/8/share/man/man4/acpi_asus.4 ============================================================================== --- stable/8/share/man/man4/acpi_asus.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/acpi_asus.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -162,7 +162,7 @@ which is parsed at boot-time. .Xr sysctl 8 .Rs .%T The acpi4asus Project -.%O http://sourceforge.net/projects/acpi4asus/ +.%U http://sourceforge.net/projects/acpi4asus/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/aue.4 ============================================================================== --- stable/8/share/man/man4/aue.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/aue.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -193,7 +193,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T ADMtek AN986 data sheet -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/axe.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -241,7 +241,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ASIX AX88x7x and AX88760 data sheets" -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/cdce.4 ============================================================================== --- stable/8/share/man/man4/cdce.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/cdce.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -120,11 +120,11 @@ is running low on mbufs. .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" -.%O http://www.usb.org/developers/devclass_docs/usbcdc11.pdf +.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf .Re .Rs .%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" -.%O http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 +.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 .Re .Sh HISTORY The Modified: stable/8/share/man/man4/dc.4 ============================================================================== --- stable/8/share/man/man4/dc.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/dc.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -351,27 +351,27 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Rs .%T ASIX Electronics AX88140A and AX88141 data sheets -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Rs .%T Davicom DM9102 data sheet -.%O http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual -.%O http://developer.intel.com +.%U http://developer.intel.com .Re .Rs .%T Macronix 98713/A, 98715/A and 98725 data sheets -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Rs .%T Macronix 98713/A and 98715/A app notes -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/gif.4 ============================================================================== --- stable/8/share/man/man4/gif.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/gif.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd July 23, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%O ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://www.ietf.org/rfc/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: stable/8/share/man/man4/hme.4 ============================================================================== --- stable/8/share/man/man4/hme.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/hme.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -139,7 +139,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf +.%U http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/lge.4 ============================================================================== --- stable/8/share/man/man4/lge.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/lge.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -143,7 +143,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T Level 1 LXT1001 Programming Manual -.%O http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf +.%U http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/lmc.4 ============================================================================== --- stable/8/share/man/man4/lmc.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/lmc.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: stable/8/share/man/man4/mac.4 ============================================================================== --- stable/8/share/man/man4/mac.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/mac.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -219,7 +219,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html .Re .Sh HISTORY The Modified: stable/8/share/man/man4/man4.i386/vpd.4 ============================================================================== --- stable/8/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -76,7 +76,7 @@ Motherboard Serial Number. .%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems" .%N "Reference #: MIGR-45120" .%D "November 22, 2002" -.%O "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" +.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" .Re .Sh HISTORY The Modified: stable/8/share/man/man4/man4.sparc64/ebus.4 ============================================================================== --- stable/8/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -99,7 +99,7 @@ DMA. .%T "Peripheral Component Interconnect Input Output Controller" .%V "Part No.: 802-7837-01" .%D "March 1997" -.%O "http://www.sun.com/oem/products/manuals/802-7837.pdf" +.%U "http://www.sun.com/oem/products/manuals/802-7837.pdf" .Re .Sh HISTORY The Modified: stable/8/share/man/man4/mpt.4 ============================================================================== --- stable/8/share/man/man4/mpt.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/mpt.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -161,7 +161,7 @@ can take on - no separate compilation is .Xr gmultipath 8 .Rs .%T "LSI Logic Website" -.%O http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/ndis.4 ============================================================================== --- stable/8/share/man/man4/ndis.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ndis.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -139,7 +139,7 @@ before a timeout expired. .Xr wpa_supplicant 8 .Rs .%T "NDIS 5.1 specification" -.%O http://www.microsoft.com +.%U http://www.microsoft.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/nge.4 ============================================================================== --- stable/8/share/man/man4/nge.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/nge.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -209,11 +209,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T National Semiconductor DP83820 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Rs .%T National Semiconductor DP83861 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/pcm.4 ============================================================================== --- stable/8/share/man/man4/pcm.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/pcm.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -633,19 +633,19 @@ A device node is not created properly. .Xr sysctl 8 .Rs .%T "Cookbook formulae for audio EQ biquad filter coefficients, by Robert Bristow-Johnson" -.%O "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" +.%U "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" .Re .Rs .%T "Julius O'Smith's Digital Audio Resampling" -.%O "http://ccrma.stanford.edu/~jos/resample/" +.%U "http://ccrma.stanford.edu/~jos/resample/" .Re .Rs .%T "Polynomial Interpolators for High-Quality Resampling of Oversampled Audio, by Olli Niemitalo" -.%O "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" +.%U "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" .Re .Rs .%T "The OSS API" -.%O "http://www.opensound.com/pguide/oss.pdf" +.%U "http://www.opensound.com/pguide/oss.pdf" .Re .Sh HISTORY The Modified: stable/8/share/man/man4/pcn.4 ============================================================================== --- stable/8/share/man/man4/pcn.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/pcn.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -179,7 +179,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T AMD PCnet/FAST, PCnet/FAST+ and PCnet/Home datasheets -.%O http://www.amd.com +.%U http://www.amd.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/psm.4 ============================================================================== --- stable/8/share/man/man4/psm.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/psm.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -829,7 +829,7 @@ Clicking any button without moving the m .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide -.%O http://www.synaptics.com/ +.%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS Modified: stable/8/share/man/man4/ral.4 ============================================================================== --- stable/8/share/man/man4/ral.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ral.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -242,7 +242,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/re.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -242,7 +242,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets -.%O http://www.realtek.com.tw/ +.%U http://www.realtek.com.tw/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/rl.4 ============================================================================== --- stable/8/share/man/man4/rl.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/rl.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -262,7 +262,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%B The RealTek 8129, 8139 and 8139C+ datasheets -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/rue.4 ============================================================================== --- stable/8/share/man/man4/rue.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/rue.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt RUE 4 .Os .Sh NAME @@ -139,8 +139,8 @@ The driver failed to allocate an mbuf fo .Xr ng_ether 4 , .Xr ifconfig 8 .Rs -.%T "ReakTek RTL8150 data sheet" -.%O ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%T "RealTek RTL8150 data sheet" +.%U http://pdf.seekdatasheet.com/2008714/200807142333305235.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/rum.4 ============================================================================== --- stable/8/share/man/man4/rum.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/rum.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -168,7 +168,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/sf.4 ============================================================================== --- stable/8/share/man/man4/sf.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/sf.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -197,7 +197,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T The Adaptec AIC-6915 Programmer's Manual -.%O http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf +.%U http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/sis.4 ============================================================================== --- stable/8/share/man/man4/sis.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/sis.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -210,11 +210,11 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets -.%O http://www.sis.com.tw +.%U http://www.sis.com.tw .Re .Rs .%T NatSemi DP83815 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/sk.4 ============================================================================== --- stable/8/share/man/man4/sk.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/sk.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -225,11 +225,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%O http://www.xaqti.com +.%U http://www.xaqti.com .Re .Rs .%T SysKonnect GEnesis programming manual -.%O http://www.syskonnect.com +.%U http://www.syskonnect.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/smbus.4 ============================================================================== --- stable/8/share/man/man4/smbus.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/smbus.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -67,7 +67,7 @@ between the internal SMB devices and ext .Xr smb 4 .Rs .%T The SMBus specification -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/snd_uaudio.4 ============================================================================== --- stable/8/share/man/man4/snd_uaudio.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/snd_uaudio.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -80,7 +80,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%O http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/devclass_docs/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/ste.4 ============================================================================== --- stable/8/share/man/man4/ste.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ste.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet -.%O http://www.sundanceti.com +.%U http://www.sundanceti.com .Re .Sh HISTORY The Modified: stable/8/share/man/man4/stf.4 ============================================================================== --- stable/8/share/man/man4/stf.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/stf.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2001 +.Dd July 23, 2011 .Dt STF 4 .Os .Sh NAME @@ -230,7 +230,7 @@ and not to use your 6to4 prefix as a sou .Xr inet 4 , .Xr inet6 4 .Pp -.Pa http://www.6bone.net/6bone_6to4.html +.Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore Modified: stable/8/share/man/man4/targ.4 ============================================================================== --- stable/8/share/man/man4/targ.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/targ.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -133,7 +133,7 @@ are the control devices. .Xr scsi 4 .Rs .%T "FreeBSD Target Information" -.%O http://www.root.org/~nate/freebsd/ +.%U http://www.root.org/~nate/freebsd/ .Re .Sh AUTHORS .An -nosplit Modified: stable/8/share/man/man4/udav.4 ============================================================================== --- stable/8/share/man/man4/udav.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/udav.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -87,7 +87,7 @@ For more information on configuring this .Xr ifconfig 8 .Rs .%T "Davicom DM9601 data sheet" -.%O http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf +.%U http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf .Re .Sh HISTORY The Modified: stable/8/share/man/man4/ural.4 ============================================================================== --- stable/8/share/man/man4/ural.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/ural.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -148,7 +148,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/8/share/man/man4/urio.4 ============================================================================== --- stable/8/share/man/man4/urio.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/urio.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -106,7 +106,7 @@ section): .Xr usb 4 .Rs .%T The Rio 500 SourceForge Project Web Page -.%O http://rio500.sourceforge.net/ +.%U http://rio500.sourceforge.net/ .Re .Pp The Rio500 tools from SourceForge Modified: stable/8/share/man/man4/urtw.4 ============================================================================== --- stable/8/share/man/man4/urtw.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/urtw.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -111,7 +111,7 @@ ifconfig wlan create wlandev urtw0 ssid .Xr wpa_supplicant 8 .Rs .%T Realtek -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/vr.4 ============================================================================== --- stable/8/share/man/man4/vr.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/vr.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -194,7 +194,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T The VIA Technologies VT86C100A data sheet -.%O http://www.via.com.tw +.%U http://www.via.com.tw .Re .Sh HISTORY The Modified: stable/8/share/man/man4/wi.4 ============================================================================== --- stable/8/share/man/man4/wi.4 Tue Jul 26 17:16:55 2011 (r224455) +++ stable/8/share/man/man4/wi.4 Tue Jul 26 17:38:49 2011 (r224456) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" $OpenBSD: wi.4tbl,v 1.14 2002/04/29 19:53:50 jsyn Exp $ .\" -.Dd August 2, 2008 +.Dd July 23, 2011 .Dt WI 4 .Os .Sh NAME @@ -321,7 +321,7 @@ command. .Xr wpa_supplicant 8 . .Rs .%T HCF Light programming specification -.%O http://www.wavelan.com +.%U http://web.archive.org/web/20040130141721/http://wavelan.com/ .Re .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 17:39:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7041065670; Tue, 26 Jul 2011 17:39:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B9D8FC13; Tue, 26 Jul 2011 17:39:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QHdenf019778; Tue, 26 Jul 2011 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHdeaJ019740; Tue, 26 Jul 2011 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261739.p6QHdeaJ019740@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224457 - in stable/7/share/man/man4: . man4.i386 man4.sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:39:41 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:39:40 2011 New Revision: 224457 URL: http://svn.freebsd.org/changeset/base/224457 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159130 159131 159132 159133 PR: 159134 159135 159144 Modified: stable/7/share/man/man4/acpi.4 stable/7/share/man/man4/aue.4 stable/7/share/man/man4/axe.4 stable/7/share/man/man4/cdce.4 stable/7/share/man/man4/dc.4 stable/7/share/man/man4/gif.4 stable/7/share/man/man4/hme.4 stable/7/share/man/man4/lge.4 stable/7/share/man/man4/lmc.4 stable/7/share/man/man4/mac.4 stable/7/share/man/man4/man4.i386/vpd.4 stable/7/share/man/man4/man4.sparc64/ebus.4 stable/7/share/man/man4/mpt.4 stable/7/share/man/man4/nge.4 stable/7/share/man/man4/pcm.4 stable/7/share/man/man4/pcn.4 stable/7/share/man/man4/psm.4 stable/7/share/man/man4/ral.4 stable/7/share/man/man4/re.4 stable/7/share/man/man4/rl.4 stable/7/share/man/man4/rue.4 stable/7/share/man/man4/rum.4 stable/7/share/man/man4/sf.4 stable/7/share/man/man4/sis.4 stable/7/share/man/man4/sk.4 stable/7/share/man/man4/smbus.4 stable/7/share/man/man4/snd_uaudio.4 stable/7/share/man/man4/ste.4 stable/7/share/man/man4/stf.4 stable/7/share/man/man4/targ.4 stable/7/share/man/man4/udav.4 stable/7/share/man/man4/ural.4 stable/7/share/man/man4/urio.4 stable/7/share/man/man4/vr.4 stable/7/share/man/man4/wi.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/acpi.4 ============================================================================== --- stable/7/share/man/man4/acpi.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/acpi.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -560,7 +560,7 @@ ACPI is only found and supported on i386 .%A "Toshiba Corporation" .%D August 25, 2003 .%T "Advanced Configuration and Power Interface Specification" -.%O http://acpi.info/spec.htm +.%U http://acpi.info/spec.htm .Re .Sh AUTHORS .An -nosplit Modified: stable/7/share/man/man4/aue.4 ============================================================================== --- stable/7/share/man/man4/aue.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/aue.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -193,7 +193,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T ADMtek AN986 data sheet -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/axe.4 ============================================================================== --- stable/7/share/man/man4/axe.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/axe.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -200,7 +200,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/cdce.4 ============================================================================== --- stable/7/share/man/man4/cdce.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/cdce.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -120,11 +120,11 @@ is running low on mbufs. .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" -.%O http://www.usb.org/developers/devclass_docs/usbcdc11.pdf +.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf .Re .Rs .%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" -.%O http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 +.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 .Re .Sh HISTORY The Modified: stable/7/share/man/man4/dc.4 ============================================================================== --- stable/7/share/man/man4/dc.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/dc.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -351,27 +351,27 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Rs .%T ASIX Electronics AX88140A and AX88141 data sheets -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Rs .%T Davicom DM9102 data sheet -.%O http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual -.%O http://developer.intel.com +.%U http://developer.intel.com .Re .Rs .%T Macronix 98713/A, 98715/A and 98725 data sheets -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Rs .%T Macronix 98713/A and 98715/A app notes -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/gif.4 ============================================================================== --- stable/7/share/man/man4/gif.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/gif.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd July 23, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%O ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://www.ietf.org/rfc/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: stable/7/share/man/man4/hme.4 ============================================================================== --- stable/7/share/man/man4/hme.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/hme.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -129,7 +129,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf +.%U http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/lge.4 ============================================================================== --- stable/7/share/man/man4/lge.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/lge.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -143,7 +143,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T Level 1 LXT1001 Programming Manual -.%O http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf +.%U http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/lmc.4 ============================================================================== --- stable/7/share/man/man4/lmc.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/lmc.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: stable/7/share/man/man4/mac.4 ============================================================================== --- stable/7/share/man/man4/mac.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/mac.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -220,7 +220,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html .Re .Sh HISTORY The Modified: stable/7/share/man/man4/man4.i386/vpd.4 ============================================================================== --- stable/7/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -76,7 +76,7 @@ Motherboard Serial Number. .%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems" .%N "Reference #: MIGR-45120" .%D "November 22, 2002" -.%O "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" +.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/man4.sparc64/ebus.4 ============================================================================== --- stable/7/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -99,7 +99,7 @@ DMA. .%T "Peripheral Component Interconnect Input Output Controller" .%V "Part No.: 802-7837-01" .%D "March 1997" -.%O "http://www.sun.com/oem/products/manuals/802-7837.pdf" +.%U "http://www.sun.com/oem/products/manuals/802-7837.pdf" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/mpt.4 ============================================================================== --- stable/7/share/man/man4/mpt.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/mpt.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -158,7 +158,7 @@ can take on - no separate compilation is .Xr targ 4 .Rs .%T "LSI Logic Website" -.%O http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/nge.4 ============================================================================== --- stable/7/share/man/man4/nge.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/nge.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -209,11 +209,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T National Semiconductor DP83820 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Rs .%T National Semiconductor DP83861 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/pcm.4 ============================================================================== --- stable/7/share/man/man4/pcm.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/pcm.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -409,7 +409,7 @@ A device node is not created properly. .Xr sysctl 8 .Rs .%T "The OSS API" -.%O "http://www.opensound.com/pguide/oss.pdf" +.%U "http://www.opensound.com/pguide/oss.pdf" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/pcn.4 ============================================================================== --- stable/7/share/man/man4/pcn.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/pcn.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -179,7 +179,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T AMD PCnet/FAST, PCnet/FAST+ and PCnet/Home datasheets -.%O http://www.amd.com +.%U http://www.amd.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/psm.4 ============================================================================== --- stable/7/share/man/man4/psm.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/psm.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -844,7 +844,7 @@ Clicking any button without moving the m .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide -.%O http://www.synaptics.com/ +.%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS Modified: stable/7/share/man/man4/ral.4 ============================================================================== --- stable/7/share/man/man4/ral.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ral.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -203,7 +203,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/re.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -242,7 +242,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets -.%O http://www.realtek.com.tw/ +.%U http://www.realtek.com.tw/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rl.4 ============================================================================== --- stable/7/share/man/man4/rl.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rl.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -262,7 +262,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%B The RealTek 8129, 8139 and 8139C+ datasheets -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rue.4 ============================================================================== --- stable/7/share/man/man4/rue.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rue.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt RUE 4 .Os .Sh NAME @@ -139,8 +139,8 @@ The driver failed to allocate an mbuf fo .Xr ng_ether 4 , .Xr ifconfig 8 .Rs -.%T "ReakTek RTL8150 data sheet" -.%O ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%T "RealTek RTL8150 data sheet" +.%U http://pdf.seekdatasheet.com/2008714/200807142333305235.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rum.4 ============================================================================== --- stable/7/share/man/man4/rum.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rum.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -144,7 +144,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sf.4 ============================================================================== --- stable/7/share/man/man4/sf.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sf.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -197,7 +197,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T The Adaptec AIC-6915 Programmer's Manual -.%O http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf +.%U http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sis.4 ============================================================================== --- stable/7/share/man/man4/sis.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sis.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -210,11 +210,11 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets -.%O http://www.sis.com.tw +.%U http://www.sis.com.tw .Re .Rs .%T NatSemi DP83815 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sk.4 ============================================================================== --- stable/7/share/man/man4/sk.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sk.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -225,11 +225,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%O http://www.xaqti.com +.%U http://www.xaqti.com .Re .Rs .%T SysKonnect GEnesis programming manual -.%O http://www.syskonnect.com +.%U http://www.syskonnect.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/smbus.4 ============================================================================== --- stable/7/share/man/man4/smbus.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/smbus.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -67,7 +67,7 @@ between the internal SMB devices and ext .Xr smb 4 .Rs .%T The SMBus specification -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/snd_uaudio.4 ============================================================================== --- stable/7/share/man/man4/snd_uaudio.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/snd_uaudio.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -78,7 +78,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%O http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/devclass_docs/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/ste.4 ============================================================================== --- stable/7/share/man/man4/ste.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ste.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet -.%O http://www.sundanceti.com +.%U http://www.sundanceti.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/stf.4 ============================================================================== --- stable/7/share/man/man4/stf.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/stf.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2001 +.Dd July 23, 2011 .Dt STF 4 .Os .Sh NAME @@ -230,7 +230,7 @@ and not to use your 6to4 prefix as a sou .Xr inet 4 , .Xr inet6 4 .Pp -.Pa http://www.6bone.net/6bone_6to4.html +.Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore Modified: stable/7/share/man/man4/targ.4 ============================================================================== --- stable/7/share/man/man4/targ.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/targ.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -133,7 +133,7 @@ are the control devices. .Xr scsi 4 .Rs .%T "FreeBSD Target Information" -.%O http://www.root.org/~nate/freebsd/ +.%U http://www.root.org/~nate/freebsd/ .Re .Sh AUTHORS .An -nosplit Modified: stable/7/share/man/man4/udav.4 ============================================================================== --- stable/7/share/man/man4/udav.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/udav.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -87,7 +87,7 @@ For more information on configuring this .Xr ifconfig 8 .Rs .%T "Davicom DM9601 data sheet" -.%O http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf +.%U http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/ural.4 ============================================================================== --- stable/7/share/man/man4/ural.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ural.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -128,7 +128,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/urio.4 ============================================================================== --- stable/7/share/man/man4/urio.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/urio.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -106,7 +106,7 @@ section): .Xr usb 4 .Rs .%T The Rio 500 SourceForge Project Web Page -.%O http://rio500.sourceforge.net/ +.%U http://rio500.sourceforge.net/ .Re .Pp The Rio500 tools from SourceForge Modified: stable/7/share/man/man4/vr.4 ============================================================================== --- stable/7/share/man/man4/vr.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/vr.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T The VIA Technologies VT86C100A data sheet -.%O http://www.via.com.tw +.%U http://www.via.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/wi.4 ============================================================================== --- stable/7/share/man/man4/wi.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/wi.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" $OpenBSD: wi.4tbl,v 1.14 2002/04/29 19:53:50 jsyn Exp $ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt WI 4 .Os .Sh NAME @@ -362,7 +362,7 @@ command. .Xr ifconfig 8 , .Rs .%T HCF Light programming specification -.%O http://www.wavelan.com +.%U http://web.archive.org/web/20040130141721/http://wavelan.com/ .Re .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 18:59:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D054106564A; Tue, 26 Jul 2011 18:59:38 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6718FC19; Tue, 26 Jul 2011 18:59:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QIxcF7022268; Tue, 26 Jul 2011 18:59:38 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QIxcf7022266; Tue, 26 Jul 2011 18:59:38 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107261859.p6QIxcf7022266@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 26 Jul 2011 18:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224458 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 18:59:38 -0000 Author: jh Date: Tue Jul 26 18:59:38 2011 New Revision: 224458 URL: http://svn.freebsd.org/changeset/base/224458 Log: MFC r222216: In init_dynamic_kenv(), ignore environment strings exceeding the KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer overflow in getenv(). Currenly loader(8) doesn't limit the length of environment strings. PR: kern/132104 Modified: stable/7/sys/kern/kern_environment.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_environment.c ============================================================================== --- stable/7/sys/kern/kern_environment.c Tue Jul 26 17:39:40 2011 (r224457) +++ stable/7/sys/kern/kern_environment.c Tue Jul 26 18:59:38 2011 (r224458) @@ -217,13 +217,19 @@ static void init_dynamic_kenv(void *data __unused) { char *cp; - int len, i; + size_t len; + int i; kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; + if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + printf("WARNING: too long kenv string, ignoring %s\n", + cp); + continue; + } if (i < KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 19:05:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86F9C106564A; Tue, 26 Jul 2011 19:05:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74BE38FC15; Tue, 26 Jul 2011 19:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QJ5AgV022511; Tue, 26 Jul 2011 19:05:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QJ5AWX022509; Tue, 26 Jul 2011 19:05:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261905.p6QJ5AWX022509@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 19:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224459 - stable/8/sys/netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 19:05:10 -0000 Author: gjb (doc committer) Date: Tue Jul 26 19:05:10 2011 New Revision: 224459 URL: http://svn.freebsd.org/changeset/base/224459 Log: MFC 223773: - General grammar and mdoc(7) fixes. - While here, remove a paragraph about userspace operation that has been outdated for some time. PR: 158623 Modified: stable/8/sys/netinet/libalias/libalias.3 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/8/sys/netinet/libalias/libalias.3 Tue Jul 26 18:59:38 2011 (r224458) +++ stable/8/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:10 2011 (r224459) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd July 04, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -52,7 +52,7 @@ machine on the local network. .Pp A certain amount of flexibility is built into the packet aliasing engine. In the simplest mode of operation, a many-to-one address mapping takes -place between local network and the packet aliasing host. +place between the local network and the packet aliasing host. This is known as IP masquerading. In addition, one-to-one mappings between local and public addresses can also be implemented, which is known as static NAT. @@ -61,15 +61,11 @@ linked to different public addresses, co many-to-one mappings. Also, a given public address and port can be statically redirected to a private address/port. -.Pp -The packet aliasing engine was designed to operate in user space outside -of the kernel, without any access to private kernel data structure, but -the source code can also be ported to a kernel environment. .Sh INITIALIZATION AND CONTROL One special function, .Fn LibAliasInit , -must always be called before any packet handling may be performed and -the returned instance pointer passed to all the other functions. +must always be called before any packet handling may be performed, and +the returned instance pointer must be passed to all the other functions. Normally, the .Fn LibAliasSetAddress function is called afterwards, to set the default aliasing address. @@ -118,8 +114,8 @@ prior to any packet handling. This function has no return value and is used to clear any resources attached to internal data structures. .Pp -This functions should be called when a program stops using the aliasing -engine; it does, amongst other things, clear out any firewall holes. +This function should be called when a program stops using the aliasing +engine; amongst other things, it clears out any firewall holes. To provide backwards compatibility and extra security, it is added to the .Xr atexit 3 @@ -135,7 +131,7 @@ local area network are aliased. All outgoing packets are re-mapped to this address unless overridden by a static address mapping established by .Fn LibAliasRedirectAddr . -If this function is not called, and no static rules match, an outgoing +If this function has not been called, and no static rules match, an outgoing packet retains its source address. .Pp If the @@ -150,7 +146,7 @@ address may or may not change on success If the .Dv PKT_ALIAS_RESET_ON_ADDR_CHANGE mode bit is set to zero, this function can also be used to dynamically change -the aliasing address on a packet to packet basis (it is a low overhead call). +the aliasing address on a packet-to-packet basis (it is a low overhead call). .Pp It is mandatory that this function be called prior to any packet handling. .Ed @@ -170,7 +166,7 @@ The following mode bits are defined in .It Dv PKT_ALIAS_LOG Enables logging into .Pa /var/log/alias.log . -Each time an aliasing link is created or deleted, the log file is appended +Each time an aliasing link is created or deleted, the log file is appended to with the current number of ICMP, TCP and UDP links. Mainly useful for debugging when the log file is viewed continuously with .Xr tail 1 . @@ -186,7 +182,7 @@ Response packets to connections or trans aliasing host or local network will be unaffected. This mode bit is useful for implementing a one-way firewall. .It Dv PKT_ALIAS_SAME_PORTS -If this mode bit is set, the packet aliasing engine will attempt to leave +If this mode bit is set, the packet-aliasing engine will attempt to leave the alias port numbers unchanged from the actual local port numbers. This can be done as long as the quintuple (proto, alias addr, alias port, remote addr, remote port) is unique. @@ -211,7 +207,7 @@ Standard Class A, B and C unregistered a 192.168.0.0 -> 192.168.255.255 (Class C subnets) .Ed .Pp -This option is useful in the case that packet aliasing host has both +This option is useful in the case that the packet aliasing host has both registered and unregistered subnets on different interfaces. The registered subnet is fully accessible to the outside world, so traffic from it does not need to be passed through the packet aliasing engine. @@ -229,8 +225,9 @@ of an address change. .It Dv PKT_ALIAS_PUNCH_FW This option makes .Nm -`punch holes' in an -.Xr ipfirewall 4 +.Dq punch holes +in an +.Xr ipfirewall 4 - based firewall for FTP/IRC DCC connections. The holes punched are bound by from/to IP address and port; it will not be possible to use a hole for another connection. @@ -240,9 +237,9 @@ To cater to unexpected death of a progra (e.g.\& kill -9), changing the state of the flag will clear the entire firewall range allocated for holes. -This will also happen on the initial call to -.Fn LibAliasSetFWBase . -This call must happen prior to setting this flag. +This clearing will also happen on the initial call to +.Fn LibAliasSetFWBase , +which must happen prior to setting this flag. .It Dv PKT_ALIAS_REVERSE This option makes .Nm @@ -263,10 +260,10 @@ below for details. .Ft void .Fn LibAliasSetFWBase "struct libalias *" "unsigned int base" "unsigned int num" .Bd -ragged -offset indent -Set firewall range allocated for punching firewall holes (with the +Set the firewall range allocated for punching firewall holes (with the .Dv PKT_ALIAS_PUNCH_FW flag). -The range will be cleared for all rules on initialization. +The range is cleared for all rules on initialization. .Ed .Pp .Ft void @@ -292,7 +289,7 @@ the two packet handling functions, .Fn LibAliasIn and .Fn LibAliasOut , -comprise minimal set of functions needed for a basic IP masquerading +comprise the minimal set of functions needed for a basic IP masquerading implementation. .Pp .Ft int @@ -313,11 +310,11 @@ Return codes: The packet aliasing process was successful. .It Dv PKT_ALIAS_IGNORED The packet was ignored and not de-aliased. -This can happen if the protocol is unrecognized, possibly an ICMP message -type is not handled or if incoming packets for new connections are being -ignored (if +This can happen if the protocol is unrecognized, as for an ICMP message +type that is not handled, or if incoming packets for new connections are being +ignored (if the .Dv PKT_ALIAS_DENY_INCOMING -mode bit was set by +mode bit was set using .Fn LibAliasSetMode ) . .It Dv PKT_ALIAS_UNRESOLVED_FRAGMENT This is returned when a fragment cannot be resolved because the header @@ -408,7 +405,7 @@ is called to change the address after .Fn LibAliasRedirectPort is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then .Fa local_addr and .Fa local_port @@ -423,7 +420,7 @@ Likewise, if .Fa remote_port is zero, this indicates to redirect packets originating from any remote port number. -Almost always, the remote port specification will be zero, but non-zero +The remote port specification will almost always be zero, but non-zero remote addresses can sometimes be useful for firewalling. If two calls to .Fn LibAliasRedirectPort @@ -475,9 +472,10 @@ is called to change the address after .Fn LibAliasRedirectAddr is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then the .Fa local_addr -is ignored, and is selected dynamically from the server pool, as described in +argument is ignored, and is selected dynamically from the server pool, +as described in .Fn LibAliasAddServer below. .Pp @@ -532,12 +530,12 @@ up for Load Sharing using IP Network Add LSNAT operates as follows. A client attempts to access a server by using the server virtual address. The LSNAT router transparently redirects the request to one of the hosts -in server pool, selected using a real-time load sharing algorithm. +in the server pool, using a real-time load sharing algorithm. Multiple sessions may be initiated from the same client, and each session -could be directed to a different host based on load balance across server -pool hosts at the time. -If load share is desired for just a few specific services, the configuration -on LSNAT could be defined to restrict load share for just the services +could be directed to a different host based on the load balance across server +pool hosts when the sessions are initiated. +If load sharing is desired for just a few specific services, the configuration +on LSNAT could be defined to restrict load sharing to just the services desired. .Pp Currently, only the simplest selection algorithm is implemented, where a @@ -596,8 +594,8 @@ The parameter is the pointer returned by either of the redirection functions. If an invalid pointer is passed to .Fn LibAliasRedirectDelete , -then a program crash or unpredictable operation could result, so it is -necessary to be careful using this function. +then a program crash or unpredictable operation could result, so +care is needed when using this function. .Ed .Pp .Ft int @@ -704,7 +702,7 @@ access, or to restrict access to certain .Bd -ragged -offset indent This function specifies that any IP packet with protocol number of .Fa proto -from a given remote address to an alias address be +from a given remote address to an alias address will be redirected to a specified local address. .Pp If @@ -1099,9 +1097,9 @@ SLIST_HEAD(dll_chain, dll) dll_chain ... .Ed .Pp .Va handler_chain -keep tracks of all the protocol handlers loaded, while +keeps track of all the protocol handlers loaded, while .Va ddl_chain -takes care of userland modules loaded. +tracks which userland modules are loaded. .Pp .Va handler_chain is composed of @@ -1123,12 +1121,12 @@ struct proto_handler { where: .Bl -inset .It Va pri -is the priority assigned to a protocol handler, lower +is the priority assigned to a protocol handler; lower priority is better. .It Va dir is the direction of packets: ingoing or outgoing. .It Va proto -says at which protocol this packet belongs: IP, TCP or UDP. +indicates to which protocol this packet belongs: IP, TCP or UDP. .It Va fingerprint points to the fingerprint function while protohandler points to the protocol handler function. @@ -1136,8 +1134,8 @@ to the protocol handler function. .Pp The .Va fingerprint -function has the double of scope of checking if the -incoming packet is found and if it belongs to any categories that this +function has the dual role of checking if the +incoming packet is found, and if it belongs to any categories that this module can handle. .Pp The @@ -1152,8 +1150,8 @@ When a packet enters if it meets a module hook, .Va handler_chain is searched to see if there is an handler that matches -this type of a packet (it checks protocol and direction of packet), then if -more than one handler is found, it starts with the module with +this type of a packet (it checks protocol and direction of packet). +Then, if more than one handler is found, it starts with the module with the lowest priority number: it calls the .Va fingerprint function and interprets the result. @@ -1191,8 +1189,8 @@ structure, then is called. The .Fn find_handler -function is responsible for walking out the handler -chain, it receives as input parameters: +function is responsible for walking the handler +chain; it receives as input parameters: .Bl -tag -width indent .It Fa IN direction @@ -1216,9 +1214,9 @@ supporting INcoming UDP packets. .Pp As was mentioned earlier, .Nm -in userland is a bit different, cause -care has to be taken of module handling too (avoiding duplicate load of -module, avoiding module with same name, etc.) so +in userland is a bit different, as +care must be taken in module handling as well (avoiding duplicate load of +modules, avoiding modules with same name, etc.) so .Va dll_chain was introduced. .Pp @@ -1232,9 +1230,8 @@ When an application calls .Nm first unloads all the loaded modules, then reloads all the modules listed in .Pa /etc/libalias.conf : -for every module loaded, a new entry to -.Va dll_chain -is added. +for every module loaded, a new entry is added to +.Va dll_chain . .Pp .Va dll_chain is composed of @@ -1271,8 +1268,8 @@ There is a module (called .Pa alias_dummy.[ch] ) in .Nm -that can be used as a skeleton for future work, here we analyse some parts of that -module. +that can be used as a skeleton for future work. +Here we analyse some parts of that module. From .Pa alias_dummy.c : .Bd -literal @@ -1285,7 +1282,7 @@ The variable is the .Dq "most important thing" in a module -cause it describes the handlers present and lets the outside world use +since it describes the handlers present and lets the outside world use it in an opaque way. .Pp It must ALWAYS be present in every module, and it MUST retain @@ -1328,7 +1325,7 @@ mod_handler(module_t mod, int type, void .Ed When running as KLD, .Fn mod_handler -register/deregister the module using +registers/deregisters the module using .Fn attach_handlers and .Fn detach_handlers , From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 19:06:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06326106564A; Tue, 26 Jul 2011 19:06:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFD708FC17; Tue, 26 Jul 2011 19:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QJ5xdq022572; Tue, 26 Jul 2011 19:05:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QJ5xom022570; Tue, 26 Jul 2011 19:05:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261905.p6QJ5xom022570@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 19:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224460 - stable/7/sys/netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 19:06:00 -0000 Author: gjb (doc committer) Date: Tue Jul 26 19:05:59 2011 New Revision: 224460 URL: http://svn.freebsd.org/changeset/base/224460 Log: MFC 223773: - General grammar and mdoc(7) fixes. - While here, remove a paragraph about userspace operation that has been outdated for some time. PR: 158623 Modified: stable/7/sys/netinet/libalias/libalias.3 Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/7/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:10 2011 (r224459) +++ stable/7/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:59 2011 (r224460) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd July 04, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -52,7 +52,7 @@ machine on the local network. .Pp A certain amount of flexibility is built into the packet aliasing engine. In the simplest mode of operation, a many-to-one address mapping takes -place between local network and the packet aliasing host. +place between the local network and the packet aliasing host. This is known as IP masquerading. In addition, one-to-one mappings between local and public addresses can also be implemented, which is known as static NAT. @@ -61,15 +61,11 @@ linked to different public addresses, co many-to-one mappings. Also, a given public address and port can be statically redirected to a private address/port. -.Pp -The packet aliasing engine was designed to operate in user space outside -of the kernel, without any access to private kernel data structure, but -the source code can also be ported to a kernel environment. .Sh INITIALIZATION AND CONTROL One special function, .Fn LibAliasInit , -must always be called before any packet handling may be performed and -the returned instance pointer passed to all the other functions. +must always be called before any packet handling may be performed, and +the returned instance pointer must be passed to all the other functions. Normally, the .Fn LibAliasSetAddress function is called afterwards, to set the default aliasing address. @@ -118,8 +114,8 @@ prior to any packet handling. This function has no return value and is used to clear any resources attached to internal data structures. .Pp -This functions should be called when a program stops using the aliasing -engine; it does, amongst other things, clear out any firewall holes. +This function should be called when a program stops using the aliasing +engine; amongst other things, it clears out any firewall holes. To provide backwards compatibility and extra security, it is added to the .Xr atexit 3 @@ -135,7 +131,7 @@ local area network are aliased. All outgoing packets are re-mapped to this address unless overridden by a static address mapping established by .Fn LibAliasRedirectAddr . -If this function is not called, and no static rules match, an outgoing +If this function has not been called, and no static rules match, an outgoing packet retains its source address. .Pp If the @@ -150,7 +146,7 @@ address may or may not change on success If the .Dv PKT_ALIAS_RESET_ON_ADDR_CHANGE mode bit is set to zero, this function can also be used to dynamically change -the aliasing address on a packet to packet basis (it is a low overhead call). +the aliasing address on a packet-to-packet basis (it is a low overhead call). .Pp It is mandatory that this function be called prior to any packet handling. .Ed @@ -170,7 +166,7 @@ The following mode bits are defined in .It Dv PKT_ALIAS_LOG Enables logging into .Pa /var/log/alias.log . -Each time an aliasing link is created or deleted, the log file is appended +Each time an aliasing link is created or deleted, the log file is appended to with the current number of ICMP, TCP and UDP links. Mainly useful for debugging when the log file is viewed continuously with .Xr tail 1 . @@ -186,7 +182,7 @@ Response packets to connections or trans aliasing host or local network will be unaffected. This mode bit is useful for implementing a one-way firewall. .It Dv PKT_ALIAS_SAME_PORTS -If this mode bit is set, the packet aliasing engine will attempt to leave +If this mode bit is set, the packet-aliasing engine will attempt to leave the alias port numbers unchanged from the actual local port numbers. This can be done as long as the quintuple (proto, alias addr, alias port, remote addr, remote port) is unique. @@ -211,7 +207,7 @@ Standard Class A, B and C unregistered a 192.168.0.0 -> 192.168.255.255 (Class C subnets) .Ed .Pp -This option is useful in the case that packet aliasing host has both +This option is useful in the case that the packet aliasing host has both registered and unregistered subnets on different interfaces. The registered subnet is fully accessible to the outside world, so traffic from it does not need to be passed through the packet aliasing engine. @@ -229,8 +225,9 @@ of an address change. .It Dv PKT_ALIAS_PUNCH_FW This option makes .Nm -`punch holes' in an -.Xr ipfirewall 4 +.Dq punch holes +in an +.Xr ipfirewall 4 - based firewall for FTP/IRC DCC connections. The holes punched are bound by from/to IP address and port; it will not be possible to use a hole for another connection. @@ -240,9 +237,9 @@ To cater to unexpected death of a progra (e.g.\& kill -9), changing the state of the flag will clear the entire firewall range allocated for holes. -This will also happen on the initial call to -.Fn LibAliasSetFWBase . -This call must happen prior to setting this flag. +This clearing will also happen on the initial call to +.Fn LibAliasSetFWBase , +which must happen prior to setting this flag. .It Dv PKT_ALIAS_REVERSE This option makes .Nm @@ -263,10 +260,10 @@ below for details. .Ft void .Fn LibAliasSetFWBase "struct libalias *" "unsigned int base" "unsigned int num" .Bd -ragged -offset indent -Set firewall range allocated for punching firewall holes (with the +Set the firewall range allocated for punching firewall holes (with the .Dv PKT_ALIAS_PUNCH_FW flag). -The range will be cleared for all rules on initialization. +The range is cleared for all rules on initialization. .Ed .Pp .Ft void @@ -292,7 +289,7 @@ the two packet handling functions, .Fn LibAliasIn and .Fn LibAliasOut , -comprise minimal set of functions needed for a basic IP masquerading +comprise the minimal set of functions needed for a basic IP masquerading implementation. .Pp .Ft int @@ -313,11 +310,11 @@ Return codes: The packet aliasing process was successful. .It Dv PKT_ALIAS_IGNORED The packet was ignored and not de-aliased. -This can happen if the protocol is unrecognized, possibly an ICMP message -type is not handled or if incoming packets for new connections are being -ignored (if +This can happen if the protocol is unrecognized, as for an ICMP message +type that is not handled, or if incoming packets for new connections are being +ignored (if the .Dv PKT_ALIAS_DENY_INCOMING -mode bit was set by +mode bit was set using .Fn LibAliasSetMode ) . .It Dv PKT_ALIAS_UNRESOLVED_FRAGMENT This is returned when a fragment cannot be resolved because the header @@ -408,7 +405,7 @@ is called to change the address after .Fn LibAliasRedirectPort is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then .Fa local_addr and .Fa local_port @@ -423,7 +420,7 @@ Likewise, if .Fa remote_port is zero, this indicates to redirect packets originating from any remote port number. -Almost always, the remote port specification will be zero, but non-zero +The remote port specification will almost always be zero, but non-zero remote addresses can sometimes be useful for firewalling. If two calls to .Fn LibAliasRedirectPort @@ -475,9 +472,10 @@ is called to change the address after .Fn LibAliasRedirectAddr is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then the .Fa local_addr -is ignored, and is selected dynamically from the server pool, as described in +argument is ignored, and is selected dynamically from the server pool, +as described in .Fn LibAliasAddServer below. .Pp @@ -532,12 +530,12 @@ up for Load Sharing using IP Network Add LSNAT operates as follows. A client attempts to access a server by using the server virtual address. The LSNAT router transparently redirects the request to one of the hosts -in server pool, selected using a real-time load sharing algorithm. +in the server pool, using a real-time load sharing algorithm. Multiple sessions may be initiated from the same client, and each session -could be directed to a different host based on load balance across server -pool hosts at the time. -If load share is desired for just a few specific services, the configuration -on LSNAT could be defined to restrict load share for just the services +could be directed to a different host based on the load balance across server +pool hosts when the sessions are initiated. +If load sharing is desired for just a few specific services, the configuration +on LSNAT could be defined to restrict load sharing to just the services desired. .Pp Currently, only the simplest selection algorithm is implemented, where a @@ -596,8 +594,8 @@ The parameter is the pointer returned by either of the redirection functions. If an invalid pointer is passed to .Fn LibAliasRedirectDelete , -then a program crash or unpredictable operation could result, so it is -necessary to be careful using this function. +then a program crash or unpredictable operation could result, so +care is needed when using this function. .Ed .Pp .Ft int @@ -704,7 +702,7 @@ access, or to restrict access to certain .Bd -ragged -offset indent This function specifies that any IP packet with protocol number of .Fa proto -from a given remote address to an alias address be +from a given remote address to an alias address will be redirected to a specified local address. .Pp If @@ -1099,9 +1097,9 @@ SLIST_HEAD(dll_chain, dll) dll_chain ... .Ed .Pp .Va handler_chain -keep tracks of all the protocol handlers loaded, while +keeps track of all the protocol handlers loaded, while .Va ddl_chain -takes care of userland modules loaded. +tracks which userland modules are loaded. .Pp .Va handler_chain is composed of @@ -1123,12 +1121,12 @@ struct proto_handler { where: .Bl -inset .It Va pri -is the priority assigned to a protocol handler, lower +is the priority assigned to a protocol handler; lower priority is better. .It Va dir is the direction of packets: ingoing or outgoing. .It Va proto -says at which protocol this packet belongs: IP, TCP or UDP. +indicates to which protocol this packet belongs: IP, TCP or UDP. .It Va fingerprint points to the fingerprint function while protohandler points to the protocol handler function. @@ -1136,8 +1134,8 @@ to the protocol handler function. .Pp The .Va fingerprint -function has the double of scope of checking if the -incoming packet is found and if it belongs to any categories that this +function has the dual role of checking if the +incoming packet is found, and if it belongs to any categories that this module can handle. .Pp The @@ -1152,8 +1150,8 @@ When a packet enters if it meets a module hook, .Va handler_chain is searched to see if there is an handler that matches -this type of a packet (it checks protocol and direction of packet), then if -more than one handler is found, it starts with the module with +this type of a packet (it checks protocol and direction of packet). +Then, if more than one handler is found, it starts with the module with the lowest priority number: it calls the .Va fingerprint function and interprets the result. @@ -1191,8 +1189,8 @@ structure, then is called. The .Fn find_handler -function is responsible for walking out the handler -chain, it receives as input parameters: +function is responsible for walking the handler +chain; it receives as input parameters: .Bl -tag -width indent .It Fa IN direction @@ -1216,9 +1214,9 @@ supporting INcoming UDP packets. .Pp As was mentioned earlier, .Nm -in userland is a bit different, cause -care has to be taken of module handling too (avoiding duplicate load of -module, avoiding module with same name, etc.) so +in userland is a bit different, as +care must be taken in module handling as well (avoiding duplicate load of +modules, avoiding modules with same name, etc.) so .Va dll_chain was introduced. .Pp @@ -1232,9 +1230,8 @@ When an application calls .Nm first unloads all the loaded modules, then reloads all the modules listed in .Pa /etc/libalias.conf : -for every module loaded, a new entry to -.Va dll_chain -is added. +for every module loaded, a new entry is added to +.Va dll_chain . .Pp .Va dll_chain is composed of @@ -1271,8 +1268,8 @@ There is a module (called .Pa alias_dummy.[ch] ) in .Nm -that can be used as a skeleton for future work, here we analyse some parts of that -module. +that can be used as a skeleton for future work. +Here we analyse some parts of that module. From .Pa alias_dummy.c : .Bd -literal @@ -1285,7 +1282,7 @@ The variable is the .Dq "most important thing" in a module -cause it describes the handlers present and lets the outside world use +since it describes the handlers present and lets the outside world use it in an opaque way. .Pp It must ALWAYS be present in every module, and it MUST retain @@ -1328,7 +1325,7 @@ mod_handler(module_t mod, int type, void .Ed When running as KLD, .Fn mod_handler -register/deregister the module using +registers/deregisters the module using .Fn attach_handlers and .Fn detach_handlers , From owner-svn-src-all@FreeBSD.ORG Tue Jul 26 20:51:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 689531065670; Tue, 26 Jul 2011 20:51:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DC1F8FC12; Tue, 26 Jul 2011 20:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QKpx7R025930; Tue, 26 Jul 2011 20:51:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QKpxm8025928; Tue, 26 Jul 2011 20:51:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107262051.p6QKpxm8025928@svn.freebsd.org> From: Rick Macklem Date: Tue, 26 Jul 2011 20:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224461 - stable/8/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 20:51:59 -0000 Author: rmacklem Date: Tue Jul 26 20:51:58 2011 New Revision: 224461 URL: http://svn.freebsd.org/changeset/base/224461 Log: MFC: r223954 Try and fix the exports.5 man page so that it clarifies how NFSv4 exports are handled. Improved by comments from mckusick, kudak at mit.edu and bde. This is a content change. Modified: stable/8/usr.sbin/mountd/exports.5 Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/exports.5 ============================================================================== --- stable/8/usr.sbin/mountd/exports.5 Tue Jul 26 19:05:59 2011 (r224460) +++ stable/8/usr.sbin/mountd/exports.5 Tue Jul 26 20:51:58 2011 (r224461) @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd June 30, 2008 +.Dd July 12, 2011 .Dt EXPORTS 5 .Os .Sh NAME @@ -72,6 +72,13 @@ that can be mounted on by the correspond There are three forms of this specification. The first is to list all mount points as absolute directory paths separated by whitespace. +This list of directory paths should be considered an +.Dq administrative control , +since it is only enforced by the +.Xr mountd 8 +daemon and not the kernel. +As such, it only applies to NFSv2 and NFSv3 mounts and only +with respect to the client's use of the mount protocol. The second is to specify the pathname of the root of the file system followed by the .Fl alldirs @@ -81,8 +88,21 @@ including regular files if the .Fl r option is used on .Xr mountd 8 . +Because NFSv4 does not use the mount protocol, +the +.Dq administrative controls +are not applied. +Thus, all the above export line(s) should be considered to have the +.Fl alldirs +flag, even if the line is specified without it. The third form has the string ``V4:'' followed by a single absolute path name, to specify the NFSv4 tree root. +This line does not export any file system, but simply marks where the root +of the server's directory tree is for NFSv4 clients. +The exported file systems for NFSv4 are specified via the other lines +in the +.Xr exports 5 +file in the same way as for NFSv2 and NFSv3. The pathnames must not have any symbolic links in them and should not have any .Dq Pa \&. From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 01:56:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A60B106564A; Wed, 27 Jul 2011 01:56:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED48B8FC12; Wed, 27 Jul 2011 01:56:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R1uq38035837; Wed, 27 Jul 2011 01:56:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R1uquD035835; Wed, 27 Jul 2011 01:56:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107270156.p6R1uquD035835@svn.freebsd.org> From: Glen Barber Date: Wed, 27 Jul 2011 01:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 01:56:53 -0000 Author: gjb (doc committer) Date: Wed Jul 27 01:56:52 2011 New Revision: 224462 URL: http://svn.freebsd.org/changeset/base/224462 Log: MFC 224286: Document the potential for jail escape. PR: 142341 Modified: stable/8/usr.sbin/jail/jail.8 Directory Properties: stable/8/usr.sbin/jail/ (props changed) Modified: stable/8/usr.sbin/jail/jail.8 ============================================================================== --- stable/8/usr.sbin/jail/jail.8 Tue Jul 26 20:51:58 2011 (r224461) +++ stable/8/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -913,3 +913,10 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. +.Sh NOTES +Great care should be taken when managing directories visible within the jail. +For example, if a jailed process has its current working directory set to a +directory that is moved out of the jail's chroot, then the process may gain +access to the file space outside of the jail. +It is recommended that directories always be copied, rather than moved, out +of a jail. From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 01:57:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F51106568C; Wed, 27 Jul 2011 01:57:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50518FC16; Wed, 27 Jul 2011 01:57:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R1vOhW035895; Wed, 27 Jul 2011 01:57:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R1vOwZ035893; Wed, 27 Jul 2011 01:57:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107270157.p6R1vOwZ035893@svn.freebsd.org> From: Glen Barber Date: Wed, 27 Jul 2011 01:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224463 - stable/7/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 01:57:25 -0000 Author: gjb (doc committer) Date: Wed Jul 27 01:57:24 2011 New Revision: 224463 URL: http://svn.freebsd.org/changeset/base/224463 Log: MFC 224286: Document the potential for jail escape. PR: 142341 Modified: stable/7/usr.sbin/jail/jail.8 Directory Properties: stable/7/usr.sbin/jail/ (props changed) Modified: stable/7/usr.sbin/jail/jail.8 ============================================================================== --- stable/7/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) +++ stable/7/usr.sbin/jail/jail.8 Wed Jul 27 01:57:24 2011 (r224463) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -708,3 +708,10 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. +.Sh NOTES +Great care should be taken when managing directories visible within the jail. +For example, if a jailed process has its current working directory set to a +directory that is moved out of the jail's chroot, then the process may gain +access to the file space outside of the jail. +It is recommended that directories always be copied, rather than moved, out +of a jail. From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 04:10:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BCAD106566C; Wed, 27 Jul 2011 04:10:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C0D8FC14; Wed, 27 Jul 2011 04:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R4AXuD040345; Wed, 27 Jul 2011 04:10:33 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R4AXc3040342; Wed, 27 Jul 2011 04:10:33 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107270410.p6R4AXc3040342@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 27 Jul 2011 04:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 04:10:33 -0000 Author: ae Date: Wed Jul 27 04:10:32 2011 New Revision: 224464 URL: http://svn.freebsd.org/changeset/base/224464 Log: MFC r223587: MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify disk drive. The boot0cfg(8) utility preserves these 4 bytes when it is writing bootcode to keep a multiboot ability. Change gpart's bootcode method to keep DSN if it is not zero. Also do not allow writing bootcode with size not equal to MBRSIZE. PR: kern/157819 Modified: stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/sys/diskmbr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 01:57:24 2011 (r224463) +++ stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 04:10:32 2011 (r224464) @@ -234,14 +234,16 @@ static int g_part_mbr_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_part_mbr_table *table; - size_t codesz; + uint32_t dsn; + + if (gpp->gpp_codesize != MBRSIZE) + return (ENODEV); - codesz = DOSPARTOFF; table = (struct g_part_mbr_table *)basetable; - bzero(table->mbr, codesz); - codesz = MIN(codesz, gpp->gpp_codesize); - if (codesz > 0) - bcopy(gpp->gpp_codeptr, table->mbr, codesz); + dsn = *(uint32_t *)(table->mbr + DOSDSNOFF); + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); + if (dsn != 0) + *(uint32_t *)(table->mbr + DOSDSNOFF) = dsn; return (0); } Modified: stable/8/sys/sys/diskmbr.h ============================================================================== --- stable/8/sys/sys/diskmbr.h Wed Jul 27 01:57:24 2011 (r224463) +++ stable/8/sys/sys/diskmbr.h Wed Jul 27 04:10:32 2011 (r224464) @@ -36,6 +36,7 @@ #include #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ #define DOSPARTOFF 446 #define DOSPARTSIZE 16 #define NDOSPART 4 From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 04:23:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E288A1065672; Wed, 27 Jul 2011 04:23:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845C38FC14; Wed, 27 Jul 2011 04:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R4NQvT040775; Wed, 27 Jul 2011 04:23:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R4NQE0040773; Wed, 27 Jul 2011 04:23:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107270423.p6R4NQE0040773@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 27 Jul 2011 04:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224465 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 04:23:27 -0000 Author: ae Date: Wed Jul 27 04:23:26 2011 New Revision: 224465 URL: http://svn.freebsd.org/changeset/base/224465 Log: MFC r216754: Make EBR probe method less strictly to be able detect EBRs with small non fatal inconsistency. EBR may contain boot loader and sometimes it just has some garbage data. Now this does not prevent FreeBSD to use extended partitions. But since we do not support bootcode for EBR we mark tables which have non empty boot area as corrupt. This does make them readonly and we can not damage this data. MFC r223594: EBR could contain an early stage of boot code. But we do not support it. Remove message about non empty bootcode, we can not break something while GEOM_PART_EBR_COMPAT is defined. But without GEOM_PART_EBR_COMPAT any changes in EBR are allowed and we can accidentally wipe the boot code. To do not break anything save the first EBR chunk and keep it untouched each time when we are changing EBR. Note that we are still not support boot code for EBR. PR: kern/141235 Modified: stable/8/sys/geom/part/g_part_ebr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/8/sys/geom/part/g_part_ebr.c Wed Jul 27 04:10:32 2011 (r224464) +++ stable/8/sys/geom/part/g_part_ebr.c Wed Jul 27 04:23:26 2011 (r224465) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); struct g_part_ebr_table { struct g_part_table base; +#ifndef GEOM_PART_EBR_COMPAT + u_char ebr[EBRSIZE]; +#endif }; struct g_part_ebr_entry { @@ -395,7 +398,7 @@ g_part_ebr_probe(struct g_part_table *ta char psn[8]; struct g_provider *pp; u_char *buf, *p; - int error, index, res, sum; + int error, index, res; uint16_t magic; pp = cp->provider; @@ -427,29 +430,11 @@ g_part_ebr_probe(struct g_part_table *ta if (magic != DOSMAGIC) goto out; - /* - * The sector is all zeroes, except for the partition entries, - * pseudo boot code and some signatures or disk serial number. - * The latter can be found in the 9 bytes immediately in front - * of the partition table. - */ - sum = 0; - for (index = 96; index < DOSPARTOFF - 9; index++) - sum += buf[index]; - if (sum != 0) - goto out; - - for (index = 0; index < NDOSPART; index++) { + for (index = 0; index < 2; index++) { p = buf + DOSPARTOFF + index * DOSPARTSIZE; if (p[0] != 0 && p[0] != 0x80) goto out; - if (index < 2) - continue; - /* The 3rd & 4th entries are always zero. */ - if ((le64dec(p+0) + le64dec(p+8)) != 0) - goto out; } - res = G_PART_PROBE_PRI_NORM; out: @@ -483,6 +468,19 @@ g_part_ebr_read(struct g_part_table *bas ebr_entry_decode(buf + DOSPARTOFF + 0 * DOSPARTSIZE, ent + 0); ebr_entry_decode(buf + DOSPARTOFF + 1 * DOSPARTSIZE, ent + 1); + + /* The 3rd & 4th entries should be zeroes. */ + if (le64dec(buf + DOSPARTOFF + 2 * DOSPARTSIZE) + + le64dec(buf + DOSPARTOFF + 3 * DOSPARTSIZE) != 0) { + basetable->gpt_corrupt = 1; + printf("GEOM: %s: invalid entries in the EBR ignored.\n", + pp->name); + } +#ifndef GEOM_PART_EBR_COMPAT + /* Save the first EBR, it can contain a boot code */ + if (lba == 0) + bcopy(buf, table->ebr, sizeof(table->ebr)); +#endif g_free(buf); if (ent[0].dp_typ == 0) @@ -570,6 +568,9 @@ g_part_ebr_type(struct g_part_table *bas static int g_part_ebr_write(struct g_part_table *basetable, struct g_consumer *cp) { +#ifndef GEOM_PART_EBR_COMPAT + struct g_part_ebr_table *table; +#endif struct g_provider *pp; struct g_part_entry *baseentry, *next; struct g_part_ebr_entry *entry; @@ -579,6 +580,10 @@ g_part_ebr_write(struct g_part_table *ba pp = cp->provider; buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); +#ifndef GEOM_PART_EBR_COMPAT + table = (struct g_part_ebr_table *)basetable; + bcopy(table->ebr, buf, DOSPARTOFF); +#endif le16enc(buf + DOSMAGICOFFSET, DOSMAGIC); baseentry = LIST_FIRST(&basetable->gpt_entry); @@ -631,7 +636,10 @@ g_part_ebr_write(struct g_part_table *ba error = g_write_data(cp, baseentry->gpe_start * pp->sectorsize, buf, pp->sectorsize); - +#ifndef GEOM_PART_EBR_COMPAT + if (baseentry->gpe_start == 0) + bzero(buf, DOSPARTOFF); +#endif baseentry = next; } while (!error && baseentry != NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 06:24:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01A04106564A; Wed, 27 Jul 2011 06:24:24 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 609388FC0C; Wed, 27 Jul 2011 06:24:23 +0000 (UTC) Received: by yxl31 with SMTP id 31so650356yxl.13 for ; Tue, 26 Jul 2011 23:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=TvkPTOAL5xfuAtC1TfF/6/g4vxKkBNRHdUuW+yY0Q+k=; b=K6EfmJbn1jilcGIcSr8lVsfWD7m+mD/FcOi7iaaxDfER0kRq68opsw1I+nLZOle8ZT RoEVF27DukWLBqUxg2uZqbKZKW1PtIPxdho6sGlwgfs+UVp31iwCtZkSeTOL0x/0yF5S kWet7YSSDDsb6WerqxvKLDCW6cRMhHgVKHK7c= MIME-Version: 1.0 Received: by 10.150.179.18 with SMTP id b18mr6256843ybf.130.1311747862275; Tue, 26 Jul 2011 23:24:22 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.150.200.3 with HTTP; Tue, 26 Jul 2011 23:24:21 -0700 (PDT) In-Reply-To: <201107210920.09604.jhb@freebsd.org> References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <201107210920.09604.jhb@freebsd.org> Date: Wed, 27 Jul 2011 10:24:21 +0400 X-Google-Sender-Auth: 361zTEAcNqPB-kFnZqFPux-2rVI Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , Robert Watson , Pan Tsu , svn-src-head@freebsd.org, Sean Bruno Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 06:24:24 -0000 On 21 July 2011 17:20, John Baldwin wrote: > On Thursday, July 21, 2011 8:37:26 am Sergey Kandaurov wrote: >> On 21 July 2011 14:14, Attilio Rao wrote: >> > 2011/7/20 Pan Tsu : >> >> Attilio Rao writes: >> >> >> >>> Author: attilio >> >>> Date: Tue Jul 19 13:00:30 2011 >> >>> New Revision: 224217 >> >>> URL: http://svn.freebsd.org/changeset/base/224217 >> >>> >> >>> Log: >> >>> =A0 Bump MAXCPU for amd64, ia64 and XLP mips appropriately. >> >>> =A0 From now on, default values for FreeBSD will be 64 maxiumum supp= orted >> >>> =A0 CPUs on amd64 and ia64 and 128 for XLP. All the other architectu= res >> >>> =A0 seem already capped appropriately (with the exception of sparc64= which >> >>> =A0 needs further support on jalapeno flavour). >> >>> >> >>> =A0 Bump __FreeBSD_version in order to reflect KBI/KPI brekage intro= duced >> >>> =A0 during the infrastructure cleanup for supporting MAXCPU > 32. Th= is >> >>> =A0 covers cpumask_t retiral too. >> >>> >> >>> =A0 The switch is considered completed at the present time, so for > whatever >> >>> =A0 bug you may experience that is reconducible to that area, please > report >> >>> =A0 immediately. >> >>> >> >>> =A0 Requested by: =A0 =A0 =A0 marcel, jchandra >> >>> =A0 Tested by: =A0pluknet, sbruno >> >>> =A0 Approved by: =A0 =A0 =A0 =A0re (kib) >> >>> >> >>> Modified: >> >>> =A0 head/sys/amd64/include/param.h >> >>> =A0 head/sys/ia64/include/param.h >> >>> =A0 head/sys/mips/conf/XLP >> >>> =A0 head/sys/mips/conf/XLP64 >> >>> =A0 head/sys/mips/conf/XLPN32 >> >>> =A0 head/sys/sys/param.h >> >>> >> >>> Modified: head/sys/amd64/include/param.h >> >>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> >>> --- head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 12:41:57 2011 > =A0(r224216) >> >>> +++ head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 13:00:30 2011 > =A0(r224217) >> >>> @@ -65,7 +65,7 @@ >> >>> >> >>> =A0#if defined(SMP) || defined(KLD_MODULE) >> >>> =A0#ifndef MAXCPU >> >>> -#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 32 >> >>> +#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 64 >> >>> =A0#endif >> >>> =A0#else >> >>> =A0#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 >> >> >> >> Do you plan to bump MEMSTAT_MAXCPU, too? >> >> >> >> =A0$ vmstat -z >> >> =A0vmstat: memstat_sysctl_uma: Too many CPUs >> >> =A0$ vmstat -m >> >> =A0vmstat: memstat_sysctl_malloc: Too many CPUs >> >> >> >> =A0$ sysctl kern. | grep smp.\*cpus >> >> =A0kern.smp.maxcpus: 64 >> >> =A0kern.smp.cpus: 2 >> >> >> > >> > Jeeeez, we seriously need to fix this getting rid of the static values= . >> > >> > Anyway, can you try the following patch?: >> > http://www.freebsd.org/~attilio/memstat_maxcpu.diff >> > >> > It is going to add some memory overhead for i386 case. >> > >> >> Something like this should work (vmstat -z, vmstat -m both work). >> It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime. >> http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff >> >> Probably it should work with maxid, instead of maxcpu to save some memor= y. >> Though, using maxcpu is more safe. > > Actually, I would prefer that it use mp_maxid as that is the general vari= able > things should use. =A0mp_maxcpus is a concession for the few places that = may > need to know the MAXCPUS value (e.g. if using libkvm to access a structur= e in > a crashdump or live kernel that has a member array with MAXCPU elements). > Code that just wants to allocate memory to hold per-CPU data should use > mp_maxid whenever possible. > Hi, I changed the patch to use mp_maxid wherever possible. http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.2.diff To summarize: 1) malloc stats kern.malloc_stats uses internally MAXCPU, and we have to query MAXCPU from kernel, too. See kern/kern_malloc.c:sysctl_kern_malloc_stats(): 849 mtsh.mtsh_maxcpus =3D MAXCPU; 1a) memstat_sysctl_malloc() left unchanged, sysctl kern.smp.maxcpus 1b) memstat_kvm_malloc() left unchanged, _mp_maxcpus symbol 2) uma stats vm.zone_stats uses (mp_maxid + 1), vm/uma_core.c:sysctl_vm_zone_stats(): 3247 ush.ush_maxcpus =3D (mp_maxid + 1); 2a) memstat_sysctl_uma() Switched to query sysctl kern.smp.maxid 2b) memstat_kvm_uma() left unchanged, _mp_maxid symbol So, there's only one change in memstat_sysctl_uma(). A bad side of things is that libmemstat() now knows these vm_zone and malloc_stats internals. As Robert suggested me on IRC to query maxcpu value from uma_stream_header and malloc_type_stream_header structures respectively to be independent from kernel details. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 07:02:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5843106566B; Wed, 27 Jul 2011 07:02:33 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 947128FC13; Wed, 27 Jul 2011 07:02:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6R72XXd045472; Wed, 27 Jul 2011 07:02:33 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R72XC6045470; Wed, 27 Jul 2011 07:02:33 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201107270702.p6R72XC6045470@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 27 Jul 2011 07:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224466 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 07:02:33 -0000 Author: maxim Date: Wed Jul 27 07:02:33 2011 New Revision: 224466 URL: http://svn.freebsd.org/changeset/base/224466 Log: MFC r223846 by thompsa: grab the rlock before checking if our interface is enabled. Approved by: thompsa Modified: stable/8/sys/net/if_lagg.c Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Wed Jul 27 04:23:26 2011 (r224465) +++ stable/8/sys/net/if_lagg.c Wed Jul 27 07:02:33 2011 (r224466) @@ -1213,14 +1213,15 @@ lagg_input(struct ifnet *ifp, struct mbu struct lagg_softc *sc = lp->lp_softc; struct ifnet *scifp = sc->sc_ifp; + LAGG_RLOCK(sc); if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (lp->lp_flags & LAGG_PORT_DISABLED) || sc->sc_proto == LAGG_PROTO_NONE) { + LAGG_RUNLOCK(sc); m_freem(m); return (NULL); } - LAGG_RLOCK(sc); ETHER_BPF_MTAP(scifp, m); m = (*sc->sc_input)(sc, lp, m); From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 11:21:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47EDA1065674; Wed, 27 Jul 2011 11:21:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 361788FC0A; Wed, 27 Jul 2011 11:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6RBLoEU055176; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6RBLon3055171; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107271121.p6RBLon3055171@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jul 2011 11:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224467 - in stable/8/lib/libthr/arch/sparc64: . include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 11:21:50 -0000 Author: marius Date: Wed Jul 27 11:21:49 2011 New Revision: 224467 URL: http://svn.freebsd.org/changeset/base/224467 Log: MFC: r223228 Merge from r161730: o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. Merge from r161840: Stylize: avoid using a global register variable. Merge from r157461: Simplify _get_curthread() and _tcb_ctor because libc and rtld now already allocate thread pointer space in tls block for initial thread. Merge from r177853: Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. Added: stable/8/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S - copied unchanged from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Modified: stable/8/lib/libthr/arch/sparc64/Makefile.inc stable/8/lib/libthr/arch/sparc64/include/pthread_md.h stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- stable/8/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 07:02:33 2011 (r224466) +++ stable/8/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:49 2011 (r224467) @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Modified: stable/8/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- stable/8/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 07:02:33 2011 (r224466) +++ stable/8/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:49 2011 (r224467) @@ -50,10 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -register struct tcb *_tp __asm("%g7"); - -#define _tcb (_tp) - /* * The tcb constructors. */ @@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - _tp = tcb; + + __asm __volatile("mov %0, %%g7" : : "r" (tcb)); } -/* - * Get the current tcb. - */ static __inline struct tcb * _tcb_get(void) { - return (_tcb); -} + register struct tcb *tp __asm("%g7"); -extern struct pthread *_thr_initial; + return (tp); +} static __inline struct pthread * _get_curthread(void) { - if (_thr_initial) - return (_tcb->tcb_thread); - return (NULL); + + return (_tcb_get()->tcb_thread); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Copied: stable/8/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S (from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Wed Jul 27 11:21:49 2011 (r224467, copy of r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +ENTRY(_umtx_op_err) + mov SYS__umtx_op, %g1 + retl + ta %xcc, ST_SYSCALL +END(_umtx_op_err) Modified: stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c ============================================================================== --- stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 07:02:33 2011 (r224466) +++ stable/8/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:49 2011 (r224467) @@ -24,10 +24,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include @@ -37,13 +38,11 @@ struct tcb * _tcb_ctor(struct pthread *thread, int initial) { struct tcb *tcb; - void *oldtls; if (initial) - oldtls = _tp; + tcb = _tcb_get(); else - oldtls = NULL; - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); + tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; return (tcb); @@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int in void _tcb_dtor(struct tcb *tcb) { + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 11:21:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233F6106564A; Wed, 27 Jul 2011 11:21:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1181C8FC0C; Wed, 27 Jul 2011 11:21:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6RBLoq6055212; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6RBLokF055207; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107271121.p6RBLokF055207@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jul 2011 11:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224468 - in stable/7/lib/libthr/arch/sparc64: . include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 11:21:51 -0000 Author: marius Date: Wed Jul 27 11:21:50 2011 New Revision: 224468 URL: http://svn.freebsd.org/changeset/base/224468 Log: MFC: r223228 Merge from r161730: o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. Merge from r161840: Stylize: avoid using a global register variable. Merge from r157461: Simplify _get_curthread() and _tcb_ctor because libc and rtld now already allocate thread pointer space in tls block for initial thread. Merge from r177853: Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. Added: stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S - copied unchanged from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Modified: stable/7/lib/libthr/arch/sparc64/Makefile.inc stable/7/lib/libthr/arch/sparc64/include/pthread_md.h stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- stable/7/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:50 2011 (r224468) @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Modified: stable/7/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- stable/7/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:50 2011 (r224468) @@ -50,10 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -register struct tcb *_tp __asm("%g7"); - -#define _tcb (_tp) - /* * The tcb constructors. */ @@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - _tp = tcb; + + __asm __volatile("mov %0, %%g7" : : "r" (tcb)); } -/* - * Get the current tcb. - */ static __inline struct tcb * _tcb_get(void) { - return (_tcb); -} + register struct tcb *tp __asm("%g7"); -extern struct pthread *_thr_initial; + return (tp); +} static __inline struct pthread * _get_curthread(void) { - if (_thr_initial) - return (_tcb->tcb_thread); - return (NULL); + + return (_tcb_get()->tcb_thread); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Copied: stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S (from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Wed Jul 27 11:21:50 2011 (r224468, copy of r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +ENTRY(_umtx_op_err) + mov SYS__umtx_op, %g1 + retl + ta %xcc, ST_SYSCALL +END(_umtx_op_err) Modified: stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c ============================================================================== --- stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:50 2011 (r224468) @@ -24,10 +24,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include @@ -37,13 +38,11 @@ struct tcb * _tcb_ctor(struct pthread *thread, int initial) { struct tcb *tcb; - void *oldtls; if (initial) - oldtls = _tp; + tcb = _tcb_get(); else - oldtls = NULL; - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); + tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; return (tcb); @@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int in void _tcb_dtor(struct tcb *tcb) { + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 12:50:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36D021065670; Wed, 27 Jul 2011 12:50:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 08A7A8FC17; Wed, 27 Jul 2011 12:50:34 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AF1C146B62; Wed, 27 Jul 2011 08:50:33 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2F5338A037; Wed, 27 Jul 2011 08:50:33 -0400 (EDT) From: John Baldwin To: Sergey Kandaurov Date: Wed, 27 Jul 2011 08:45:39 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <201107210920.09604.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107270845.39419.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 27 Jul 2011 08:50:33 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , Robert Watson , Pan Tsu , svn-src-head@freebsd.org, Sean Bruno Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 12:50:34 -0000 On Wednesday, July 27, 2011 2:24:21 am Sergey Kandaurov wrote: > On 21 July 2011 17:20, John Baldwin wrote: > > On Thursday, July 21, 2011 8:37:26 am Sergey Kandaurov wrote: > >> On 21 July 2011 14:14, Attilio Rao wrote: > >> > 2011/7/20 Pan Tsu : > >> >> Attilio Rao writes: > >> >> > >> >>> Author: attilio > >> >>> Date: Tue Jul 19 13:00:30 2011 > >> >>> New Revision: 224217 > >> >>> URL: http://svn.freebsd.org/changeset/base/224217 > >> >>> > >> >>> Log: > >> >>> Bump MAXCPU for amd64, ia64 and XLP mips appropriately. > >> >>> From now on, default values for FreeBSD will be 64 maxiumum supported > >> >>> CPUs on amd64 and ia64 and 128 for XLP. All the other architectures > >> >>> seem already capped appropriately (with the exception of sparc64 which > >> >>> needs further support on jalapeno flavour). > >> >>> > >> >>> Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced > >> >>> during the infrastructure cleanup for supporting MAXCPU > 32. This > >> >>> covers cpumask_t retiral too. > >> >>> > >> >>> The switch is considered completed at the present time, so for > > whatever > >> >>> bug you may experience that is reconducible to that area, please > > report > >> >>> immediately. > >> >>> > >> >>> Requested by: marcel, jchandra > >> >>> Tested by: pluknet, sbruno > >> >>> Approved by: re (kib) > >> >>> > >> >>> Modified: > >> >>> head/sys/amd64/include/param.h > >> >>> head/sys/ia64/include/param.h > >> >>> head/sys/mips/conf/XLP > >> >>> head/sys/mips/conf/XLP64 > >> >>> head/sys/mips/conf/XLPN32 > >> >>> head/sys/sys/param.h > >> >>> > >> >>> Modified: head/sys/amd64/include/param.h > >> >>> > > ============================================================================== > >> >>> --- head/sys/amd64/include/param.h Tue Jul 19 12:41:57 2011 > > (r224216) > >> >>> +++ head/sys/amd64/include/param.h Tue Jul 19 13:00:30 2011 > > (r224217) > >> >>> @@ -65,7 +65,7 @@ > >> >>> > >> >>> #if defined(SMP) || defined(KLD_MODULE) > >> >>> #ifndef MAXCPU > >> >>> -#define MAXCPU 32 > >> >>> +#define MAXCPU 64 > >> >>> #endif > >> >>> #else > >> >>> #define MAXCPU 1 > >> >> > >> >> Do you plan to bump MEMSTAT_MAXCPU, too? > >> >> > >> >> $ vmstat -z > >> >> vmstat: memstat_sysctl_uma: Too many CPUs > >> >> $ vmstat -m > >> >> vmstat: memstat_sysctl_malloc: Too many CPUs > >> >> > >> >> $ sysctl kern. | grep smp.\*cpus > >> >> kern.smp.maxcpus: 64 > >> >> kern.smp.cpus: 2 > >> >> > >> > > >> > Jeeeez, we seriously need to fix this getting rid of the static values. > >> > > >> > Anyway, can you try the following patch?: > >> > http://www.freebsd.org/~attilio/memstat_maxcpu.diff > >> > > >> > It is going to add some memory overhead for i386 case. > >> > > >> > >> Something like this should work (vmstat -z, vmstat -m both work). > >> It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime. > >> http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff > >> > >> Probably it should work with maxid, instead of maxcpu to save some memory. > >> Though, using maxcpu is more safe. > > > > Actually, I would prefer that it use mp_maxid as that is the general variable > > things should use. mp_maxcpus is a concession for the few places that may > > need to know the MAXCPUS value (e.g. if using libkvm to access a structure in > > a crashdump or live kernel that has a member array with MAXCPU elements). > > Code that just wants to allocate memory to hold per-CPU data should use > > mp_maxid whenever possible. > > > > Hi, > > I changed the patch to use mp_maxid wherever possible. > http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.2.diff > > To summarize: > > 1) malloc stats > kern.malloc_stats uses internally MAXCPU, and we have to query MAXCPU > from kernel, too. See kern/kern_malloc.c:sysctl_kern_malloc_stats(): > 849 mtsh.mtsh_maxcpus = MAXCPU; > > 1a) memstat_sysctl_malloc() > left unchanged, sysctl kern.smp.maxcpus > 1b) memstat_kvm_malloc() > left unchanged, _mp_maxcpus symbol > > 2) uma stats > vm.zone_stats uses (mp_maxid + 1), vm/uma_core.c:sysctl_vm_zone_stats(): > 3247 ush.ush_maxcpus = (mp_maxid + 1); > > 2a) memstat_sysctl_uma() > Switched to query sysctl kern.smp.maxid > 2b) memstat_kvm_uma() > left unchanged, _mp_maxid symbol > > So, there's only one change in memstat_sysctl_uma(). > A bad side of things is that libmemstat() now knows these vm_zone > and malloc_stats internals. > As Robert suggested me on IRC to query maxcpu value from > uma_stream_header and malloc_type_stream_header structures > respectively to be independent from kernel details. Looks good to me, thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 14:41:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2FD106566B; Wed, 27 Jul 2011 14:41:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 541578FC0A; Wed, 27 Jul 2011 14:41:22 +0000 (UTC) Received: by gyf3 with SMTP id 3so1380897gyf.13 for ; Wed, 27 Jul 2011 07:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FmxLelklfaDYaKNlYz+OjwUukO1OdCLquioCCh1IwyI=; b=NhmWhivhyKOy+S/X5fFHZ8KX5ppzHNRCv2nyUX/SjAosOGroFTmdSH1LMTMrHLtovm 6UezbPknz8Ds68AxDq0dox+ojME8uYA12pDZ/IJDUZ8Rfz367Wb7Ly3zqLzz3uXcroSK Y2yNx/2Pzx4yRm7orAQ2LUivz8CYQgLdJ3blA= MIME-Version: 1.0 Received: by 10.151.86.11 with SMTP id o11mr89365ybl.386.1311777681614; Wed, 27 Jul 2011 07:41:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.197.5 with HTTP; Wed, 27 Jul 2011 07:41:21 -0700 (PDT) In-Reply-To: <1311687058.3848.44.camel@buffy.york.ac.uk> References: <201107220939.p6M9dnsR008517@svn.freebsd.org> <1311687058.3848.44.camel@buffy.york.ac.uk> Date: Wed, 27 Jul 2011 22:41:21 +0800 X-Google-Sender-Auth: v0_Il4_iKJ2ails1_vLG8mYJb3M Message-ID: From: Adrian Chadd To: Gavin Atkinson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224267 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 14:41:22 -0000 Hm, nope. I'll double-check this against the reference code and commit a fi= x. Thanks for picking it up! adrian On 26 July 2011 21:30, Gavin Atkinson wrote: > On Fri, 2011-07-22 at 09:39 +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Fri Jul 22 09:39:49 2011 >> New Revision: 224267 >> URL: http://svn.freebsd.org/changeset/base/224267 >> >> Log: >> =A0 Implement a basic radar parameter API in the dfs_null module. >> >> =A0 Since no actual radar data is ever handled, this won't >> =A0 do anything. It's mostly here as a reference for those who >> =A0 wish to experiment with radar detection. >> >> Modified: >> =A0 head/sys/dev/ath/ath_dfs/null/dfs_null.c > > [...] > >> + =A0 =A0 =A0 =A0 =A0 =A0 indata =3D malloc(insize, M_TEMP, M_NOWAIT); >> + =A0 =A0 =A0 =A0 =A0 =A0 if (indata =3D=3D NULL) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D ENOMEM; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto bad; > > Here you return positive errors to indicate a failure... > >> + =A0 =A0 =A0 =A0 =A0 =A0 case DFS_SET_THRESH: >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (insize < sizeof(HAL_PHYERR= _PARAM)) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D -EIN= VAL; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > [...] >> + =A0 =A0 =A0 =A0 =A0 =A0 default: >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D -EINVAL; >> + =A0 =A0 } > [...] >> + =A0 =A0 if (outdata && copyout(outdata, ad->ad_out_data, ad->ad_out_si= ze)) >> + =A0 =A0 =A0 =A0 =A0 =A0 error =3D -EFAULT; > > And for these, you return negative error values. =A0Is this inconsistency > intentional? > > Thanks, > > Gavin > From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 14:43:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2551B106566B; Wed, 27 Jul 2011 14:43:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id B1A748FC0C; Wed, 27 Jul 2011 14:43:24 +0000 (UTC) Received: by yic13 with SMTP id 13so1388029yic.13 for ; Wed, 27 Jul 2011 07:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zqWsDOoLkRCEyTZZAX6Zq+Pch3xRDvgz3hqyNi0hAK0=; b=TUDURWgKEglLNXZFtru+COe/XvVqVKUfE0Fgf7UhxhltyLcrAw63AesX5rVPeFFlQI pRKb0QZz+lZpMHWSArgMV8w4jSp/rANfuSaalUTCDkxiNiNM+aGRv5Fihy5lqjuTg9Ch tz7SHP+aAVIoCob/kdQq2AlLP6sEvDqmR5UbE= MIME-Version: 1.0 Received: by 10.151.86.11 with SMTP id o11mr91417ybl.386.1311777803719; Wed, 27 Jul 2011 07:43:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.197.5 with HTTP; Wed, 27 Jul 2011 07:43:23 -0700 (PDT) In-Reply-To: <1311687058.3848.44.camel@buffy.york.ac.uk> References: <201107220939.p6M9dnsR008517@svn.freebsd.org> <1311687058.3848.44.camel@buffy.york.ac.uk> Date: Wed, 27 Jul 2011 22:43:23 +0800 X-Google-Sender-Auth: 7I1apHERPof02EiF8a2dtbR6vNY Message-ID: From: Adrian Chadd To: Gavin Atkinson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224267 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 14:43:25 -0000 On 26 July 2011 21:30, Gavin Atkinson wrote: [snip code] > And for these, you return negative error values. =A0Is this inconsistency > intentional? Nope; this somehow was incorrectly picked up from the reference code. I wonder if it's due to Linuxisms there.. Thanks, Adrian From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 17:19:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA1E1065672; Wed, 27 Jul 2011 17:19:05 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.freebsd.org (Postfix) with ESMTP id 8900C8FC14; Wed, 27 Jul 2011 17:19:05 +0000 (UTC) Received: from [127.0.0.1] (cheese.corp.yahoo.com [216.145.50.99]) by mrout2.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id p6RH8EIt007926; Wed, 27 Jul 2011 10:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1311786494; bh=7k9rjDsUHxBRzWrHRpYqZPvOX4hsL9QmSJRa9bVb+zA=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=fxe1d0Hp4mFZEr4DvqXrWTjd4kapsxniq7bmEx0F6VVW/SG0v1Bd9LEGKKLkF4Cns Bz5CETPTykFKRAc2/I1ee8bB2M8xzhk0O8EYDXVGvBAooTCvtHUR7KEeFijixmWHo5 G+WuYdHzmbo8Ywen/0z1V52Jiv7lqtDKS5rdt01U= From: Sean Bruno To: John Baldwin In-Reply-To: <201107270845.39419.jhb@freebsd.org> References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <201107210920.09604.jhb@freebsd.org> <201107270845.39419.jhb@freebsd.org> Content-Type: text/plain; charset="UTF-8" Date: Wed, 27 Jul 2011 10:08:14 -0700 Message-ID: <1311786494.2592.5.camel@hitfishpass-lx.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 (2.32.2-1.fc14) Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Attilio Rao , Sergey Kandaurov , Robert Watson , Pan Tsu , "svn-src-head@freebsd.org" Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 17:19:05 -0000 On Wed, 2011-07-27 at 05:45 -0700, John Baldwin wrote: > On Wednesday, July 27, 2011 2:24:21 am Sergey Kandaurov wrote: > > On 21 July 2011 17:20, John Baldwin wrote: > > > On Thursday, July 21, 2011 8:37:26 am Sergey Kandaurov wrote: > > >> On 21 July 2011 14:14, Attilio Rao wrote: > > >> > 2011/7/20 Pan Tsu : > > >> >> Attilio Rao writes: > > >> >> > > >> >>> Author: attilio > > >> >>> Date: Tue Jul 19 13:00:30 2011 > > >> >>> New Revision: 224217 > > >> >>> URL: http://svn.freebsd.org/changeset/base/224217 > > >> >>> > > >> >>> Log: > > >> >>> Bump MAXCPU for amd64, ia64 and XLP mips appropriately. > > >> >>> From now on, default values for FreeBSD will be 64 maxiumum supported > > >> >>> CPUs on amd64 and ia64 and 128 for XLP. All the other architectures > > >> >>> seem already capped appropriately (with the exception of sparc64 which > > >> >>> needs further support on jalapeno flavour). > > >> >>> > > >> >>> Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced > > >> >>> during the infrastructure cleanup for supporting MAXCPU > 32. This > > >> >>> covers cpumask_t retiral too. > > >> >>> > > >> >>> The switch is considered completed at the present time, so for > > > whatever > > >> >>> bug you may experience that is reconducible to that area, please > > > report > > >> >>> immediately. > > >> >>> > > >> >>> Requested by: marcel, jchandra > > >> >>> Tested by: pluknet, sbruno > > >> >>> Approved by: re (kib) > > >> >>> > > >> >>> Modified: > > >> >>> head/sys/amd64/include/param.h > > >> >>> head/sys/ia64/include/param.h > > >> >>> head/sys/mips/conf/XLP > > >> >>> head/sys/mips/conf/XLP64 > > >> >>> head/sys/mips/conf/XLPN32 > > >> >>> head/sys/sys/param.h > > >> >>> > > >> >>> Modified: head/sys/amd64/include/param.h > > >> >>> > > > ============================================================================== > > >> >>> --- head/sys/amd64/include/param.h Tue Jul 19 12:41:57 2011 > > > (r224216) > > >> >>> +++ head/sys/amd64/include/param.h Tue Jul 19 13:00:30 2011 > > > (r224217) > > >> >>> @@ -65,7 +65,7 @@ > > >> >>> > > >> >>> #if defined(SMP) || defined(KLD_MODULE) > > >> >>> #ifndef MAXCPU > > >> >>> -#define MAXCPU 32 > > >> >>> +#define MAXCPU 64 > > >> >>> #endif > > >> >>> #else > > >> >>> #define MAXCPU 1 > > >> >> > > >> >> Do you plan to bump MEMSTAT_MAXCPU, too? > > >> >> > > >> >> $ vmstat -z > > >> >> vmstat: memstat_sysctl_uma: Too many CPUs > > >> >> $ vmstat -m > > >> >> vmstat: memstat_sysctl_malloc: Too many CPUs > > >> >> > > >> >> $ sysctl kern. | grep smp.\*cpus > > >> >> kern.smp.maxcpus: 64 > > >> >> kern.smp.cpus: 2 > > >> >> > > >> > > > >> > Jeeeez, we seriously need to fix this getting rid of the static values. > > >> > > > >> > Anyway, can you try the following patch?: > > >> > http://www.freebsd.org/~attilio/memstat_maxcpu.diff > > >> > > > >> > It is going to add some memory overhead for i386 case. > > >> > > > >> > > >> Something like this should work (vmstat -z, vmstat -m both work). > > >> It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime. > > >> http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff > > >> > > >> Probably it should work with maxid, instead of maxcpu to save some memory. > > >> Though, using maxcpu is more safe. > > > > > > Actually, I would prefer that it use mp_maxid as that is the general variable > > > things should use. mp_maxcpus is a concession for the few places that may > > > need to know the MAXCPUS value (e.g. if using libkvm to access a structure in > > > a crashdump or live kernel that has a member array with MAXCPU elements). > > > Code that just wants to allocate memory to hold per-CPU data should use > > > mp_maxid whenever possible. > > > > > > > Hi, > > > > I changed the patch to use mp_maxid wherever possible. > > http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.2.diff > > > > To summarize: > > > > 1) malloc stats > > kern.malloc_stats uses internally MAXCPU, and we have to query MAXCPU > > from kernel, too. See kern/kern_malloc.c:sysctl_kern_malloc_stats(): > > 849 mtsh.mtsh_maxcpus = MAXCPU; > > > > 1a) memstat_sysctl_malloc() > > left unchanged, sysctl kern.smp.maxcpus > > 1b) memstat_kvm_malloc() > > left unchanged, _mp_maxcpus symbol > > > > 2) uma stats > > vm.zone_stats uses (mp_maxid + 1), vm/uma_core.c:sysctl_vm_zone_stats(): > > 3247 ush.ush_maxcpus = (mp_maxid + 1); > > > > 2a) memstat_sysctl_uma() > > Switched to query sysctl kern.smp.maxid > > 2b) memstat_kvm_uma() > > left unchanged, _mp_maxid symbol > > > > So, there's only one change in memstat_sysctl_uma(). > > A bad side of things is that libmemstat() now knows these vm_zone > > and malloc_stats internals. > > As Robert suggested me on IRC to query maxcpu value from > > uma_stream_header and malloc_type_stream_header structures > > respectively to be independent from kernel details. > > Looks good to me, thanks! > Aye +1 here. I'll run this over to peter@ just to be sure though. I'm pretty sure that this will just work. I'll ask HP for their big machine again to validate. Sean From owner-svn-src-all@FreeBSD.ORG Wed Jul 27 17:30:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D498B106566B; Wed, 27 Jul 2011 17:30:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A9DBE8FC17; Wed, 27 Jul 2011 17:30:39 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 3081E46B2E; Wed, 27 Jul 2011 13:30:39 -0400 (EDT) Date: Wed, 27 Jul 2011 18:30:39 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Sean Bruno In-Reply-To: <1311786494.2592.5.camel@hitfishpass-lx.corp.yahoo.com> Message-ID: References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <201107210920.09604.jhb@freebsd.org> <201107270845.39419.jhb@freebsd.org> <1311786494.2592.5.camel@hitfishpass-lx.corp.yahoo.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "src-committers@freebsd.org" , John Baldwin , "svn-src-all@freebsd.org" , Attilio Rao , Sergey Kandaurov , Pan Tsu , "svn-src-head@freebsd.org" Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 17:30:39 -0000 On Wed, 27 Jul 2011, Sean Bruno wrote: > Aye +1 here. I'll run this over to peter@ just to be sure though. I'm > pretty sure that this will just work. > > I'll ask HP for their big machine again to validate. As of (extremely recently) there's now an 80-core system in the Netperf cluster. I'm not sure that it's ready for production (which is to say, ready to be used in SMP scalability work) yet, but it's intended as a resource to help with these sorts of issues. This box was purchased by the FreeBSD Foundation and very helpful rates from iX Systems. Robert From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 02:40:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E54A106566B; Thu, 28 Jul 2011 02:40:17 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 271AF8FC16; Thu, 28 Jul 2011 02:40:16 +0000 (UTC) Received: by iyb11 with SMTP id 11so3219695iyb.13 for ; Wed, 27 Jul 2011 19:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=p24sltxxJBcYDmMrJriF27NJE4b3KhbfS1pOpLVaI58=; b=dCTBbLibMCNTPcJ2AGAMluki8Z4liQwyHTHBYDZY0CAJ2cHXN928RkK2s4F632bcMT 88tNq9PE8OmWZisbYbDJGIwB9y9UWHIUu69FaJpsGsDDeqrRXJPsFwEkSz0OaJWq1ISe TfF1GEV6IjiYVvYNwwqHPyrc3q8RHDeiIrEBY= Received: by 10.42.134.2 with SMTP id j2mr365821ict.308.1311820815172; Wed, 27 Jul 2011 19:40:15 -0700 (PDT) Received: from DataIX.net (adsl-99-181-132-76.dsl.klmzmi.sbcglobal.net [99.181.132.76]) by mx.google.com with ESMTPS id e2sm339800ibb.23.2011.07.27.19.40.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 19:40:13 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6S2e7Rq092373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jul 2011 22:40:08 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6S2e77n092372; Wed, 27 Jul 2011 22:40:07 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Wed, 27 Jul 2011 22:40:07 -0400 From: Jason Hellenthal To: "Andrey V. Elsukov" Message-ID: <20110728024007.GB55550@DataIX.net> References: <201107270410.p6R4AXc3040342@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" Content-Disposition: inline In-Reply-To: <201107270410.p6R4AXc3040342@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 02:40:17 -0000 --jho1yZJdad60DJr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2011 at 04:10:33AM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Jul 27 04:10:32 2011 > New Revision: 224464 > URL: http://svn.freebsd.org/changeset/base/224464 >=20 > Log: > MFC r223587: > MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify > disk drive. The boot0cfg(8) utility preserves these 4 bytes when it is > writing bootcode to keep a multiboot ability. > Change gpart's bootcode method to keep DSN if it is not zero. Also > do not allow writing bootcode with size not equal to MBRSIZE. > =20 > PR: kern/157819 >=20 > Modified: > stable/8/sys/geom/part/g_part_mbr.c > stable/8/sys/sys/diskmbr.h > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/geom/label/ (props changed) >=20 > Modified: stable/8/sys/geom/part/g_part_mbr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 01:57:24 2011 (r224463) > +++ stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 04:10:32 2011 (r224464) > @@ -234,14 +234,16 @@ static int > g_part_mbr_bootcode(struct g_part_table *basetable, struct g_part_parms = *gpp) > { > struct g_part_mbr_table *table; > - size_t codesz; > + uint32_t dsn; > + > + if (gpp->gpp_codesize !=3D MBRSIZE) > + return (ENODEV); Is it known for an absolute fact that the size being written is always going to be the size of MBRSIZE ? never less ? wouldnt ">=3D" greater-than or equal make sense here ? though I would seriously doubt it needs to return on equal too as that could be written. > =20 > - codesz =3D DOSPARTOFF; > table =3D (struct g_part_mbr_table *)basetable; > - bzero(table->mbr, codesz); > - codesz =3D MIN(codesz, gpp->gpp_codesize); > - if (codesz > 0) > - bcopy(gpp->gpp_codeptr, table->mbr, codesz); > + dsn =3D *(uint32_t *)(table->mbr + DOSDSNOFF); > + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); > + if (dsn !=3D 0) Shit happens... any case that the product might return less than 0 causing this to still fall through and process... ? ">" ? > + *(uint32_t *)(table->mbr + DOSDSNOFF) =3D dsn; > return (0); > } > =20 >=20 > Modified: stable/8/sys/sys/diskmbr.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/sys/diskmbr.h Wed Jul 27 01:57:24 2011 (r224463) > +++ stable/8/sys/sys/diskmbr.h Wed Jul 27 04:10:32 2011 (r224464) > @@ -36,6 +36,7 @@ > #include > =20 > #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ > +#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ > #define DOSPARTOFF 446 > #define DOSPARTSIZE 16 > #define NDOSPART 4 > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.or= g" --jho1yZJdad60DJr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMMwHAAoJEJBXh4mJ2FR+mCEH/11OPJqBMX9ueQRnMdHVvcM1 4gCv10qaHzKNaXhBqOzLAmg/kXQOs28kNXkhViBDnRr7NLGF7euFZCd7PyiK10Dy sB1+Ti2p9WEAk9JWBNKI34ttv5yKrOd67Cc3YojUs4Qt7vISYwMJ6PkvINM67YnY MDDFmQ45N7ry03jZQYl2mTW34Qdo1nBp4gT/VQ44M6mJSFECt+0QYXKtoG+DVi5y N0ZoFcg+b4g4zDwTlyCNDnpW0B3aRoCfhvoM87UZ6LBcuFS4xBF4j7jojaFCJsR2 hWnRMpUs+nnk5G8XlTaQ7K7rZlVKfPvi2zVRWU5QY5P4YMINsnBIitUv0ZhSZEM= =NqxT -----END PGP SIGNATURE----- --jho1yZJdad60DJr+-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 02:47:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC2D81065675; Thu, 28 Jul 2011 02:47:37 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id F11CB8FC0A; Thu, 28 Jul 2011 02:47:36 +0000 (UTC) Received: by yic13 with SMTP id 13so1942913yic.13 for ; Wed, 27 Jul 2011 19:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=0+ESv33P/Dx0OE0rDtj6WorplC+Dc+UbEmwC6GFG40g=; b=Nr5s2qOAGlf84i0yr5W/hl/6hbxbPp3w8LV9qrg0mvkFhpOf/EYGye00ws7/HvotBc O/vMQ7E9Tvu1VKNztzg1pab+FY/gkwsueZ3EIGC5Tm/Y5C6faG7eAXcDzJ1Yp1DWTlpX 2XJHHBoCU3b2ep9w2zWosDfeLsCtQN7WGK4VY= Received: by 10.42.28.194 with SMTP id o2mr434060icc.5.1311819561055; Wed, 27 Jul 2011 19:19:21 -0700 (PDT) Received: from DataIX.net (adsl-99-181-132-76.dsl.klmzmi.sbcglobal.net [99.181.132.76]) by mx.google.com with ESMTPS id v16sm326477ibf.42.2011.07.27.19.19.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 19:19:19 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6S2JGXu091566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jul 2011 22:19:16 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6S2JFdn091565; Wed, 27 Jul 2011 22:19:15 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Wed, 27 Jul 2011 22:19:14 -0400 From: Jason Hellenthal To: Glen Barber Message-ID: <20110728021914.GA55550@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <201107270156.p6R1uquD035835@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 02:47:37 -0000 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2011 at 01:56:52AM +0000, Glen Barber wrote: > Author: gjb (doc committer) > Date: Wed Jul 27 01:56:52 2011 > New Revision: 224462 > URL: http://svn.freebsd.org/changeset/base/224462 >=20 > Log: > MFC 224286: > =20 > Document the potential for jail escape. > =20 > PR: 142341 >=20 > Modified: > stable/8/usr.sbin/jail/jail.8 > Directory Properties: > stable/8/usr.sbin/jail/ (props changed) >=20 > Modified: stable/8/usr.sbin/jail/jail.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/usr.sbin/jail/jail.8 Tue Jul 26 20:51:58 2011 (r224461) > +++ stable/8/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) > @@ -34,7 +34,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 17, 2010 > +.Dd July 23, 2011 > .Dt JAIL 8 > .Os > .Sh NAME > @@ -913,3 +913,10 @@ Currently, the simplest answer is to min > offered on the host, possibly limiting it to services offered from > .Xr inetd 8 > which is easily configurable. > +.Sh NOTES > +Great care should be taken when managing directories visible within the = jail. > +For example, if a jailed process has its current working directory set t= o a > +directory that is moved out of the jail's chroot, then the process may g= ain > +access to the file space outside of the jail. > +It is recommended that directories always be copied, rather than moved, = out > +of a jail. How is either one of these different ? All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is still broken and a process is not going to just get up and move with it. On the other side though if you copied a pipe or socket or something similiar for example into a jail then it might make whatever is outside available to the jailed environment. Is there something I am misunderstanding about this ? has the way cp(1), rm(1) & mv(1) been changed recently ? or is this wording a little off ? --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMMcfAAoJEJBXh4mJ2FR+cJcH/A8lNW6rpTBgk7WgnOHO/grV kXcSIveh+MBkfoxt9F65Mt7RMroIXSpk2pvg9upNVjuMDNTfCkRuNnPK6NgwptDp BSq9bSzeQW08aQRwB0ARaaEyNpXJh0aqV4GkYHel9vBqNd6Jwc1dAtriIJIJQhgC rRRdtOJEJ2f1Xc5x1k0Ikg4vULxbvKlVhe1K92gHRJlf7I67TZstH1UsgsD9u/wh OvSj49Xh0ND0CzB5VY6imqvxLGCyc4a6F5vXdh/5uNfyWnkxXuT7MpFNmosoVCK4 qNHPzZuWHrhyqi4+bF8YjAm8ZfdtMNbaHRiH+u7QVp/xmjVA4G/JnuZtthIOeYY= =pela -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 02:59:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BBA8106566B; Thu, 28 Jul 2011 02:59:33 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E9EE78FC08; Thu, 28 Jul 2011 02:59:32 +0000 (UTC) Received: by gyf3 with SMTP id 3so1942399gyf.13 for ; Wed, 27 Jul 2011 19:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=aAjfBZnqaueGj4T/eD9O8KM8z0RzFnZ1cJ/+bMUBzWI=; b=fGvpn4Wpa94HybPC2j5WxFzVZEYON5sb3+rXfzogN4fN0+DZken40CqKNvNu2kJY3x ZRIaHphL157aEWgmAgJx8FyYVWw6n+9Cva54VM9LG1NTL2wPfTGzVEExeJTXyRmNYsUH a98o6Ii4wSVduBrwZIuqDceYTzbozBDKdaMJQ= MIME-Version: 1.0 Received: by 10.236.175.35 with SMTP id y23mr345261yhl.495.1311821972006; Wed, 27 Jul 2011 19:59:32 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.108.129 with HTTP; Wed, 27 Jul 2011 19:59:31 -0700 (PDT) In-Reply-To: References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> <4E2DB8AC.3000703@FreeBSD.org> <4E2DBCBF.2030402@freebsd.org> Date: Wed, 27 Jul 2011 22:59:31 -0400 X-Google-Sender-Auth: C5GCgNSijjRJyWnkavGYrtMAd5I Message-ID: From: Attilio Rao To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Sergey Kandaurov , Andreas Tobler Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 02:59:33 -0000 I think that the following patch may better reflect the definition of size_t: http://www.freebsd.org/~attilio/sintrcnt-fixup32.diff Do you think you can test it out? Thanks, Attilio 2011/7/25 Attilio Rao : > Guys, I'm a bit out of that for a couple of days, flying to another > continent, I'm not entirely sure the patch is right because I think we > need an unified approach for specifying a 32-bits value, but you can > check-in as a showstopper for the moment, I will make a better one in > a couple of days. > > Attilio > > 2011/7/25 Nathan Whitehorn : >> On 07/25/11 13:40, Andreas Tobler wrote: >>> >>> On 24.07.11 23:35, Nathan Whitehorn wrote: >>>> >>>> On 07/19/11 07:41, Attilio Rao wrote: >>>>> >>>>> Author: attilio >>>>> Date: Tue Jul 19 12:41:57 2011 >>>>> New Revision: 224216 >>>>> URL: http://svn.freebsd.org/changeset/base/224216 >>>>> >>>>> Log: >>>>> On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes >>>>> storage. >>>>> Fix the sintrcnt/sintrnames specification. >>>>> >>>>> No MFC is previewed for this patch. >>>>> >>>> >>>> These also need to be .long on 32-bit PowerPC, otherwise this change >>>> triggers kernel panics and faults in sysctl. Please change it as quickly >>>> as possible. >>> >>> Like the below? >>> >>> I'll test and I could commit if ok. (Build and approval) >>> >>> Gruss, >>> Andreas >>> >>> Index: locore32.S >>> =================================================================== >>> --- locore32.S (revision 224326) >>> +++ locore32.S (working copy) >>> @@ -91,13 +91,13 @@ >>> GLOBAL(intrnames) >>> .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >>> GLOBAL(sintrnames) >>> - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >>> + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >>> >>> .align 4 >>> GLOBAL(intrcnt) >>> .space INTRCNT_COUNT * 4 * 2 >>> GLOBAL(sintrcnt) >>> - .word INTRCNT_COUNT * 4 * 2 >>> + .long INTRCNT_COUNT * 4 * 2 >>> >>> .text >>> .globl btext >> >> Exactly like that. >> -Nathan >> > > > > -- > Peace can only be achieved by understanding - A. Einstein > -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 03:01:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A157106566B; Thu, 28 Jul 2011 03:01:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 889A78FC15; Thu, 28 Jul 2011 03:01:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6S31MCC082767; Thu, 28 Jul 2011 03:01:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6S31MlL082765; Thu, 28 Jul 2011 03:01:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107280301.p6S31MlL082765@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 28 Jul 2011 03:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224470 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 03:01:22 -0000 Author: bz Date: Thu Jul 28 03:01:22 2011 New Revision: 224470 URL: http://svn.freebsd.org/changeset/base/224470 Log: To inet or not two inet. Unbreak static IPv4 configuration. If you tried you were stuck in an endless loop. Reported by: kensmith Approved by: re (kib) for BETA1 Pointy hat to: bz - wonder why I had not tested legacy IP thoroughly.. Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Wed Jul 27 22:54:40 2011 (r224469) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Jul 28 03:01:22 2011 (r224470) @@ -78,7 +78,7 @@ echo $INTERFACE $IF_CONFIG | if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then . $BSDINSTALL_TMPETC/._rc.conf.net - ifconfig $INTERFACE inet `eval echo \\\$ifconfig_$INTERFACE` + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` route delete -inet default route add -inet default $defaultrouter fi From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 03:04:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B2D106564A; Thu, 28 Jul 2011 03:04:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id A92018FC12; Thu, 28 Jul 2011 03:04:01 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C2E6325D389F; Thu, 28 Jul 2011 03:04:00 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 17245BD3D17; Thu, 28 Jul 2011 03:04:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id uqWMsPEH9Tn3; Thu, 28 Jul 2011 03:03:58 +0000 (UTC) Received: from [IPv6:::1] (shell.eq4-01.sbone.de [IPv6:fde9:577b:c1a9:3161::401:22]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id AB25FBD3C1C; Thu, 28 Jul 2011 03:03:48 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201107280301.p6S31MlL082765@svn.freebsd.org> Date: Thu, 28 Jul 2011 03:03:19 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201107280301.p6S31MlL082765@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224470 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 03:04:02 -0000 On Jul 28, 2011, at 3:01 AM, Bjoern A. Zeeb wrote: Please not that HEAD is not open for other approved commits before BETA1 was publicly announced! So in case you have re@ approval already you must not yet commit! Sorry for the IPv4 problem, but it makes me wonder how many people are actually testing and using the new installer? /bz > Author: bz > Date: Thu Jul 28 03:01:22 2011 > New Revision: 224470 > URL: http://svn.freebsd.org/changeset/base/224470 >=20 > Log: > To inet or not two inet. Unbreak static IPv4 configuration. If you = tried > you were stuck in an endless loop. >=20 > Reported by: kensmith > Approved by: re (kib) for BETA1 > Pointy hat to: bz - wonder why I had not tested legacy IP = thoroughly.. >=20 > Modified: > head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 >=20 > Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Wed Jul 27 = 22:54:40 2011 (r224469) > +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Jul 28 = 03:01:22 2011 (r224470) > @@ -78,7 +78,7 @@ echo $INTERFACE $IF_CONFIG |=20 >=20 > if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then > . $BSDINSTALL_TMPETC/._rc.conf.net > - ifconfig $INTERFACE inet `eval echo \\\$ifconfig_$INTERFACE` > + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` > route delete -inet default > route add -inet default $defaultrouter > fi --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 03:08:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6761065670; Thu, 28 Jul 2011 03:08:34 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 99ABC8FC15; Thu, 28 Jul 2011 03:08:33 +0000 (UTC) Received: by gyf3 with SMTP id 3so1946327gyf.13 for ; Wed, 27 Jul 2011 20:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=OYpEqejJsUTAWqSoI+FO3fyRWBUNqHUxcbNdcooKCi8=; b=a5qibZKtekbwM/Z4NmNWSPJ/QysoK1ghUAffFp2hkO/6a7txk3YKMTa1duDlgeZpKO rZ2l5ADS/+CcXZ4iB+QRdbX9go1Vk1QwYASt3EzfiLBpRkixhjonJkUpF/hCL57+6L7v MGOqJkbe4YC1bjo+Zta5aMA5RCl5s8SC0d9NM= MIME-Version: 1.0 Received: by 10.236.178.101 with SMTP id e65mr588097yhm.325.1311822511504; Wed, 27 Jul 2011 20:08:31 -0700 (PDT) Received: by 10.236.109.147 with HTTP; Wed, 27 Jul 2011 20:08:31 -0700 (PDT) In-Reply-To: <20110728021914.GA55550@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> Date: Wed, 27 Jul 2011 23:08:31 -0400 Message-ID: From: Ben Kaduk To: Jason Hellenthal Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 03:08:34 -0000 On Wed, Jul 27, 2011 at 10:19 PM, Jason Hellenthal wrote= : > > > On Wed, Jul 27, 2011 at 01:56:52AM +0000, Glen Barber wrote: >> Author: gjb (doc committer) >> Date: Wed Jul 27 01:56:52 2011 >> New Revision: 224462 >> URL: http://svn.freebsd.org/changeset/base/224462 >> >> Log: >> =A0 MFC 224286: >> >> =A0 Document the potential for jail escape. >> >> =A0 PR: =A0 =A0 =A0 =A0 142341 >> >> Modified: >> =A0 stable/8/usr.sbin/jail/jail.8 >> Directory Properties: >> =A0 stable/8/usr.sbin/jail/ =A0 (props changed) >> >> Modified: stable/8/usr.sbin/jail/jail.8 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- stable/8/usr.sbin/jail/jail.8 =A0 =A0 Tue Jul 26 20:51:58 2011 =A0 = =A0 =A0 =A0(r224461) >> +++ stable/8/usr.sbin/jail/jail.8 =A0 =A0 Wed Jul 27 01:56:52 2011 =A0 = =A0 =A0 =A0(r224462) >> @@ -34,7 +34,7 @@ >> =A0.\" >> =A0.\" $FreeBSD$ >> =A0.\" >> -.Dd January 17, 2010 >> +.Dd July 23, 2011 >> =A0.Dt JAIL 8 >> =A0.Os >> =A0.Sh NAME >> @@ -913,3 +913,10 @@ Currently, the simplest answer is to min >> =A0offered on the host, possibly limiting it to services offered from >> =A0.Xr inetd 8 >> =A0which is easily configurable. >> +.Sh NOTES >> +Great care should be taken when managing directories visible within the= jail. >> +For example, if a jailed process has its current working directory set = to a >> +directory that is moved out of the jail's chroot, then the process may = gain >> +access to the file space outside of the jail. >> +It is recommended that directories always be copied, rather than moved,= out >> +of a jail. > > How is either one of these different ? > > All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is This is not always true when the source and destination live on the same filesystem. See rename(2). Via VOP_RENAME, individual filesystems can override this behavior if needed (e.g. for AFS where permissions are per-directory, so a cross-directory copy would return EXDEV). -Ben Kaduk > still broken and a process is not going to just get up and move with it. > On the other side though if you copied a pipe or socket or something > similiar for example into a jail then it might make whatever is outside > available to the jailed environment. > > Is there something I am misunderstanding about this ? has the way cp(1), > rm(1) & mv(1) been changed recently ? or is this wording a little off ? > From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 03:19:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E53BA106566C for ; Thu, 28 Jul 2011 03:19:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id 70C1C8FC0C for ; Thu, 28 Jul 2011 03:19:10 +0000 (UTC) Received: (qmail 80690 invoked by uid 0); 27 Jul 2011 22:52:28 -0400 Received: from unknown (HELO schism.local) (gjb@76.124.49.145) by 0 with SMTP; 27 Jul 2011 22:52:28 -0400 Message-ID: <4E30CEEB.107@FreeBSD.org> Date: Wed, 27 Jul 2011 22:52:27 -0400 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Hellenthal References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> In-Reply-To: <20110728021914.GA55550@DataIX.net> X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 03:19:11 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 7/27/11 10:19 PM, Jason Hellenthal wrote: >> +.Sh NOTES +Great care should be taken when managing directories >> visible within the jail. +For example, if a jailed process has its >> current working directory set to a +directory that is moved out of >> the jail's chroot, then the process may gain +access to the file >> space outside of the jail. +It is recommended that directories >> always be copied, rather than moved, out +of a jail. > > How is either one of these different ? > > All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle > is still broken and a process is not going to just get up and move > with it. On the other side though if you copied a pipe or socket or > something similiar for example into a jail then it might make > whatever is outside available to the jailed environment. > > Is there something I am misunderstanding about this ? has the way > cp(1), rm(1) & mv(1) been changed recently ? or is this wording a > little off ? The text in the example is just an example of a situation where it may be possible for a process within a jail(8) to gain filesystem access outside of the jail(8). Regards, - -- Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBCAAGBQJOMM7rAAoJEFJPDDeguUajw7gIALesuCIHff5+p/a4v3gCYetF Su1RWFH/4Cc7iETC0sBR8vvJM9tUXuuKgSXCMswqmOQeJgwE5F+Xv4zAqofVyG6x b/C0WkmEe+nShOx1JLpmyvoSXlyh7b9QxV/41Kf/0Z1EoUZSNz1q5X58ZCvelaTr pqwftcCqGp0qHxVphCq8q42Z8hzS0V2SMco7gD/dqzyKjmST0zAhQfOgrT8kAqiH JHSU8ZSjVjQ5GPKi68fVCUBsivp/hyrXviSfFwh+anBembPrzMQNS7oYBtSJCrpf Ksy5SrT+JLNTSSZlhnqIvhwLfk01LR4alryZAlXYyUqO+DDjFX11vFqCW8qPrw8= =iXr5 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 04:52:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 508EE1065673; Thu, 28 Jul 2011 04:52:10 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id CD0678FC0A; Thu, 28 Jul 2011 04:52:09 +0000 (UTC) Received: by iyb11 with SMTP id 11so3352976iyb.13 for ; Wed, 27 Jul 2011 21:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=I01KlNVBr3UfsFZzDygYhxm3H0enAGiHTKyeMFaTS3A=; b=YSdIpvEdM32hwPWB0XuNCgLUGE4OQY1g7ix4J6nHT7RmFgy3SJ/2ow6G48D3qlj7Su EtAzOGqWX+lru8PfFUAo5lNt7UObYoIQw+Ga8joc4ltykSe7OZP1n/mBBd8zFy+eSO1H EicEdYnQLyKpNpscVuP+IHhzAsHcwlnGnVwog= Received: by 10.231.61.134 with SMTP id t6mr437638ibh.15.1311828729137; Wed, 27 Jul 2011 21:52:09 -0700 (PDT) Received: from DataIX.net ([99.181.132.76]) by mx.google.com with ESMTPS id y3sm403142ibc.54.2011.07.27.21.52.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 21:52:07 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6S4q4cb027952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Jul 2011 00:52:04 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6S4q3po027951; Thu, 28 Jul 2011 00:52:03 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Thu, 28 Jul 2011 00:52:03 -0400 From: Jason Hellenthal To: Ben Kaduk Message-ID: <20110728045202.GC55550@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bAmEntskrkuBymla" Content-Disposition: inline In-Reply-To: Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 04:52:10 -0000 --bAmEntskrkuBymla Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2011 at 11:08:31PM -0400, Ben Kaduk wrote: > On Wed, Jul 27, 2011 at 10:19 PM, Jason Hellenthal wro= te: > > > > > > On Wed, Jul 27, 2011 at 01:56:52AM +0000, Glen Barber wrote: > >> Author: gjb (doc committer) > >> Date: Wed Jul 27 01:56:52 2011 > >> New Revision: 224462 > >> URL: http://svn.freebsd.org/changeset/base/224462 > >> > >> Log: > >> =A0 MFC 224286: > >> > >> =A0 Document the potential for jail escape. > >> > >> =A0 PR: =A0 =A0 =A0 =A0 142341 > >> > >> Modified: > >> =A0 stable/8/usr.sbin/jail/jail.8 > >> Directory Properties: > >> =A0 stable/8/usr.sbin/jail/ =A0 (props changed) > >> > >> Modified: stable/8/usr.sbin/jail/jail.8 > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- stable/8/usr.sbin/jail/jail.8 =A0 =A0 Tue Jul 26 20:51:58 2011 =A0= =A0 =A0 =A0(r224461) > >> +++ stable/8/usr.sbin/jail/jail.8 =A0 =A0 Wed Jul 27 01:56:52 2011 =A0= =A0 =A0 =A0(r224462) > >> @@ -34,7 +34,7 @@ > >> =A0.\" > >> =A0.\" $FreeBSD$ > >> =A0.\" > >> -.Dd January 17, 2010 > >> +.Dd July 23, 2011 > >> =A0.Dt JAIL 8 > >> =A0.Os > >> =A0.Sh NAME > >> @@ -913,3 +913,10 @@ Currently, the simplest answer is to min > >> =A0offered on the host, possibly limiting it to services offered from > >> =A0.Xr inetd 8 > >> =A0which is easily configurable. > >> +.Sh NOTES > >> +Great care should be taken when managing directories visible within t= he jail. > >> +For example, if a jailed process has its current working directory se= t to a > >> +directory that is moved out of the jail's chroot, then the process ma= y gain > >> +access to the file space outside of the jail. > >> +It is recommended that directories always be copied, rather than move= d, out > >> +of a jail. > > > > How is either one of these different ? > > > > All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is >=20 > This is not always true when the source and destination live on the > same filesystem. See rename(2). > Via VOP_RENAME, individual filesystems can override this behavior if > needed (e.g. for AFS where permissions are per-directory, so a > cross-directory copy would return EXDEV). >=20 Ok so in the least words... be careful of poor administration techniques that is trying to be explained here. The only real example I could think of that relates to the example above would be in the case of a hardlink that rests on the same filesystem. Anyway just a nit-pick it just seems trying to explain these things in example throughout a manual page can lead a user in the direction of thought that everything has been explained or that is all the examples and seems would be better off in a security aware section of a handbook rather than mudding up the manual page. >=20 > > still broken and a process is not going to just get up and move with it. > > On the other side though if you copied a pipe or socket or something > > similiar for example into a jail then it might make whatever is outside > > available to the jailed environment. > > > > Is there something I am misunderstanding about this ? has the way cp(1), > > rm(1) & mv(1) been changed recently ? or is this wording a little off ? > > --bAmEntskrkuBymla Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMOryAAoJEJBXh4mJ2FR+Ym8H/jfJr9lBDFdRHxzovyWZvFV8 9xa0jPyAYwkGXPFBeX8H8pk3wj3zNAbIu1IUOv6xJ14LZz7afKPXpP5OFn7cBNHk OIIrSi3wOmmE1H367VBTISFxCvlGzyWegzJkGLGyJDIrCfT7wrDBgcuzXbPXz41I FTGTiJeA0WSRGvZbMRT/8mlt4UIA3MHcfbnYs1R1HmK1N1wd4+XIVpy+7cQFdKM7 1P02xrh0LoNESBZB3WYaINrU7ImcyOjkw04u0CvRq9/Q+3EVnhQhE5by/aBazuFY otU8LDJM9f2LMf76h8/dmvC69QjFzrY5al/O0Af+WEv2gWuxj4B1+7SvHakY2nM= =bTVA -----END PGP SIGNATURE----- --bAmEntskrkuBymla-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 04:56:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C1641065673 for ; Thu, 28 Jul 2011 04:56:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id E0CE08FC13 for ; Thu, 28 Jul 2011 04:56:35 +0000 (UTC) Received: (qmail 82552 invoked by uid 0); 28 Jul 2011 00:56:35 -0400 Received: from unknown (HELO schism.local) (gjb@76.124.49.145) by 0 with SMTP; 28 Jul 2011 00:56:35 -0400 Message-ID: <4E30EBFA.5030505@FreeBSD.org> Date: Thu, 28 Jul 2011 00:56:26 -0400 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Hellenthal References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> <20110728045202.GC55550@DataIX.net> In-Reply-To: <20110728045202.GC55550@DataIX.net> X-Enigmail-Version: 1.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig9DCD5FDE87F27B0C5E36E47F" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Ben Kaduk Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 04:56:36 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9DCD5FDE87F27B0C5E36E47F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 7/28/11 12:52 AM, Jason Hellenthal wrote: >> This is not always true when the source and destination live on the >> same filesystem. See rename(2). >> Via VOP_RENAME, individual filesystems can override this behavior if >> needed (e.g. for AFS where permissions are per-directory, so a >> cross-directory copy would return EXDEV). >> >=20 > Ok so in the least words... be careful of poor administration > techniques that is trying to be explained here. The only real example I= > could think of that relates to the example above would be in the case o= f > a hardlink that rests on the same filesystem. >=20 > Anyway just a nit-pick it just seems trying to explain these things in > example throughout a manual page can lead a user in the direction of > thought that everything has been explained or that is all the examples > and seems would be better off in a security aware section of a handbook= > rather than mudding up the manual page. >=20 Hi, Feel free to submit patches to the original PR if you feel the explanation that has been committed is sub-par to what you expect. --=20 Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project --------------enig9DCD5FDE87F27B0C5E36E47F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBCAAGBQJOMOwBAAoJEFJPDDeguUajJFsH/iaOZglk5kZsMKkUZDKPMbcA 7aT+rLzeHxtRsboGKBcEqOBvUWfd2AXem9oQ0np/WgDn17zxzfvR9abg5Cn/hFe+ gL3kmbcnGz9KMxeWYhyBTyXy3gByzKVYIzeLio4dsJ1kQK4QB/G0aTouyVOIxiB+ LTmGTg1fSkxodhKZD0uDzXuwhEN7+nbcdf2y1DKRl4j8e+hqz3FtGb9N4m8TelJR kza/FCkMnBupgZTGknSgAUnmDt3JRhSbplKVQ98Z0KrPfFPJjmoedajFj5JMJrLn Z6aX+dAiuRbAP1YB4rd0JZIaiysGAuaV4MtrJTe6tngMZonPduydB3m413u2TmM= =dqQQ -----END PGP SIGNATURE----- --------------enig9DCD5FDE87F27B0C5E36E47F-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 09:24:49 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F41E2106566B; Thu, 28 Jul 2011 09:24:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D47DF8FC0A; Thu, 28 Jul 2011 09:24:46 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA19274; Thu, 28 Jul 2011 12:24:43 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QmMpe-0000nv-Ut; Thu, 28 Jul 2011 12:24:42 +0300 Message-ID: <4E312AD9.3020703@FreeBSD.org> Date: Thu, 28 Jul 2011 12:24:41 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Hellenthal References: <201107270410.p6R4AXc3040342@svn.freebsd.org> <20110728024007.GB55550@DataIX.net> In-Reply-To: <20110728024007.GB55550@DataIX.net> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Andrey V. Elsukov" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:24:49 -0000 on 28/07/2011 05:40 Jason Hellenthal said the following: > > > On Wed, Jul 27, 2011 at 04:10:33AM +0000, Andrey V. Elsukov wrote: >> Author: ae Date: Wed Jul 27 04:10:32 2011 New Revision: 224464 URL: >> http://svn.freebsd.org/changeset/base/224464 >> >> Log: MFC r223587: MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to >> identify disk drive. The boot0cfg(8) utility preserves these 4 bytes when >> it is writing bootcode to keep a multiboot ability. Change gpart's bootcode >> method to keep DSN if it is not zero. Also do not allow writing bootcode >> with size not equal to MBRSIZE. >> >> PR: kern/157819 >> >> Modified: stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/sys/diskmbr.h >> Directory Properties: stable/8/sys/ (props changed) >> stable/8/sys/amd64/include/xen/ (props changed) >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >> stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ >> (props changed) stable/8/sys/geom/label/ (props changed) >> >> Modified: stable/8/sys/geom/part/g_part_mbr.c >> ============================================================================== >> >> --- stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 01:57:24 2011 (r224463) >> +++ stable/8/sys/geom/part/g_part_mbr.c Wed Jul 27 04:10:32 2011 (r224464) >> @@ -234,14 +234,16 @@ static int g_part_mbr_bootcode(struct g_part_table >> *basetable, struct g_part_parms *gpp) { struct g_part_mbr_table *table; - >> size_t codesz; + uint32_t dsn; + + if (gpp->gpp_codesize != MBRSIZE) + >> return (ENODEV); > > Is it known for an absolute fact that the size being written is always going > to be the size of MBRSIZE ? never less ? wouldnt ">=" greater-than or equal > make sense here ? though I would seriously doubt it needs to return on equal > too as that could be written. > >> >> - codesz = DOSPARTOFF; table = (struct g_part_mbr_table *)basetable; - >> bzero(table->mbr, codesz); - codesz = MIN(codesz, gpp->gpp_codesize); - if >> (codesz > 0) - bcopy(gpp->gpp_codeptr, table->mbr, codesz); + dsn = >> *(uint32_t *)(table->mbr + DOSDSNOFF); + bcopy(gpp->gpp_codeptr, >> table->mbr, DOSPARTOFF); + if (dsn != 0) > > Shit happens... any case that the product might return less than 0 causing > this to still fall through and process... ? ">" ? Not with unsigned types :-) >> + *(uint32_t *)(table->mbr + DOSDSNOFF) = dsn; return (0); } >> >> >> Modified: stable/8/sys/sys/diskmbr.h >> ============================================================================== >> >> --- stable/8/sys/sys/diskmbr.h Wed Jul 27 01:57:24 2011 (r224463) >> +++ stable/8/sys/sys/diskmbr.h Wed Jul 27 04:10:32 2011 (r224464) @@ -36,6 >> +36,7 @@ #include >> >> #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define >> DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ #define >> DOSPARTOFF 446 #define DOSPARTSIZE 16 #define NDOSPART 4 -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 09:40:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6B5A106564A; Thu, 28 Jul 2011 09:40:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8173E8FC16; Thu, 28 Jul 2011 09:40:20 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id F151E46B2A; Thu, 28 Jul 2011 05:40:19 -0400 (EDT) Date: Thu, 28 Jul 2011 10:40:19 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Glen Barber In-Reply-To: <4E30CEEB.107@FreeBSD.org> Message-ID: References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> <4E30CEEB.107@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jason Hellenthal , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:40:20 -0000 On Wed, 27 Jul 2011, Glen Barber wrote: >> How is either one of these different ? >> >> All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle is >> still broken and a process is not going to just get up and move with it. On >> the other side though if you copied a pipe or socket or something similiar >> for example into a jail then it might make whatever is outside available to >> the jailed environment. >> >> Is there something I am misunderstanding about this ? has the way cp(1), >> rm(1) & mv(1) been changed recently ? or is this wording a little off ? > > The text in the example is just an example of a situation where it may be > possible for a process within a jail(8) to gain filesystem access outside of > the jail(8). I wonder, if on these grounds, we should actually advise administrators that it is a more robust configuration, both in terms of managing free space and avoiding potential escape paths, to put each jail in its own file system. Lots of people do this anyway, and as recommendations go, it's not a bad one. We can then caution that if you *don't* do this, then you need to be careful about the mv issue. Robert From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 09:56:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B05E1065675; Thu, 28 Jul 2011 09:56:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-cdu.ru (ns.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id 320088FC17; Thu, 28 Jul 2011 09:56:55 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-cdu.ru [127.0.0.1]) by mail.kirov.so-cdu.ru (Postfix) with SMTP id 1F97FB801F; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: from kirov.so-cdu.ru (unknown [172.21.81.1]) by mail.kirov.so-cdu.ru (Postfix) with ESMTP id 19BA7B801B; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: by ns.kirov.so-cdu.ru (Postfix, from userid 1010) id 14308B8400; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: from [10.118.3.52] (elsukov.kirov.oduur.so [10.118.3.52]) by ns.kirov.so-cdu.ru (Postfix) with ESMTP id D29D8B83FD; Thu, 28 Jul 2011 13:38:02 +0400 (MSD) Message-ID: <4E312DF5.2050306@FreeBSD.org> Date: Thu, 28 Jul 2011 13:37:57 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Jason Hellenthal References: <201107270410.p6R4AXc3040342@svn.freebsd.org> <20110728024007.GB55550@DataIX.net> In-Reply-To: <20110728024007.GB55550@DataIX.net> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC86E7A483DB4FA181B6735A7" X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:56:56 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC86E7A483DB4FA181B6735A7 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 28.07.2011 6:40, Jason Hellenthal wrote: >> + uint32_t dsn; >> + >> + if (gpp->gpp_codesize !=3D MBRSIZE) >> + return (ENODEV); >=20 > Is it known for an absolute fact that the size being written is always > going to be the size of MBRSIZE ? never less ? wouldnt ">=3D" greater-t= han > or equal make sense here ? though I would seriously doubt it needs to > return on equal too as that could be written. Yes. Now the size of bootcode must be equal to MBRSIZE. We do not have any of bootcode images with size different than MBRSIZE. If you want to write bootcode with size less than MBRSIZE, then just fill up your image with zeroes to MBRSIZE. >> - codesz =3D DOSPARTOFF; >> table =3D (struct g_part_mbr_table *)basetable; >> - bzero(table->mbr, codesz); >> - codesz =3D MIN(codesz, gpp->gpp_codesize); >> - if (codesz > 0) >> - bcopy(gpp->gpp_codeptr, table->mbr, codesz); >> + dsn =3D *(uint32_t *)(table->mbr + DOSDSNOFF); >> + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); >> + if (dsn !=3D 0) >=20 > Shit happens... any case that the product might return less than 0 > causing this to still fall through and process... ? ">" ? Variable with type uint32_t could not be less than zero. This code only restores old DSN if it is not zero. In any other cases you can use boot0c= fg(8) to set or change it. --=20 WBR, Andrey V. Elsukov --------------enigC86E7A483DB4FA181B6735A7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOMS36AAoJEAHF6gQQyKF6OIcIAK4l/muhv/PMUMqhnQHVSAFj afLFgFAgul4ENbVD9k7o9WZoJy2Dk0285jKxang8m+O//7iATdCt9fHSle9VRh+e LuhH+kk541Lq6TXae/EtyBR1+tcSUXOUapioioRxjst+bgFqmh4uskGnTGyJL+vl TIhH3FhsPca+FTadlDI4cGGXOKmym6hiyi3pV/V1eZHbMkWUhCY7sNtmg718qlum y4LHUajOjC6+KF1Lomu2x5iHmkW7MUAlFGnp1BdSobEcVM5fQn7C8zodM3ar98cX bmvZNWV86hMWdyDJJM0C/SiQUkj94/C8TaTEcw37JvLl10UQHmPi4HVzXyhRc5M= =gDKy -----END PGP SIGNATURE----- --------------enigC86E7A483DB4FA181B6735A7-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 10:10:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437F3106564A; Thu, 28 Jul 2011 10:10:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 321B18FC1A; Thu, 28 Jul 2011 10:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SAAejO095605; Thu, 28 Jul 2011 10:10:40 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SAAdV2095597; Thu, 28 Jul 2011 10:10:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107281010.p6SAAdV2095597@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 28 Jul 2011 10:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224473 - in stable/8: sbin/ipfw sys/netinet/ipfw sys/netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 10:10:40 -0000 Author: ae Date: Thu Jul 28 10:10:39 2011 New Revision: 224473 URL: http://svn.freebsd.org/changeset/base/224473 Log: MFC r223080: Implement "global" mode for ipfw nat. It is similar to natd(8) "globalport" option for multiple NAT instances. If ipfw rule contains "global" keyword instead of nat_number, then for each outgoing packet ipfw_nat looks up translation state in all configured nat instances. If an entry is found, packet aliased according to that entry, otherwise packet is passed unchanged. User can specify "skip_global" option in NAT configuration to exclude an instance from the lookup in global mode. PR: kern/157867 Submitted by: Alexander V. Chernikov (previous version) Modified: stable/8/sbin/ipfw/ipfw.8 stable/8/sbin/ipfw/ipfw2.c stable/8/sbin/ipfw/ipfw2.h stable/8/sbin/ipfw/nat.c stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_nat.c stable/8/sys/netinet/libalias/alias.h Directory Properties: stable/8/sbin/ipfw/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sbin/ipfw/ipfw.8 ============================================================================== --- stable/8/sbin/ipfw/ipfw.8 Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/ipfw.8 Thu Jul 28 10:10:39 2011 (r224473) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd June 14, 2011 .Dt IPFW 8 .Os .Sh NAME @@ -2422,6 +2422,27 @@ Reset table of the packet aliasing engin Reverse the way libalias handles aliasing. .It Cm proxy_only Obey transparent proxy rules only, packet aliasing is not performed. +.It Cm skip_global +Skip instance in case of global state lookup (see below). +.El +.Pp +Some specials value can be supplied instead of +.Va nat_number: +.Bl -tag -width indent +.It Cm global +Looks up translation state in all configured nat instances. +If an entry is found, packet is aliased according to that entry. +If no entry was found in any of the instances, packet is passed unchanged, +and no new entry will be created. +See section +.Sx MULTIPLE INSTANCES +in +.Xr natd 8 +for more information. +.It Cm tablearg +Uses argument supplied in lookup table. See +.Sx LOOKUP TABLES +section below for more information on lookup tables. .El .Pp To let the packet continue after being (de)aliased, set the sysctl variable Modified: stable/8/sbin/ipfw/ipfw2.c ============================================================================== --- stable/8/sbin/ipfw/ipfw2.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/ipfw2.c Thu Jul 28 10:10:39 2011 (r224473) @@ -1112,8 +1112,11 @@ show_ipfw(struct ip_fw *rule, int pcwidt break; case O_NAT: - PRINT_UINT_ARG("nat ", cmd->arg1); - break; + if (cmd->arg1 != 0) + PRINT_UINT_ARG("nat ", cmd->arg1); + else + printf("nat global"); + break; case O_SETFIB: PRINT_UINT_ARG("setfib ", cmd->arg1); @@ -2728,9 +2731,14 @@ ipfw_add(char *av[]) break; case TOK_NAT: - action->opcode = O_NAT; - action->len = F_INSN_SIZE(ipfw_insn_nat); - goto chkarg; + action->opcode = O_NAT; + action->len = F_INSN_SIZE(ipfw_insn_nat); + if (_substrcmp(*av, "global") == 0) { + action->arg1 = 0; + av++; + break; + } else + goto chkarg; case TOK_QUEUE: action->opcode = O_QUEUE; Modified: stable/8/sbin/ipfw/ipfw2.h ============================================================================== --- stable/8/sbin/ipfw/ipfw2.h Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/ipfw2.h Thu Jul 28 10:10:39 2011 (r224473) @@ -178,6 +178,7 @@ enum tokens { TOK_DENY_INC, TOK_SAME_PORTS, TOK_UNREG_ONLY, + TOK_SKIP_GLOBAL, TOK_RESET_ADDR, TOK_ALIAS_REV, TOK_PROXY_ONLY, Modified: stable/8/sbin/ipfw/nat.c ============================================================================== --- stable/8/sbin/ipfw/nat.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sbin/ipfw/nat.c Thu Jul 28 10:10:39 2011 (r224473) @@ -53,6 +53,7 @@ static struct _s_x nat_params[] = { { "deny_in", TOK_DENY_INC }, { "same_ports", TOK_SAME_PORTS }, { "unreg_only", TOK_UNREG_ONLY }, + { "skip_global", TOK_SKIP_GLOBAL }, { "reset", TOK_RESET_ADDR }, { "reverse", TOK_ALIAS_REV }, { "proxy_only", TOK_PROXY_ONLY }, @@ -638,6 +639,9 @@ print_nat_config(unsigned char *buf) } else if (n->mode & PKT_ALIAS_SAME_PORTS) { printf(" same_ports"); n->mode &= ~PKT_ALIAS_SAME_PORTS; + } else if (n->mode & PKT_ALIAS_SKIP_GLOBAL) { + printf(" skip_global"); + n->mode &= ~PKT_ALIAS_SKIP_GLOBAL; } else if (n->mode & PKT_ALIAS_UNREGISTERED_ONLY) { printf(" unreg_only"); n->mode &= ~PKT_ALIAS_UNREGISTERED_ONLY; @@ -760,10 +764,11 @@ ipfw_config_nat(int ac, char **av) case TOK_IF: ac1--; av1++; - break; + break; case TOK_ALOG: case TOK_DENY_INC: case TOK_SAME_PORTS: + case TOK_SKIP_GLOBAL: case TOK_UNREG_ONLY: case TOK_RESET_ADDR: case TOK_ALIAS_REV: @@ -856,6 +861,9 @@ ipfw_config_nat(int ac, char **av) case TOK_UNREG_ONLY: n->mode |= PKT_ALIAS_UNREGISTERED_ONLY; break; + case TOK_SKIP_GLOBAL: + n->mode |= PKT_ALIAS_SKIP_GLOBAL; + break; case TOK_RESET_ADDR: n->mode |= PKT_ALIAS_RESET_ON_ADDR_CHANGE; break; Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 28 10:10:39 2011 (r224473) @@ -2128,6 +2128,13 @@ do { \ int nat_id; set_match(args, f_pos, chain); + /* Check if this is 'global' nat rule */ + if (cmd->arg1 == 0) { + retval = ipfw_nat_ptr(args, NULL, m); + l = 0; + done = 1; + break; + } t = ((ipfw_insn_nat *)cmd)->nat; if (t == NULL) { nat_id = (cmd->arg1 == IP_FW_TABLEARG) ? Modified: stable/8/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_nat.c Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sys/netinet/ipfw/ip_fw_nat.c Thu Jul 28 10:10:39 2011 (r224473) @@ -207,7 +207,8 @@ ipfw_nat(struct ip_fw_args *args, struct struct mbuf *mcl; struct ip *ip; /* XXX - libalias duct tape */ - int ldt, retval; + int ldt, retval, found; + struct ip_fw_chain *chain; char *c; ldt = 0; @@ -256,12 +257,44 @@ ipfw_nat(struct ip_fw_args *args, struct ldt = 1; c = mtod(mcl, char *); - if (args->oif == NULL) - retval = LibAliasIn(t->lib, c, - mcl->m_len + M_TRAILINGSPACE(mcl)); - else - retval = LibAliasOut(t->lib, c, - mcl->m_len + M_TRAILINGSPACE(mcl)); + + /* Check if this is 'global' instance */ + if (t == NULL) { + if (args->oif == NULL) { + /* Wrong direction, skip processing */ + args->m = mcl; + return (IP_FW_NAT); + } + + found = 0; + chain = &V_layer3_chain; + IPFW_RLOCK(chain); + /* Check every nat entry... */ + LIST_FOREACH(t, &chain->nat, _next) { + if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0) + continue; + retval = LibAliasOutTry(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl), 0); + if (retval == PKT_ALIAS_OK) { + /* Nat instance recognises state */ + found = 1; + break; + } + } + IPFW_RUNLOCK(chain); + if (found != 1) { + /* No instance found, return ignore */ + args->m = mcl; + return (IP_FW_NAT); + } + } else { + if (args->oif == NULL) + retval = LibAliasIn(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl)); + else + retval = LibAliasOut(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl)); + } /* * We drop packet when: @@ -274,7 +307,7 @@ ipfw_nat(struct ip_fw_args *args, struct if (retval == PKT_ALIAS_ERROR || (args->oif == NULL && (retval == PKT_ALIAS_UNRESOLVED_FRAGMENT || (retval == PKT_ALIAS_IGNORED && - (t->lib->packetAliasMode & PKT_ALIAS_DENY_INCOMING) != 0)))) { + (t->mode & PKT_ALIAS_DENY_INCOMING) != 0)))) { /* XXX - should i add some logging? */ m_free(mcl); args->m = NULL; Modified: stable/8/sys/netinet/libalias/alias.h ============================================================================== --- stable/8/sys/netinet/libalias/alias.h Thu Jul 28 09:27:01 2011 (r224472) +++ stable/8/sys/netinet/libalias/alias.h Thu Jul 28 10:10:39 2011 (r224473) @@ -220,6 +220,12 @@ struct mbuf *m_megapullup(struct mbuf */ #define PKT_ALIAS_REVERSE 0x80 +/* + * If PKT_ALIAS_SKIP_GLOBAL is set, nat instance is not checked for matching + * states in 'ipfw nat global' rule. + */ +#define PKT_ALIAS_SKIP_GLOBAL 0x200 + /* Function return codes. */ #define PKT_ALIAS_ERROR -1 #define PKT_ALIAS_OK 1 From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 10:16:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68ABB106564A; Thu, 28 Jul 2011 10:16:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5F88FC0C; Thu, 28 Jul 2011 10:16:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SAGVIU095838; Thu, 28 Jul 2011 10:16:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SAGUN3095833; Thu, 28 Jul 2011 10:16:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107281016.p6SAGUN3095833@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 28 Jul 2011 10:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224474 - stable/8/sys/netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 10:16:31 -0000 Author: ae Date: Thu Jul 28 10:16:30 2011 New Revision: 224474 URL: http://svn.freebsd.org/changeset/base/224474 Log: MFC r223437: Export AddLink() function from libalias. It can be used when custom alias address needs to be specified. Add inbound handler to the alias_ftp module. It helps handle active FTP transfer mode for the case with external clients and FTP server behind NAT. Fix passive FTP transfer case for server behind NAT using redirect with external IP address different from NAT ip address. PR: kern/157957 Submitted by: Alexander V. Chernikov Modified: stable/8/sys/netinet/libalias/alias_db.c stable/8/sys/netinet/libalias/alias_ftp.c stable/8/sys/netinet/libalias/alias_local.h stable/8/sys/netinet/libalias/libalias.3 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/netinet/libalias/alias_db.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_db.c Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/alias_db.c Thu Jul 28 10:16:30 2011 (r224474) @@ -552,10 +552,6 @@ static void IncrementalCleanup(struct li static void DeleteLink(struct alias_link *); static struct alias_link * -AddLink(struct libalias *, struct in_addr, struct in_addr, struct in_addr, - u_short, u_short, int, int); - -static struct alias_link * ReLink(struct alias_link *, struct in_addr, struct in_addr, struct in_addr, u_short, u_short, int, int); @@ -572,9 +568,6 @@ static struct alias_link * #define ALIAS_PORT_MASK_EVEN 0x07ffe #define GET_NEW_PORT_MAX_ATTEMPTS 20 -#define GET_ALIAS_PORT -1 -#define GET_ALIAS_ID GET_ALIAS_PORT - #define FIND_EVEN_ALIAS_BASE 1 /* GetNewPort() allocates port numbers. Note that if a port number @@ -937,17 +930,12 @@ DeleteLink(struct alias_link *lnk) } -static struct alias_link * -AddLink(struct libalias *la, struct in_addr src_addr, - struct in_addr dst_addr, - struct in_addr alias_addr, - u_short src_port, - u_short dst_port, - int alias_port_param, /* if less than zero, alias */ - int link_type) -{ /* port will be automatically *//* chosen. - * If greater than */ - u_int start_point; /* zero, equal to alias port */ +struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_port_param, int link_type) +{ + u_int start_point; struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); Modified: stable/8/sys/netinet/libalias/alias_ftp.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_ftp.c Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/alias_ftp.c Thu Jul 28 10:16:30 2011 (r224474) @@ -100,38 +100,68 @@ __FBSDID("$FreeBSD$"); #define FTP_CONTROL_PORT_NUMBER 21 static void -AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, - int maxpacketsize); +AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, + int maxpacketsize); +static void +AliasHandleFtpIn(struct libalias *, struct ip *, struct alias_link *); -static int -fingerprint(struct libalias *la, struct alias_data *ah) +static int +fingerprint_out(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || - ah->maxpktsize == 0) + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + ah->maxpktsize == 0) return (-1); - if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER - || ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) return (0); return (-1); } -static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +static int +fingerprint_in(struct libalias *la, struct alias_data *ah) +{ + + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) + return (-1); + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + return (0); + return (-1); +} + +static int +protohandler_out(struct libalias *la, struct ip *pip, struct alias_data *ah) { - + AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize); return (0); } + +static int +protohandler_in(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ + + AliasHandleFtpIn(la, pip, ah->lnk); + return (0); +} + struct proto_handler handlers[] = { - { - .pri = 80, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, - .protohandler = &protohandler - }, + { + .pri = 80, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint_out, + .protohandler = &protohandler_out + }, + { + .pri = 80, + .dir = IN, + .proto = TCP, + .fingerprint = &fingerprint_in, + .protohandler = &protohandler_in + }, { EOH } }; @@ -256,6 +286,57 @@ AliasHandleFtpOut( } } +static void +AliasHandleFtpIn(struct libalias *la, + struct ip *pip, /* IP packet to examine/patch */ + struct alias_link *lnk) /* The link to go through (aliased port) */ +{ + int hlen, tlen, dlen, pflags; + char *sptr; + struct tcphdr *tc; + + /* Calculate data length of TCP packet */ + tc = (struct tcphdr *)ip_next(pip); + hlen = (pip->ip_hl + tc->th_off) << 2; + tlen = ntohs(pip->ip_len); + dlen = tlen - hlen; + + /* Place string pointer and beginning of data */ + sptr = (char *)pip; + sptr += hlen; + + /* + * Check that data length is not too long and previous message was + * properly terminated with CRLF. + */ + pflags = GetProtocolFlags(lnk); + if (dlen <= MAX_MESSAGE_SIZE && (pflags & WAIT_CRLF) == 0 && + ntohs(tc->th_dport) == FTP_CONTROL_PORT_NUMBER && + (ParseFtpPortCommand(la, sptr, dlen) != 0 || + ParseFtpEprtCommand(la, sptr, dlen) != 0)) { + /* + * Alias active mode client requesting data from server + * behind NAT. We need to alias server->client connection + * to external address client is connecting to. + */ + AddLink(la, GetOriginalAddress(lnk), la->true_addr, + GetAliasAddress(lnk), htons(FTP_CONTROL_PORT_NUMBER - 1), + htons(la->true_port), GET_ALIAS_PORT, IPPROTO_TCP); + } + /* Track the msgs which are CRLF term'd for PORT/PASV FW breach */ + if (dlen) { + sptr = (char *)pip; /* start over at beginning */ + tlen = ntohs(pip->ip_len); /* recalc tlen, pkt may + * have grown. + */ + if (sptr[tlen - 2] == '\r' && sptr[tlen - 1] == '\n') + pflags &= ~WAIT_CRLF; + else + pflags |= WAIT_CRLF; + SetProtocolFlags(lnk, pflags); + } +} + static int ParseFtpPortCommand(struct libalias *la, char *sptr, int dlen) { @@ -576,9 +657,10 @@ NewFtpMessage(struct libalias *la, struc if (la->true_port < IPPORT_RESERVED) return; -/* Establish link to address and port found in FTP control message. */ - ftp_lnk = FindUdpTcpOut(la, la->true_addr, GetDestAddress(lnk), - htons(la->true_port), 0, IPPROTO_TCP, 1); + /* Establish link to address and port found in FTP control message. */ + ftp_lnk = AddLink(la, la->true_addr, GetDestAddress(lnk), + GetAliasAddress(lnk), htons(la->true_port), 0, GET_ALIAS_PORT, + IPPROTO_TCP); if (ftp_lnk != NULL) { int slen, hlen, tlen, dlen; Modified: stable/8/sys/netinet/libalias/alias_local.h ============================================================================== --- stable/8/sys/netinet/libalias/alias_local.h Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/alias_local.h Thu Jul 28 10:16:30 2011 (r224474) @@ -67,6 +67,9 @@ #define LINK_TABLE_OUT_SIZE 4001 #define LINK_TABLE_IN_SIZE 4001 +#define GET_ALIAS_PORT -1 +#define GET_ALIAS_ID GET_ALIAS_PORT + struct proxy_entry; struct libalias { @@ -249,6 +252,10 @@ DifferentialChecksum(u_short * _cksum, v /* Internal data access */ struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_param, int link_type); +struct alias_link * FindIcmpIn(struct libalias *la, struct in_addr _dst_addr, struct in_addr _alias_addr, u_short _id_alias, int _create); struct alias_link * Modified: stable/8/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/8/sys/netinet/libalias/libalias.3 Thu Jul 28 10:10:39 2011 (r224473) +++ stable/8/sys/netinet/libalias/libalias.3 Thu Jul 28 10:16:30 2011 (r224474) @@ -812,6 +812,17 @@ argument is the pointer to a header frag is the pointer to the packet to be de-aliased. .Ed .Sh MISCELLANEOUS FUNCTIONS +.Ft struct alias_link * +.Fn AddLink "struct libalias *" "struct in_addr src_addr" "struct in_addr dst_addr" \ +"struct in_addr alias_addr" "u_short src_port" "u_short dst_port" \ +"int alias_param" "int link_type" +.Bd -ragged -offset indent +This function adds new state to instance hash table. +Zero can be specified instead of dst_address and/or dst port. +This makes link partially specified dynamic. +However due to hashing method such links can be resolved on inbound (ext -> int) only. +.Ed +.Pp .Ft void .Fn LibAliasSetTarget "struct libalias *" "struct in_addr addr" .Bd -ragged -offset indent From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 11:41:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D099106564A; Thu, 28 Jul 2011 11:41:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2B68FC0A; Thu, 28 Jul 2011 11:41:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SBfu8M002115; Thu, 28 Jul 2011 11:41:56 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SBfuZg002113; Thu, 28 Jul 2011 11:41:56 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201107281141.p6SBfuZg002113@svn.freebsd.org> From: Benedict Reuschling Date: Thu, 28 Jul 2011 11:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224475 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 11:41:56 -0000 Author: bcr (doc committer) Date: Thu Jul 28 11:41:55 2011 New Revision: 224475 URL: http://svn.freebsd.org/changeset/base/224475 Log: Add a section to the jail chapter that explains why it is not recommended to allow root users in the jail to access the host system. PR: docs/156853 Submitted by: crees Patch by: crees Approved by: re (kib) for BETA1 Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Jul 28 10:16:30 2011 (r224474) +++ head/usr.sbin/jail/jail.8 Thu Jul 28 11:41:55 2011 (r224475) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2011 +.Dd July 28, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -914,3 +914,8 @@ directory that is moved out of the jail' access to the file space outside of the jail. It is recommended that directories always be copied, rather than moved, out of a jail. +.Pp +It is also not recommended that users allowed root in the jail be allowed +access to the host system. +For example, a root user in a jail can create a setuid root utility that +could be run in the host system to achieve elevated privileges. From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 12:23:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E10C8106567D; Thu, 28 Jul 2011 12:23:32 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D22C18FC16; Thu, 28 Jul 2011 12:23:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SCNWUf003493; Thu, 28 Jul 2011 12:23:32 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SCNWn3003491; Thu, 28 Jul 2011 12:23:32 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201107281223.p6SCNWn3003491@svn.freebsd.org> From: Benedict Reuschling Date: Thu, 28 Jul 2011 12:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224477 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 12:23:33 -0000 Author: bcr (doc committer) Date: Thu Jul 28 12:23:32 2011 New Revision: 224477 URL: http://svn.freebsd.org/changeset/base/224477 Log: Revert my last change to this file, as BETA1 is not announced yet. Pointed out by: kib Pointy hat to: me Approved by: re (kib, implicit) Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Jul 28 12:08:13 2011 (r224476) +++ head/usr.sbin/jail/jail.8 Thu Jul 28 12:23:32 2011 (r224477) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2011 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -914,8 +914,3 @@ directory that is moved out of the jail' access to the file space outside of the jail. It is recommended that directories always be copied, rather than moved, out of a jail. -.Pp -It is also not recommended that users allowed root in the jail be allowed -access to the host system. -For example, a root user in a jail can create a setuid root utility that -could be run in the host system to achieve elevated privileges. From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 15:12:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36288106566B; Thu, 28 Jul 2011 15:12:16 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id B4C0E8FC18; Thu, 28 Jul 2011 15:12:15 +0000 (UTC) Received: by gxk28 with SMTP id 28so2397120gxk.13 for ; Thu, 28 Jul 2011 08:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Wk4hVuhGnU980DWu+7Qx34zZTzeD/bxZ1PeUNV6TABY=; b=IAAgfnGuHZDh24DBiYRgIWBf2dEKAkJseWrUj0OZYXYEE2E59Y904mQQGgBDOsu5DQ b/UK7s8kJmx4H4MjoNIIf6aP9rFCQXaxfAugHVgSuAZTWy8kcONjPzGuWywoum4fvGov ulWZyRylB3ll+dxq2zO9B73V/IX3ZOYrM3QGs= MIME-Version: 1.0 Received: by 10.236.80.67 with SMTP id j43mr184765yhe.57.1311865934994; Thu, 28 Jul 2011 08:12:14 -0700 (PDT) Received: by 10.236.109.147 with HTTP; Thu, 28 Jul 2011 08:12:14 -0700 (PDT) In-Reply-To: <201107281141.p6SBfuZg002113@svn.freebsd.org> References: <201107281141.p6SBfuZg002113@svn.freebsd.org> Date: Thu, 28 Jul 2011 11:12:14 -0400 Message-ID: From: Ben Kaduk To: Benedict Reuschling , rwatson@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224475 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 15:12:16 -0000 On Thu, Jul 28, 2011 at 7:41 AM, Benedict Reuschling wrot= e: > Author: bcr (doc committer) > Date: Thu Jul 28 11:41:55 2011 > New Revision: 224475 > URL: http://svn.freebsd.org/changeset/base/224475 > > Log: > =A0Add a section to the jail chapter that explains why it is not > =A0recommended to allow root users in the jail to access the host system. > > =A0PR: =A0 =A0 =A0 =A0 =A0 docs/156853 > =A0Submitted by: crees > =A0Patch by: =A0 =A0 crees > =A0Approved by: =A0re (kib) for BETA1 > > Modified: > =A0head/usr.sbin/jail/jail.8 > > Modified: head/usr.sbin/jail/jail.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/jail/jail.8 =A0 Thu Jul 28 10:16:30 2011 =A0 =A0 =A0 = =A0(r224474) > +++ head/usr.sbin/jail/jail.8 =A0 Thu Jul 28 11:41:55 2011 =A0 =A0 =A0 = =A0(r224475) > @@ -34,7 +34,7 @@ > =A0.\" > =A0.\" $FreeBSD$ > =A0.\" > -.Dd July 23, 2011 > +.Dd July 28, 2011 > =A0.Dt JAIL 8 > =A0.Os > =A0.Sh NAME > @@ -914,3 +914,8 @@ directory that is moved out of the jail' > =A0access to the file space outside of the jail. > =A0It is recommended that directories always be copied, rather than moved= , out > =A0of a jail. > +.Pp > +It is also not recommended that users allowed root in the jail be allowe= d > +access to the host system. > +For example, a root user in a jail can create a setuid root utility that > +could be run in the host system to achieve elevated privileges. Per rwatson's comment on the other jail.8 thread we've got going, we might recommend that the separate file system for a jail might also be mounted nosuid, which would close off this class of attack. I don't have a good sense of whether suid applications are frequently useful/needed inside a jail, though. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 15:28:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15219106566B; Thu, 28 Jul 2011 15:28:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E26038FC19; Thu, 28 Jul 2011 15:28:45 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6B9D046B2A; Thu, 28 Jul 2011 11:28:45 -0400 (EDT) Date: Thu, 28 Jul 2011 16:28:45 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ben Kaduk In-Reply-To: Message-ID: References: <201107281141.p6SBfuZg002113@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-478209871-1311866925=:24841" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Benedict Reuschling , src-committers@freebsd.org Subject: Re: svn commit: r224475 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 15:28:46 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --621616949-478209871-1311866925=:24841 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 28 Jul 2011, Ben Kaduk wrote: >> @@ -914,3 +914,8 @@ directory that is moved out of the jail' >>  access to the file space outside of the jail. >>  It is recommended that directories always be copied, rather than moved, out >>  of a jail. >> +.Pp >> +It is also not recommended that users allowed root in the jail be allowed >> +access to the host system. >> +For example, a root user in a jail can create a setuid root utility that >> +could be run in the host system to achieve elevated privileges. > > Per rwatson's comment on the other jail.8 thread we've got going, we might > recommend that the separate file system for a jail might also be mounted > nosuid, which would close off this class of attack. Setting nosuid will break many common jail installations by turning off things like su(1), sudo, crontab, at, etc. I think that the better way to approach this may be to discuss, briefly, the philosophy behind Jail: it's not a virtualisation service, it's a subsetting service. A result of that is that the host system is a superset of the various containers, and has properties derived from each of them. You could imagine using various integrity/tainting schemes to avoid this issue -- a new nosuidjail (don't allow it to be setuid except in a jail), using some of our MAC-related schemes, etc. I would be tempted not to do things, but rather, to document the actual semantics and some of the implications. Robert --621616949-478209871-1311866925=:24841-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 16:40:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 345EA1065670; Thu, 28 Jul 2011 16:40:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A7669152409; Thu, 28 Jul 2011 16:40:53 +0000 (UTC) Message-ID: <4E319115.5050003@FreeBSD.org> Date: Thu, 28 Jul 2011 09:40:53 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:5.0) Gecko/20110723 Thunderbird/5.0 MIME-Version: 1.0 To: Robert Watson References: <201107281141.p6SBfuZg002113@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Benedict Reuschling , src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r224475 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 16:40:54 -0000 On 07/28/2011 08:28, Robert Watson wrote: > > On Thu, 28 Jul 2011, Ben Kaduk wrote: > >>> @@ -914,3 +914,8 @@ directory that is moved out of the jail' >>> access to the file space outside of the jail. >>> It is recommended that directories always be copied, rather than >>> moved, out >>> of a jail. >>> +.Pp >>> +It is also not recommended that users allowed root in the jail be >>> allowed >>> +access to the host system. >>> +For example, a root user in a jail can create a setuid root utility >>> that >>> +could be run in the host system to achieve elevated privileges. >> >> Per rwatson's comment on the other jail.8 thread we've got going, we >> might recommend that the separate file system for a jail might also be >> mounted nosuid, which would close off this class of attack. > > Setting nosuid will break many common jail installations by turning off > things like su(1), sudo, crontab, at, etc. > > I think that the better way to approach this may be to discuss, briefly, > the philosophy behind Jail: it's not a virtualisation service, it's a > subsetting service. A result of that is that the host system is a > superset of the various containers, and has properties derived from each > of them. You could imagine using various integrity/tainting schemes to > avoid this issue -- a new nosuidjail (don't allow it to be setuid except > in a jail), using some of our MAC-related schemes, etc. I would be > tempted not to do things, but rather, to document the actual semantics > and some of the implications. In my jail use case (package building systems) having to put them on separate file systems would significantly reduce their utility. My take on the previous discussion was "Don't allow untrusted jail users to have access to the host system" which seems like a fundamental security principle in any case. In the absence of that precaution I'm not sure how much more we can help. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 21:00:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E47E1065670; Thu, 28 Jul 2011 21:00:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC7D8FC12; Thu, 28 Jul 2011 21:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SL0lcY018919; Thu, 28 Jul 2011 21:00:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6SL0kGl018917; Thu, 28 Jul 2011 21:00:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107282100.p6SL0kGl018917@svn.freebsd.org> From: Rick Macklem Date: Thu, 28 Jul 2011 21:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224487 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 21:00:47 -0000 Author: rmacklem Date: Thu Jul 28 21:00:46 2011 New Revision: 224487 URL: http://svn.freebsd.org/changeset/base/224487 Log: MFC: r223971 r222389 introduced a case where the NFSv4 client could loop in nfscl_getcl() when a forced dismount is in progress, because nfsv4_lock() will return 0 without sleeping when MNTK_UNMOUNTF is set. This patch fixes it so it won't loop calling nfsv4_lock() for this case. Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Jul 28 20:30:55 2011 (r224486) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Jul 28 21:00:46 2011 (r224487) @@ -761,7 +761,8 @@ nfscl_getcl(vnode_t vp, struct ucred *cr FREE((caddr_t)newclp, M_NFSCLCLIENT); } NFSLOCKCLSTATE(); - while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock) + while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock && + (mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0) igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL, NFSCLSTATEMUTEXPTR, mp); if (!igotlock) From owner-svn-src-all@FreeBSD.ORG Thu Jul 28 23:31:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B231B1065676; Thu, 28 Jul 2011 23:31:23 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 395CC8FC0C; Thu, 28 Jul 2011 23:31:22 +0000 (UTC) Received: by iyb11 with SMTP id 11so4564136iyb.13 for ; Thu, 28 Jul 2011 16:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=Vsj4srFaU8jprIwje3gIy890/UxlZtACGibSQhNUi0E=; b=Boso7uIxxMdj0z9CrMLZiBYhQLbi3AarzE0L2S+HUtARzS/PgMYAghQ2lXl2j9M4aF RJFt5sjZbzQOAS9nkRkwWjg73FFZxGG0zvYHuWvUBA4RNea2U8422tcnd7WH6KQdBMGx 3tBgPELp0lAmxfTdcZJljHUZOEeDQ4jYlTanA= Received: by 10.42.157.138 with SMTP id d10mr421476icx.490.1311895882520; Thu, 28 Jul 2011 16:31:22 -0700 (PDT) Received: from DataIX.net ([99.56.120.66]) by mx.google.com with ESMTPS id e2sm944285ibb.23.2011.07.28.16.31.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jul 2011 16:31:20 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6SNVGJL038296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Jul 2011 19:31:17 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6SNVE9b038295; Thu, 28 Jul 2011 19:31:14 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Thu, 28 Jul 2011 19:31:14 -0400 From: Jason Hellenthal To: Robert Watson Message-ID: <20110728233114.GA37774@DataIX.net> References: <201107270156.p6R1uquD035835@svn.freebsd.org> <20110728021914.GA55550@DataIX.net> <4E30CEEB.107@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: Cc: Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r224462 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 23:31:23 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 28, 2011 at 10:40:19AM +0100, Robert Watson wrote: >=20 > On Wed, 27 Jul 2011, Glen Barber wrote: >=20 > >> How is either one of these different ? > >> > >> All mv(1) is doing is a cp(1) & rm(1). In either case the filehandle i= s=20 > >> still broken and a process is not going to just get up and move with i= t. On=20 > >> the other side though if you copied a pipe or socket or something simi= liar=20 > >> for example into a jail then it might make whatever is outside availab= le to=20 > >> the jailed environment. > >> > >> Is there something I am misunderstanding about this ? has the way cp(1= ),=20 > >> rm(1) & mv(1) been changed recently ? or is this wording a little off ? > > > > The text in the example is just an example of a situation where it may = be=20 > > possible for a process within a jail(8) to gain filesystem access outsi= de of=20 > > the jail(8). >=20 > I wonder, if on these grounds, we should actually advise administrators t= hat=20 > it is a more robust configuration, both in terms of managing free space a= nd=20 > avoiding potential escape paths, to put each jail in its own file system.= =20 > Lots of people do this anyway, and as recommendations go, it's not a bad = one.=20 > We can then caution that if you *don't* do this, then you need to be care= ful=20 > about the mv issue. >=20 That sounds like a perfectly sane idea. --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOMfFCAAoJEJBXh4mJ2FR+XXkH/im3tgkucIQrtuqd5DZbBIck q3qtWsT3fGyRoEKB3sGXLzxDpMeic9Rm5qES9FQFM/vW/sxoNu6k8jd/7LwoD5bG merDyuJCSuHIoaYDGssKUCt/z+sr5+7dwPQEhWsc2MdoDaX55JLiyDsdevbFZoeb 1q0XQVh6jUBHHVzam7ex4xSCZ3UjVwe8gaHbZd3J7uvXPowgHVDcgYbRMDKvQ9Km xgoWSpXfGR4SCsbzLKVNI4eVN2TvDo80DLqCDFkKr9rOqDB/l2IveZMgq5q8dTZ/ lBkAZEIZZHbANwsfFchGVbfOn6WoKSdjDyiDehwiKTNZYUnLUwJ5tUQI0cdgGqI= =OQAQ -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 06:15:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2277B106567F; Fri, 29 Jul 2011 06:15:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07B418FC23; Fri, 29 Jul 2011 06:15:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T6FICa035451; Fri, 29 Jul 2011 06:15:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6T6FITb035448; Fri, 29 Jul 2011 06:15:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107290615.p6T6FITb035448@svn.freebsd.org> From: Xin LI Date: Fri, 29 Jul 2011 06:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224488 - stable/8/sbin/dumpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 06:15:19 -0000 Author: delphij Date: Fri Jul 29 06:15:18 2011 New Revision: 224488 URL: http://svn.freebsd.org/changeset/base/224488 Log: MFC rr224004,224025: Add a -l option to show file system's corresponding /dev/ufsid path. This is useful for scripts that converts existing system's fstab to use their /dev/ufsid devices. Modified: stable/8/sbin/dumpfs/dumpfs.8 stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.8 Thu Jul 28 21:00:46 2011 (r224487) +++ stable/8/sbin/dumpfs/dumpfs.8 Fri Jul 29 06:15:18 2011 (r224488) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd Jul 14, 2011 .Dt DUMPFS 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl f +.Op Fl l .Op Fl m .Ar filesys | device .Sh DESCRIPTION @@ -44,7 +45,8 @@ The .Nm utility prints out the super block and cylinder group information for the file system or special device specified, unless the -.Fl f +.Fl f , +.Fl l or .Fl m flag is specified. @@ -64,6 +66,11 @@ Fragment numbers may be converted to raw fragment size, which may be useful when recovering deleted data. .Pp If +.Fl l +is specified, the pathname to the file system's container derived from +its unique identifier is printed. +.Pp +If .Fl m is specified, a .Xr newfs 8 Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Thu Jul 28 21:00:46 2011 (r224487) +++ stable/8/sbin/dumpfs/dumpfs.c Fri Jul 29 06:15:18 2011 (r224488) @@ -68,6 +68,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ static const char rcsid[] = struct uufsd disk; int dumpfs(const char *); +int dumpfsid(void); int dumpcg(void); int dumpfreespace(const char *, int); void dumpfreespacecg(int); @@ -92,11 +94,11 @@ int main(int argc, char *argv[]) { const char *name; - int ch, dofreespace, domarshal, eval; + int ch, dofreespace, domarshal, dolabel, eval; - dofreespace = domarshal = eval = 0; + dofreespace = domarshal = dolabel = eval = 0; - while ((ch = getopt(argc, argv, "fm")) != -1) { + while ((ch = getopt(argc, argv, "lfm")) != -1) { switch (ch) { case 'f': dofreespace++; @@ -104,6 +106,9 @@ main(int argc, char *argv[]) case 'm': domarshal = 1; break; + case 'l': + dolabel = 1; + break; case '?': default: usage(); @@ -129,6 +134,8 @@ main(int argc, char *argv[]) eval |= dumpfreespace(name, dofreespace); else if (domarshal) eval |= marshal(name); + else if (dolabel) + eval |= dumpfsid(); else eval |= dumpfs(name); ufs_disk_close(&disk); @@ -137,6 +144,14 @@ main(int argc, char *argv[]) } int +dumpfsid(void) +{ + + printf("%sufsid/%08x%08x\n", _PATH_DEV, afs.fs_id[0], afs.fs_id[1]); + return 0; +} + +int dumpfs(const char *name) { time_t fstime; From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 06:16:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E69F61065670; Fri, 29 Jul 2011 06:16:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5BBC8FC1C; Fri, 29 Jul 2011 06:16:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T6GG7I035524; Fri, 29 Jul 2011 06:16:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6T6GGq6035522; Fri, 29 Jul 2011 06:16:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107290616.p6T6GGq6035522@svn.freebsd.org> From: Xin LI Date: Fri, 29 Jul 2011 06:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224489 - stable/8/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 06:16:17 -0000 Author: delphij Date: Fri Jul 29 06:16:16 2011 New Revision: 224489 URL: http://svn.freebsd.org/changeset/base/224489 Log: Use calloc() instead of an explicit memset. Modified: stable/8/usr.sbin/mountd/mountd.c Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/mountd.c ============================================================================== --- stable/8/usr.sbin/mountd/mountd.c Fri Jul 29 06:15:18 2011 (r224488) +++ stable/8/usr.sbin/mountd/mountd.c Fri Jul 29 06:16:16 2011 (r224489) @@ -1789,10 +1789,9 @@ get_exp(void) { struct exportlist *ep; - ep = (struct exportlist *)malloc(sizeof (struct exportlist)); + ep = (struct exportlist *)calloc(1, sizeof (struct exportlist)); if (ep == (struct exportlist *)NULL) out_of_mem(); - memset(ep, 0, sizeof(struct exportlist)); return (ep); } @@ -1804,10 +1803,9 @@ get_grp(void) { struct grouplist *gp; - gp = (struct grouplist *)malloc(sizeof (struct grouplist)); + gp = (struct grouplist *)calloc(1, sizeof (struct grouplist)); if (gp == (struct grouplist *)NULL) out_of_mem(); - memset(gp, 0, sizeof(struct grouplist)); return (gp); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 06:42:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95137106564A; Fri, 29 Jul 2011 06:42:22 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id CBBE48FC0A; Fri, 29 Jul 2011 06:42:21 +0000 (UTC) Received: by yic13 with SMTP id 13so3008954yic.13 for ; Thu, 28 Jul 2011 23:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CyNpUqRTio4wrAThCuhw5KLyi3LmsaIriw+SC0UxJxk=; b=plrRi2ROddyQjLt6b2ySvzJuM4ic6KQkJd6ItR47fFeUIYNDjuI2dG3rbfj1ojJ/uO dUt5l3V7um9DF6QpYAsYC0xXthZNSZ9yFDplIDq75E+BT7DP+NpdytC4mexVLYseoOWh 85uos0ouAlzapB50ISeA+Y+XLd/RchBu70Xhc= MIME-Version: 1.0 Received: by 10.150.238.19 with SMTP id l19mr348395ybh.301.1311921740943; Thu, 28 Jul 2011 23:42:20 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.150.200.3 with HTTP; Thu, 28 Jul 2011 23:42:20 -0700 (PDT) In-Reply-To: References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> <4E2DB8AC.3000703@FreeBSD.org> <4E2DBCBF.2030402@freebsd.org> Date: Fri, 29 Jul 2011 10:42:20 +0400 X-Google-Sender-Auth: 9R0KnZ1jETAzC-w8FL7VMLMPG68 Message-ID: From: Sergey Kandaurov To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn , Andreas Tobler Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 06:42:22 -0000 On 28 July 2011 06:59, Attilio Rao wrote: > I think that the following patch may better reflect the definition of size_t: > http://www.freebsd.org/~attilio/sintrcnt-fixup32.diff > > Do you think you can test it out? Hi. FYI, I just finished buildtesting the patch with make universe. No stopping build errors found (surely, that still doesn't indicate that it works). > > 2011/7/25 Attilio Rao : >> Guys, I'm a bit out of that for a couple of days, flying to another >> continent, I'm not entirely sure the patch is right because I think we >> need an unified approach for specifying a 32-bits value, but you can >> check-in as a showstopper for the moment, I will make a better one in >> a couple of days. >> >> Attilio >> >> 2011/7/25 Nathan Whitehorn : >>> On 07/25/11 13:40, Andreas Tobler wrote: >>>> >>>> On 24.07.11 23:35, Nathan Whitehorn wrote: >>>>> >>>>> On 07/19/11 07:41, Attilio Rao wrote: >>>>>> >>>>>> Author: attilio >>>>>> Date: Tue Jul 19 12:41:57 2011 >>>>>> New Revision: 224216 >>>>>> URL: http://svn.freebsd.org/changeset/base/224216 >>>>>> >>>>>> Log: >>>>>> On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes >>>>>> storage. >>>>>> Fix the sintrcnt/sintrnames specification. >>>>>> >>>>>> No MFC is previewed for this patch. >>>>>> >>>>> >>>>> These also need to be .long on 32-bit PowerPC, otherwise this change >>>>> triggers kernel panics and faults in sysctl. Please change it as quickly >>>>> as possible. >>>> >>>> Like the below? >>>> >>>> I'll test and I could commit if ok. (Build and approval) >>>> >>>> Gruss, >>>> Andreas >>>> >>>> Index: locore32.S >>>> =================================================================== >>>> --- locore32.S (revision 224326) >>>> +++ locore32.S (working copy) >>>> @@ -91,13 +91,13 @@ >>>> GLOBAL(intrnames) >>>> .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >>>> GLOBAL(sintrnames) >>>> - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >>>> + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 >>>> >>>> .align 4 >>>> GLOBAL(intrcnt) >>>> .space INTRCNT_COUNT * 4 * 2 >>>> GLOBAL(sintrcnt) >>>> - .word INTRCNT_COUNT * 4 * 2 >>>> + .long INTRCNT_COUNT * 4 * 2 >>>> >>>> .text >>>> .globl btext >>> >>> Exactly like that. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 09:58:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71B6106564A; Fri, 29 Jul 2011 09:58:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFBB8FC14; Fri, 29 Jul 2011 09:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T9wuYQ042487; Fri, 29 Jul 2011 09:58:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6T9wum1042480; Fri, 29 Jul 2011 09:58:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107290958.p6T9wum1042480@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 09:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 09:58:57 -0000 Author: mav Date: Fri Jul 29 09:58:56 2011 New Revision: 224490 URL: http://svn.freebsd.org/changeset/base/224490 Log: MFC r224270: - Use mutex to serialize index/data register pair usage, when accessing SATA registers. Unserialized access under heavy load caused wrong speed reporting and potentially could cause device loss. - To free memory and other resources (including above), allocated during chipinit() method call on attach, add new chipdeinit() method, called during driver detach. Modified: stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-acard.c stable/8/sys/dev/ata/chipsets/ata-acerlabs.c stable/8/sys/dev/ata/chipsets/ata-intel.c stable/8/sys/dev/ata/chipsets/ata-promise.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/ata-pci.c Fri Jul 29 09:58:56 2011 (r224490) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* local vars */ -static MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); +MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); /* misc defines */ #define IOMASK 0xfffffffc @@ -146,13 +145,14 @@ ata_pci_detach(device_t dev) device_delete_child(dev, children[i]); free(children, M_TEMP); } - if (ctlr->r_irq) { bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle); bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq); if (ctlr->r_irq_rid != ATA_IRQ_RID) pci_release_msi(dev); } + if (ctlr->chipdeinit != NULL) + ctlr->chipdeinit(dev); if (ctlr->r_res2) bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); if (ctlr->r_res1) Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/ata-pci.h Fri Jul 29 09:58:56 2011 (r224490) @@ -55,6 +55,7 @@ struct ata_pci_controller { int channels; int ichannels; int (*chipinit)(device_t); + int (*chipdeinit)(device_t); int (*suspend)(device_t); int (*resume)(device_t); int (*ch_attach)(device_t); @@ -579,6 +580,8 @@ int ata_sii_chipinit(device_t); /* externs */ extern devclass_t ata_pci_devclass; +MALLOC_DECLARE(M_ATAPCI); + /* macro for easy definition of all driver module stuff */ #define ATA_DECLARE_DRIVER(dname) \ static device_method_t __CONCAT(dname,_methods)[] = { \ Modified: stable/8/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acard.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-acard.c Fri Jul 29 09:58:56 2011 (r224490) @@ -59,6 +59,7 @@ struct ata_serialize { /* local prototypes */ static int ata_acard_chipinit(device_t dev); +static int ata_acard_chipdeinit(device_t dev); static int ata_acard_ch_attach(device_t dev); static int ata_acard_status(device_t dev); static int ata_acard_850_setmode(device_t dev, int target, int mode); @@ -93,6 +94,7 @@ ata_acard_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_acard_chipinit; + ctlr->chipdeinit = ata_acard_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -111,7 +113,7 @@ ata_acard_chipinit(device_t dev) ctlr->setmode = ata_acard_850_setmode; ctlr->locking = ata_serialize; serial = malloc(sizeof(struct ata_serialize), - M_TEMP, M_WAITOK | M_ZERO); + M_ATAPCI, M_WAITOK | M_ZERO); ata_serialize_init(serial); ctlr->chipset_data = serial; } @@ -121,6 +123,21 @@ ata_acard_chipinit(device_t dev) } static int +ata_acard_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_serialize *serial; + + if (ctlr->chip->cfg1 == ATP_OLD) { + serial = ctlr->chipset_data; + mtx_destroy(&serial->locked_mtx); + free(serial, M_ATAPCI); + ctlr->chipset_data = NULL; + } + return (0); +} + +static int ata_acard_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jul 29 09:58:56 2011 (r224490) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ali_chipinit(device_t dev); +static int ata_ali_chipdeinit(device_t dev); static int ata_ali_ch_attach(device_t dev); static int ata_ali_sata_ch_attach(device_t dev); static void ata_ali_reset(device_t dev); @@ -95,6 +96,7 @@ ata_ali_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_ali_chipinit; + ctlr->chipdeinit = ata_ali_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -122,7 +124,7 @@ ata_ali_chipinit(device_t dev) return 0; /* Allocate resources for later use by channel attach routines. */ - res = malloc(sizeof(struct ali_sata_resources), M_TEMP, M_WAITOK); + res = malloc(sizeof(struct ali_sata_resources), M_ATAPCI, M_WAITOK); for (i = 0; i < 4; i++) { rid = PCIR_BAR(i); res->bars[i] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, @@ -173,6 +175,27 @@ ata_ali_chipinit(device_t dev) } static int +ata_ali_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ali_sata_resources *res; + int i; + + if (ctlr->chip->cfg2 == ALI_SATA) { + res = ctlr->chipset_data; + for (i = 0; i < 4; i++) { + if (res->bars[i] != NULL) { + bus_release_resource(dev, SYS_RES_IOPORT, + PCIR_BAR(i), res->bars[i]); + } + } + free(res, M_ATAPCI); + ctlr->chipset_data = NULL; + } + return (0); +} + +static int ata_ali_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Fri Jul 29 09:58:56 2011 (r224490) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_intel_chipinit(device_t dev); +static int ata_intel_chipdeinit(device_t dev); static int ata_intel_ch_attach(device_t dev); static void ata_intel_reset(device_t dev); static int ata_intel_old_setmode(device_t dev, int target, int mode); @@ -85,6 +86,18 @@ static void ata_intel_31244_reset(device #define INTEL_6CH2 8 #define INTEL_ICH7 16 +struct ata_intel_data { + struct mtx lock; + u_char smap[4]; +}; + +#define ATA_INTEL_SMAP(ctlr, ch) \ + &((struct ata_intel_data *)((ctlr)->chipset_data))->smap[(ch)->unit * 2] +#define ATA_INTEL_LOCK(ctlr) \ + mtx_lock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock) +#define ATA_INTEL_UNLOCK(ctlr) \ + mtx_unlock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock) + /* * Intel chipset support functions */ @@ -206,6 +219,7 @@ ata_intel_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_intel_chipinit; + ctlr->chipdeinit = ata_intel_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -213,11 +227,14 @@ static int ata_intel_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_intel_data *data; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - ctlr->chipset_data = NULL; + data = malloc(sizeof(struct ata_intel_data), M_ATAPCI, M_WAITOK | M_ZERO); + mtx_init(&data->lock, "Intel SATA lock", NULL, MTX_DEF); + ctlr->chipset_data = (void *)data; /* good old PIIX needs special treatment (not implemented) */ if (ctlr->chip->chipid == ATA_I82371FB) { @@ -305,6 +322,19 @@ ata_intel_chipinit(device_t dev) } static int +ata_intel_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_intel_data *data; + + data = ctlr->chipset_data; + mtx_destroy(&data->lock); + free(data, M_ATAPCI); + ctlr->chipset_data = NULL; + return (0); +} + +static int ata_intel_ch_attach(device_t dev) { struct ata_pci_controller *ctlr; @@ -329,7 +359,7 @@ ata_intel_ch_attach(device_t dev) ch->flags |= ATA_ALWAYS_DMASTAT; if (ctlr->chip->max_dma >= ATA_SA150) { - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); map = pci_read_config(device_get_parent(dev), 0x90, 1); if (ctlr->chip->cfg1 & INTEL_ICH5) { map &= 0x07; @@ -415,7 +445,7 @@ ata_intel_reset(device_t dev) return (ata_generic_reset(dev)); /* Do hard-reset on respective SATA ports. */ - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); mask = 1 << smap[0]; if ((ch->flags & ATA_NO_SLAVE) == 0) mask |= (1 << smap[1]); @@ -605,7 +635,7 @@ ata_intel_sata_ahci_read(device_t dev, i ctlr = device_get_softc(parent); ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); offset = 0x100 + smap[port] * 0x80; switch (reg) { case ATA_SSTATUS: @@ -635,7 +665,7 @@ ata_intel_sata_cscr_read(device_t dev, i parent = device_get_parent(dev); ctlr = device_get_softc(parent); ch = device_get_softc(dev); - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -650,9 +680,11 @@ ata_intel_sata_cscr_read(device_t dev, i default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); pci_write_config(parent, 0xa0, 0x50 + smap[port] * 0x10 + reg * 4, 4); *result = pci_read_config(parent, 0xa4, 4); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -680,8 +712,10 @@ ata_intel_sata_sidpr_read(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg); *result = ATA_IDX_INL(ch, ATA_IDX_DATA); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -698,7 +732,7 @@ ata_intel_sata_ahci_write(device_t dev, ctlr = device_get_softc(parent); ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); offset = 0x100 + smap[port] * 0x80; switch (reg) { case ATA_SSTATUS: @@ -728,7 +762,7 @@ ata_intel_sata_cscr_write(device_t dev, parent = device_get_parent(dev); ctlr = device_get_softc(parent); ch = device_get_softc(dev); - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -743,9 +777,11 @@ ata_intel_sata_cscr_write(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); pci_write_config(parent, 0xa0, 0x50 + smap[port] * 0x10 + reg * 4, 4); pci_write_config(parent, 0xa4, value, 4); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -773,8 +809,10 @@ ata_intel_sata_sidpr_write(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg); ATA_IDX_OUTL(ch, ATA_IDX_DATA, value); + ATA_INTEL_UNLOCK(ctlr); return (0); } Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Fri Jul 29 06:16:16 2011 (r224489) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Fri Jul 29 09:58:56 2011 (r224490) @@ -280,7 +280,7 @@ ata_promise_chipinit(device_t dev) /* setup host packet controls */ hpkt = malloc(sizeof(struct ata_promise_sx4), - M_TEMP, M_NOWAIT | M_ZERO); + M_ATAPCI, M_NOWAIT | M_ZERO); mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 10:02:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36A8106564A; Fri, 29 Jul 2011 10:02:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9D9D8FC20; Fri, 29 Jul 2011 10:02:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TA23W7042714; Fri, 29 Jul 2011 10:02:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TA23Wg042712; Fri, 29 Jul 2011 10:02:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107291002.p6TA23Wg042712@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 10:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224491 - stable/8/usr.sbin/diskinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 10:02:04 -0000 Author: mav Date: Fri Jul 29 10:02:03 2011 New Revision: 224491 URL: http://svn.freebsd.org/changeset/base/224491 Log: MFC r224250: Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB. Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array. Modified: stable/8/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/8/usr.sbin/diskinfo/ (props changed) Modified: stable/8/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/8/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 09:58:56 2011 (r224490) +++ stable/8/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:02:03 2011 (r224491) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -168,7 +169,7 @@ static char sector[65536]; static char mega[1024 * 1024]; static void -rdsect(int fd, u_int blockno, u_int sectorsize) +rdsect(int fd, off_t blockno, u_int sectorsize) { int error; @@ -229,21 +230,27 @@ TR(double count) static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { - int i; - uint b0, b1, sectorcount; + int bulk, i; + off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); + if (step > 16384) + step = 16384; + bulk = mediasize / (1024 * 1024); + if (bulk > 100) + bulk = 100; printf("Seek times:\n"); printf("\tFull stroke:\t"); b0 = 0; - b1 = sectorcount - 1 - 16384; + b1 = sectorcount - step; T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 -= 16384; + b1 -= step; } TN(250); @@ -253,9 +260,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(250); printf("\tQuarter stroke:\t"); @@ -264,9 +271,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 250; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(500); @@ -275,7 +282,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; } TN(400); @@ -284,7 +291,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 -= 16384; + b0 -= step; } TN(400); @@ -298,7 +305,7 @@ speeddisk(int fd, off_t mediasize, u_int TN(2048); printf("\tSeq inner:\t"); - b0 = sectorcount - 2048 - 1; + b0 = sectorcount - 2048; T0(); for (i = 0; i < 2048; i++) { rdsect(fd, b0, sectorsize); @@ -310,28 +317,28 @@ speeddisk(int fd, off_t mediasize, u_int printf("\toutside: "); rdsect(fd, 0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tmiddle: "); - b0 = sectorcount / 2; + b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\n"); return; From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 10:51:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1F77106566B; Fri, 29 Jul 2011 10:51:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8BCD8FC08; Fri, 29 Jul 2011 10:51:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TApuhJ044242; Fri, 29 Jul 2011 10:51:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TApuA0044240; Fri, 29 Jul 2011 10:51:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107291051.p6TApuA0044240@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 10:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224492 - stable/7/usr.sbin/diskinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 10:51:57 -0000 Author: mav Date: Fri Jul 29 10:51:56 2011 New Revision: 224492 URL: http://svn.freebsd.org/changeset/base/224492 Log: MFC r224250: Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB. Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array. Modified: stable/7/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/7/usr.sbin/diskinfo/ (props changed) Modified: stable/7/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/7/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:02:03 2011 (r224491) +++ stable/7/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:51:56 2011 (r224492) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -161,7 +162,7 @@ static char sector[65536]; static char mega[1024 * 1024]; static void -rdsect(int fd, u_int blockno, u_int sectorsize) +rdsect(int fd, off_t blockno, u_int sectorsize) { int error; @@ -222,21 +223,27 @@ TR(double count) static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { - int i; - uint b0, b1, sectorcount; + int bulk, i; + off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); + if (step > 16384) + step = 16384; + bulk = mediasize / (1024 * 1024); + if (bulk > 100) + bulk = 100; printf("Seek times:\n"); printf("\tFull stroke:\t"); b0 = 0; - b1 = sectorcount - 1 - 16384; + b1 = sectorcount - step; T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 -= 16384; + b1 -= step; } TN(250); @@ -246,9 +253,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(250); printf("\tQuarter stroke:\t"); @@ -257,9 +264,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 250; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(500); @@ -268,7 +275,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; } TN(400); @@ -277,7 +284,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 -= 16384; + b0 -= step; } TN(400); @@ -291,7 +298,7 @@ speeddisk(int fd, off_t mediasize, u_int TN(2048); printf("\tSeq inner:\t"); - b0 = sectorcount - 2048 - 1; + b0 = sectorcount - 2048; T0(); for (i = 0; i < 2048; i++) { rdsect(fd, b0, sectorsize); @@ -303,28 +310,28 @@ speeddisk(int fd, off_t mediasize, u_int printf("\toutside: "); rdsect(fd, 0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tmiddle: "); - b0 = sectorcount / 2; + b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\n"); return; From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 15:51:42 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5952F106566B; Fri, 29 Jul 2011 15:51:42 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4818FC08; Fri, 29 Jul 2011 15:51:42 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LP300000QQ5KL00@smtpauth3.wiscmail.wisc.edu>; Fri, 29 Jul 2011 10:51:41 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.68.180]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LP300KBUQQ4D310@smtpauth3.wiscmail.wisc.edu>; Fri, 29 Jul 2011 10:51:40 -0500 (CDT) Date: Fri, 29 Jul 2011 10:51:39 -0500 From: Nathan Whitehorn To: delphij@freebsd.org Message-id: <4E32D70B.9060307@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.68.180 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.7.29.154214, SenderIP=76.210.68.180 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110704 Thunderbird/5.0 X-Mailman-Approved-At: Fri, 29 Jul 2011 16:42:46 +0000 Cc: svn-src-all@FreeBSD.org, FreeBSD Release Engineering Team Subject: Re: svn commit: r223115 - head/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 15:51:42 -0000 > Author: delphij > Date: Wed Jun 15 19:09:58 2011 > New Revision: 223115 > URL:http://svn.freebsd.org/changeset/base/223115 > > Log: > Don't attempt to create the base directory when -d is specified. > > MFC after: 1 month > > Modified: > head/usr.sbin/pw/pw_user.c > > Modified: head/usr.sbin/pw/pw_user.c > ============================================================================== > --- head/usr.sbin/pw/pw_user.c Wed Jun 15 18:05:08 2011 (r223114) > +++ head/usr.sbin/pw/pw_user.c Wed Jun 15 19:09:58 2011 (r223115) > @@ -163,7 +163,7 @@ pw_user(struct userconf * cnf, int mode, > * If we'll need to use it or we're updating it, > * then create the base home directory if necessary > */ > - if (arg != NULL || getarg(args, 'm') != NULL) { > + if ((arg != NULL || getarg(args, 'm') != NULL)&& (getarg(args, 'd') == NULL)) { > int l = strlen(cnf->home); > > if (l> 1&& cnf->home[l-1] == '/') /* Shave off any trailing path delimiter */ This has broken use of adduser(8) on new systems without /home (or /usr/home) when using default settings and so has also broken creation of home directories in the installer. Please either fix adduser(8) not to fail or revert this. -Nathan From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 18:35:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 861CF106566C; Fri, 29 Jul 2011 18:35:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73BE68FC13; Fri, 29 Jul 2011 18:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TIZAOD061437; Fri, 29 Jul 2011 18:35:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TIZA8g061428; Fri, 29 Jul 2011 18:35:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107291835.p6TIZA8g061428@svn.freebsd.org> From: Marius Strobl Date: Fri, 29 Jul 2011 18:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224493 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 18:35:10 -0000 Author: marius Date: Fri Jul 29 18:35:10 2011 New Revision: 224493 URL: http://svn.freebsd.org/changeset/base/224493 Log: - Staticize functions as appropriate and comment out unused ones. - Sprinkle some const where appropriate. - Consistently use target_id_t for the target parameter of mpt_map_physdisk() and mpt_is_raid_volume(). - Fix some whitespace bugs. Approved by: re (kib) Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_debug.c head/sys/dev/mpt/mpt_pci.c head/sys/dev/mpt/mpt_raid.c head/sys/dev/mpt/mpt_raid.h head/sys/dev/mpt/mpt_user.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt.c Fri Jul 29 18:35:10 2011 (r224493) @@ -301,66 +301,75 @@ mpt_modevent(module_t mod, int type, voi return (error); } -int +static int mpt_stdload(struct mpt_personality *pers) { + /* Load is always successful. */ return (0); } -int +static int mpt_stdprobe(struct mpt_softc *mpt) { + /* Probe is always successful. */ return (0); } -int +static int mpt_stdattach(struct mpt_softc *mpt) { + /* Attach is always successful. */ return (0); } -int +static int mpt_stdenable(struct mpt_softc *mpt) { + /* Enable is always successful. */ return (0); } -void +static void mpt_stdready(struct mpt_softc *mpt) { -} +} -int +static int mpt_stdevent(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_stdevent: 0x%x\n", msg->Event & 0xFF); /* Event was not for us. */ return (0); } -void +static void mpt_stdreset(struct mpt_softc *mpt, int type) { + } -void +static void mpt_stdshutdown(struct mpt_softc *mpt) { + } -void +static void mpt_stddetach(struct mpt_softc *mpt) { + } -int +static int mpt_stdunload(struct mpt_personality *pers) { + /* Unload is always successful. */ return (0); } @@ -383,7 +392,6 @@ mpt_postattach(void *unused) } SYSINIT(mptdev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, mpt_postattach, NULL); - /******************************* Bus DMA Support ******************************/ void mpt_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error) @@ -478,6 +486,7 @@ static int mpt_default_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { + mpt_prt(mpt, "Default Handler Called: req=%p:%u reply_descriptor=%x frame=%p\n", req, req->serno, reply_desc, reply_frame); @@ -494,8 +503,8 @@ static int mpt_config_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { - if (req != NULL) { + if (req != NULL) { if (reply_frame != NULL) { MSG_CONFIG *cfgp; MSG_CONFIG_REPLY *reply; @@ -528,6 +537,7 @@ static int mpt_handshake_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { + /* Nothing to be done. */ return (TRUE); } @@ -650,6 +660,7 @@ static int mpt_core_event(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_core_event: 0x%x\n", msg->Event & 0xFF); switch(msg->Event & 0xFF) { @@ -870,6 +881,7 @@ mpt_complete_request_chain(struct mpt_so void mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame) { + mpt_prt(mpt, "Address Reply:\n"); mpt_print_reply(reply_frame); } @@ -881,12 +893,14 @@ static __inline uint32_t mpt_rd_intr(st static __inline uint32_t mpt_rd_db(struct mpt_softc *mpt) { + return mpt_read(mpt, MPT_OFFSET_DOORBELL); } static __inline uint32_t mpt_rd_intr(struct mpt_softc *mpt) { + return mpt_read(mpt, MPT_OFFSET_INTR_STATUS); } @@ -895,6 +909,7 @@ static int mpt_wait_db_ack(struct mpt_softc *mpt) { int i; + for (i=0; i < MPT_MAX_WAIT; i++) { if (!MPT_DB_IS_BUSY(mpt_rd_intr(mpt))) { maxwait_ack = i > maxwait_ack ? i : maxwait_ack; @@ -910,6 +925,7 @@ static int mpt_wait_db_int(struct mpt_softc *mpt) { int i; + for (i = 0; i < MPT_MAX_WAIT; i++) { if (MPT_DB_INTR(mpt_rd_intr(mpt))) { maxwait_int = i > maxwait_int ? i : maxwait_int; @@ -925,6 +941,7 @@ void mpt_check_doorbell(struct mpt_softc *mpt) { uint32_t db = mpt_rd_db(mpt); + if (MPT_STATE(db) != MPT_DB_STATE_RUNNING) { mpt_prt(mpt, "Device not running\n"); mpt_print_db(db); @@ -956,6 +973,7 @@ static int mpt_download_fw(struct mpt_so static int mpt_soft_reset(struct mpt_softc *mpt) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "soft reset\n"); /* Have to use hard reset if we are not in Running state */ @@ -1019,6 +1037,7 @@ mpt_enable_diag_mode(struct mpt_softc *m static void mpt_disable_diag_mode(struct mpt_softc *mpt) { + mpt_write(mpt, MPT_OFFSET_SEQUENCE, 0xFFFFFFFF); } @@ -1094,6 +1113,7 @@ mpt_hard_reset(struct mpt_softc *mpt) static void mpt_core_ioc_reset(struct mpt_softc *mpt, int type) { + /* * Complete all pending requests with a status * appropriate for an IOC reset. @@ -1102,7 +1122,6 @@ mpt_core_ioc_reset(struct mpt_softc *mpt MPI_IOCSTATUS_INVALID_STATE); } - /* * Reset the IOC when needed. Try software command first then if needed * poke at the magic diagnostic reset. Note that a hard reset resets @@ -1263,6 +1282,7 @@ retry: void mpt_send_cmd(struct mpt_softc *mpt, request_t *req) { + if (mpt->verbose > MPT_PRT_DEBUG2) { mpt_dump_request(mpt, req); } @@ -2110,6 +2130,7 @@ mpt_send_event_request(struct mpt_softc void mpt_enable_ints(struct mpt_softc *mpt) { + /* Unmask every thing except door bell int */ mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_DB_MASK); } @@ -2120,6 +2141,7 @@ mpt_enable_ints(struct mpt_softc *mpt) void mpt_disable_ints(struct mpt_softc *mpt) { + /* Mask all interrupts */ mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_REPLY_MASK | MPT_INTR_DB_MASK); @@ -2219,7 +2241,7 @@ mpt_detach(struct mpt_softc *mpt) return (0); } -int +static int mpt_core_load(struct mpt_personality *pers) { int i; @@ -2245,7 +2267,7 @@ mpt_core_load(struct mpt_personality *pe * Initialize per-instance driver data and perform * initial controller configuration. */ -int +static int mpt_core_attach(struct mpt_softc *mpt) { int val, error; @@ -2276,9 +2298,10 @@ mpt_core_attach(struct mpt_softc *mpt) return (error); } -int +static int mpt_core_enable(struct mpt_softc *mpt) { + /* * We enter with the IOC enabled, but async events * not enabled, ports not enabled and interrupts @@ -2326,13 +2349,14 @@ mpt_core_enable(struct mpt_softc *mpt) return (0); } -void +static void mpt_core_shutdown(struct mpt_softc *mpt) { + mpt_disable_ints(mpt); } -void +static void mpt_core_detach(struct mpt_softc *mpt) { int val; @@ -2351,9 +2375,10 @@ mpt_core_detach(struct mpt_softc *mpt) mpt_dma_buf_free(mpt); } -int +static int mpt_core_unload(struct mpt_personality *pers) { + /* Unload is always successful. */ return (0); } @@ -2575,6 +2600,7 @@ static void mpt_dma_buf_free(struct mpt_softc *mpt) { int i; + if (mpt->request_dmat == 0) { mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n"); return; Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt.h Fri Jul 29 18:35:10 2011 (r224493) @@ -1075,16 +1075,6 @@ mpt_complete_request_chain(struct mpt_so int mpt_reset(struct mpt_softc *, int /*reinit*/); /****************************** Debugging ************************************/ -typedef struct mpt_decode_entry { - char *name; - u_int value; - u_int mask; -} mpt_decode_entry_t; - -int mpt_decode_value(mpt_decode_entry_t *table, u_int num_entries, - const char *name, u_int value, u_int *cur_column, - u_int wrap_point); - void mpt_dump_data(struct mpt_softc *, const char *, void *, int); void mpt_dump_request(struct mpt_softc *, request_t *); @@ -1110,17 +1100,21 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) +#if 0 #define mpt_lprtc(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) +#endif #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) __printflike(3, 4); +#if 0 void mpt_lprtc(struct mpt_softc *, int, const char *, ...) __printflike(3, 4); #endif +#endif void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) @@ -1277,7 +1271,6 @@ void mpt_check_doorbell(struct mpt_soft void mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame); -void mpt_set_config_regs(struct mpt_softc *); int mpt_issue_cfg_req(struct mpt_softc */*mpt*/, request_t */*req*/, cfgparms_t *params, bus_addr_t /*addr*/, bus_size_t/*len*/, @@ -1331,6 +1324,5 @@ char *mpt_ioc_diag(uint32_t diag); void mpt_req_state(mpt_req_state_t state); void mpt_print_config_request(void *vmsg); void mpt_print_request(void *vmsg); -void mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *msg); void mpt_dump_sgl(SGE_IO_UNION *se, int offset); #endif /* _MPT_H_ */ Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt_cam.c Fri Jul 29 18:35:10 2011 (r224493) @@ -193,7 +193,7 @@ MODULE_DEPEND(mpt_cam, cam, 1, 1, 1); int mpt_enable_sata_wc = -1; TUNABLE_INT("hw.mpt.enable_sata_wc", &mpt_enable_sata_wc); -int +static int mpt_cam_probe(struct mpt_softc *mpt) { int role; @@ -215,7 +215,7 @@ mpt_cam_probe(struct mpt_softc *mpt) return (ENODEV); } -int +static int mpt_cam_attach(struct mpt_softc *mpt) { struct cam_devq *devq; @@ -509,7 +509,6 @@ mpt_read_config_info_fc(struct mpt_softc static int mpt_set_initial_config_fc(struct mpt_softc *mpt) { - CONFIG_PAGE_FC_PORT_1 fc; U32 fl; int r, doit = 0; @@ -881,8 +880,8 @@ static int mpt_sata_pass_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { - if (req != NULL) { + if (req != NULL) { if (reply_frame != NULL) { req->IOCStatus = le16toh(reply_frame->IOCStatus); } @@ -1114,7 +1113,7 @@ mpt_set_initial_config_spi(struct mpt_so return (0); } -int +static int mpt_cam_enable(struct mpt_softc *mpt) { int error; @@ -1151,9 +1150,10 @@ out: return (error); } -void +static void mpt_cam_ready(struct mpt_softc *mpt) { + /* * If we're in target mode, hang out resources now * so we don't cause the world to hang talking to us. @@ -1171,7 +1171,7 @@ mpt_cam_ready(struct mpt_softc *mpt) mpt->ready = 1; } -void +static void mpt_cam_detach(struct mpt_softc *mpt) { mpt_handler_t handler; @@ -1842,8 +1842,6 @@ bad: memset(se, 0,sizeof (*se)); se->Address = htole32(dm_segs->ds_addr); - - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; if (seg == first_lim - 1) { @@ -1958,9 +1956,6 @@ bad: memset(se, 0, sizeof (*se)); se->Address = htole32(dm_segs->ds_addr); - - - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; if (seg == this_seg_lim - 1) { @@ -3045,6 +3040,7 @@ mpt_fc_els_reply_handler(struct mpt_soft static void mpt_cam_ioc_reset(struct mpt_softc *mpt, int type) { + /* * The pending list is already run down by * the generic handler. Perform the same @@ -3974,6 +3970,7 @@ mpt_spawn_recovery_thread(struct mpt_sof static void mpt_terminate_recovery_thread(struct mpt_softc *mpt) { + if (mpt->recovery_thread == NULL) { return; } @@ -4377,6 +4374,7 @@ mpt_add_target_commands(struct mpt_softc static int mpt_enable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun) { + if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) { mpt->twildcard = 1; } else if (lun >= MPT_MAX_LUNS) { @@ -4402,6 +4400,7 @@ static int mpt_disable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun) { int i; + if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) { mpt->twildcard = 0; } else if (lun >= MPT_MAX_LUNS) { @@ -5286,6 +5285,7 @@ mpt_tgt_dump_tgt_state(struct mpt_softc static void mpt_tgt_dump_req_state(struct mpt_softc *mpt, request_t *req) { + mpt_prt(mpt, "req %p:%u index %u (%x) state %x\n", req, req->serno, req->index, req->index, req->state); mpt_tgt_dump_tgt_state(mpt, req); Modified: head/sys/dev/mpt/mpt_debug.c ============================================================================== --- head/sys/dev/mpt/mpt_debug.c Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt_debug.c Fri Jul 29 18:35:10 2011 (r224493) @@ -285,6 +285,7 @@ mpt_scsi_state(int code) } return buf; } + static char * mpt_scsi_status(int code) { @@ -298,10 +299,11 @@ mpt_scsi_status(int code) snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } -static char * + +static const char * mpt_who(int who_init) { - char *who; + const char *who; switch (who_init) { case MPT_DB_INIT_NOONE: who = "No One"; break; @@ -315,10 +317,10 @@ mpt_who(int who_init) return who; } -static char * +static const char * mpt_state(u_int32_t mb) { - char *text; + const char *text; switch (MPT_STATE(mb)) { case MPT_DB_STATE_RESET: text = "Reset"; break; @@ -347,6 +349,7 @@ mpt_scsi_tm_type(int code) void mpt_print_db(u_int32_t mb) { + printf("mpt mailbox: (0x%x) State %s WhoInit %s\n", mb, mpt_state(mb), mpt_who(MPT_WHO(mb))); } @@ -357,6 +360,7 @@ mpt_print_db(u_int32_t mb) static void mpt_print_reply_hdr(MSG_DEFAULT_REPLY *msg) { + printf("%s Reply @ %p\n", mpt_ioc_function(msg->Function), msg); printf("\tIOC Status %s\n", mpt_ioc_status(msg->IOCStatus)); printf("\tIOCLogInfo 0x%08x\n", msg->IOCLogInfo); @@ -368,6 +372,7 @@ mpt_print_reply_hdr(MSG_DEFAULT_REPLY *m static void mpt_print_init_reply(MSG_IOC_INIT_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tWhoInit %s\n", mpt_who(msg->WhoInit)); printf("\tMaxDevices 0x%02x\n", msg->MaxDevices); @@ -377,6 +382,7 @@ mpt_print_init_reply(MSG_IOC_INIT_REPLY static void mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tIOCNumber %d\n", msg->IOCNumber); printf("\tMaxChainDepth %d\n", msg->MaxChainDepth); @@ -402,6 +408,7 @@ mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY static void mpt_print_enable_reply(MSG_PORT_ENABLE_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tPort: %d\n", msg->PortNumber); } @@ -409,6 +416,7 @@ mpt_print_enable_reply(MSG_PORT_ENABLE_R static void mpt_print_scsi_io_reply(MSG_SCSI_IO_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tBus: %d\n", msg->Bus); printf("\tTargetID %d\n", msg->TargetID); @@ -420,11 +428,10 @@ mpt_print_scsi_io_reply(MSG_SCSI_IO_REPL printf("\tResponseInfo 0x%08x\n", msg->ResponseInfo); } - - static void mpt_print_event_notice(MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tEvent: %s\n", mpt_ioc_event(msg->Event)); printf("\tEventContext 0x%04x\n", msg->EventContext); @@ -517,7 +524,7 @@ mpt_print_request_hdr(MSG_REQUEST_HEADER printf("\tMsgContext 0x%08x\n", req->MsgContext); } -void +static void mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *orig_msg) { MSG_SCSI_IO_REQUEST local, *msg = &local; @@ -575,6 +582,7 @@ mpt_print_scsi_io_request(MSG_SCSI_IO_RE static void mpt_print_scsi_tmf_request(MSG_SCSI_TASK_MGMT *msg) { + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tLun 0x%02x\n", msg->LUN[1]); printf("\tTaskType %s\n", mpt_scsi_tm_type(msg->TaskType)); @@ -585,6 +593,7 @@ mpt_print_scsi_tmf_request(MSG_SCSI_TASK static void mpt_print_scsi_target_assist_request(PTR_MSG_TARGET_ASSIST_REQUEST msg) { + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tStatusCode 0x%02x\n", msg->StatusCode); printf("\tTargetAssist 0x%02x\n", msg->TargetAssistFlags); @@ -600,6 +609,7 @@ static void mpt_print_scsi_target_status_send_request(MSG_TARGET_STATUS_SEND_REQUEST *msg) { SGE_IO_UNION x; + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tStatusCode 0x%02x\n", msg->StatusCode); printf("\tStatusFlags 0x%02x\n", msg->StatusFlags); @@ -637,7 +647,14 @@ mpt_print_request(void *vreq) } } -int +#if 0 +typedef struct mpt_decode_entry { + char *name; + u_int value; + u_int mask; +} mpt_decode_entry_t; + +static int mpt_decode_value(mpt_decode_entry_t *table, u_int num_entries, const char *name, u_int value, u_int *cur_column, u_int wrap_point) @@ -689,7 +706,7 @@ mpt_decode_value(mpt_decode_entry_t *tab return (printed); } -static mpt_decode_entry_t req_state_parse_table[] = { +static const mpt_decode_entry_t req_state_parse_table[] = { { "REQ_FREE", 0x00, 0xff }, { "REQ_ALLOCATED", 0x01, 0x01 }, { "REQ_QUEUED", 0x02, 0x02 }, @@ -698,13 +715,15 @@ static mpt_decode_entry_t req_state_pars { "REQ_NEED_WAKEUP", 0x10, 0x10 } }; -void +static void mpt_req_state(mpt_req_state_t state) { + mpt_decode_value(req_state_parse_table, NUM_ELEMENTS(req_state_parse_table), "REQ_STATE", state, NULL, 80); } +#endif #define LAST_SGE ( \ MPI_SGE_FLAGS_END_OF_LIST | \ @@ -805,6 +824,7 @@ mpt_dump_data(struct mpt_softc *mpt, con { int offset; uint8_t *cp = addr; + mpt_prt(mpt, "%s:", msg); for (offset = 0; offset < len; offset++) { if ((offset & 0xf) == 0) { @@ -820,6 +840,7 @@ mpt_dump_request(struct mpt_softc *mpt, { uint32_t *pReq = req->req_vbuf; int o; + #if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); @@ -850,6 +871,7 @@ mpt_lprt(struct mpt_softc *mpt, int leve } } +#if 0 void mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) { @@ -861,6 +883,7 @@ mpt_lprtc(struct mpt_softc *mpt, int lev } } #endif +#endif void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt_pci.c Fri Jul 29 18:35:10 2011 (r224493) @@ -201,6 +201,9 @@ static int mpt_pci_shutdown(device_t); static int mpt_dma_mem_alloc(struct mpt_softc *mpt); static void mpt_dma_mem_free(struct mpt_softc *mpt); static void mpt_read_config_regs(struct mpt_softc *mpt); +#if 0 +static void mpt_set_config_regs(struct mpt_softc *mpt); +#endif static void mpt_pci_intr(void *); static device_method_t mpt_methods[] = { @@ -404,6 +407,7 @@ mpt_link_peer(struct mpt_softc *mpt) static void mpt_unlink_peer(struct mpt_softc *mpt) { + if (mpt->mpt2) { mpt->mpt2->mpt2 = NULL; } @@ -654,6 +658,7 @@ bad: static void mpt_free_bus_resources(struct mpt_softc *mpt) { + if (mpt->ih) { bus_teardown_intr(mpt->dev, mpt->pci_irq, mpt->ih); mpt->ih = NULL; @@ -827,6 +832,7 @@ mpt_dma_mem_free(struct mpt_softc *mpt) static void mpt_read_config_regs(struct mpt_softc *mpt) { + mpt->pci_cfg.Command = pci_read_config(mpt->dev, PCIR_COMMAND, 2); mpt->pci_cfg.LatencyTimer_LineSize = pci_read_config(mpt->dev, PCIR_CACHELNSZ, 2); @@ -840,8 +846,9 @@ mpt_read_config_regs(struct mpt_softc *m mpt->pci_cfg.PMCSR = pci_read_config(mpt->dev, 0x44, 4); } +#if 0 /* Sets modifiable config registers */ -void +static void mpt_set_config_regs(struct mpt_softc *mpt) { uint32_t val; @@ -880,6 +887,7 @@ mpt_set_config_regs(struct mpt_softc *mp pci_write_config(mpt->dev, PCIR_INTLINE, mpt->pci_cfg.IntLine, 1); pci_write_config(mpt->dev, 0x44, mpt->pci_cfg.PMCSR, 4); } +#endif static void mpt_pci_intr(void *arg) Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt_raid.c Fri Jul 29 18:35:10 2011 (r224493) @@ -81,7 +81,6 @@ struct mpt_raid_action_result #define REQ_IOCSTATUS(req) ((req)->IOCStatus & MPI_IOCSTATUS_MASK) - static mpt_probe_handler_t mpt_raid_probe; static mpt_attach_handler_t mpt_raid_attach; static mpt_enable_handler_t mpt_raid_enable; @@ -125,9 +124,25 @@ static void mpt_adjust_queue_depth(struc static void mpt_raid_sysctl_attach(struct mpt_softc *); #endif +static const char *mpt_vol_type(struct mpt_raid_volume *vol); +static const char *mpt_vol_state(struct mpt_raid_volume *vol); +static const char *mpt_disk_state(struct mpt_raid_disk *disk); +static void mpt_vol_prt(struct mpt_softc *mpt, struct mpt_raid_volume *vol, + const char *fmt, ...); +static void mpt_disk_prt(struct mpt_softc *mpt, struct mpt_raid_disk *disk, + const char *fmt, ...); + +static int mpt_issue_raid_req(struct mpt_softc *mpt, + struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req, + u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len, + int write, int wait); + +static int mpt_refresh_raid_data(struct mpt_softc *mpt); +static void mpt_schedule_raid_refresh(struct mpt_softc *mpt); + static uint32_t raid_handler_id = MPT_HANDLER_ID_NONE; -const char * +static const char * mpt_vol_type(struct mpt_raid_volume *vol) { switch (vol->config_page->VolumeType) { @@ -142,7 +157,7 @@ mpt_vol_type(struct mpt_raid_volume *vol } } -const char * +static const char * mpt_vol_state(struct mpt_raid_volume *vol) { switch (vol->config_page->VolumeStatus.State) { @@ -157,7 +172,7 @@ mpt_vol_state(struct mpt_raid_volume *vo } } -const char * +static const char * mpt_disk_state(struct mpt_raid_disk *disk) { switch (disk->config_page.PhysDiskStatus.State) { @@ -182,7 +197,7 @@ mpt_disk_state(struct mpt_raid_disk *dis } } -void +static void mpt_vol_prt(struct mpt_softc *mpt, struct mpt_raid_volume *vol, const char *fmt, ...) { @@ -196,7 +211,7 @@ mpt_vol_prt(struct mpt_softc *mpt, struc va_end(ap); } -void +static void mpt_disk_prt(struct mpt_softc *mpt, struct mpt_raid_disk *disk, const char *fmt, ...) { @@ -254,16 +269,17 @@ mpt_raid_async(void *callback_arg, u_int } } -int +static int mpt_raid_probe(struct mpt_softc *mpt) { + if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) { return (ENODEV); } return (0); } -int +static int mpt_raid_attach(struct mpt_softc *mpt) { struct ccb_setasync csa; @@ -307,13 +323,14 @@ cleanup: return (error); } -int +static int mpt_raid_enable(struct mpt_softc *mpt) { + return (0); } -void +static void mpt_raid_detach(struct mpt_softc *mpt) { struct ccb_setasync csa; @@ -338,6 +355,7 @@ mpt_raid_detach(struct mpt_softc *mpt) static void mpt_raid_ioc_reset(struct mpt_softc *mpt, int type) { + /* Nothing to do yet. */ } @@ -570,7 +588,7 @@ mpt_raid_reply_frame_handler(struct mpt_ /* * Utiltity routine to perform a RAID action command; */ -int +static int mpt_issue_raid_req(struct mpt_softc *mpt, struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req, u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len, @@ -719,6 +737,7 @@ mpt_raid_thread(void *arg) static void mpt_raid_quiesce_timeout(void *arg) { + /* Complete the CCB with error */ /* COWWWW */ } @@ -776,7 +795,7 @@ mpt_raid_quiesce_disk(struct mpt_softc * /* XXX Ignores that there may be multiple busses/IOCs involved. */ cam_status -mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, u_int *tgt) +mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, target_id_t *tgt) { struct mpt_raid_disk *mpt_disk; @@ -793,7 +812,7 @@ mpt_map_physdisk(struct mpt_softc *mpt, /* XXX Ignores that there may be multiple busses/IOCs involved. */ int -mpt_is_raid_volume(struct mpt_softc *mpt, int tgt) +mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; CONFIG_PAGE_IOC_2_RAID_VOL *ioc_last_vol; @@ -1305,7 +1324,7 @@ mpt_refresh_raid_vol(struct mpt_softc *m * be updated by our event handler. Interesting changes are displayed * to the console. */ -int +static int mpt_refresh_raid_data(struct mpt_softc *mpt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; @@ -1565,9 +1584,10 @@ mpt_raid_timer(void *arg) #endif } -void +static void mpt_schedule_raid_refresh(struct mpt_softc *mpt) { + callout_reset(&mpt->raid_timer, MPT_RAID_SYNC_REPORT_INTERVAL, mpt_raid_timer, mpt); } @@ -1719,7 +1739,8 @@ mpt_raid_set_vol_mwce(struct mpt_softc * MPT_UNLOCK(mpt); return (0); } -const char *mpt_vol_mwce_strs[] = + +static const char *mpt_vol_mwce_strs[] = { "On", "Off", Modified: head/sys/dev/mpt/mpt_raid.h ============================================================================== --- head/sys/dev/mpt/mpt_raid.h Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt_raid.h Fri Jul 29 18:35:10 2011 (r224493) @@ -53,29 +53,13 @@ typedef enum { MPT_RAID_MWCE_NC } mpt_raid_mwce_t; -const char *mpt_vol_type(struct mpt_raid_volume *); -const char *mpt_vol_state(struct mpt_raid_volume *); -const char *mpt_disk_state(struct mpt_raid_disk *); -void -mpt_vol_prt(struct mpt_softc *, struct mpt_raid_volume *, const char *fmt, ...); -void -mpt_disk_prt(struct mpt_softc *, struct mpt_raid_disk *, const char *, ...); - -int -mpt_issue_raid_req(struct mpt_softc *, struct mpt_raid_volume *, - struct mpt_raid_disk *, request_t *, u_int, uint32_t, bus_addr_t, - bus_size_t, int, int); - -cam_status -mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); -int mpt_is_raid_volume(struct mpt_softc *, int); +cam_status mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); +int mpt_is_raid_volume(struct mpt_softc *, target_id_t); #if 0 cam_status mpt_raid_quiesce_disk(struct mpt_softc *, struct mpt_raid_disk *, request_t *); #endif -int mpt_refresh_raid_data(struct mpt_softc *); -void mpt_schedule_raid_refresh(struct mpt_softc *); void mpt_raid_free_mem(struct mpt_softc *); static __inline void Modified: head/sys/dev/mpt/mpt_user.c ============================================================================== --- head/sys/dev/mpt/mpt_user.c Fri Jul 29 10:51:56 2011 (r224492) +++ head/sys/dev/mpt/mpt_user.c Fri Jul 29 18:35:10 2011 (r224493) @@ -94,7 +94,7 @@ static MALLOC_DEFINE(M_MPTUSER, "mpt_use static uint32_t user_handler_id = MPT_HANDLER_ID_NONE; -int +static int mpt_user_probe(struct mpt_softc *mpt) { @@ -102,7 +102,7 @@ mpt_user_probe(struct mpt_softc *mpt) return (0); } -int +static int mpt_user_attach(struct mpt_softc *mpt) { mpt_handler_t handler; @@ -131,19 +131,20 @@ mpt_user_attach(struct mpt_softc *mpt) return (0); } -int +static int mpt_user_enable(struct mpt_softc *mpt) { return (0); } -void +static void mpt_user_ready(struct mpt_softc *mpt) { + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 18:38:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C9711065670; Fri, 29 Jul 2011 18:38:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B71C8FC12; Fri, 29 Jul 2011 18:38:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TIcWHO061529; Fri, 29 Jul 2011 18:38:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TIcVKo061525; Fri, 29 Jul 2011 18:38:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107291838.p6TIcVKo061525@svn.freebsd.org> From: Marius Strobl Date: Fri, 29 Jul 2011 18:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224494 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 18:38:32 -0000 Author: marius Date: Fri Jul 29 18:38:31 2011 New Revision: 224494 URL: http://svn.freebsd.org/changeset/base/224494 Log: - Send the RELSIM_ADJUST_OPENINGS in response to a MPI_EVENT_QUEUE_FULL using the right SIM in case the HBA is RAID-capable but the target in question is not a hot spare or member of a RAID volume. - Report the loss and addition of SAS and SATA targets detected via PHY link status changes and signalled by MPI_EVENT_SAS_DEVICE_STATUS_CHANGE to cam(4) as lost devices and trigger rescans as appropriate. Without this it can take quite some time until a lost device actually is no longer tried to be used, if it ever stops. [1] - Handle MPI_EVENT_IR2, MPI_EVENT_LOG_ENTRY_ADDED, MPI_EVENT_SAS_DISCOVERY and MPI_EVENT_SAS_PHY_LINK_STATUS silently as these serve no additional purpose beyond adding cryptic entries to logs. Thanks to Hans-Joerg Sirtl for providing one of the HBAs these changes were developed with and RIP to the mainboard that didn't survive testing them. PR: 157534 [1] Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_raid.c head/sys/dev/mpt/mpt_raid.h Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Fri Jul 29 18:35:10 2011 (r224493) +++ head/sys/dev/mpt/mpt_cam.c Fri Jul 29 18:38:31 2011 (r224494) @@ -2538,7 +2538,8 @@ mpt_cam_event(struct mpt_softc *mpt, req pqf->CurrentDepth = le16toh(pqf->CurrentDepth); mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth " "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth); - if (mpt->phydisk_sim) { + if (mpt->phydisk_sim && mpt_is_raid_member(mpt, + pqf->TargetID) != 0) { sim = mpt->phydisk_sim; } else { sim = mpt->sim; @@ -2570,9 +2571,72 @@ mpt_cam_event(struct mpt_softc *mpt, req mpt_prt(mpt, "IR resync update %d completed\n", (data0 >> 16) & 0xff); break; + case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: + { + union ccb *ccb; + struct cam_sim *sim; + struct cam_path *tmppath; + PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE psdsc; + + psdsc = (PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE)msg->Data; + if (mpt->phydisk_sim && mpt_is_raid_member(mpt, + psdsc->TargetID) != 0) + sim = mpt->phydisk_sim; + else + sim = mpt->sim; + switch(psdsc->ReasonCode) { + case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: + MPTLOCK_2_CAMLOCK(mpt); + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mpt_prt(mpt, + "unable to alloc CCB for rescan\n"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(sim), psdsc->TargetID, + CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + CAMLOCK_2_MPTLOCK(mpt); + mpt_prt(mpt, + "unable to create path for rescan\n"); + xpt_free_ccb(ccb); + break; + } + xpt_rescan(ccb); + CAMLOCK_2_MPTLOCK(mpt); + break; + case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: + MPTLOCK_2_CAMLOCK(mpt); + if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), + psdsc->TargetID, CAM_LUN_WILDCARD) != + CAM_REQ_CMP) { + mpt_prt(mpt, + "unable to create path for async event"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + xpt_async(AC_LOST_DEVICE, tmppath, NULL); + xpt_free_path(tmppath); + CAMLOCK_2_MPTLOCK(mpt); + break; + case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET: + break; + default: + mpt_lprt(mpt, MPT_PRT_WARN, + "SAS device status change: Bus: 0x%02x TargetID: " + "0x%02x ReasonCode: 0x%02x\n", psdsc->TargetID, + psdsc->Bus, psdsc->ReasonCode); + break; + } + break; + } case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: - case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: + case MPI_EVENT_IR2: + case MPI_EVENT_LOG_ENTRY_ADDED: + case MPI_EVENT_SAS_DISCOVERY: + case MPI_EVENT_SAS_PHY_LINK_STATUS: case MPI_EVENT_SAS_SES: break; default: Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Fri Jul 29 18:35:10 2011 (r224493) +++ head/sys/dev/mpt/mpt_raid.c Fri Jul 29 18:38:31 2011 (r224494) @@ -812,6 +812,25 @@ mpt_map_physdisk(struct mpt_softc *mpt, /* XXX Ignores that there may be multiple busses/IOCs involved. */ int +mpt_is_raid_member(struct mpt_softc *mpt, target_id_t tgt) +{ + struct mpt_raid_disk *mpt_disk; + int i; + + if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) + return (0); + for (i = 0; i < mpt->ioc_page2->MaxPhysDisks; i++) { + mpt_disk = &mpt->raid_disks[i]; + if ((mpt_disk->flags & MPT_RDF_ACTIVE) != 0 && + mpt_disk->config_page.PhysDiskID == tgt) + return (1); + } + return (0); + +} + +/* XXX Ignores that there may be multiple busses/IOCs involved. */ +int mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; Modified: head/sys/dev/mpt/mpt_raid.h ============================================================================== --- head/sys/dev/mpt/mpt_raid.h Fri Jul 29 18:35:10 2011 (r224493) +++ head/sys/dev/mpt/mpt_raid.h Fri Jul 29 18:38:31 2011 (r224494) @@ -54,6 +54,7 @@ typedef enum { } mpt_raid_mwce_t; cam_status mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); +int mpt_is_raid_member(struct mpt_softc *, target_id_t); int mpt_is_raid_volume(struct mpt_softc *, target_id_t); #if 0 cam_status From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 18:47:38 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21466106566B; Fri, 29 Jul 2011 18:47:38 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 97BC68FC14; Fri, 29 Jul 2011 18:47:37 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id p6TIlECL000303; Fri, 29 Jul 2011 20:47:15 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4E330032.2030306@FreeBSD.org> Date: Fri, 29 Jul 2011 20:47:14 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Attilio Rao References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> <4E2DB8AC.3000703@FreeBSD.org> <4E2DBCBF.2030402@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Sergey Kandaurov , Nathan Whitehorn , svn-src-head@FreeBSD.org, Andreas Tobler Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 18:47:38 -0000 On 28.07.11 04:59, Attilio Rao wrote: > I think that the following patch may better reflect the definition of size_t: > http://www.freebsd.org/~attilio/sintrcnt-fixup32.diff > > Do you think you can test it out? PowerPC 32-bit built, booted and completed a buildworld. Thanks, Andreas From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 18:51:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 282F41065674; Fri, 29 Jul 2011 18:51:42 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7480C8FC1B; Fri, 29 Jul 2011 18:51:41 +0000 (UTC) Received: by gxk28 with SMTP id 28so3515025gxk.13 for ; Fri, 29 Jul 2011 11:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OiGQDTKSPuV8GpBIqjHbLJrEpmyhJ/YZRJPKsqH7Gh4=; b=V9Hv0U47gz3gGQS+8t8QSm2T1pzJ6QasVEcXg7V1EC2/YTK6ZDFsUOzp1M/fwiy45L 6lL9S2vGBZvJRz105s7wvLXzbmLDdbiLLUCnjPkqJP7H97msDvt2WWE6++Xah6Z87Y/x /sdIKKvvW5ALTKl34gCt2DgBszzuaKqsyEIuI= MIME-Version: 1.0 Received: by 10.236.157.102 with SMTP id n66mr706140yhk.361.1311965494486; Fri, 29 Jul 2011 11:51:34 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.139 with HTTP; Fri, 29 Jul 2011 11:51:34 -0700 (PDT) In-Reply-To: <4E330032.2030306@FreeBSD.org> References: <201107191241.p6JCfvqw072816@svn.freebsd.org> <4E2C9012.602@freebsd.org> <4E2DB8AC.3000703@FreeBSD.org> <4E2DBCBF.2030402@freebsd.org> <4E330032.2030306@FreeBSD.org> Date: Fri, 29 Jul 2011 14:51:34 -0400 X-Google-Sender-Auth: IO59Eu5kyeuG7UVQSSx6pvQ8SR0 Message-ID: From: Attilio Rao To: Andreas Tobler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Sergey Kandaurov , Nathan Whitehorn Subject: Re: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 18:51:42 -0000 2011/7/29 Andreas Tobler : > On 28.07.11 04:59, Attilio Rao wrote: >> >> I think that the following patch may better reflect the definition of >> size_t: >> http://www.freebsd.org/~attilio/sintrcnt-fixup32.diff >> >> Do you think you can test it out? > > PowerPC 32-bit built, booted and completed a buildworld. > Thanks a lot as usual. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 20:24:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 085031065674; Fri, 29 Jul 2011 20:24:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBDB18FC13; Fri, 29 Jul 2011 20:24:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TKO4l1064684; Fri, 29 Jul 2011 20:24:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TKO4vI064682; Fri, 29 Jul 2011 20:24:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107292024.p6TKO4vI064682@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jul 2011 20:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224495 - head/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 20:24:05 -0000 Author: jhb Date: Fri Jul 29 20:24:04 2011 New Revision: 224495 URL: http://svn.freebsd.org/changeset/base/224495 Log: Properly initialize an error variable to avoid returning uninitialized data when 'show drives' succeeds, often resulting in a failing exit code even though the command worked fine. Reviewed by: bz Approved by: re (kib) MFC after: 3 days Modified: head/usr.sbin/mfiutil/mfi_show.c Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Fri Jul 29 18:38:31 2011 (r224494) +++ head/usr.sbin/mfiutil/mfi_show.c Fri Jul 29 20:24:04 2011 (r224495) @@ -533,6 +533,7 @@ show_drives(int ac, char **av) MFI_DNAME_ES)); printf("\n"); } + error = 0; error: free(list); close(fd); From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 20:30:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 852C7106566B; Fri, 29 Jul 2011 20:30:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69BF68FC1C; Fri, 29 Jul 2011 20:30:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TKUSBT064897; Fri, 29 Jul 2011 20:30:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TKUSaf064895; Fri, 29 Jul 2011 20:30:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107292030.p6TKUSaf064895@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 20:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224496 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 20:30:28 -0000 Author: mav Date: Fri Jul 29 20:30:28 2011 New Revision: 224496 URL: http://svn.freebsd.org/changeset/base/224496 Log: In some cases failed SATA disks may report their presence, but don't respond to any commands. I've found that because of multiple command retries, each of which cause 30s timeout, bus reset and another retry or requeue for many commands, it may take ages to eventually drop the failed device. The odd thing is that those retries continue even after XPT considered device as dead and invalidated it. This patch makes cam_periph_error() to block any command retries after periph was marked as invalid. With that patch all activity completes in 1-2 minutes, just after several timeouts, required to consider device death. This should make ZFS, gmirror, graid, etc. operation more robust. Reviewed by: mjacob@ on scsi@ Approved by: re (kib) Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Jul 29 20:24:04 2011 (r224495) +++ head/sys/cam/cam_periph.c Fri Jul 29 20:30:28 2011 (r224496) @@ -1550,7 +1550,8 @@ camperiphscsisenseerror(union ccb *ccb, * make sure we actually have retries available. */ if ((err_action & SSQ_DECREMENT_COUNT) != 0) { - if (ccb->ccb_h.retry_count > 0) + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) ccb->ccb_h.retry_count--; else { *action_string = "Retries exhausted"; @@ -1718,6 +1719,7 @@ int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb) { + struct cam_periph *periph; const char *action_string; cam_status status; int frozen; @@ -1725,7 +1727,8 @@ cam_periph_error(union ccb *ccb, cam_fla int openings; u_int32_t relsim_flags; u_int32_t timeout = 0; - + + periph = xpt_path_periph(ccb->ccb_h.path); action_string = NULL; status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; @@ -1787,9 +1790,9 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Data overrun\n"); printed++; } - error = EIO; /* we have to kill the command */ /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; } else { @@ -1808,7 +1811,8 @@ cam_periph_error(union ccb *ccb, cam_fla struct cam_path *newpath; if ((camflags & CAM_RETRY_SELTO) != 0) { - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; @@ -1826,10 +1830,11 @@ cam_periph_error(union ccb *ccb, cam_fla timeout = periph_selto_delay; break; } + action_string = "Retries exhausted"; } error = ENXIO; /* Should we do more if we can't create the path?? */ - if (xpt_create_path(&newpath, xpt_path_periph(ccb->ccb_h.path), + if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), CAM_LUN_WILDCARD) != CAM_REQ_CMP) @@ -1874,11 +1879,16 @@ cam_periph_error(union ccb *ccb, cam_fla /* FALLTHROUGH */ case CAM_REQUEUE_REQ: /* Unconditional requeue */ - error = ERESTART; if (bootverbose && printed == 0) { xpt_print(ccb->ccb_h.path, "Request requeued\n"); printed++; } + if ((periph->flags & CAM_PERIPH_INVALID) == 0) + error = ERESTART; + else { + action_string = "Retries exhausted"; + error = EIO; + } break; case CAM_RESRC_UNAVAIL: /* Wait a bit for the resource shortage to abate. */ @@ -1893,7 +1903,8 @@ cam_periph_error(union ccb *ccb, cam_fla /* FALLTHROUGH */ default: /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; if (bootverbose && printed == 0) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 20:32:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1548E1065672; Fri, 29 Jul 2011 20:32:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03F318FC29; Fri, 29 Jul 2011 20:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TKWRGb065001; Fri, 29 Jul 2011 20:32:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TKWRWl064999; Fri, 29 Jul 2011 20:32:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107292032.p6TKWRWl064999@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 20:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224497 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 20:32:28 -0000 Author: mav Date: Fri Jul 29 20:32:27 2011 New Revision: 224497 URL: http://svn.freebsd.org/changeset/base/224497 Log: Add control for ATA disk read-ahead, alike to the previously added write cache control. Some controller BIOS'es tend to disable read-ahead, that dramatically reduces read performance. Previously ata(4) always enabled read-ahead unconditionally. Approved by: re (kib) Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Jul 29 20:30:28 2011 (r224496) +++ head/sys/cam/ata/ata_da.c Fri Jul 29 20:32:27 2011 (r224497) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #define ATA_MAX_28BIT_LBA 268435455UL typedef enum { + ADA_STATE_RAHEAD, ADA_STATE_WCACHE, ADA_STATE_NORMAL } ada_state; @@ -94,7 +95,8 @@ typedef enum { } ada_quirks; typedef enum { - ADA_CCB_WCACHE = 0x01, + ADA_CCB_RAHEAD = 0x01, + ADA_CCB_WCACHE = 0x02, ADA_CCB_BUFFER_IO = 0x03, ADA_CCB_WAITING = 0x04, ADA_CCB_DUMP = 0x05, @@ -132,6 +134,7 @@ struct ada_softc { int outstanding_cmds; int trim_max_ranges; int trim_running; + int read_ahead; int write_cache; #ifdef ADA_TEST_FAILURE int force_read_error; @@ -294,10 +297,19 @@ static void adaresume(void *arg); #define ADA_DEFAULT_SPINDOWN_SUSPEND 1 #endif +#ifndef ADA_DEFAULT_READ_AHEAD +#define ADA_DEFAULT_READ_AHEAD 1 +#endif + #ifndef ADA_DEFAULT_WRITE_CACHE #define ADA_DEFAULT_WRITE_CACHE 1 #endif +#define ADA_RA (softc->read_ahead >= 0 ? \ + softc->read_ahead : ada_read_ahead) +#define ADA_WC (softc->write_cache >= 0 ? \ + softc->write_cache : ada_write_cache) + /* * Most platforms map firmware geometry to actual, but some don't. If * not overridden, default to nothing. @@ -312,6 +324,7 @@ static int ada_default_timeout = ADA_DEF static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOWN_SHUTDOWN; static int ada_spindown_suspend = ADA_DEFAULT_SPINDOWN_SUSPEND; +static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, @@ -334,6 +347,9 @@ TUNABLE_INT("kern.cam.ada.spindown_shutd SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW, &ada_spindown_suspend, 0, "Spin down upon suspend"); TUNABLE_INT("kern.cam.ada.spindown_suspend", &ada_spindown_suspend); +SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW, + &ada_read_ahead, 0, "Enable disk read-ahead"); +TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead); SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW, &ada_write_cache, 0, "Enable disk write cache"); TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache); @@ -737,16 +753,19 @@ adaasync(void *callback_arg, u_int32_t c softc = (struct ada_softc *)periph->softc; cam_periph_async(periph, code, path, arg); - if (ada_write_cache < 0 && softc->write_cache < 0) - break; if (softc->state != ADA_STATE_NORMAL) break; xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - if ((cgd.ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) == 0) - break; - softc->state = ADA_STATE_WCACHE; + if (ADA_RA >= 0 && + cgd.ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) + softc->state = ADA_STATE_RAHEAD; + else if (ADA_WC >= 0 && + cgd.ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) + softc->state = ADA_STATE_WCACHE; + else + break; cam_periph_acquire(periph); cam_freeze_devq_arg(periph->path, RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); @@ -789,6 +808,9 @@ adasysctlinit(void *context, int pending } SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "read_ahead", CTLFLAG_RW | CTLFLAG_MPSAFE, + &softc->read_ahead, 0, "Enable disk read ahead."); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "write_cache", CTLFLAG_RW | CTLFLAG_MPSAFE, &softc->write_cache, 0, "Enable disk write cache."); #ifdef ADA_TEST_FAILURE @@ -922,6 +944,10 @@ adaregister(struct cam_periph *periph, v quirks = softc->quirks; TUNABLE_INT_FETCH(announce_buf, &quirks); softc->quirks = quirks; + softc->read_ahead = -1; + snprintf(announce_buf, sizeof(announce_buf), + "kern.cam.ada.%d.read_ahead", periph->unit_number); + TUNABLE_INT_FETCH(announce_buf, &softc->read_ahead); softc->write_cache = -1; snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); @@ -1044,7 +1070,14 @@ adaregister(struct cam_periph *periph, v (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); - if ((ada_write_cache >= 0 || softc->write_cache >= 0) && + if (ADA_RA >= 0 && + cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { + softc->state = ADA_STATE_RAHEAD; + cam_periph_acquire(periph); + cam_freeze_devq_arg(periph->path, + RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); + xpt_schedule(periph, CAM_PRIORITY_DEV); + } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; cam_periph_acquire(periph); @@ -1317,8 +1350,19 @@ out: adaschedule(periph); break; } + case ADA_STATE_RAHEAD: case ADA_STATE_WCACHE: { + if (softc->flags & ADA_FLAG_PACK_INVALID) { + softc->state = ADA_STATE_NORMAL; + xpt_release_ccb(start_ccb); + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + adaschedule(periph); + cam_periph_release_locked(periph); + return; + } + cam_fill_ataio(ataio, 1, adadone, @@ -1328,10 +1372,15 @@ out: 0, ada_default_timeout*1000); - ata_28bit_cmd(ataio, ATA_SETFEATURES, (softc->write_cache > 0 || - (softc->write_cache < 0 && ada_write_cache)) ? - ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); - start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; + if (softc->state == ADA_STATE_RAHEAD) { + ata_28bit_cmd(ataio, ATA_SETFEATURES, ADA_RA ? + ATA_SF_ENAB_RCACHE : ATA_SF_DIS_RCACHE, 0, 0); + start_ccb->ccb_h.ccb_state = ADA_CCB_RAHEAD; + } else { + ata_28bit_cmd(ataio, ATA_SETFEATURES, ADA_WC ? + ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); + start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; + } xpt_action(start_ccb); break; } @@ -1343,6 +1392,7 @@ adadone(struct cam_periph *periph, union { struct ada_softc *softc; struct ccb_ataio *ataio; + struct ccb_getdev *cgd; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; @@ -1423,6 +1473,47 @@ adadone(struct cam_periph *periph, union biodone(bp); break; } + case ADA_CCB_RAHEAD: + { + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (adaerror(done_ccb, 0, 0) == ERESTART) { + return; + } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + + /* + * Since our peripheral may be invalidated by an error + * above or an external event, we must release our CCB + * before releasing the reference on the peripheral. + * The peripheral will only go away once the last reference + * is removed, and we need it around for the CCB release + * operation. + */ + cgd = (struct ccb_getdev *)done_ccb; + xpt_setup_ccb(&cgd->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); + if (ADA_WC >= 0 && + cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { + softc->state = ADA_STATE_WCACHE; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, CAM_PRIORITY_DEV); + return; + } + softc->state = ADA_STATE_NORMAL; + xpt_release_ccb(done_ccb); + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + adaschedule(periph); + cam_periph_release_locked(periph); + return; + } case ADA_CCB_WCACHE: { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 20:35:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB3E106566B; Fri, 29 Jul 2011 20:35:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC7D8FC16; Fri, 29 Jul 2011 20:35:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TKZOYM065132; Fri, 29 Jul 2011 20:35:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TKZOtY065129; Fri, 29 Jul 2011 20:35:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107292035.p6TKZOtY065129@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 20:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224498 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 20:35:24 -0000 Author: mav Date: Fri Jul 29 20:35:23 2011 New Revision: 224498 URL: http://svn.freebsd.org/changeset/base/224498 Log: In some cases, at least on Marvell 88SE912x controllers, Current Command Slot field of the PxCMD register may point to an empty command slot. That breaks command timeout detection logic, making impossible to find what command actually caused timeout, and leading to infinite wait. Workaround that by checking whether pointed command slot is really used and can timeout in its time. And if not, fallback to the dumb algorithm used with FBS -- let all commands to time out and then fail all of them. Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Jul 29 20:32:27 2011 (r224497) +++ head/sys/dev/ahci/ahci.c Fri Jul 29 20:35:23 2011 (r224498) @@ -1879,12 +1879,13 @@ ahci_execute_transaction(struct ahci_slo device_printf(dev, "Poll timeout on slot %d port %d\n", slot->slot, port); device_printf(dev, "is %08x cs %08x ss %08x " - "rs %08x tfd %02x serr %08x\n", + "rs %08x tfd %02x serr %08x cmd %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), - ATA_INL(ch->r_mem, AHCI_P_SERR)); + ATA_INL(ch->r_mem, AHCI_P_SERR), + ATA_INL(ch->r_mem, AHCI_P_CMD)); et = AHCI_ERR_TIMEOUT; } @@ -1960,8 +1961,12 @@ ahci_timeout(struct ahci_slot *slot) ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT; if ((sstatus & (1 << slot->slot)) != 0 || ccs == slot->slot || - ch->fbs_enabled) + ch->fbs_enabled || ch->wrongccs) slot->state = AHCI_SLOT_EXECUTING; + else if ((ch->rslots & (1 << ccs)) == 0) { + ch->wrongccs = 1; + slot->state = AHCI_SLOT_EXECUTING; + } callout_reset(&slot->timeout, (int)slot->ccb->ccb_h.timeout * hz / 2000, @@ -1971,10 +1976,12 @@ ahci_timeout(struct ahci_slot *slot) device_printf(dev, "Timeout on slot %d port %d\n", slot->slot, slot->ccb->ccb_h.target_id & 0x0f); - device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n", + device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x " + "serr %08x cmd %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, - ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR)); + ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR), + ATA_INL(ch->r_mem, AHCI_P_CMD)); /* Handle frozen command. */ if (ch->frozen) { @@ -1987,7 +1994,7 @@ ahci_timeout(struct ahci_slot *slot) } xpt_done(fccb); } - if (!ch->fbs_enabled) { + if (!ch->fbs_enabled && !ch->wrongccs) { /* Without FBS we know real timeout source. */ ch->fatalerr = 1; /* Handle command with timeout. */ @@ -2585,6 +2592,7 @@ ahci_reset(device_t dev) xpt_release_simq(ch->sim, TRUE); ch->eslots = 0; ch->toslots = 0; + ch->wrongccs = 0; ch->fatalerr = 0; /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Fri Jul 29 20:32:27 2011 (r224497) +++ head/sys/dev/ahci/ahci.h Fri Jul 29 20:35:23 2011 (r224498) @@ -426,6 +426,7 @@ struct ahci_channel { int resetting; /* Hard-reset in progress. */ int resetpolldiv; /* Hard-reset poll divider. */ int listening; /* SUD bit is cleared. */ + int wrongccs; /* CCS field in CMD was wrong */ union ccb *frozen; /* Frozen command */ struct callout pm_timer; /* Power management events */ struct callout reset_timer; /* Hard-reset timeout */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 20:38:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFBEA1065670; Fri, 29 Jul 2011 20:38:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5D5A8FC1E; Fri, 29 Jul 2011 20:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TKc6Wv065244; Fri, 29 Jul 2011 20:38:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TKc6S3065242; Fri, 29 Jul 2011 20:38:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107292038.p6TKc6S3065242@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 20:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224499 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 20:38:07 -0000 Author: mav Date: Fri Jul 29 20:38:06 2011 New Revision: 224499 URL: http://svn.freebsd.org/changeset/base/224499 Log: Make ums(4) driver more picky, not attaching to "mouses" with absolute coordinates, such as digitizers and touch-screens, leaving these devices to uhid(4) and user-level. Specially patched xf86-input-mouse driver can handle them, that isn't done and can't be done properly with ums(4) because of mouse(4) protocol limitations. Approved by: re (kib) Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Fri Jul 29 20:35:23 2011 (r224498) +++ head/sys/dev/usb/input/ums.c Fri Jul 29 20:38:06 2011 (r224499) @@ -367,7 +367,9 @@ ums_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); void *d_ptr; - int error; + struct hid_data *hd; + struct hid_item hi; + int error, mdepth, found; uint16_t d_len; DPRINTFN(11, "\n"); @@ -388,14 +390,44 @@ ums_probe(device_t dev) if (error) return (ENXIO); - if (hid_is_collection(d_ptr, d_len, - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) - error = BUS_PROBE_DEFAULT; - else - error = ENXIO; - + hd = hid_start_parse(d_ptr, d_len, 1 << hid_input); + if (hd == NULL) + return (0); + mdepth = 0; + found = 0; + while (hid_get_item(hd, &hi)) { + switch (hi.kind) { + case hid_collection: + if (mdepth != 0) + mdepth++; + else if (hi.collection == 1 && + hi.usage == + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)) + mdepth++; + break; + case hid_endcollection: + if (mdepth != 0) + mdepth--; + break; + case hid_input: + if (mdepth == 0) + break; + if (hi.usage == + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X) && + (hi.flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) + found++; + if (hi.usage == + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y) && + (hi.flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) + found++; + break; + default: + break; + } + } + hid_end_parse(hd); free(d_ptr, M_TEMP); - return (error); + return (found ? BUS_PROBE_DEFAULT : ENXIO); } static void From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 21:58:20 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CF53106566C; Fri, 29 Jul 2011 21:58:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B58B98FC0A; Fri, 29 Jul 2011 21:58:18 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA17764; Sat, 30 Jul 2011 00:58:17 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Qmv4S-0004V3-VO; Sat, 30 Jul 2011 00:58:16 +0300 Message-ID: <4E332CF8.6080002@FreeBSD.org> Date: Sat, 30 Jul 2011 00:58:16 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: src-committers@FreeBSD.org References: <201107290958.p6T9wum1042480@svn.freebsd.org> In-Reply-To: <201107290958.p6T9wum1042480@svn.freebsd.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 21:58:20 -0000 Picking a random stable/8 sys commit: on 29/07/2011 12:58 Alexander Motin said the following: > Modified: > stable/8/sys/dev/ata/ata-pci.c > stable/8/sys/dev/ata/ata-pci.h > stable/8/sys/dev/ata/chipsets/ata-acard.c > stable/8/sys/dev/ata/chipsets/ata-acerlabs.c > stable/8/sys/dev/ata/chipsets/ata-intel.c > stable/8/sys/dev/ata/chipsets/ata-promise.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/geom/label/ (props changed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Why do we have this now? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 22:00:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF36106566C; Fri, 29 Jul 2011 22:00:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C73E8FC0C; Fri, 29 Jul 2011 22:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TM0Wls067768; Fri, 29 Jul 2011 22:00:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TM0WAY067766; Fri, 29 Jul 2011 22:00:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107292200.p6TM0WAY067766@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jul 2011 22:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224500 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 22:00:32 -0000 Author: avg Date: Fri Jul 29 22:00:32 2011 New Revision: 224500 URL: http://svn.freebsd.org/changeset/base/224500 Log: MFC r223663: add SNDCTL_DSP_HALT specified by OSS PR: kern/156874 Modified: stable/8/sys/sys/soundcard.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/sys/soundcard.h ============================================================================== --- stable/8/sys/sys/soundcard.h Fri Jul 29 20:38:06 2011 (r224499) +++ stable/8/sys/sys/soundcard.h Fri Jul 29 22:00:32 2011 (r224500) @@ -775,7 +775,8 @@ typedef struct { * IOCTL commands for /dev/dsp and /dev/audio */ -#define SNDCTL_DSP_RESET _IO ('P', 0) +#define SNDCTL_DSP_HALT _IO ('P', 0) +#define SNDCTL_DSP_RESET SNDCTL_DSP_HALT #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 22:11:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F54F1065670; Fri, 29 Jul 2011 22:11:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF378FC1E; Fri, 29 Jul 2011 22:11:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TMB6ci068220; Fri, 29 Jul 2011 22:11:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TMB6Rd068218; Fri, 29 Jul 2011 22:11:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107292211.p6TMB6Rd068218@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jul 2011 22:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224501 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 22:11:06 -0000 Author: avg Date: Fri Jul 29 22:11:05 2011 New Revision: 224501 URL: http://svn.freebsd.org/changeset/base/224501 Log: MFC r223663: add SNDCTL_DSP_HALT specified by OSS PR: kern/156874 Modified: stable/7/sys/sys/soundcard.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/soundcard.h ============================================================================== --- stable/7/sys/sys/soundcard.h Fri Jul 29 22:00:32 2011 (r224500) +++ stable/7/sys/sys/soundcard.h Fri Jul 29 22:11:05 2011 (r224501) @@ -752,7 +752,8 @@ typedef struct { * IOCTL commands for /dev/dsp and /dev/audio */ -#define SNDCTL_DSP_RESET _IO ('P', 0) +#define SNDCTL_DSP_HALT _IO ('P', 0) +#define SNDCTL_DSP_RESET SNDCTL_DSP_HALT #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) From owner-svn-src-all@FreeBSD.ORG Fri Jul 29 23:55:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD9A106566B; Fri, 29 Jul 2011 23:55:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCB438FC13; Fri, 29 Jul 2011 23:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6TNtHIp071277; Fri, 29 Jul 2011 23:55:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TNtHcA071275; Fri, 29 Jul 2011 23:55:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107292355.p6TNtHcA071275@svn.freebsd.org> From: Adrian Chadd Date: Fri, 29 Jul 2011 23:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224502 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 23:55:18 -0000 Author: adrian Date: Fri Jul 29 23:55:17 2011 New Revision: 224502 URL: http://svn.freebsd.org/changeset/base/224502 Log: Reset the NIC if ANI is enabled or disabled. Although this may not be what the original sysctl was designed to do, it feels a bit more "expected". Before, if ANI is disabled, the initial ANI parameters are still written to the hardware, even if they're not enabled. "ANI enabled" would then adjust the noise immunity parameters dynamically. Disabling ANI would simply leave the existing noise immunity parameters where they are, and disable the dynamic part. The problem is that disabling ANI doesn't leave the hardware in a consistent, predictable state - so asking a user to disable ANI wouldn't actually reset the NIC to a consistent set of PHY signal detection parameters, resulting in an unpredictable/unreliable outcome. This makes it difficult to get reliable debugging information from the user. Approved by: re (kib) Modified: head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Fri Jul 29 22:11:05 2011 (r224501) +++ head/sys/dev/ath/if_ath_sysctl.c Fri Jul 29 23:55:17 2011 (r224502) @@ -354,7 +354,21 @@ ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &intmit, 0, req); if (error || !req->newptr) return error; - return !ath_hal_setintmit(sc->sc_ah, intmit) ? EINVAL : 0; + + /* reusing error; 1 here means "good"; 0 means "fail" */ + error = ath_hal_setintmit(sc->sc_ah, intmit); + if (! error) + return EINVAL; + + /* + * Reset the hardware here - disabling ANI in the HAL + * doesn't reset ANI related registers, so it'll leave + * things in an inconsistent state. + */ + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) + ath_reset(sc->sc_ifp); + + return 0; } #ifdef IEEE80211_SUPPORT_TDMA From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 00:43:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD895106566C; Sat, 30 Jul 2011 00:43:18 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD1538FC08; Sat, 30 Jul 2011 00:43:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U0hIuG072670; Sat, 30 Jul 2011 00:43:18 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U0hIq3072663; Sat, 30 Jul 2011 00:43:18 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201107300043.p6U0hIq3072663@svn.freebsd.org> From: Kirk McKusick Date: Sat, 30 Jul 2011 00:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224503 - in head: sbin/mount sys/ufs/ffs sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 00:43:19 -0000 Author: mckusick Date: Sat Jul 30 00:43:18 2011 New Revision: 224503 URL: http://svn.freebsd.org/changeset/base/224503 Log: Update to -r224294 to ensure that only one of MNT_SUJ or MNT_SOFTDEP is set so that mount can revert back to using MNT_NOWAIT when doing getmntinfo. Approved by: re (kib) Modified: head/sbin/mount/mount.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/inode.h Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Fri Jul 29 23:55:17 2011 (r224502) +++ head/sbin/mount/mount.c Sat Jul 30 00:43:18 2011 (r224503) @@ -317,7 +317,7 @@ main(int argc, char *argv[]) rval = 0; switch (argc) { case 0: - if ((mntsize = getmntinfo(&mntbuf, MNT_WAIT)) == 0) + if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) err(1, "getmntinfo"); if (all) { while ((fs = getfsent()) != NULL) { @@ -666,7 +666,7 @@ getmntpt(const char *name) struct statfs *mntbuf; int i, mntsize; - mntsize = getmntinfo(&mntbuf, MNT_WAIT); + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = mntsize - 1; i >= 0; i--) { if (strcmp(mntbuf[i].f_mntfromname, name) == 0 || strcmp(mntbuf[i].f_mntonname, name) == 0) Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri Jul 29 23:55:17 2011 (r224502) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Jul 30 00:43:18 2011 (r224503) @@ -1967,7 +1967,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size ACTIVECLEAR(fs, cg); UFS_UNLOCK(ump); mp = UFSTOVFS(ump); - if (mp->mnt_flag & MNT_SOFTDEP && devvp->v_type != VREG) + if (MOUNTEDSOFTDEP(mp) && devvp->v_type != VREG) softdep_setup_blkfree(UFSTOVFS(ump), bp, bno, numfrags(fs, size), dephd); bdwrite(bp); @@ -2217,7 +2217,7 @@ ffs_freefile(ump, fs, devvp, ino, mode, fs->fs_fmod = 1; ACTIVECLEAR(fs, cg); UFS_UNLOCK(ump); - if (UFSTOVFS(ump)->mnt_flag & MNT_SOFTDEP && devvp->v_type != VREG) + if (MOUNTEDSOFTDEP(UFSTOVFS(ump)) && devvp->v_type != VREG) softdep_setup_inofree(UFSTOVFS(ump), bp, ino + cg * fs->fs_ipg, wkhd); bdwrite(bp); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Jul 29 23:55:17 2011 (r224502) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Jul 30 00:43:18 2011 (r224503) @@ -1364,7 +1364,7 @@ softdep_flush(void) mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { nmp = TAILQ_NEXT(mp, mnt_list); - if ((mp->mnt_flag & MNT_SOFTDEP) == 0) + if (MOUNTEDSOFTDEP(mp) == 0) continue; if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) continue; @@ -2423,7 +2423,7 @@ softdep_unmount(mp) MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_SOFTDEP; - if ((mp->mnt_flag & MNT_SUJ) == 0) { + if (MOUNTEDSUJ(mp) == 0) { MNT_IUNLOCK(mp); return; } @@ -2638,6 +2638,7 @@ out: if (error == 0) { MNT_ILOCK(mp); mp->mnt_flag |= MNT_SUJ; + mp->mnt_flag &= ~MNT_SOFTDEP; MNT_IUNLOCK(mp); /* * Only validate the journal contents if the @@ -3060,7 +3061,7 @@ softdep_flushjournal(mp) struct jblocks *jblocks; struct ufsmount *ump; - if ((mp->mnt_flag & MNT_SUJ) == 0) + if (MOUNTEDSUJ(mp) == 0) return; ump = VFSTOUFS(mp); jblocks = ump->softdep_jblocks; @@ -3096,7 +3097,7 @@ softdep_process_journal(mp, needwk, flag int off; int devbsize; - if ((mp->mnt_flag & MNT_SUJ) == 0) + if (MOUNTEDSUJ(mp) == 0) return; ump = VFSTOUFS(mp); fs = ump->um_fs; @@ -3827,8 +3828,8 @@ newfreework(ump, freeblks, parent, lbn, freework->fw_blkno = nb; freework->fw_frags = frags; freework->fw_indir = NULL; - freework->fw_ref = ((UFSTOVFS(ump)->mnt_flag & MNT_SUJ) == 0 || - lbn >= -NXADDR) ? 0 : NINDIR(ump->um_fs) + 1; + freework->fw_ref = (MOUNTEDSUJ(UFSTOVFS(ump)) == 0 || lbn >= -NXADDR) + ? 0 : NINDIR(ump->um_fs) + 1; freework->fw_start = freework->fw_off = off; if (journal) newjfreeblk(freeblks, lbn, nb, frags); @@ -4681,7 +4682,7 @@ softdep_setup_inomapdep(bp, ip, newinum, * Allocate the journal reference add structure so that the bitmap * can be dependent on it. */ - if (mp->mnt_flag & MNT_SUJ) { + if (MOUNTEDSUJ(mp)) { jaddref = newjaddref(ip, newinum, 0, 0, mode); jaddref->ja_state |= NEWBLOCK; } @@ -4734,7 +4735,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno * Add it to the dependency list for the buffer holding * the cylinder group map from which it was allocated. */ - if (mp->mnt_flag & MNT_SUJ) { + if (MOUNTEDSUJ(mp)) { jnewblk = malloc(sizeof(*jnewblk), M_JNEWBLK, M_SOFTDEP_FLAGS); workitem_alloc(&jnewblk->jn_list, D_JNEWBLK, mp); jnewblk->jn_jsegdep = newjsegdep(&jnewblk->jn_list); @@ -5199,7 +5200,7 @@ newfreefrag(ip, blkno, size, lbn) freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; - if ((ip->i_ump->um_mountp->mnt_flag & MNT_SUJ) != 0) { + if (MOUNTEDSUJ(UFSTOVFS(ip->i_ump))) { freefrag->ff_jdep = (struct worklist *) newjfreefrag(freefrag, ip, blkno, size, lbn); } else { @@ -7254,7 +7255,7 @@ freework_freeblock(freework) freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; - needj = (freeblks->fb_list.wk_mp->mnt_flag & MNT_SUJ) != 0; + needj = MOUNTEDSUJ(freeblks->fb_list.wk_mp) != 0; bsize = lfragtosize(fs, freework->fw_frags); LIST_INIT(&wkhd); /* @@ -7674,7 +7675,7 @@ indir_trunc(freework, dbn, lbn) ufs1fmt = 0; } level = lbn_level(lbn); - needj = (UFSTOVFS(ump)->mnt_flag & MNT_SUJ) != 0; + needj = MOUNTEDSUJ(UFSTOVFS(ump)) != 0; lbnadd = lbn_offset(fs, level); nblocks = btodb(fs->fs_bsize); nfreework = freework; @@ -7860,7 +7861,7 @@ setup_newdir(dap, newinum, dinum, newdir mkdir2->md_state = ATTACHED | MKDIR_PARENT; mkdir2->md_diradd = dap; mkdir2->md_jaddref = NULL; - if ((mp->mnt_flag & MNT_SUJ) == 0) { + if (MOUNTEDSUJ(mp) == 0) { mkdir1->md_state |= DEPCOMPLETE; mkdir2->md_state |= DEPCOMPLETE; } @@ -7900,7 +7901,7 @@ setup_newdir(dap, newinum, dinum, newdir * been satisfied and mkdir2 can be freed. */ inodedep_lookup(mp, dinum, 0, &inodedep); - if (mp->mnt_flag & MNT_SUJ) { + if (MOUNTEDSUJ(mp)) { if (inodedep == NULL) panic("setup_newdir: Lost parent."); jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -8031,7 +8032,7 @@ softdep_setup_directory_add(bp, dp, diro * written place it on the bufwait list, otherwise do the post-inode * write processing to put it on the id_pendinghd list. */ - if (mp->mnt_flag & MNT_SUJ) { + if (MOUNTEDSUJ(mp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, inoreflst); KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, @@ -8047,7 +8048,7 @@ softdep_setup_directory_add(bp, dp, diro * Add the journal entries for . and .. links now that the primary * link is written. */ - if (mkdir1 != NULL && (mp->mnt_flag & MNT_SUJ)) { + if (mkdir1 != NULL && MOUNTEDSUJ(mp)) { jaddref = (struct jaddref *)TAILQ_PREV(&jaddref->ja_ref, inoreflst, if_deps); KASSERT(jaddref != NULL && @@ -8144,7 +8145,7 @@ softdep_change_directoryentry_offset(bp, * determine if any affected adds or removes are present in the * journal. */ - if (mp->mnt_flag & MNT_SUJ) { + if (MOUNTEDSUJ(mp)) { flags = DEPALLOC; jmvref = newjmvref(dp, de->d_ino, dp->i_offset + (oldloc - base), @@ -8865,7 +8866,7 @@ softdep_setup_directory_change(bp, dp, i * processing to put it on the id_pendinghd list. */ inodedep_lookup(mp, newinum, DEPALLOC, &inodedep); - if (mp->mnt_flag & MNT_SUJ) { + if (MOUNTEDSUJ(mp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, inoreflst); KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, @@ -8928,7 +8929,7 @@ softdep_setup_sbupdate(ump, fs, bp) struct sbdep *sbdep; struct worklist *wk; - if ((ump->um_mountp->mnt_flag & MNT_SUJ) == 0) + if (MOUNTEDSUJ(UFSTOVFS(ump)) == 0) return; LIST_FOREACH(wk, &bp->b_dep, wk_list) if (wk->wk_type == D_SBDEP) @@ -9046,7 +9047,7 @@ unlinked_inodedep(mp, inodedep) { struct ufsmount *ump; - if ((mp->mnt_flag & MNT_SUJ) == 0) + if (MOUNTEDSUJ(mp) == 0) return; ump = VFSTOUFS(mp); ump->um_fs->fs_fmod = 1; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Jul 29 23:55:17 2011 (r224502) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Jul 30 00:43:18 2011 (r224503) @@ -281,7 +281,7 @@ ffs_mount(struct mount *mp) flags = WRITECLOSE; if (mp->mnt_flag & MNT_FORCE) flags |= FORCECLOSE; - if (mp->mnt_flag & MNT_SOFTDEP) { + if (MOUNTEDSOFTDEP(mp)) { error = softdep_flushfiles(mp, flags, td); } else { error = ffs_flushfiles(mp, flags, td); @@ -307,7 +307,7 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp); return (error); } - if (mp->mnt_flag & MNT_SOFTDEP) + if (MOUNTEDSOFTDEP(mp)) softdep_unmount(mp); DROP_GIANT(); g_topology_lock(); @@ -411,7 +411,7 @@ ffs_mount(struct mount *mp) * Softdep_mount() clears it in an initial mount * or ro->rw remount. */ - if (mp->mnt_flag & MNT_SOFTDEP) { + if (MOUNTEDSOFTDEP(mp)) { /* XXX: Reset too late ? */ MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_ASYNC; @@ -443,7 +443,7 @@ ffs_mount(struct mount *mp) fs->fs_fsmnt); return (EINVAL); } - KASSERT((mp->mnt_flag & MNT_SOFTDEP) == 0, + KASSERT(MOUNTEDSOFTDEP(mp) == 0, ("soft updates enabled on read-only file system")); DROP_GIANT(); g_topology_lock(); @@ -530,7 +530,7 @@ ffs_mount(struct mount *mp) return (error); } if (fsckpid > 0) { - KASSERT((mp->mnt_flag & MNT_SOFTDEP) == 0, + KASSERT(MOUNTEDSOFTDEP(mp) == 0, ("soft updates enabled on read-only file system")); ump = VFSTOUFS(mp); fs = ump->um_fs; @@ -1247,7 +1247,7 @@ ffs_unmount(mp, mntflags) vn_start_write(NULL, &mp, V_WAIT); } } - if (mp->mnt_flag & MNT_SOFTDEP) + if (MOUNTEDSOFTDEP(mp)) error = softdep_flushfiles(mp, flags, td); else error = ffs_flushfiles(mp, flags, td); @@ -1389,9 +1389,6 @@ ffs_statfs(mp, sbp) fs = ump->um_fs; if (fs->fs_magic != FS_UFS1_MAGIC && fs->fs_magic != FS_UFS2_MAGIC) panic("ffs_statfs"); - /* Don't export MNT_SOFTDEP when MNT_SUJ is in use */ - if ((sbp->f_flags & (MNT_SOFTDEP | MNT_SUJ)) == (MNT_SOFTDEP | MNT_SUJ)) - sbp->f_flags &= ~MNT_SOFTDEP; sbp->f_version = STATFS_VERSION; sbp->f_bsize = fs->fs_fsize; sbp->f_iosize = fs->fs_bsize; Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Fri Jul 29 23:55:17 2011 (r224502) +++ head/sys/ufs/ffs/ffs_vnops.c Sat Jul 30 00:43:18 2011 (r224503) @@ -187,8 +187,7 @@ retry: error = ffs_syncvnode(vp, ap->a_waitfor); if (error) return (error); - if (ap->a_waitfor == MNT_WAIT && - (vp->v_mount->mnt_flag & MNT_SOFTDEP)) { + if (ap->a_waitfor == MNT_WAIT && DOINGSOFTDEP(vp)) { error = softdep_fsync(vp); if (error) return (error); Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Fri Jul 29 23:55:17 2011 (r224502) +++ head/sys/ufs/ufs/inode.h Sat Jul 30 00:43:18 2011 (r224503) @@ -174,9 +174,11 @@ struct indir { #define ITOV(ip) ((ip)->i_vnode) /* Determine if soft dependencies are being done */ -#define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & MNT_SOFTDEP) -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) -#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) +#define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) +#define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) +#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) +#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) +#define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) /* This overlays the fid structure (see mount.h). */ struct ufid { From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 00:51:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F581106564A; Sat, 30 Jul 2011 00:51:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA99B8FC08; Sat, 30 Jul 2011 00:51:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U0pa4T073014; Sat, 30 Jul 2011 00:51:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U0paFj073011; Sat, 30 Jul 2011 00:51:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201107300051.p6U0paFj073011@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 30 Jul 2011 00:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224504 - in head/release: amd64 i386 powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 00:51:37 -0000 Author: nwhitehorn Date: Sat Jul 30 00:51:36 2011 New Revision: 224504 URL: http://svn.freebsd.org/changeset/base/224504 Log: Mount memsticks read-only by default to prevent them being filled by user modifications and subsequently preventing a functioning installation. Approved by: re (kib) Modified: head/release/amd64/make-memstick.sh head/release/i386/make-memstick.sh head/release/powerpc/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Sat Jul 30 00:43:18 2011 (r224503) +++ head/release/amd64/make-memstick.sh Sat Jul 30 00:51:36 2011 (r224504) @@ -32,7 +32,7 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' > ${1}/etc/fstab +echo '/dev/gpt/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab rm -f ${tempfile} makefs -B little ${tempfile} ${1} if [ $? -ne 0 ]; then Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Sat Jul 30 00:43:18 2011 (r224503) +++ head/release/i386/make-memstick.sh Sat Jul 30 00:51:36 2011 (r224504) @@ -32,7 +32,7 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' > ${1}/etc/fstab +echo '/dev/gpt/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab rm -f ${tempfile} makefs -B little ${tempfile} ${1} if [ $? -ne 0 ]; then Modified: head/release/powerpc/make-memstick.sh ============================================================================== --- head/release/powerpc/make-memstick.sh Sat Jul 30 00:43:18 2011 (r224503) +++ head/release/powerpc/make-memstick.sh Sat Jul 30 00:51:36 2011 (r224504) @@ -32,7 +32,7 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/da0s3 / ufs rw,noatime 1 1' > ${1}/etc/fstab +echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab rm -f ${tempfile} makefs -B big ${tempfile} ${1} if [ $? -ne 0 ]; then From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 00:52:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C013106566B; Sat, 30 Jul 2011 00:52:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C7118FC13; Sat, 30 Jul 2011 00:52:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U0qDnX073072; Sat, 30 Jul 2011 00:52:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U0qDVU073070; Sat, 30 Jul 2011 00:52:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201107300052.p6U0qDVU073070@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 30 Jul 2011 00:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224505 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 00:52:13 -0000 Author: nwhitehorn Date: Sat Jul 30 00:52:13 2011 New Revision: 224505 URL: http://svn.freebsd.org/changeset/base/224505 Log: Fix an error that could cause sysctl -a to enter an infinite loop in the event of a broken or busy fan due to returning incorrect error codes from the FCU sysctl handler. Reported by: Path Mather 1 Approved by: re (kib) Modified: head/sys/powerpc/powermac/fcu.c Modified: head/sys/powerpc/powermac/fcu.c ============================================================================== --- head/sys/powerpc/powermac/fcu.c Sat Jul 30 00:51:36 2011 (r224504) +++ head/sys/powerpc/powermac/fcu.c Sat Jul 30 00:52:13 2011 (r224505) @@ -282,14 +282,14 @@ fcu_fan_set_rpm(struct fcu_fan *fan, int fan->setpoint = rpm; } else { device_printf(fan->dev, "Unknown fan type: %d\n", fan->type); - return (-1); + return (ENXIO); } buf[0] = rpm >> (8 - fcu_rpm_shift); buf[1] = rpm << fcu_rpm_shift; if (fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 2) < 0) - return (-1); + return (EIO); return (0); } @@ -377,7 +377,7 @@ fcu_fan_set_pwm(struct fcu_fan *fan, int buf[0] = (pwm * 2550) / 1000; if (fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 1) < 0) - return (-1); + return (EIO); return (0); } @@ -536,12 +536,12 @@ fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) if (fan->type == FCU_FAN_RPM) { rpm = fcu_fan_get_rpm(fan); if (rpm < 0) - return (-1); + return (EIO); error = sysctl_handle_int(oidp, &rpm, 0, req); } else { error = fcu_fan_get_pwm(fcu, fan, &pwm, &rpm); if (error < 0) - return (-1); + return (EIO); switch (arg2 & 0xff00) { case FCU_PWM_SYSCTL_PWM: @@ -552,7 +552,7 @@ fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) break; default: /* This should never happen */ - error = -1; + return (EINVAL); }; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 01:06:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A11BB1065674; Sat, 30 Jul 2011 01:06:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91F1B8FC16; Sat, 30 Jul 2011 01:06:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U16ChJ073515; Sat, 30 Jul 2011 01:06:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U16C17073512; Sat, 30 Jul 2011 01:06:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107300106.p6U16C17073512@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 30 Jul 2011 01:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224506 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 01:06:12 -0000 Author: yongari Date: Sat Jul 30 01:06:12 2011 New Revision: 224506 URL: http://svn.freebsd.org/changeset/base/224506 Log: Add new device id of D-Link DGE-530T Rev. C controller. DGE-503T Rev A1 and B1 is supported by sk(4) but the DGE-530T Rev. C controller is re-branded RealTek 8169 controller. PR: kern/159116 Approved by: re (kib) Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Sat Jul 30 00:52:13 2011 (r224505) +++ head/sys/dev/re/if_re.c Sat Jul 30 01:06:12 2011 (r224506) @@ -174,6 +174,8 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe static struct rl_type re_devs[] = { { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, + { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, + "D-Link DGE-530(T) Gigabit Ethernet Adapter" }, { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Sat Jul 30 00:52:13 2011 (r224505) +++ head/sys/pci/if_rlreg.h Sat Jul 30 01:06:12 2011 (r224506) @@ -1042,6 +1042,7 @@ struct rl_softc { * D-Link DFE-5280T device ID */ #define DLINK_DEVICEID_528T 0x4300 +#define DLINK_DEVICEID_530T_REVC 0x4302 /* * D-Link DFE-690TXD device ID From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 08:31:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 185FC1065673; Sat, 30 Jul 2011 08:31:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07EF18FC08; Sat, 30 Jul 2011 08:31:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U8VIWY087613; Sat, 30 Jul 2011 08:31:18 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U8VIeu087611; Sat, 30 Jul 2011 08:31:18 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107300831.p6U8VIeu087611@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 30 Jul 2011 08:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224507 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 08:31:19 -0000 Author: jh Date: Sat Jul 30 08:31:18 2011 New Revision: 224507 URL: http://svn.freebsd.org/changeset/base/224507 Log: MFC r216047 by kevlo: Fix fd leak in get_font MFC r222568: Don't try to close the stream if fopen(3) fails. PR: bin/155349 Modified: stable/8/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/8/usr.sbin/kbdmap/ (props changed) Modified: stable/8/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/8/usr.sbin/kbdmap/kbdmap.c Sat Jul 30 01:06:12 2011 (r224506) +++ stable/8/usr.sbin/kbdmap/kbdmap.c Sat Jul 30 08:31:18 2011 (r224507) @@ -226,6 +226,7 @@ get_font(void) } } } + fclose(fp); } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 09:38:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0230106566B; Sat, 30 Jul 2011 09:38:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBCE8FC1B; Sat, 30 Jul 2011 09:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6U9cq2o089721; Sat, 30 Jul 2011 09:38:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6U9cqrD089719; Sat, 30 Jul 2011 09:38:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107300938.p6U9cqrD089719@svn.freebsd.org> From: Alexander Motin Date: Sat, 30 Jul 2011 09:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224508 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 09:38:52 -0000 Author: mav Date: Sat Jul 30 09:38:52 2011 New Revision: 224508 URL: http://svn.freebsd.org/changeset/base/224508 Log: r224283: Do not try to execute FLUSHCACHE on close and print extra messages for invalidated (considered lost) ada device. Exactly same already done for the da devices. Modified: stable/8/sys/cam/ata/ata_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sat Jul 30 08:31:18 2011 (r224507) +++ stable/8/sys/cam/ata/ata_da.c Sat Jul 30 09:38:52 2011 (r224508) @@ -401,7 +401,8 @@ adaclose(struct disk *dp) softc = (struct ada_softc *)periph->softc; /* We only sync the cache if the drive is capable of it. */ - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { + if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -1272,7 +1273,8 @@ adadone(struct cam_periph *periph, union return; } if (error != 0) { - if (error == ENXIO) { + if (error == ENXIO && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { /* * Catastrophic error. Mark our pack as * invalid. From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:18:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD75B106566B; Sat, 30 Jul 2011 13:18:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92A628FC0A; Sat, 30 Jul 2011 13:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDImEF001242; Sat, 30 Jul 2011 13:18:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDImm1001240; Sat, 30 Jul 2011 13:18:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301318.p6UDImm1001240@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224509 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:18:48 -0000 Author: adrian Date: Sat Jul 30 13:18:48 2011 New Revision: 224509 URL: http://svn.freebsd.org/changeset/base/224509 Log: Fix the AR9280 initial AGC calibration code. It looks like this was mixed up with the AR9285 calibration code. This code is now more in line with what Linux ath9k and Atheros reference drivers do. Obtained from: Atheros Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jul 30 09:38:52 2011 (r224508) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jul 30 13:18:48 2011 (r224509) @@ -186,36 +186,22 @@ ar5416RunInitCals(struct ath_hal *ah, in } #endif + +/* + * AGC calibration for the AR5416, AR9130, AR9160, AR9280. + */ HAL_BOOL ar5416InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan) { - if (AR_SREV_MERLIN_10_OR_LATER(ah)) { - /* Enable Rx Filter Cal */ - OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); - OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_FLTR_CAL); - - /* Clear the carrier leak cal bit */ - OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); - /* kick off the cal */ - OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); - - /* Poll for offset calibration complete */ - if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { - HALDEBUG(ah, HAL_DEBUG_ANY, - "%s: offset calibration failed to complete in 1ms; " - "noisy environment?\n", __func__); - return AH_FALSE; - } + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + /* Disable ADC */ + OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, + AR_PHY_ADC_CTL_OFF_PWDADC); - /* Set the cl cal bit and rerun the cal a 2nd time */ /* Enable Rx Filter Cal */ - OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_FLTR_CAL); - - OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); } /* Calibrate the AGC */ @@ -229,6 +215,16 @@ ar5416InitCalHardware(struct ath_hal *ah return AH_FALSE; } + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + /* Enable ADC */ + OS_REG_SET_BIT(ah, AR_PHY_ADC_CTL, + AR_PHY_ADC_CTL_OFF_PWDADC); + + /* Disable Rx Filter Cal */ + OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_FLTR_CAL); + } + return AH_TRUE; } @@ -247,7 +243,8 @@ ar5416InitCal(struct ath_hal *ah, const /* Do initial chipset-specific calibration */ if (! AH5416(ah)->ah_cal_initcal(ah, chan)) { - HALDEBUG(ah, HAL_DEBUG_ANY, "%s: initial chipset calibration did " + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: initial chipset calibration did " "not complete in time; noisy environment?\n", __func__); return AH_FALSE; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:21:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBEB8106564A; Sat, 30 Jul 2011 13:21:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB0198FC16; Sat, 30 Jul 2011 13:21:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDLXlP001364; Sat, 30 Jul 2011 13:21:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDLXZ2001362; Sat, 30 Jul 2011 13:21:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301321.p6UDLXZ2001362@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224510 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:21:34 -0000 Author: adrian Date: Sat Jul 30 13:21:33 2011 New Revision: 224510 URL: http://svn.freebsd.org/changeset/base/224510 Log: I noticed that the Merlin NICs I had (AR9220, AR9280) never completed the ADC calibrations if the NIC is in 5ghz 11a or 5ghz HT/20 modes. I've been told that the dual-ADC is only engaged in turbo/40mhz modes. Since Sowl (AR9160) seems to return valid-looking calibration data in 5ghz 20MHz modes, I'm only disabling it for Merlin for now. It may turn out I can disable it for all chipsets and only enable it for 40MHz modes. Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jul 30 13:18:48 2011 (r224509) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jul 30 13:21:33 2011 (r224510) @@ -73,8 +73,15 @@ ar5416IsCalSupp(struct ath_hal *ah, cons case ADC_GAIN_CAL: case ADC_DC_CAL: /* Run ADC Gain Cal for either 5ghz any or 2ghz HT40 */ - if (IEEE80211_IS_CHAN_5GHZ(chan)) - return AH_TRUE; + /* + * Merlin (AR9280) doesn't ever complete ADC calibrations + * in 5ghz non-HT40 mode (ie, HT20, 11a). For now, disable + * it for Merlin only until further information is + * available. + */ + if (! AR_SREV_MERLIN(ah)) + if (IEEE80211_IS_CHAN_5GHZ(chan)) + return AH_TRUE; if (IEEE80211_IS_CHAN_HT40(chan)) return AH_TRUE; return AH_FALSE; From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:22:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 786EA106566B; Sat, 30 Jul 2011 13:22:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661798FC0A; Sat, 30 Jul 2011 13:22:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDMioF001446; Sat, 30 Jul 2011 13:22:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDMicQ001442; Sat, 30 Jul 2011 13:22:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107301322.p6UDMicQ001442@svn.freebsd.org> From: Alexander Motin Date: Sat, 30 Jul 2011 13:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224511 - in head: lib/libusbhid usr.bin/usbhidaction usr.bin/usbhidctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:22:44 -0000 Author: mav Date: Sat Jul 30 13:22:44 2011 New Revision: 224511 URL: http://svn.freebsd.org/changeset/base/224511 Log: MFprojects/hid: - Fix usbhidctl and usbhidaction to handle HID devices with multiple report ids, such as multimedia keyboards. - Add collection type and report id to the `usbhidctl -r` output. They are important for proper device understanding and debugging. - Fix usbhidaction tool to properly handle items having report_count more then 1. Approved by: re (kib) MFC after: 2 weeks Modified: head/lib/libusbhid/parse.c head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/usbhidctl/usbhid.c Modified: head/lib/libusbhid/parse.c ============================================================================== --- head/lib/libusbhid/parse.c Sat Jul 30 13:21:33 2011 (r224510) +++ head/lib/libusbhid/parse.c Sat Jul 30 13:22:44 2011 (r224511) @@ -322,6 +322,8 @@ hid_get_item(hid_data_t s, hid_item_t *h * one and one item: */ c->report_count = 1; + c->usage_minimum = 0; + c->usage_maximum = 0; } else { s->ncount = 1; } @@ -512,13 +514,14 @@ hid_report_size(report_desc_t r, enum hi uint32_t temp; uint32_t hpos; uint32_t lpos; + int report_id = 0; hpos = 0; lpos = 0xFFFFFFFF; memset(&h, 0, sizeof h); for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) { - if (h.report_ID == id && h.kind == k) { + if ((h.report_ID == id || id < 0) && h.kind == k) { /* compute minimum */ if (lpos > h.pos) lpos = h.pos; @@ -527,6 +530,8 @@ hid_report_size(report_desc_t r, enum hi /* compute maximum */ if (hpos < temp) hpos = temp; + if (h.report_ID != 0) + report_id = 1; } } hid_end_parse(d); @@ -537,11 +542,8 @@ hid_report_size(report_desc_t r, enum hi else temp = hpos - lpos; - if (id) - temp += 8; - /* return length in bytes rounded up */ - return ((temp + 7) / 8); + return ((temp + 7) / 8 + report_id); } int Modified: head/usr.bin/usbhidaction/usbhidaction.c ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.c Sat Jul 30 13:21:33 2011 (r224510) +++ head/usr.bin/usbhidaction/usbhidaction.c Sat Jul 30 13:22:44 2011 (r224511) @@ -92,12 +92,12 @@ main(int argc, char **argv) char buf[100]; char devnamebuf[PATH_MAX]; struct command *cmd; - int reportid; + int reportid = -1; demon = 1; ignore = 0; dieearly = 0; - while ((ch = getopt(argc, argv, "c:def:ip:t:v")) != -1) { + while ((ch = getopt(argc, argv, "c:def:ip:r:t:v")) != -1) { switch(ch) { case 'c': conf = optarg; @@ -117,6 +117,9 @@ main(int argc, char **argv) case 'p': pidfile = optarg; break; + case 'r': + reportid = atoi(optarg); + break; case 't': table = optarg; break; @@ -146,14 +149,13 @@ main(int argc, char **argv) fd = open(dev, O_RDWR); if (fd < 0) err(1, "%s", dev); - reportid = hid_get_report_id(fd); repd = hid_get_report_desc(fd); if (repd == NULL) err(1, "hid_get_report_desc() failed"); commands = parse_conf(conf, repd, reportid, ignore); - sz = (size_t)hid_report_size(repd, hid_input, reportid); + sz = (size_t)hid_report_size(repd, hid_input, -1); if (verbose) printf("report size %zu\n", sz); @@ -198,7 +200,23 @@ main(int argc, char **argv) } #endif for (cmd = commands; cmd; cmd = cmd->next) { - val = hid_get_data(buf, &cmd->item); + if (cmd->item.report_ID != 0 && + buf[0] != cmd->item.report_ID) + continue; + if (cmd->item.flags & HIO_VARIABLE) + val = hid_get_data(buf, &cmd->item); + else { + uint32_t pos = cmd->item.pos; + for (i = 0; i < cmd->item.report_count; i++) { + val = hid_get_data(buf, &cmd->item); + if (val == cmd->value) + break; + cmd->item.pos += cmd->item.report_size; + } + cmd->item.pos = pos; + val = (i < cmd->item.report_count) ? + cmd->value : -1; + } if (cmd->value != val && cmd->anyvalue == 0) goto next; if ((cmd->debounce == 0) || Modified: head/usr.bin/usbhidctl/usbhid.c ============================================================================== --- head/usr.bin/usbhidctl/usbhid.c Sat Jul 30 13:21:33 2011 (r224510) +++ head/usr.bin/usbhidctl/usbhid.c Sat Jul 30 13:22:44 2011 (r224511) @@ -46,7 +46,6 @@ int verbose = 0; int all = 0; int noname = 0; int hexdump = 0; -static int reportid; char **names; int nnames; @@ -101,11 +100,12 @@ dumpitem(const char *label, struct hid_i { if ((h->flags & HIO_CONST) && !verbose) return; - printf("%s size=%d count=%d page=%s usage=%s%s", label, - h->report_size, h->report_count, + printf("%s rid=%d size=%d count=%d page=%s usage=%s%s%s", label, + h->report_ID, h->report_size, h->report_count, hid_usage_page(HID_PAGE(h->usage)), hid_usage_in_page(h->usage), - h->flags & HIO_CONST ? " Const" : ""); + h->flags & HIO_CONST ? " Const" : "", + h->flags & HIO_VARIABLE ? "" : " Array"); printf(", logical range %d..%d", h->logical_minimum, h->logical_maximum); if (h->physical_minimum != h->physical_maximum) @@ -116,6 +116,24 @@ dumpitem(const char *label, struct hid_i printf("\n"); } +static const char * +hid_collection_type(int32_t type) +{ + static char num[8]; + + switch (type) { + case 0: return ("Physical"); + case 1: return ("Application"); + case 2: return ("Logical"); + case 3: return ("Report"); + case 4: return ("Named_Array"); + case 5: return ("Usage_Switch"); + case 6: return ("Usage_Modifier"); + } + snprintf(num, sizeof(num), "0x%02x", type); + return (num); +} + void dumpitems(report_desc_t r) { @@ -123,10 +141,11 @@ dumpitems(report_desc_t r) struct hid_item h; int size; - for (d = hid_start_parse(r, ~0, reportid); hid_get_item(d, &h); ) { + for (d = hid_start_parse(r, ~0, -1); hid_get_item(d, &h); ) { switch (h.kind) { case hid_collection: - printf("Collection page=%s usage=%s\n", + printf("Collection type=%s page=%s usage=%s\n", + hid_collection_type(h.collection), hid_usage_page(HID_PAGE(h.usage)), hid_usage_in_page(h.usage)); break; @@ -145,13 +164,13 @@ dumpitems(report_desc_t r) } } hid_end_parse(d); - size = hid_report_size(r, hid_input, 0); + size = hid_report_size(r, hid_input, -1); printf("Total input size %d bytes\n", size); - size = hid_report_size(r, hid_output, 0); + size = hid_report_size(r, hid_output, -1); printf("Total output size %d bytes\n", size); - size = hid_report_size(r, hid_feature, 0); + size = hid_report_size(r, hid_feature, -1); printf("Total feature size %d bytes\n", size); } @@ -180,14 +199,17 @@ prdata(u_char *buf, struct hid_item *h) pos = h->pos; for (i = 0; i < h->report_count; i++) { data = hid_get_data(buf, h); + if (i > 0) + printf(" "); if (h->logical_minimum < 0) printf("%d", (int)data); else printf("%u", data); if (hexdump) printf(" [0x%x]", data); - pos += h->report_size; + h->pos += h->report_size; } + h->pos = pos; } void @@ -202,7 +224,7 @@ dumpdata(int f, report_desc_t rd, int lo char namebuf[10000], *namep; hids = 0; - for (d = hid_start_parse(rd, 1<next) { + if (n->report_ID != 0 && dbuf[0] != n->report_ID) + continue; namep = namebuf; namep += sprintf(namep, "%s:%s.", hid_usage_page(HID_PAGE(n->collection)), @@ -242,7 +266,7 @@ dumpdata(int f, report_desc_t rd, int lo if (all || gotname(namebuf)) { if (!noname) printf("%s=", namebuf); - prdata(dbuf + (reportid != 0), n); + prdata(dbuf, n); printf("\n"); } } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:25:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E056F106564A; Sat, 30 Jul 2011 13:25:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4138FC13; Sat, 30 Jul 2011 13:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDPBdT001580; Sat, 30 Jul 2011 13:25:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDPBkA001576; Sat, 30 Jul 2011 13:25:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301325.p6UDPBkA001576@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224512 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:25:12 -0000 Author: adrian Date: Sat Jul 30 13:25:11 2011 New Revision: 224512 URL: http://svn.freebsd.org/changeset/base/224512 Log: Bring over AR5416 specific RX filter get/set routines. This in particular fixes radar PHY handling - on the AR5212 NIC, one enables the AR_PHY_ERR_RADAR bit in AR_PHY_ERR; the AR5416 and later also needs a bit set in AR_RX_FILTER. A follow-up commit is needed to convert the AR5416 ANI code to use this particular method, as it's currently using the AR5212 methods directly. Obtained from: Atheros Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jul 30 13:22:44 2011 (r224511) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jul 30 13:25:11 2011 (r224512) @@ -218,6 +218,8 @@ extern HAL_BOOL ar5416ResetKeyCacheEntry extern HAL_BOOL ar5416SetKeyCacheEntry(struct ath_hal *ah, uint16_t entry, const HAL_KEYVAL *k, const uint8_t *mac, int xorKey); +extern uint32_t ar5416GetRxFilter(struct ath_hal *ah); +extern void ar5416SetRxFilter(struct ath_hal *ah, uint32_t bits); extern void ar5416StartPcuReceive(struct ath_hal *ah); extern void ar5416StopPcuReceive(struct ath_hal *ah); extern HAL_BOOL ar5416SetupRxDesc(struct ath_hal *, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jul 30 13:22:44 2011 (r224511) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jul 30 13:25:11 2011 (r224512) @@ -117,6 +117,8 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_resetTxQueue = ar5416ResetTxQueue; /* Receive Functions */ + ah->ah_getRxFilter = ar5416GetRxFilter; + ah->ah_setRxFilter = ar5416SetRxFilter; ah->ah_startPcuReceive = ar5416StartPcuReceive; ah->ah_stopPcuReceive = ar5416StopPcuReceive; ah->ah_setupRxDesc = ar5416SetupRxDesc; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sat Jul 30 13:22:44 2011 (r224511) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sat Jul 30 13:25:11 2011 (r224512) @@ -27,6 +27,46 @@ #include "ar5416/ar5416desc.h" /* + * Get the receive filter. + */ +uint32_t +ar5416GetRxFilter(struct ath_hal *ah) +{ + uint32_t bits = OS_REG_READ(ah, AR_RX_FILTER); + uint32_t phybits = OS_REG_READ(ah, AR_PHY_ERR); + + if (phybits & AR_PHY_ERR_RADAR) + bits |= HAL_RX_FILTER_PHYRADAR; + if (phybits & (AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING)) + bits |= HAL_RX_FILTER_PHYERR; + return bits; +} + +/* + * Set the receive filter. + */ +void +ar5416SetRxFilter(struct ath_hal *ah, u_int32_t bits) +{ + uint32_t phybits; + + OS_REG_WRITE(ah, AR_RX_FILTER, (bits & 0xffff)); + phybits = 0; + if (bits & HAL_RX_FILTER_PHYRADAR) + phybits |= AR_PHY_ERR_RADAR; + if (bits & HAL_RX_FILTER_PHYERR) + phybits |= AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING; + OS_REG_WRITE(ah, AR_PHY_ERR, phybits); + if (phybits) { + OS_REG_WRITE(ah, AR_RXCFG, + OS_REG_READ(ah, AR_RXCFG) | AR_RXCFG_ZLFDMA); + } else { + OS_REG_WRITE(ah, AR_RXCFG, + OS_REG_READ(ah, AR_RXCFG) &~ AR_RXCFG_ZLFDMA); + } +} + +/* * Start receive at the PCU engine */ void From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:30:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EF3F106566C; Sat, 30 Jul 2011 13:30:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D0068FC15; Sat, 30 Jul 2011 13:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDUP2p001837; Sat, 30 Jul 2011 13:30:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDUPgN001834; Sat, 30 Jul 2011 13:30:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301330.p6UDUPgN001834@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224514 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:30:25 -0000 Author: adrian Date: Sat Jul 30 13:30:24 2011 New Revision: 224514 URL: http://svn.freebsd.org/changeset/base/224514 Log: Fix ANI handling to work correctly when (trying) to receive radar errors. * Teach the AR5212/AR5416 ANI code to use the RX filter methods, rather than calling the RX filter routines directly. * Make HAL_ANI_PRESENT and HAL_ANI_MODE unconditionally available, regardless of whether ah_ani_function is masking it. * (Mostly) fully disable ANI if interference mitigation is disabled. When disabled, the ANI code doesn't touch any ANI/PHY registers, leaving them the default value. This is in line with what the Atheros reference driver does. * Correctly set the ANI parameters during ANI reset, rather than when ANI is enabled. In this way, if ANI is disabled or enabled whilst the NIC is not active (and there's no current channel), bogus parameters or a NULL pointer deference doesn't occur. There's still some lingering issues - notably, the MIB events/interrupts aren't fully disabled, so MIB interrupts still occur. I'll worry about that later. Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Sat Jul 30 13:28:11 2011 (r224513) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Sat Jul 30 13:30:24 2011 (r224514) @@ -222,7 +222,14 @@ ar5212AniControl(struct ath_hal *ah, HAL typedef int TABLE[]; struct ath_hal_5212 *ahp = AH5212(ah); struct ar5212AniState *aniState = ahp->ah_curani; - const struct ar5212AniParams *params = aniState->params; + const struct ar5212AniParams *params = AH_NULL; + + /* + * This function may be called before there's a current + * channel (eg to disable ANI.) + */ + if (aniState != AH_NULL) + params = aniState->params; OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd); @@ -343,8 +350,8 @@ ar5212AniControl(struct ath_hal *ah, HAL ahp->ah_procPhyErr &= ~HAL_ANI_ENA; /* Turn off HW counters if we have them */ ar5212AniDetach(ah); - ar5212SetRxFilter(ah, - ar5212GetRxFilter(ah) &~ HAL_RX_FILTER_PHYERR); + ah->ah_setRxFilter(ah, + ah->ah_getRxFilter(ah) &~ HAL_RX_FILTER_PHYERR); } else { /* normal/auto mode */ /* don't mess with state if already enabled */ if (ahp->ah_procPhyErr & HAL_ANI_ENA) @@ -358,8 +365,8 @@ ar5212AniControl(struct ath_hal *ah, HAL ahp->ah_curani->params: &ahp->ah_aniParams24 /*XXX*/); } else { - ar5212SetRxFilter(ah, - ar5212GetRxFilter(ah) | HAL_RX_FILTER_PHYERR); + ah->ah_setRxFilter(ah, + ah->ah_getRxFilter(ah) | HAL_RX_FILTER_PHYERR); } ahp->ah_procPhyErr |= HAL_ANI_ENA; } @@ -609,8 +616,20 @@ ar5212AniReset(struct ath_hal *ah, const /* * Turn off PHY error frame delivery while we futz with settings. */ - rxfilter = ar5212GetRxFilter(ah); - ar5212SetRxFilter(ah, rxfilter &~ HAL_RX_FILTER_PHYERR); + rxfilter = ah->ah_getRxFilter(ah); + ah->ah_setRxFilter(ah, rxfilter &~ HAL_RX_FILTER_PHYERR); + + /* + * If ANI is disabled at this point, don't set the default + * ANI parameter settings - leave the HAL settings there. + * This is (currently) needed for reliable radar detection. + */ + if (! ANI_ENA(ah)) { + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ANI disabled\n", + __func__); + goto finish; + } + /* * Automatic processing is done only in station mode right now. */ @@ -644,10 +663,15 @@ ar5212AniReset(struct ath_hal *ah, const ar5212AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, 0); ichan->privFlags |= CHANNEL_ANI_SETUP; } + /* + * In case the counters haven't yet been setup; set them up. + */ + enableAniMIBCounters(ah, ahp->ah_curani->params); ar5212AniRestart(ah, aniState); +finish: /* restore RX filter mask */ - ar5212SetRxFilter(ah, rxfilter); + ah->ah_setRxFilter(ah, rxfilter); } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sat Jul 30 13:28:11 2011 (r224513) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sat Jul 30 13:30:24 2011 (r224514) @@ -156,6 +156,8 @@ ar5416AniAttach(struct ath_hal *ah, cons /* * Cleanup any ANI state setup. + * + * This doesn't restore registers to their default settings! */ void ar5416AniDetach(struct ath_hal *ah) @@ -173,7 +175,43 @@ ar5416AniControl(struct ath_hal *ah, HAL typedef int TABLE[]; struct ath_hal_5212 *ahp = AH5212(ah); struct ar5212AniState *aniState = ahp->ah_curani; - const struct ar5212AniParams *params = aniState->params; + const struct ar5212AniParams *params = AH_NULL; + + /* + * This function may be called before there's a current + * channel (eg to disable ANI.) + */ + if (aniState != AH_NULL) + params = aniState->params; + + OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd); + + /* These commands can't be disabled */ + if (cmd == HAL_ANI_PRESENT) + return AH_TRUE; + + if (cmd == HAL_ANI_MODE) { + if (param == 0) { + ahp->ah_procPhyErr &= ~HAL_ANI_ENA; + /* Turn off HW counters if we have them */ + ar5416AniDetach(ah); + } else { /* normal/auto mode */ + /* don't mess with state if already enabled */ + if (! (ahp->ah_procPhyErr & HAL_ANI_ENA)) { + /* Enable MIB Counters */ + /* + * XXX use 2.4ghz params if no channel is + * available + */ + enableAniMIBCounters(ah, + ahp->ah_curani != AH_NULL ? + ahp->ah_curani->params: + &ahp->ah_aniParams24); + ahp->ah_procPhyErr |= HAL_ANI_ENA; + } + } + return AH_TRUE; + } /* Check whether the particular function is enabled */ if (((1 << cmd) & AH5416(ah)->ah_ani_function) == 0) { @@ -183,7 +221,6 @@ ar5416AniControl(struct ath_hal *ah, HAL return AH_FALSE; } - OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd); switch (cmd) { case HAL_ANI_NOISE_IMMUNITY_LEVEL: { @@ -317,23 +354,6 @@ ar5416AniControl(struct ath_hal *ah, HAL aniState->spurImmunityLevel = level; break; } - case HAL_ANI_PRESENT: - break; - case HAL_ANI_MODE: - if (param == 0) { - ahp->ah_procPhyErr &= ~HAL_ANI_ENA; - /* Turn off HW counters if we have them */ - ar5416AniDetach(ah); - } else { /* normal/auto mode */ - /* don't mess with state if already enabled */ - if (ahp->ah_procPhyErr & HAL_ANI_ENA) - break; - /* Enable MIB Counters */ - enableAniMIBCounters(ah, ahp->ah_curani != AH_NULL ? - ahp->ah_curani->params: &ahp->ah_aniParams24 /*XXX*/); - ahp->ah_procPhyErr |= HAL_ANI_ENA; - } - break; #ifdef AH_PRIVATE_DIAG case HAL_ANI_PHYERR_RESET: ahp->ah_stats.ast_ani_ofdmerrs = 0; @@ -548,8 +568,21 @@ ar5416AniReset(struct ath_hal *ah, const /* * Turn off PHY error frame delivery while we futz with settings. */ - rxfilter = ar5212GetRxFilter(ah); - ar5212SetRxFilter(ah, rxfilter &~ HAL_RX_FILTER_PHYERR); + rxfilter = ah->ah_getRxFilter(ah); + ah->ah_setRxFilter(ah, rxfilter &~ HAL_RX_FILTER_PHYERR); + + /* + * If ANI is disabled at this point, don't set the default + * ANI parameter settings - leave the HAL settings there. + * This is (currently) needed for reliable radar detection. + */ + if (! ANI_ENA(ah)) { + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ANI disabled\n", + __func__); + goto finish; + } + + /* * Automatic processing is done only in station mode right now. */ @@ -583,10 +616,16 @@ ar5416AniReset(struct ath_hal *ah, const ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, 0); ichan->privFlags |= CHANNEL_ANI_SETUP; } + + /* + * In case the counters haven't yet been setup; set them up. + */ + enableAniMIBCounters(ah, aniState->params); ar5416AniRestart(ah, aniState); +finish: /* restore RX filter mask */ - ar5212SetRxFilter(ah, rxfilter); + ah->ah_setRxFilter(ah, rxfilter); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:31:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 040851065670; Sat, 30 Jul 2011 13:31:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E70648FC1B; Sat, 30 Jul 2011 13:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDVRkl001907; Sat, 30 Jul 2011 13:31:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDVRJ5001905; Sat, 30 Jul 2011 13:31:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301331.p6UDVRJ5001905@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224515 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:31:28 -0000 Author: adrian Date: Sat Jul 30 13:31:27 2011 New Revision: 224515 URL: http://svn.freebsd.org/changeset/base/224515 Log: Fix the initial calibration sample count when doing ADC calibrations. Obtained from: Atheros Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat Jul 30 13:30:24 2011 (r224514) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat Jul 30 13:31:27 2011 (r224515) @@ -42,14 +42,14 @@ static const HAL_PERCAL_DATA ar9280_iq_c static const HAL_PERCAL_DATA ar9280_adc_gain_cal = { /* single sample */ .calName = "ADC Gain", .calType = ADC_GAIN_CAL, .calNumSamples = MIN_CAL_SAMPLES, - .calCountMax = PER_MIN_LOG_COUNT, + .calCountMax = PER_MAX_LOG_COUNT, .calCollect = ar5416AdcGainCalCollect, .calPostProc = ar5416AdcGainCalibration }; static const HAL_PERCAL_DATA ar9280_adc_dc_cal = { /* single sample */ .calName = "ADC DC", .calType = ADC_DC_CAL, .calNumSamples = MIN_CAL_SAMPLES, - .calCountMax = PER_MIN_LOG_COUNT, + .calCountMax = PER_MAX_LOG_COUNT, .calCollect = ar5416AdcDcCalCollect, .calPostProc = ar5416AdcDcCalibration }; From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:33:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B252B106566C; Sat, 30 Jul 2011 13:33:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A208FC13; Sat, 30 Jul 2011 13:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDX5wm002001; Sat, 30 Jul 2011 13:33:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDX5ca001997; Sat, 30 Jul 2011 13:33:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107301333.p6UDX5ca001997@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 30 Jul 2011 13:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224516 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:33:05 -0000 Author: bz Date: Sat Jul 30 13:33:05 2011 New Revision: 224516 URL: http://svn.freebsd.org/changeset/base/224516 Log: Introduce a tunable to disable the time consuming parts of bootup memtesting, which can easily save seconds to minutes of boot time. The tunable name is kept general to allow reusing the code in alternate frameworks. Requested by: many Discussed on: arch (a while a go) Obtained from: Sandvine Incorporated Reviewed by: sbruno Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Jul 30 13:31:27 2011 (r224515) +++ head/sys/amd64/amd64/machdep.c Sat Jul 30 13:33:05 2011 (r224516) @@ -1309,7 +1309,7 @@ getmemsize(caddr_t kmdp, u_int64_t first { int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; pt_entry_t *pte; struct bios_smap *smapbase, *smap, *smapend; u_int32_t smapsize; @@ -1372,6 +1372,14 @@ getmemsize(caddr_t kmdp, u_int64_t first Maxmem = atop(physmem_tunable); /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + + /* * Don't allow MAXMEM or hw.physmem to extend the amount of memory * in the system. */ @@ -1433,6 +1441,8 @@ getmemsize(caddr_t kmdp, u_int64_t first goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -1470,6 +1480,7 @@ getmemsize(caddr_t kmdp, u_int64_t first */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Jul 30 13:31:27 2011 (r224515) +++ head/sys/i386/i386/machdep.c Sat Jul 30 13:33:05 2011 (r224516) @@ -2132,7 +2132,7 @@ static void getmemsize(int first) { int has_smap, off, physmap_idx, pa_indx, da_indx; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -2339,6 +2339,14 @@ physmap_done: if (has_smap && Maxmem > atop(physmap[physmap_idx + 1])) Maxmem = atop(physmap[physmap_idx + 1]); + /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) printf("Physical memory use set to %ldK\n", Maxmem * 4); @@ -2402,6 +2410,8 @@ physmap_done: goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -2439,6 +2449,7 @@ physmap_done: */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Jul 30 13:31:27 2011 (r224515) +++ head/sys/pc98/pc98/machdep.c Sat Jul 30 13:33:05 2011 (r224516) @@ -1855,7 +1855,7 @@ static void getmemsize(int first) { int off, physmap_idx, pa_indx, da_indx; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -1915,6 +1915,14 @@ getmemsize(int first) if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable)) Maxmem = atop(physmem_tunable); + /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) printf("Physical memory use set to %ldK\n", Maxmem * 4); @@ -1991,6 +1999,8 @@ getmemsize(int first) goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -2028,6 +2038,7 @@ getmemsize(int first) */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:34:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44EDC106566B; Sat, 30 Jul 2011 13:34:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9EA8FC0C; Sat, 30 Jul 2011 13:34:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDYvYw002086; Sat, 30 Jul 2011 13:34:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDYvZG002084; Sat, 30 Jul 2011 13:34:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301334.p6UDYvZG002084@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224517 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:34:58 -0000 Author: adrian Date: Sat Jul 30 13:34:57 2011 New Revision: 224517 URL: http://svn.freebsd.org/changeset/base/224517 Log: Fix AR5416 radar parameter initialisation. * I messed up the order of parameter true/false; oops! * AR_PHY_RADAR_1 was being written at the wrong place, and was writing potential garbage to the hardware. Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Jul 30 13:33:05 2011 (r224516) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Jul 30 13:34:57 2011 (r224517) @@ -670,26 +670,27 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); - if (pe->pe_usefir128 == 0) - OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); - else if (pe->pe_usefir128 == 1) + if (pe->pe_usefir128 == 1) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); + else if (pe->pe_usefir128 == 0) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); - if (pe->pe_enmaxrssi == 0) + if (pe->pe_enmaxrssi == 1) OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI); - else if (pe->pe_enmaxrssi == 1) + else if (pe->pe_enmaxrssi == 0) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI); - if (pe->pe_blockradar == 0) + if (pe->pe_blockradar == 1) OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK); - else if (pe->pe_blockradar == 1) + else if (pe->pe_blockradar == 0) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK); if (pe->pe_maxlen != HAL_PHYERR_PARAM_NOVAL) { + val = OS_REG_READ(ah, AR_PHY_RADAR_1); val &= ~AR_PHY_RADAR_1_MAXLEN; val |= SM(pe->pe_maxlen, AR_PHY_RADAR_1_MAXLEN); + OS_REG_WRITE(ah, AR_PHY_RADAR_1, val); } - OS_REG_WRITE(ah, AR_PHY_RADAR_1, val); /* * Enable HT/40 if the upper layer asks; From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:37:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C85CD106564A; Sat, 30 Jul 2011 13:37:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B73398FC0C; Sat, 30 Jul 2011 13:37:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDbcU6002198; Sat, 30 Jul 2011 13:37:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDbcM3002195; Sat, 30 Jul 2011 13:37:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301337.p6UDbcM3002195@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224518 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:37:39 -0000 Author: adrian Date: Sat Jul 30 13:37:38 2011 New Revision: 224518 URL: http://svn.freebsd.org/changeset/base/224518 Log: Prepare for embedded use of the AR9285/AR9287. Calibration/PCI data that's written to flash (rather than EEPROM attached to the NIC) is typically already in host-endian. The existing checks end up swapping 16 bit words incorrectly - the correct solution would be to read the magic value and determine the EEPROM endianness from that. (This is what Linux does.) This doesn't completely enable embedded use of the AR9285/AR9287 - notably, the EEPROM read methods need to be made generic and available to all EEPROM drivers. I'll worry about that later. Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sat Jul 30 13:34:57 2011 (r224517) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sat Jul 30 13:37:38 2011 (r224518) @@ -298,11 +298,18 @@ ath_hal_9287EepromAttach(struct ath_hal uint32_t sum; HALASSERT(ee == AH_NULL); - - if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { - HALDEBUG(ah, HAL_DEBUG_ANY, - "%s Error reading Eeprom MAGIC\n", __func__); - return HAL_EEREAD; + + /* + * Don't check magic if we're supplied with an EEPROM block, + * typically this is from Howl but it may also be from later + * boards w/ an embedded WMAC. + */ + if (ah->ah_eepromdata == NULL) { + if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s Error reading Eeprom MAGIC\n", __func__); + return HAL_EEREAD; + } } HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", __func__, magic); @@ -328,7 +335,11 @@ ath_hal_9287EepromAttach(struct ath_hal } } /* Convert to eeprom native eeprom endian format */ - if (isBigEndian()) { + /* + * XXX this is likely incorrect but will do for now + * XXX to get embedded boards working. + */ + if (ah->ah_eepromdata == NULL && isBigEndian()) { for (w = 0; w < NW(HAL_EEPROM_9287); w++) eep_data[w] = __bswap16(eep_data[w]); } Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Sat Jul 30 13:34:57 2011 (r224517) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Sat Jul 30 13:37:38 2011 (r224518) @@ -288,11 +288,17 @@ ath_hal_v4kEepromAttach(struct ath_hal * uint32_t sum; HALASSERT(ee == AH_NULL); - - if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { - HALDEBUG(ah, HAL_DEBUG_ANY, - "%s Error reading Eeprom MAGIC\n", __func__); - return HAL_EEREAD; + /* + * Don't check magic if we're supplied with an EEPROM block, + * typically this is from Howl but it may also be from later + * boards w/ an embedded WMAC. + */ + if (ah->ah_eepromdata == NULL) { + if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s Error reading Eeprom MAGIC\n", __func__); + return HAL_EEREAD; + } } HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", __func__, magic); @@ -318,7 +324,11 @@ ath_hal_v4kEepromAttach(struct ath_hal * } } /* Convert to eeprom native eeprom endian format */ - if (isBigEndian()) { + /* + * XXX this is likely incorrect but will do for now + * XXX to get embedded boards working. + */ + if (ah->ah_eepromdata == NULL && isBigEndian()) { for (w = 0; w < NW(struct ar5416eeprom_4k); w++) eep_data[w] = __bswap16(eep_data[w]); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:45:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D41A106566B; Sat, 30 Jul 2011 13:45:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 291928FC16; Sat, 30 Jul 2011 13:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDjCXb002466; Sat, 30 Jul 2011 13:45:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDjCOr002461; Sat, 30 Jul 2011 13:45:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301345.p6UDjCOr002461@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224519 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:45:13 -0000 Author: adrian Date: Sat Jul 30 13:45:12 2011 New Revision: 224519 URL: http://svn.freebsd.org/changeset/base/224519 Log: Introduce the FRAC_5G EEPROM parameter. This seems to indicate whether to program the NIC for fractional 5ghz mode (ie, 5mhz spaced channels, rather than 10 or 20mhz spacing) or not. The default (0) seems to mean "only program fractional mode if needed". A different value (eg 1) seems to always enable fractional 5ghz mode regardless of the frequency. Obtained from: Atheros Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h head/sys/dev/ath/ath_hal/ah_eeprom_v14.c head/sys/dev/ath/ath_hal/ah_eeprom_v14.h head/sys/dev/ath/ath_hal/ar9002/ar9280.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Sat Jul 30 13:37:38 2011 (r224518) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Sat Jul 30 13:45:12 2011 (r224519) @@ -104,6 +104,7 @@ enum { AR_EEP_PWDCLKIND, /* uint8_t* */ AR_EEP_TEMPSENSE_SLOPE, /* int8_t* */ AR_EEP_TEMPSENSE_SLOPE_PAL_ON, /* int8_t* */ + AR_EEP_FRAC_N_5G, /* uint8_t* */ }; typedef struct { Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat Jul 30 13:37:38 2011 (r224518) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat Jul 30 13:45:12 2011 (r224519) @@ -97,6 +97,12 @@ v14EepromGet(struct ath_hal *ah, int par return HAL_OK; } else return HAL_EIO; + case AR_EEP_FRAC_N_5G: + if (IS_VERS(>=, AR5416_EEP_MINOR_VER_22)) { + *(uint8_t *) val = pBase->frac_n_5g; + } else + *(uint8_t *) val = 0; + return HAL_OK; case AR_EEP_AMODE: HALASSERT(val == AH_NULL); return pBase->opCapFlags & AR5416_OPFLAGS_11A ? Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Sat Jul 30 13:37:38 2011 (r224518) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Sat Jul 30 13:45:12 2011 (r224519) @@ -187,7 +187,10 @@ typedef struct BaseEepHeader { uint8_t rcChainMask; /* "1" if the card is an HB93 1x2 */ uint8_t desiredScaleCCK; uint8_t pwr_table_offset; - uint8_t frac_n_5g; + uint8_t frac_n_5g; /* + * bit 0: indicates that fracN synth + * mode applies to all 5G channels + */ uint8_t futureBase[21]; } __packed BASE_EEP_HEADER; // 64 B Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280.c Sat Jul 30 13:37:38 2011 (r224518) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.c Sat Jul 30 13:45:12 2011 (r224519) @@ -76,6 +76,7 @@ ar9280SetChannel(struct ath_hal *ah, con uint32_t freq, ndiv, channelSel = 0, channelFrac = 0, reg32 = 0; CHAN_CENTERS centers; uint32_t refDivA = 24; + uint8_t frac_n_5g; OS_MARK(ah, AH_MARK_SETCHANNEL, chan->ic_freq); @@ -85,6 +86,9 @@ ar9280SetChannel(struct ath_hal *ah, con reg32 = OS_REG_READ(ah, AR_PHY_SYNTH_CONTROL); reg32 &= 0xc0000000; + if (ath_hal_eepromGet(ah, AR_EEP_FRAC_N_5G, &frac_n_5g) != HAL_OK) + frac_n_5g = 0; + if (freq < 4800) { /* 2 GHz, fractional mode */ uint32_t txctl; @@ -106,11 +110,16 @@ ar9280SetChannel(struct ath_hal *ah, con bMode = 0; fracMode = 0; - if ((freq % 20) == 0) { - aModeRefSel = 3; - } else if ((freq % 10) == 0) { - aModeRefSel = 2; - } else { + switch (frac_n_5g) { + case 0: + if ((freq % 20) == 0) { + aModeRefSel = 3; + } else if ((freq % 10) == 0) { + aModeRefSel = 2; + } + if (aModeRefSel) break; + case 1: + default: aModeRefSel = 0; /* Enable 2G (fractional) mode for channels which are 5MHz spaced */ fracMode = 1; @@ -121,6 +130,7 @@ ar9280SetChannel(struct ath_hal *ah, con OS_A_REG_RMW_FIELD(ah, AR_AN_SYNTH9, AR_AN_SYNTH9_REFDIVA, refDivA); } + if (!fracMode) { ndiv = (freq * (refDivA >> aModeRefSel))/60; channelSel = ndiv & 0x1ff; From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 13:46:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0303C1065673; Sat, 30 Jul 2011 13:46:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E61DF8FC15; Sat, 30 Jul 2011 13:46:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UDkfxC002549; Sat, 30 Jul 2011 13:46:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UDkfsq002547; Sat, 30 Jul 2011 13:46:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107301346.p6UDkfsq002547@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jul 2011 13:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224520 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 13:46:42 -0000 Author: adrian Date: Sat Jul 30 13:46:41 2011 New Revision: 224520 URL: http://svn.freebsd.org/changeset/base/224520 Log: Fix incorrect error reporting during the dfs ioctl function. Approved by: re (kib) Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Sat Jul 30 13:45:12 2011 (r224519) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Sat Jul 30 13:46:41 2011 (r224520) @@ -189,7 +189,7 @@ ath_ioctl_phyerr(struct ath_softc *sc, s switch (id) { case DFS_SET_THRESH: if (insize < sizeof(HAL_PHYERR_PARAM)) { - error = -EINVAL; + error = EINVAL; break; } pe = (HAL_PHYERR_PARAM *) indata; @@ -203,12 +203,12 @@ ath_ioctl_phyerr(struct ath_softc *sc, s memcpy(pe, &peout, sizeof(*pe)); break; default: - error = -EINVAL; + error = EINVAL; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; if (outdata && copyout(outdata, ad->ad_out_data, ad->ad_out_size)) - error = -EFAULT; + error = EFAULT; bad: if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL) free(indata, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 14:12:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AACCD106566C; Sat, 30 Jul 2011 14:12:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A1DF8FC13; Sat, 30 Jul 2011 14:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UECblV003299; Sat, 30 Jul 2011 14:12:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UECbXe003297; Sat, 30 Jul 2011 14:12:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107301412.p6UECbXe003297@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jul 2011 14:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224521 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 14:12:37 -0000 Author: kib Date: Sat Jul 30 14:12:37 2011 New Revision: 224521 URL: http://svn.freebsd.org/changeset/base/224521 Log: Fix the devmtx lock leak from make_dev(9) when the old device cloning failed due to invalid or duplicated path being generated. Reviewed by: jh Approved by: re (kensmith) MFC after: 1 week Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Jul 30 13:46:41 2011 (r224520) +++ head/sys/kern/kern_conf.c Sat Jul 30 14:12:37 2011 (r224521) @@ -764,7 +764,8 @@ make_dev_credv(int flags, struct cdev ** LIST_REMOVE(dev, si_list); dev_unlock(); devfs_free(dev); - } + } else + dev_unlock(); return (res); } } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 14:13:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E281106564A; Sat, 30 Jul 2011 14:13:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D62A8FC0A; Sat, 30 Jul 2011 14:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UEDwKc003372; Sat, 30 Jul 2011 14:13:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UEDwtd003370; Sat, 30 Jul 2011 14:13:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107301413.p6UEDwtd003370@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jul 2011 14:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224522 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 14:13:58 -0000 Author: kib Date: Sat Jul 30 14:13:57 2011 New Revision: 224522 URL: http://svn.freebsd.org/changeset/base/224522 Log: Fix a race in the device pager allocation. If another thread won and allocated the device pager for the given handle, then the object fictitious pages list and the object membership in the global object list still need to be initialized. Otherwise, dev_pager_dealloc() will traverse uninitialized pointers. Reported and tested by: pho Reviewed by: jhb Approved by: re (kensmith) MFC after: 1 week Modified: head/sys/vm/device_pager.c Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Sat Jul 30 14:12:37 2011 (r224521) +++ head/sys/vm/device_pager.c Sat Jul 30 14:13:57 2011 (r224522) @@ -147,6 +147,7 @@ dev_pager_alloc(void *handle, vm_ooffset object1 = vm_object_allocate(OBJT_DEVICE, pindex); object1->flags |= OBJ_COLORED; object1->pg_color = atop(paddr) - OFF_TO_IDX(off - PAGE_SIZE); + TAILQ_INIT(&object1->un_pager.devp.devp_pglist); mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); if (object != NULL) { @@ -159,7 +160,6 @@ dev_pager_alloc(void *handle, vm_ooffset object = object1; object1 = NULL; object->handle = handle; - TAILQ_INIT(&object->un_pager.devp.devp_pglist); TAILQ_INSERT_TAIL(&dev_pager_object_list, object, pager_object_list); } @@ -169,7 +169,14 @@ dev_pager_alloc(void *handle, vm_ooffset } mtx_unlock(&dev_pager_mtx); dev_relthread(dev, ref); - vm_object_deallocate(object1); + if (object1 != NULL) { + object1->handle = object1; + mtx_lock(&dev_pager_mtx); + TAILQ_INSERT_TAIL(&dev_pager_object_list, object1, + pager_object_list); + mtx_unlock(&dev_pager_mtx); + vm_object_deallocate(object1); + } return (object); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 14:42:41 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB011065672; Sat, 30 Jul 2011 14:42:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9008B8FC0C; Sat, 30 Jul 2011 14:42:41 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d9fd:71cc:37a8:cf48] (unknown [IPv6:2001:7b8:3a7:0:d9fd:71cc:37a8:cf48]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E40615C37; Sat, 30 Jul 2011 16:42:39 +0200 (CEST) Message-ID: <4E341862.9000805@FreeBSD.org> Date: Sat, 30 Jul 2011 16:42:42 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Andriy Gapon References: <201107290958.p6T9wum1042480@svn.freebsd.org> <4E332CF8.6080002@FreeBSD.org> In-Reply-To: <4E332CF8.6080002@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 14:42:41 -0000 On 2011-07-29 23:58, Andriy Gapon wrote: > Picking a random stable/8 sys commit: > > on 29/07/2011 12:58 Alexander Motin said the following: >> Modified: >> stable/8/sys/dev/ata/ata-pci.c >> stable/8/sys/dev/ata/ata-pci.h >> stable/8/sys/dev/ata/chipsets/ata-acard.c >> stable/8/sys/dev/ata/chipsets/ata-acerlabs.c >> stable/8/sys/dev/ata/chipsets/ata-intel.c >> stable/8/sys/dev/ata/chipsets/ata-promise.c >> Directory Properties: >> stable/8/sys/ (props changed) >> stable/8/sys/amd64/include/xen/ (props changed) >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >> stable/8/sys/contrib/dev/acpica/ (props changed) >> stable/8/sys/contrib/pf/ (props changed) >> stable/8/sys/geom/label/ (props changed) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Why do we have this now? Because the merging instructions say: "Changes to kernel code should be merged to sys. For instance, a change to the ichwd(4) driver should be merged to sys, not sys/dev/ichwd. Likewise, a change to the TCP/IP stack should be merged to sys, not sys/netinet." So any merge from head to stable/x will also update the directories that already have svn:mergeinfo properties, namely those listed above. From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 16:37:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C322F1065673; Sat, 30 Jul 2011 16:37:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6418FC15; Sat, 30 Jul 2011 16:37:27 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p6UGbNXV060606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 30 Jul 2011 19:37:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p6UGbNXK026978; Sat, 30 Jul 2011 19:37:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p6UGbNGf026977; Sat, 30 Jul 2011 19:37:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 30 Jul 2011 19:37:23 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20110730163723.GZ17489@deviant.kiev.zoral.com.ua> References: <201107292030.p6TKUSaf064895@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lzwOWbZ6TxNmVMlX" Content-Disposition: inline In-Reply-To: <201107292030.p6TKUSaf064895@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224496 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 16:37:28 -0000 --lzwOWbZ6TxNmVMlX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 29, 2011 at 08:30:28PM +0000, Alexander Motin wrote: > Author: mav > Date: Fri Jul 29 20:30:28 2011 > New Revision: 224496 > URL: http://svn.freebsd.org/changeset/base/224496 >=20 > Log: > In some cases failed SATA disks may report their presence, but don't > respond to any commands. I've found that because of multiple command > retries, each of which cause 30s timeout, bus reset and another retry or > requeue for many commands, it may take ages to eventually drop the > failed device. The odd thing is that those retries continue even after > XPT considered device as dead and invalidated it. > =20 > This patch makes cam_periph_error() to block any command retries after > periph was marked as invalid. With that patch all activity completes in > 1-2 minutes, just after several timeouts, required to consider device > death. This should make ZFS, gmirror, graid, etc. operation more robust. > =20 > Reviewed by: mjacob@ on scsi@ > =20 > Approved by: re (kib) >=20 > Modified: > head/sys/cam/cam_periph.c Amusingly, this commit makes my test machine to not boot. This is Ibex Peak PCH, with two SATA disks on the channels 0 and 1. It seems that geom thread 100012 owns GEOM topology lock, while sleeping in adaclose->cam_periph_getccb() : db> bt 100012 Tracing pid 12 tid 100012 td 0xfffffe00028a2000 sched_switch() at 0xffffffff8034a0c7 =3D sched_switch+0x157 mi_switch() at 0xffffffff803291fb =3D mi_switch+0x2eb sleepq_switch() at 0xffffffff803631f3 =3D sleepq_switch+0x123 sleepq_wait() at 0xffffffff80363eed =3D sleepq_wait+0x4d _sleep() at 0xffffffff80329b59 =3D _sleep+0x3b9 cam_periph_getccb() at 0xffffffff817ffc50 =3D cam_periph_getccb+0xa0 adaclose() at 0xffffffff8182c484 =3D adaclose+0xc4 g_disk_access() at 0xffffffff802bea74 =3D g_disk_access+0x1e4 g_access() at 0xffffffff802c519a =3D g_access+0x1ba g_dev_attrchanged() at 0xffffffff802bd1f6 =3D g_dev_attrchanged+0x96 g_dev_taste() at 0xffffffff802bd574 =3D g_dev_taste+0x284 g_new_provider_event() at 0xffffffff802c4ecd =3D g_new_provider_event+0xad g_run_events() at 0xffffffff802c0750 =3D g_run_events+0x250 fork_exit() at 0xffffffff802f0d99 =3D fork_exit+0x189 fork_trampoline() at 0xffffffff804ee3be =3D fork_trampoline+0xe --- trap 0, rip =3D 0, rsp =3D 0xffffff800025fd00, rbp =3D 0 --- (gdb) list *cam_periph_getccb+0xa0 0x1c50 is in cam_periph_getccb (/usr/home/kostik/work/build/bsd/DEV/src/sys= /modules/cam/../../cam/cam_periph.c:883). 882 883 while (SLIST_FIRST(&periph->ccb_list) =3D=3D NULL) { 884 if (periph->immediate_priority > priority) Reverting the rev. or not loading ahci.ko allows machine to boot. --lzwOWbZ6TxNmVMlX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk40M0MACgkQC3+MBN1Mb4hnowCfbdZicpeUrXDM+DM/ZVC38XNf 0EIAoIqCgEzxKP0tz9QkLpKKr4Y+/zBk =C6T3 -----END PGP SIGNATURE----- --lzwOWbZ6TxNmVMlX-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 17:26:05 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91547106566C; Sat, 30 Jul 2011 17:26:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0F31A8FC08; Sat, 30 Jul 2011 17:26:03 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA28655; Sat, 30 Jul 2011 20:26:02 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QnDIY-0008Gw-0I; Sat, 30 Jul 2011 20:26:02 +0300 Message-ID: <4E343EA8.6010609@FreeBSD.org> Date: Sat, 30 Jul 2011 20:26:00 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Dimitry Andric References: <201107290958.p6T9wum1042480@svn.freebsd.org> <4E332CF8.6080002@FreeBSD.org> <4E341862.9000805@FreeBSD.org> In-Reply-To: <4E341862.9000805@FreeBSD.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 17:26:05 -0000 on 30/07/2011 17:42 Dimitry Andric said the following: > On 2011-07-29 23:58, Andriy Gapon wrote: >> Picking a random stable/8 sys commit: >> >> on 29/07/2011 12:58 Alexander Motin said the following: >>> Modified: >>> stable/8/sys/dev/ata/ata-pci.c >>> stable/8/sys/dev/ata/ata-pci.h >>> stable/8/sys/dev/ata/chipsets/ata-acard.c >>> stable/8/sys/dev/ata/chipsets/ata-acerlabs.c >>> stable/8/sys/dev/ata/chipsets/ata-intel.c >>> stable/8/sys/dev/ata/chipsets/ata-promise.c >>> Directory Properties: >>> stable/8/sys/ (props changed) >>> stable/8/sys/amd64/include/xen/ (props changed) >>> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >>> stable/8/sys/contrib/dev/acpica/ (props changed) >>> stable/8/sys/contrib/pf/ (props changed) >>> stable/8/sys/geom/label/ (props changed) >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> Why do we have this now? > > Because the merging instructions say: > > "Changes to kernel code should be merged to sys. For instance, a change > to the ichwd(4) driver should be merged to sys, not sys/dev/ichwd. > Likewise, a change to the TCP/IP stack should be merged to sys, not > sys/netinet." > > So any merge from head to stable/x will also update the directories that > already have svn:mergeinfo properties, namely those listed above. Maybe my question was not clear enough, so I'll ask it differently. Why do we have mergeinfo on stable/8/sys/geom/label now? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 17:27:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 921E6106566B; Sat, 30 Jul 2011 17:27:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81B968FC18; Sat, 30 Jul 2011 17:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UHRTuX008858; Sat, 30 Jul 2011 17:27:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UHRTBr008855; Sat, 30 Jul 2011 17:27:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107301727.p6UHRTBr008855@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jul 2011 17:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224523 - head/contrib/gcc/cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 17:27:29 -0000 Author: mm Date: Sat Jul 30 17:27:29 2011 New Revision: 224523 URL: http://svn.freebsd.org/changeset/base/224523 Log: Fix invalid assertion of C++ external static data member declarations as anonymous namespaces are local to the current translation. GCC PR: c++/33094 Reviewed by: uqs Approved by: re (kib) Obtained from: gcc (branches/redhat/gcc-4_1-branch, rev. 129554, GPLv2) MFC after: 1 week Modified: head/contrib/gcc/cp/ChangeLog head/contrib/gcc/cp/decl.c Modified: head/contrib/gcc/cp/ChangeLog ============================================================================== --- head/contrib/gcc/cp/ChangeLog Sat Jul 30 14:13:57 2011 (r224522) +++ head/contrib/gcc/cp/ChangeLog Sat Jul 30 17:27:29 2011 (r224523) @@ -1,3 +1,9 @@ +2007-09-29 Jason Merrill + + PR c++/33094 + * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member + constant to not have DECL_EXTERNAL if it's file-local. + 2007-08-24 Jakub Jelinek PR c++/31941 Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Sat Jul 30 14:13:57 2011 (r224522) +++ head/contrib/gcc/cp/decl.c Sat Jul 30 17:27:29 2011 (r224523) @@ -4968,7 +4968,7 @@ make_rtl_for_nonlocal_decl (tree decl, t /* An in-class declaration of a static data member should be external; it is only a declaration, and not a definition. */ if (init == NULL_TREE) - gcc_assert (DECL_EXTERNAL (decl)); + gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)); } /* We don't create any RTL for local variables. */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 17:40:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E402106564A; Sat, 30 Jul 2011 17:40:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E04F8FC0C; Sat, 30 Jul 2011 17:40:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UHeB48009250; Sat, 30 Jul 2011 17:40:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UHeBax009248; Sat, 30 Jul 2011 17:40:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107301740.p6UHeBax009248@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jul 2011 17:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224524 - head/contrib/gcc/cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 17:40:12 -0000 Author: mm Date: Sat Jul 30 17:40:11 2011 New Revision: 224524 URL: http://svn.freebsd.org/changeset/base/224524 Log: Fix accidential dos-style endings to unix-style line endings from last commit (r224523) to match the version approved by re@ Approved by: re (implicit) Modified: head/contrib/gcc/cp/ChangeLog Modified: head/contrib/gcc/cp/ChangeLog ============================================================================== --- head/contrib/gcc/cp/ChangeLog Sat Jul 30 17:27:29 2011 (r224523) +++ head/contrib/gcc/cp/ChangeLog Sat Jul 30 17:40:11 2011 (r224524) @@ -1,9 +1,9 @@ -2007-09-29 Jason Merrill - - PR c++/33094 - * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member - constant to not have DECL_EXTERNAL if it's file-local. - +2007-09-29 Jason Merrill + + PR c++/33094 + * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member + constant to not have DECL_EXTERNAL if it's file-local. + 2007-08-24 Jakub Jelinek PR c++/31941 From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 17:44:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31344106566C; Sat, 30 Jul 2011 17:44:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2069F8FC13; Sat, 30 Jul 2011 17:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UHi6eq009409; Sat, 30 Jul 2011 17:44:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UHi6s3009407; Sat, 30 Jul 2011 17:44:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107301744.p6UHi6s3009407@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jul 2011 17:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224525 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 17:44:07 -0000 Author: mm Date: Sat Jul 30 17:44:06 2011 New Revision: 224525 URL: http://svn.freebsd.org/changeset/base/224525 Log: Fix wrong initialization of "cmd" for calling the jail/unjail ioctl. Reviewed by: pjd@, delphij@ Approved by: re (kib) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Jul 30 17:40:11 2011 (r224524) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Jul 30 17:44:06 2011 (r224525) @@ -4289,7 +4289,8 @@ zfs_jail(zfs_handle_t *zhp, int jailid, libzfs_handle_t *hdl = zhp->zfs_hdl; zfs_cmd_t zc = { 0 }; char errbuf[1024]; - int cmd, ret; + unsigned long cmd; + int ret; if (attach) { (void) snprintf(errbuf, sizeof (errbuf), From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 18:58:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39FDF106566B; Sat, 30 Jul 2011 18:58:18 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4F59F8FC12; Sat, 30 Jul 2011 18:58:16 +0000 (UTC) Received: by ewy1 with SMTP id 1so3438931ewy.13 for ; Sat, 30 Jul 2011 11:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AY0Y1XojJCoo4pVay1UJT4IiYbM0Qj1f1VXhWkBmzEQ=; b=KVZ84Wt7ha+LxblbciKea+zwgQovRIXIJiaUhMWrS1KkI6BImGjAGnzr1EAaAzNmOl wj1hkppOY0+hClGNK0v/cqdzNOKqjWflF9sTy8mmnXU7Xq2Cq8mId5vhSWJUjolEbqBQ 0eEbJLn1XuBvG7pFn3oy/zxs75F/RNdCJylrc= MIME-Version: 1.0 Received: by 10.213.13.19 with SMTP id z19mr1110980ebz.107.1312052295003; Sat, 30 Jul 2011 11:58:15 -0700 (PDT) Received: by 10.213.31.194 with HTTP; Sat, 30 Jul 2011 11:58:14 -0700 (PDT) In-Reply-To: <4E343EA8.6010609@FreeBSD.org> References: <201107290958.p6T9wum1042480@svn.freebsd.org> <4E332CF8.6080002@FreeBSD.org> <4E341862.9000805@FreeBSD.org> <4E343EA8.6010609@FreeBSD.org> Date: Sat, 30 Jul 2011 14:58:14 -0400 Message-ID: From: Ryan Stone To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: sobomax@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224490 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 18:58:18 -0000 On Sat, Jul 30, 2011 at 1:26 PM, Andriy Gapon wrote: > Maybe my question was not clear enough, so I'll ask it differently. > Why do we have mergeinfo on stable/8/sys/geom/label now? Looks like r224301 was improperly merged. http://svn.freebsd.org/changeset/base/224301 From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 19:00:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961B4106566B; Sat, 30 Jul 2011 19:00:31 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 848858FC0A; Sat, 30 Jul 2011 19:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UJ0VTU011579; Sat, 30 Jul 2011 19:00:31 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UJ0VDw011576; Sat, 30 Jul 2011 19:00:31 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107301900.p6UJ0VDw011576@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jul 2011 19:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224526 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 19:00:31 -0000 Author: mm Date: Sat Jul 30 19:00:31 2011 New Revision: 224526 URL: http://svn.freebsd.org/changeset/base/224526 Log: Fix serious bug in ZIL that can lead to pool corruption in the case of a held dataset during remount. Detailed description is available at: https://www.illumos.org/issues/883 illumos-gate revision: 13380:161b964a0e10 Reviewed by: pjd Approved by: re (kib) Obtained from: Illumos (Bug #883) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Jul 30 17:44:06 2011 (r224525) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Jul 30 19:00:31 2011 (r224526) @@ -205,6 +205,7 @@ typedef struct ztest_od { */ typedef struct ztest_ds { objset_t *zd_os; + rwlock_t zd_zilog_lock; zilog_t *zd_zilog; uint64_t zd_seq; ztest_od_t *zd_od; /* debugging aid */ @@ -238,6 +239,7 @@ ztest_func_t ztest_dmu_commit_callbacks; ztest_func_t ztest_zap; ztest_func_t ztest_zap_parallel; ztest_func_t ztest_zil_commit; +ztest_func_t ztest_zil_remount; ztest_func_t ztest_dmu_read_write_zcopy; ztest_func_t ztest_dmu_objset_create_destroy; ztest_func_t ztest_dmu_prealloc; @@ -273,6 +275,7 @@ ztest_info_t ztest_info[] = { { ztest_zap_parallel, 100, &zopt_always }, { ztest_split_pool, 1, &zopt_always }, { ztest_zil_commit, 1, &zopt_incessant }, + { ztest_zil_remount, 1, &zopt_sometimes }, { ztest_dmu_read_write_zcopy, 1, &zopt_often }, { ztest_dmu_objset_create_destroy, 1, &zopt_often }, { ztest_dsl_prop_get_set, 1, &zopt_often }, @@ -986,6 +989,7 @@ ztest_zd_init(ztest_ds_t *zd, objset_t * zd->zd_seq = 0; dmu_objset_name(os, zd->zd_name); + VERIFY(rwlock_init(&zd->zd_zilog_lock, USYNC_THREAD, NULL) == 0); VERIFY(_mutex_init(&zd->zd_dirobj_lock, USYNC_THREAD, NULL) == 0); for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++) @@ -1965,6 +1969,8 @@ ztest_io(ztest_ds_t *zd, uint64_t object if (ztest_random(2) == 0) io_type = ZTEST_IO_WRITE_TAG; + (void) rw_rdlock(&zd->zd_zilog_lock); + switch (io_type) { case ZTEST_IO_WRITE_TAG: @@ -2000,6 +2006,8 @@ ztest_io(ztest_ds_t *zd, uint64_t object break; } + (void) rw_unlock(&zd->zd_zilog_lock); + umem_free(data, blocksize); } @@ -2054,6 +2062,8 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_ { zilog_t *zilog = zd->zd_zilog; + (void) rw_rdlock(&zd->zd_zilog_lock); + zil_commit(zilog, ztest_random(ZTEST_OBJECTS)); /* @@ -2065,6 +2075,31 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_ ASSERT(zd->zd_seq <= zilog->zl_commit_lr_seq); zd->zd_seq = zilog->zl_commit_lr_seq; mutex_exit(&zilog->zl_lock); + + (void) rw_unlock(&zd->zd_zilog_lock); +} + +/* + * This function is designed to simulate the operations that occur during a + * mount/unmount operation. We hold the dataset across these operations in an + * attempt to expose any implicit assumptions about ZIL management. + */ +/* ARGSUSED */ +void +ztest_zil_remount(ztest_ds_t *zd, uint64_t id) +{ + objset_t *os = zd->zd_os; + + (void) rw_wrlock(&zd->zd_zilog_lock); + + /* zfsvfs_teardown() */ + zil_close(zd->zd_zilog); + + /* zfsvfs_setup() */ + VERIFY(zil_open(os, ztest_get_data) == zd->zd_zilog); + zil_replay(os, zd, ztest_replay_vector); + + (void) rw_unlock(&zd->zd_zilog_lock); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Jul 30 17:44:06 2011 (r224525) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Jul 30 19:00:31 2011 (r224526) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -567,7 +568,7 @@ zil_destroy(zilog_t *zilog, boolean_t ke if (!list_is_empty(&zilog->zl_lwb_list)) { ASSERT(zh->zh_claim_txg == 0); - ASSERT(!keep_first); + VERIFY(!keep_first); while ((lwb = list_head(&zilog->zl_lwb_list)) != NULL) { list_remove(&zilog->zl_lwb_list, lwb); if (lwb->lwb_buf != NULL) @@ -1668,20 +1669,9 @@ zil_alloc(objset_t *os, zil_header_t *zh void zil_free(zilog_t *zilog) { - lwb_t *head_lwb; - zilog->zl_stop_sync = 1; - /* - * After zil_close() there should only be one lwb with a buffer. - */ - head_lwb = list_head(&zilog->zl_lwb_list); - if (head_lwb) { - ASSERT(head_lwb == list_tail(&zilog->zl_lwb_list)); - list_remove(&zilog->zl_lwb_list, head_lwb); - zio_buf_free(head_lwb->lwb_buf, head_lwb->lwb_sz); - kmem_cache_free(zil_lwb_cache, head_lwb); - } + ASSERT(list_is_empty(&zilog->zl_lwb_list)); list_destroy(&zilog->zl_lwb_list); avl_destroy(&zilog->zl_vdev_tree); @@ -1721,6 +1711,10 @@ zil_open(objset_t *os, zil_get_data_t *g { zilog_t *zilog = dmu_objset_zil(os); + ASSERT(zilog->zl_clean_taskq == NULL); + ASSERT(zilog->zl_get_data == NULL); + ASSERT(list_is_empty(&zilog->zl_lwb_list)); + zilog->zl_get_data = get_data; zilog->zl_clean_taskq = taskq_create("zil_clean", 1, minclsyspri, 2, 2, TASKQ_PREPOPULATE); @@ -1734,7 +1728,7 @@ zil_open(objset_t *os, zil_get_data_t *g void zil_close(zilog_t *zilog) { - lwb_t *tail_lwb; + lwb_t *lwb; uint64_t txg = 0; zil_commit(zilog, 0); /* commit all itx */ @@ -1746,9 +1740,9 @@ zil_close(zilog_t *zilog) * destroy the zl_clean_taskq. */ mutex_enter(&zilog->zl_lock); - tail_lwb = list_tail(&zilog->zl_lwb_list); - if (tail_lwb != NULL) - txg = tail_lwb->lwb_max_txg; + lwb = list_tail(&zilog->zl_lwb_list); + if (lwb != NULL) + txg = lwb->lwb_max_txg; mutex_exit(&zilog->zl_lock); if (txg) txg_wait_synced(zilog->zl_dmu_pool, txg); @@ -1756,6 +1750,19 @@ zil_close(zilog_t *zilog) taskq_destroy(zilog->zl_clean_taskq); zilog->zl_clean_taskq = NULL; zilog->zl_get_data = NULL; + + /* + * We should have only one LWB left on the list; remove it now. + */ + mutex_enter(&zilog->zl_lock); + lwb = list_head(&zilog->zl_lwb_list); + if (lwb != NULL) { + ASSERT(lwb == list_tail(&zilog->zl_lwb_list)); + list_remove(&zilog->zl_lwb_list, lwb); + zio_buf_free(lwb->lwb_buf, lwb->lwb_sz); + kmem_cache_free(zil_lwb_cache, lwb); + } + mutex_exit(&zilog->zl_lock); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 20:01:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641FA106564A; Sat, 30 Jul 2011 20:01:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3A10A8FC0A; Sat, 30 Jul 2011 20:01:38 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DCCC546B1A; Sat, 30 Jul 2011 16:01:37 -0400 (EDT) Received: from [192.168.1.55] (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 630778A02C; Sat, 30 Jul 2011 16:01:37 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: John Baldwin In-Reply-To: <201107301333.p6UDX5ca001997@svn.freebsd.org> Date: Sat, 30 Jul 2011 16:01:36 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201107301333.p6UDX5ca001997@svn.freebsd.org> To: Bjoern A. Zeeb X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sat, 30 Jul 2011 16:01:37 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224516 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 20:01:38 -0000 On Jul 30, 2011, at 9:33 AM, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Jul 30 13:33:05 2011 > New Revision: 224516 > URL: http://svn.freebsd.org/changeset/base/224516 >=20 > Log: > Introduce a tunable to disable the time consuming parts of bootup > memtesting, which can easily save seconds to minutes of boot time. > The tunable name is kept general to allow reusing the code in > alternate frameworks. Why the 'tmpul' variable? The TUNABLE_*_FETCH() macros will not modify = the parameter if the environment variable is missing or unparseable. Lots of places = depend on this all over the kernel already, so you can depend on it here. --=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 20:29:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41A90106566B; Sat, 30 Jul 2011 20:29:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 327508FC16; Sat, 30 Jul 2011 20:29:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UKTebs014411; Sat, 30 Jul 2011 20:29:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UKTeGc014409; Sat, 30 Jul 2011 20:29:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107302029.p6UKTeGc014409@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jul 2011 20:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224527 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 20:29:40 -0000 Author: avg Date: Sat Jul 30 20:29:39 2011 New Revision: 224527 URL: http://svn.freebsd.org/changeset/base/224527 Log: smp_rendezvous: master cpu should wait until all slaves are fully done This is a followup to r222032 and a reimplementation of it. While that revision fixed the race for the smp_rv_waiters[2] exit sentinel, it still left a possibility for a target CPU to access stale or wrong smp_rv_func_arg in smp_rv_teardown_func. To fix this race the slave CPUs signal when they are really fully done with the rendezvous and the master CPU waits until all slaves are done. Diagnosed by: kib Reviewed by: jhb, mlaier, neel Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat Jul 30 19:00:31 2011 (r224526) +++ head/sys/kern/subr_smp.c Sat Jul 30 20:29:39 2011 (r224527) @@ -109,8 +109,7 @@ static void (*volatile smp_rv_setup_func static void (*volatile smp_rv_action_func)(void *arg); static void (*volatile smp_rv_teardown_func)(void *arg); static void *volatile smp_rv_func_arg; -static volatile int smp_rv_waiters[3]; -static volatile int smp_rv_generation; +static volatile int smp_rv_waiters[4]; /* * Shared mutex to restrict busywaits between smp_rendezvous() and @@ -321,7 +320,6 @@ smp_rendezvous_action(void) void (*local_setup_func)(void*); void (*local_action_func)(void*); void (*local_teardown_func)(void*); - int generation; #ifdef INVARIANTS int owepreempt; #endif @@ -336,7 +334,6 @@ smp_rendezvous_action(void) local_setup_func = smp_rv_setup_func; local_action_func = smp_rv_action_func; local_teardown_func = smp_rv_teardown_func; - generation = smp_rv_generation; /* * Use a nested critical section to prevent any preemptions @@ -382,32 +379,28 @@ smp_rendezvous_action(void) if (local_action_func != NULL) local_action_func(local_func_arg); - /* - * Signal that the main action has been completed. If a - * full exit rendezvous is requested, then all CPUs will - * wait here until all CPUs have finished the main action. - * - * Note that the write by the last CPU to finish the action - * may become visible to different CPUs at different times. - * As a result, the CPU that initiated the rendezvous may - * exit the rendezvous and drop the lock allowing another - * rendezvous to be initiated on the same CPU or a different - * CPU. In that case the exit sentinel may be cleared before - * all CPUs have noticed causing those CPUs to hang forever. - * Workaround this by using a generation count to notice when - * this race occurs and to exit the rendezvous in that case. - */ - MPASS(generation == smp_rv_generation); - atomic_add_int(&smp_rv_waiters[2], 1); if (local_teardown_func != smp_no_rendevous_barrier) { - while (smp_rv_waiters[2] < smp_rv_ncpus && - generation == smp_rv_generation) + /* + * Signal that the main action has been completed. If a + * full exit rendezvous is requested, then all CPUs will + * wait here until all CPUs have finished the main action. + */ + atomic_add_int(&smp_rv_waiters[2], 1); + while (smp_rv_waiters[2] < smp_rv_ncpus) cpu_spinwait(); if (local_teardown_func != NULL) local_teardown_func(local_func_arg); } + /* + * Signal that the rendezvous is fully completed by this CPU. + * This means that no member of smp_rv_* pseudo-structure will be + * accessed by this target CPU after this point; in particular, + * memory pointed by smp_rv_func_arg. + */ + atomic_add_int(&smp_rv_waiters[3], 1); + td->td_critnest--; KASSERT(owepreempt == td->td_owepreempt, ("rendezvous action changed td_owepreempt")); @@ -441,8 +434,6 @@ smp_rendezvous_cpus(cpuset_t map, mtx_lock_spin(&smp_ipi_mtx); - atomic_add_acq_int(&smp_rv_generation, 1); - /* Pass rendezvous parameters via global variables. */ smp_rv_ncpus = ncpus; smp_rv_setup_func = setup_func; @@ -451,6 +442,7 @@ smp_rendezvous_cpus(cpuset_t map, smp_rv_func_arg = arg; smp_rv_waiters[1] = 0; smp_rv_waiters[2] = 0; + smp_rv_waiters[3] = 0; atomic_store_rel_int(&smp_rv_waiters[0], 0); /* @@ -466,13 +458,13 @@ smp_rendezvous_cpus(cpuset_t map, smp_rendezvous_action(); /* - * If the caller did not request an exit barrier to be enforced - * on each CPU, ensure that this CPU waits for all the other - * CPUs to finish the rendezvous. + * Ensure that the master CPU waits for all the other + * CPUs to finish the rendezvous, so that smp_rv_* + * pseudo-structure and the arg are guaranteed to not + * be in use. */ - if (teardown_func == smp_no_rendevous_barrier) - while (atomic_load_acq_int(&smp_rv_waiters[2]) < ncpus) - cpu_spinwait(); + while (atomic_load_acq_int(&smp_rv_waiters[3]) < ncpus) + cpu_spinwait(); mtx_unlock_spin(&smp_ipi_mtx); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 20:42:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD283106564A; Sat, 30 Jul 2011 20:42:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39358FC08; Sat, 30 Jul 2011 20:42:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UKgEJa014782; Sat, 30 Jul 2011 20:42:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UKgEIV014778; Sat, 30 Jul 2011 20:42:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107302042.p6UKgEIV014778@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jul 2011 20:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224528 - in head: release/doc/en_US.ISO8859-1/hardware share/man/man4 tools/tools/sysdoc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 20:42:14 -0000 Author: avg Date: Sat Jul 30 20:42:14 2011 New Revision: 224528 URL: http://svn.freebsd.org/changeset/base/224528 Log: update smp related documentation after recent changes Remove references to machdep.hlt_logical_cpus and machdep.hlt_cpus sysctls and tunables. Document machdep.hyperthreading_allowed and hint.lapic.X.disabled tunables. Prompted by: ru Proofreading: bf Reviewed by: jhb Approved by: re (kib) Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml head/share/man/man4/smp.4 head/tools/tools/sysdoc/tunables.mdoc Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Jul 30 20:29:39 2011 (r224527) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Jul 30 20:42:14 2011 (r224528) @@ -196,10 +196,8 @@ Because this naive scheduling can result in suboptimal performance, under certain circumstances it may be useful to disable the logical processors with the the - machdep.hlt_logical_cpus sysctl variable. - It is also possible to halt any CPU in the idle loop with the - machdep.hlt_cpus sysctl variable. The - &man.smp.4; manual page has more details. + machdep.hyperthreading_allowed tunable. + The &man.smp.4; manual page has more details. &os; will take advantage of Physical Address Extensions (PAE) support on CPUs that support this feature. A kernel Modified: head/share/man/man4/smp.4 ============================================================================== --- head/share/man/man4/smp.4 Sat Jul 30 20:29:39 2011 (r224527) +++ head/share/man/man4/smp.4 Sat Jul 30 20:42:14 2011 (r224528) @@ -63,10 +63,10 @@ the read-only sysctl variable .Pp .Fx allows specific CPUs on a multi-processor system to be disabled. -The sysctl variable -.Va machdep.hlt_cpus -is an integer bitmask denoting CPUs to halt, counting from 0. -Setting a bit to 1 will result in the corresponding CPU being +This can be done using the +.Va hint.lapic.X.disabled +tunable, where X is the APIC ID of a CPU. +Setting this tunable to 1 will result in the corresponding CPU being disabled. .Pp The @@ -122,12 +122,12 @@ tasks on CPUs that are closely grouped t supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. Since using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the -.Va machdep.hlt_logical_cpus -sysctl to one. -Note that this operation is different from the mechanism used by the +.Va machdep.hyperthreading_allowed +tunable to zero. .Xr cpuset 1 . .Sh SEE ALSO .Xr mptable 1 , +.Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , Modified: head/tools/tools/sysdoc/tunables.mdoc ============================================================================== --- head/tools/tools/sysdoc/tunables.mdoc Sat Jul 30 20:29:39 2011 (r224527) +++ head/tools/tools/sysdoc/tunables.mdoc Sat Jul 30 20:42:14 2011 (r224528) @@ -1233,24 +1233,12 @@ machdep.disable_mtrrs machdep.guessed_bootdev --- -machdep.hlt_cpus +machdep.hyperthreading_allowed bool -This option will permit the halting -of CPUs. -For instance, to halt CPU 0, -machdep.htl_cpus=1 can be used. -It is possible to halt two CPUs by providing -a comma separated list (i.e: cpu1,cpu2). - ---- -machdep.hlt_logical_cpus -bool - -This keeps the logical CPUs halted in the idle loop. -By default the logical CPUs are halted at startup. -It is also possible to halt any cpu in the idle loop now -using machdep.hlt_cpus. +Setting this tunable to zero disables +the use of additional logical processors +provided by Intel HTT technology. --- machdep.panic_on_nmi From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 21:08:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B03711065672; Sat, 30 Jul 2011 21:08:34 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id 7162F8FC12; Sat, 30 Jul 2011 21:08:33 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 90B8F7F38B0; Sat, 30 Jul 2011 23:08:31 +0200 (CEST) Date: Sat, 30 Jul 2011 23:08:31 +0200 From: Roman Divacky To: Martin Matuska Message-ID: <20110730210831.GA98105@freebsd.org> References: <201107301727.p6UHRTBr008855@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107301727.p6UHRTBr008855@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224523 - head/contrib/gcc/cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:08:34 -0000 Why are we compiling our in-tree gcc with assertions enabled in the first place? On Sat, Jul 30, 2011 at 05:27:29PM +0000, Martin Matuska wrote: > Author: mm > Date: Sat Jul 30 17:27:29 2011 > New Revision: 224523 > URL: http://svn.freebsd.org/changeset/base/224523 > > Log: > Fix invalid assertion of C++ external static data member declarations > as anonymous namespaces are local to the current translation. > > GCC PR: c++/33094 > > Reviewed by: uqs > Approved by: re (kib) > Obtained from: gcc (branches/redhat/gcc-4_1-branch, rev. 129554, GPLv2) > MFC after: 1 week > > Modified: > head/contrib/gcc/cp/ChangeLog > head/contrib/gcc/cp/decl.c > > Modified: head/contrib/gcc/cp/ChangeLog > ============================================================================== > --- head/contrib/gcc/cp/ChangeLog Sat Jul 30 14:13:57 2011 (r224522) > +++ head/contrib/gcc/cp/ChangeLog Sat Jul 30 17:27:29 2011 (r224523) > @@ -1,3 +1,9 @@ > +2007-09-29 Jason Merrill > + > + PR c++/33094 > + * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member > + constant to not have DECL_EXTERNAL if it's file-local. > + > 2007-08-24 Jakub Jelinek > > PR c++/31941 > > Modified: head/contrib/gcc/cp/decl.c > ============================================================================== > --- head/contrib/gcc/cp/decl.c Sat Jul 30 14:13:57 2011 (r224522) > +++ head/contrib/gcc/cp/decl.c Sat Jul 30 17:27:29 2011 (r224523) > @@ -4968,7 +4968,7 @@ make_rtl_for_nonlocal_decl (tree decl, t > /* An in-class declaration of a static data member should be > external; it is only a declaration, and not a definition. */ > if (init == NULL_TREE) > - gcc_assert (DECL_EXTERNAL (decl)); > + gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)); > } > > /* We don't create any RTL for local variables. */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 21:09:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FCD9106566B; Sat, 30 Jul 2011 21:09:35 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 535D68FC12; Sat, 30 Jul 2011 21:09:33 +0000 (UTC) Received: by fxe4 with SMTP id 4so4641497fxe.13 for ; Sat, 30 Jul 2011 14:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; bh=frUVb/KGMPGpqdzWFpDZy75+v0ECobOfk0Kukc0pa5Y=; b=xBvdYl28nZQZIe0+m+Tt2BK4gUGZKt3KaWEw8dG/liGwmcUAjykVtDWy8WRwA3PwFZ sTHcALFiz7agjzcumHEtuqVxNwPj85vYs5cwym8SO0D7XEofv+lsITgGx1PZa6zy5u7G Vz+mPPGK9Kwd2YtxEXEcsONjeClHgCbBuB0eg= Received: by 10.223.76.202 with SMTP id d10mr3868751fak.106.1312058870838; Sat, 30 Jul 2011 13:47:50 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id x2sm1696538fal.44.2011.07.30.13.47.46 (version=SSLv3 cipher=OTHER); Sat, 30 Jul 2011 13:47:48 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E346DD9.5030902@FreeBSD.org> Date: Sat, 30 Jul 2011 23:47:21 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Kostik Belousov References: <201107292030.p6TKUSaf064895@svn.freebsd.org> <20110730163723.GZ17489@deviant.kiev.zoral.com.ua> In-Reply-To: <20110730163723.GZ17489@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: multipart/mixed; boundary="------------020700080908040403090808" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224496 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:09:35 -0000 This is a multi-part message in MIME format. --------------020700080908040403090808 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Kostik Belousov wrote: > On Fri, Jul 29, 2011 at 08:30:28PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Fri Jul 29 20:30:28 2011 >> New Revision: 224496 >> URL: http://svn.freebsd.org/changeset/base/224496 >> >> Log: >> In some cases failed SATA disks may report their presence, but don't >> respond to any commands. I've found that because of multiple command >> retries, each of which cause 30s timeout, bus reset and another retry or >> requeue for many commands, it may take ages to eventually drop the >> failed device. The odd thing is that those retries continue even after >> XPT considered device as dead and invalidated it. >> >> This patch makes cam_periph_error() to block any command retries after >> periph was marked as invalid. With that patch all activity completes in >> 1-2 minutes, just after several timeouts, required to consider device >> death. This should make ZFS, gmirror, graid, etc. operation more robust. >> >> Reviewed by: mjacob@ on scsi@ >> >> Approved by: re (kib) >> >> Modified: >> head/sys/cam/cam_periph.c > Amusingly, this commit makes my test machine to not boot. > This is Ibex Peak PCH, with two SATA disks on the channels 0 and 1. > > It seems that geom thread 100012 owns GEOM topology lock, while sleeping > in adaclose->cam_periph_getccb() : > > db> bt 100012 > Tracing pid 12 tid 100012 td 0xfffffe00028a2000 > sched_switch() at 0xffffffff8034a0c7 = sched_switch+0x157 > mi_switch() at 0xffffffff803291fb = mi_switch+0x2eb > sleepq_switch() at 0xffffffff803631f3 = sleepq_switch+0x123 > sleepq_wait() at 0xffffffff80363eed = sleepq_wait+0x4d > _sleep() at 0xffffffff80329b59 = _sleep+0x3b9 > cam_periph_getccb() at 0xffffffff817ffc50 = cam_periph_getccb+0xa0 > adaclose() at 0xffffffff8182c484 = adaclose+0xc4 > g_disk_access() at 0xffffffff802bea74 = g_disk_access+0x1e4 > g_access() at 0xffffffff802c519a = g_access+0x1ba > g_dev_attrchanged() at 0xffffffff802bd1f6 = g_dev_attrchanged+0x96 > g_dev_taste() at 0xffffffff802bd574 = g_dev_taste+0x284 > g_new_provider_event() at 0xffffffff802c4ecd = g_new_provider_event+0xad > g_run_events() at 0xffffffff802c0750 = g_run_events+0x250 > fork_exit() at 0xffffffff802f0d99 = fork_exit+0x189 > fork_trampoline() at 0xffffffff804ee3be = fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffff800025fd00, rbp = 0 --- > > (gdb) list *cam_periph_getccb+0xa0 > 0x1c50 is in cam_periph_getccb (/usr/home/kostik/work/build/bsd/DEV/src/sys/modules/cam/../../cam/cam_periph.c:883). > 882 > 883 while (SLIST_FIRST(&periph->ccb_list) == NULL) { > 884 if (periph->immediate_priority > priority) > > Reverting the rev. or not loading ahci.ko allows machine to boot. After many experiments I believe that problem is not related to this change. I've managed to reproduce it depending on GEOM modules registration order. After I disabled all GEOM modules and only geom_dev left, problem became persistent. Specifics of the geom_dev is that it opens device and closes it back without doing any I/O. That caused race condition between CCB allocation for FLUSHCACHE execution in adaclose() and higher-priority commands of device initialization sequence. Any I/O scheduled before adaclose() closed that race, making problem rare. The problem is specific to the ada, as for no other driver initialization and payload requests may intersect in time. Attached patch solved the problem for me. Please try it and approve commit if it works. -- Alexander Motin --------------020700080908040403090808 Content-Type: text/plain; name="adaschedule.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="adaschedule.patch" --- cam/ata/ata_da.c.prev 2011-07-30 22:22:21.000000000 +0300 +++ cam/ata/ata_da.c 2011-07-30 23:12:22.000000000 +0300 @@ -488,12 +488,20 @@ static void adaschedule(struct cam_periph *periph) { struct ada_softc *softc = (struct ada_softc *)periph->softc; + uint32_t prio; + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || (!softc->trim_running && bioq_first(&softc->trim_queue))) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + prio = CAM_PRIORITY_NORMAL; } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); } /* --------------020700080908040403090808-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 21:09:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941A0106566B; Sat, 30 Jul 2011 21:09:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84B728FC16; Sat, 30 Jul 2011 21:09:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UL9jmM015570; Sat, 30 Jul 2011 21:09:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UL9jsE015568; Sat, 30 Jul 2011 21:09:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107302109.p6UL9jsE015568@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jul 2011 21:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224529 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:09:45 -0000 Author: avg Date: Sat Jul 30 21:09:45 2011 New Revision: 224529 URL: http://svn.freebsd.org/changeset/base/224529 Log: fix a typo/tautology in the release documentation Approved by: re (kib) MFC after: 1 week Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Jul 30 20:42:14 2011 (r224528) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Jul 30 21:09:45 2011 (r224529) @@ -195,7 +195,7 @@ resources between logical processors within the same CPU. Because this naive scheduling can result in suboptimal performance, under certain circumstances it may be useful to - disable the logical processors with the the + disable the logical processors with the machdep.hyperthreading_allowed tunable. The &man.smp.4; manual page has more details. From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 21:17:07 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1125B106566B; Sat, 30 Jul 2011 21:17:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CBEAB8FC13; Sat, 30 Jul 2011 21:17:05 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA00500; Sun, 31 Jul 2011 00:17:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QnGu7-0008PW-9c; Sun, 31 Jul 2011 00:17:03 +0300 Message-ID: <4E3474CE.5090301@FreeBSD.org> Date: Sun, 31 Jul 2011 00:17:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Alexander Motin References: <201107292030.p6TKUSaf064895@svn.freebsd.org> <20110730163723.GZ17489@deviant.kiev.zoral.com.ua> <4E346DD9.5030902@FreeBSD.org> In-Reply-To: <4E346DD9.5030902@FreeBSD.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224496 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:17:07 -0000 on 30/07/2011 23:47 Alexander Motin said the following: > Kostik Belousov wrote: >> On Fri, Jul 29, 2011 at 08:30:28PM +0000, Alexander Motin wrote: >>> Author: mav >>> Date: Fri Jul 29 20:30:28 2011 >>> New Revision: 224496 >>> URL: http://svn.freebsd.org/changeset/base/224496 >>> >>> Log: >>> In some cases failed SATA disks may report their presence, but don't >>> respond to any commands. I've found that because of multiple command >>> retries, each of which cause 30s timeout, bus reset and another retry or >>> requeue for many commands, it may take ages to eventually drop the >>> failed device. The odd thing is that those retries continue even after >>> XPT considered device as dead and invalidated it. >>> >>> This patch makes cam_periph_error() to block any command retries after >>> periph was marked as invalid. With that patch all activity completes in >>> 1-2 minutes, just after several timeouts, required to consider device >>> death. This should make ZFS, gmirror, graid, etc. operation more robust. >>> >>> Reviewed by: mjacob@ on scsi@ >>> >>> Approved by: re (kib) >>> >>> Modified: >>> head/sys/cam/cam_periph.c >> Amusingly, this commit makes my test machine to not boot. >> This is Ibex Peak PCH, with two SATA disks on the channels 0 and 1. >> >> It seems that geom thread 100012 owns GEOM topology lock, while sleeping >> in adaclose->cam_periph_getccb() : >> >> db> bt 100012 >> Tracing pid 12 tid 100012 td 0xfffffe00028a2000 >> sched_switch() at 0xffffffff8034a0c7 = sched_switch+0x157 >> mi_switch() at 0xffffffff803291fb = mi_switch+0x2eb >> sleepq_switch() at 0xffffffff803631f3 = sleepq_switch+0x123 >> sleepq_wait() at 0xffffffff80363eed = sleepq_wait+0x4d >> _sleep() at 0xffffffff80329b59 = _sleep+0x3b9 >> cam_periph_getccb() at 0xffffffff817ffc50 = cam_periph_getccb+0xa0 >> adaclose() at 0xffffffff8182c484 = adaclose+0xc4 >> g_disk_access() at 0xffffffff802bea74 = g_disk_access+0x1e4 >> g_access() at 0xffffffff802c519a = g_access+0x1ba >> g_dev_attrchanged() at 0xffffffff802bd1f6 = g_dev_attrchanged+0x96 >> g_dev_taste() at 0xffffffff802bd574 = g_dev_taste+0x284 >> g_new_provider_event() at 0xffffffff802c4ecd = g_new_provider_event+0xad >> g_run_events() at 0xffffffff802c0750 = g_run_events+0x250 >> fork_exit() at 0xffffffff802f0d99 = fork_exit+0x189 >> fork_trampoline() at 0xffffffff804ee3be = fork_trampoline+0xe >> --- trap 0, rip = 0, rsp = 0xffffff800025fd00, rbp = 0 --- >> >> (gdb) list *cam_periph_getccb+0xa0 >> 0x1c50 is in cam_periph_getccb (/usr/home/kostik/work/build/bsd/DEV/src/sys/modules/cam/../../cam/cam_periph.c:883). >> 882 >> 883 while (SLIST_FIRST(&periph->ccb_list) == NULL) { >> 884 if (periph->immediate_priority > priority) >> >> Reverting the rev. or not loading ahci.ko allows machine to boot. > > After many experiments I believe that problem is not related to this > change. I've managed to reproduce it depending on GEOM modules > registration order. After I disabled all GEOM modules and only geom_dev > left, problem became persistent. Specifics of the geom_dev is that it > opens device and closes it back without doing any I/O. That caused race > condition between CCB allocation for FLUSHCACHE execution in adaclose() > and higher-priority commands of device initialization sequence. Any I/O > scheduled before adaclose() closed that race, making problem rare. The > problem is specific to the ada, as for no other driver initialization > and payload requests may intersect in time. Alexander, somewhat contradicting your conclusions... can the following issue be also caused by similar mechanics? http://lists.freebsd.org/pipermail/freebsd-current/2010-October/020336.html > Attached patch solved the problem for me. Please try it and approve > commit if it works. > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 21:28:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E2A106566B; Sat, 30 Jul 2011 21:28:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BA218FC13; Sat, 30 Jul 2011 21:28:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ULSYYB016188; Sat, 30 Jul 2011 21:28:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ULSYb1016187; Sat, 30 Jul 2011 21:28:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107302128.p6ULSYb1016187@svn.freebsd.org> From: John Baldwin Date: Sat, 30 Jul 2011 21:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224530 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:28:34 -0000 Author: jhb Date: Sat Jul 30 21:28:34 2011 New Revision: 224530 URL: http://svn.freebsd.org/changeset/base/224530 Log: Host mergeinfo for 219400 up to sys/ and out of sys/geom/label. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 21:42:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1AA1065673; Sat, 30 Jul 2011 21:42:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4A848FC0A; Sat, 30 Jul 2011 21:42:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ULgr9v016659; Sat, 30 Jul 2011 21:42:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ULgrbL016657; Sat, 30 Jul 2011 21:42:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107302142.p6ULgrbL016657@svn.freebsd.org> From: Alexander Motin Date: Sat, 30 Jul 2011 21:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224531 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 21:42:54 -0000 Author: mav Date: Sat Jul 30 21:42:53 2011 New Revision: 224531 URL: http://svn.freebsd.org/changeset/base/224531 Log: Higher-priority initialization request can eat request scheduling done from adaclose(). Add immediate_priority check into adaschedule() to restore it. Approved by: re (kib) MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Jul 30 21:28:34 2011 (r224530) +++ head/sys/cam/ata/ata_da.c Sat Jul 30 21:42:53 2011 (r224531) @@ -484,12 +484,20 @@ static void adaschedule(struct cam_periph *periph) { struct ada_softc *softc = (struct ada_softc *)periph->softc; + uint32_t prio; + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || (!softc->trim_running && bioq_first(&softc->trim_queue))) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + prio = CAM_PRIORITY_NORMAL; } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 22:21:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B285A1065673; Sat, 30 Jul 2011 22:21:42 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A932B8FC16; Sat, 30 Jul 2011 22:21:41 +0000 (UTC) Received: by fxe4 with SMTP id 4so4679438fxe.13 for ; Sat, 30 Jul 2011 15:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=svrrbO1T5fwIE/CZKzGJG8K96W1pZ/p0SkvY5YeXvgI=; b=k64bWIkVKpl23ZVpc23xTSUvWcNl6JiVECmeG4END4tpBIgVhXSghAzF2CbzivtW1A 6vMJXow37TRdsLsDc+/EL3jaY7pXyv6be3e33UkCaT5clCWDtE8RQb6BaRpGpInlbb2z JrXFcjp0dU4RiRvP1ILnB9i7d4KgfVUCtDHio= Received: by 10.223.76.17 with SMTP id a17mr3990825fak.32.1312064500404; Sat, 30 Jul 2011 15:21:40 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id g20sm1409032fai.45.2011.07.30.15.21.38 (version=SSLv3 cipher=OTHER); Sat, 30 Jul 2011 15:21:39 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E3483D8.3060507@FreeBSD.org> Date: Sun, 31 Jul 2011 01:21:12 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Andriy Gapon References: <201107292030.p6TKUSaf064895@svn.freebsd.org> <20110730163723.GZ17489@deviant.kiev.zoral.com.ua> <4E346DD9.5030902@FreeBSD.org> <4E3474CE.5090301@FreeBSD.org> In-Reply-To: <4E3474CE.5090301@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224496 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 22:21:42 -0000 Andriy Gapon wrote: > on 30/07/2011 23:47 Alexander Motin said the following: >> After many experiments I believe that problem is not related to this >> change. I've managed to reproduce it depending on GEOM modules >> registration order. After I disabled all GEOM modules and only geom_dev >> left, problem became persistent. Specifics of the geom_dev is that it >> opens device and closes it back without doing any I/O. That caused race >> condition between CCB allocation for FLUSHCACHE execution in adaclose() >> and higher-priority commands of device initialization sequence. Any I/O >> scheduled before adaclose() closed that race, making problem rare. The >> problem is specific to the ada, as for no other driver initialization >> and payload requests may intersect in time. > > somewhat contradicting your conclusions... can the following issue be also > caused by similar mechanics? > http://lists.freebsd.org/pipermail/freebsd-current/2010-October/020336.html Not sure, At least not exactly the same. cd driver keeps hold on device until probe completes, effectively blocking cdopen(). Seems there was a window in case of CD changers (closed month ago at r223557), but it should not affect plain CDs. Also, as soon as cd driver sends requests from cdopen(), not cdclose(), there would be much more chances to hit some global problem, as it would not depend on GEOM taste order. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 22:57:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34143106564A; Sat, 30 Jul 2011 22:57:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23FB88FC15; Sat, 30 Jul 2011 22:57:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UMvdNl018924; Sat, 30 Jul 2011 22:57:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UMvdWf018922; Sat, 30 Jul 2011 22:57:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107302257.p6UMvdWf018922@svn.freebsd.org> From: Rick Macklem Date: Sat, 30 Jul 2011 22:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224532 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 22:57:39 -0000 Author: rmacklem Date: Sat Jul 30 22:57:38 2011 New Revision: 224532 URL: http://svn.freebsd.org/changeset/base/224532 Log: The new NFS client failed to vput() the new vnode if a setattr failed after the file was created in nfs_create(). This would probably only happen during a forced dismount. The old NFS client does have a vput() for this case. Detected by pho during recent testing, where an open syscall returned with a vnode still locked. Tested by: pho Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sat Jul 30 21:42:53 2011 (r224531) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sat Jul 30 22:57:38 2011 (r224532) @@ -1596,6 +1596,8 @@ again: if (attrflag) (void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); + if (error != 0) + vput(newvp); } } if (!error) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 23:07:52 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C20106566B; Sat, 30 Jul 2011 23:07:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id DD6A68FC13; Sat, 30 Jul 2011 23:07:51 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p6UN7iJr003120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Jul 2011 09:07:47 +1000 Date: Sun, 31 Jul 2011 09:07:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: Message-ID: <20110731081349.K1061@besplex.bde.org> References: <201107301333.p6UDX5ca001997@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , src-committers@FreeBSD.org Subject: Re: svn commit: r224516 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 23:07:52 -0000 On Sat, 30 Jul 2011, John Baldwin wrote: > > On Jul 30, 2011, at 9:33 AM, Bjoern A. Zeeb wrote: > >> Author: bz >> Date: Sat Jul 30 13:33:05 2011 >> New Revision: 224516 >> URL: http://svn.freebsd.org/changeset/base/224516 >> >> Log: >> Introduce a tunable to disable the time consuming parts of bootup >> memtesting, which can easily save seconds to minutes of boot time. >> The tunable name is kept general to allow reusing the code in >> alternate frameworks. > > Why the 'tmpul' variable? The TUNABLE_*_FETCH() macros will not modify the parameter > if the environment variable is missing or unparseable. Lots of places depend on this all over > the kernel already, so you can depend on it here. And why do it and `memtest' have type unsigned long? This is a strange type for a boolean variable. The dependency is visible on there being almost no other instances of checking the return value of TUNABLE_*_FETCH(). E.g., in kern/*.c in a checkout a few months ago, there are 50 lines matching TUNABLE.*FETCH. Only 1 of these lines has an 'if (' in it. This 1 is in sysv_shm.c and seems to be correct since it is checking that a tunable which should not be used (because it has been renamed) is in fact not used. In the whole kernel, 155 lines match TUNABLE.*FETCH and 14 of these match 'if ('. Some of the 14 are not wrong. About 1/3 of them are for dubious use in memory sizing. E.g., in amd64/machdep.c: % realmem = Maxmem; The unprobed Maxmem remains in realmem for printing a confusing value later in sysctls. % % /* % * Display physical memory if SMBIOS reports reasonable amount. % */ % memsize = 0; % sysenv = getenv("smbios.memory.enabled"); % if (sysenv != NULL) { % memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; % freeenv(sysenv); % } First override for `memsize'. % if (memsize < ptoa((uintmax_t)cnt.v_free_count)) % memsize = ptoa((uintmax_t)Maxmem); `memsize' is normally (?) `Maxmem' in bytes, but not if SMBIOS set it. % printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); Code doesn't match comment. The display is unconditional, but the comment set that it is only done if SMBIOS reports a reasonable amount. `memsize' is not used after this point, so the only effect of the SMBIOS check is to possibly print a value that is different from all of the following: - the initial Maxmem in bytes - the final realmem in bytes (this equals the initial Maxmem in bytes) - the final Maxmem in bytes. The comment is also wrong in saying that SMBIOS is used. Only an environment string is used. Users can easily confuse themselves by putting garbage in this string. The above logic is also confused by the memory size being in cnt.v_free_cnt. If SMBIOS does't change memsize from 0, then we use Maxmem even if it is larger than cnt.v_free_cnt. % /* % * Maxmem isn't the "maximum memory", it's one larger than the % * highest page of the physical address space. It should be % * called something like "Maxphyspage". We may adjust this % * based on ``hw.physmem'' and the results of the memory test. % */ % Maxmem = atop(physmap[physmap_idx + 1]); Here we change Maxmem to another unprobed value. I think this value is more closely related to cnt.v_free_cnt. % % #ifdef MAXMEM % Maxmem = MAXMEM / 4; % #endif Then we optionally change MaxMem to a hard-configured value. % % if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable)) % Maxmem = atop(physmem_tunable); Then we use a temporary variable, since the primary variable has units of pages while the tunable has units of bytes. But this can be reorganized to: /* * memsize was Maxmem in bytes, but was not maintained when Maxmem * was changed about. Maintain it now. */ memsize = ptoa(Maxmem). * * XXX we also have a physmem variable, but this can't be used to * hole the result of the tunable any more than Maxmem can, since * it is in pages. memsize is not quite right either, since it * is a uintmax_t while the following assumes that it is u_long. * The u_long is too small for PAE on i386, but works for amd64. * The uintmax_t is needed on i386, but is not needed for amd64. */ TUNABLE_ULONG_FETCH("hw.physmem", &memsize); /* XXX sic */ Maxmem = atop(memsize); % /* % * Don't allow MAXMEM or hw.physmem to extend the amount of memory % * in the system. % */ % if (Maxmem > atop(physmap[physmap_idx + 1])) % Maxmem = atop(physmap[physmap_idx + 1]); After all these defaults and overrides for Maxmem, who knows its relationship to the "real memory" printed originally and printed later by sysctl? The memory size overrides and probes exist mainly to handle cases where the original value is wrong, so preserving the original value is a bug in most cases where it differs from the final value. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 23:09:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A761065675; Sat, 30 Jul 2011 23:09:53 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F87F8FC1E; Sat, 30 Jul 2011 23:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UN9r3M019323; Sat, 30 Jul 2011 23:09:53 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UN9rhJ019321; Sat, 30 Jul 2011 23:09:53 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201107302309.p6UN9rhJ019321@svn.freebsd.org> From: Joel Dahl Date: Sat, 30 Jul 2011 23:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224533 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 23:09:53 -0000 Author: joel (doc committer) Date: Sat Jul 30 23:09:52 2011 New Revision: 224533 URL: http://svn.freebsd.org/changeset/base/224533 Log: Add a better description, a few examples and a couple of minor fixes. Reviewed by: brueffer Approved by: re (kib) Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Sat Jul 30 22:57:38 2011 (r224532) +++ head/share/man/man4/pcm.4 Sat Jul 30 23:09:52 2011 (r224533) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 13, 2009 +.Dd July 31, 2011 .Dt SOUND 4 .Os .Sh NAME @@ -41,7 +41,121 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "device sound" .Ed +.Sh DESCRIPTION +The +.Nm +driver is the main component of the +.Fx sound system. +It works in conjunction with a bridge device driver on supported devices +and provides PCM audio record and playback once it attaches. +Each bridge device driver supports a specific set of audio chipsets and +needs to be enabled together with the +.Nm +driver. +PCI and ISA PnP audio devices identify themselves so users are usually not +required to add anything to +.Pa /boot/device.hints . +.Pp +Some of the main features of the +.Nm +driver are: multichannel audio, per-application +volume control, dynamic mixing through virtual sound channels, true full +duplex operation, bit perfect audio, rate conversion and low latency +modes. +.Pp +The +.Nm +driver is enabled by default, along with several bridge device drivers. +Those not enabled by default can be loaded during runtime with +.Xr kldload 8 +or during boot via +.Xr loader.conf 5 . +The following bridge device drivers are available: .Pp +.Bl -bullet -compact +.It +.Xr snd_ad1816 4 +.It +.Xr snd_ai2s 4 (enabled by default on powerpc) +.It +.Xr snd_als4000 4 +.It +.Xr snd_atiixp 4 +.It +.Xr snd_audiocs 4 (enabled by default on sparc64) +.It +.Xr snd_cmi 4 +.It +.Xr snd_cs4281 4 +.It +.Xr snd_csa 4 +.It +.Xr snd_davbus 4 (enabled by default on powerpc) +.It +.Xr snd_ds1 4 +.It +.Xr snd_emu10k1 4 +.It +.Xr snd_emu10kx 4 +.It +.Xr snd_envy24 4 +.It +.Xr snd_envy24ht 4 +.It +.Xr snd_es137x 4 (enabled by default on amd64, i386, sparc64) +.It +.Xr snd_ess 4 +.It +.Xr snd_fm801 4 +.It +.Xr snd_gusc 4 +.It +.Xr snd_hda 4 (enabled by default on amd64, i386) +.It +.Xr snd_ich 4 (enabled by default on amd64, i386) +.It +.Xr snd_maestro 4 +.It +.Xr snd_maestro3 4 +.It +.Xr snd_mss 4 +.It +.Xr snd_neomagic 4 +.It +snd_sb16 +.It +snd_sb8 +.It +.Xr snd_sbc 4 +.It +.Xr snd_solo 4 +.It +.Xr snd_spicds 4 +.It +.Xr snd_t4dwave 4 (enabled by default on sparc64) +.It +.Xr snd_uaudio 4 (enabled by default on amd64, i386, powerpc, sparc64) +.It +.Xr snd_via8233 4 (enabled by default on amd64, i386) +.It +.Xr snd_via82c686 4 +.It +.Xr snd_vibes 4 +.El +.Pp +Refer to the manual page for each bridge device driver for driver specific +settings and information. +.Ss Legacy Hardware +For old legacy +.Tn ISA +cards, the driver looks for +.Tn MSS +cards at addresses +.Dv 0x530 +and +.Dv 0x604 . +These values can be overridden in +.Pa /boot/device.hints . Non-PnP sound cards require the following lines in .Xr device.hints 5 : .Bd -literal -offset indent @@ -50,33 +164,6 @@ hint.pcm.0.irq="5" hint.pcm.0.drq="1" hint.pcm.0.flags="0x0" .Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for -.Tn PCM -audio play and capture. -This driver also supports various -.Tn PCI , -.Tn ISA , -.Tn WSS/MSS -compatible -sound cards, AC97 mixer and High Definition Audio. -Once the -.Nm -driver attaches, supported devices provide audio record and -playback channels. -The -.Fx -sound system provides dynamic mixing -.Dq VCHAN -and rate conversion -.Dq soft formats . -True full duplex operation is available on most sound cards. -.Pp -If the sound card is supported by a bridge driver, the -.Nm -driver works in conjunction with the bridge driver. .Pp Apart from the usual parameters, the flags field is used to specify the secondary @@ -85,24 +172,6 @@ channel (generally used for capture in f Flags are set to 0 for cards not using a secondary .Tn DMA channel, or to 0x10 + C to specify channel C. -.Pp -The driver does its best to recognize the installed hardware and drive -it correctly so the user is not required to add several lines in -.Pa /boot/device.hints . -For -.Tn PCI -and -.Tn ISA -.Tn PnP -cards this is actually easy -since they identify themselves. -For legacy -.Tn ISA -cards, the driver looks for -.Tn MSS -cards at addresses 0x530 and 0x604 (unless overridden -in -.Pa /boot/device.hints ) . .Ss Boot Variables In general, the module .Pa snd_foo @@ -119,17 +188,18 @@ utility. Options which can be specified in .Pa /boot/loader.conf include: -.Bl -tag -width ".Va snd_emu10k1_load" -offset indent +.Bl -tag -width ".Va snd_driver_load" -offset indent .It Va snd_driver_load .Pq Dq Li NO If set to .Dq Li YES , this option loads all available drivers. -.It Va snd_emu10k1_load +.It Va snd_hda_load .Pq Dq Li NO If set to .Dq Li YES , -only the SoundBlaster 5.1 driver and dependent modules will be loaded. +only the Intel High Definition Audio bridge device driver and dependent +modules will be loaded. .It Va snd_foo_load .Pq Dq Li NO If set to @@ -155,8 +225,9 @@ This provides a base interface for relat support. Multichannel audio works both with and without .Tn VCHANs . -Most bridge device drivers are still missing multichannel matrixing support -, but in most cases this should be trivial to implement. +.Pp +Most bridge device drivers are still missing multichannel matrixing +support, but in most cases this should be trivial to implement. Use the .Va dev.pcm.%d.[play|rec].vchanformat .Xr sysctl(8) @@ -173,7 +244,7 @@ controls (bass and treble). Commonly used for ear-candy or frequency compensation due to the vast difference in hardware quality. EQ is disabled by default, but can be enabled with the -.Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq +.Va hint.pcm.%d.eq tunable. .Ss VCHANs Each device can optionally support more playback and recording channels @@ -208,13 +279,13 @@ driver. The following tunables can not be changed during runtime using .Xr sysctl 8 . .Bl -tag -width indent -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq +.It Va hint.pcm.%d.eq Set to 1 or 0 to explicitly enable (1) or disable (0) the equalizer. Requires a driver reload if changed. Enabling this will make bass and treble controls appear in mixer applications. This tunable is undefined by default. Equalizing is disabled by default. -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .vpc +.It Va hint.pcm.%d.vpc Set to 1 or 0 to explicitly enable (1) or disable (0) the .Tn VPC feature. @@ -512,6 +583,9 @@ On devices that have more than one recor there is a corresponding .Pa /dev/dsp%d.r%d device. +The +.Xr mixer 8 +utility can be used to start and stop recording from an specific device. .Ss Statistics Channel statistics are only kept while the device is open. So with situations involving overruns and underruns, consider the output @@ -586,6 +660,31 @@ For specific sound card access, please i .Pa /dev/dsp or .Pa /dev/dsp%d . +.Sh EXAMPLES +Use the sound metadriver to load all +.Nm +bridge device drivers at once +(for example if it is unclear which the correct driver to use is): +.Pp +.Dl kldload snd_driver +.Pp +Load a specific bridge device driver, in this case the Intel +High Definition Audio driver: +.Pp +.Dl kldload snd_hda +.Pp +Check the status of all detected +.Nm +devices: +.Pp +.Dl cat /dev/sndstat +.Pp +Change the default sound device, in this case to the second device. +This is handy if there are multiple +.Nm +devices available: +.Pp +.Dl sysctl hw.snd.default_unit=1 .Sh DIAGNOSTICS .Bl -diag .It pcm%d:play:%d:dsp%d.p%d: play interrupt timeout, channel dead @@ -596,12 +695,14 @@ A device node is not created properly. .El .Sh SEE ALSO .Xr snd_ad1816 4 , +.Xr snd_ai2s 4 , .Xr snd_als4000 4 , .Xr snd_atiixp 4 , .Xr snd_audiocs 4 , .Xr snd_cmi 4 , .Xr snd_cs4281 4 , .Xr snd_csa 4 , +.Xr snd_davbus 4 , .Xr snd_ds1 4 , .Xr snd_emu10k1 4 , .Xr snd_emu10kx 4 , @@ -630,6 +731,7 @@ A device node is not created properly. .Xr loader.conf 5 , .Xr dmesg 8 , .Xr kldload 8 , +.Xr mixer 8 , .Xr sysctl 8 .Rs .%T "Cookbook formulae for audio EQ biquad filter coefficients, by Robert Bristow-Johnson" From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 23:21:53 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C156106566B; Sat, 30 Jul 2011 23:21:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 937E98FC0C; Sat, 30 Jul 2011 23:21:52 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p6UNLjsJ001468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Jul 2011 09:21:48 +1000 Date: Sun, 31 Jul 2011 09:21:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20110731081349.K1061@besplex.bde.org> Message-ID: <20110731091237.R1216@besplex.bde.org> References: <201107301333.p6UDX5ca001997@svn.freebsd.org> <20110731081349.K1061@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , John Baldwin , src-committers@FreeBSD.org Subject: Re: svn commit: r224516 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 23:21:53 -0000 On Sun, 31 Jul 2011, Bruce Evans wrote: > ... In the > whole kernel, 155 lines match TUNABLE.*FETCH and 14 of these match 'if ('. > Some of the 14 are not wrong. About 1/3 of them are for dubious use in > memory sizing. E.g., in amd64/machdep.c: > > % realmem = Maxmem; > > The unprobed Maxmem remains in realmem for printing a confusing value later > in sysctls. Oops. This is actually the final (probed) value of Maxmem. I got confused by the file order being different from the dynamic order. > > % % /* > % * Display physical memory if SMBIOS reports reasonable amount. > % */ > % memsize = 0; > % sysenv = getenv("smbios.memory.enabled"); > % if (sysenv != NULL) { > % memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << > 10; > % freeenv(sysenv); > % } > > First override for `memsize'. > > % if (memsize < ptoa((uintmax_t)cnt.v_free_count)) > % memsize = ptoa((uintmax_t)Maxmem); > > `memsize' is normally (?) `Maxmem' in bytes, but not if SMBIOS set it. > > % printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); > > Code doesn't match comment. The display is unconditional, but the comment > set that it is only done if SMBIOS reports a reasonable amount. > > `memsize' is not used after this point, so the only effect of the SMBIOS > check is to possibly print a value that is different from all of the > following: > - the initial Maxmem in bytes > - the final realmem in bytes (this equals the initial Maxmem in bytes) > - the final Maxmem in bytes. > The comment is also wrong in saying that SMBIOS is used. Only an > environment string is used. Users can easily confuse themselves by putting > garbage in this string. > > The above logic is also confused by the memory size being in cnt.v_free_cnt. > If SMBIOS does't change memsize from 0, then we use Maxmem even if it is > larger than cnt.v_free_cnt. So realmem is the correct final value unless the SMBIOS non-call gives a different value; in the latter case, we print this different value above but the realmem sysctl can't recover it. > % /* > % * Maxmem isn't the "maximum memory", it's one larger than the > % * highest page of the physical address space. It should be > % * called something like "Maxphyspage". We may adjust this > % * based on ``hw.physmem'' and the results of the memory test. > % */ > % Maxmem = atop(physmap[physmap_idx + 1]); > > Here we change Maxmem to another unprobed value. I think this value is > more closely related to cnt.v_free_cnt. > > % % #ifdef MAXMEM > % Maxmem = MAXMEM / 4; > % #endif > > Then we optionally change MaxMem to a hard-configured value. > > % % if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable)) > % Maxmem = atop(physmem_tunable); > > Then we use a temporary variable, since the primary variable has > units of pages while the tunable has units of bytes. But this can > be reorganized to: > > /* > * memsize was Maxmem in bytes, but was not maintained when Maxmem > * was changed about. Maintain it now. > */ > memsize = ptoa(Maxmem). > * > * XXX we also have a physmem variable, but this can't be used to > * hole the result of the tunable any more than Maxmem can, since > * it is in pages. memsize is not quite right either, since it > * is a uintmax_t while the following assumes that it is u_long. > * The u_long is too small for PAE on i386, but works for amd64. > * The uintmax_t is needed on i386, but is not needed for amd64. > */ > TUNABLE_ULONG_FETCH("hw.physmem", &memsize); /* XXX sic */ > Maxmem = atop(memsize); > > % /* > % * Don't allow MAXMEM or hw.physmem to extend the amount of memory > % * in the system. > % */ > % if (Maxmem > atop(physmap[physmap_idx + 1])) > % Maxmem = atop(physmap[physmap_idx + 1]); Now we're in the getmemsize() function, which doesn't have a memsize variable. It should have one instead of the physmem_tunable variable, if only because the physmem tunable is actually for memsize in bytes and not for physmem in pages. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jul 30 23:42:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18597106566C; Sat, 30 Jul 2011 23:42:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06E288FC0C; Sat, 30 Jul 2011 23:42:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6UNgFeg020329; Sat, 30 Jul 2011 23:42:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6UNgFoB020327; Sat, 30 Jul 2011 23:42:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107302342.p6UNgFoB020327@svn.freebsd.org> From: Rick Macklem Date: Sat, 30 Jul 2011 23:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224534 - stable/8/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2011 23:42:16 -0000 Author: rmacklem Date: Sat Jul 30 23:42:15 2011 New Revision: 224534 URL: http://svn.freebsd.org/changeset/base/224534 Log: MFC: r224117 The new NFSv4 client handled NFSERR_GRACE as a fatal error for the remove and rename operations. Some NFSv4 servers will report NFSERR_GRACE for these operations. This patch changes the behaviour of the client so that it handles NFSERR_GRACE like NFSERR_DELAY for non-state related operations like remove and rename. It also exempts the delegreturn operation from handling within newnfs_request() for NFSERR_DELAY/NFSERR_GRACE so that it can handle NFSERR_GRACE in the same manner as before. This problem was resolved thanks to discussion with bfields at fieldses.org. The problem was identified at the recent NFSv4 ineroperability bakeathon. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat Jul 30 23:09:52 2011 (r224533) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat Jul 30 23:42:15 2011 (r224534) @@ -666,8 +666,10 @@ tryagain: NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); nd->nd_repstat = fxdr_unsigned(u_int32_t, *tl); if (nd->nd_repstat != 0) { - if ((nd->nd_repstat == NFSERR_DELAY && + if (((nd->nd_repstat == NFSERR_DELAY || + nd->nd_repstat == NFSERR_GRACE) && (nd->nd_flag & ND_NFSV4) && + nd->nd_procnum != NFSPROC_DELEGRETURN && nd->nd_procnum != NFSPROC_SETATTR && nd->nd_procnum != NFSPROC_READ && nd->nd_procnum != NFSPROC_WRITE &&