Re: svn commit: r273647 - head/sys/dev/acpica

2014-10-26 Thread Rui Paulo
On Oct 25, 2014, at 14:01, Konstantin Belousov  wrote:
> 
> Author: kib
> Date: Sat Oct 25 21:01:50 2014
> New Revision: 273647
> URL: https://svnweb.freebsd.org/changeset/base/273647
> 
> Log:
>  Set the caching mode for the usermode mapping of the HPET registers
>  page to uncached.
> 
>  Reviewed by: rpaulo
>  Sponsored by:The FreeBSD Foundation
>  MFC after:   1 week
> 
> Modified:
>  head/sys/dev/acpica/acpi_hpet.c
> 
> Modified: head/sys/dev/acpica/acpi_hpet.c
> ==
> --- head/sys/dev/acpica/acpi_hpet.c   Sat Oct 25 20:42:47 2014
> (r273646)
> +++ head/sys/dev/acpica/acpi_hpet.c   Sat Oct 25 21:01:50 2014
> (r273647)
> @@ -356,6 +356,7 @@ hpet_mmap(struct cdev *cdev, vm_ooffset_
>   if (!sc->mmap_allow_write && (nprot & PROT_WRITE))
>   return (EPERM);
>   *paddr = rman_get_start(sc->mem_res) + offset;
> + *memattr = VM_MEMATTR_UNCACHEABLE;
> 
>   return (0);
> }

Thanks!

--
Rui Paulo



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


svn commit: r273687 - in head: sys/cam/ctl usr.sbin/ctladm

2014-10-26 Thread Alexander Motin
Author: mav
Date: Sun Oct 26 07:40:37 2014
New Revision: 273687
URL: https://svnweb.freebsd.org/changeset/base/273687

Log:
  Add "rpm" and "formfactor" LUN options to match istgt functionality.
  
  MFC after:1 week

