svn commit: r350497 - head/sys/net

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 13:42:58 2019
New Revision: 350497
URL: https://svnweb.freebsd.org/changeset/base/350497

Log:
  ppp: correct echo-req magic number on big endian archs
  
  The magic number is a 32-bit quantity; use uint32_t to match hton's
  return type and avoid sending zeros (upper 32 bits) on big-endian
  architectures.
  
  PR:   184141
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/if_spppsubr.c

Modified: head/sys/net/if_spppsubr.c
==
--- head/sys/net/if_spppsubr.c  Thu Aug  1 06:35:33 2019(r350496)
+++ head/sys/net/if_spppsubr.c  Thu Aug  1 13:42:58 2019(r350497)
@@ -4803,7 +4803,7 @@ sppp_keepalive(void *dummy)
sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ,
 ++sp->pp_seq[IDX_LCP], sp->pp_rseq[IDX_LCP]);
else if (sp->pp_phase >= PHASE_AUTHENTICATE) {
-   long nmagic = htonl (sp->lcp.magic);
+   uint32_t nmagic = htonl(sp->lcp.magic);
sp->lcp.echoid = ++sp->pp_seq[IDX_LCP];
sppp_cp_send (sp, PPP_LCP, ECHO_REQ,
sp->lcp.echoid, 4, &nmagic);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350498 - head/contrib/telnet/telnet

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 13:46:04 2019
New Revision: 350498
URL: https://svnweb.freebsd.org/changeset/base/350498

Log:
  telnet: use asprintf for r349890 change
  
  Suggested by: imp
  MFC after:3 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/telnet/telnet/commands.c

Modified: head/contrib/telnet/telnet/commands.c
==
--- head/contrib/telnet/telnet/commands.c   Thu Aug  1 13:42:58 2019
(r350497)
+++ head/contrib/telnet/telnet/commands.c   Thu Aug  1 13:46:04 2019
(r350498)
@@ -1655,14 +1655,11 @@ env_init(void)
|| (strncmp((char *)ep->value, "unix:", 5) == 0))) {
char hbuf[256+1];
char *cp2 = strchr((char *)ep->value, ':');
-size_t buflen;
 
gethostname(hbuf, sizeof(hbuf));
hbuf[sizeof(hbuf)-1] = '\0';
-   buflen = strlen(hbuf) + strlen(cp2) + 1;
-   cp = (char *)malloc(sizeof(char)*buflen);
+   asprintf(&cp, "%s%s", hbuf, cp2);
assert(cp != NULL);
-   snprintf((char *)cp, buflen, "%s%s", hbuf, cp2);
free(ep->value);
ep->value = (unsigned char *)cp;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r349863 - in head/sys/contrib/dev/acpica: . compiler components/dispatcher components/events components/executer components/namespace components/tables components/utilities include

2019-08-01 Thread Scott Long
Hi,

I need to ask that this be backed out.  I have two systems that are failing
to boot when this revision is present.  One I can’t debug because it causes
USB to fail to probe, leaving me without a working console (and no network
access for other reasons).  The other fails in a different way and livelocks
the system:


ixl1: flags=8843 metric 0 mtu 1500

options=e507bb
ether ac:1f:6b:0a:4a:57
media: Ethernet autoselect (1000baseT )
status: active
nd6 options=29
Starting devd.

Here the boot hangs.  If I hit Ctrl-C, I get this:

^CACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex 
[ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434)
ACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex 
[ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434)
ACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex 
[ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434)

Breaking into DDB gives this:
db> bt
Tracing pid 11 tid 100012 td 0xf800038a85a0
acpi_cpu_idle_mwait() at acpi_cpu_idle_mwait+0x70/frame 0xfe5a4180
acpi_cpu_idle() at acpi_cpu_idle+0x183/frame 0xfe5a41d0
cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfe5a41f0
cpu_idle() at cpu_idle+0xa6/frame 0xfe5a4210
sched_idletd() at sched_idletd+0x442/frame 0xfe5a42f0
fork_exit() at fork_exit+0x83/frame 0xfe5a4330
fork_trampoline() at fork_trampoline+0xe/frame 0xfe5a4330
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
db> ps
  pid  ppid  pgrp   uid  state   wmesg   wchan   cmd
  401   39959 0  S+  piperd  0xf80005214000  sort
  400   39959 0  S+  acmtx   0xf80003770280  devmatch
…
100247   S   acmtx   0xf80003770280  [usbus0]
...
db> bt 100315
Thread 100315 not found
db> bt 400
Tracing pid 400 tid 100339 td 0xf8002a52c5a0
sched_switch() at sched_switch+0x64a/frame 0xfe00b4c21d20
mi_switch() at mi_switch+0xe2/frame 0xfe00b4c21d50
sleepq_catch_signals() at sleepq_catch_signals+0x425/frame 0xfe00b4c21da0
sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfe00b4c21dd0
_sleep() at _sleep+0x1bf/frame 0xfe00b4c21e50
AcpiOsAcquireMutex() at AcpiOsAcquireMutex+0xab/frame 0xfe00b4c21ea0
AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x3d/frame 0xfe00b4c21ee0
AcpiGetObjectInfo() at AcpiGetObjectInfo+0x51/frame 0xfe00b4c21f60
acpi_child_pnpinfo_str_method() at acpi_child_pnpinfo_str_method+0x24/frame 
0xfe00b4c21f90
sysctl_devices() at sysctl_devices+0x215/frame 0xfe00b4c21fe0
sysctl_root_handler_locked() at sysctl_root_handler_locked+0x8b/frame 
0xfe00b4c22020
sysctl_root() at sysctl_root+0x24d/frame 0xfe00b4c220a0
userland_sysctl() at userland_sysctl+0x17a/frame 0xfe00b4c22150
sys___sysctl() at sys___sysctl+0x5f/frame 0xfe00b4c22200
amd64_syscall() at amd64_syscall+0x3b0/frame 0xfe00b4c22330
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfe00b4c22330
--- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041cb2a, rsp = 
0x7fffda78, rbp = 0x7fffdab0 ---
db> bt 100247
Tracing pid 45 tid 100247 td 0xf800077045a0
sched_switch() at sched_switch+0x64a/frame 0xfe00a7f76dc0
mi_switch() at mi_switch+0xe2/frame 0xfe00a7f76df0
sleepq_catch_signals() at sleepq_catch_signals+0x425/frame 0xfe00a7f76e40
sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfe00a7f76e70
_sleep() at _sleep+0x1bf/frame 0xfe00a7f76ef0
AcpiOsAcquireMutex() at AcpiOsAcquireMutex+0xab/frame 0xfe00a7f76f40
AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x3d/frame 0xfe00a7f76f80
AcpiNsGetNode() at AcpiNsGetNode+0x27/frame 0xfe00a7f77020
AcpiNsEvaluate() at AcpiNsEvaluate+0x1a7/frame 0xfe00a7f77060
AcpiEvaluateObject() at AcpiEvaluateObject+0x196/frame 0xfe00a7f770c0
acpi_GetInteger() at acpi_GetInteger+0x3f/frame 0xfe00a7f77120
acpi_get_domain() at acpi_get_domain+0x92/frame 0xfe00a7f77170
device_attach() at device_attach+0x2e7/frame 0xfe00a7f771c0
device_probe_and_attach() at device_probe_and_attach+0x42/frame 
0xfe00a7f771f0
usb_probe_and_attach() at usb_probe_and_attach+0x282/frame 0xfe00a7f77280
usb_bus_attach() at usb_bus_attach+0x1b3/frame 0xfe00a7f772b0
usb_process() at usb_process+0xf5/frame 0xfe00a7f772f0
fork_exit() at fork_exit+0x83/frame 0xfe00a7f77330
fork_trampoline() at fork_trampoline+0xe/frame 0xfe00a7f77330
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
db> 

It looks like there’s a leaked mutex inside of ACPI.  Not sure
what’s up with thread 100315, but thread 400 is a dead
give-away.  If I revert the 20190703 ACPICA import then
everything is fine.  I don’t know yet if this is the same problem
on my first system, but both work fine without this revision,
and the hung usb thread is also very telling.

Please consider reverting this from HEAD while we debug it
further.

Thanks,
Scott


> On Jul 9, 2019, at 12:02 PM, Jung-uk Kim  wrote:
> 
> Author: jkim
> Date: Tue Jul  9 18:02:36 2019
> Ne

svn commit: r350499 - head/sys/dev/acpica

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 14:02:59 2019
New Revision: 350499
URL: https://svnweb.freebsd.org/changeset/base/350499

Log:
  acpi_resource.c: mention ThunderX2 firmware revision with issue
  
  Presumably this will be fixed in the next version, and the workaround
  could eventually be removed.  See r330113 and r346066 details.

Modified:
  head/sys/dev/acpica/acpi_resource.c

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Thu Aug  1 13:46:04 2019
(r350498)
+++ head/sys/dev/acpica/acpi_resource.c Thu Aug  1 14:02:59 2019
(r350499)
@@ -477,7 +477,10 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
 arc.dev = dev;
 arc.ignore_producer_flag = false;
 
-/* UARTs on ThunderX2 set ResourceProducer on memory resources. */
+/*
+ * UARTs on ThunderX2 set ResourceProducer on memory resources, with
+ * 7.2 firmware.
+ */
 if (acpi_MatchHid(handle, "ARMH0011") != ACPI_MATCHHID_NOMATCH)
arc.ignore_producer_flag = true;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r349863 - in head/sys/contrib/dev/acpica: . compiler components/dispatcher components/events components/executer components/namespace components/tables components/utilities include

2019-08-01 Thread Alexander Motin
I was just got the same outcome, investigating my X11DPI-NT board boot
issue, same as reported on current@ thread "Re: Boot still broken from
r349133-r349160 - Was re:(Problem with USB after r349133)".  Revert of
this commit solves the issue, otherwise boot stops and I see the same
backtraces and messages as Scott.

On 01.08.2019 09:54, Scott Long wrote:
> Hi,
> 
> I need to ask that this be backed out.  I have two systems that are failing
> to boot when this revision is present.  One I can’t debug because it causes
> USB to fail to probe, leaving me without a working console (and no network
> access for other reasons).  The other fails in a different way and livelocks
> the system:
> 
> 
> ixl1: flags=8843 metric 0 mtu 1500
>   
> options=e507bb
>   ether ac:1f:6b:0a:4a:57
>   media: Ethernet autoselect (1000baseT )
>   status: active
>   nd6 options=29
> Starting devd.
> 
> Here the boot hangs.  If I hit Ctrl-C, I get this:
> 
> ^CACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex 
> [ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434)
> ACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex 
> [ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434)
> ACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex 
> [ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434)
> 
> Breaking into DDB gives this:
> db> bt
> Tracing pid 11 tid 100012 td 0xf800038a85a0
> acpi_cpu_idle_mwait() at acpi_cpu_idle_mwait+0x70/frame 0xfe5a4180
> acpi_cpu_idle() at acpi_cpu_idle+0x183/frame 0xfe5a41d0
> cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfe5a41f0
> cpu_idle() at cpu_idle+0xa6/frame 0xfe5a4210
> sched_idletd() at sched_idletd+0x442/frame 0xfe5a42f0
> fork_exit() at fork_exit+0x83/frame 0xfe5a4330
> fork_trampoline() at fork_trampoline+0xe/frame 0xfe5a4330
> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> db> ps
>   pid  ppid  pgrp   uid  state   wmesg   wchan   cmd
>   401   39959 0  S+  piperd  0xf80005214000  sort
>   400   39959 0  S+  acmtx   0xf80003770280  devmatch
> …
> 100247   S   acmtx   0xf80003770280  [usbus0]
> ...
> db> bt 100315
> Thread 100315 not found
> db> bt 400
> Tracing pid 400 tid 100339 td 0xf8002a52c5a0
> sched_switch() at sched_switch+0x64a/frame 0xfe00b4c21d20
> mi_switch() at mi_switch+0xe2/frame 0xfe00b4c21d50
> sleepq_catch_signals() at sleepq_catch_signals+0x425/frame 0xfe00b4c21da0
> sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfe00b4c21dd0
> _sleep() at _sleep+0x1bf/frame 0xfe00b4c21e50
> AcpiOsAcquireMutex() at AcpiOsAcquireMutex+0xab/frame 0xfe00b4c21ea0
> AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x3d/frame 0xfe00b4c21ee0
> AcpiGetObjectInfo() at AcpiGetObjectInfo+0x51/frame 0xfe00b4c21f60
> acpi_child_pnpinfo_str_method() at acpi_child_pnpinfo_str_method+0x24/frame 
> 0xfe00b4c21f90
> sysctl_devices() at sysctl_devices+0x215/frame 0xfe00b4c21fe0
> sysctl_root_handler_locked() at sysctl_root_handler_locked+0x8b/frame 
> 0xfe00b4c22020
> sysctl_root() at sysctl_root+0x24d/frame 0xfe00b4c220a0
> userland_sysctl() at userland_sysctl+0x17a/frame 0xfe00b4c22150
> sys___sysctl() at sys___sysctl+0x5f/frame 0xfe00b4c22200
> amd64_syscall() at amd64_syscall+0x3b0/frame 0xfe00b4c22330
> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfe00b4c22330
> --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041cb2a, rsp = 
> 0x7fffda78, rbp = 0x7fffdab0 ---
> db> bt 100247
> Tracing pid 45 tid 100247 td 0xf800077045a0
> sched_switch() at sched_switch+0x64a/frame 0xfe00a7f76dc0
> mi_switch() at mi_switch+0xe2/frame 0xfe00a7f76df0
> sleepq_catch_signals() at sleepq_catch_signals+0x425/frame 0xfe00a7f76e40
> sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfe00a7f76e70
> _sleep() at _sleep+0x1bf/frame 0xfe00a7f76ef0
> AcpiOsAcquireMutex() at AcpiOsAcquireMutex+0xab/frame 0xfe00a7f76f40
> AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x3d/frame 0xfe00a7f76f80
> AcpiNsGetNode() at AcpiNsGetNode+0x27/frame 0xfe00a7f77020
> AcpiNsEvaluate() at AcpiNsEvaluate+0x1a7/frame 0xfe00a7f77060
> AcpiEvaluateObject() at AcpiEvaluateObject+0x196/frame 0xfe00a7f770c0
> acpi_GetInteger() at acpi_GetInteger+0x3f/frame 0xfe00a7f77120
> acpi_get_domain() at acpi_get_domain+0x92/frame 0xfe00a7f77170
> device_attach() at device_attach+0x2e7/frame 0xfe00a7f771c0
> device_probe_and_attach() at device_probe_and_attach+0x42/frame 
> 0xfe00a7f771f0
> usb_probe_and_attach() at usb_probe_and_attach+0x282/frame 0xfe00a7f77280
> usb_bus_attach() at usb_bus_attach+0x1b3/frame 0xfe00a7f772b0
> usb_process() at usb_process+0xf5/frame 0xfe00a7f772f0
> fork_exit() at fork_exit+0x83/frame 0xfe00a7f77330
> fork_trampoline() at fork_trampoline+0xe/frame 0xfe00a7f77330
> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> db> 
> 
> It 

svn commit: r350500 - head/sys/conf

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 14:13:04 2019
New Revision: 350500
URL: https://svnweb.freebsd.org/changeset/base/350500

Log:
  newvers: append commit count to uname version string
  
  In a git world this provides a facsimile of a monotonically increasing
  version number.  This might be refined further, but this provides a
  starting point for investigation.
  
  Reviewed by:  cem
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20462

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shThu Aug  1 14:02:59 2019(r350499)
+++ head/sys/conf/newvers.shThu Aug  1 14:13:04 2019(r350500)
@@ -291,6 +291,10 @@ if [ -n "$git_cmd" ] ; then
git=" ${git}"
fi
fi
+   git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null)
+   if [ -n "$git_cnt" ] ; then
+   git="${git}-c${git_cnt}"
+   fi
git_b=$($git_cmd rev-parse --abbrev-ref HEAD)
if [ -n "$git_b" ] ; then
git="${git}(${git_b})"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350501 - in head/sys: conf dev/cxgbe dev/mlx5/mlx5_en net netinet

