svn commit: r204274 - in head/sys: dev/cxgb dev/cxgb/common dev/cxgb/ulp/iw_cxgb dev/cxgb/ulp/tom modules/cxgb/cxgb

2010-02-24 Thread Navdeep Parhar
Author: np
Date: Wed Feb 24 10:16:18 2010
New Revision: 204274
URL: http://svn.freebsd.org/changeset/base/204274

Log:
  There is no need to test __FreeBSD_version for features that have
  been around for a long time now (7.1-ish or even earlier); assume
  they are present.  These includes MSI, TSO, LRO, VLAN, INTR_FILTERS,
  FIRMWARE, etc.
  
  Also, eliminate some dead code and clean up in other places as part
  of this quick once-over.
  
  MFC after:1 week

Deleted:
  head/sys/dev/cxgb/common/cxgb_version.h
  head/sys/dev/cxgb/cxgb_config.h
Modified:
  head/sys/dev/cxgb/common/cxgb_common.h
  head/sys/dev/cxgb/common/cxgb_t3_hw.c
  head/sys/dev/cxgb/cxgb_adapter.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_offload.h
  head/sys/dev/cxgb/cxgb_osdep.h
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
  head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c
  head/sys/modules/cxgb/cxgb/Makefile

Modified: head/sys/dev/cxgb/common/cxgb_common.h
==
--- head/sys/dev/cxgb/common/cxgb_common.h  Wed Feb 24 07:53:29 2010
(r204273)
+++ head/sys/dev/cxgb/common/cxgb_common.h  Wed Feb 24 10:16:18 2010
(r204274)
@@ -392,11 +392,9 @@ struct adapter_params {
 
const struct adapter_info *info;
 
-#ifdef CONFIG_CHELSIO_T3_CORE
unsigned short mtus[NMTUS];
unsigned short a_wnd[NCCTRL_WIN];
unsigned short b_wnd[NCCTRL_WIN];
-#endif
unsigned int   nports;  /* # of ethernet ports */
unsigned int   chan_map;/* bitmap of in-use Tx channels */
unsigned int   stats_update_period; /* MAC stats accumulation period */
@@ -650,11 +648,7 @@ static inline int is_10G(const adapter_t
 
 static inline int is_offload(const adapter_t *adap)
 {
-#if defined(CONFIG_CHELSIO_T3_CORE)
return adap-params.offload;
-#else
-   return 0;
-#endif
 }
 
 static inline unsigned int core_ticks_per_usec(const adapter_t *adap)
@@ -772,7 +766,6 @@ void t3_mc5_intr_handler(struct mc5 *mc5
 int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int 
n,
  u32 *buf);
 
-#ifdef CONFIG_CHELSIO_T3_CORE
 int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh);
 void t3_tp_set_max_rxsize(adapter_t *adap, unsigned int size);
 void t3_tp_get_mib_stats(adapter_t *adap, struct tp_mib_stats *tps);
@@ -793,7 +786,6 @@ void t3_get_tx_sched(adapter_t *adap, un
 void t3_read_pace_tbl(adapter_t *adap, unsigned int pace_vals[NTX_SCHED]);
 void t3_set_pace_tbl(adapter_t *adap, unsigned int *pace_vals,
 unsigned int start, unsigned int n);
-#endif
 
 int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index,
 u32 *size, void *data);

Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c
==
--- head/sys/dev/cxgb/common/cxgb_t3_hw.c   Wed Feb 24 07:53:29 2010
(r204273)
+++ head/sys/dev/cxgb/common/cxgb_t3_hw.c   Wed Feb 24 10:16:18 2010
(r204274)
@@ -3263,7 +3263,6 @@ static void tp_set_timers(adapter_t *ada
 #undef SECONDS
 }
 
-#ifdef CONFIG_CHELSIO_T3_CORE
 /**
  * t3_tp_set_coalescing_size - set receive coalescing size
  * @adap: the adapter
@@ -3566,7 +3565,6 @@ int t3_set_proto_sram(adapter_t *adap, c
}
return 0;
 }
-#endif
 
 /**
  * t3_config_trace_filter - configure one of the tracing filters
@@ -4150,14 +4148,12 @@ int t3_init_hw(adapter_t *adapter, u32 f
if (tp_init(adapter, adapter-params.tp))
goto out_err;
 
-#ifdef CONFIG_CHELSIO_T3_CORE
t3_tp_set_coalescing_size(adapter,
  min(adapter-params.sge.max_pkt_size,
  MAX_RX_COALESCING_LEN), 1);
t3_tp_set_max_rxsize(adapter,
 min(adapter-params.sge.max_pkt_size, 16384U));
ulp_config(adapter, adapter-params.tp);
-#endif
if (is_pcie(adapter))
config_pcie(adapter);
else
@@ -4508,10 +4504,8 @@ int __devinit t3_prep_adapter(adapter_t 
adapter-params.mc5.nroutes = 0;
t3_mc5_prep(adapter, adapter-mc5, MC5_MODE_144_BIT);
 
-#ifdef CONFIG_CHELSIO_T3_CORE
init_mtus(adapter-params.mtus);
init_cong_ctrl(adapter-params.a_wnd, adapter-params.b_wnd);
-#endif
}
 
early_hw_init(adapter, ai);

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==
--- head/sys/dev/cxgb/cxgb_adapter.hWed Feb 24 07:53:29 2010
(r204273)
+++ head/sys/dev/cxgb/cxgb_adapter.hWed Feb 24 10:16:18 2010
(r204274)
@@ -46,6 +46,7 @@ $FreeBSD$
 #include net/if.h
 #include net/if_media.h
 #include net/if_dl.h
+#include netinet/tcp_lro.h
 
 #include machine/bus.h
 #include machine/resource.h
@@ 

svn commit: r204275 - head/share/man/man9

2010-02-24 Thread John Baldwin
Author: jhb
Date: Wed Feb 24 13:13:29 2010
New Revision: 204275
URL: http://svn.freebsd.org/changeset/base/204275

Log:
  Fix spelling of EACCES.
  
  PR:   docs/144112
  Submitted by: Alexander Best
  MFC after:3 days

Modified:
  head/share/man/man9/namei.9

Modified: head/share/man/man9/namei.9
==
--- head/share/man/man9/namei.9 Wed Feb 24 10:16:18 2010(r204274)
+++ head/share/man/man9/namei.9 Wed Feb 24 13:13:29 2010(r204275)
@@ -333,7 +333,7 @@ or an entire pathname exceeded 1023 char
 .It Bq Er ENOENT
 A component of the specified pathname does not exist,
 or the pathname is an empty string.
-.It Bq Er ACCES
+.It Bq Er EACCES
 An attempt is made to access a file in a way forbidden by its file access
 permissions.
 .It Bq Er ELOOP
___
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: r204276 - head/bin/sh

2010-02-24 Thread Jaakko Heinonen
Author: jh
Date: Wed Feb 24 14:19:56 2010
New Revision: 204276
URL: http://svn.freebsd.org/changeset/base/204276

Log:
  Fix expansion of \W in prompt strings when the working directory is /.
  The prompt string was truncated after \W when the working directory was /.
  
  PR:   bin/89410
  Submitted by: Dr Balwinder Singh Dheeman
  MFC after:1 week

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cWed Feb 24 13:13:29 2010(r204275)
+++ head/bin/sh/parser.cWed Feb 24 14:19:56 2010(r204276)
@@ -1641,7 +1641,7 @@ getprompt(void *unused __unused)
case 'w':
ps[i] = '\0';
getcwd(ps[i], PROMPTLEN - i);
-   if (*fmt == 'W') {
+   if (*fmt == 'W'  ps[i + 1] != '\0') {
/* Final path component only. */
trim = 1;
for (j = i; ps[j] != '\0'; j++)
___
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: r204278 - head/sys/kern

2010-02-24 Thread Brooks Davis
Author: brooks
Date: Wed Feb 24 15:52:18 2010
New Revision: 204278
URL: http://svn.freebsd.org/changeset/base/204278

Log:
  Don't inforce an upper bound on kern.ngroups.  The INT_MAX-1 limit was
  too high due to several overflows.  The actual limit is somewhere in the
  neighborhood of INT_MAX/4 on 64-bit machines, but most systems could not
  support such a limit due to a lack of memory and the cost of duplicate
  credentials.
  
  Reported by:  bde

Modified:
  head/sys/kern/subr_param.c

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Wed Feb 24 15:27:31 2010(r204277)
+++ head/sys/kern/subr_param.c  Wed Feb 24 15:52:18 2010(r204278)
@@ -240,8 +240,6 @@ init_param1(void)
TUNABLE_INT_FETCH(kern.ngroups, ngroups_max);
if (ngroups_max  NGROUPS_MAX)
ngroups_max = NGROUPS_MAX;
-   if (ngroups_max  INT_MAX - 1)
-   ngroups_max = INT_MAX - 1;
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204280 - head/sys/arm/conf

2010-02-24 Thread Bruce Cran
Author: brucec
Date: Wed Feb 24 19:28:15 2010
New Revision: 204280
URL: http://svn.freebsd.org/changeset/base/204280

Log:
  Update the commented out option for omitting the sysctl descriptions; it
  was committed as NO_SYSCTL_DESCR.
  
  Approved by:  rrs (mentor)

Modified:
  head/sys/arm/conf/BWCT
  head/sys/arm/conf/HL200
  head/sys/arm/conf/KB920X

Modified: head/sys/arm/conf/BWCT
==
--- head/sys/arm/conf/BWCT  Wed Feb 24 15:54:24 2010(r204279)
+++ head/sys/arm/conf/BWCT  Wed Feb 24 19:28:15 2010(r204280)
@@ -63,7 +63,7 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
+#options   NO_SYSCTL_DESCR
 optionsMUTEX_NOINLINE
 optionsRWLOCK_NOINLINE
 optionsNO_FFS_SNAPSHOT

Modified: head/sys/arm/conf/HL200
==
--- head/sys/arm/conf/HL200 Wed Feb 24 15:54:24 2010(r204279)
+++ head/sys/arm/conf/HL200 Wed Feb 24 19:28:15 2010(r204280)
@@ -59,7 +59,7 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
+#options   NO_SYSCTL_DESCR
 optionsMUTEX_NOINLINE
 optionsRWLOCK_NOINLINE
 optionsNO_FFS_SNAPSHOT

Modified: head/sys/arm/conf/KB920X
==
--- head/sys/arm/conf/KB920XWed Feb 24 15:54:24 2010(r204279)
+++ head/sys/arm/conf/KB920XWed Feb 24 19:28:15 2010(r204280)
@@ -57,7 +57,7 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
+#options   NO_SYSCTL_DESCR
 # Disable the inlining of mutex, rwlock and sx locks.  These eat up a lot
 # of space.
 optionsMUTEX_NOINLINE
___
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: r204283 - head/sys/arm/mv

2010-02-24 Thread Rafal Jaworowski
Author: raj
Date: Wed Feb 24 20:31:00 2010
New Revision: 204283
URL: http://svn.freebsd.org/changeset/base/204283

Log:
  Do not force verbose and single mode in non-metadata boot case.
  
  We want to go multi-user by default also in case of booting without loader(8).

Modified:
  head/sys/arm/mv/mv_machdep.c

Modified: head/sys/arm/mv/mv_machdep.c
==
--- head/sys/arm/mv/mv_machdep.cWed Feb 24 20:20:02 2010
(r204282)
+++ head/sys/arm/mv/mv_machdep.cWed Feb 24 20:31:00 2010
(r204283)
@@ -406,8 +406,7 @@ initarm(void *mdp, void *unused __unused
}
availmem_regions_sz = i;
} else {
-   /* Fall back to hardcoded boothowto flags and metadata. */
-   boothowto = RB_VERBOSE | RB_SINGLE;
+   /* Fall back to hardcoded metadata. */
lastaddr = fake_preload_metadata();
 
/*
___
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: r204294 - head/tools/regression/sockets/sendfile

2010-02-24 Thread Bruce Cran
Author: brucec
Date: Wed Feb 24 23:00:16 2010
New Revision: 204294
URL: http://svn.freebsd.org/changeset/base/204294

Log:
  Update the sendfile regression test so that it outputs results in the
  TAP format.
  Add a checksum to verify that the data hasn't been corrupted between
  being read from disk and being received.
  
  Approved by:  rrs (mentor)

Modified:
  head/tools/regression/sockets/sendfile/Makefile
  head/tools/regression/sockets/sendfile/sendfile.c

Modified: head/tools/regression/sockets/sendfile/Makefile
==
--- head/tools/regression/sockets/sendfile/Makefile Wed Feb 24 22:16:16 
2010(r204293)
+++ head/tools/regression/sockets/sendfile/Makefile Wed Feb 24 23:00:16 
2010(r204294)
@@ -5,5 +5,6 @@
 PROG=  sendfile
 NO_MAN=
 WARNS?=6
+LDADD = -lmd
 
 .include bsd.prog.mk

Modified: head/tools/regression/sockets/sendfile/sendfile.c
==
--- head/tools/regression/sockets/sendfile/sendfile.c   Wed Feb 24 22:16:16 
2010(r204293)
+++ head/tools/regression/sockets/sendfile/sendfile.c   Wed Feb 24 23:00:16 
2010(r204294)
@@ -29,11 +29,14 @@
 #include sys/types.h
 #include sys/socket.h
 #include sys/stat.h
+#include sys/wait.h
 
 #include netinet/in.h
 
 #include err.h
+#include errno.h
 #include limits.h
+#include md5.h
 #include signal.h
 #include stdint.h
 #include stdio.h
@@ -47,113 +50,192 @@
  * of cases and performing limited validation.
  */
 
+#define FAIL(msg)  {printf(# %s\n, msg); \
+   return (-1);}
+
+#define FAIL_ERR(msg)  {printf(# %s: %s\n, msg, strerror(errno)); \
+   return (-1);}
+
 #defineTEST_PORT   5678
 #defineTEST_MAGIC  0x4440f7bb
 #defineTEST_PAGES  4
 #defineTEST_SECONDS30
 
 struct test_header {
-   u_int32_t   th_magic;
-   u_int32_t   th_header_length;
-   u_int32_t   th_offset;
-   u_int32_t   th_length;
+   uint32_tth_magic;
+   uint32_tth_header_length;
+   uint32_tth_offset;
+   uint32_tth_length;
+   charth_md5[33];
+};
+
+struct sendfile_test {
+   uint32_thdr_length;
+   uint32_toffset;
+   uint32_tlength;
 };
 
