ifdef bwfm_pci_debug_console()

2018-01-07 Thread Michael W. Bombardieri
Hello,

I noticed that calls to the function bwfm_pci_debug_console() 
are wrapped in ifdef but the function itself isn't.

- Michael


Index: if_bwfm_pci.c
===
RCS file: /cvs/src/sys/dev/pci/if_bwfm_pci.c,v
retrieving revision 1.8
diff -u -p -u -r1.8 if_bwfm_pci.c
--- if_bwfm_pci.c   8 Jan 2018 00:46:15 -   1.8
+++ if_bwfm_pci.c   8 Jan 2018 02:29:14 -
@@ -255,7 +255,9 @@ void bwfm_pci_flowring_delete(struct b
 
 voidbwfm_pci_stop(struct bwfm_softc *);
 int bwfm_pci_txdata(struct bwfm_softc *, struct mbuf *);
+#ifdef BWFM_DEBUG
 voidbwfm_pci_debug_console(struct bwfm_pci_softc *);
+#endif
 
 int bwfm_pci_msgbuf_query_dcmd(struct bwfm_softc *, int,
int, char *, size_t *);
@@ -1666,6 +1668,7 @@ bwfm_pci_txdata(struct bwfm_softc *bwfm,
return 0;
 }
 
+#ifdef BWFM_DEBUG
 void
 bwfm_pci_debug_console(struct bwfm_pci_softc *sc)
 {
@@ -1685,6 +1688,7 @@ bwfm_pci_debug_console(struct bwfm_pci_s
printf("%c", ch);
}
 }
+#endif 
 
 int
 bwfm_pci_intr(void *v)



make mpls_input take struct ifnet *ifp as an argument

2018-01-07 Thread David Gwynne
i want this so it makes mpls_input have the same function signature
as all the other protocol input functions we care about.

it also helps mpls_input because it looks up the interface the mpls
packet was received on, but it's always called by the interface
that the packet was receieved on.

on a related note, does anyone have an opinion on what a representative
mpls test setup looks like?

anyway, ok?

Index: net/if.c
===
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.534
diff -u -p -r1.534 if.c
--- net/if.c4 Jan 2018 10:48:02 -   1.534
+++ net/if.c8 Jan 2018 01:43:50 -
@@ -756,7 +756,7 @@ if_input_local(struct ifnet *ifp, struct
 #endif /* INET6 */
 #ifdef MPLS
case AF_MPLS:
-   mpls_input(m);
+   mpls_input(ifp, m);
break;
 #endif /* MPLS */
default:
Index: net/if_ethersubr.c
===
RCS file: /cvs/src/sys/net/if_ethersubr.c,v
retrieving revision 1.248
diff -u -p -r1.248 if_ethersubr.c
--- net/if_ethersubr.c  4 Jan 2018 00:33:54 -   1.248
+++ net/if_ethersubr.c  8 Jan 2018 01:43:50 -
@@ -434,7 +434,7 @@ ether_input(struct ifnet *ifp, struct mb
 #ifdef MPLS
case ETHERTYPE_MPLS:
case ETHERTYPE_MPLS_MCAST:
-   mpls_input(m);
+   mpls_input(ifp, m);
return (1);
 #endif
default:
Index: netinet/ip_ether.c
===
RCS file: /cvs/src/sys/netinet/ip_ether.c,v
retrieving revision 1.97
diff -u -p -r1.97 ip_ether.c
--- netinet/ip_ether.c  20 Nov 2017 10:35:24 -  1.97
+++ netinet/ip_ether.c  8 Jan 2018 01:43:50 -
@@ -130,7 +130,7 @@ mplsip_decap(struct mbuf *m, int iphlen)
pf_pkt_addr_changed(m);
 #endif
 
-   mpls_input(m);
+   mpls_input(&sc->gif_if, m);
 }
 
 struct gif_softc *
Index: netinet/ip_gre.c
===
RCS file: /cvs/src/sys/netinet/ip_gre.c,v
retrieving revision 1.68
diff -u -p -r1.68 ip_gre.c
--- netinet/ip_gre.c20 Nov 2017 10:35:24 -  1.68
+++ netinet/ip_gre.c8 Jan 2018 01:43:50 -
@@ -175,7 +175,7 @@ gre_input2(struct mbuf *m, int hlen, int
 #ifdef MPLS
case ETHERTYPE_MPLS:
case ETHERTYPE_MPLS_MCAST:
-   mpls_input(m);
+   mpls_input(&sc->sc_if, m);
return (1);
 #endif
default:   /* others not yet supported */
Index: netmpls/mpls.h
===
RCS file: /cvs/src/sys/netmpls/mpls.h,v
retrieving revision 1.37
diff -u -p -r1.37 mpls.h
--- netmpls/mpls.h  28 Feb 2017 07:07:07 -  1.37
+++ netmpls/mpls.h  8 Jan 2018 01:43:50 -
@@ -185,6 +185,6 @@ struct mbuf *mpls_shim_push(struct mbuf 
 
 int mpls_output(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
-voidmpls_input(struct mbuf *);
+voidmpls_input(struct ifnet *, struct mbuf *);
 
 #endif /* _KERNEL */
Index: netmpls/mpls_input.c
===
RCS file: /cvs/src/sys/netmpls/mpls_input.c,v
retrieving revision 1.65
diff -u -p -r1.65 mpls_input.c
--- netmpls/mpls_input.c8 Dec 2017 22:10:34 -   1.65
+++ netmpls/mpls_input.c8 Jan 2018 01:43:50 -
@@ -53,36 +53,32 @@ struct mbuf *mpls_ip6_adjttl(struct mbuf
 struct mbuf*mpls_do_error(struct mbuf *, int, int, int);
 
 void
-mpls_input(struct mbuf *m)
+mpls_input(struct ifnet *ifp, struct mbuf *m)
 {
struct sockaddr_mpls *smpls;
struct sockaddr_mpls sa_mpls;
struct shim_hdr *shim;
struct rtentry *rt;
struct rt_mpls *rt_mpls;
-   struct ifnet   *ifp;
u_int8_t ttl;
int hasbos;
 
-   if ((ifp = if_get(m->m_pkthdr.ph_ifidx)) == NULL ||
-   !ISSET(ifp->if_xflags, IFXF_MPLS)) {
+   if (!ISSET(ifp->if_xflags, IFXF_MPLS)) {
m_freem(m);
-   if_put(ifp);
return;
}
 
/* drop all broadcast and multicast packets */
if (m->m_flags & (M_BCAST | M_MCAST)) {
m_freem(m);
-   if_put(ifp);
return;
}
 
-   if (m->m_len < sizeof(*shim))
-   if ((m = m_pullup(m, sizeof(*shim))) == NULL) {
-   if_put(ifp);
+   if (m->m_len < sizeof(*shim)) {
+   m = m_pullup(m, sizeof(*shim));
+   if (m == NULL)
return;
-   }
+   }
 
shim = mtod(m, struct shim_hdr *);
 
@@ -98,10 +94,9 @@ mpls_input(struct mbuf *m)
if (ttl-- <= 1) {
/* TTL exceeded */
m = mpls_do_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0);
-

Re: ksh: State of NOTES and PROJECTS

2018-01-07 Thread Jeremie Courreges-Anglas
On Sat, Jan 06 2018, Klemens Nanni  wrote:
> Looking at the CVS log one can see that other legacies such as ChangeLog
> have already been zapped. NOTES and PROJECTS have seen sporadic minor
> updates since import and still list valid topics, but they lack other
> long overdue correcttions. For example:
>
> - support for POSIX character class globbing was done in 2009
> - EASY and COMPLEX history code got zapped in 2004
> - `time' has a -p option since pdksh-5.2.14 from 1999
>
> Documentation is nice but wrong/outdated documentation sucks, so should
> NOTES and PROJECTS be further maintained or removed as well?
>
> I prefer keeping them as of now since they're quite informative when
> digging deeper into the sources. On the other hand, maintenance requires
> history and knowledge of other shells when it comes to differences
> between them - I'm clearly out here and cannot judge the amount of work
> on that part.
>
> What do you think? Feedback is greatly appreciated.

NOTES is quite dense indeed, I think it can have value.

> If NOTES and PROJECTS stay, I'd be happy to remove/update some of the
> topics.

Here's a first diff to kill the most obvious entries in PROJECTS.  The
next steps will probably take more time.


Index: PROJECTS
===
RCS file: /d/cvs/src/bin/ksh/PROJECTS,v
retrieving revision 1.8
diff -u -p -r1.8 PROJECTS
--- PROJECTS14 Sep 2015 09:42:33 -  1.8
+++ PROJECTS8 Jan 2018 01:12:43 -
@@ -22,31 +22,11 @@ Things to be done in pdksh (see also the
 
   (ulimit also needs to be examined to check that it fits the posix style)
 
-* test suite
-  Ideally, as the builtin utilities are being POSIXized, short tests
-  should be written to be used in regression testing.  The tests
-  directory contains some tests, but many more need to be written.
-
-* internationalization
-  Need to handle with the LANG and LC_* environment variables.  This
-  involves changes to ensure  macros are being used (currently
-  uses its own macros in many places), figuring out how to deal with
-  bases (for integer arithmetic, eg, 12#1A), and (the nasty one) doing
-  string look ups for error messages, etc..  It probably isn't worth
-  translating strings to other languages yet as the code is likely
-  to change a lot in the near future, but it would be good to have the
-  code set up so string tables can be used.
-
 * trap code
* add the DEBUG trap.
* fix up signal handling code.  In particular, fatal vs tty signals,
  have signal routine to call to check for pending/fatal traps, etc.
 
-* parsing
-   * the time keyword needs to be hacked to accept options (!) since
- POSIX says it shall accept the -p option and must skip a -- argument
- (end of options).  Yuck.
-
 * lexing
   the lexing may need a re-write since it currently doesn't parse $( .. ),
   $(( .. )), (( ... )) properly.
@@ -68,30 +48,10 @@ Things to be done in pdksh (see also the
   in general, treatment of OPTIND/OPTARG,
 
 * history
-  There are two versions of the history code, COMPLEX_HISTORY and
-  EASY_HISTORY, which need to be merged.  COMPLEX does at&t style history
-  where the history file is written after each command and checked when
-  ever looking through the history (in case another shell has added
-  something).  EASY simply reads the history file at startup and writes
-  it before exiting.
-   * re-write the COMPLEX_HISTORY code so mmap() not needed (currently
- can't be used on machines without mmap()).
-   * Add multiline knowledge to COMPLEX_HISTORY (see EASY_HISTORY
- stuff).
-   * change COMPLEX_HISTORY code so concurrent history files are
- controlled by an option (set -o history-concurrent?).  Delete
- the EASY_HISTORY code.
+   * Add multiline knowledge
* bring history code up to POSIX standards (see POSIX description
  of fc, etc.).
 
-* documentation
-  Some sort of tutorial with examples would be good.  Texinfo is probably
-  the best medium for this.  Also, the man page could be converted to
-  texinfo (if the tutorial and man page  are put in the same texinfo
-  page, they should be somewhat distinct - i.e., the tutorial should
-  be a separate thread - but there should be cross references between the
-  two).
-
 * miscellaneous
* POSIX specifies what happens when various kinds of errors occur
  in special built-ins commands vs regular commands (builtin or
@@ -104,8 +64,3 @@ Things to be done in pdksh (see also the
* merge the emacs and vi code (should reduce the size of the shell and
  make maintenance easier); handle SIGWINCH while editing a line.
  [John Rochester is working on the merge]
-
-   * add POSIX globbing (eg, [[:alnum:]]), see POSIX.2:2.8.3.2.
-
-

interface tx mitigation, with NET LOCK fixes

2018-01-07 Thread David Gwynne
this is tx mitigation again, ie, defer calling an interfaces start
routine until at least 4 packets are queued, or a task fires.

the task firing is a problem for things like gif or vxlan that encap
a packet in ip and send it through the ip stack again. the ip stack
expects NET_RLOCK to be held. that is implicitly true when sending
out of the network stack, but not when the bundle task fires.

this has the bundle tasks take the network read lock on behalf of
the start routines, like the stack does. this avoids having to patch
every driver to cope with this.

tests?

Index: ifq.c
===
RCS file: /cvs/src/sys/net/ifq.c,v
retrieving revision 1.21
diff -u -p -r1.21 ifq.c
--- ifq.c   4 Jan 2018 11:02:57 -   1.21
+++ ifq.c   8 Jan 2018 01:09:05 -
@@ -70,9 +70,16 @@ struct priq {
 void   ifq_start_task(void *);
 void   ifq_restart_task(void *);
 void   ifq_barrier_task(void *);
+void   ifq_bundle_task(void *);
 
 #define TASK_ONQUEUE 0x1
 
+static inline void
+ifq_run_start(struct ifqueue *ifq)
+{
+   ifq_serialize(ifq, &ifq->ifq_start);
+}
+
 void
 ifq_serialize(struct ifqueue *ifq, struct task *t)
 {
@@ -114,6 +121,16 @@ ifq_is_serialized(struct ifqueue *ifq)
 }
 
 void
+ifq_start(struct ifqueue *ifq)
+{
+   if (ifq_len(ifq) >= min(4, ifq->ifq_maxlen)) {
+   task_del(ifq->ifq_softnet, &ifq->ifq_bundle);
+   ifq_run_start(ifq);
+   } else
+   task_add(ifq->ifq_softnet, &ifq->ifq_bundle);
+}
+
+void
 ifq_start_task(void *p)
 {
struct ifqueue *ifq = p;
@@ -137,11 +154,36 @@ ifq_restart_task(void *p)
 }
 
 void
+ifq_bundle_task(void *p)
+{
+   struct ifqueue *ifq = p;
+   int s;
+
+   NET_RLOCK();
+   s = splnet();
+   ifq_run_start(ifq);
+   splx(s);
+   NET_RUNLOCK();
+}
+
+void
 ifq_barrier(struct ifqueue *ifq)
 {
struct cond c = COND_INITIALIZER();
struct task t = TASK_INITIALIZER(ifq_barrier_task, &c);
 
+   if (!task_del(ifq->ifq_softnet, &ifq->ifq_bundle)) {
+   int netlocked = (rw_status(&netlock) == RW_WRITE);
+
+   if (netlocked) /* XXXSMP breaks atomicity */
+   NET_UNLOCK();
+
+   taskq_barrier(ifq->ifq_softnet);
+
+   if (netlocked)
+   NET_LOCK();
+   }
+
if (ifq->ifq_serializer == NULL)
return;
 
@@ -166,6 +208,7 @@ void
 ifq_init(struct ifqueue *ifq, struct ifnet *ifp, unsigned int idx)
 {
ifq->ifq_if = ifp;
+   ifq->ifq_softnet = net_tq(ifp->if_index);
ifq->ifq_softc = NULL;
 
mtx_init(&ifq->ifq_mtx, IPL_NET);
@@ -187,6 +230,7 @@ ifq_init(struct ifqueue *ifq, struct ifn
mtx_init(&ifq->ifq_task_mtx, IPL_NET);
TAILQ_INIT(&ifq->ifq_task_list);
ifq->ifq_serializer = NULL;
+   task_set(&ifq->ifq_bundle, ifq_bundle_task, ifq);
 
task_set(&ifq->ifq_start, ifq_start_task, ifq);
task_set(&ifq->ifq_restart, ifq_restart_task, ifq);
@@ -237,6 +281,8 @@ void
 ifq_destroy(struct ifqueue *ifq)
 {
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
+
+   ifq_barrier(ifq); /* ensure nothing is running with the ifq */
 
/* don't need to lock because this is the last use of the ifq */
 
Index: ifq.h
===
RCS file: /cvs/src/sys/net/ifq.h,v
retrieving revision 1.20
diff -u -p -r1.20 ifq.h
--- ifq.h   4 Jan 2018 11:02:57 -   1.20
+++ ifq.h   8 Jan 2018 01:09:05 -
@@ -25,6 +25,7 @@ struct ifq_ops;
 
 struct ifqueue {
struct ifnet*ifq_if;
+   struct taskq*ifq_softnet;
union {
void*_ifq_softc;
/*
@@ -57,6 +58,7 @@ struct ifqueue {
struct mutex ifq_task_mtx;
struct task_list ifq_task_list;
void*ifq_serializer;
+   struct task  ifq_bundle;
 
/* work to be serialised */
struct task  ifq_start;
@@ -405,6 +407,7 @@ void ifq_attach(struct ifqueue *, cons
 voidifq_destroy(struct ifqueue *);
 voidifq_add_data(struct ifqueue *, struct if_data *);
 int ifq_enqueue(struct ifqueue *, struct mbuf *);
+voidifq_start(struct ifqueue *);
 struct mbuf*ifq_deq_begin(struct ifqueue *);
 voidifq_deq_commit(struct ifqueue *, struct mbuf *);
 voidifq_deq_rollback(struct ifqueue *, struct mbuf *);
@@ -438,12 +441,6 @@ static inline unsigned int
 ifq_is_oactive(struct ifqueue *ifq)
 {
return (ifq->ifq_oactive);
-}
-
-static inline void
-ifq_start(struct ifqueue *ifq)
-{
-   ifq_serialize(ifq, &ifq->ifq_start);
 }
 
 static inline void



Re: ksh: remove unused param from kb_add()

2018-01-07 Thread Jeremie Courreges-Anglas
On Sun, Jan 07 2018, "Todd C. Miller"  wrote:
> In kb_add(), the args parameter is always NULL.  Noticed by anton@

ok jca@

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



av7/imx: maybe _SD_

2018-01-07 Thread Artturi Alm
Hi,

unsure about if the _MMC_HIGHSPEED is used at all,
but to keep this ++ i didn't touch it.

because of the bugged fec; i will not test this.
-Artturi


diff --git a/sys/arch/armv7/imx/imxesdhc.c b/sys/arch/armv7/imx/imxesdhc.c
index 8414dedcb37..0e951af6073 100644
--- a/sys/arch/armv7/imx/imxesdhc.c
+++ b/sys/arch/armv7/imx/imxesdhc.c
@@ -432,6 +432,8 @@ imxesdhc_attach(struct device *parent, struct device *self, 
void *aux)

if (caps & SDHC_HOST_CTRL_CAP_HSS)
saa.caps |= SMC_CAPS_MMC_HIGHSPEED;
+   if (caps & SDHC_HOST_CTRL_CAP_HSS)
+   saa.caps |= SMC_CAPS_SD_HIGHSPEED;
 
width = OF_getpropint(sc->sc_node, "bus-width", 1);
if (width >= 8)



Re: VMD: add regress tests for cdrom keyword

2018-01-07 Thread Mike Larkin
On Sat, Jan 06, 2018 at 07:33:16PM -0800, Carlos Cardenas wrote:
> Attached are regress tests for the cdrom keyword.
> 
> Comments? Ok?
> 
> +--+
> Carlos

seems ok to me

> Index: Makefile
> ===
> RCS file: /home/los/cvs/src/regress/usr.sbin/vmd/config/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- Makefile  11 Nov 2017 02:54:42 -  1.3
> +++ Makefile  7 Jan 2018 03:27:10 -
> @@ -2,10 +2,10 @@
>  
>  VMD ?= /usr/sbin/vmd
>  
> -VMD_PASS=boot-keyword memory-round memory-just-enough
> +VMD_PASS=boot-keyword memory-round memory-just-enough cdrom-keyword
>  VMD_FAIL=kernel-keyword too-few-ram vm-name-too-long too-many-ifs \
>boot-name-too-long disk-path-too-long too-many-disks \
> -  switch-no-interface switch-no-add
> +  switch-no-interface switch-no-add cdrom-name-too-long
>  
>  REGRESS_TARGETS=
>  
> Index: vmd-fail-cdrom-name-too-long.conf
> ===
> RCS file: vmd-fail-cdrom-name-too-long.conf
> diff -N vmd-fail-cdrom-name-too-long.conf
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ vmd-fail-cdrom-name-too-long.conf 7 Jan 2018 03:21:59 -
> @@ -0,0 +1,6 @@
> +#$OpenBSD$
> +# Fail on cdrom path (> 128)
> +iso="/some/absolutepath/somewhere/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/abcdefghijklmnopqrstuvwxyz0123456789/cd62.iso"
> +vm "x" {
> +cdrom $iso
> +}
> Index: vmd-fail-cdrom-name-too-long.ok
> ===
> RCS file: vmd-fail-cdrom-name-too-long.ok
> diff -N vmd-fail-cdrom-name-too-long.ok
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ vmd-fail-cdrom-name-too-long.ok   7 Jan 2018 03:21:59 -
> @@ -0,0 +1 @@
> +5: cdrom name too long
> Index: vmd-pass-cdrom-keyword.conf
> ===
> RCS file: vmd-pass-cdrom-keyword.conf
> diff -N vmd-pass-cdrom-keyword.conf
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ vmd-pass-cdrom-keyword.conf   7 Jan 2018 03:21:59 -
> @@ -0,0 +1,8 @@
> +#$OpenBSD$
> +# Pass on cdrom keyword
> +
> +vm "x" {
> +memory 1G
> +cdrom "cd62.iso"
> +disable
> +}
> Index: vmd-pass-cdrom-keyword.ok
> ===
> RCS file: vmd-pass-cdrom-keyword.ok
> diff -N vmd-pass-cdrom-keyword.ok
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ vmd-pass-cdrom-keyword.ok 7 Jan 2018 03:21:59 -
> @@ -0,0 +1 @@
> +configuration OK



ksh: remove unused param from kb_add()

2018-01-07 Thread Todd C. Miller
In kb_add(), the args parameter is always NULL.  Noticed by anton@

 - todd

Index: bin/ksh/emacs.c
===
RCS file: /cvs/src/bin/ksh/emacs.c,v
retrieving revision 1.81
diff -u -p -u -r1.81 emacs.c
--- bin/ksh/emacs.c 7 Jan 2018 19:18:56 -   1.81
+++ bin/ksh/emacs.c 7 Jan 2018 19:24:35 -
@@ -1325,14 +1325,14 @@ kb_add_string(void *func, void *args, ch
 }
 
 static struct kb_entry *
-kb_add(void *func, void *args, ...)
+kb_add(void *func, ...)
 {
va_list ap;
unsigned char   ch;
unsigned inti;
charline[LINE + 1];
 
-   va_start(ap, args);
+   va_start(ap, func);
for (i = 0; i < sizeof(line) - 1; i++) {
ch = va_arg(ap, unsigned int);
if (ch == 0)
@@ -1342,7 +1342,7 @@ kb_add(void *func, void *args, ...)
va_end(ap);
line[i] = '\0';
 
-   return (kb_add_string(func, args, line));
+   return (kb_add_string(func, NULL, line));
 }
 
 static void
@@ -1453,109 +1453,109 @@ x_init_emacs(void)
TAILQ_INIT(&kblist);
 
/* man page order */
-   kb_add(x_abort, NULL, CTRL('G'), 0);
-   kb_add(x_mv_back,   NULL, CTRL('B'), 0);
-   kb_add(x_mv_back,   NULL, CTRL('X'), CTRL('D'), 0);
-   kb_add(x_mv_bword,  NULL, CTRL('['), 'b', 0);
-   kb_add(x_beg_hist,  NULL, CTRL('['), '<', 0);
-   kb_add(x_mv_begin,  NULL, CTRL('A'), 0);
-   kb_add(x_fold_capitalize,   NULL, CTRL('['), 'C', 0);
-   kb_add(x_fold_capitalize,   NULL, CTRL('['), 'c', 0);
-   kb_add(x_comment,   NULL, CTRL('['), '#', 0);
-   kb_add(x_complete,  NULL, CTRL('['), CTRL('['), 0);
-   kb_add(x_comp_comm, NULL, CTRL('X'), CTRL('['), 0);
-   kb_add(x_comp_file, NULL, CTRL('['), CTRL('X'), 0);
-   kb_add(x_comp_list, NULL, CTRL('I'), 0);
-   kb_add(x_comp_list, NULL, CTRL('['), '=', 0);
-   kb_add(x_del_back,  NULL, CTRL('?'), 0);
-   kb_add(x_del_back,  NULL, CTRL('H'), 0);
-   kb_add(x_del_char,  NULL, CTRL('['), '[', '3', '~', 0); /* 
delete */
-   kb_add(x_del_bword, NULL, CTRL('W'), 0);
-   kb_add(x_del_bword, NULL, CTRL('['), CTRL('?'), 0);
-   kb_add(x_del_bword, NULL, CTRL('['), CTRL('H'), 0);
-   kb_add(x_del_bword, NULL, CTRL('['), 'h', 0);
-   kb_add(x_del_fword, NULL, CTRL('['), 'd', 0);
-   kb_add(x_next_com,  NULL, CTRL('N'), 0);
-   kb_add(x_next_com,  NULL, CTRL('X'), 'B', 0);
-   kb_add(x_fold_lower,NULL, CTRL('['), 'L', 0);
-   kb_add(x_fold_lower,NULL, CTRL('['), 'l', 0);
-   kb_add(x_end_hist,  NULL, CTRL('['), '>', 0);
-   kb_add(x_mv_end,NULL, CTRL('E'), 0);
+   kb_add(x_abort, CTRL('G'), 0);
+   kb_add(x_mv_back,   CTRL('B'), 0);
+   kb_add(x_mv_back,   CTRL('X'), CTRL('D'), 0);
+   kb_add(x_mv_bword,  CTRL('['), 'b', 0);
+   kb_add(x_beg_hist,  CTRL('['), '<', 0);
+   kb_add(x_mv_begin,  CTRL('A'), 0);
+   kb_add(x_fold_capitalize,   CTRL('['), 'C', 0);
+   kb_add(x_fold_capitalize,   CTRL('['), 'c', 0);
+   kb_add(x_comment,   CTRL('['), '#', 0);
+   kb_add(x_complete,  CTRL('['), CTRL('['), 0);
+   kb_add(x_comp_comm, CTRL('X'), CTRL('['), 0);
+   kb_add(x_comp_file, CTRL('['), CTRL('X'), 0);
+   kb_add(x_comp_list, CTRL('I'), 0);
+   kb_add(x_comp_list, CTRL('['), '=', 0);
+   kb_add(x_del_back,  CTRL('?'), 0);
+   kb_add(x_del_back,  CTRL('H'), 0);
+   kb_add(x_del_char,  CTRL('['), '[', '3', '~', 0); /* delete 
*/
+   kb_add(x_del_bword, CTRL('W'), 0);
+   kb_add(x_del_bword, CTRL('['), CTRL('?'), 0);
+   kb_add(x_del_bword, CTRL('['), CTRL('H'), 0);
+   kb_add(x_del_bword, CTRL('['), 'h', 0);
+   kb_add(x_del_fword, CTRL('['), 'd', 0);
+   kb_add(x_next_com,  CTRL('N'), 0);
+   kb_add(x_next_com,  CTRL('X'), 'B', 0);
+   kb_add(x_fold_lower,CTRL('['), 'L', 0);
+   kb_add(x_fold_lower,CTRL('['), 'l', 0);
+   kb_add(x_end_hist,  CTRL('['), '>', 0);
+   kb_add(x_mv_end,CTRL('E'), 0);
/* how to handle: eot: ^_, underneath copied from original keybindings 
*/
-   kb_add(x_end_of_text,   NULL, CTRL('_'), 0);
-   kb_add(x_eot_del,   NULL, CTRL('D'), 0);
+   kb_add(x_end_of_text,   

Re: clean on-disk filesystems through {suspend,hibernate}/resume

2018-01-07 Thread Theo de Raadt
> > BTW, if anyone uses softdep *you have to tell me*, and then try
> > to repeat problems you encounter without softdep.  That is a
> > totally different problem set.
> 
> Yes, I am using softdep.

I am not concerned with the softdep case.  softdep needs a maintainer,
and it isn't me.  I'll provide hints for how to debug this though:

First apply the following diff to the tree.  This will keep the screen
alive during the suspend cycle.  On some inteldrm chipsets it will
fail to resume afterwards, however.  On x230 this works, newer models
cannot handle this hack.  Anyways the goal is is to observe why it
isn't suceeding at completing the suspend sync.

Having the screen alive makes it possible to add printf's to the ffs
softdep code, in particular softdep_sync_metadata() and such
functions.  Figure out what the code is doing keeping so busy.  Why
does it keep doing IO?  Is it writing data blocks for files?  Is it
repeatedly updating the same metadata?

For this suspend case, the sync functions are being called with various
_WAIT flags instead of _NOWAIT or _LAZY.  It is being asked to achieve
stability.  What stops it from achieving stability?  When you read the
code in the area you'll be shocked at the comments.  Try to figure
out which cases are occurring.

Anyone with rudimentary C skills and patience can do this.  (But I
won't be doing it, I have other things to do)

Index: i915_drv.c
===
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_drv.c,v
retrieving revision 1.108
diff -u -p -u -r1.108 i915_drv.c
--- i915_drv.c  30 Sep 2017 07:36:56 -  1.108
+++ i915_drv.c  21 Dec 2017 05:52:54 -
@@ -673,6 +673,8 @@ static int i915_drm_suspend(struct drm_d
pci_power_t opregion_target_state;
int error;
 
+   return 0;
+
/* ignore lid events during suspend */
mutex_lock(&dev_priv->modeset_restore_lock);
dev_priv->modeset_restore = MODESET_SUSPENDED;
@@ -745,6 +747,8 @@ static int i915_drm_suspend_late(struct 
 {
struct drm_i915_private *dev_priv = drm_dev->dev_private;
int ret;
+
+   return 0;
 
ret = intel_suspend_complete(dev_priv);
 



Re: clean on-disk filesystems through {suspend,hibernate}/resume

2018-01-07 Thread Matthias Schmidt
Hi,

* Theo de Raadt wrote:
> 
> BTW, if anyone uses softdep *you have to tell me*, and then try
> to repeat problems you encounter without softdep.  That is a
> totally different problem set.

Yes, I am using softdep.

For testing, I removed softdep and performed all tests again and
run the "extract src.tar while suspending" multiple times both on /tmp
and /home.  Now, the suspend process was quite fast and the file systems
were marked clean every time.

Cheers

Matthias