2019-08-01 Thread Randall Stewart
Author: rrs
Date: Thu Aug  1 14:17:31 2019
New Revision: 350501
URL: https://svnweb.freebsd.org/changeset/base/350501

Log:
  This adds the third step in getting BBR into the tree. BBR and
  an updated rack depend on having access to the new
  ratelimit api in this commit.
  
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D20953

Added:
  head/sys/netinet/tcp_ratelimit.c   (contents, props changed)
  head/sys/netinet/tcp_ratelimit.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sched.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/net/if_dead.c
  head/sys/net/if_lagg.c
  head/sys/net/if_var.h
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Aug  1 14:13:04 2019(r350500)
+++ head/sys/conf/files Thu Aug  1 14:17:31 2019(r350501)
@@ -4276,6 +4276,7 @@ netinet/tcp_lro.c optional inet | inet6
 netinet/tcp_output.c   optional inet | inet6
 netinet/tcp_offload.c  optional tcp_offload inet | tcp_offload inet6
 netinet/tcp_hpts.c  optional tcphpts inet | tcphpts inet6
+netinet/tcp_ratelimit.c optional ratelimit inet | ratelimit inet6
 netinet/tcp_pcap.c optional inet tcppcap | inet6 tcppcap \
compile-with "${NORMAL_C} ${NO_WNONNULL}"
 netinet/tcp_reass.coptional inet | inet6

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Aug  1 14:13:04 2019
(r350500)
+++ head/sys/dev/cxgbe/adapter.hThu Aug  1 14:17:31 2019
(r350501)
@@ -1247,6 +1247,7 @@ int cxgbe_snd_tag_modify(struct m_snd_tag *, union if_
 int cxgbe_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *);
 void cxgbe_snd_tag_free(struct m_snd_tag *);
 void cxgbe_snd_tag_free_locked(struct cxgbe_snd_tag *);
+void cxgbe_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results 
*);
 #endif
 
 /* t4_filter.c */

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Aug  1 14:13:04 2019
(r350500)
+++ head/sys/dev/cxgbe/t4_main.cThu Aug  1 14:17:31 2019
(r350501)
@@ -1658,6 +1658,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
ifp->if_snd_tag_modify = cxgbe_snd_tag_modify;
ifp->if_snd_tag_query = cxgbe_snd_tag_query;
ifp->if_snd_tag_free = cxgbe_snd_tag_free;
+   ifp->if_ratelimit_query = cxgbe_ratelimit_query;
 #endif
 
ifp->if_capabilities = T4_CAP;

Modified: head/sys/dev/cxgbe/t4_sched.c
==
--- head/sys/dev/cxgbe/t4_sched.c   Thu Aug  1 14:13:04 2019
(r350500)
+++ head/sys/dev/cxgbe/t4_sched.c   Thu Aug  1 14:17:31 2019
(r350501)
@@ -903,4 +903,35 @@ cxgbe_snd_tag_free(struct m_snd_tag *mst)
}
mtx_unlock(&cst->lock);
 }
+
+#define CXGBE_MAX_FLOWS 4000   /* Testing show so far thats all this adapter 
can do */
+#define CXGBE_UNIQUE_RATE_COUNT 16 /* Number of unique rates that can be setup 
*/
+
+void
+cxgbe_ratelimit_query(struct ifnet *ifp __unused,
+ struct if_ratelimit_query_results *q)
+{
+   /*
+* This is a skeleton and needs future work
+* by the driver supporters. It should be
+* enhanced to look at the specific type of
+* interface and select approprate values
+* for these settings. This example goes
+* with an earlier card (t5), it has a maximum
+* number of 16 rates that the first guys in
+* select (thus the flags value RT_IS_SELECTABLE).
+* If it was a fixed table then we would setup a
+* const array (example mlx5). Note the card tested
+* can only support reasonably 4000 flows before
+* the adapter has issues with sending so here 
+* we limit the number of flows using hardware
+* pacing to that number, other cards may
+* be able to raise or eliminate this limit.
+*/
+   q->rate_table = NULL;
+   q->flags = RT_IS_SELECTABLE;
+   q->max_flows = CXGBE_MAX_FLOWS;
+   q->number_of_rates = CXGBE_UNIQUE_RATE_COUNT;
+   q->min_segment_burst = 4;   /* Driver emits 4 in a burst */
+}
 #endif

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cThu Aug  1 14:13:04 2019
(r350500)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cThu Aug  1 14:17:31 2019
(r350501)
@@ -4070,7 +4070,49 @@ mlx5e_snd_tag_query(struct m_snd_tag *pmt, union if_sn

svn commit: r350502 - head/sys/kern

2019-08-01 Thread Konstantin Belousov
Author: kib
Date: Thu Aug  1 14:34:27 2019
New Revision: 350502
URL: https://svnweb.freebsd.org/changeset/base/350502

Log:
  Make umtxq_check_susp() to correctly handle thread exit requests.
  
  The check for P_SINGLE_EXIT was shadowed by the (P_SHOULDSTOP || traced) 
check.
  
  Reported by:  bdrewery (might be)
  Reviewed by:  markj
  Tested by:pho
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential revision:https://reviews.freebsd.org/D21124

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==
--- head/sys/kern/kern_umtx.c   Thu Aug  1 14:17:31 2019(r350501)
+++ head/sys/kern/kern_umtx.c   Thu Aug  1 14:34:27 2019(r350502)
@@ -723,13 +723,11 @@ umtxq_check_susp(struct thread *td, bool sleep)
error = 0;
p = td->td_proc;
PROC_LOCK(p);
-   if (P_SHOULDSTOP(p) ||
-   ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) {
-   if (p->p_flag & P_SINGLE_EXIT)
-   error = EINTR;
-   else
-   error = sleep ? thread_suspend_check(0) : ERESTART;
-   }
+   if (p->p_flag & P_SINGLE_EXIT)
+   error = EINTR;
+   else if (P_SHOULDSTOP(p) ||
+   ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND)))
+   error = sleep ? thread_suspend_check(0) : ERESTART;
PROC_UNLOCK(p);
return (error);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350503 - head/gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 14:39:26 2019
New Revision: 350503
URL: https://svnweb.freebsd.org/changeset/base/350503

Log:
  objdump: move deprecation notice to indended spot in the man page
  
  r335217 added a deprecation notice to the source file for the objdump
  man page, and r335219 added it to the rendered objdump.1, but in the
  wrong spot.
  
  MFC after:3 days

Modified:
  head/gnu/usr.bin/binutils/objdump/objdump.1

Modified: head/gnu/usr.bin/binutils/objdump/objdump.1
==
--- head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:34:27 2019
(r350502)
+++ head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:39:26 2019
(r350503)
@@ -179,13 +179,13 @@ information is mostly useful to programmers who are wo
 compilation tools, as opposed to programmers who just want their
 program to compile and work.
 .PP
-\&\fBobjdump\fR will be removed from a future version of the
-FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
-to install the binutils port or package.
-.PP
 \&\fIobjfile\fR... are the object files to be examined.  When you
 specify archives, \fBobjdump\fR shows information on each of the member
 object files.
+.PP
+\&\fBobjdump\fR will be removed from a future version of the
+FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
+to install the binutils port or package.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
 The long and short forms of options, shown here as alternatives, are
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350504 - head/sys/fs/unionfs

2019-08-01 Thread Konstantin Belousov
Author: kib
Date: Thu Aug  1 14:40:37 2019
New Revision: 350504
URL: https://svnweb.freebsd.org/changeset/base/350504

Log:
  Try to decrease the number of bugs in unionfs after the VV_TEXT flag removal.
  
  - Provide unionfs_add_writecount() which passes the writecount to the
lower or upper vnode as appropriate.
  - In unionfs VOP_RECLAIM() implementation, annulate unionfs
writecounts from upper or lower vnode.  It is not clear that it is
always correct to remove the all references from either lower or
upper vnode, but we currently do not track which vnode get how many
refs anyway.
  
  Reported and tested by:   t_uem...@macome.co.jp
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/fs/unionfs/union_subr.c
  head/sys/fs/unionfs/union_vnops.c

Modified: head/sys/fs/unionfs/union_subr.c
==
--- head/sys/fs/unionfs/union_subr.cThu Aug  1 14:39:26 2019
(r350503)
+++ head/sys/fs/unionfs/union_subr.cThu Aug  1 14:40:37 2019
(r350504)
@@ -349,6 +349,13 @@ unionfs_noderem(struct vnode *vp, struct thread *td)
vp->v_vnlock = &(vp->v_lock);
vp->v_data = NULL;
vp->v_object = NULL;
+   if (vp->v_writecount > 0) {
+   if (uvp != NULL)
+   VOP_ADD_WRITECOUNT(uvp, -vp->v_writecount);
+   else if (lvp != NULL)
+   VOP_ADD_WRITECOUNT(lvp, -vp->v_writecount);
+   } else if (vp->v_writecount < 0)
+   vp->v_writecount = 0;
VI_UNLOCK(vp);
 
if (lvp != NULLVP)

Modified: head/sys/fs/unionfs/union_vnops.c
==
--- head/sys/fs/unionfs/union_vnops.c   Thu Aug  1 14:39:26 2019
(r350503)
+++ head/sys/fs/unionfs/union_vnops.c   Thu Aug  1 14:40:37 2019
(r350504)
@@ -2511,6 +2511,33 @@ unionfs_vptofh(struct vop_vptofh_args *ap)
return (EOPNOTSUPP);
 }
 