-pid_t  child_pid, parent_pid;
-intlisten_socket;
 intfile_fd;
+char   path[PATH_MAX];
+intlisten_socket;
+intaccept_socket;
+
+static int test_th(struct test_header *th, uint32_t *header_length,
+   uint32_t *offset, uint32_t *length);
+static void signal_alarm(int signum);
+static void setup_alarm(int seconds);
+static void cancel_alarm(void);
+static int receive_test(void);
+static void run_child(void);
+static int new_test_socket(int *connect_socket);
+static void init_th(struct test_header *th, uint32_t header_length, 
+   uint32_t offset, uint32_t length);
+static int send_test(int connect_socket, struct sendfile_test);
+static void run_parent(void);
+static void cleanup(void);
+
 
 static int
-test_th(struct test_header *th, u_int32_t *header_length, u_int32_t *offset,
-u_int32_t *length)
+test_th(struct test_header *th, uint32_t *header_length, uint32_t *offset, 
+   uint32_t *length)
 {
 
if (th-th_magic != htonl(TEST_MAGIC))
-   return (0);
+   FAIL(magic number not found in header)
*header_length = ntohl(th-th_header_length);
*offset = ntohl(th-th_offset);
*length = ntohl(th-th_length);
-   return (1);
+   return (0);
 }
 
 static void
 signal_alarm(int signum)
 {
-
(void)signum;
+
+   printf(# test timeout\n);
+
+   if (accept_socket  0)
+   close(accept_socket);
+   if (listen_socket  0)
+   close(listen_socket);
+
+   _exit(-1);
 }
 
 static void
 setup_alarm(int seconds)
 {
+   struct itimerval itv;
+   bzero(itv, sizeof(itv));
+   (void)seconds;
+   itv.it_value.tv_sec = seconds;
 
signal(SIGALRM, signal_alarm);
-   alarm(seconds);
+   setitimer(ITIMER_REAL, itv, NULL);
 }
 
 static void
 cancel_alarm(void)
 {
-
-   alarm(0);
-   signal(SIGALRM, SIG_DFL);
+   struct itimerval itv;
+   bzero(itv, sizeof(itv));
+   setitimer(ITIMER_REAL, itv, NULL);
 }
 
-static void
-receive_test(int accept_socket)
+static int
+receive_test(void)
 {
-   u_int32_t header_length, offset, length, counter;
+   uint32_t header_length, offset, length, counter;
struct test_header th;
ssize_t len;
-   char ch;
+   char buf[10240];
+   MD5_CTX md5ctx;
+   char *rxmd5;
 
len = read(accept_socket, th, sizeof(th));
-   if (len  0)
-   err(1, read);
-   if ((size_t)len  sizeof(th))
-   errx(1, read: %zd, len);
+   if (len  0 || (size_t)len  sizeof(th))
+  

svn commit: r204296 - head/sys/powerpc/aim

2010-02-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Feb 25 03:49:17 2010
New Revision: 204296
URL: http://svn.freebsd.org/changeset/base/204296

Log:
  Provide an implementation of pmap_dev_direct_mapped() on OEA64. This is
  required in order to be able to mmap the running kernel, which is turn
  required to avoid fstat returning gibberish.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cThu Feb 25 00:46:51 2010
(r204295)
+++ head/sys/powerpc/aim/mmu_oea64.cThu Feb 25 03:49:17 2010
(r204296)
@@ -2410,7 +2410,22 @@ moea64_clear_bit(vm_page_t m, u_int64_t 
 boolean_t
 moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size)
 {
-   return (EFAULT);
+   struct pvo_entry *pvo;
+   vm_offset_t ppa;
+   int error = 0;
+
+   PMAP_LOCK(kernel_pmap);
+   for (ppa = pa  ~ADDR_POFF; ppa  pa + size; ppa += PAGE_SIZE) {
+   pvo = moea64_pvo_find_va(kernel_pmap, ppa, NULL);
+   if (pvo == NULL ||
+   (pvo-pvo_pte.lpte.pte_lo  LPTE_RPGN) != ppa) {
+   error = EFAULT;
+   break;
+   }
+   }
+   PMAP_UNLOCK(kernel_pmap);
+
+   return (error);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204297 - head/sys/powerpc/aim

2010-02-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Feb 25 03:53:21 2010
New Revision: 204297
URL: http://svn.freebsd.org/changeset/base/204297

Log:
  Move the OEA64 scratchpage to the end of KVA from the beginning, and set
  its PVO to map physical address 0 instead of kernelstart. This fixes a
  situation in which a user process could attempt to return this address
  via KVM, have it fault while being modified, and then panic the kernel
  because (a) it is supposed to map a valid address and (b) it lies in the
  no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail.
  
  While here, move msgbuf and dpcpu make into regular KVA space for
  consistency with other implementations.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cThu Feb 25 03:49:17 2010
(r204296)
+++ head/sys/powerpc/aim/mmu_oea64.cThu Feb 25 03:53:21 2010
(r204297)
@@ -970,10 +970,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 
mtx_init(moea64_scratchpage_mtx, pvo zero page, NULL, MTX_DEF);
for (i = 0; i  2; i++) {
-   moea64_scratchpage_va[i] = virtual_avail;
-   virtual_avail += PAGE_SIZE;
+   moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE;
+   virtual_end -= PAGE_SIZE;
 
-   moea64_kenter(mmup,moea64_scratchpage_va[i],kernelstart);
+   moea64_kenter(mmup,moea64_scratchpage_va[i],0);
 
LOCK_TABLE();
moea64_scratchpage_pvo[i] = moea64_pvo_find_va(kernel_pmap,
@@ -1004,20 +1004,25 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 * Allocate virtual address space for the message buffer.
 */
pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE);
-   msgbufp = (struct msgbuf *)msgbuf_phys;
-   while (pa - msgbuf_phys  MSGBUF_SIZE) {
-   moea64_kenter(mmup, pa, pa);
+   msgbufp = (struct msgbuf *)virtual_avail;
+   va = virtual_avail;
+   virtual_avail += round_page(MSGBUF_SIZE);
+   while (va  virtual_avail) {
+   moea64_kenter(mmup, va, pa);
pa += PAGE_SIZE;
+   va += PAGE_SIZE;
}
 
/*
 * Allocate virtual address space for the dynamic percpu area.
 */
pa = moea64_bootstrap_alloc(DPCPU_SIZE, PAGE_SIZE);
-   dpcpu = (void *)pa;
-   while (pa - (vm_offset_t)dpcpu  DPCPU_SIZE) {
-   moea64_kenter(mmup, pa, pa);
+   dpcpu = (void *)virtual_avail;
+   virtual_avail += DPCPU_SIZE;
+   while (va  virtual_avail) {
+   moea64_kenter(mmup, va, pa);
pa += PAGE_SIZE;
+   va += PAGE_SIZE;
}
dpcpu_init(dpcpu, 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: r204297 - head/sys/powerpc/aim

2010-02-24 Thread Nathan Whitehorn

I can't seem to type the correct words tonight. This should have read:

 Move the OEA64 scratchpage to the end of KVA from the beginning, and set
 its PVO to map physical address 0 instead of kernelstart. This fixes a
 situation in which a user process could attempt to read this address
 via KVM, have it fault while being modified, and then panic the kernel
 because (a) it is supposed to map a valid address and (b) it lies in the
 no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail.
 
 While here, move msgbuf and dpcpu back into regular KVA space for

 consistency with other implementations.

-Nathan


Nathan Whitehorn wrote:

Author: nwhitehorn
Date: Thu Feb 25 03:53:21 2010
New Revision: 204297
URL: http://svn.freebsd.org/changeset/base/204297

Log:
  Move the OEA64 scratchpage to the end of KVA from the beginning, and set
  its PVO to map physical address 0 instead of kernelstart. This fixes a
  situation in which a user process could attempt to return this address
  via KVM, have it fault while being modified, and then panic the kernel
  because (a) it is supposed to map a valid address and (b) it lies in the
  no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail.
  
  While here, move msgbuf and dpcpu make into regular KVA space for

  consistency with other implementations.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cThu Feb 25 03:49:17 2010
(r204296)
+++ head/sys/powerpc/aim/mmu_oea64.cThu Feb 25 03:53:21 2010
(r204297)
@@ -970,10 +970,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 
 	mtx_init(moea64_scratchpage_mtx, pvo zero page, NULL, MTX_DEF);

for (i = 0; i  2; i++) {
-   moea64_scratchpage_va[i] = virtual_avail;
-   virtual_avail += PAGE_SIZE;
+   moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE;
+   virtual_end -= PAGE_SIZE;
 
-		moea64_kenter(mmup,moea64_scratchpage_va[i],kernelstart);

+   moea64_kenter(mmup,moea64_scratchpage_va[i],0);
 
 		LOCK_TABLE();

moea64_scratchpage_pvo[i] = moea64_pvo_find_va(kernel_pmap,
@@ -1004,20 +1004,25 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 * Allocate virtual address space for the message buffer.
 */
pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE);
-   msgbufp = (struct msgbuf *)msgbuf_phys;
-   while (pa - msgbuf_phys  MSGBUF_SIZE) {
-   moea64_kenter(mmup, pa, pa);
+   msgbufp = (struct msgbuf *)virtual_avail;
+   va = virtual_avail;
+   virtual_avail += round_page(MSGBUF_SIZE);
+   while (va  virtual_avail) {
+   moea64_kenter(mmup, va, pa);
pa += PAGE_SIZE;
+   va += PAGE_SIZE;
}
 
 	/*

 * Allocate virtual address space for the dynamic percpu area.
 */
pa = moea64_bootstrap_alloc(DPCPU_SIZE, PAGE_SIZE);
-   dpcpu = (void *)pa;
-   while (pa - (vm_offset_t)dpcpu  DPCPU_SIZE) {
-   moea64_kenter(mmup, pa, pa);
+   dpcpu = (void *)virtual_avail;
+   virtual_avail += DPCPU_SIZE;
+   while (va  virtual_avail) {
+   moea64_kenter(mmup, va, pa);
pa += PAGE_SIZE;
+   va += PAGE_SIZE;
}
dpcpu_init(dpcpu, 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


svn commit: r204298 - head/contrib/tzdata

2010-02-24 Thread Edwin Groothuis
Author: edwin
Date: Thu Feb 25 06:31:05 2010
New Revision: 204298
URL: http://svn.freebsd.org/changeset/base/204298

Log:
  Copy share/zoneinfo to contrib/zoneinfo for the proper split of
  contributed data and FreeBSD specific data.

Added:
 - copied from r204297, head/share/zoneinfo/
Directory Properties:
  head/contrib/tzdata/   (props changed)
___
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: r204300 - head/share/zoneinfo

2010-02-24 Thread Edwin Groothuis
Author: edwin
Date: Thu Feb 25 06:44:16 2010
New Revision: 204300
URL: http://svn.freebsd.org/changeset/base/204300

Log:
  Officially speaking, the zoneinfo data files are contributed data.
  Therefore treat them as such.

Deleted:
  head/share/zoneinfo/africa
  head/share/zoneinfo/antarctica
  head/share/zoneinfo/asia
  head/share/zoneinfo/australasia
  head/share/zoneinfo/backward
  head/share/zoneinfo/etcetera
  head/share/zoneinfo/europe
  head/share/zoneinfo/factory
  head/share/zoneinfo/leapseconds
  head/share/zoneinfo/northamerica
  head/share/zoneinfo/pacificnew
  head/share/zoneinfo/southamerica
  head/share/zoneinfo/systemv
  head/share/zoneinfo/yearistype.sh
  head/share/zoneinfo/zone.tab
Modified:
  head/share/zoneinfo/Makefile

Modified: head/share/zoneinfo/Makefile
==
--- head/share/zoneinfo/MakefileThu Feb 25 06:35:21 2010
(r204299)
+++ head/share/zoneinfo/MakefileThu Feb 25 06:44:16 2010
(r204300)
@@ -29,6 +29,8 @@
 #
 
 CLEANFILES+=   yearistype
+CONTRIBDIR=${.CURDIR}/../../contrib/tzdata/
+.PATH: ${CONTRIBDIR}
 
 .if defined(LEAPSECONDS)
 LEAPFILE=  -L leapseconds
@@ -44,6 +46,8 @@ POSIXRULES=   America/New_York
 TZFILES+=  backward systemv
 .endif
 
+TZFILES:=  ${TZFILES:S/^/${CONTRIBDIR}/}
+
 all: yearistype
 
 beforeinstall:
@@ -52,7 +56,7 @@ beforeinstall:
-u ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
-   ${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
+   ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
 
 afterinstall:
 #
___
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: r204302 - head/contrib/tzcode/zic

2010-02-24 Thread Edwin Groothuis
Author: edwin
Date: Thu Feb 25 06:53:46 2010
New Revision: 204302
URL: http://svn.freebsd.org/changeset/base/204302

Log:
  Copy usr.sbin/zic to contrib/tzcode/zic for the proper split of
  contributed code and FreeBSD specific code.

Added:
 - copied from r204301, head/usr.sbin/zic/
Directory Properties:
  head/contrib/tzcode/zic/   (props changed)
___
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