Modified:
  head/sys/cam/ctl/ctl.c
  head/usr.sbin/ctladm/ctladm.8

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Oct 26 07:07:54 2014(r273686)
+++ head/sys/cam/ctl/ctl.c  Sun Oct 26 07:40:37 2014(r273687)
@@ -10207,6 +10207,8 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio *
 {
struct scsi_vpd_block_device_characteristics *bdc_ptr;
struct ctl_lun *lun;
+   const char *value;
+   u_int i;
 
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -10239,7 +10241,18 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio *
bdc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
bdc_ptr->page_code = SVPD_BDC;
scsi_ulto2b(sizeof(*bdc_ptr) - 4, bdc_ptr->page_length);
-   scsi_ulto2b(SVPD_NON_ROTATING, bdc_ptr->medium_rotation_rate);
+   if (lun != NULL &&
+   (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL)
+   i = strtol(value, NULL, 0);
+   else
+   i = SVPD_NON_ROTATING;
+   scsi_ulto2b(i, bdc_ptr->medium_rotation_rate);
+   if (lun != NULL &&
+   (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL)
+   i = strtol(value, NULL, 0);
+   else
+   i = 0;
+   bdc_ptr->wab_wac_ff = (i & 0x0f);
bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS;
 
ctsio->scsi_status = SCSI_STATUS_OK;

Modified: head/usr.sbin/ctladm/ctladm.8
==
--- head/usr.sbin/ctladm/ctladm.8   Sun Oct 26 07:07:54 2014
(r273686)
+++ head/usr.sbin/ctladm/ctladm.8   Sun Oct 26 07:40:37 2014
(r273687)
@@ -34,7 +34,7 @@
 .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $
 .\" $FreeBSD$
 .\"
-.Dd October 12, 2014
+.Dd October 26, 2014
 .Dt CTLADM 8
 .Os
 .Sh NAME
@@ -995,6 +995,12 @@ command sequence order shall be explicit
 client through the selection of appropriate commands and task attributes.
 The default value is "restricted".  It improves data integrity, but may
 introduce some additional delays.
+.It Va rpm
+Specifies medium rotation rate of the device: 0 -- not reported,
+1 -- non-rotating (SSD), >1024 -- value in revolutions per minute.
+.It Va formfactor
+Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25",
+2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8".
 .It Va unmap
 Set to "on", enables UNMAP support for the LUN, if supported by the backend.
 .It Va writecache
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273689 - head/contrib/file/magic/Magdir

2014-10-26 Thread Xin LI
Author: delphij
Date: Sun Oct 26 09:29:12 2014
New Revision: 273689
URL: https://svnweb.freebsd.org/changeset/base/273689

Log:
  MFV r273688:
  
  Update filesystems magic.  This fixes a regression introduced by
  libmagic 5.19 which prevents file(1) to show more verbose information
  about a MBR.
  
  Submitted by: madpilot
  MFC after:2 weeks

Modified:
  head/contrib/file/magic/Magdir/filesystems
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/magic/Magdir/filesystems
==
--- head/contrib/file/magic/Magdir/filesystems  Sun Oct 26 09:24:32 2014
(r273688)
+++ head/contrib/file/magic/Magdir/filesystems  Sun Oct 26 09:29:12 2014
(r273689)
@@ -1,5 +1,5 @@
 #--
-# $File: filesystems,v 1.95 2014/06/03 19:17:27 christos Exp $
+# $File: filesystems,v 1.106 2014/10/23 17:17:09 christos Exp $
 # filesystems:  file(1) magic for different filesystems
 #
 0  namepartid  
@@ -254,19 +254,13 @@
 30 search/481  \x55\xAA
 # to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux 
bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111)
 # DOS BPB information (70) and after DOS floppy (120) like in previous file 
version
-!:strength +72
+!:strength +65
 # for sector sizes < 512 Bytes
 >11uleshort<512
 >>(11.s-2) uleshort0xAA55  DOS/MBR boot sector
 # for sector sizes with 512 or more Bytes
 >0x1FE leshort 0xAA55  DOS/MBR boot sector
-# keep old DOS/MBR boot sector as dummy for mbr and bootloader displaying
-# only for sector sizes with 512 or more Bytes
-0x1FE  leshort 0xAA55  
-#
-# to display information (50) before DOS BPB (strength=70) and after DOS 
floppy (120) like in old file version
-!:strength +21
->2 string  OSBS\b, OS/BS MBR
+>2 string  OSBSOS/BS MBR
 # added by Joerg Jenderek at Feb 2013 according to 
http://thestarman.pcministry.com/asm/mbr/
 # and http://en.wikipedia.org/wiki/Master_Boot_Record
 # test for nearly all MS-DOS Master Boot Record initial program loader (IPL) 
is now done by 
@@ -538,6 +532,8 @@
 >>>514 string  !HdrS   
 # not BeOS
 422string  !Be\ Boot\ Loader   
+>32769 stringCD001
+>>0use cdrom
 # jump over BPB instruction implies DOS bootsector or AdvanceMAME mbr 
 >0 ubelong&0xFD00  =0xE900 
 # AdvanceMAME mbr
@@ -1043,7 +1039,7 @@
 >>466  ubyte   <0x10   
 >>>466 ubyte   0x05\b, extended partition table
 >>>466 ubyte   0x0F\b, extended partition table 
 >>>(LBA)
->>>466 ubyte   0x0 \b, extended partition table 
(last) 
+>>>466 ubyte   0x0 \b, extended partition table 
(last)
 
 # DOS x86 sector separated and moved from "DOS/MBR boot sector" by Joerg 
Jenderek at May 2011
 
@@ -1236,6 +1232,7 @@
 >181   search/166  Error\ \0   
 # "a: disk" , "Fn: diskn" or "NetBSD MBR boot"
 >>&3   string  x   \b,"%s"
+>>>446 use partition-table
 # Andrea Mazzoleni AdvanceCD mbr loader of 
http://advancemame.sourceforge.net/boot-readme.html
 # added by Joerg Jenderek at Nov 2012 for versions 1.3 - 1.4
 # assembler instructions: jmp short 0x58;nop;ASCII
@@ -1353,18 +1350,19 @@
 # minimal short forward jump found 0x29 for bootloaders or 0x0
 # maximal short forward jump is 0x7f
 # OEM-ID is empty or contain readable bytes
-0  ulelong&0x804000E9  0x00E9  
+0  ulelong&0x804000E9  0x00E9
+!:strength +60
 # mtools-3.9.8/msdos.h
 # usual values are marked with comments to get only informations of strange 
FAT systems
 # valid sectorsize must be a power of 2 from 32 to 32768
->11uleshort&0xf001f0   
+>11uleshort&0x001f 0   
 >>11   uleshort<32769  
 >>>11  uleshort>31 
 21 ubyte&0xf0  0xF0
->0 ubyte   0xEB
+>0 ubyte   0xEBDOS/MBR boot sector
 >>1ubyte   x   \b, code offset 0x%x+2
 >0 ubyte   0xE9
->>1uleshortx   \b, code offset 0x%x+2
+>>1uleshortx   \b, code offset 0x%x+3
 >3 string  >\0 \b, OEM-ID "%-.8s"
 #http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC
 >>8string  IHC  

svn commit: r273690 - head/share/man/man4

2014-10-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 26 13:30:53 2014
New Revision: 273690
URL: https://svnweb.freebsd.org/changeset/base/273690

Log:
  Mention VAAI and ODX in ctl(4).
  
  Reviewed by:  mav@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man4/ctl.4
==
--- head/share/man/man4/ctl.4   Sun Oct 26 09:29:12 2014(r273689)
+++ head/share/man/man4/ctl.4   Sun Oct 26 13:30:53 2014(r273690)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd April 2, 2013
+.Dd October 23, 2014
 .Dt CTL 4
 .Os
 .Sh NAME
@@ -57,7 +57,7 @@ Tagged queueing
 .It
 SCSI task attribute support (ordered, head of queue, simple tags)
 .It
-SCSI implicit command ordering support.
+SCSI implicit command ordering support
 .It
 Full task management support (abort, LUN reset, target reset, etc.)
 .It
@@ -67,6 +67,12 @@ Support for multiple simultaneous initia
 .It
 Support for multiple simultaneous backing stores
 .It
+Support for VMWare VAAI: COMPARE AND WRITE, XCOPY, WRITE SAME,
+and UNMAP commands
+.It
+Support for Microsoft ODX: POPULATE TOKEN/WRITE USING TOKEN,
+WRITE SAME, and UNMAP commands
+.It
 Persistent reservation support
 .It
 Mode sense/select support
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273691 - head/sys/kern

2014-10-26 Thread Mateusz Guzik
Author: mjg
Date: Sun Oct 26 14:25:42 2014
New Revision: 273691
URL: https://svnweb.freebsd.org/changeset/base/273691

Log:
  Fix up an assertion in kern_setgroups, it should compare with ngroups_max + 1
  
  Bug introdued in r273685.
  
  Noted by: Tiwei Bie 

Modified:
  head/sys/kern/kern_prot.c

Modified: head/sys/kern/kern_prot.c
==
--- head/sys/kern/kern_prot.c   Sun Oct 26 13:30:53 2014(r273690)
+++ head/sys/kern/kern_prot.c   Sun Oct 26 14:25:42 2014(r273691)
@@ -835,7 +835,7 @@ kern_setgroups(struct thread *td, u_int 
struct ucred *newcred, *oldcred;
int error;
 
-   MPASS(ngrp <= ngroups_max);
+   MPASS(ngrp <= ngroups_max + 1);
AUDIT_ARG_GROUPSET(groups, ngrp);
newcred = crget();
crextend(newcred, ngrp);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273693 - head/sys/cam/ctl

2014-10-26 Thread Alexander Motin
Author: mav
Date: Sun Oct 26 15:28:07 2014
New Revision: 273693
URL: https://svnweb.freebsd.org/changeset/base/273693

Log:
  Fix printing non-terminated strings in devlist XML.
  
  MFC after:1 week

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Oct 26 14:43:02 2014(r273692)
+++ head/sys/cam/ctl/ctl.c  Sun Oct 26 15:28:07 2014(r273693)
@@ -2200,13 +2200,14 @@ ctl_copyout_args(int num_args, struct ct
  * Escape characters that are illegal or not recommended in XML.
  */
 int
-ctl_sbuf_printf_esc(struct sbuf *sb, char *str)
+ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size)
 {
+   char *end = str + size;
int retval;
 
retval = 0;
 
-   for (; *str; str++) {
+   for (; *str && str < end; str++) {
switch (*str) {
case '&':
retval = sbuf_printf(sb, "&");
@@ -3198,7 +3199,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
break;
 
retval = ctl_sbuf_printf_esc(sb,
-lun->be_lun->serial_num);
+   lun->be_lun->serial_num,
+   sizeof(lun->be_lun->serial_num));
 
if (retval != 0)
break;
@@ -3213,7 +3215,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
if (retval != 0)
break;
 
-   retval = ctl_sbuf_printf_esc(sb,lun->be_lun->device_id);
+   retval = ctl_sbuf_printf_esc(sb,
+   lun->be_lun->device_id,
+   sizeof(lun->be_lun->device_id));
 
if (retval != 0)
break;

Modified: head/sys/cam/ctl/ctl.h
==
--- head/sys/cam/ctl/ctl.h  Sun Oct 26 14:43:02 2014(r273692)
+++ head/sys/cam/ctl/ctl.h  Sun Oct 26 15:28:07 2014(r273693)
@@ -156,7 +156,7 @@ int ctl_port_list(struct ctl_port_entry 
  * Put a string into an sbuf, escaping characters that are illegal or not
  * recommended in XML.  Note this doesn't escape everything, just > < and &.
  */
-int ctl_sbuf_printf_esc(struct sbuf *sb, char *str);
+int ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size);
 
 int ctl_ffz(uint32_t *mask, uint32_t size);
 int ctl_set_mask(uint32_t *mask, uint32_t bit);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273700 - in head/bin/sh: . tests/builtins

2014-10-26 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 26 17:50:33 2014
New Revision: 273700
URL: https://svnweb.freebsd.org/changeset/base/273700

Log:
  sh: Make getopts memory-safe if with changing arguments.
  
  POSIX does not permit to continuing a getopts loop with different
  arguments. For parsing the positional parameters, we handle this case by
  resetting the getopts state when the positional parameters are changed in
  any way (and the getopts state is local to a function). However, in the
  syntax getopts   , changes could lead to invalid
  memory access.
  
  In the syntax getopts   , store a copy of the
  arguments and continue to use them until getopts is reset.

Added:
  head/bin/sh/tests/builtins/getopts9.0   (contents, props changed)
  head/bin/sh/tests/builtins/getopts9.0.stdout   (contents, props changed)
Modified:
  head/bin/sh/eval.c
  head/bin/sh/options.c
  head/bin/sh/options.h

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Sun Oct 26 17:17:08 2014(r273699)
+++ head/bin/sh/eval.c  Sun Oct 26 17:50:33 2014(r273700)
@@ -1039,6 +1039,7 @@ evalcommand(union node *cmd, int flags, 
shellparam.reset = 1;
shellparam.nparam = argc - 1;
shellparam.p = argv + 1;
+   shellparam.optp = NULL;
shellparam.optnext = NULL;
INTOFF;
savelocalvars = localvars;

Modified: head/bin/sh/options.c
==
--- head/bin/sh/options.c   Sun Oct 26 17:17:08 2014(r273699)
+++ head/bin/sh/options.c   Sun Oct 26 17:50:33 2014(r273700)
@@ -325,6 +325,7 @@ setparam(char **argv)
shellparam.malloc = 1;
shellparam.nparam = nparam;
shellparam.p = newparam;
+   shellparam.optp = NULL;
shellparam.reset = 1;
shellparam.optnext = NULL;
 }
@@ -344,6 +345,11 @@ freeparam(struct shparam *param)
ckfree(*ap);
ckfree(param->p);
}
+   if (param->optp) {
+   for (ap = param->optp ; *ap ; ap++)
+   ckfree(*ap);
+   ckfree(param->optp);
+   }
 }
 
 
@@ -417,20 +423,33 @@ getoptsreset(const char *value)
 int
 getoptscmd(int argc, char **argv)
 {
-   char **optbase = NULL;
+   char **optbase = NULL, **ap;
+   int i;
 
if (argc < 3)
error("usage: getopts optstring var [arg]");
-   else if (argc == 3)
-   optbase = shellparam.p;
-   else
-   optbase = &argv[3];
 
if (shellparam.reset == 1) {
+   INTOFF;
+   if (shellparam.optp) {
+   for (ap = shellparam.optp ; *ap ; ap++)
+   ckfree(*ap);
+   ckfree(shellparam.optp);
+   shellparam.optp = NULL;
+   }
+   if (argc > 3) {
+   shellparam.optp = ckmalloc((argc - 2) * sizeof *ap);
+   memset(shellparam.optp, '\0', (argc - 2) * sizeof *ap);
+   for (i = 0; i < argc - 3; i++)
+   shellparam.optp[i] = savestr(argv[i + 3]);
+   }
+   INTON;
+   optbase = argc == 3 ? shellparam.p : shellparam.optp;
shellparam.optnext = optbase;
shellparam.optptr = NULL;
shellparam.reset = 0;
-   }
+   } else
+   optbase = shellparam.optp ? shellparam.optp : shellparam.p;
 
return getopts(argv[1], argv[2], optbase, &shellparam.optnext,
   &shellparam.optptr);

Modified: head/bin/sh/options.h
==
--- head/bin/sh/options.h   Sun Oct 26 17:17:08 2014(r273699)
+++ head/bin/sh/options.h   Sun Oct 26 17:50:33 2014(r273700)
@@ -38,6 +38,7 @@ struct shparam {
unsigned char malloc;   /* if parameter list dynamically allocated */
unsigned char reset;/* if getopts has been reset */
char **p;   /* parameter list */
+   char **optp;/* parameter list for getopts */
char **optnext; /* next parameter to be processed by getopts */
char *optptr;   /* used by getopts */
 };

Added: head/bin/sh/tests/builtins/getopts9.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/getopts9.0   Sun Oct 26 17:50:33 2014
(r273700)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+args='-ab'
+getopts ab opt $args
+echo $?:$opt:$OPTARG
+for dummy in dummy1 dummy2; do
+   getopts ab opt $args
+   echo $?:$opt:$OPTARG
+done

Added: head/bin/sh/tests/builtins/getopts9.0.stdout
=

svn commit: r273701 - in head/sys: amd64/amd64 arm/arm i386/i386

2014-10-26 Thread Alan Cox
Author: alc
Date: Sun Oct 26 17:56:47 2014
New Revision: 273701
URL: https://svnweb.freebsd.org/changeset/base/273701

Log:
  By the time that pmap_init() runs, vm_phys_segs[] has been initialized.  
Obtaining
  the end of memory address from vm_phys_segs[] is a little easier than 
obtaining it
  from phys_avail[].
  
  Discussed with:   Svatopluk Kraus

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sun Oct 26 17:50:33 2014(r273700)
+++ head/sys/amd64/amd64/pmap.c Sun Oct 26 17:56:47 2014(r273701)
@@ -131,6 +131,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1056,8 +1057,7 @@ pmap_init(void)
/*
 * Calculate the size of the pv head table for superpages.
 */
-   for (i = 0; phys_avail[i + 1]; i += 2);
-   pv_npg = round_2mpage(phys_avail[(i - 2) + 1]) / NBPDR;
+   pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, NBPDR);
 
/*
 * Allocate memory for the pv head table for superpages.

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Sun Oct 26 17:50:33 2014(r273700)
+++ head/sys/arm/arm/pmap-v6.c  Sun Oct 26 17:56:47 2014(r273701)
@@ -172,6 +172,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1342,9 +1343,10 @@ pmap_init(void)
 
/*
 * Calculate the size of the pv head table for superpages.
+* Handle the possibility that "vm_phys_segs[...].end" is zero.
 */
-   for (i = 0; phys_avail[i + 1]; i += 2);
-   pv_npg = round_1mpage(phys_avail[(i - 2) + 1]) / NBPDR;
+   pv_npg = trunc_1mpage(vm_phys_segs[vm_phys_nsegs - 1].end -
+   PAGE_SIZE) / NBPDR + 1;
 
/*
 * Allocate memory for the pv head table for superpages.

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Sun Oct 26 17:50:33 2014(r273700)
+++ head/sys/i386/i386/pmap.c   Sun Oct 26 17:56:47 2014(r273701)
@@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -778,9 +779,10 @@ pmap_init(void)
 
/*
 * Calculate the size of the pv head table for superpages.
+* Handle the possibility that "vm_phys_segs[...].end" is zero.
 */
-   for (i = 0; phys_avail[i + 1]; i += 2);
-   pv_npg = round_4mpage(phys_avail[(i - 2) + 1]) / NBPDR;
+   pv_npg = trunc_4mpage(vm_phys_segs[vm_phys_nsegs - 1].end -
+   PAGE_SIZE) / NBPDR + 1;
 
/*
 * Allocate memory for the pv head table for superpages.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273702 - head/tools/regression/lib/libc/nss

2014-10-26 Thread Stefan Farfeleder
Author: stefanf
Date: Sun Oct 26 17:56:58 2014
New Revision: 273702
URL: https://svnweb.freebsd.org/changeset/base/273702

Log:
  Remove incorrect semicolon.

Modified:
  head/tools/regression/lib/libc/nss/test-gethostby.c

Modified: head/tools/regression/lib/libc/nss/test-gethostby.c
==
--- head/tools/regression/lib/libc/nss/test-gethostby.c Sun Oct 26 17:56:47 
2014(r273701)
+++ head/tools/regression/lib/libc/nss/test-gethostby.c Sun Oct 26 17:56:58 
2014(r273702)
@@ -109,7 +109,7 @@ __gethostbyname2(const char *name, int a
else {
error = 0;
he = getipnodebyname(name, af, ipnode_flags, &error);
-   if (he == NULL);
+   if (he == NULL)
errno = error;
}

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


svn commit: r273703 - in head/sys: arm/arm arm/at91 conf

2014-10-26 Thread Ian Lepore
Author: ian
Date: Sun Oct 26 18:30:35 2014
New Revision: 273703
URL: https://svnweb.freebsd.org/changeset/base/273703

Log:
  Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default.
  
  Multipass device attachment was tested on many arm platforms by users and
  only success was reported on the arm@ mailing list.  This is just the
  long-delayed followup of making it the default.
  
  Multipass attachment is necessary when using vendor-supplied FDT data,
  because our devices may need to be attached in a different order than they
  are described in the FDT data.

Modified:
  head/sys/arm/arm/nexus.c
  head/sys/arm/at91/std.atmel
  head/sys/conf/options.arm

Modified: head/sys/arm/arm/nexus.c
==
--- head/sys/arm/arm/nexus.cSun Oct 26 17:56:58 2014(r273702)
+++ head/sys/arm/arm/nexus.cSun Oct 26 18:30:35 2014(r273703)
@@ -128,12 +128,8 @@ static driver_t nexus_driver = {
nexus_methods,
1   /* no softc */
 };
-#ifdef ARM_DEVICE_MULTIPASS
 EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, 
 BUS_PASS_BUS + BUS_PASS_ORDER_EARLY);
-#else
-DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
-#endif
 
 static int
 nexus_probe(device_t dev)

Modified: head/sys/arm/at91/std.atmel
==
--- head/sys/arm/at91/std.atmel Sun Oct 26 17:56:58 2014(r273702)
+++ head/sys/arm/at91/std.atmel Sun Oct 26 18:30:35 2014(r273703)
@@ -12,4 +12,3 @@ deviceat91sam9x5
 # bring in the sam specific timers and such
 device at91sam9
 
-optionsARM_DEVICE_MULTIPASS

Modified: head/sys/conf/options.arm
==
--- head/sys/conf/options.arm   Sun Oct 26 17:56:58 2014(r273702)
+++ head/sys/conf/options.arm   Sun Oct 26 18:30:35 2014(r273703)
@@ -1,7 +1,6 @@
 #$FreeBSD$
 ARM9_CACHE_WRITE_THROUGH   opt_global.h
 ARM_CACHE_LOCK_ENABLE  opt_global.h
-ARM_DEVICE_MULTIPASS   opt_global.h
 ARM_KERN_DIRECTMAP opt_vm.h
 ARM_L2_PIPTopt_global.h
 ARM_MANY_BOARD opt_global.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273704 - head/sys/cam/ata

2014-10-26 Thread Steven Hartland
Author: smh
Date: Sun Oct 26 18:41:01 2014
New Revision: 273704
URL: https://svnweb.freebsd.org/changeset/base/273704

Log:
  Fix CF ERASE breakage caused by 268205.
  
  This prevents BIO_DELETE requests getting stuck in the TRIM queue which
  results in a panic on shutdown due to outstanding requests.
  
  PR:   194606
  Reported by:  Guido Falsi
  Reviewed by:  mav
  MFC after:3 days
  Sponsored by: Multiplay

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Sun Oct 26 18:30:35 2014(r273703)
+++ head/sys/cam/ata/ata_da.c   Sun Oct 26 18:41:01 2014(r273704)
@@ -1483,9 +1483,15 @@ ada_dsmtrim(struct ada_softc *softc, str
 static void
 ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio)
 {
+   struct trim_request *req = &softc->trim_req;
uint64_t lba = bp->bio_pblkno;
uint16_t count = bp->bio_bcount / softc->params.secsize;
 
+   bzero(req, sizeof(*req));
+   TAILQ_INIT(&req->bps);
+   bioq_remove(&softc->trim_queue, bp);
+   TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue);
+
cam_fill_ataio(ataio,
ada_retry_count,
adadone,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273706 - in head/sys/amd64/vmm: . io

2014-10-26 Thread Neel Natu
Author: neel
Date: Sun Oct 26 19:03:06 2014
New Revision: 273706
URL: https://svnweb.freebsd.org/changeset/base/273706

Log:
  Change the type of the first argument to the I/O emulation handlers to
  'struct vm *'. Previously it used to be a 'void *' but there is no reason
  to hide the actual type from the handler.
  
  Discussed with:   tychon
  MFC after:1 week

Modified:
  head/sys/amd64/vmm/io/vatpic.c
  head/sys/amd64/vmm/io/vatpic.h
  head/sys/amd64/vmm/io/vatpit.c
  head/sys/amd64/vmm/io/vatpit.h
  head/sys/amd64/vmm/io/vpmtmr.c
  head/sys/amd64/vmm/io/vpmtmr.h
  head/sys/amd64/vmm/vmm_ioport.h

Modified: head/sys/amd64/vmm/io/vatpic.c
==
--- head/sys/amd64/vmm/io/vatpic.c  Sun Oct 26 18:46:03 2014
(r273705)
+++ head/sys/amd64/vmm/io/vatpic.c  Sun Oct 26 19:03:06 2014
(r273706)
@@ -641,7 +641,7 @@ vatpic_write(struct vatpic *vatpic, stru
 }
 
 int
-vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax)
 {
struct vatpic *vatpic;
@@ -661,7 +661,7 @@ vatpic_master_handler(void *vm, int vcpu
 }
 
 int
-vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax)
 {
struct vatpic *vatpic;
@@ -681,7 +681,7 @@ vatpic_slave_handler(void *vm, int vcpui
 }
 
 int
-vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax)
 {
struct vatpic *vatpic;

Modified: head/sys/amd64/vmm/io/vatpic.h
==
--- head/sys/amd64/vmm/io/vatpic.h  Sun Oct 26 18:46:03 2014
(r273705)
+++ head/sys/amd64/vmm/io/vatpic.h  Sun Oct 26 19:03:06 2014
(r273706)
@@ -39,11 +39,11 @@
 struct vatpic *vatpic_init(struct vm *vm);
 void vatpic_cleanup(struct vatpic *vatpic);
 
-int vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes,
-uint32_t *eax);
-int vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes,
-uint32_t *eax);
-int vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+int vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port,
+int bytes, uint32_t *eax);
+int vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port,
+int bytes, uint32_t *eax);
+int vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax);
 
 int vatpic_assert_irq(struct vm *vm, int irq);