+static int
+unionfs_add_writecount(struct vop_add_writecount_args *ap)
+{
+   struct vnode *tvp, *vp;
+   struct unionfs_node *unp;
+   int error;
+
+   vp = ap->a_vp;
+   unp = VTOUNIONFS(vp);
+   tvp = unp->un_uppervp != NULL ? unp->un_uppervp : unp->un_lowervp;
+   VI_LOCK(vp);
+   /* text refs are bypassed to lowervp */
+   VNASSERT(vp->v_writecount >= 0, vp, ("wrong null writecount"));
+   VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp,
+   ("wrong writecount inc %d", ap->a_inc));
+   if (tvp != NULL)
+   error = VOP_ADD_WRITECOUNT(tvp, ap->a_inc);
+   else if (vp->v_writecount < 0)
+   error = ETXTBSY;
+   else
+   error = 0;
+   if (error == 0)
+   vp->v_writecount += ap->a_inc;
+   VI_UNLOCK(vp);
+   return (error);
+}
+
 struct vop_vector unionfs_vnodeops = {
.vop_default =  &default_vnodeops,
 
@@ -2559,4 +2586,5 @@ struct vop_vector unionfs_vnodeops = {
.vop_whiteout = unionfs_whiteout,
.vop_write =unionfs_write,
.vop_vptofh =   unionfs_vptofh,
+   .vop_add_writecount =   unionfs_add_writecount,
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 14:42:41 2019
New Revision: 350505
URL: https://svnweb.freebsd.org/changeset/base/350505

Log:
  objdump: be explicit that GNU objdump that will be removed
  
  We may install llvm-objdump as objdump (see review D18307) or just
  provide no /usr/bin/objdump, but either way GNU objdump won't be
  installed in the future.
  
  MFC after:3 days

Modified:
  head/contrib/binutils/binutils/doc/binutils.texi
  head/gnu/usr.bin/binutils/objdump/objdump.1

Modified: head/contrib/binutils/binutils/doc/binutils.texi
==
--- head/contrib/binutils/binutils/doc/binutils.texiThu Aug  1 14:40:37 
2019(r350504)
+++ head/contrib/binutils/binutils/doc/binutils.texiThu Aug  1 14:42:41 
2019(r350505)
@@ -1624,8 +1624,8 @@ program to compile and work.
 specify archives, @command{objdump} shows information on each of the member
 object files.
 
-@command{objdump} will be removed from a future version of the
-FreeBSD base system.  Users who require @command{objdump} are advised
+GNU @command{objdump} will be removed from a future version of the
+FreeBSD base system.  Users who require GNU @command{objdump} are advised
 to install the binutils port or package.
 
 @c man end

Modified: head/gnu/usr.bin/binutils/objdump/objdump.1
==
--- head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:40:37 2019
(r350504)
+++ head/gnu/usr.bin/binutils/objdump/objdump.1 Thu Aug  1 14:42:41 2019
(r350505)
@@ -183,8 +183,8 @@ program to compile and work.
 specify archives, \fBobjdump\fR shows information on each of the member
 object files.
 .PP
-\&\fBobjdump\fR will be removed from a future version of the
-FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
+GNU \&\fBobjdump\fR will be removed from a future version of the
+FreeBSD base system.  Users who require GNU \&\fBobjdump\fR are advised
 to install the binutils port or package.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Rodney W. Grimes
> Author: emaste
> Date: Thu Aug  1 14:42:41 2019
> New Revision: 350505
> URL: https://svnweb.freebsd.org/changeset/base/350505
> 
> Log:
>   objdump: be explicit that GNU objdump that will be removed
>   
>   We may install llvm-objdump as objdump (see review D18307) or just
>   provide no /usr/bin/objdump, but either way GNU objdump won't be
>   installed in the future.
>   
>   MFC after:  3 days

Can we get a RELNOTES entry for this please?

> Modified:
>   head/contrib/binutils/binutils/doc/binutils.texi
>   head/gnu/usr.bin/binutils/objdump/objdump.1
> 
> Modified: head/contrib/binutils/binutils/doc/binutils.texi
> ==
> --- head/contrib/binutils/binutils/doc/binutils.texi  Thu Aug  1 14:40:37 
> 2019(r350504)
> +++ head/contrib/binutils/binutils/doc/binutils.texi  Thu Aug  1 14:42:41 
> 2019(r350505)
> @@ -1624,8 +1624,8 @@ program to compile and work.
>  specify archives, @command{objdump} shows information on each of the member
>  object files.
>  
> -@command{objdump} will be removed from a future version of the
> -FreeBSD base system.  Users who require @command{objdump} are advised
> +GNU @command{objdump} will be removed from a future version of the
> +FreeBSD base system.  Users who require GNU @command{objdump} are advised
>  to install the binutils port or package.
>  
>  @c man end
> 
> Modified: head/gnu/usr.bin/binutils/objdump/objdump.1
> ==
> --- head/gnu/usr.bin/binutils/objdump/objdump.1   Thu Aug  1 14:40:37 
> 2019(r350504)
> +++ head/gnu/usr.bin/binutils/objdump/objdump.1   Thu Aug  1 14:42:41 
> 2019(r350505)
> @@ -183,8 +183,8 @@ program to compile and work.
>  specify archives, \fBobjdump\fR shows information on each of the member
>  object files.
>  .PP
> -\&\fBobjdump\fR will be removed from a future version of the
> -FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
> +GNU \&\fBobjdump\fR will be removed from a future version of the
> +FreeBSD base system.  Users who require GNU \&\fBobjdump\fR are advised
>  to install the binutils port or package.
>  .SH "OPTIONS"
>  .IX Header "OPTIONS"
> 
> 

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


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Warner Losh
On Thu, Aug 1, 2019, 11:00 AM Rodney W. Grimes 
wrote:

> > Author: emaste
> > Date: Thu Aug  1 14:42:41 2019
> > New Revision: 350505
> > URL: https://svnweb.freebsd.org/changeset/base/350505
> >
> > Log:
> >   objdump: be explicit that GNU objdump that will be removed
> >
> >   We may install llvm-objdump as objdump (see review D18307) or just
> >   provide no /usr/bin/objdump, but either way GNU objdump won't be
> >   installed in the future.
> >
> >   MFC after:  3 days
>
> Can we get a RELNOTES entry for this please?
>

Great idea. What's the protocol the project wants here? It seems to me that
we'd want a world where either the original committer or folks shepherding
the release notes out the door when the time comes could commit entries to
the file. We should encourage the OC to do it, but have the culture that we
can be relaxed about others doing it too so we have low friction around
this file.

Warner

> Modified:
> >   head/contrib/binutils/binutils/doc/binutils.texi
> >   head/gnu/usr.bin/binutils/objdump/objdump.1
> >
> > Modified: head/contrib/binutils/binutils/doc/binutils.texi
> >
> ==
> > --- head/contrib/binutils/binutils/doc/binutils.texi  Thu Aug  1
> 14:40:37 2019(r350504)
> > +++ head/contrib/binutils/binutils/doc/binutils.texi  Thu Aug  1
> 14:42:41 2019(r350505)
> > @@ -1624,8 +1624,8 @@ program to compile and work.
> >  specify archives, @command{objdump} shows information on each of the
> member
> >  object files.
> >
> > -@command{objdump} will be removed from a future version of the
> > -FreeBSD base system.  Users who require @command{objdump} are advised
> > +GNU @command{objdump} will be removed from a future version of the
> > +FreeBSD base system.  Users who require GNU @command{objdump} are
> advised
> >  to install the binutils port or package.
> >
> >  @c man end
> >
> > Modified: head/gnu/usr.bin/binutils/objdump/objdump.1
> >
> ==
> > --- head/gnu/usr.bin/binutils/objdump/objdump.1   Thu Aug  1
> 14:40:37 2019(r350504)
> > +++ head/gnu/usr.bin/binutils/objdump/objdump.1   Thu Aug  1
> 14:42:41 2019(r350505)
> > @@ -183,8 +183,8 @@ program to compile and work.
> >  specify archives, \fBobjdump\fR shows information on each of the member
> >  object files.
> >  .PP
> > -\&\fBobjdump\fR will be removed from a future version of the
> > -FreeBSD base system.  Users who require \&\fBobjdump\fR are advised
> > +GNU \&\fBobjdump\fR will be removed from a future version of the
> > +FreeBSD base system.  Users who require GNU \&\fBobjdump\fR are advised
> >  to install the binutils port or package.
> >  .SH "OPTIONS"
> >  .IX Header "OPTIONS"
> >
> >
>
> --
> Rod Grimes
> rgri...@freebsd.org
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ian Lepore
On Thu, 2019-08-01 at 14:42 +, Ed Maste wrote:
> Author: emaste
> Date: Thu Aug  1 14:42:41 2019
> New Revision: 350505
> URL: https://svnweb.freebsd.org/changeset/base/350505
> 
> Log:
>   objdump: be explicit that GNU objdump that will be removed
>   
>   We may install llvm-objdump as objdump (see review D18307) or just
>   provide no /usr/bin/objdump, but either way GNU objdump won't be
>   installed in the future.
>   

Why would we provide no objdump?  I use it quite frequently; it seems
like an essential part of the toolchain to me.

-- Ian


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


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 12:00, Rodney W. Grimes  wrote:
>
> > Author: emaste
> > Date: Thu Aug  1 14:42:41 2019
> > New Revision: 350505
> > URL: https://svnweb.freebsd.org/changeset/base/350505
> >
> > Log:
> >   objdump: be explicit that GNU objdump that will be removed
> >
> >   We may install llvm-objdump as objdump (see review D18307) or just
> >   provide no /usr/bin/objdump, but either way GNU objdump won't be
> >   installed in the future.
> >
> >   MFC after:  3 days
>
> Can we get a RELNOTES entry for this please?

Can you suggest wording for such a note? Something like:

The deprecation notice in the GNU objdump man page was clarified to
indicate that it is GNU objdump which will be removed; an objdump from
the LLVM project may be provided in its place.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Rodney W. Grimes
> On Thu, 1 Aug 2019 at 12:00, Rodney W. Grimes  
> wrote:
> >
> > > Author: emaste
> > > Date: Thu Aug  1 14:42:41 2019
> > > New Revision: 350505
> > > URL: https://svnweb.freebsd.org/changeset/base/350505
> > >
> > > Log:
> > >   objdump: be explicit that GNU objdump that will be removed
> > >
> > >   We may install llvm-objdump as objdump (see review D18307) or just
> > >   provide no /usr/bin/objdump, but either way GNU objdump won't be
> > >   installed in the future.
> > >
> > >   MFC after:  3 days
> >
> > Can we get a RELNOTES entry for this please?
> 
> Can you suggest wording for such a note? Something like:
> 
> The deprecation notice in the GNU objdump man page was clarified to
> indicate that it is GNU objdump which will be removed; an objdump from
> the LLVM project may be provided in its place.

That would be fine, the important thing is that the
r350505 gets listed in the file, the people who shall
actually have to write the release notes simply need
a key to let them know they should look at this commit
and create a proper entry.

I did not set the policy or write the current RELNOTES file,
so markj and gjb have far more to say here than anything I
do.

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


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 12:35, Ian Lepore  wrote:
>
> Why would we provide no objdump?  I use it quite frequently; it seems
> like an essential part of the toolchain to me.

I don't want us to provide no objdump, but providing GNU objdump
2.17.50 indefinitely is not a viable option; see PR 218387[1] for an
example of the kind of issue we have with providing obsolete software.

We have a choice of:
1. provide llvm-objdump, and no /usr/bin/objdump in the base system
2. install llvm-objdump as /usr/bin/objdump
3. require that users who want an objdump install the binutils port

/usr/bin/objdump is not required by the base system build and not
required by most ports. exp-run details with no /usr/bin/objdump can
be found in PR 212319[2], and PR 229046[3] is a tracking PR for
removing dependencies on objdump.

Option 1 (removing /usr/bin/objdump) is proposed in review D7338[4]
while option 2 is (installing llvm-objdump as objdump) is proposed in
review D18307. llvm-objdump is roughly compatible with GNU objdump
(command line and output format) but there are a large number of small
issues that will likely trip up scripted or automated objdump use.
(Scripts should probably just use readelf instead, though.) D18307 has
a list of LLVM bug reports for known issues in llvm-objdump.

Note also that we currently provide only two or three obsolete
binutils, depending on the CPU architecture:
- as
- ld
- objdump

[1] https://bugs.freebsd.org/218387
[2] https://bugs.freebsd.org/212319
[3] https://bugs.freebsd.org/229046
[4] https://reviews.freebsd.org/D7338
[5] https://reviews.freebsd.org/D18307
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350506 - head/tools/debugscripts

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 17:02:58 2019
New Revision: 350506
URL: https://svnweb.freebsd.org/changeset/base/350506

Log:
  remove obsolete kernel debugging script
  
  For quite some time kgdb has been internally handling FreeBSD kernel
  module state; add-on scripts and tools are not needed.  asf(8) served
  a similar purpose to this script and was removed in r335222.
  
  PR:   229046
  Reported by:  jhb
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/tools/debugscripts/kld_deb.py
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 12:51, Rodney W. Grimes  wrote:
>
> That would be fine, the important thing is that the
> r350505 gets listed in the file,

I don't see any reason that r350505 specifically should be in a
release note - this is a minor clarification of an existing
deprecation notice. It seems having an overall "deprecation notices"
section in the release notes would make sense, but they should really
persist from version to version. Should we add a top-level
DEPRECATION_NOTICES file perhaps? Or tag deprecation notices with some
sort of comment in the source so they can be found with a 'grep'
during release preparation?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Mark Johnston
On Thu, Aug 01, 2019 at 11:22:46AM -0500, Warner Losh wrote:
> On Thu, Aug 1, 2019, 11:00 AM Rodney W. Grimes 
> wrote:
> 
> > > Author: emaste
> > > Date: Thu Aug  1 14:42:41 2019
> > > New Revision: 350505
> > > URL: https://svnweb.freebsd.org/changeset/base/350505
> > >
> > > Log:
> > >   objdump: be explicit that GNU objdump that will be removed
> > >
> > >   We may install llvm-objdump as objdump (see review D18307) or just
> > >   provide no /usr/bin/objdump, but either way GNU objdump won't be
> > >   installed in the future.
> > >
> > >   MFC after:  3 days
> >
> > Can we get a RELNOTES entry for this please?
> >
> 
> Great idea. What's the protocol the project wants here? It seems to me that
> we'd want a world where either the original committer or folks shepherding
> the release notes out the door when the time comes could commit entries to
> the file. We should encourage the OC to do it, but have the culture that we
> can be relaxed about others doing it too so we have low friction around
> this file.

This is basically how UPDATING works.  It's reasonable to reply to a
commit mail and ask the committer to consider adding a RELNOTES entry,
perhaps proposing some text.  And if the committer doesn't follow up,
there's no problem with just going ahead and committing the new entry.

That said, I would think that an actual removal of GNU objdump would
be the commit that deserves a RELNOTES entry, not this one.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350507 - head/sys/net

2019-08-01 Thread Eric Joyner
Author: erj
Date: Thu Aug  1 17:28:36 2019
New Revision: 350507
URL: https://svnweb.freebsd.org/changeset/base/350507

Log:
  iflib: remove kobject class reference increment
  
  Commit message from Jake:
  In iflib_register, the context is initialized as a kobject using the
  device driver's "driver" kobject class. As part of this, the function
  mistakenly increments the ref counter.
  
  The ref counter is incremented twice, once in the code directly, and
  once again by kobj_class_compile. However, there is no associated
  decrement in the detach path. Because of this, the ref counter will
  never go back down to zero, and thus the kobject method table will never
  be released.
  
  Remove this unnecessary reference count increment.
  
  Signed-off-by: Jacob Keller 
  
  Submitted by: Jacob Keller 
  Reviewed by:  jhb@, erj@
  MFC after:3 days
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D21125

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug  1 17:02:58 2019(r350506)
+++ head/sys/net/iflib.cThu Aug  1 17:28:36 2019(r350507)
@@ -5342,7 +5342,6 @@ iflib_register(if_ctx_t ctx)
 */
kobj_init((kobj_t) ctx, (kobj_class_t) driver);
kobj_class_compile((kobj_class_t) driver);
-   driver->refs++;
 
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
if_setsoftc(ifp, ctx);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350508 - head/sys/netinet

2019-08-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Aug  1 17:36:15 2019
New Revision: 350508
URL: https://svnweb.freebsd.org/changeset/base/350508

Log:
  When responding with an ABORT to an INIT chunk containing a
  HOSTNAME parameter or a parameter with an illegal length, only
  include an error cause indicating why the ABORT was sent.
  This also fixes an mbuf leak which could occur.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Thu Aug  1 17:28:36 2019
(r350507)
+++ head/sys/netinet/sctp_output.c  Thu Aug  1 17:36:15 2019
(r350508)
@@ -5115,55 +5115,42 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
break;
case SCTP_HOSTNAME_ADDRESS:
{
-   /* We can NOT handle HOST NAME addresses!! */
+   /* Hostname parameters are deprecated. */
+   struct sctp_gen_error_cause *cause;
int l_len;
 
SCTPDBG(SCTP_DEBUG_OUTPUT1, "Can't handle 
hostname addresses.. abort processing\n");
*abort_processing = 1;
-   if (op_err == NULL) {
-   /* Ok need to try to get a mbuf */
+   sctp_m_freem(op_err);
+   op_err = NULL;
 #ifdef INET6
-   l_len = SCTP_MIN_OVERHEAD;
+   l_len = SCTP_MIN_OVERHEAD;
 #else
-   l_len = SCTP_MIN_V4_OVERHEAD;
+   l_len = SCTP_MIN_V4_OVERHEAD;
 #endif
-   l_len += sizeof(struct sctp_chunkhdr);
-   l_len += sizeof(struct 
sctp_gen_error_cause);
-   op_err = sctp_get_mbuf_for_msg(l_len, 
0, M_NOWAIT, 1, MT_DATA);
-   if (op_err) {
-   SCTP_BUF_LEN(op_err) = 0;
-   /*
-* Pre-reserve space for IP,
-* SCTP, and chunk header.
-*/
+   l_len += sizeof(struct sctp_chunkhdr);
+   l_len += sizeof(struct sctp_gen_error_cause);
+   op_err = sctp_get_mbuf_for_msg(l_len, 0, 
M_NOWAIT, 1, MT_DATA);
+   if (op_err) {
+   /*
+* Pre-reserve space for IP, SCTP,
+* and chunk header.
+*/
 #ifdef INET6
-   SCTP_BUF_RESV_UF(op_err, 
sizeof(struct ip6_hdr));
+   SCTP_BUF_RESV_UF(op_err, sizeof(struct 
ip6_hdr));
 #else
-   SCTP_BUF_RESV_UF(op_err, 
sizeof(struct ip));
+   SCTP_BUF_RESV_UF(op_err, sizeof(struct 
ip));
 #endif
-   SCTP_BUF_RESV_UF(op_err, 
sizeof(struct sctphdr));
-   SCTP_BUF_RESV_UF(op_err, 
sizeof(struct sctp_chunkhdr));
-   }
-   }
-   if (op_err) {
-   /* If we have space */
-   struct sctp_gen_error_cause cause;
-
-   if (err_at % 4) {
-   uint32_t cpthis = 0;
-
-   pad_needed = 4 - (err_at % 4);
-   m_copyback(op_err, err_at, 
pad_needed, (caddr_t)&cpthis);
-   err_at += pad_needed;
-   }
-   cause.code = 
htons(SCTP_CAUSE_UNRESOLVABLE_ADDR);
-   cause.length = 
htons((uint16_t)(sizeof(struct sctp_gen_error_cause) + plen));
-   m_copyback(op_err, err_at, 
sizeof(struct sctp_gen_error_cause), (caddr_t)&cause);
-   err_at += sizeof(struct 
sctp_gen_error_cause);
+   SCTP_BUF_RESV_UF(op_err, sizeof(struct 
sctphdr));
+   SCTP_BUF_RESV_UF(op_err, sizeof(struct 
sctp_chunkhdr));
+   SCTP_BUF_LEN(op_err) = si

svn commit: r350509 - head/sys/net

2019-08-01 Thread Eric Joyner
Author: erj
Date: Thu Aug  1 17:37:25 2019
New Revision: 350509
URL: https://svnweb.freebsd.org/changeset/base/350509

Log:
  iflib: Prevent kernel panic caused by loading driver with a specific 
interrupt configuration
  
  If a device has only 1 MSI-X interrupt available and does not support either
  MSI or legacy interrupts, iflib_device_register() will fail, leak memory and
  MSI resources, and the driver will not load. Worse, if another iflib-using
  driver tries to unload afterwards, a kernel panic will occur because the
  previous failed iflib driver loead did not properly call "taskqgroup_detach()"
  during it's cleanup.
  
  This patch is band-aid for this situation -- don't try allocating MSI or 
legacy
  interrupts if a single MSI-X interrupt was allocated, but fail to load 
instead.
  As well, during the cleanup, properly call taskqgroup_detach() on the admin
  task to prevent panics when other iflib drivers unload.
  
  This whole interrupt allocation process actually needs re-doing to properly
  support devices with only a single MSI-X interrupt, devices that only support
  MSI-X, non-PCI devices, and multiple non-MSIX interrupts, as well.
  
  Signed-off-by: Eric Joyner 
  
  Reviewed by:  marius@
  MFC after:1 week
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D20747

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug  1 17:36:15 2019(r350508)
+++ head/sys/net/iflib.cThu Aug  1 17:37:25 2019(r350509)
@@ -4731,7 +4731,7 @@ iflib_device_register(device_t dev, void *sc, if_share
err);
goto fail_queues;
}
-   } else {
+   } else if (scctx->isc_intr != IFLIB_INTR_MSIX) {
rid = 0;
if (scctx->isc_intr == IFLIB_INTR_MSI) {
MPASS(msix == 1);
@@ -4741,6 +4741,11 @@ iflib_device_register(device_t dev, void *sc, if_share
device_printf(dev, "iflib_legacy_setup failed %d\n", 
err);
goto fail_queues;
}
+   } else {
+   device_printf(dev,
+   "Cannot use iflib with only 1 MSI-X interrupt!\n");
+   err = ENODEV;
+   goto fail_intr_free;
}
 
ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet);
@@ -4781,6 +4786,7 @@ fail_intr_free:
 fail_queues:
iflib_tx_structures_free(ctx);
iflib_rx_structures_free(ctx);
+   taskqgroup_detach(qgroup_if_config_tqg, &ctx->ifc_admin_task);
IFDI_DETACH(ctx);
 fail_unlock:
CTX_UNLOCK(ctx);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread John Baldwin
On 7/31/19 8:13 PM, Ed Maste wrote:
> On Thu, 1 Aug 2019 at 12:51, Rodney W. Grimes  
> wrote:
>>
>> That would be fine, the important thing is that the
>> r350505 gets listed in the file,
> 
> I don't see any reason that r350505 specifically should be in a
> release note - this is a minor clarification of an existing
> deprecation notice. It seems having an overall "deprecation notices"
> section in the release notes would make sense, but they should really
> persist from version to version. Should we add a top-level
> DEPRECATION_NOTICES file perhaps? Or tag deprecation notices with some
> sort of comment in the source so they can be found with a 'grep'
> during release preparation?

I think it would make sense to have "sections" in RELNOTES that mimic
the sections we have in the existing release notes (e.g. kernel vs
userland).  That is effectively what GDB does with a top level NEWS
file.  This approach would hopefully make it easier to translate this
file into the real release notes.  It also means that a given "note"
can evolve over time (e.g. it might start with "XYZ is deprecated" to
"XYZ is removed" if a deprecation note is added and merged and later it
is removed) rather than only having a running journal ala UPDATING.

On the question of whether we want a dedicated section just for
deprecation notices, I'm not sure.  Probably we can just stick with the
layout of our existing release notes?

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


svn commit: r350510 - in head/sys/contrib/dev/acpica: . compiler components/dispatcher components/events components/executer components/namespace components/tables components/utilities include

2019-08-01 Thread Jung-uk Kim
Author: jkim
Date: Thu Aug  1 17:45:43 2019
New Revision: 350510
URL: https://svnweb.freebsd.org/changeset/base/350510

Log:
  Revert r349863 (ACPICA 20190703).
  
  This commit caused boot failures on some systems.
  
  Requested by: scottl

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslglobal.h
  head/sys/contrib/dev/acpica/compiler/aslload.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslstubs.c
  head/sys/contrib/dev/acpica/compiler/aslsupport.l
  head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
  head/sys/contrib/dev/acpica/components/events/evgpe.c
  head/sys/contrib/dev/acpica/components/events/evgpeblk.c
  head/sys/contrib/dev/acpica/components/events/evxface.c
  head/sys/contrib/dev/acpica/components/events/evxfgpe.c
  head/sys/contrib/dev/acpica/components/executer/exconfig.c
  head/sys/contrib/dev/acpica/components/namespace/nsaccess.c
  head/sys/contrib/dev/acpica/components/namespace/nseval.c
  head/sys/contrib/dev/acpica/components/namespace/nsinit.c
  head/sys/contrib/dev/acpica/components/namespace/nsload.c
  head/sys/contrib/dev/acpica/components/namespace/nsutils.c
  head/sys/contrib/dev/acpica/components/tables/tbdata.c
  head/sys/contrib/dev/acpica/components/tables/tbxfload.c
  head/sys/contrib/dev/acpica/components/utilities/utinit.c
  head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
  head/sys/contrib/dev/acpica/include/acevents.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acnamesp.h
  head/sys/contrib/dev/acpica/include/acpixf.h

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Thu Aug  1 17:37:25 2019
(r350509)
+++ head/sys/contrib/dev/acpica/changes.txt Thu Aug  1 17:45:43 2019
(r350510)
@@ -1,53 +1,4 @@
 
-03 July 2019. Summary of changes for version 20190703:
-
-
-1) ACPICA kernel-resident subsystem:
-
-Remove legacy module-level support code. There were still some remnants 
-of the legacy module-level code executions. Since we no longer support 
-this option, this is essentially dead code and has been removed from the 
-ACPICA source.
-
-iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
-scope. If these named objects are declared outside the root scope, they 
-will not be invoked by any host Operating System.
-
-Clear status of GPEs on first direct enable. ACPI GPEs (other than the EC 
-one) can be enabled in two situations. First, the GPEs with existing _Lxx 
-and _Exx methods are enabled implicitly by ACPICA during system 
-initialization.  Second, the GPEs without these methods (like GPEs listed 
-by _PRW objects for wakeup devices) need to be enabled directly by the 
-code that is going to use them (e.g. ACPI power management or device 
-drivers).
-
-In the former case, if the status of a given GPE is set to start with, 
-its handler method (either _Lxx or _Exx) needs to be invoked to take care 
-of the events (possibly) signaled before the GPE was enabled. In the 
-latter case, however, the first caller of AcpiEnableGpe() for a given GPE 
-should not be expected to care about any events that might be signaled 
-through it earlier.  In that case, it is better to clear the status of 
-the GPE before enabling it, to prevent stale events from triggering 
-unwanted actions (like spurious system resume, for example).
-
-For this reason, modify AcpiEvAddGpeReference() to take an additional 
-boolean argument indicating whether or not the GPE status needs to be 
-cleared when its reference counter changes from zero to one and make 
-AcpiEnableGpe() pass TRUE to it through that new argument.
-
-
-2) iASL Compiler/Disassembler and ACPICA tools:
-
-The tool generation process has been migrated to MSVC 2017, and all 
-project files have been upgraded. The new project files appear in the 
-directory \acpica\generate\msvc2017. This change effectively deprecates 
-the older project files in \acpica\generate\msvc9.
-
-iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
-scope. If these named objects are declared outside the root scope, they 
-will not be invoked by any host Operating System
-
-
 09 May 2019. Summary of changes for version 20190509:
 
 

Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h
==
--- head/sys/contrib/dev/acpica/compiler/asldefine.hThu Aug  1 17:37:25 
2019(r350509)
+++ head/sys/contrib/dev/acpica/compiler/asldefine.hThu Aug  1 17:45:43 
2019(r350510)
@@ -298,20 +298,4 @@
 #define COMMENT_CAPTURE_ONAslGbl_CommentState.Capt

Re: svn commit: r350510 - in head/sys/contrib/dev/acpica: . compiler components/dispatcher components/events components/executer components/namespace components/tables components/utilities include

2019-08-01 Thread Scott Long
Thanks.  I’m working on the root cause right now, hopefully will have
more information soon.

Scott


> On Aug 1, 2019, at 11:45 AM, Jung-uk Kim  wrote:
> 
> Author: jkim
> Date: Thu Aug  1 17:45:43 2019
> New Revision: 350510
> URL: https://svnweb.freebsd.org/changeset/base/350510
> 
> Log:
>  Revert r349863 (ACPICA 20190703).
> 
>  This commit caused boot failures on some systems.
> 
>  Requested by:scottl
> 
> Modified:
>  head/sys/contrib/dev/acpica/changes.txt
>  head/sys/contrib/dev/acpica/compiler/asldefine.h
>  head/sys/contrib/dev/acpica/compiler/aslglobal.h
>  head/sys/contrib/dev/acpica/compiler/aslload.c
>  head/sys/contrib/dev/acpica/compiler/aslmessages.c
>  head/sys/contrib/dev/acpica/compiler/aslmessages.h
>  head/sys/contrib/dev/acpica/compiler/aslstubs.c
>  head/sys/contrib/dev/acpica/compiler/aslsupport.l
>  head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
>  head/sys/contrib/dev/acpica/components/events/evgpe.c
>  head/sys/contrib/dev/acpica/components/events/evgpeblk.c
>  head/sys/contrib/dev/acpica/components/events/evxface.c
>  head/sys/contrib/dev/acpica/components/events/evxfgpe.c
>  head/sys/contrib/dev/acpica/components/executer/exconfig.c
>  head/sys/contrib/dev/acpica/components/namespace/nsaccess.c
>  head/sys/contrib/dev/acpica/components/namespace/nseval.c
>  head/sys/contrib/dev/acpica/components/namespace/nsinit.c
>  head/sys/contrib/dev/acpica/components/namespace/nsload.c
>  head/sys/contrib/dev/acpica/components/namespace/nsutils.c
>  head/sys/contrib/dev/acpica/components/tables/tbdata.c
>  head/sys/contrib/dev/acpica/components/tables/tbxfload.c
>  head/sys/contrib/dev/acpica/components/utilities/utinit.c
>  head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
>  head/sys/contrib/dev/acpica/include/acevents.h
>  head/sys/contrib/dev/acpica/include/acglobal.h
>  head/sys/contrib/dev/acpica/include/acnamesp.h
>  head/sys/contrib/dev/acpica/include/acpixf.h
> 
> Modified: head/sys/contrib/dev/acpica/changes.txt
> ==
> --- head/sys/contrib/dev/acpica/changes.txt   Thu Aug  1 17:37:25 2019
> (r350509)
> +++ head/sys/contrib/dev/acpica/changes.txt   Thu Aug  1 17:45:43 2019
> (r350510)
> @@ -1,53 +1,4 @@
> 
> -03 July 2019. Summary of changes for version 20190703:
> -
> -
> -1) ACPICA kernel-resident subsystem:
> -
> -Remove legacy module-level support code. There were still some remnants 
> -of the legacy module-level code executions. Since we no longer support 
> -this option, this is essentially dead code and has been removed from the 
> -ACPICA source.
> -
> -iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
> -scope. If these named objects are declared outside the root scope, they 
> -will not be invoked by any host Operating System.
> -
> -Clear status of GPEs on first direct enable. ACPI GPEs (other than the EC 
> -one) can be enabled in two situations. First, the GPEs with existing _Lxx 
> -and _Exx methods are enabled implicitly by ACPICA during system 
> -initialization.  Second, the GPEs without these methods (like GPEs listed 
> -by _PRW objects for wakeup devices) need to be enabled directly by the 
> -code that is going to use them (e.g. ACPI power management or device 
> -drivers).
> -
> -In the former case, if the status of a given GPE is set to start with, 
> -its handler method (either _Lxx or _Exx) needs to be invoked to take care 
> -of the events (possibly) signaled before the GPE was enabled. In the 
> -latter case, however, the first caller of AcpiEnableGpe() for a given GPE 
> -should not be expected to care about any events that might be signaled 
> -through it earlier.  In that case, it is better to clear the status of 
> -the GPE before enabling it, to prevent stale events from triggering 
> -unwanted actions (like spurious system resume, for example).
> -
> -For this reason, modify AcpiEvAddGpeReference() to take an additional 
> -boolean argument indicating whether or not the GPE status needs to be 
> -cleared when its reference counter changes from zero to one and make 
> -AcpiEnableGpe() pass TRUE to it through that new argument.
> -
> -
> -2) iASL Compiler/Disassembler and ACPICA tools:
> -
> -The tool generation process has been migrated to MSVC 2017, and all 
> -project files have been upgraded. The new project files appear in the 
> -directory \acpica\generate\msvc2017. This change effectively deprecates 
> -the older project files in \acpica\generate\msvc9.
> -
> -iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
> -scope. If these named objects are declared outside the root scope, they 
> -will not be invoked by any host Operating System
> -
> -
> 09 May 2019. Summary of changes for version 20190509:
> 
> 
> 
> Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h
> 

