svn commit: r241340 - head/sys/dev/ale

2012-10-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Oct  8 07:01:07 2012
New Revision: 241340
URL: http://svn.freebsd.org/changeset/base/241340

Log:
  Fix typo. Check against number of allocated MSI-X vectors.
  There is no ale(4) controller that supports MSI-X so this is not
  real issue.
  
  PR:   kern/171825

Modified:
  head/sys/dev/ale/if_ale.c

Modified: head/sys/dev/ale/if_ale.c
==
--- head/sys/dev/ale/if_ale.c   Mon Oct  8 05:51:47 2012(r241339)
+++ head/sys/dev/ale/if_ale.c   Mon Oct  8 07:01:07 2012(r241340)
@@ -551,7 +551,7 @@ ale_attach(device_t dev)
if (msix_disable == 0 || msi_disable == 0) {
if (msix_disable == 0  msixc == ALE_MSIX_MESSAGES 
pci_alloc_msix(dev, msixc) == 0) {
-   if (msic == ALE_MSIX_MESSAGES) {
+   if (msixc == ALE_MSIX_MESSAGES) {
device_printf(dev, Using %d MSIX messages.\n,
msixc);
sc-ale_flags |= ALE_FLAG_MSIX;
___
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: r241341 - head/sys/dev/bge

2012-10-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Oct  8 07:13:45 2012
New Revision: 241341
URL: http://svn.freebsd.org/changeset/base/241341

Log:
  Limit applying TX data corruption and FIFO workaround to BCM5719
  A0. It's believed BCM5720 does not have the issue.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Mon Oct  8 07:01:07 2012(r241340)
+++ head/sys/dev/bge/if_bge.c   Mon Oct  8 07:13:45 2012(r241341)
@@ -2121,8 +2121,8 @@ bge_blockinit(struct bge_softc *sc)
 * Adjust tx margin to prevent TX data corruption and
 * fix internal FIFO overflow.
 */
-   if (sc-bge_asicrev == BGE_ASICREV_BCM5719 ||
-   sc-bge_asicrev == BGE_ASICREV_BCM5720) {
+   if (sc-bge_asicrev == BGE_ASICREV_BCM5719 
+   sc-bge_chipid == BGE_CHIPID_BCM5719_A0) {
dmactl = ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK |
BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK |
BGE_RDMA_RSRVCTRL_TXMRGN_MASK);
___
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: r241342 - head/sys/netinet

2012-10-08 Thread Gleb Smirnoff
Author: glebius
Date: Mon Oct  8 07:21:32 2012
New Revision: 241342
URL: http://svn.freebsd.org/changeset/base/241342

Log:
  No reason to play with IP header before calling sctp_delayed_cksum()
  with offset beyond the IP header.

Modified:
  head/sys/netinet/ip_divert.c

Modified: head/sys/netinet/ip_divert.c
==
--- head/sys/netinet/ip_divert.cMon Oct  8 07:13:45 2012
(r241341)
+++ head/sys/netinet/ip_divert.cMon Oct  8 07:21:32 2012
(r241342)
@@ -215,10 +215,8 @@ divert_packet(struct mbuf *m, int incomi
}
 #ifdef SCTP
if (m-m_pkthdr.csum_flags  CSUM_SCTP) {
-   ip-ip_len = ntohs(ip-ip_len);
sctp_delayed_cksum(m, (uint32_t)(ip-ip_hl  2));
m-m_pkthdr.csum_flags = ~CSUM_SCTP;
-   ip-ip_len = htons(ip-ip_len);
}
 #endif
bzero(divsrc, sizeof(divsrc));
___
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: r241343 - head/sys/dev/bge

2012-10-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Oct  8 07:33:43 2012
New Revision: 241343
URL: http://svn.freebsd.org/changeset/base/241343

Log:
  Rework device detach. While here, move driver lock/callout
  initialization to the beginning of device attach for readability.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Mon Oct  8 07:21:32 2012(r241342)
+++ head/sys/dev/bge/if_bge.c   Mon Oct  8 07:33:43 2012(r241343)
@@ -2875,7 +2875,9 @@ bge_attach(device_t dev)
sc = device_get_softc(dev);
sc-bge_dev = dev;
 
+   BGE_LOCK_INIT(sc, device_get_nameunit(dev));
TASK_INIT(sc-bge_intr_task, 0, bge_intr_task, sc);
+   callout_init_mtx(sc-bge_stat_ch, sc-bge_mtx, 0);
 
/*
 * Map control/status registers.
@@ -3234,8 +3236,6 @@ bge_attach(device_t dev)
 
bge_devinfo(sc);
 
-   BGE_LOCK_INIT(sc, device_get_nameunit(dev));
-
/* Try to reset the chip. */
if (bge_reset(sc)) {
device_printf(sc-bge_dev, chip reset failed\n);
@@ -3439,7 +3439,6 @@ again:
 * Call MI attach routine.
 */
ether_ifattach(ifp, eaddr);
-   callout_init_mtx(sc-bge_stat_ch, sc-bge_mtx, 0);
 
/* Tell upper layer we support long frames. */
ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
@@ -3456,7 +3455,7 @@ again:
if (sc-bge_tq == NULL) {
device_printf(dev, could not create taskqueue.\n);
ether_ifdetach(ifp);
-   error = ENXIO;
+   error = ENOMEM;
goto fail;
}
taskqueue_start_threads(sc-bge_tq, 1, PI_NET, %s taskq,
@@ -3464,23 +3463,19 @@ again:
error = bus_setup_intr(dev, sc-bge_irq,
INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc,
sc-bge_intrhand);
-   if (error)
-   ether_ifdetach(ifp);
} else
error = bus_setup_intr(dev, sc-bge_irq,
INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc,
sc-bge_intrhand);
 
if (error) {
-   bge_detach(dev);
+   ether_ifdetach(ifp);
device_printf(sc-bge_dev, couldn't set up irq\n);
}
 
-   return (0);
-
 fail:
-   bge_release_resources(sc);
-
+   if (error)
+   bge_detach(dev);
return (error);
 }
 
@@ -3498,16 +3493,16 @@ bge_detach(device_t dev)
ether_poll_deregister(ifp);
 #endif
 
-   BGE_LOCK(sc);
-   bge_stop(sc);
-   bge_reset(sc);
-   BGE_UNLOCK(sc);
-
-   callout_drain(sc-bge_stat_ch);
+   if (device_is_attached(dev)) {
+   ether_ifdetach(ifp);
+   BGE_LOCK(sc);
+   bge_stop(sc);
+   BGE_UNLOCK(sc);
+   callout_drain(sc-bge_stat_ch);
+   }
 
if (sc-bge_tq)
taskqueue_drain(sc-bge_tq, sc-bge_intr_task);
-   ether_ifdetach(ifp);
 
if (sc-bge_flags  BGE_FLAG_TBI) {
ifmedia_removeall(sc-bge_ifmedia);
___
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: r241344 - in head/sys: netgraph netinet netinet6 netpfil/ipfw netpfil/pf

2012-10-08 Thread Gleb Smirnoff
Author: glebius
Date: Mon Oct  8 08:03:58 2012
New Revision: 241344
URL: http://svn.freebsd.org/changeset/base/241344

Log:
After r241245 it appeared that in_delayed_cksum(), which still expects
  host byte order, was sometimes called with net byte order. Since we are
  moving towards net byte order throughout the stack, the function was
  converted to expect net byte order, and its consumers fixed appropriately:
- ip_output(), ipfilter(4) not changed, since already call
  in_delayed_cksum() with header in net byte order.
- divert(4), ng_nat(4), ipfw_nat(4) now don't need to swap byte order
  there and back.
- mrouting code and IPv6 ipsec now need to switch byte order there and
  back, but I hope, this is temporary solution.
- In ipsec(4) shifted switch to net byte order prior to in_delayed_cksum().
- pf_route() catches up on r241245 changes to ip_output().

Modified:
  head/sys/netgraph/ng_nat.c
  head/sys/netinet/ip_divert.c
  head/sys/netinet/ip_ipsec.c
  head/sys/netinet/ip_mroute.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/ip6_ipsec.c
  head/sys/netpfil/ipfw/ip_fw_nat.c
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netgraph/ng_nat.c
==
--- head/sys/netgraph/ng_nat.c  Mon Oct  8 07:33:43 2012(r241343)
+++ head/sys/netgraph/ng_nat.c  Mon Oct  8 08:03:58 2012(r241344)
@@ -756,18 +756,18 @@ ng_nat_rcvdata(hook_p hook, item_p item 
 */
 
if (th-th_x2) {
+   uint16_t ip_len = ntohs(ip-ip_len);
+
th-th_x2 = 0;
-   ip-ip_len = ntohs(ip-ip_len);
th-th_sum = in_pseudo(ip-ip_src.s_addr,
ip-ip_dst.s_addr, htons(IPPROTO_TCP +
-   ip-ip_len - (ip-ip_hl  2)));
+   ip_len - (ip-ip_hl  2)));

if ((m-m_pkthdr.csum_flags  CSUM_TCP) == 0) {
m-m_pkthdr.csum_data = offsetof(struct tcphdr,
th_sum);
in_delayed_cksum(m);
}
-   ip-ip_len = htons(ip-ip_len);
}
}
 

Modified: head/sys/netinet/ip_divert.c
==
--- head/sys/netinet/ip_divert.cMon Oct  8 07:33:43 2012
(r241343)
+++ head/sys/netinet/ip_divert.cMon Oct  8 08:03:58 2012
(r241344)
@@ -208,10 +208,8 @@ divert_packet(struct mbuf *m, int incomi
 
/* Delayed checksums are currently not compatible with divert. */
if (m-m_pkthdr.csum_flags  CSUM_DELAY_DATA) {
-   ip-ip_len = ntohs(ip-ip_len);
in_delayed_cksum(m);
m-m_pkthdr.csum_flags = ~CSUM_DELAY_DATA;
-   ip-ip_len = htons(ip-ip_len);
}
 #ifdef SCTP
if (m-m_pkthdr.csum_flags  CSUM_SCTP) {

Modified: head/sys/netinet/ip_ipsec.c
==
--- head/sys/netinet/ip_ipsec.c Mon Oct  8 07:33:43 2012(r241343)
+++ head/sys/netinet/ip_ipsec.c Mon Oct  8 08:03:58 2012(r241344)
@@ -332,6 +332,9 @@ ip_ipsec_output(struct mbuf **m, struct 
}
}
 
+   ip-ip_len = htons(ip-ip_len);
+   ip-ip_off = htons(ip-ip_off);
+
/*
 * Do delayed checksums now because we send before
 * this is done in the normal processing path.
@@ -346,8 +349,6 @@ ip_ipsec_output(struct mbuf **m, struct 
(*m)-m_pkthdr.csum_flags = ~CSUM_SCTP;
}
 #endif
-   ip-ip_len = htons(ip-ip_len);
-   ip-ip_off = htons(ip-ip_off);
 
/* NB: callee frees mbuf */
*error = ipsec4_process_packet(*m, sp-req, *flags, 0);

Modified: head/sys/netinet/ip_mroute.c
==
--- head/sys/netinet/ip_mroute.cMon Oct  8 07:33:43 2012
(r241343)
+++ head/sys/netinet/ip_mroute.cMon Oct  8 08:03:58 2012
(r241344)
@@ -2376,7 +2376,10 @@ pim_register_prepare(struct ip *ip, stru
 
 /* Take care of delayed checksums */
 if (m-m_pkthdr.csum_flags  CSUM_DELAY_DATA) {
+   /* XXX: in_delayed_cksum() expects net byte order */
+   ip-ip_len = htons(ip-ip_len);
in_delayed_cksum(m);
+   ip-ip_len = ntohs(ip-ip_len);
m-m_pkthdr.csum_flags = ~CSUM_DELAY_DATA;
 }
 

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cMon Oct  8 07:33:43 2012
(r241343)
+++ head/sys/netinet/ip_output.cMon Oct  8 08:03:58 2012
(r241344)
@@ -882,11 +882,12 @@ void
 

Re: svn commit: r241298 - in head: . gnu/usr.bin/cc/cc_int gnu/usr.bin/cc/include kerberos5 kerberos5/tools/asn1_compile kerberos5/tools/slc lib/clang/include share/mk tools/build/make_check usr.sbin/

2012-10-08 Thread Bruce Evans

On Sun, 7 Oct 2012, Marcel Moolenaar wrote:


On Oct 6, 2012, at 10:31 PM, Bruce Evans b...@optusnet.com.au wrote:


On Sat, 6 Oct 2012, Marcel Moolenaar wrote:


Log:
Add support for bmake. This includes:

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkSat Oct  6 19:57:27 2012(r241297)
+++ head/share/mk/bsd.dep.mkSat Oct  6 20:01:05 2012(r241298)
@@ -102,8 +102,8 @@ ${_YC} y.tab.h: ${_YSRC}
CLEANFILES+= y.tab.c y.tab.h
.elif !empty(YFLAGS:M-d)
.for _YH in ${_YC:R}.h
-.ORDER: ${_YC} ${_YH}
-${_YC} ${_YH}: ${_YSRC}
+${_YH}: ${_YC}
+${_YC}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
SRCS+=  ${_YH}
CLEANFILES+= ${_YH}


This is broken.  Yacc headers don't depend on generated yacc .c files.
Now there is only a null rule to create the headers.  One broken case
is when the header somehow gets deleted.  It bcomes out of date, but
running make to update it only runs the null rule, so it remains
nonexistent.


The problem with the old rule is that it's broken as well. The
change attempts to fix a real parallel build problem. Your
comment is valid though. What about the following (possibly
white-space corrupted) patch from Simon:


What's wrong with the old rule?  It uses the .ORDER directive to force
creation of the 2 generated files in sequential order, so that parallel
builds can't happen.


Index: share/mk/bsd.dep.mk
===
--- share/mk/bsd.dep.mk (revision 241871)
+++ share/mk/bsd.dep.mk (working copy)
@@ -95,16 +95,17 @@ CLEANFILES+= ${_LC}
SRCS:=  ${SRCS:S/${_YSRC}/${_YC}/}
CLEANFILES+= ${_YC}
.if !empty(YFLAGS:M-d)  !empty(SRCS:My.tab.h)
-.ORDER: ${_YC} y.tab.h
-${_YC} y.tab.h: ${_YSRC}
+y.tab.h: ${_YSRC}
${YACC} ${YFLAGS} ${.ALLSRC}
+${_YC}: y.tab.h
cp y.tab.c ${_YC}
CLEANFILES+= y.tab.c y.tab.h
.elif !empty(YFLAGS:M-d)
.for _YH in ${_YC:R}.h
-${_YH}: ${_YC}
-${_YC}: ${_YSRC}
+${_YH}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
+${_YC}: ${_YH}
+   @touch ${.TARGET}
SRCS+=  ${_YH}
CLEANFILES+= ${_YH}
.endfor

This makes sure the C file is always more recent than the H
file and important to keep make happy in all situations. It
doesn't fix the the problem of removing the C file entirely.
At least the C file is recreated, but not with the right
contents.


I don't like it much.

With better yacc(1) options, we could run separate yacc commands to
create each file, but that requires 2 commands in all cases so it is
not more efficient than a working .ORDER.  It could avoid the separate
cp command.  Hmm, is that command the only actual problem?  The
dependencies and ordering are incomplete for the intermediate file
y.tab.c, so it might be clobbered before it is copied.  This case is
just compatibility cruft for sources that don't name the yacc header
sensibily, but use the bad old default name y.tab.h even if they don't
use y.tab.c directly.  Such sources are still too common.

I see many ways to make the cp step more robust, so this is easy to
fix if it is the problem.  A mv instead of a cp would be more robust,
but is intentionally not used, since the y.tab.c has self references
which are used by at least (gdb) debugging.  y.tab.c is kept so that
these references are to an existent file (just not the actual source
file).

Bruce
___
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: r241345 - head

2012-10-08 Thread Doug Barton
Author: dougb
Date: Mon Oct  8 10:34:49 2012
New Revision: 241345
URL: http://svn.freebsd.org/changeset/base/241345

Log:
  Remove my pre-commit review request for mergemaster

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSMon Oct  8 08:03:58 2012(r241344)
+++ head/MAINTAINERSMon Oct  8 10:34:49 2012(r241345)
@@ -21,7 +21,6 @@ It is not a registry of 'turf' or privat
 subsystem  login   notes
 -
 kqueue jmg Pre-commit review requested.
-mergemasterdougb   Prefers to pre-approve commits
 libc/posix1e   rwatson Pre-commit review requested.
 POSIX.1e ACLs  rwatson Pre-commit review requested.
 UFS EAsrwatson Pre-commit review requested.
___
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: r241221 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump

2012-10-08 Thread Peter Jeremy
On 2012-Oct-05 07:51:21 +, Gleb Smirnoff gleb...@freebsd.org wrote:
Provide ability for printing and decoding pfsync(4) traffic. This
  doesn't mean supporting IFT_PFSYNC (which I hope will eventually
  die). This means decoding packets with IP protocol of 240 caught
  on any normal interface like Ethernet.

You might like to look at bin/124825 as well.

-- 
Peter Jeremy


pgpFEsnxzNhtD.pgp
Description: PGP signature


svn commit: r241349 - head/sys/netinet6

2012-10-08 Thread Andriy Gapon
Author: avg
Date: Mon Oct  8 13:45:40 2012
New Revision: 241349
URL: http://svn.freebsd.org/changeset/base/241349

Log:
  ip6_ipsec_output: fix a typo in r241344
  
  Acting as a remote drone of glebius.

Modified:
  head/sys/netinet6/ip6_ipsec.c

Modified: head/sys/netinet6/ip6_ipsec.c
==
--- head/sys/netinet6/ip6_ipsec.c   Mon Oct  8 13:14:00 2012
(r241348)
+++ head/sys/netinet6/ip6_ipsec.c   Mon Oct  8 13:45:40 2012
(r241349)
@@ -300,7 +300,7 @@ ip6_ipsec_output(struct mbuf **m, struct
ipseclog((LOG_DEBUG,
%s: we do not support IPv4 over IPv6, __func__));
/* XXX: in_delayed_cksum() expects net byte order */
-   ip = mtod(m, struct ip *);
+   ip = mtod(*m, struct ip *);
ip-ip_len = htons(ip-ip_len);
in_delayed_cksum(*m);
ip-ip_len = ntohs(ip-ip_len);
___
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: r241351 - head/sys/modules

2012-10-08 Thread David E. O'Brien
Author: obrien
Date: Mon Oct  8 14:08:13 2012
New Revision: 241351
URL: http://svn.freebsd.org/changeset/base/241351

Log:
  Restrict the module to varied environments.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Mon Oct  8 14:05:00 2012(r241350)
+++ head/sys/modules/Makefile   Mon Oct  8 14:08:13 2012(r241351)
@@ -108,7 +108,7 @@ SUBDIR= \
fdc \
fdescfs \
${_fe} \
-   filemon \
+   ${_filemon} \
firewire \
firmware \
${_fxp} \
@@ -364,6 +364,10 @@ SUBDIR=\
${_zfs} \
zlib \
 
+.if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
+_filemon=  filemon
+.endif
+
 .if ${MACHINE_CPUARCH} != powerpc  ${MACHINE_CPUARCH} != arm  \
${MACHINE_CPUARCH} != mips
 _syscons=  syscons
___
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: r241353 - in head/sys/i386: i386 xen

2012-10-08 Thread Alan Cox
Author: alc
Date: Mon Oct  8 16:57:05 2012
New Revision: 241353
URL: http://svn.freebsd.org/changeset/base/241353

Log:
  In a few places, like the implementation of ptrace(), a thread may call
  upon pmap_enter() to create a mapping within a different address space,
  i.e., not the thread's own address space.  On i386, this entails the
  creation of a temporary mapping to the affected page table page (PTP).  In
  general, pmap_enter() will read from this PTP, allocate a PV entry, and
  write to this PTP.  The trouble comes when the system is short of memory.
  In order to allocate a new PV entry, an older PV entry has to be
  reclaimed.  Reclaiming a PV entry involves destroying a mapping, which
  requires access to the affected PTP.  Thus, the PTP mapped at the
  beginning of pmap_enter() is no longer mapped at the end of pmap_enter(),
  which leads to pmap_enter() modifying the wrong PTP.  To address this
  problem, pmap_pv_reclaim() is changed to use an alternate method of
  mapping PTPs.
  
  Update a related comment.
  
  Reported by:  pho
  Diagnosed by: kib
  MFC after:5 days

Modified:
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Mon Oct  8 16:00:33 2012(r241352)
+++ head/sys/i386/i386/pmap.c   Mon Oct  8 16:57:05 2012(r241353)
@@ -475,7 +475,8 @@ pmap_bootstrap(vm_paddr_t firstaddr)
KPTmap -= i386_btop(KPTDI  PDRSHIFT);
 
/*
-* ptemap is used for pmap_pte_quick
+* PADDR1 and PADDR2 are used by pmap_pte_quick() and pmap_pte(),
+* respectively.
 */
SYSMAP(pt_entry_t *, PMAP1, PADDR1, 1)
SYSMAP(pt_entry_t *, PMAP2, PADDR2, 1)
@@ -2228,7 +2229,6 @@ pmap_pv_reclaim(pmap_t locked_pmap)
pmap = NULL;
free = m_pc = NULL;
TAILQ_INIT(newtail);
-   sched_pin();
while ((pc = TAILQ_FIRST(pv_chunks)) != NULL  (pv_vafree == 0 ||
free == NULL)) {
TAILQ_REMOVE(pv_chunks, pc, pc_lru);
@@ -2262,10 +2262,13 @@ pmap_pv_reclaim(pmap_t locked_pmap)
pde = pmap_pde(pmap, va);
if ((*pde  PG_PS) != 0)
continue;
-   pte = pmap_pte_quick(pmap, va);
-   if ((*pte  PG_W) != 0)
+   pte = pmap_pte(pmap, va);
+   tpte = *pte;
+   if ((tpte  PG_W) == 0)
+   tpte = pte_load_clear(pte);
+   pmap_pte_release(pte);
+   if ((tpte  PG_W) != 0)
continue;
-   tpte = pte_load_clear(pte);
if ((tpte  PG_G) != 0)
pmap_invalidate_page(pmap, va);
m = PHYS_TO_VM_PAGE(tpte  PG_FRAME);
@@ -2323,7 +2326,6 @@ pmap_pv_reclaim(pmap_t locked_pmap)
}
}
 out:
-   sched_unpin();
TAILQ_CONCAT(pv_chunks, newtail, pc_lru);
if (pmap != NULL) {
pmap_invalidate_all(pmap);

Modified: head/sys/i386/xen/pmap.c
==
--- head/sys/i386/xen/pmap.cMon Oct  8 16:00:33 2012(r241352)
+++ head/sys/i386/xen/pmap.cMon Oct  8 16:57:05 2012(r241353)
@@ -429,7 +429,8 @@ pmap_bootstrap(vm_paddr_t firstaddr)
SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize)))
 
/*
-* ptemap is used for pmap_pte_quick
+* PADDR1 and PADDR2 are used by pmap_pte_quick() and pmap_pte(),
+* respectively.
 */
SYSMAP(pt_entry_t *, PMAP1, PADDR1, 1)
SYSMAP(pt_entry_t *, PMAP2, PADDR2, 1)
@@ -1976,7 +1977,6 @@ pmap_pv_reclaim(pmap_t locked_pmap)
pmap = NULL;
free = m_pc = NULL;
TAILQ_INIT(newtail);
-   sched_pin();
while ((pc = TAILQ_FIRST(pv_chunks)) != NULL  (pv_vafree == 0 ||
free == NULL)) {
TAILQ_REMOVE(pv_chunks, pc, pc_lru);
@@ -2007,10 +2007,13 @@ pmap_pv_reclaim(pmap_t locked_pmap)
bit = bsfl(inuse);
pv = pc-pc_pventry[field * 32 + bit];
va = pv-pv_va;
-   pte = pmap_pte_quick(pmap, va);
-   if ((*pte  PG_W) != 0)
+   pte = pmap_pte(pmap, va);
+   tpte = *pte;
+   if ((tpte  PG_W) == 0)
+   tpte = pte_load_clear(pte);
+   pmap_pte_release(pte);
+   if ((tpte  PG_W) != 0)

Re: svn commit: r241298 - in head: . gnu/usr.bin/cc/cc_int gnu/usr.bin/cc/include kerberos5 kerberos5/tools/asn1_compile kerberos5/tools/slc lib/clang/include share/mk tools/build/make_check usr.sbin/

2012-10-08 Thread Marcel Moolenaar

On Oct 8, 2012, at 1:08 AM, Bruce Evans b...@optusnet.com.au wrote:

 On Sun, 7 Oct 2012, Marcel Moolenaar wrote:
 
 On Oct 6, 2012, at 10:31 PM, Bruce Evans b...@optusnet.com.au wrote:
 
 On Sat, 6 Oct 2012, Marcel Moolenaar wrote:
 
 Log:
 Add support for bmake. This includes:
 
 Modified: head/share/mk/bsd.dep.mk
 ==
 --- head/share/mk/bsd.dep.mk   Sat Oct  6 19:57:27 2012
 (r241297)
 +++ head/share/mk/bsd.dep.mk   Sat Oct  6 20:01:05 2012
 (r241298)
 @@ -102,8 +102,8 @@ ${_YC} y.tab.h: ${_YSRC}
 CLEANFILES+= y.tab.c y.tab.h
 .elif !empty(YFLAGS:M-d)
 .for _YH in ${_YC:R}.h
 -.ORDER: ${_YC} ${_YH}
 -${_YC} ${_YH}: ${_YSRC}
 +${_YH}: ${_YC}
 +${_YC}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
 SRCS+= ${_YH}
 CLEANFILES+= ${_YH}
 
 This is broken.  Yacc headers don't depend on generated yacc .c files.
 Now there is only a null rule to create the headers.  One broken case
 is when the header somehow gets deleted.  It bcomes out of date, but
 running make to update it only runs the null rule, so it remains
 nonexistent.
 
 The problem with the old rule is that it's broken as well. The
 change attempts to fix a real parallel build problem. Your
 comment is valid though. What about the following (possibly
 white-space corrupted) patch from Simon:
 
 What's wrong with the old rule?  It uses the .ORDER directive to force
 creation of the 2 generated files in sequential order, so that parallel
 builds can't happen.

Since the source file is re-created when the header is created,
any parallel work done with the C file is a problem.

At HP, where we used clearcase  clearmake, we had to create
an intermediate tarfile, the result of the yacc(1) rule and
then have the .h and .c file depend on the tarfile. Each got
unique created by extracting only ${.TARGET}.

Roughly and loosely speaking:

.tar: .y
yacc and create tar file

.c: .tar
tar x y.tab.c

.h: .tar
tar x y.tab.h

I think something like this is the only way to get something
that's 100% correct.

-- 
Marcel Moolenaar
mar...@xcllnt.net


___
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: r241356 - head/sys/i386/i386

2012-10-08 Thread Konstantin Belousov
Author: kib
Date: Mon Oct  8 18:33:08 2012
New Revision: 241356
URL: http://svn.freebsd.org/changeset/base/241356

Log:
  Add several asserts to i386 pmap, which mostly state that pv entry shall
  have corresponding pte.
  
  Reviewed by:  alc
  Tested by:pho
  MFC after:3 days

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Mon Oct  8 17:27:54 2012(r241355)
+++ head/sys/i386/i386/pmap.c   Mon Oct  8 18:33:08 2012(r241356)
@@ -2269,6 +2269,9 @@ pmap_pv_reclaim(pmap_t locked_pmap)
pmap_pte_release(pte);
if ((tpte  PG_W) != 0)
continue;
+   KASSERT(tpte != 0,
+   (pmap_pv_reclaim: pmap %p va %x zero pte,
+   pmap, va));
if ((tpte  PG_G) != 0)
pmap_invalidate_page(pmap, va);
m = PHYS_TO_VM_PAGE(tpte  PG_FRAME);
@@ -2865,6 +2868,8 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t 
rw_assert(pvh_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
oldpte = pte_load_clear(ptq);
+   KASSERT(oldpte != 0,
+   (pmap_remove_pte: pmap %p va %x zero pte, pmap, va));
if (oldpte  PG_W)
pmap-pm_stats.wired_count -= 1;
/*
@@ -3069,6 +3074,8 @@ small_mappings:
 a 4mpage in page %p's pv list, m));
pte = pmap_pte_quick(pmap, pv-pv_va);
tpte = pte_load_clear(pte);
+   KASSERT(tpte != 0, (pmap_remove_all: pmap %p va %x zero pte,
+   pmap, pv-pv_va));
if (tpte  PG_W)
pmap-pm_stats.wired_count--;
if (tpte  PG_A)
@@ -4368,6 +4375,8 @@ pmap_remove_pages(pmap_t pmap)
PMAP_LOCK(pmap);
sched_pin();
TAILQ_FOREACH_SAFE(pc, pmap-pm_pvchunk, pc_list, npc) {
+   KASSERT(pc-pc_pmap == pmap, (Wrong pmap %p %p, pmap,
+   pc-pc_pmap));
allfree = 1;
for (field = 0; field  _NPCM; field++) {
inuse = ~pc-pc_map[field]  pc_freemask[field];
___
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