Modified: head/sys/amd64/vmm/io/vatpit.c
==
--- head/sys/amd64/vmm/io/vatpit.c  Sun Oct 26 18:46:03 2014
(r273705)
+++ head/sys/amd64/vmm/io/vatpit.c  Sun Oct 26 19:03:06 2014
(r273706)
@@ -317,7 +317,7 @@ vatpit_update_mode(struct vatpit *vatpit
 }
 
 int
-vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax)
 {
struct vatpit *vatpit;
@@ -400,7 +400,7 @@ vatpit_handler(void *vm, int vcpuid, boo
 }
 
 int
-vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax)
 {
struct vatpit *vatpit;

Modified: head/sys/amd64/vmm/io/vatpit.h
==
--- head/sys/amd64/vmm/io/vatpit.h  Sun Oct 26 18:46:03 2014
(r273705)
+++ head/sys/amd64/vmm/io/vatpit.h  Sun Oct 26 19:03:06 2014
(r273706)
@@ -37,9 +37,9 @@
 struct vatpit *vatpit_init(struct vm *vm);
 void vatpit_cleanup(struct vatpit *vatpit);
 
-int vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes,
-uint32_t *eax);
-int vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+int vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *eax);
+int vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port,
+int bytes, uint32_t *eax);
 
 #endif /* _VATPIT_H_ */