svn commit: r350511 - head/contrib/elftoolchain/readelf

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 17:59:56 2019
New Revision: 350511
URL: https://svnweb.freebsd.org/changeset/base/350511

Log:
  readelf: decode NT_GNU_PROPERTY_TYPE_0 / GNU_PROPERTY_X86_FEATURE_1_AND
  
  These bits are used for Intel CET IBT/Shadow Stack.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20516

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Aug  1 17:45:43 2019
(r350510)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Aug  1 17:59:56 2019
(r350511)
@@ -322,11 +322,13 @@ static void dump_mips_specific_info(struct readelf *re
 static void dump_notes(struct readelf *re);
 static void dump_notes_content(struct readelf *re, const char *buf, size_t sz,
 off_t off);
-static void dump_notes_data(const char *name, uint32_t type, const char *buf,
-size_t sz);
+static void dump_notes_data(struct readelf *re, const char *name,
+uint32_t type, const char *buf, size_t sz);
 static void dump_svr4_hash(struct section *s);
 static void dump_svr4_hash64(struct readelf *re, struct section *s);
 static void dump_gnu_hash(struct readelf *re, struct section *s);
+static void dump_gnu_property_type_0(struct readelf *re, const char *buf,
+size_t sz);
 static void dump_hash(struct readelf *re);
 static void dump_phdr(struct readelf *re);
 static void dump_ppc_attributes(uint8_t *p, uint8_t *pe);
@@ -3517,7 +3519,63 @@ dump_gnu_hash(struct readelf *re, struct section *s)
free(bl);
 }
 