Modified: head/sys/amd64/vmm/io/vpmtmr.c
==
--- head/sys/amd64/vmm/io/vpmtmr.c  Sun Oct 26 18:46:03 2014
(r273705)
+++ head/sys/amd64/vmm/io/vpmtmr.c  Sun Oct 26 19:03:06 2014
(r273706)
@@ -79,7 +79,7 @@ vpmtmr_cleanup(struct vpmtmr *vpmtmr)
 }
 
 int
-vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes,
+vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes,
 uint32_t *val)
 {
struct vpmtmr *vpmtmr;

Modified: head/sys/amd64/vmm/io/vpmtmr.h
===

svn commit: r273707 - in head/sys: compat/freebsd32 kern kgssapi netinet nfs nlm sys

2014-10-26 Thread Mateusz Guzik
Author: mjg
Date: Sun Oct 26 19:42:44 2014
New Revision: 273707
URL: https://svnweb.freebsd.org/changeset/base/273707

Log:
  Avoid dynamic syscall overhead for statically compiled modules.
  
  The kernel tracks syscall users so that modules can safely unregister them.
  
  But if the module is not unloadable or was compiled into the kernel, there is
  no need to do this.
  
  Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATIC
  during kernel build and 0 otherwise.
  
  Reviewed by:  kib (previous version)
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/kern/kern_syscalls.c
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c
  head/sys/kern/uipc_mqueue.c
  head/sys/kern/uipc_sem.c
  head/sys/kern/vfs_aio.c
  head/sys/kgssapi/gss_impl.c
  head/sys/netinet/sctp_syscalls.c
  head/sys/nfs/nfs_nfssvc.c
  head/sys/nlm/nlm_prot_impl.c
  head/sys/sys/sysent.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Sun Oct 26 19:03:06 2014
(r273706)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Sun Oct 26 19:42:44 2014
(r273707)
@@ -2628,8 +2628,12 @@ freebsd32_xxx(struct thread *td, struct 
 
 int
 syscall32_register(int *offset, struct sysent *new_sysent,
-struct sysent *old_sysent)
+struct sysent *old_sysent, int flags)
 {
+
+   if ((flags & ~SY_THR_STATIC) != 0)
+   return (EINVAL);
+
if (*offset == NO_SYSCALL) {
int i;
 
@@ -2648,16 +2652,19 @@ syscall32_register(int *offset, struct s
 
*old_sysent = freebsd32_sysent[*offset];
freebsd32_sysent[*offset] = *new_sysent;
-   return 0;
+   atomic_store_rel_32(&freebsd32_sysent[*offset].sy_thrcnt, flags);
+   return (0);
 }
 
 int
 syscall32_deregister(int *offset, struct sysent *old_sysent)
 {
 
-   if (*offset)
-   freebsd32_sysent[*offset] = *old_sysent;
-   return 0;
+   if (*offset == 0)
+   return (0);
+
+   freebsd32_sysent[*offset] = *old_sysent;
+   return (0);
 }
 
 int
@@ -2670,7 +2677,7 @@ syscall32_module_handler(struct module *
switch (what) {
case MOD_LOAD:
error = syscall32_register(data->offset, data->new_sysent,
-   &data->old_sysent);
+   &data->old_sysent, SY_THR_STATIC_KLD);
if (error) {
/* Leave a mark so we know to safely unload below. */
data->offset = NULL;
@@ -2707,14 +2714,14 @@ syscall32_module_handler(struct module *
 }
 
 int
-syscall32_helper_register(struct syscall_helper_data *sd)
+syscall32_helper_register(struct syscall_helper_data *sd, int flags)
 {
struct syscall_helper_data *sd1;
int error;
 
for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) {
error = syscall32_register(&sd1->syscall_no, &sd1->new_sysent,
-   &sd1->old_sysent);
+   &sd1->old_sysent, flags);
if (error != 0) {
syscall32_helper_unregister(sd);
return (error);

Modified: head/sys/compat/freebsd32/freebsd32_util.h
==
--- head/sys/compat/freebsd32/freebsd32_util.h  Sun Oct 26 19:03:06 2014
(r273706)
+++ head/sys/compat/freebsd32/freebsd32_util.h  Sun Oct 26 19:42:44 2014
(r273707)
@@ -98,10 +98,10 @@ SYSCALL32_MODULE(syscallname,   
 }
 
 intsyscall32_register(int *offset, struct sysent *new_sysent,
-   struct sysent *old_sysent);
+   struct sysent *old_sysent, int flags);
 intsyscall32_deregister(int *offset, struct sysent *old_sysent);
 intsyscall32_module_handler(struct module *mod, int what, void *arg);
-intsyscall32_helper_register(struct syscall_helper_data *sd);
+intsyscall32_helper_register(struct syscall_helper_data *sd, int flags);
 intsyscall32_helper_unregister(struct syscall_helper_data *sd);
 
 struct iovec32;

Modified: head/sys/kern/kern_syscalls.c
==
--- head/sys/kern/kern_syscalls.c   Sun Oct 26 19:03:06 2014
(r273706)
+++ head/sys/kern/kern_syscalls.c   Sun Oct 26 19:42:44 2014
(r273707)
@@ -105,10 +105,13 @@ syscall_thread_exit(struct thread *td, s
 
 int
 syscall_register(int *offset, struct sysent *new_sysent,
-struct sysent *old_sysent)
+struct sysent *old_sysent, int flags)
 {
int i;
 
+   if ((flags & ~SY_THR_STATIC) != 0)
+   return (EINVAL);
+
if (*offset == NO_SYSCALL) {
for (i = 1; i < SYS_MAXSYSCALL; ++i)
if (sysent[i].sy_call == (sy_call_t *)lkmnosys)
@@ -127,18

svn commit: r273708 - head/sys/cam/ctl

2014-10-26 Thread Alexander Motin
Author: mav
Date: Sun Oct 26 20:13:46 2014
New Revision: 273708
URL: https://svnweb.freebsd.org/changeset/base/273708

Log:
  Fix support for LUN flat space addressing.
  
  MFC after:1 week

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Oct 26 19:42:44 2014(r273707)
+++ head/sys/cam/ctl/ctl.c  Sun Oct 26 20:13:46 2014(r273708)
@@ -9403,17 +9403,18 @@ ctl_report_luns(struct ctl_scsiio *ctsio
 * Flat addressing method.
 */
lun_data->luns[num_filled].lundata[0] =
-   RPL_LUNDATA_ATYP_FLAT |
-   (targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK);
-#ifdef OLDCTLHEADERS
-   (SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) |
-   (targ_lun_id & SRLD_BUS_LUN_MASK);
-#endif
+   RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8);
lun_data->luns[num_filled].lundata[1] =
-#ifdef OLDCTLHEADERS
-   targ_lun_id >> SRLD_BUS_LUN_BITS;
-#endif
-   targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS;
+   (targ_lun_id & 0xff);
+   num_filled++;
+   } else if (targ_lun_id <= 0xff) {
+   /*
+* Extended flat addressing method.
+*/
+   lun_data->luns[num_filled].lundata[0] =
+   RPL_LUNDATA_ATYP_EXTLUN | 0x12;
+   scsi_ulto3b(targ_lun_id,
+   &lun_data->luns[num_filled].lundata[1]);
num_filled++;
} else {
printf("ctl_report_luns: bogus LUN number %jd, "
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273709 - head/usr.bin/vmstat

2014-10-26 Thread Kirk McKusick
Author: mckusick
Date: Sun Oct 26 20:48:26 2014
New Revision: 273709
URL: https://svnweb.freebsd.org/changeset/base/273709

Log:
  Replace update from -r271410 accidentally lost in -r273575.

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

Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cSun Oct 26 20:13:46 2014
(r273708)
+++ head/usr.bin/vmstat/vmstat.cSun Oct 26 20:48:26 2014
(r273709)
@@ -828,7 +828,7 @@ dovmstat(unsigned int interval, int reps
 }
 
 static void
-printhdr(int ncpus, u_long cpumask)
+printhdr(int maxid, u_long cpumask)
 {
int i, num_shown;
 
@@ -844,7 +844,7 @@ printhdr(int ncpus, u_long cpumask)
(void)printf("   disk");
(void)printf("   faults  ");
if (Pflag) {
-   for (i = 0; i < ncpus; i++) {
+   for (i = 0; i <= maxid; i++) {
if (cpumask & (1ul << i))
printf("  cpu%d   ", i);
}
@@ -864,7 +864,7 @@ printhdr(int ncpus, u_long cpumask)
 dev_select[i].unit_number);
(void)printf("  insycs");
if (Pflag) {
-   for (i = 0; i < ncpus; i++) {
+   for (i = 0; i <= maxid; i++) {
if (cpumask & (1ul << i))
printf(" us sy id");
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-10-26 Thread Neel Natu
Author: neel
Date: Sun Oct 26 21:17:44 2014
New Revision: 273710
URL: https://svnweb.freebsd.org/changeset/base/273710

Log:
  Add a comment explaining the intent behind the I/O reservation [0x72-0x77].

Modified:
  head/usr.sbin/bhyve/rtc.c

Modified: head/usr.sbin/bhyve/rtc.c
==
--- head/usr.sbin/bhyve/rtc.c   Sun Oct 26 20:48:26 2014(r273709)
+++ head/usr.sbin/bhyve/rtc.c   Sun Oct 26 21:17:44 2014(r273710)
@@ -375,4 +375,8 @@ rtc_dsdt(void)
 }
 LPC_DSDT(rtc_dsdt);
 
+/*
+ * Reserve the extended RTC I/O ports although they are not emulated at this
+ * time.
+ */
 SYSRES_IO(0x72, 6);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273711 - head/sys/cam/ctl

2014-10-26 Thread Alexander Motin
Author: mav
Date: Sun Oct 26 23:25:42 2014
New Revision: 273711
URL: https://svnweb.freebsd.org/changeset/base/273711

Log:
  Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand.
  
  These commands are rare, but consume additional 256KB RAM per LUN.
  
  MFC after:1 week

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Oct 26 21:17:44 2014(r273710)
+++ head/sys/cam/ctl/ctl.c  Sun Oct 26 23:25:42 2014(r273711)
@@ -4735,6 +4735,7 @@ ctl_free_lun(struct ctl_lun *lun)
ctl_tpc_lun_shutdown(lun);
mtx_destroy(&lun->lun_lock);
free(lun->lun_devid, M_CTL);
+   free(lun->write_buffer, M_CTL);
if (lun->flags & CTL_LUN_MALLOCED)
free(lun, M_CTL);
 
@@ -5726,7 +5727,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio
len = scsi_3btoul(cdb->length);
buffer_offset = scsi_3btoul(cdb->offset);
 
-   if (buffer_offset + len > sizeof(lun->write_buffer)) {
+   if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) {
ctl_set_invalid_field(ctsio,
  /*sks_valid*/ 1,
  /*command*/ 1,
@@ -5739,14 +5740,19 @@ ctl_read_buffer(struct ctl_scsiio *ctsio
 
if ((cdb->byte2 & RWB_MODE) == RWB_MODE_DESCR) {
descr[0] = 0;
-   scsi_ulto3b(sizeof(lun->write_buffer), &descr[1]);
+   scsi_ulto3b(CTL_WRITE_BUFFER_SIZE, &descr[1]);
ctsio->kern_data_ptr = descr;
len = min(len, sizeof(descr));
} else if ((cdb->byte2 & RWB_MODE) == RWB_MODE_ECHO_DESCR) {
ctsio->kern_data_ptr = echo_descr;
len = min(len, sizeof(echo_descr));
-   } else
+   } else {
+   if (lun->write_buffer == NULL) {
+   lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE,
+   M_CTL, M_WAITOK);
+   }
ctsio->kern_data_ptr = lun->write_buffer + buffer_offset;
+   }
ctsio->kern_data_len = len;
ctsio->kern_total_len = len;
ctsio->kern_data_resid = 0;
@@ -5784,7 +5790,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi
len = scsi_3btoul(cdb->length);
buffer_offset = scsi_3btoul(cdb->offset);
 
-   if (buffer_offset + len > sizeof(lun->write_buffer)) {
+   if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) {
ctl_set_invalid_field(ctsio,
  /*sks_valid*/ 1,
  /*command*/ 1,
@@ -5800,6 +5806,10 @@ ctl_write_buffer(struct ctl_scsiio *ctsi
 * malloc it and tell the caller the data buffer is here.
 */
if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
+   if (lun->write_buffer == NULL) {
+   lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE,
+   M_CTL, M_WAITOK);
+   }
ctsio->kern_data_ptr = lun->write_buffer + buffer_offset;
ctsio->kern_data_len = len;
ctsio->kern_total_len = len;

Modified: head/sys/cam/ctl/ctl_private.h
==
--- head/sys/cam/ctl/ctl_private.h  Sun Oct 26 21:17:44 2014
(r273710)
+++ head/sys/cam/ctl/ctl_private.h  Sun Oct 26 23:25:42 2014
(r273711)
@@ -384,6 +384,8 @@ struct ctl_devid {
  */
 #define NUM_TARGET_PORT_GROUPS 2
 
+#define CTL_WRITE_BUFFER_SIZE  262144
+
 struct tpc_list;
 struct ctl_lun {
struct mtx  lun_lock;
@@ -417,7 +419,7 @@ struct ctl_lun {
int pr_key_count;
uint32_tpr_res_idx;
uint8_t res_type;
-   uint8_t write_buffer[262144];
+   uint8_t *write_buffer;
struct ctl_devid*lun_devid;
TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists;
 };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273716 - head/sys/sparc64/sparc64

2014-10-26 Thread Alan Cox
Author: alc
Date: Mon Oct 27 01:10:40 2014
New Revision: 273716
URL: https://svnweb.freebsd.org/changeset/base/273716

Log:
  Simplify memrw().
  
  MFC after:10 days

Modified:
  head/sys/sparc64/sparc64/mem.c

Modified: head/sys/sparc64/sparc64/mem.c
==
--- head/sys/sparc64/sparc64/mem.c  Mon Oct 27 00:47:55 2014
(r273715)
+++ head/sys/sparc64/sparc64/mem.c  Mon Oct 27 01:10:40 2014
(r273716)
@@ -65,13 +65,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -92,7 +92,6 @@ memrw(struct cdev *dev, struct uio *uio,
vm_size_t cnt;
vm_page_t m;
int error;
-   int i;
uint32_t colors;
 
cnt = 0;
@@ -124,15 +123,7 @@ memrw(struct cdev *dev, struct uio *uio,
cnt = ulmin(cnt, PAGE_SIZE - off);
cnt = ulmin(cnt, iov->iov_len);
 
-   m = NULL;
-   for (i = 0; phys_avail[i] != 0; i += 2) {
-   if (pa >= phys_avail[i] &&
-   pa < phys_avail[i + 1]) {
-   m = PHYS_TO_VM_PAGE(pa);
-   break;
-   }
-   }
-
+   m = vm_phys_paddr_to_vm_page(pa);
if (m != NULL) {
if (ova == 0) {
if (dcache_color_ignore == 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r272386 - in head: sbin/ifconfig share/man/man4 sys/net

2014-10-26 Thread Lawrence Stewart
Hi Hiroki-san,

On 10/02/14 07:37, Hiroki Sato wrote:
> Author: hrs
> Date: Wed Oct  1 21:37:32 2014
> New Revision: 272386
> URL: https://svnweb.freebsd.org/changeset/base/272386
> 
> Log:
>   Virtualize lagg(4) cloner.  This change fixes a panic when tearing down
>   if_lagg(4) interfaces which were cloned in a vnet jail.
>   
>   Sysctl nodes which are dynamically generated for each cloned interface
>   (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift
>   ifconfig(8) parameters have been added instead.  Flags and per-interface
>   statistics counters are displayed in "ifconfig -v".
>   
>   CR: D842
> 
> Modified:
>   head/sbin/ifconfig/ifconfig.8
>   head/sbin/ifconfig/iflagg.c
>   head/share/man/man4/lagg.4
>   head/sys/net/ieee8023ad_lacp.c
>   head/sys/net/if_lagg.c
>   head/sys/net/if_lagg.h

What was the reasoning for removing the net.link.lagg.* sysctls? We use
them at Netflix and the new way of obtaining the information via
ifconfig -v is less structured and significantly higher overhead by
comparison. Would be good to have the sysctls back or an equivalent low
overhead way of obtaining the previously available information.

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


svn commit: r273717 - head/lib/libc/gen

2014-10-26 Thread Mark Johnston
Author: markj
Date: Mon Oct 27 04:09:23 2014
New Revision: 273717
URL: https://svnweb.freebsd.org/changeset/base/273717

Log:
  getgrouplist(3) was reimplemented in terms of getgrent_r(3) in r174547, so
  this bug is no longer valid.
  
  MFC after:3 days

Modified:
  head/lib/libc/gen/getgrouplist.3
  head/lib/libc/gen/initgroups.3

Modified: head/lib/libc/gen/getgrouplist.3
==
--- head/lib/libc/gen/getgrouplist.3Mon Oct 27 01:10:40 2014
(r273716)
+++ head/lib/libc/gen/getgrouplist.3Mon Oct 27 04:09:23 2014
(r273717)
@@ -28,7 +28,7 @@
 .\" @(#)getgrouplist.3 8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd February 20, 2012
+.Dd October 26, 2014
 .Dt GETGROUPLIST 3
 .Os
 .Sh NAME
@@ -80,13 +80,3 @@ The
 .Fn getgrouplist
 function first appeared in
 .Bx 4.4 .
-.Sh BUGS
-The
-.Fn getgrouplist
-function
-uses the routines based on
-.Xr getgrent 3 .
-If the invoking program uses any of these routines,
-the group structure will
-be overwritten in the call to
-.Fn getgrouplist .

Modified: head/lib/libc/gen/initgroups.3
==
--- head/lib/libc/gen/initgroups.3  Mon Oct 27 01:10:40 2014
(r273716)
+++ head/lib/libc/gen/initgroups.3  Mon Oct 27 04:09:23 2014
(r273717)
@@ -28,7 +28,7 @@
 .\" @(#)initgroups.3   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd October 26, 2014
 .Dt INITGROUPS 3
 .Os
 .Sh NAME
@@ -80,14 +80,3 @@ The
 .Fn initgroups
 function appeared in
 .Bx 4.2 .
-.Sh BUGS
-The
-.Fn getgrouplist
-function called by
-.Fn initgroups
-uses the routines based on
-.Xr getgrent 3 .
-If the invoking program uses any of these routines,
-the group structure will
-be overwritten in the call to
-.Fn initgroups .
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r273718 - head/contrib/tzdata

2014-10-26 Thread Edwin Groothuis
Author: edwin
Date: Mon Oct 27 05:50:02 2014
New Revision: 273718
URL: https://svnweb.freebsd.org/changeset/base/273718

Log:
  Merge of 273518, tzdata2014i
  
  Upgrade to 2014i
  
  Lots of historical data
  
  Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18
  Pacific/Bougainville will go from UTC+10 to UTC+11.
  Europe/Minsk will go from FET to MSK.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/antarctica
  head/contrib/tzdata/asia
  head/contrib/tzdata/australasia
  head/contrib/tzdata/backward
  head/contrib/tzdata/europe
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/zone.tab
  head/contrib/tzdata/zone1970.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==
--- head/contrib/tzdata/africa  Mon Oct 27 04:09:23 2014(r273717)
+++ head/contrib/tzdata/africa  Mon Oct 27 05:50:02 2014(r273718)
@@ -1,9 +1,10 @@
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
-# This data is by no means authoritative; if you think you know better,
+# This file is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
-# t...@iana.org for general use in the future).
+# t...@iana.org for general use in the future).  For more, please see
+# the file CONTRIBUTING in the tz distribution.
 
 # From Paul Eggert (2013-02-21):
 #
@@ -25,8 +26,8 @@
 # I found in the UCLA library.
 #
 # For data circa 1899, a common source is:
-# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
-# .
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
+# http://www.jstor.org/stable/1774359
 #
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@@ -93,9 +94,9 @@ Rule  Algeria 1980only-   Oct 31   2:00   
0   
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Africa/Algiers  0:12:12 -   LMT 1891 Mar 15 0:01
-   0:09:21 -   PMT 1911 Mar 11# Paris Mean Time
-   0:00Algeria WE%sT   1940 Feb 25 2:00
+Zone   Africa/Algiers  0:12:12 -   LMT 1891 Mar 15  0:01
+   0:09:21 -   PMT 1911 Mar 11 # Paris Mean Time
+   0:00Algeria WE%sT   1940 Feb 25  2:00
1:00Algeria CE%sT   1946 Oct  7
0:00-   WET 1956 Jan 29
1:00-   CET 1963 Apr 14
@@ -105,82 +106,57 @@ Zone  Africa/Algiers  0:12:12 -   LMT 1891 M
1:00-   CET
 
 # Angola
-# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Africa/Luanda   0:52:56 -   LMT 1892
-   0:52:04 -   AOT 1911 May 26 # Angola Time
-   1:00-   WAT
-
 # Benin
-# Whitman says they switched to 1:00 in 1946, not 1934;
-# go with Shanks & Pottenger.
-# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone Africa/Porto-Novo 0:10:28 -   LMT 1912
-   0:00-   GMT 1934 Feb 26
-   1:00-   WAT
+# See Africa/Lagos.
 
 # Botswana
-# From Paul Eggert (2013-02-21):
-# Milne says they were regulated by the Cape Town Signal in 1899;
-# assume they switched to 2:00 when Cape Town did.
-# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Africa/Gaborone 1:43:40 -   LMT 1885
-   1:30-   SAST1903 Mar
-   2:00-   CAT 1943 Sep 19 2:00
-   2:001:00CAST1944 Mar 19 2:00
-   2:00-   CAT
+# See Africa/Maputo.
 
 # Burkina Faso
 # See Africa/Abidjan.
 
 # Burundi
-# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone Africa/Bujumbura  1:57:28 -   LMT 1890
-   2:00-   CAT
+# See Africa/Maputo.
 
 # Cameroon
-# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger.
-# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone   Africa/Douala   0:38:48 -   LMT 1912
-   1:00-   WAT
+# See Africa/Lagos.
 
 # Cape Verde
+#
+# Shanks gives 1907 for the transition to CVT.
+# Perhaps the 1911-05-26 Portuguese decree
+# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# merely made it official?
+#
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
-Zone Atlantic/Cape_Verde -1:34:04 -LMT 1907# Praia
+Zone Atlantic/Cape_Verde -1:34:04 -LMT 1907# Praia
-2:00   -   CVT 1942 Sep