+static struct flag_desc gnu_property_x86_feature_1_and_bits[] = {
+   { GNU_PROPERTY_X86_FEATURE_1_IBT,   "IBT" },
+   { GNU_PROPERTY_X86_FEATURE_1_SHSTK, "SHSTK" },
+   { 0, NULL }
+};
+
 static void
+dump_gnu_property_type_0(struct readelf *re, const char *buf, size_t sz)
+{
+   size_t i;
+   uint32_t type, prop_sz;
+
+   printf("  Properties: ");
+   while (sz > 0) {
+   if (sz < 8)
+   goto bad;
+
+   type = *(const uint32_t *)(const void *)buf;
+   prop_sz = *(const uint32_t *)(const void *)(buf + 4);
+   buf += 8;
+   sz -= 8;
+
+   if (prop_sz > sz)
+   goto bad;
+
+   if (type >= GNU_PROPERTY_LOPROC &&
+   type <= GNU_PROPERTY_HIPROC) {
+   if (re->ehdr.e_machine != EM_X86_64) {
+   printf("machine type %x unknown\n",
+   re->ehdr.e_machine);
+   goto unknown;
+   }
+   switch (type) {
+   case GNU_PROPERTY_X86_FEATURE_1_AND:
+   printf("x86 features:");
+   if (prop_sz != 4)
+   goto bad;
+   dump_flags(gnu_property_x86_feature_1_and_bits,
+   *(const uint32_t *)(const void *)buf);
+   break;
+   }
+   }
+
+   buf += roundup2(prop_sz, 8);
+   sz -= roundup2(prop_sz, 8);
+   }
+   return;
+bad:
+   printf("corrupt GNU property\n");
+unknown:
+   printf("remaining description data:");
+   for (i = 0; i < sz; i++)
+   printf(" %02x", (unsigned char)buf[i]);
+   printf("\n");
+}
+
+static void
 dump_hash(struct readelf *re)
 {
struct section  *s;
@@ -3608,7 +3666,8 @@ static struct flag_desc note_feature_ctl_flags[] = {
 };
 
 static void
-dump_notes_data(const char *name, uint32_t type, const char *buf, size_t sz)
+dump_notes_data(struct readelf *re, const char *name, uint32_t type,
+const char *buf, size_t sz)
 {
size_t i;
const uint32_t *ubuf;
@@ -3640,6 +3699,12 @@ dump_notes_data(const char *name, uint32_t type, const
dump_flags(note_feature_ctl_flags, ubuf[0]);
return;
}
+   } else if (strcmp(name, "GNU") == 0) {
+   switch (type) {
+   case NT_GNU_PROPERTY_TYPE_0:
+   dump_gnu_property_type_0(re, buf, sz);
+   return;
+   }
}
 unknown:
printf("   description data:");
@@ -3684,7 +3749,7 @@ dump_notes_content(struct readelf *re, const char *buf
printf("  %-13s %#010jx", name, (uintmax_t) note->n_descsz);
printf("  %s\n", note_type(name, re->ehdr.e_type,
note->n_type));
-   dump_notes_data(name, note->n_type, buf, note->n_descsz);
+   dump_notes_data(re, name, note->n_type, buf, note->n_descsz);
buf += roundup2(note->n_descsz

Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ian Lepore
On Thu, 2019-08-01 at 10:39 -0700, John Baldwin wrote:
> On 7/31/19 8:13 PM, Ed Maste wrote:
> > On Thu, 1 Aug 2019 at 12:51, Rodney W. Grimes <
> > free...@gndrsh.dnsmgr.net> wrote:
> > > 
> > > That would be fine, the important thing is that the
> > > r350505 gets listed in the file,
> > 
> > I don't see any reason that r350505 specifically should be in a
> > release note - this is a minor clarification of an existing
> > deprecation notice. It seems having an overall "deprecation
> > notices"
> > section in the release notes would make sense, but they should
> > really
> > persist from version to version. Should we add a top-level
> > DEPRECATION_NOTICES file perhaps? Or tag deprecation notices with
> > some
> > sort of comment in the source so they can be found with a 'grep'
> > during release preparation?
> 
> I think it would make sense to have "sections" in RELNOTES that mimic
> the sections we have in the existing release notes (e.g. kernel vs
> userland).  That is effectively what GDB does with a top level NEWS
> file.  This approach would hopefully make it easier to translate this
> file into the real release notes.  It also means that a given "note"
> can evolve over time (e.g. it might start with "XYZ is deprecated" to
> "XYZ is removed" if a deprecation note is added and merged and later
> it
> is removed) rather than only having a running journal ala UPDATING.
> 
> On the question of whether we want a dedicated section just for
> deprecation notices, I'm not sure.  Probably we can just stick with
> the
> layout of our existing release notes?
> 

I wonder why it is that this relnotes file is some kind of major
attractor for complexity?

As I understand it, the *entire* intent of this file was "if you forget
to add Relnotes: yes" to a commit, this gives you a way to flag the
commit after the fact, since commit messages are immutable.

If people realize they forgot Relnotes: yes, and the remedy for that is
that they have to spelunk around in some complex formatted file to find
the "right section" (whatever that means)... well, I think in the real
world: they won't.

-- Ian


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


svn commit: r350512 - head/tests/sys/kern

2019-08-01 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Aug  1 18:19:16 2019
New Revision: 350512
URL: https://svnweb.freebsd.org/changeset/base/350512

Log:
  Only skip test cases sometimes failing in CI when they are running in CI
  
  Suggested by: jhb
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/kern/ptrace_test.c

Modified: head/tests/sys/kern/ptrace_test.c
==
--- head/tests/sys/kern/ptrace_test.c   Thu Aug  1 17:59:56 2019
(r350511)
+++ head/tests/sys/kern/ptrace_test.c   Thu Aug  1 18:19:16 2019
(r350512)
@@ -258,7 +258,8 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debug
int cpipe[2], dpipe[2], status;
char c;
 
-   atf_tc_skip("https://bugs.freebsd.org/239399";);
+   if (atf_tc_get_config_var_as_bool(tc, "ci"))
+   atf_tc_skip("https://bugs.freebsd.org/239399";);
 
ATF_REQUIRE(pipe(cpipe) == 0);
ATF_REQUIRE((child = fork()) != -1);
@@ -801,7 +802,8 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelate
pid_t children[2], fpid, wpid;
int cpipe[2], status;
 
-   atf_tc_skip("https://bugs.freebsd.org/239397";);
+   if (atf_tc_get_config_var_as_bool(tc, "ci"))
+   atf_tc_skip("https://bugs.freebsd.org/239397";);
 
ATF_REQUIRE(pipe(cpipe) == 0);
ATF_REQUIRE((fpid = fork()) != -1);
@@ -871,7 +873,8 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat
pid_t children[2], fpid, wpid;
int cpipe[2], status;
 
-   atf_tc_skip("https://bugs.freebsd.org/239292";);
+   if (atf_tc_get_config_var_as_bool(tc, "ci"))
+   atf_tc_skip("https://bugs.freebsd.org/239292";);
 
ATF_REQUIRE(pipe(cpipe) == 0);
ATF_REQUIRE((fpid = fork()) != -1);
@@ -936,7 +939,8 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrela
pid_t children[2], fpid, wpid;
int cpipe[2], status;
 
-   atf_tc_skip("https://bugs.freebsd.org/239425";);
+   if (atf_tc_get_config_var_as_bool(tc, "ci"))
+   atf_tc_skip("https://bugs.freebsd.org/239425";);
 
ATF_REQUIRE(pipe(cpipe) == 0);
ATF_REQUIRE((fpid = fork()) != -1);
@@ -2084,7 +2088,8 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc)
struct ptrace_lwpinfo pl;
struct sched_param sched_param;
 
-   atf_tc_skip("https://bugs.freebsd.org/220841";);
+   if (atf_tc_get_config_var_as_bool(tc, "ci"))
+   atf_tc_skip("https://bugs.freebsd.org/220841";);
 
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350512 - head/tests/sys/kern

2019-08-01 Thread John Baldwin
On 8/1/19 11:19 AM, Li-Wen Hsu wrote:
> Author: lwhsu
> Date: Thu Aug  1 18:19:16 2019
> New Revision: 350512
> URL: https://svnweb.freebsd.org/changeset/base/350512
> 
> Log:
>   Only skip test cases sometimes failing in CI when they are running in CI
>   
>   Suggested by:   jhb
>   Sponsored by:   The FreeBSD Foundation

Thanks Li-Wen!

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


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

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 18:51:18 2019
New Revision: 350514
URL: https://svnweb.freebsd.org/changeset/base/350514

Log:
  Add an MLINK for daemonfd(3).
  
  MFC after:3 days

Modified:
  head/lib/libc/gen/Makefile.inc

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu Aug  1 18:51:06 2019
(r350513)
+++ head/lib/libc/gen/Makefile.inc  Thu Aug  1 18:51:18 2019
(r350514)
@@ -325,6 +325,7 @@ MLINKS+=arc4random.3 arc4random_buf.3 \
arc4random.3 arc4random_uniform.3
 MLINKS+=auxv.3 elf_aux_info.3
 MLINKS+=ctermid.3 ctermid_r.3
+MLINKS+=daemon.3 daemonfd.3
 MLINKS+=devname.3 devname_r.3
 MLINKS+=devname.3 fdevname.3
 MLINKS+=devname.3 fdevname_r.3
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 18:51:06 2019
New Revision: 350513
URL: https://svnweb.freebsd.org/changeset/base/350513

Log:
  Fix formatting.
  
  MFC after:3 days

Modified:
  head/lib/libc/gen/daemon.3

Modified: head/lib/libc/gen/daemon.3
==
--- head/lib/libc/gen/daemon.3  Thu Aug  1 18:19:16 2019(r350512)
+++ head/lib/libc/gen/daemon.3  Thu Aug  1 18:51:06 2019(r350513)
@@ -93,7 +93,7 @@ function may fail and set
 .Va errno
 for any of the errors specified for the library functions
 .Xr fork 2
-.Xr open 2,
+.Xr open 2 ,
 and
 .Xr setsid 2 .
 .Sh SEE ALSO
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread John Baldwin
On 8/1/19 11:09 AM, Ian Lepore wrote:
> On Thu, 2019-08-01 at 10:39 -0700, John Baldwin wrote:
>> On 7/31/19 8:13 PM, Ed Maste wrote:
>>> On Thu, 1 Aug 2019 at 12:51, Rodney W. Grimes <
>>> free...@gndrsh.dnsmgr.net> wrote:

 That would be fine, the important thing is that the
 r350505 gets listed in the file,
>>>
>>> I don't see any reason that r350505 specifically should be in a
>>> release note - this is a minor clarification of an existing
>>> deprecation notice. It seems having an overall "deprecation
>>> notices"
>>> section in the release notes would make sense, but they should
>>> really
>>> persist from version to version. Should we add a top-level
>>> DEPRECATION_NOTICES file perhaps? Or tag deprecation notices with
>>> some
>>> sort of comment in the source so they can be found with a 'grep'
>>> during release preparation?
>>
>> I think it would make sense to have "sections" in RELNOTES that mimic
>> the sections we have in the existing release notes (e.g. kernel vs
>> userland).  That is effectively what GDB does with a top level NEWS
>> file.  This approach would hopefully make it easier to translate this
>> file into the real release notes.  It also means that a given "note"
>> can evolve over time (e.g. it might start with "XYZ is deprecated" to
>> "XYZ is removed" if a deprecation note is added and merged and later
>> it
>> is removed) rather than only having a running journal ala UPDATING.
>>
>> On the question of whether we want a dedicated section just for
>> deprecation notices, I'm not sure.  Probably we can just stick with
>> the
>> layout of our existing release notes?
>>
> 
> I wonder why it is that this relnotes file is some kind of major
> attractor for complexity?
> 
> As I understand it, the *entire* intent of this file was "if you forget
> to add Relnotes: yes" to a commit, this gives you a way to flag the
> commit after the fact, since commit messages are immutable.
> 
> If people realize they forgot Relnotes: yes, and the remedy for that is
> that they have to spelunk around in some complex formatted file to find
> the "right section" (whatever that means)... well, I think in the real
> world: they won't.

My assumption was that relnotes would remain a simple text file.  I think
the win is that you aren't editing XML or SGML or the like, and that you
can go back and edit existing entries if needed as well as document
something when you missed relnotes: yes.  The more work we put into having
something closer to the finished product in this file, the less work re@
has to do to parse commit messages.

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


svn commit: r350515 - head/contrib/elftoolchain/addr2line

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 18:56:32 2019
New Revision: 350515
URL: https://svnweb.freebsd.org/changeset/base/350515

Log:
  Capsicumize addr2line(1).
  
  Reviewed by:  oshogbo
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21104

Modified:
  head/contrib/elftoolchain/addr2line/addr2line.c

Modified: head/contrib/elftoolchain/addr2line/addr2line.c
==
--- head/contrib/elftoolchain/addr2line/addr2line.c Thu Aug  1 18:51:18 
2019(r350514)
+++ head/contrib/elftoolchain/addr2line/addr2line.c Thu Aug  1 18:56:32 
2019(r350515)
@@ -25,6 +25,8 @@
  */
 
 #include 
+
+#include 
 #include 
 #include 
 #include 
@@ -649,6 +651,7 @@ find_section_base(const char *exe, Elf *e, const char 
 int
 main(int argc, char **argv)
 {
+   cap_rights_t rights;
Elf *e;
Dwarf_Debug dbg;
Dwarf_Error de;
@@ -705,6 +708,16 @@ main(int argc, char **argv)
 
if ((fd = open(exe, O_RDONLY)) < 0)
err(EXIT_FAILURE, "%s", exe);
+
+   if (caph_rights_limit(fd, cap_rights_init(&rights, CAP_FSTAT,
+   CAP_MMAP_R)) < 0)
+   errx(EXIT_FAILURE, "caph_rights_limit");
+
+   caph_cache_catpages();
+   if (caph_limit_stdio() < 0)
+   errx(EXIT_FAILURE, "failed to limit stdio rights");
+   if (caph_enter() < 0)
+   errx(EXIT_FAILURE, "failed to enter capability mode");
 
if (dwarf_init(fd, DW_DLC_READ, NULL, NULL, &dbg, &de))
errx(EXIT_FAILURE, "dwarf_init: %s", dwarf_errmsg(de));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350516 - in head: contrib/elftoolchain/readelf usr.bin/readelf

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 18:57:08 2019
New Revision: 350516
URL: https://svnweb.freebsd.org/changeset/base/350516

Log:
  Capsicumize readelf(1).
  
  Reviewed by:  oshogbo
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21108

Modified:
  head/contrib/elftoolchain/readelf/readelf.c
  head/usr.bin/readelf/Makefile

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Aug  1 18:56:32 2019
(r350515)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Aug  1 18:57:08 2019
(r350516)
@@ -26,8 +26,10 @@
 
 #include 
 #include 
+
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -45,6 +47,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include "_elftc.h"
 
 ELFTC_VCSID("$Id: readelf.c 3649 2018-11-24 03:26:23Z emaste $");
@@ -7214,15 +7219,8 @@ process_members:
 }
 
 static void
-dump_object(struct readelf *re)
+dump_object(struct readelf *re, int fd)
 {
-   int fd;
-
-   if ((fd = open(re->filename, O_RDONLY)) == -1) {
-   warn("open %s failed", re->filename);
-   return;
-   }
-
if ((re->flags & DISPLAY_FILENAME) != 0)
printf("\nFile: %s\n", re->filename);
 
@@ -7589,9 +7587,11 @@ readelf_usage(int status)
 int
 main(int argc, char **argv)
 {
+   cap_rights_trights;
+   fileargs_t  *fa;
struct readelf  *re, re_storage;
unsigned longsi;
-   int  opt, i;
+   int  fd, opt, i;
char*ep;
 
re = &re_storage;
@@ -7714,9 +7714,28 @@ main(int argc, char **argv)
errx(EXIT_FAILURE, "ELF library initialization failed: %s",
elf_errmsg(-1));
 
+   cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_MMAP_R, CAP_SEEK);
+   fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
+   if (fa == NULL)
+   err(1, "Unable to initialize casper fileargs");
+
+   caph_cache_catpages();
+   if (caph_limit_stdio() < 0) {
+   fileargs_free(fa);
+   err(1, "Unable to limit stdio rights");
+   }
+   if (caph_enter_casper() < 0) {
+   fileargs_free(fa);
+   err(1, "Unable to enter capability mode");
+   }
+
for (i = 0; i < argc; i++) {
re->filename = argv[i];
-   dump_object(re);
+   fd = fileargs_open(fa, re->filename);
+   if (fd < 0)
+   warn("open %s failed", re->filename);
+   else
+   dump_object(re, fd);
}
 
exit(EXIT_SUCCESS);

Modified: head/usr.bin/readelf/Makefile
==
--- head/usr.bin/readelf/Makefile   Thu Aug  1 18:56:32 2019
(r350515)
+++ head/usr.bin/readelf/Makefile   Thu Aug  1 18:57:08 2019
(r350516)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 ELFTCDIR=  ${SRCTOP}/contrib/elftoolchain
 READELFDIR=${ELFTCDIR}/readelf
 
@@ -9,6 +11,12 @@ PROG= readelf
 SRCS=  readelf.c
 
 LIBADD=dwarf elftc elf
+
+.if ${MK_CASPER} != "no"
+LIBADD+=   casper
+LIBADD+=   cap_fileargs
+CFLAGS+=   -DWITH_CASPER
+.endif
 
 CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350517 - in head: contrib/elftoolchain/size usr.bin/size

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 18:57:37 2019
New Revision: 350517
URL: https://svnweb.freebsd.org/changeset/base/350517

Log:
  Capsicumize size(1).
  
  Reviewed by:  oshogbo
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21105

Modified:
  head/contrib/elftoolchain/size/size.c
  head/usr.bin/size/Makefile

Modified: head/contrib/elftoolchain/size/size.c
==
--- head/contrib/elftoolchain/size/size.c   Thu Aug  1 18:57:08 2019
(r350516)
+++ head/contrib/elftoolchain/size/size.c   Thu Aug  1 18:57:37 2019
(r350517)
@@ -25,6 +25,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,6 +37,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include "_elftc.h"
 
 ELFTC_VCSID("$Id: size.c 3458 2016-05-09 15:01:25Z emaste $");
@@ -46,7 +50,6 @@ ELFTC_VCSID("$Id: size.c 3458 2016-05-09 15:01:25Z ema
 
 enum return_code {
RETURN_OK,
-   RETURN_NOINPUT,
RETURN_DATAERR,
RETURN_USAGE
 };
@@ -68,7 +71,6 @@ static int show_totals;
 static int size_option;
 static enum radix_style radix = RADIX_DECIMAL;
 static enum output_style style = STYLE_BERKELEY;
-static const char *default_args[2] = { "a.out", NULL };
 
 static struct {
int row;
@@ -97,7 +99,7 @@ static void   berkeley_header(void);
 static voidberkeley_totals(void);
 static int handle_core(char const *, Elf *elf, GElf_Ehdr *);
 static voidhandle_core_note(Elf *, GElf_Ehdr *, GElf_Phdr *, char **);
-static int handle_elf(char const *);
+static int handle_elf(int, char const *);
 static voidhandle_phdr(Elf *, GElf_Ehdr *, GElf_Phdr *, uint32_t,
const char *);
 static voidshow_version(void);
@@ -119,8 +121,11 @@ static voidtbl_flush(void);
 int
 main(int argc, char **argv)
 {
-   int ch, r, rc;
-   const char **files, *fn;
+   cap_rights_t rights;
+   fileargs_t *fa;
+   int ch, fd, r, rc;
+   const char *fn;
+   char *defaultfn;
 
rc = RETURN_OK;
 
@@ -193,21 +198,45 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
 
-   files = (argc == 0) ? default_args : (void *) argv;
+   if (argc == 0) {
+   defaultfn = strdup("a.out");
+   if (defaultfn == NULL)
+   err(EXIT_FAILURE, "strdup");
+   argc = 1;
+   argv = &defaultfn;
+   } else {
+   defaultfn = NULL;
+   }
 
-   while ((fn = *files) != NULL) {
-   rc = handle_elf(fn);
+   cap_rights_init(&rights, CAP_FSTAT, CAP_MMAP_R);
+   fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
+   if (fa == NULL)
+   err(EXIT_FAILURE, "failed to initialize fileargs");
+
+   caph_cache_catpages();
+   if (caph_limit_stdio() < 0)
+   err(EXIT_FAILURE, "failed to limit stdio rights");
+   if (caph_enter_casper() < 0)
+   err(EXIT_FAILURE, "failed to enter capability mode");
+
+   for (; argc > 0; argc--, argv++) {
+   fn = argv[0];
+   fd = fileargs_open(fa, fn);
+   if (fd < 0) {
+   warn("%s: Failed to open", fn);
+   continue;
+   }
+   rc = handle_elf(fd, fn);
if (rc != RETURN_OK)
-   warnx(rc == RETURN_NOINPUT ?
- "'%s': No such file" :
- "%s: File format not recognized", fn);
-   files++;
+   warnx("%s: File format not recognized", fn);
}
if (style == STYLE_BERKELEY) {
if (show_totals)
berkeley_totals();
tbl_flush();
}
+   fileargs_free(fa);
+   free(defaultfn);
 return (rc);
 }
 
@@ -582,7 +611,7 @@ handle_core(char const *name, Elf *elf, GElf_Ehdr *elf
  * or the size of the text, data, bss sections will be printed out.
  */
 static int
-handle_elf(char const *name)
+handle_elf(int fd, const char *name)
 {
GElf_Ehdr elfhdr;
GElf_Shdr shdr;
@@ -590,13 +619,7 @@ handle_elf(char const *name)
Elf_Arhdr *arhdr;
Elf_Scn *scn;
Elf_Cmd elf_cmd;
-   int exit_code, fd;
-
-   if (name == NULL)
-   return (RETURN_NOINPUT);
-
-   if ((fd = open(name, O_RDONLY, 0)) < 0)
-   return (RETURN_NOINPUT);
+   int exit_code;
 
elf_cmd = ELF_C_READ;
elf1 = elf_begin(fd, elf_cmd, NULL);

Modified: head/usr.bin/size/Makefile
==
--- head/usr.bin/size/Makefile  Thu Aug  1 18:57:08 2019(r350516)
+++ head/usr.bin/size/Makefile  Thu Aug  1 18:57:37 2019(r350517)
@@ -11,6 +11,12 @@ PROG=size
 
 LIBADD=elftc elf
 
+.if ${MK_CASPER} 

svn commit: r350518 - in head: contrib/binutils/gas/doc gnu/usr.bin/binutils/as

2019-08-01 Thread Ed Maste
Author: emaste
Date: Thu Aug  1 19:01:27 2019
New Revision: 350518
URL: https://svnweb.freebsd.org/changeset/base/350518

Log:
  as: add deprecation notice to the man page
  
  In the future FreeBSD will ship without GNU binutils 2.17.50.  Add a
  note advising users who require GNU as to install the binutils port
  or package.
  
  Note that on armv7, arm64, amd64, i386 we currently ship only two
  binutils tools (as and objdump).  A deprecation notice was added to
  objdump's man page some time ago.
  
  PR:   233611
  Discussed with:   jhb
  MFC after:1 week
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/binutils/gas/doc/as.texinfo
  head/gnu/usr.bin/binutils/as/as.1

Modified: head/contrib/binutils/gas/doc/as.texinfo
==
--- head/contrib/binutils/gas/doc/as.texinfoThu Aug  1 18:57:37 2019
(r350517)
+++ head/contrib/binutils/gas/doc/as.texinfoThu Aug  1 19:01:27 2019
(r350518)
@@ -1295,6 +1295,9 @@ computer-readable series of instructions.  Different v
 @section The GNU Assembler
 
 @c man begin DESCRIPTION
+@sc{gnu} @command{as} will be removed from a future version of the
+FreeBSD base system.  Users who require
+@sc{gnu} @command{as} are advised to install the binutils port or package.
 
 @sc{gnu} @command{as} is really a family of assemblers.
 @ifclear GENERIC

Modified: head/gnu/usr.bin/binutils/as/as.1
==
--- head/gnu/usr.bin/binutils/as/as.1   Thu Aug  1 18:57:37 2019
(r350517)
+++ head/gnu/usr.bin/binutils/as/as.1   Thu Aug  1 19:01:27 2019
(r350518)
@@ -293,6 +293,10 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-\-alte
  [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR]
 .SH "DESCRIPTION"
 .IX Header "DESCRIPTION"
+\&\s-1GNU\s0 \fBas\fR will be removed from a future version of the
+FreeBSD base system.  Users who require
+\&\s-1GNU\s0 \fBas\fR are advised to install the binutils port or package.
+.PP
 \&\s-1GNU\s0 \fBas\fR is really a family of assemblers.
 If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you
 should find a fairly similar environment when you use it on another
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350519 - head/tools/build

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 19:26:16 2019
New Revision: 350519
URL: https://svnweb.freebsd.org/changeset/base/350519

Log:
  Include caph_rights_limit() in libegacy if need be.
  
  Reported by:  jenkins
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/build/Makefile

Modified: head/tools/build/Makefile
==
--- head/tools/build/Makefile   Thu Aug  1 19:01:27 2019(r350518)
+++ head/tools/build/Makefile   Thu Aug  1 19:26:16 2019(r350519)
@@ -51,8 +51,9 @@ SRCS+=explicit_bzero.c
 
 .if exists(/usr/include/capsicum_helpers.h)
 _WITH_CAPH_ENTER!= grep -c caph_enter /usr/include/capsicum_helpers.h || true
+_WITH_CAPH_RIGHTS_LIMIT!= grep -c caph_rights_limit 
/usr/include/capsicum_helpers.h || true
 .endif
-.if !defined(_WITH_CAPH_ENTER) || ${_WITH_CAPH_ENTER} == 0
+.if !defined(_WITH_CAPH_ENTER) || ${_WITH_CAPH_ENTER} == 0 || 
${_WITH_CAPH_RIGHTS_LIMIT} == 0
 .PATH: ${SRCTOP}/lib/libcapsicum
 INCS+= capsicum_helpers.h
 .PATH: ${SRCTOP}/lib/libcasper/libcasper
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350520 - head/sys/netinet

2019-08-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Aug  1 19:45:34 2019
New Revision: 350520
URL: https://svnweb.freebsd.org/changeset/base/350520

Log:
  Fix the reporting of multiple unknown parameters in an received INIT
  chunk. This also plugs an potential mbuf leak.
  Thanks to Felix Weinrank for reporting this issue found by fuzz-testing
  the userland stack.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Thu Aug  1 19:26:16 2019
(r350519)
+++ head/sys/netinet/sctp_output.c  Thu Aug  1 19:45:34 2019
(r350520)
@@ -4988,17 +4988,17 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
 */
struct sctp_paramhdr *phdr, params;
 
-   struct mbuf *mat, *op_err;
+   struct mbuf *mat, *m_tmp, *op_err, *op_err_last;
int at, limit, pad_needed;
uint16_t ptype, plen, padded_size;
-   int err_at;
 
*abort_processing = 0;
mat = in_initpkt;
-   err_at = 0;
limit = ntohs(cp->chunk_length) - sizeof(struct sctp_init_chunk);
at = param_offset;
op_err = NULL;
+   op_err_last = NULL;
+   pad_needed = 0;
SCTPDBG(SCTP_DEBUG_OUTPUT1, "Check for unrecognized param's\n");
phdr = sctp_get_next_param(mat, at, ¶ms, sizeof(params));
while ((phdr != NULL) && ((size_t)limit >= sizeof(struct 
sctp_paramhdr))) {
@@ -5123,6 +5123,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
*abort_processing = 1;
sctp_m_freem(op_err);
op_err = NULL;
+   op_err_last = NULL;
 #ifdef INET6
l_len = SCTP_MIN_OVERHEAD;
 #else
@@ -5131,7 +5132,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
l_len += sizeof(struct sctp_chunkhdr);
l_len += sizeof(struct sctp_gen_error_cause);
op_err = sctp_get_mbuf_for_msg(l_len, 0, 
M_NOWAIT, 1, MT_DATA);
-   if (op_err) {
+   if (op_err != NULL) {
/*
 * Pre-reserve space for IP, SCTP,
 * and chunk header.
@@ -5151,6 +5152,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
if (SCTP_BUF_NEXT(op_err) == NULL) {
sctp_m_freem(op_err);
op_err = NULL;
+   op_err_last = NULL;
}
}
return (op_err);
@@ -5186,37 +5188,55 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_
 #endif
SCTP_BUF_RESV_UF(op_err, 
sizeof(struct sctphdr));
SCTP_BUF_RESV_UF(op_err, 
sizeof(struct sctp_chunkhdr));
+   op_err_last = op_err;
}
}
-   if (op_err) {
+   if (op_err != NULL) {
/* If we have space */
-   struct sctp_paramhdr s;
+   struct sctp_paramhdr *param;
 
-   if (err_at % 4) {
-   uint32_t cpthis = 0;
-
-   pad_needed = 4 - (err_at % 4);
-   m_copyback(op_err, err_at, 
pad_needed, (caddr_t)&cpthis);
-   err_at += pad_needed;
+   if (pad_needed > 0) {
+   op_err_last = 
sctp_add_pad_tombuf(op_err_last, pad_needed);
}
-   s.param_type = 
htons(SCTP_UNRECOG_PARAM);
-   s.param_length = 
htons((uint16_t)sizeof(struct sctp_paramhdr) + plen);
-   m_copyback(op_err, err_at, 
sizeof(struct sctp_paramhdr), (caddr_t)&s);
-   err_at += sizeof(struct sctp_paramhdr);
-   SCTP_BUF_NEXT(op_err) = 
SCTP_M_COPYM(mat, at, plen, M_NOWAIT);
-   if (SCTP_BUF_NEXT(op_err) == NULL) {
+   if (op_err_last == NULL) {
sctp_m_freem(op_err);

Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Rodney W. Grimes
> On Thu, 2019-08-01 at 10:39 -0700, John Baldwin wrote:
> > On 7/31/19 8:13 PM, Ed Maste wrote:
> > > On Thu, 1 Aug 2019 at 12:51, Rodney W. Grimes <
> > > free...@gndrsh.dnsmgr.net> wrote:
> > > > 
> > > > That would be fine, the important thing is that the
> > > > r350505 gets listed in the file,
> > > 
> > > I don't see any reason that r350505 specifically should be in a
> > > release note - this is a minor clarification of an existing
> > > deprecation notice. It seems having an overall "deprecation
> > > notices"
> > > section in the release notes would make sense, but they should
> > > really
> > > persist from version to version. Should we add a top-level
> > > DEPRECATION_NOTICES file perhaps? Or tag deprecation notices with
> > > some
> > > sort of comment in the source so they can be found with a 'grep'
> > > during release preparation?
> > 
> > I think it would make sense to have "sections" in RELNOTES that mimic
> > the sections we have in the existing release notes (e.g. kernel vs
> > userland).  That is effectively what GDB does with a top level NEWS
> > file.  This approach would hopefully make it easier to translate this
> > file into the real release notes.  It also means that a given "note"
> > can evolve over time (e.g. it might start with "XYZ is deprecated" to
> > "XYZ is removed" if a deprecation note is added and merged and later
> > it
> > is removed) rather than only having a running journal ala UPDATING.
> > 
> > On the question of whether we want a dedicated section just for
> > deprecation notices, I'm not sure.  Probably we can just stick with
> > the
> > layout of our existing release notes?
> > 
> 
> I wonder why it is that this relnotes file is some kind of major
> attractor for complexity?
> 
> As I understand it, the *entire* intent of this file was "if you forget
> to add Relnotes: yes" to a commit, this gives you a way to flag the
> commit after the fact, since commit messages are immutable.
> 
> If people realize they forgot Relnotes: yes, and the remedy for that is
> that they have to spelunk around in some complex formatted file to find
> the "right section" (whatever that means)... well, I think in the real
> world: they won't.

That was my original intent when "I" first proposed this,
imho that is as simple as it needs to be.  Markj then
later proposed this file here in a review, which I did
give some feedback on, and here we are now, having
discussion that probably would of better been had during
a wider review process.

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


svn commit: r350521 - head/sys/netinet

2019-08-01 Thread Randall Stewart
Author: rrs
Date: Thu Aug  1 20:26:27 2019
New Revision: 350521
URL: https://svnweb.freebsd.org/changeset/base/350521

Log:
  Opps use fetchadd_u64 not long to keep old 32 bit platforms
  happy.

Modified:
  head/sys/netinet/tcp_ratelimit.c

Modified: head/sys/netinet/tcp_ratelimit.c
==
--- head/sys/netinet/tcp_ratelimit.cThu Aug  1 19:45:34 2019
(r350520)
+++ head/sys/netinet/tcp_ratelimit.cThu Aug  1 20:26:27 2019
(r350521)
@@ -1186,7 +1186,7 @@ tcp_rel_pacing_rate(const struct tcp_hwrate_limit_tabl
 * in order to release our refcount.
 */
rs = __DECONST(struct tcp_rate_set *, crs);
-   pre = atomic_fetchadd_long(&rs->rs_flows_using, -1);
+   pre = atomic_fetchadd_64(&rs->rs_flows_using, -1);
if (pre == 1) {
mtx_lock(&rs_mtx);
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350522 - head/usr.bin/netstat

2019-08-01 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Aug  1 20:36:25 2019
New Revision: 350522
URL: https://svnweb.freebsd.org/changeset/base/350522

Log:
  IPv6 cleanup: netstat
  
  Rename the variable for the in6_addr from in6p to ia6 to follow the
  convention generally used in FreeBSD.
  
  No functional changes.
  
  MFC after:3 months
  Sponsored by: Netflix

Modified:
  head/usr.bin/netstat/inet6.c

Modified: head/usr.bin/netstat/inet6.c
==
--- head/usr.bin/netstat/inet6.cThu Aug  1 20:26:27 2019
(r350521)
+++ head/usr.bin/netstat/inet6.cThu Aug  1 20:36:25 2019
(r350522)
@@ -1310,7 +1310,7 @@ inet6print(const char *container, struct in6_addr *in6
  */
 
 char *
-inet6name(struct in6_addr *in6p)
+inet6name(struct in6_addr *ia6)
 {
struct sockaddr_in6 sin6;
char hbuf[NI_MAXHOST], *cp;
@@ -1319,7 +1319,7 @@ inet6name(struct in6_addr *in6p)
static int first = 1;
int flags, error;
 
-   if (IN6_IS_ADDR_UNSPECIFIED(in6p)) {
+   if (IN6_IS_ADDR_UNSPECIFIED(ia6)) {
strcpy(line, "*");
return (line);
}
@@ -1332,9 +1332,9 @@ inet6name(struct in6_addr *in6p)
domain[0] = 0;
}
memset(&sin6, 0, sizeof(sin6));
-   memcpy(&sin6.sin6_addr, in6p, sizeof(*in6p));
+   memcpy(&sin6.sin6_addr, ia6, sizeof(*ia6));
sin6.sin6_family = AF_INET6;
-   /* XXX: in6p.s6_addr[2] can contain scopeid. */
+   /* XXX: ia6.s6_addr[2] can contain scopeid. */
in6_fillscopeid(&sin6);
flags = (numeric_addr) ? NI_NUMERICHOST : 0;
error = getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), hbuf,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350523 - in head: sbin/nvmecontrol sys/dev/nvme

2019-08-01 Thread Alexander Motin
Author: mav
Date: Thu Aug  1 21:44:07 2019
New Revision: 350523
URL: https://svnweb.freebsd.org/changeset/base/350523

Log:
  Add IOCTL to translate nvdX into nvmeY and NSID.
  
  While very useful by itself, it also makes `nvmecontrol` not depend on
  hardcoded device names parsing, that in its turn makes simple to take
  nvdX (and potentially any other) device names as arguments.
  
  Also added IOCTL bypass from nvdX to respective nvmeYnsZ makes them
  interchangeable for management purposes.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Added:
  head/sbin/nvmecontrol/nsid.c   (contents, props changed)
Modified:
  head/sbin/nvmecontrol/Makefile
  head/sbin/nvmecontrol/devlist.c
  head/sbin/nvmecontrol/firmware.c
  head/sbin/nvmecontrol/format.c
  head/sbin/nvmecontrol/identify.c
  head/sbin/nvmecontrol/identify_ext.c
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/ns.c
  head/sbin/nvmecontrol/nvmecontrol.8
  head/sbin/nvmecontrol/nvmecontrol.c
  head/sbin/nvmecontrol/nvmecontrol.h
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ns.c

Modified: head/sbin/nvmecontrol/Makefile
==
--- head/sbin/nvmecontrol/Makefile  Thu Aug  1 20:36:25 2019
(r350522)
+++ head/sbin/nvmecontrol/Makefile  Thu Aug  1 21:44:07 2019
(r350523)
@@ -3,7 +3,8 @@
 PACKAGE=runtime
 PROG=  nvmecontrol
 SRCS=  comnd.c nvmecontrol.c
-SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c perftest.c 
power.c reset.c
+SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c nsid.c
+SRCS+= perftest.c power.c reset.c
 #SRCS+=passthru.c
 SRCS+= identify_ext.c nvme_util.c nc_util.c
 MAN=   nvmecontrol.8

Modified: head/sbin/nvmecontrol/devlist.c
==
--- head/sbin/nvmecontrol/devlist.c Thu Aug  1 20:36:25 2019
(r350522)
+++ head/sbin/nvmecontrol/devlist.c Thu Aug  1 21:44:07 2019
(r350523)
@@ -107,11 +107,11 @@ devlist(const struct cmd *f, int argc, char *argv[])
printf("%6s: %s\n", name, mn);
 
for (i = 0; i < cdata.nn; i++) {
-   sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr,
-   NVME_NS_PREFIX, i+1);
-   read_namespace_data(fd, i+1, &nsdata);
+   read_namespace_data(fd, i + 1, &nsdata);
if (nsdata.nsze == 0)
continue;
+   sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr,
+   NVME_NS_PREFIX, i + 1);
printf("  %10s (%lldMB)\n",
name,
nsdata.nsze *

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cThu Aug  1 20:36:25 2019
(r350522)
+++ head/sbin/nvmecontrol/firmware.cThu Aug  1 21:44:07 2019
(r350523)
@@ -224,7 +224,7 @@ firmware(const struct cmd *f, int argc, char *argv[])
int activate_action, reboot_required;
charprompt[64];
void*buf = NULL;
-   int32_t size = 0;
+   int32_t size = 0, nsid;
uint16_toacs_fw;
uint8_t fw_slot1_ro, fw_num_slots;
struct nvme_controller_data cdata;
@@ -253,10 +253,6 @@ firmware(const struct cmd *f, int argc, char *argv[])
arg_help(argc, argv, f);
}
 
-   /* Check that a controller (and not a namespace) was specified. */
-   if (strstr(opt.dev, NVME_NS_PREFIX) != NULL)
-   arg_help(argc, argv, f);
-
if (opt.activate && opt.fw_img == NULL && opt.slot == 0) {
fprintf(stderr,
"Slot number to activate not specified.\n");
@@ -264,6 +260,14 @@ firmware(const struct cmd *f, int argc, char *argv[])
}
 
open_dev(opt.dev, &fd, 1, 1);
+
+   /* Check that a controller (and not a namespace) was specified. */
+   get_nsid(fd, NULL, &nsid);
+   if (nsid != 0) {
+   close(fd);
+   arg_help(argc, argv, f);
+   }
+
read_controller_data(fd, &cdata);
 
oacs_fw = (cdata.oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) &

Modified: head/sbin/nvmecontrol/format.c
==
--- head/sbin/nvmecontrol/format.c  Thu Aug  1 20:36:25 2019
(r350522)
+++ head/sbin/nvmecontrol/format.c  Thu Aug  1 21:44:07 2019
(r350523)
@@ -1,8 +1,7 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
- * Copyright (C) 2018 Alexander Motin 
- * All rights reserved

svn commit: r350524 - head/sbin/nvmecontrol

2019-08-01 Thread Alexander Motin
Author: mav
Date: Thu Aug  1 22:22:06 2019
New Revision: 350524
URL: https://svnweb.freebsd.org/changeset/base/350524

Log:
  Rename function added in r350523 to make gcc happy.
  
  MFC after:2 weeks

Modified:
  head/sbin/nvmecontrol/nsid.c

Modified: head/sbin/nvmecontrol/nsid.c
==
--- head/sbin/nvmecontrol/nsid.cThu Aug  1 21:44:07 2019
(r350523)
+++ head/sbin/nvmecontrol/nsid.cThu Aug  1 22:22:06 2019
(r350524)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 
 /* Tables for command line parsing */
 
-static cmd_fn_t nsid;
+static cmd_fn_t gnsid;
 
 static struct nsid_options {
const char  *dev;
@@ -54,7 +54,7 @@ static const struct args nsid_args[] = {
 
 static struct cmd nsid_cmd = {
.name = "nsid",
-   .fn = nsid,
+   .fn = gnsid,
.descr = "Get controller and NSID for namespace",
.ctx_size = sizeof(nsid_opt),
.opts = NULL,
@@ -64,7 +64,7 @@ static struct cmd nsid_cmd = {
 CMD_COMMAND(nsid_cmd);
 
 static void
-nsid(const struct cmd *f, int argc, char *argv[])
+gnsid(const struct cmd *f, int argc, char *argv[])
 {
char*path;
int fd;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350525 - in head/sys/arm64: arm64 include

2019-08-01 Thread Mark Johnston
Author: markj
Date: Thu Aug  1 22:48:06 2019
New Revision: 350525
URL: https://svnweb.freebsd.org/changeset/base/350525

Log:
  Use ATTR_DBM even when hardware dirty bit management is not enabled.
  
  The ARMv8 reference manual only states that the bit is reserved in
  this case; following Linux's example, use it instead of a
  software-defined bit for the purpose of indicating that a managed
  mapping is writable.
  
  Reviewed by:  alc, andrew
  MFC after:r350004
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21121

Modified:
  head/sys/arm64/arm64/pmap.c
  head/sys/arm64/include/pte.h

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Thu Aug  1 22:22:06 2019(r350524)
+++ head/sys/arm64/arm64/pmap.c Thu Aug  1 22:48:06 2019(r350525)
@@ -221,8 +221,11 @@ __FBSDID("$FreeBSD$");
  * The presence of this flag indicates that the mapping is writeable.
  * If the ATTR_AP_RO bit is also set, then the mapping is clean, otherwise it 
is
  * dirty.  This flag may only be set on managed mappings.
+ *
+ * The DBM bit is reserved on ARMv8.0 but it seems we can safely treat it
+ * as a software managed bit.
  */
-static pt_entry_t ATTR_SW_DBM;
+#defineATTR_SW_DBM ATTR_DBM
 
 struct pmap kernel_pmap_store;
 
@@ -783,15 +786,6 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_
vm_paddr_t start_pa, pa, min_pa;
uint64_t kern_delta;
int i;
-
-#ifdef notyet
-   /* Determine whether the hardware implements DBM management. */
-   uint64_t reg = READ_SPECIALREG(ID_AA64MMFR1_EL1);
-   ATTR_SW_DBM = ID_AA64MMFR1_HAFDBS(reg) == ID_AA64MMFR1_HAFDBS_AF_DBS ?
-   ATTR_DBM : _ATTR_SW_DBM;
-#else
-   ATTR_SW_DBM = _ATTR_SW_DBM;
-#endif
 
kern_delta = KERNBASE - kernstart;
 

Modified: head/sys/arm64/include/pte.h
==
--- head/sys/arm64/include/pte.hThu Aug  1 22:22:06 2019
(r350524)
+++ head/sys/arm64/include/pte.hThu Aug  1 22:48:06 2019
(r350525)
@@ -43,8 +43,8 @@ typedef   uint64_tpt_entry_t; /* page 
table entry */
 #defineATTR_MASK_L UINT64_C(0x0fff)
 #defineATTR_MASK   (ATTR_MASK_H | ATTR_MASK_L)
 /* Bits 58:55 are reserved for software */
-#defineATTR_SW_UNUSED  (1UL << 58)
-#define_ATTR_SW_DBM(1UL << 57)
+#defineATTR_SW_UNUSED2 (1UL << 58)
+#defineATTR_SW_UNUSED1 (1UL << 57)
 #defineATTR_SW_MANAGED (1UL << 56)
 #defineATTR_SW_WIRED   (1UL << 55)
 #defineATTR_UXN(1UL << 54)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Enji Cooper

> On Jul 31, 2019, at 19:58, Ed Maste  wrote:
> 
>> On Thu, 1 Aug 2019 at 12:35, Ian Lepore  wrote:
>> 
>> Why would we provide no objdump?  I use it quite frequently; it seems
>> like an essential part of the toolchain to me.
> 
> I don't want us to provide no objdump, but providing GNU objdump
> 2.17.50 indefinitely is not a viable option; see PR 218387[1] for an
> example of the kind of issue we have with providing obsolete software.
> 
> We have a choice of:
> 1. provide llvm-objdump, and no /usr/bin/objdump in the base system
> 2. install llvm-objdump as /usr/bin/objdump
> 3. require that users who want an objdump install the binutils port
> 
> /usr/bin/objdump is not required by the base system build and not
> required by most ports. exp-run details with no /usr/bin/objdump can
> be found in PR 212319[2], and PR 229046[3] is a tracking PR for
> removing dependencies on objdump.
> 
> Option 1 (removing /usr/bin/objdump) is proposed in review D7338[4]
> while option 2 is (installing llvm-objdump as objdump) is proposed in
> review D18307. llvm-objdump is roughly compatible with GNU objdump
> (command line and output format) but there are a large number of small
> issues that will likely trip up scripted or automated objdump use.
> (Scripts should probably just use readelf instead, though.) D18307 has
> a list of LLVM bug reports for known issues in llvm-objdump.
> 
> Note also that we currently provide only two or three obsolete
> binutils, depending on the CPU architecture:
> - as
> - ld
> - objdump
> 
> [1] https://bugs.freebsd.org/218387
> [2] https://bugs.freebsd.org/212319
> [3] https://bugs.freebsd.org/229046
> [4] https://reviews.freebsd.org/D7338
> [5] https://reviews.freebsd.org/D18307

Thought: could this be modified in an iterative manner, like “objdump” -> 
“gobjdump” / “llvm-objdump” -> “objdump”, etc (assuming llvm and gnu objdump 
are largely compatible)?
Thanks :)!
-Enji
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r350505 - in head: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump

2019-08-01 Thread Ed Maste
On Thu, 1 Aug 2019 at 18:54, Enji Cooper  wrote:
>
> Thought: could this be modified in an iterative manner, like “objdump” -> 
> “gobjdump” / “llvm-objdump” -> “objdump”, etc (assuming llvm and gnu objdump 
> are largely compatible)?

It could, and we have done that sort of thing in the past. But here we
should be retiring the old binutils tools well before 13.0 and I don't
think it's worth the extra complexity.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350529 - in head: sbin/nvmecontrol sys/dev/nvme

2019-08-01 Thread Alexander Motin
Author: mav
Date: Fri Aug  2 03:43:24 2019
New Revision: 350529
URL: https://svnweb.freebsd.org/changeset/base/350529

Log:
  Add more new fields and values from NVMe 1.4.
  
  MFC after:2 weeks

Modified:
  head/sbin/nvmecontrol/logpage.c
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sbin/nvmecontrol/logpage.c
==
--- head/sbin/nvmecontrol/logpage.c Fri Aug  2 01:59:58 2019
(r350528)
+++ head/sbin/nvmecontrol/logpage.c Fri Aug  2 03:43:24 2019
(r350529)
@@ -243,6 +243,9 @@ print_log_error(const struct nvme_controller_data *cda
printf(" LBA:  %ju\n", entry->lba);
printf(" Namespace ID: %u\n", entry->nsid);
printf(" Vendor specific info: %u\n", entry->vendor_specific);
+   printf(" Transport type:   %u\n", entry->trtype);
+   printf(" Command specific info:%ju\n", entry->csi);
+   printf(" Transport specific:   %u\n", entry->ttsi);
}
 }
 
@@ -315,6 +318,10 @@ print_log_health(const struct nvme_controller_data *cd
printf("Temperature Sensor %d:   ", i + 1);
print_temp(health->temp_sensor[i]);
}
+   printf("Temperature 1 Transition Count: %d\n", health->tmt1tc);
+   printf("Temperature 2 Transition Count: %d\n", health->tmt2tc);
+   printf("Total Time For Temperature 1:   %d\n", health->ttftmt1);
+   printf("Total Time For Temperature 2:   %d\n", health->ttftmt2);
 }
 
 static void

Modified: head/sys/dev/nvme/nvme.h
==
--- head/sys/dev/nvme/nvme.hFri Aug  2 01:59:58 2019(r350528)
+++ head/sys/dev/nvme/nvme.hFri Aug  2 03:43:24 2019(r350529)
@@ -600,6 +600,9 @@ enum nvme_generic_command_status_code {
NVME_SC_SANITIZE_IN_PROGRESS= 0x1d,
NVME_SC_SGL_DATA_BLOCK_GRAN_INVALID = 0x1e,
NVME_SC_NOT_SUPPORTED_IN_CMB= 0x1f,
+   NVME_SC_NAMESPACE_IS_WRITE_PROTECTED= 0x20,
+   NVME_SC_COMMAND_INTERRUPTED = 0x21,
+   NVME_SC_TRANSIENT_TRANSPORT_ERROR   = 0x22,
 
NVME_SC_LBA_OUT_OF_RANGE= 0x80,
NVME_SC_CAPACITY_EXCEEDED   = 0x81,
@@ -645,6 +648,9 @@ enum nvme_command_specific_status_code {
NVME_SC_INVALID_SEC_CTRLR_STATE = 0x20,
NVME_SC_INVALID_NUM_OF_CTRLR_RESRC  = 0x21,
NVME_SC_INVALID_RESOURCE_ID = 0x22,
+   NVME_SC_SANITIZE_PROHIBITED_WPMRE   = 0x23,
+   NVME_SC_ANA_GROUP_ID_INVALID= 0x24,
+   NVME_SC_ANA_ATTACH_FAILED   = 0x25,
 
NVME_SC_CONFLICTING_ATTRIBUTES  = 0x80,
NVME_SC_INVALID_PROTECTION_INFO = 0x81,
@@ -682,20 +688,27 @@ enum nvme_admin_opcode {
/* 0x0e-0x0f - reserved */
NVME_OPC_FIRMWARE_ACTIVATE  = 0x10,
NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD= 0x11,
+   /* 0x12-0x13 - reserved */
NVME_OPC_DEVICE_SELF_TEST   = 0x14,
NVME_OPC_NAMESPACE_ATTACHMENT   = 0x15,
+   /* 0x16-0x17 - reserved */
NVME_OPC_KEEP_ALIVE = 0x18,
NVME_OPC_DIRECTIVE_SEND = 0x19,
NVME_OPC_DIRECTIVE_RECEIVE  = 0x1a,
+   /* 0x1b - reserved */
NVME_OPC_VIRTUALIZATION_MANAGEMENT  = 0x1c,
NVME_OPC_NVME_MI_SEND   = 0x1d,
NVME_OPC_NVME_MI_RECEIVE= 0x1e,
+   /* 0x1f-0x7b - reserved */
NVME_OPC_DOORBELL_BUFFER_CONFIG = 0x7c,
 
NVME_OPC_FORMAT_NVM = 0x80,
NVME_OPC_SECURITY_SEND  = 0x81,
NVME_OPC_SECURITY_RECEIVE   = 0x82,
+   /* 0x83 - reserved */
NVME_OPC_SANITIZE   = 0x84,
+   /* 0x85 - reserved */
+   NVME_OPC_GET_LBA_STATUS = 0x86,
 };
 
 /* nvme nvm opcodes */
@@ -706,11 +719,11 @@ enum nvme_nvm_opcode {
/* 0x03 - reserved */
NVME_OPC_WRITE_UNCORRECTABLE= 0x04,
NVME_OPC_COMPARE= 0x05,
-   /* 0x06 - reserved */
+   /* 0x06-0x07 - reserved */
NVME_OPC_WRITE_ZEROES   = 0x08,
-   /* 0x07 - reserved */
NVME_OPC_DATASET_MANAGEMENT = 0x09,
-   /* 0x0a-0x0c - reserved */
+   /* 0x0a-0x0b - reserved */
+   NVME_OPC_VERIFY = 0x0c,
NVME_OPC_RESERVATION_REGISTER   = 0x0d,
NVME_OPC_RESERVATION_REPORT = 0x0e,
/* 0x0f-0x10 - reserved */
@@ -738,10 +751,21 @@ enum nvme_feature {
NVME_FEAT_KEEP_ALIVE_TIMER  = 0x0F,
NVME_FEAT_HOST_CONTROLLED_THERMAL_MGMT  = 0x10,
NVME_FEAT_NON_OP_POWER_STATE_CONFIG = 0x11,
-   /* 0x12-

svn commit: r350530 - head/sys/dev/nvme

2019-08-01 Thread Alexander Motin
Author: mav
Date: Fri Aug  2 04:04:18 2019
New Revision: 350530
URL: https://svnweb.freebsd.org/changeset/base/350530

Log:
  Fix typo in r350529.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/nvme/nvme.h

Modified: head/sys/dev/nvme/nvme.h
==
--- head/sys/dev/nvme/nvme.hFri Aug  2 03:43:24 2019(r350529)
+++ head/sys/dev/nvme/nvme.hFri Aug  2 04:04:18 2019(r350530)
@@ -1695,7 +1695,7 @@ void  nvme_health_information_page_swapbytes(struct 
nvm
for (i = 0; i < 8; i++)
s->temp_sensor[i] = le16toh(s->temp_sensor[i]);
s->tmt1tc = le32toh(s->tmt1tc);
-   s->tmt1tc = le32toh(s->tmt2tc);
+   s->tmt2tc = le32toh(s->tmt2tc);
s->ttftmt1 = le32toh(s->ttftmt1);
s->ttftmt2 = le32toh(s->ttftmt2);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"