svn commit: r316652 - head/sys/dev/isp

2017-04-09 Thread Alexander Motin
Author: mav
Date: Sun Apr  9 07:53:31 2017
New Revision: 316652
URL: https://svnweb.freebsd.org/changeset/base/316652

Log:
  Fix few minor issues found by Clang Analyzer.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Sun Apr  9 06:44:31 2017(r316651)
+++ head/sys/dev/isp/isp.c  Sun Apr  9 07:53:31 2017(r316652)
@@ -2662,7 +2662,8 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
break;
}
if (msg) {
-   isp_prt(isp, ISP_LOGERR, "Chan %d PLOGX PortID 0x%06x to N-Port 
handle 0x%x: %s", chan, portid, handle, msg);
+   isp_prt(isp, lev, "Chan %d PLOGX PortID 0x%06x to N-Port handle 
0x%x: %s",
+   chan, portid, handle, msg);
}
return (rval);
 }

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Sun Apr  9 06:44:31 2017
(r316651)
+++ head/sys/dev/isp/isp_freebsd.c  Sun Apr  9 07:53:31 2017
(r316652)
@@ -3779,7 +3779,6 @@ changed:
nlstate = reason = 0;
}
va_end(ap);
-   fc = ISP_FC_PC(isp, bus);
 
if (evt == ISPASYNC_CHANGE_PDB) {
msg = "Port Database Changed";
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-04-09 Thread Alexander Motin
Author: mav
Date: Sun Apr  9 07:54:39 2017
New Revision: 316653
URL: https://svnweb.freebsd.org/changeset/base/316653

Log:
  Fix few minor issues found by Clang Analyzer.
  
  MFC after:2 weeks

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

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Apr  9 07:53:31 2017(r316652)
+++ head/sys/cam/ctl/ctl.c  Sun Apr  9 07:54:39 2017(r316653)
@@ -7047,7 +7047,7 @@ ctl_get_lba_status(struct ctl_scsiio *ct
lbalen->len = total_len;
lbalen->flags = 0;
retval = lun->backend->config_read((union ctl_io *)ctsio);
-   return (CTL_RETVAL_COMPLETE);
+   return (retval);
 }
 
 int

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Sun Apr  9 07:53:31 2017
(r316652)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Sun Apr  9 07:54:39 2017
(r316653)
@@ -321,11 +321,10 @@ cfiscsi_pdu_handle(struct icl_pdu *reque
 static void
 cfiscsi_receive_callback(struct icl_pdu *request)
 {
+#ifdef ICL_KERNEL_PROXY
struct cfiscsi_session *cs;
 
cs = PDU_SESSION(request);
-
-#ifdef ICL_KERNEL_PROXY
if (cs->cs_waiting_for_ctld || cs->cs_login_phase) {
if (cs->cs_login_pdu == NULL)
cs->cs_login_pdu = request;
@@ -1709,6 +1708,13 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci)
sbuf_finish(sb);
 
error = copyout(sbuf_data(sb), cilp->conn_xml, sbuf_len(sb) + 1);
+   if (error != 0) {
+   sbuf_delete(sb);
+   snprintf(ci->error_str, sizeof(ci->error_str),
+   "copyout failed with error %d", error);
+   ci->status = CTL_ISCSI_ERROR;
+   return;
+   }
cilp->fill_len = sbuf_len(sb) + 1;
ci->status = CTL_ISCSI_OK;
sbuf_delete(sb);
@@ -2163,9 +2169,9 @@ cfiscsi_ioctl_port_create(struct ctl_req
retval = ctl_port_register(port);
if (retval != 0) {
ctl_free_opts(&port->options);
-   cfiscsi_target_release(ct);
free(port->port_devid, M_CFISCSI);
free(port->target_devid, M_CFISCSI);
+   cfiscsi_target_release(ct);
req->status = CTL_LUN_ERROR;
snprintf(req->error_str, sizeof(req->error_str),
"ctl_port_register() failed with error %d", retval);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316642 - head/sys/dev/syscons

2017-04-09 Thread Bruce Evans

On Sun, 9 Apr 2017, Andrey Chernov wrote:


On 09.04.2017 7:54, Andrey Chernov wrote:

On 08.04.2017 13:00, Bruce Evans wrote:

Log:
  Quick fix for removal of the mouse cursor in vga direct graphics modes
...


Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes
SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for
the case they overlap valid characters region for some code tables.


Probably we just can change default to remove additional vidcontrol -M
setup. I usually have this range started with 0x03.


That can only work if you also avoid 9-bit text modes.  9-bit modes
give 1-bit separations between characters, except for those in the
graphics range (starting at about 0xd0).

Hmm, syscons already seems to have bugs handling this.  The mouse cursor
is always 8x16, usually split into 4.  For cells placed outside the graphics
region, this gives 1-bit gaps in 9-bit mode.  For cells placed in the
graphics region, it is a difficult or impossible transformation which is
not done to rearrange the pixels to fill in the gaps correctly.

9-bit mode basically gives an 9x16 cursor, but the 9th bit is already
unusable within a single cell, since it would extend the rightmost
pixels in the 8x16 cursor in an ugly way.  These pixels are for 1 end
of the arrow and the end of its right barb.  The extension occurs
every 8th x position when the cursor is moved from left to right.  Also,
when the cursor is moved over an ordinary character, the ordinary
character is merged into the cursor and drawn as part of the cursor.
This gives ugly extensions of '0' characters in a font carefully
designed for 9-bit mode (the '0' characters are a full 8 bits wide
and if they are in the graphics range the become 9 bits wide with
extra pixels on the right).

This problem doesn't occur in graphics mode.  However, graphics mode
should support 9-bit mode in software, so that the fonts carefully
designed for 9-bit mode can be used.  8 bits wide is too narrow for
a good font (it requires '0' to be only 7 bits wide...), and is even
worse when used with fonts designed for 9-bit mode (their '0's and
'M's are not separated).

vt uses a 10x16 mouse cursor and only supports it in graphics mode.
The extra bit makes it look much better.  Support for 9-bit mode is
otherwise worse in vt than in sc.  E.g, the cp437 glyphs for line
drawing characters don't work in 9-bit text mode, since a gap is
left between then.  I think the bit that controls extension is forced
off together with the bit that controls blinking fg/bg brightness,
so even if these glyphs are rendered using a char in the graphics
range, they are not extended.

9-bit text modes are hard to avoid.  90-column sc modes avoid them,
but tend to be broken on newer hardware.  The newer hardware tends
to force 9-bit modes because this is normal and works better.  I
have just 1 system (an 11 year old laptop) than forces 8-bit mode
instead.

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


Re: svn commit: r316585 - in head/sys/boot: efi/boot1 efi/loader i386/common i386/loader i386/zfsboot zfs

2017-04-09 Thread Toomas Soome

> On 9. apr 2017, at 1:16, Shawn Webb  wrote:
> 
> On Thu, Apr 06, 2017 at 06:17:29PM +, Toomas Soome wrote:
>> Author: tsoome
>> Date: Thu Apr  6 18:17:29 2017
>> New Revision: 316585
>> URL: https://svnweb.freebsd.org/changeset/base/316585
>> 
>> Log:
>>  loader: zfs reader should check all labels
>> 
>>  The current zfs reader is only checking first label from each device, 
>> however,
>>  we do have 4 labels on device and we should check all 4 to be protected
>>  against disk failures and incomplete label updates.
>> 
>>  The difficulty is about the fact that 2 label copies are in front of the
>>  pool data, and 2 are at the end, which means, we have to know the size of
>>  the pool data area.
>> 
>>  Since we have now the mechanism from common/disk.c to use the partition
>>  information, it does help us in this task; however, there are still some
>>  corner cases.
>> 
>>  Namely, if the pool is created without partition, directly on the disk,
>>  and firmware will give us the wrong size for the disk, we only can check
>>  the first two label copies.
>> 
>>  Reviewed by:allanjude
>>  Differential Revision:  https://reviews.freebsd.org/D10203
> 
> This breaks bhyve userboot:
> 
> # sh /usr/share/examples/bhyve/vmrun.sh -c 8 -m 16g -t tap4 -C 
> /dev/nmdm-laptop-dev-03-A -d /dev/zvol/enctank/bhyve/laptop-dev-03/disk-01 
> laptop-dev-03
> /boot/userboot.so: Undefined symbol "ldi_get_size"
> 
> Thanks,
> 
> -- 
> Shawn Webb
> Cofounder and Security Engineer
> HardenedBSD
> 
> GPG Key ID:  0x6A84658F52456EEE
> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


Yep, the fix is posted as part of https://reviews.freebsd.org/D10302 
 - I’m currently running the build to 
double check and I think I’ll make the userboot commit  as soon as it is 
verified. Sorry for the mess.

rgds,
toomas

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

Re: svn commit: r316642 - head/sys/dev/syscons

2017-04-09 Thread Andrey Chernov
On 09.04.2017 9:46, Bruce Evans wrote:
>> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes
>> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for
>> the case they overlap valid characters region for some code tables.
> 
> I didn't forget it, but these cells are only used in text mode and there
> are only 4 of them AFAIK (-M goes up to 252, which leaves space for only
> 4 cells 252-255).  Text mode is is one case that has no renderer support
> for the mouse cursor.

Here is 5th one (depends of SC_MOUSE_CHAR which can be set in the kernel
config):

#if SC_MOUSE_CHAR <= SC_CURSOR_CHAR && SC_CURSOR_CHAR < (SC_MOUSE_CHAR + 4)
#undef SC_CURSOR_CHAR
#define SC_CURSOR_CHAR  (SC_MOUSE_CHAR + 4)
#endif

> NOTES gives the example of setting it to 0x3.  Then if the configured
> SC_CURSOR_CHAR is inside the 4-char range for the mouse cursor, then

AFAIK SC_CURSOR_CHAR kernel config or vidcontrol is not supported.

> There is no way to reconfigure the cursor char AFAIK.  In fact, it
> doesn't even seem to be configured -- SC_CURSOR_CHAR is never used,

I remember times it was used but not remember how, log history needs to
be browsed.

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


Re: svn commit: r316642 - head/sys/dev/syscons

2017-04-09 Thread Andrey Chernov
On 09.04.2017 10:33, Bruce Evans wrote:
> On Sun, 9 Apr 2017, Andrey Chernov wrote:
> 
>> On 09.04.2017 7:54, Andrey Chernov wrote:
>>> On 08.04.2017 13:00, Bruce Evans wrote:
 Log:
   Quick fix for removal of the mouse cursor in vga direct graphics
 modes
 ...
>>>
>>> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes
>>> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for
>>> the case they overlap valid characters region for some code tables.
>>
>> Probably we just can change default to remove additional vidcontrol -M
>> setup. I usually have this range started with 0x03.
> 
> That can only work if you also avoid 9-bit text modes.  9-bit modes
> give 1-bit separations between characters, except for those in the
> graphics range (starting at about 0xd0).

Then let is stays as it is. For me small line in the mouse cursor looks
less distractive that junk in all 4 chars around, which happens if fonts
codepage have 0xd0-0xd3 as valid characters.

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


Re: svn commit: r316642 - head/sys/dev/syscons

2017-04-09 Thread Bruce Evans

On Sun, 9 Apr 2017, Andrey Chernov wrote:


On 09.04.2017 9:46, Bruce Evans wrote:

Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes
SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for
the case they overlap valid characters region for some code tables.


I didn't forget it, but these cells are only used in text mode and there
are only 4 of them AFAIK (-M goes up to 252, which leaves space for only
4 cells 252-255).  Text mode is is one case that has no renderer support
for the mouse cursor.


Here is 5th one (depends of SC_MOUSE_CHAR which can be set in the kernel
config):

#if SC_MOUSE_CHAR <= SC_CURSOR_CHAR && SC_CURSOR_CHAR < (SC_MOUSE_CHAR + 4)
#undef SC_CURSOR_CHAR
#define SC_CURSOR_CHAR  (SC_MOUSE_CHAR + 4)
#endif


NOTES gives the example of setting it to 0x3.  Then if the configured
SC_CURSOR_CHAR is inside the 4-char range for the mouse cursor, then


AFAIK SC_CURSOR_CHAR kernel config or vidcontrol is not supported.


There is no way to reconfigure the cursor char AFAIK.  In fact, it
doesn't even seem to be configured -- SC_CURSOR_CHAR is never used,


I remember times it was used but not remember how, log history needs to
be browsed.


The initializations are well hidden in MD code: {arm,mips,powerpc,sparc64}
/.../sc_machdep.c and isa/syscons_isa.c.  This is sort of backwards.  The
MI initializations of sc->cursor_char are in MD files, while the more MD
default value of SC_CURSOR_CHAR is in an MI file.  Then sc->cursor_char
is only used by the vga renderer for text mode.  This is closely associated
with isa, so the initializations are mostly irrelevant since their result
is not used.

How do you initialize actual use of sc->cursor_char?  It is only used
when SC_NO_FONT_LOADING is not defined.  Configuring SC_PIXEL_MODE
forces SC_NO_FONT_LOADING to be undefined.  Except to test sc->cursor_char,
I removed the #undef for this.  Next, sc->cursor_char is only used if
scp->curs.attr_flags & CONS_CHAR_CURSOR.  vidcontrol only supports this
with blinking too, and I know I don't want that.  Anyway, font loading
is almost always defined.  Apparently the char cursor is turned off with
loadable fonts since it would mess up special fonts more than the default
font.  But not as much as the mouse cursor.

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


Re: svn commit: r316642 - head/sys/dev/syscons

2017-04-09 Thread Bruce Evans

On Sun, 9 Apr 2017, Andrey Chernov wrote:


On 09.04.2017 10:33, Bruce Evans wrote:

On Sun, 9 Apr 2017, Andrey Chernov wrote:


On 09.04.2017 7:54, Andrey Chernov wrote:

On 08.04.2017 13:00, Bruce Evans wrote:

Log:
  Quick fix for removal of the mouse cursor in vga direct graphics
modes
...


Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes
SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for
the case they overlap valid characters region for some code tables.


Probably we just can change default to remove additional vidcontrol -M
setup. I usually have this range started with 0x03.


That can only work if you also avoid 9-bit text modes.  9-bit modes
give 1-bit separations between characters, except for those in the
graphics range (starting at about 0xd0).


Then let is stays as it is. For me small line in the mouse cursor looks
less distractive that junk in all 4 chars around, which happens if fonts
codepage have 0xd0-0xd3 as valid characters.


Both look bad.

Low characters are a better choice if you don't mind the gap, since sc
has too many magic characters whose magic can't be turned off with a
flag line -opost.  These chars are 7-13 and 27.  Also 0 with scteken.
I don't know of any way to reach the glyphs behind these characters
using syscons.

The cursor would have to have to consist of vertical lines of width 2
or more for it to be translatable across all positions (reduce to
width 1 at the gap so that the hardware extends back to width 2).
8x16 doesn't have enough pixels for that.  The border has width 1 in
most places.

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


svn commit: r316654 - head/sys/boot/userboot/userboot

2017-04-09 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  9 11:16:16 2017
New Revision: 316654
URL: https://svnweb.freebsd.org/changeset/base/316654

Log:
  loader: r316585 did miss userboot update
  
  The work to implement zfs reader to inspect all pool label copies did
  miss the userboot, this update does correct this issue.
  
  Since userboot is already using common/disk.c API (disk_open() etc),
  the fix is quite simple - we only need to make sure the userdisk_iocl()
  will call disk_ioctl(). In addition, the diskioctl callback does return
  int, not pointer.
  
  Note, the review request is actually addressing the sparc and userboot,
  but as testing the fix for sparc will take some more time, I am posting the
  userboot fix now.
  
  This patch is part of the implementation presented in review:
  https://reviews.freebsd.org/D10302
  
  Once we have the sparc part tested, we will have the complete fix
  for the issue.
  
  Reviewed by:  imp

Modified:
  head/sys/boot/userboot/userboot/main.c
  head/sys/boot/userboot/userboot/userboot_disk.c

Modified: head/sys/boot/userboot/userboot/main.c
==
--- head/sys/boot/userboot/userboot/main.c  Sun Apr  9 07:54:39 2017
(r316653)
+++ head/sys/boot/userboot/userboot/main.c  Sun Apr  9 11:16:16 2017
(r316654)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "bootstrap.h"
 #include "disk.h"
@@ -270,6 +271,16 @@ command_reloadbe(int argc, char *argv[])
 
return (CMD_OK);
 }
+
+uint64_t
+ldi_get_size(void *priv)
+{
+   int fd = (uintptr_t) priv;
+   uint64_t size;
+
+   ioctl(fd, DIOCGMEDIASIZE, &size);
+   return (size);
+}
 #endif /* USERBOOT_ZFS_SUPPORT */
 
 COMMAND_SET(quit, "quit", "exit the loader", command_quit);

Modified: head/sys/boot/userboot/userboot/userboot_disk.c
==
--- head/sys/boot/userboot/userboot/userboot_disk.c Sun Apr  9 07:54:39 
2017(r316653)
+++ head/sys/boot/userboot/userboot/userboot_disk.c Sun Apr  9 11:16:16 
2017(r316654)
@@ -91,8 +91,8 @@ userdisk_init(void)
return (ENOMEM);
for (i = 0; i < userdisk_maxunit; i++) {
if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE,
-   §orsize) != NULL || CALLBACK(diskioctl, i,
-   DIOCGMEDIASIZE, &mediasize) != NULL)
+   §orsize) != 0 || CALLBACK(diskioctl, i,
+   DIOCGMEDIASIZE, &mediasize) != 0)
return (ENXIO);
ud_info[i].mediasize = mediasize;
ud_info[i].sectorsize = sectorsize;
@@ -230,7 +230,12 @@ static int
 userdisk_ioctl(struct open_file *f, u_long cmd, void *data)
 {
struct disk_devdesc *dev;
+   int rc;
 
dev = (struct disk_devdesc *)f->f_devdata;
+   rc = disk_ioctl(dev, cmd, data);
+   if (rc != ENOTTY)
+   return (rc);
+
return (CALLBACK(diskioctl, dev->d_unit, cmd, data));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316655 - head/sys/fs/nfsclient

2017-04-09 Thread Rick Macklem
Author: rmacklem
Date: Sun Apr  9 12:32:22 2017
New Revision: 316655
URL: https://svnweb.freebsd.org/changeset/base/316655

Log:
  Fix parsing failure for NFSv4 Setattr operation for failed case.
  
  If an operation that preceeds a Setattr in an NFSv4 compound fails,
  there is no bitmap of attributes to parse. Without this patch, the
  parsing would fail and return EBADRPC instead of the correct failure
  error. This could break recovery from a server crash/reboot.
  
  Tested by:cperciva
  PR:   215883
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clrpcops.c

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==
--- head/sys/fs/nfsclient/nfs_clrpcops.cSun Apr  9 11:16:16 2017
(r316654)
+++ head/sys/fs/nfsclient/nfs_clrpcops.cSun Apr  9 12:32:22 2017
(r316655)
@@ -1190,7 +1190,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vat
return (error);
if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4))
error = nfscl_wcc_data(nd, vp, rnap, attrflagp, NULL, stuff);
-   if ((nd->nd_flag & ND_NFSV4) && !error)
+   if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4 && !error)
error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL);
if (!(nd->nd_flag & ND_NFSV3) && !nd->nd_repstat && !error)
error = nfscl_postop_attr(nd, rnap, attrflagp, stuff);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316642 - head/sys/dev/syscons

2017-04-09 Thread Andrey Chernov
On 09.04.2017 13:32, Bruce Evans wrote:
> How do you initialize actual use of sc->cursor_char?  It is only used
> when SC_NO_FONT_LOADING is not defined.  Configuring SC_PIXEL_MODE
> forces SC_NO_FONT_LOADING to be undefined.  Except to test sc->cursor_char,

I use text console mode with loading national codepage font. I don't
touch sc->cursor_char directly, I only use 'vidcontrol -M' to move range
start to 0x03 since 0xd0-0xd3 and 0xd4 are valid characters in my
codepage. Loading font and changing mousechar start are both through
rc.conf variables:

font8x14="cp866-8x14"
font8x16="cp866b-8x16"
font8x8="cp866-8x8"
mousechar_start="3"

> is almost always defined.  Apparently the char cursor is turned off with
> loadable fonts since it would mess up special fonts more than the default
> font.  But not as much as the mouse cursor.

If you mean just cursor, I have it (even not block but underline
cursor). It is not strictly char (i.e. text cursor), but emulation of it
via loaded font change on the fly. Via rc.conf variable too:

cursor="destructive"

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


Re: svn commit: r316033 - in head/sys/compat/linuxkpi/common: include/asm include/linux src

2017-04-09 Thread Hans Petter Selasky

On 04/08/17 20:08, Ed Maste wrote:

On 27 March 2017 at 13:04, Hans Petter Selasky  wrote:

Author: hselasky
Date: Mon Mar 27 17:04:11 2017
New Revision: 316033
URL: https://svnweb.freebsd.org/changeset/base/316033


powerpc.GENERIC is now failing with:

In file included from
/scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/gfp.h:39,
 from
/scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/slab.h:41,
 from
/scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/sched.h:44,
 from
/scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/kernel.h:49,
 from
/scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/kobject.h:36,
 from
/scratch/tmp/emaste/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:58:
/scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/page.h:43:
error: conflicting types for 'pte_t'
./machine/pte.h:127: error: previous declaration of 'pte_t' was here
cc1: warnings being treated as errors
/scratch/tmp/emaste/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:
In function 'linux_cdev_pager_populate':
/scratch/tmp/emaste/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:414:
warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
*** [linux_compat.o] Error code 1




I'm on it. Thank you for the notice.

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


svn commit: r316656 - in head/sys/compat/linuxkpi/common: include/linux src

2017-04-09 Thread Hans Petter Selasky
Author: hselasky
Date: Sun Apr  9 14:31:41 2017
New Revision: 316656
URL: https://svnweb.freebsd.org/changeset/base/316656

Log:
  Fix compilation of LinuxKPI for PowerPC.
  
  Found by: emaste @
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/mm.h
  head/sys/compat/linuxkpi/common/include/linux/page.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h
==
--- head/sys/compat/linuxkpi/common/include/linux/mm.h  Sun Apr  9 12:32:22 
2017(r316655)
+++ head/sys/compat/linuxkpi/common/include/linux/mm.h  Sun Apr  9 14:31:41 
2017(r316656)
@@ -91,7 +91,7 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0)
 #defineFAULT_FLAG_REMOTE   (1 << 7)
 #defineFAULT_FLAG_INSTRUCTION  (1 << 8)
 
-typedef int (*pte_fn_t)(pte_t *, pgtable_t, unsigned long addr, void *data);
+typedef int (*pte_fn_t)(linux_pte_t *, pgtable_t, unsigned long addr, void 
*data);
 
 struct vm_area_struct {
vm_offset_t vm_start;

Modified: head/sys/compat/linuxkpi/common/include/linux/page.h
==
--- head/sys/compat/linuxkpi/common/include/linux/page.hSun Apr  9 
12:32:22 2017(r316655)
+++ head/sys/compat/linuxkpi/common/include/linux/page.hSun Apr  9 
14:31:41 2017(r316656)
@@ -40,9 +40,9 @@
 #include 
 #include 
 
-typedef unsigned long pte_t;
-typedef unsigned long pmd_t;
-typedef unsigned long pgd_t;
+typedef unsigned long linux_pte_t;
+typedef unsigned long linux_pmd_t;
+typedef unsigned long linux_pgd_t;
 typedef unsigned long pgprot_t;
 
 #define page   vm_page

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Sun Apr  9 12:32:22 
2017(r316655)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Sun Apr  9 14:31:41 
2017(r316656)
@@ -411,7 +411,7 @@ linux_cdev_pager_populate(vm_object_t vm
MPASS(vmap->vm_private_data == vm_obj->handle);
 
/* fill out VM fault structure */
-   vmf.virtual_address = (void *)(pidx << PAGE_SHIFT);
+   vmf.virtual_address = (void *)((uintptr_t)pidx << PAGE_SHIFT);
vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0;
vmf.pgoff = 0;
vmf.page = NULL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316657 - head/sbin/setkey

2017-04-09 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Sun Apr  9 15:17:55 2017
New Revision: 316657
URL: https://svnweb.freebsd.org/changeset/base/316657

Log:
  Make setkey(8) more clear about anti-replay window size option semantics.
  
  PR:   172913
  Submitted by: j...@saltant.com
  Reviewed by:  ae@
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D10304

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Sun Apr  9 14:31:41 2017(r316656)
+++ head/sbin/setkey/setkey.8   Sun Apr  9 15:17:55 2017(r316657)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 5, 2017
+.Dd April 9, 2017
 .Dt SETKEY 8
 .Os
 .\"
@@ -290,12 +290,13 @@ The default value is
 .Li any .
 .\"
 .It Fl r Ar size
-Specify window size of bytes for replay prevention.
+Specify the bitmap size in octets of the anti-replay window.
 .Ar size
-must be decimal number in 32-bit word.
+is a 32-bit unsigned integer, and its value is one eighth of the
+anti-replay window size in packets.
 If
 .Ar size
-is zero or not specified, replay check does not take place.
+is zero or not specified, an anti-replay check does not take place.
 .\"
 .It Fl u Ar id
 Specify the identifier of the policy entry in SPD.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316658 - head/sys/compat/linux

2017-04-09 Thread Tai-hwa Liang
Author: avatar
Date: Sun Apr  9 15:27:04 2017
New Revision: 316658
URL: https://svnweb.freebsd.org/changeset/base/316658

Log:
  Adding SIOCGIFNAME support in Linuxulator.  This should silence the console 
warning associated
  with linux-opera:
linux: pid 23492 (opera): ioctl fd=5, cmd=0x8910 ('\M^I',16) is not 
implemented
linux: pid 23492 (opera): ioctl fd=28, cmd=0x8910 ('\M^I',16) is not 
implemented
...
  
  Reviewed by:  kib, marcel, dchagin
  Tested with:  linux-opera-12.16_3
  MFC after:1 month

Modified:
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_ioctl.h

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Sun Apr  9 15:17:55 2017
(r316657)
+++ head/sys/compat/linux/linux_ioctl.c Sun Apr  9 15:27:04 2017
(r316658)
@@ -2167,6 +2167,49 @@ ifname_linux_to_bsd(struct thread *td, c
 }
 
 /*
+ * Implement the SIOCGIFNAME ioctl
+ */
+
+static int
+linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr)
+{
+   struct l_ifreq ifr;
+   struct ifnet *ifp;
+   int error, ethno, index;
+
+   error = copyin(uifr, &ifr, sizeof(ifr));
+   if (error != 0)
+   return (error);
+
+   CURVNET_SET(TD_TO_VNET(curthread));
+   IFNET_RLOCK();
+   index = 1;  /* ifr.ifr_ifindex starts from 1 */
+   ethno = 0;
+   error = ENODEV;
+   TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
+   if (ifr.ifr_ifindex == index) {
+   if (IFP_IS_ETH(ifp))
+   snprintf(ifr.ifr_name, LINUX_IFNAMSIZ,
+   "eth%d", ethno);
+   else
+   strlcpy(ifr.ifr_name, ifp->if_xname,
+   LINUX_IFNAMSIZ);
+   error = 0;
+   break;
+   }
+   if (IFP_IS_ETH(ifp))
+   ethno++;
+   index++;
+   }
+   IFNET_RUNLOCK();
+   if (error == 0)
+   error = copyout(&ifr, uifr, sizeof(ifr));
+   CURVNET_RESTORE();
+
+   return (error);
+}
+
+/*
  * Implement the SIOCGIFCONF ioctl
  */
 
@@ -2393,6 +2436,7 @@ linux_ioctl_socket(struct thread *td, st
case LINUX_SIOCADDMULTI:
case LINUX_SIOCATMARK:
case LINUX_SIOCDELMULTI:
+   case LINUX_SIOCGIFNAME:
case LINUX_SIOCGIFCONF:
case LINUX_SIOCGPGRP:
case LINUX_SIOCSPGRP:
@@ -2478,6 +2522,10 @@ linux_ioctl_socket(struct thread *td, st
 
/* LINUX_SIOCGSTAMP */
 
+   case LINUX_SIOCGIFNAME:
+   error = linux_ioctl_ifname(td, (struct l_ifreq *)args->arg);
+   break;
+
case LINUX_SIOCGIFCONF:
error = linux_ifconf(td, (struct ifconf *)args->arg);
break;

Modified: head/sys/compat/linux/linux_ioctl.h
==
--- head/sys/compat/linux/linux_ioctl.h Sun Apr  9 15:17:55 2017
(r316657)
+++ head/sys/compat/linux/linux_ioctl.h Sun Apr  9 15:27:04 2017
(r316658)
@@ -226,6 +226,7 @@
 #defineLINUX_SIOCGPGRP 0x8904
 #defineLINUX_SIOCATMARK0x8905
 #defineLINUX_SIOCGSTAMP0x8906
+#defineLINUX_SIOCGIFNAME   0x8910
 #defineLINUX_SIOCGIFCONF   0x8912
 #defineLINUX_SIOCGIFFLAGS  0x8913
 #defineLINUX_SIOCGIFADDR   0x8915
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313495 - head/sys/kern

2017-04-09 Thread Alexey Dokuchaev
On Thu, Feb 09, 2017 at 09:21:42PM -0800, Cy Schubert wrote:
> In message <201702092335.v19nzvsq026...@repo.freebsd.org>, Konstantin
> Belousov writes:
> > New Revision: 313495
> > URL: https://svnweb.freebsd.org/changeset/base/313495
> > 
> > Log:
> >   ...
> >   Restructure the block in vn_open_vnode() which handles O_EXLOCK and
> >   O_SHLOCK open flags to make it easier to quit its execution earlier
> >   with an error.
> 
> This broke dhclient. I've attached typescript output at the end of this
> email.
> 
> > @@ -376,20 +384,20 @@ vn_open_vnode(struct vnode *vp, int fmod
> >  * Ensure the vnode is still able to be opened for
> >  * writing after the lock has been obtained.
> >  */
> > -   if (error == 0 && accmode & VWRITE)
> > +   if ((accmode & VWRITE) != 0)
> > error = vn_writechk(vp);
> > +   break;
> > +   }

Could it be related to this hunk?  It unconditionally breaks out of the
loop now (missing { } in that `if')?  PVS-Studio trips at here:

/usr/src/sys/kern/vfs_vnops.c:389:1: warning: V612 An unconditional 'break'
within a loop.

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


svn commit: r316659 - head/sys/arm/freescale/imx

2017-04-09 Thread Ian Lepore
Author: ian
Date: Sun Apr  9 18:31:33 2017
New Revision: 316659
URL: https://svnweb.freebsd.org/changeset/base/316659

Log:
  Remove some old interrupt handling workaround code from the pre-INTRNG days.
  
  At this point, INTRNG is not going away (the option may go away, but the
  code is not), so we no longer need code to support workarounds that handled
  the lack of INTRNG functionality.

Modified:
  head/sys/arm/freescale/imx/imx6_machdep.c

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==
--- head/sys/arm/freescale/imx/imx6_machdep.c   Sun Apr  9 15:27:04 2017
(r316658)
+++ head/sys/arm/freescale/imx/imx6_machdep.c   Sun Apr  9 18:31:33 2017
(r316659)
@@ -54,49 +54,11 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
-static uint32_t gpio1_node;
-
 static platform_attach_t imx6_attach;
 static platform_devmap_init_t imx6_devmap_init;
 static platform_late_init_t imx6_late_init;
 static platform_cpu_reset_t imx6_cpu_reset;
 
-#ifndef INTRNG
-/*
- * Work around the linux workaround for imx6 erratum 006687, in which some
- * ethernet interrupts don't go to the GPC and thus won't wake the system from
- * Wait mode. We don't use Wait mode (which halts the GIC, leaving only GPC
- * interrupts able to wake the system), so we don't experience the bug at all.
- * The linux workaround is to reconfigure GPIO1_6 as the ENET interrupt by
- * writing magic values to an undocumented IOMUX register, then letting the 
gpio
- * interrupt driver notify the ethernet driver.  We'll be able to do all that
- * (even though we don't need to) once the INTRNG project is committed and the
- * imx_gpio driver becomes an interrupt driver.  Until then, this crazy little
- * workaround watches for requests to map an interrupt 6 with the interrupt
- * controller node referring to gpio1, and it substitutes the proper ffec
- * interrupt number.
- */
-static int
-imx6_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt,
-int *trig, int *pol)
-{
-
-   if (fdt32_to_cpu(intr[0]) == 6 && 
-   OF_node_from_xref(iparent) == gpio1_node) {
-   *interrupt = 150;
-   *trig = INTR_TRIGGER_CONFORM;
-   *pol  = INTR_POLARITY_CONFORM;
-   return (0);
-   }
-   return (gic_decode_fdt(iparent, intr, interrupt, trig, pol));
-}
-
-fdt_pic_decode_t fdt_pic_table[] = {
-   &imx6_decode_fdt,
-   NULL
-};
-#endif
-
 /*
  * Fix FDT data related to interrupts.
  *
@@ -184,10 +146,6 @@ imx6_late_init(platform_t plat)
const uint32_t IMX6_WDOG_SR_PHYS = 0x020bc004;
 
imx_wdog_init_last_reset(IMX6_WDOG_SR_PHYS);
-
-   /* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */
-   gpio1_node = OF_node_from_xref(
-   OF_finddevice("/soc/aips-bus@0200/gpio@0209c000"));
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316660 - in stable/11: share/man/man4 sys/conf sys/dev/usb/storage sys/modules/usb sys/modules/usb/cfumass

2017-04-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Apr  9 19:30:49 2017
New Revision: 316660
URL: https://svnweb.freebsd.org/changeset/base/316660

Log:
  MFC r313959:
  
  Add USB Mass Storage CTL frontend.  This makes it possible
  for USB OTG-capable hardware to implement device side of USB
  Mass Storage, ie pretend it's a flash drive.  It's configured
  in the same way as other CTL frontends, using ctladm(8)
  or ctld(8).  Differently from usfs(4), all the configuration
  can be done without rebuilding the kernel.
  
  Testing and review is welcome.  Right now I'm still moving,
  and I don't have access to my test environment, so I'm somewhat
  reluctant to making larger changes to this code; on the other
  hand I don't want to let it sit on Phab until my testing setup
  is back, because I want to get it into 11.1-RELEASE.
  
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation

Added:
  stable/11/share/man/man4/cfumass.4
 - copied unchanged from r313959, head/share/man/man4/cfumass.4
  stable/11/sys/dev/usb/storage/cfumass.c
 - copied unchanged from r313959, head/sys/dev/usb/storage/cfumass.c
  stable/11/sys/modules/usb/cfumass/
 - copied from r313959, head/sys/modules/usb/cfumass/
Modified:
  stable/11/share/man/man4/Makefile
  stable/11/share/man/man4/ctl.4
  stable/11/share/man/man4/umass.4
  stable/11/share/man/man4/usb_template.4
  stable/11/share/man/man4/usfs.4
  stable/11/sys/conf/files
  stable/11/sys/modules/usb/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/Makefile
==
--- stable/11/share/man/man4/Makefile   Sun Apr  9 18:31:33 2017
(r316659)
+++ stable/11/share/man/man4/Makefile   Sun Apr  9 19:30:49 2017
(r316660)
@@ -102,6 +102,7 @@ MAN=aac.4 \
cd.4 \
cdce.4 \
cfi.4 \
+   cfumass.4 \
ch.4 \
chromebook_platform.4 \
ciss.4 \

Copied: stable/11/share/man/man4/cfumass.4 (from r313959, 
head/share/man/man4/cfumass.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/share/man/man4/cfumass.4  Sun Apr  9 19:30:49 2017
(r316660, copy of r313959, head/share/man/man4/cfumass.4)
@@ -0,0 +1,137 @@
+.\" Copyright (c) 2017 The FreeBSD Foundation
+.\" All rights reserved.
+.\"
+.\" This software was developed by Edward Tomasz Napierala under sponsorship
+.\" from the FreeBSD Foundation.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.Dd January 27, 2017
+.Dt CFUMASS 4
+.Os
+.Sh NAME
+.Nm cfumass
+.Nd USB device side support for Mass Storage Class Transport
+.Sh SYNOPSIS
+This driver can be compiled into the kernel by placing these lines in
+the kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device usb"
+.Cd "device usb_template"
+.Cd "device iscsi"
+.Cd "device ctl"
+.Cd "device cfumass"
+.Ed
+.Pp
+The driver module can also be loaded at boot by adding this line to
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+cfumass_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides device side support for emulating an USB mass storage
+device compliant with the USB Mass Storage Class Bulk-Only (BBB) Transport
+specification, implemented as a
+.Xr ctl 4
+frontend driver.
+.Pp
+To use
+.Nm :
+.Bl -bullet
+.It
+.Xr cfumass 4
+must be loaded as a module or compiled into the kernel.
+.It
+The USB Mass Storage template must be chosen by setting the
+.Va hw.usb.template
+sysctl to 0.
+.It
+The USB OTG port must be working in USB device-side mode.
+This happens automatically upon connection to a USB host.
+.It

svn commit: r316661 - head/sys/arm/freescale/imx

2017-04-09 Thread Ian Lepore
Author: ian
Date: Sun Apr  9 20:41:00 2017
New Revision: 316661
URL: https://svnweb.freebsd.org/changeset/base/316661

Log:
  Update the code that compensates for the lack of a GPC interrupt controller
  driver for imx6.  Some newer dts source puts the GIC node at the root
  instead of under /soc, so look in both places.  Also, sometimes the GIC
  node doesn't list itself as its own interrupt-parent, allow that too.

Modified:
  head/sys/arm/freescale/imx/imx6_machdep.c

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==
--- head/sys/arm/freescale/imx/imx6_machdep.c   Sun Apr  9 19:30:49 2017
(r316660)
+++ head/sys/arm/freescale/imx/imx6_machdep.c   Sun Apr  9 20:41:00 2017
(r316661)
@@ -78,7 +78,7 @@ static platform_cpu_reset_t imx6_cpu_res
  * We validate that we have data that looks like we expect before changing it:
  *  - SOC node exists and has GPC as its interrupt parent.
  *  - GPC node exists and has GIC as its interrupt parent.
- *  - GIC node exists and is its own interrupt parent.
+ *  - GIC node exists and is its own interrupt parent or has no parent.
  *
  * This applies to all models of imx6.  Luckily all of them have the devices
  * involved at the same addresses on the same buses, so we don't need any
@@ -102,14 +102,20 @@ fix_fdt_interrupt_data(void)
if (result <= 0)
return;
 
+   /* GIC node may be child of soc node, or appear directly at root. */
gicnode = OF_finddevice("/soc/interrupt-controller@00a01000");
+   if (gicnode == -1) {
+   gicnode = OF_finddevice("/interrupt-controller@00a01000");
if (gicnode == -1)
return;
+   }
+   gicxref = OF_xref_from_node(gicnode);
+
+   /* If gic node has no parent, pretend it is its own parent. */
result = OF_getencprop(gicnode, "interrupt-parent", &gicipar,
sizeof(gicipar));
if (result <= 0)
-   return;
-   gicxref = OF_xref_from_node(gicnode);
+   gicipar = gicxref;
 
gpcnode = OF_finddevice("/soc/aips-bus@0200/gpc@020dc000");
if (gpcnode == -1)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316662 - in vendor-sys/ck/dist: include src

2017-04-09 Thread Olivier Houchard
Author: cognet
Date: Sun Apr  9 20:53:02 2017
New Revision: 316662
URL: https://svnweb.freebsd.org/changeset/base/316662

Log:
  Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32
  This brings us changes we needed in ck_epoch.

Modified:
  vendor-sys/ck/dist/include/ck_epoch.h
  vendor-sys/ck/dist/src/ck_epoch.c

Modified: vendor-sys/ck/dist/include/ck_epoch.h
==
--- vendor-sys/ck/dist/include/ck_epoch.h   Sun Apr  9 20:41:00 2017
(r316661)
+++ vendor-sys/ck/dist/include/ck_epoch.h   Sun Apr  9 20:53:02 2017
(r316662)
@@ -83,6 +83,7 @@ struct ck_epoch_ref {
 };
 
 struct ck_epoch_record {
+   ck_stack_entry_t record_next;
struct ck_epoch *global;
unsigned int state;
unsigned int epoch;
@@ -92,17 +93,16 @@ struct ck_epoch_record {
} local CK_CC_CACHELINE;
unsigned int n_pending;
unsigned int n_peak;
-   unsigned long n_dispatch;
+   unsigned int n_dispatch;
+   void *ct;
ck_stack_t pending[CK_EPOCH_LENGTH];
-   ck_stack_entry_t record_next;
 } CK_CC_CACHELINE;
 typedef struct ck_epoch_record ck_epoch_record_t;
 
 struct ck_epoch {
unsigned int epoch;
-   char pad[CK_MD_CACHELINE - sizeof(unsigned int)];
-   ck_stack_t records;
unsigned int n_free;
+   ck_stack_t records;
 };
 typedef struct ck_epoch ck_epoch_t;
 
@@ -110,7 +110,14 @@ typedef struct ck_epoch ck_epoch_t;
  * Internal functions.
  */
 void _ck_epoch_addref(ck_epoch_record_t *, ck_epoch_section_t *);
-void _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *);
+bool _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *);
+
+CK_CC_FORCE_INLINE static void *
+ck_epoch_record_ct(const ck_epoch_record_t *record)
+{
+
+   return ck_pr_load_ptr(&record->ct);
+}
 
 /*
  * Marks the beginning of an epoch-protected section.
@@ -160,9 +167,10 @@ ck_epoch_begin(ck_epoch_record_t *record
 }
 
 /*
- * Marks the end of an epoch-protected section.
+ * Marks the end of an epoch-protected section. Returns true if no more
+ * sections exist for the caller.
  */
-CK_CC_FORCE_INLINE static void
+CK_CC_FORCE_INLINE static bool
 ck_epoch_end(ck_epoch_record_t *record, ck_epoch_section_t *section)
 {
 
@@ -170,15 +178,19 @@ ck_epoch_end(ck_epoch_record_t *record, 
ck_pr_store_uint(&record->active, record->active - 1);
 
if (section != NULL)
-   _ck_epoch_delref(record, section);
+   return _ck_epoch_delref(record, section);
 
-   return;
+   return record->active == 0;
 }
 
 /*
  * Defers the execution of the function pointed to by the "cb"
  * argument until an epoch counter loop. This allows for a
  * non-blocking deferral.
+ *
+ * We can get away without a fence here due to the monotonic nature
+ * of the epoch counter. Worst case, this will result in some delays
+ * before object destruction.
  */
 CK_CC_FORCE_INLINE static void
 ck_epoch_call(ck_epoch_record_t *record,
@@ -195,13 +207,74 @@ ck_epoch_call(ck_epoch_record_t *record,
return;
 }
 
+/*
+ * Same as ck_epoch_call, but allows for records to be shared and is reentrant.
+ */
+CK_CC_FORCE_INLINE static void
+ck_epoch_call_strict(ck_epoch_record_t *record,
+ ck_epoch_entry_t *entry,
+ ck_epoch_cb_t *function)
+{
+   struct ck_epoch *epoch = record->global;
+   unsigned int e = ck_pr_load_uint(&epoch->epoch);
+   unsigned int offset = e & (CK_EPOCH_LENGTH - 1);
+
+   ck_pr_inc_uint(&record->n_pending);
+   entry->function = function;
+
+   /* Store fence is implied by push operation. */
+   ck_stack_push_upmc(&record->pending[offset], &entry->stack_entry);
+   return;
+}
+
+/*
+ * This callback is used for synchronize_wait to allow for custom blocking
+ * behavior.
+ */
+typedef void ck_epoch_wait_cb_t(ck_epoch_t *, ck_epoch_record_t *,
+void *);
+
+/*
+ * Return latest epoch value. This operation provides load ordering.
+ */
+CK_CC_FORCE_INLINE static unsigned int
+ck_epoch_value(const ck_epoch_t *ep)
+{
+
+   ck_pr_fence_load();
+   return ck_pr_load_uint(&ep->epoch);
+}
+
 void ck_epoch_init(ck_epoch_t *);
-ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *);
-void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *);
+
+/*
+ * Attempts to recycle an unused epoch record. If one is successfully
+ * allocated, the record context pointer is also updated.
+ */
+ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *, void *);
+
+/*
+ * Registers an epoch record. An optional context pointer may be passed that
+ * is retrievable with ck_epoch_record_ct.
+ */
+void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *, void *);
+
+/*
+ * Marks a record as available for re-use by a subsequent recycle operation.
+ * Note that the record cannot be physically destroyed.
+ */
 void ck_epoch_unregister(ck_epoch_record_t *);
+
 bool ck_epoch_poll(ck_epoch_record_t *);
 void ck_ep

svn commit: r316663 - vendor-sys/ck/20170407

2017-04-09 Thread Olivier Houchard
Author: cognet
Date: Sun Apr  9 20:54:33 2017
New Revision: 316663
URL: https://svnweb.freebsd.org/changeset/base/316663

Log:
  Tag new CK import.

Added:
  vendor-sys/ck/20170407/
 - copied from r316662, vendor-sys/ck/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316664 - head/sys/arm/freescale/imx

2017-04-09 Thread Ian Lepore
Author: ian
Date: Sun Apr  9 20:59:12 2017
New Revision: 316664
URL: https://svnweb.freebsd.org/changeset/base/316664

Log:
  Add code/constants for detecting imx6ul (ultralite) chips, a species of
  imx6 based on a single cortex-a7 core.  Other changes to imx6 drivers
  and support code are needed to fully support the imx6ul.
  
  Also fix an indentation glitch committed in the prior change.

Modified:
  head/sys/arm/freescale/imx/imx6_machdep.c
  head/sys/arm/freescale/imx/imx_machdep.h

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==
--- head/sys/arm/freescale/imx/imx6_machdep.c   Sun Apr  9 20:54:33 2017
(r316663)
+++ head/sys/arm/freescale/imx/imx6_machdep.c   Sun Apr  9 20:59:12 2017
(r316664)
@@ -106,8 +106,8 @@ fix_fdt_interrupt_data(void)
gicnode = OF_finddevice("/soc/interrupt-controller@00a01000");
if (gicnode == -1) {
gicnode = OF_finddevice("/interrupt-controller@00a01000");
-   if (gicnode == -1)
-   return;
+   if (gicnode == -1)
+   return;
}
gicxref = OF_xref_from_node(gicnode);
 
@@ -234,6 +234,7 @@ imx_soc_type(void)
 #defineHWSOC_MX6DL 0x61
 #defineHWSOC_MX6SOLO   0x62
 #defineHWSOC_MX6Q  0x63
+#defineHWSOC_MX6UL 0x64
 
if (soctype != 0)
return (soctype);
@@ -272,6 +273,9 @@ imx_soc_type(void)
case HWSOC_MX6Q :
soctype = IMXSOC_6Q;
break;
+   case HWSOC_MX6UL:
+   soctype = IMXSOC_6UL;
+   break;
default:
printf("imx_soc_type: Don't understand hwsoc 0x%02x, "
"digprog 0x%08x; assuming IMXSOC_6Q\n", hwsoc, digprog);
@@ -323,3 +327,4 @@ static platform_method_t imx6_methods[] 
 FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 0);
 FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6dl", 0);
 FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 0);
+FDT_PLATFORM_DEF2(imx6, imx6ul, "i.MX6 UltraLite", 0, "fsl,imx6ul", 0);

Modified: head/sys/arm/freescale/imx/imx_machdep.h
==
--- head/sys/arm/freescale/imx/imx_machdep.hSun Apr  9 20:54:33 2017
(r316663)
+++ head/sys/arm/freescale/imx/imx_machdep.hSun Apr  9 20:59:12 2017
(r316664)
@@ -55,6 +55,7 @@ void imx_wdog_init_last_reset(vm_offset_
 #defineIMXSOC_6DL  0x6100
 #defineIMXSOC_6S   0x6200
 #defineIMXSOC_6Q   0x6300
+#defineIMXSOC_6UL  0x6400
 #defineIMXSOC_FAMSHIFT 28
 
 u_int imx_soc_type(void);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src

2017-04-09 Thread Olivier Houchard
Author: cognet
Date: Sun Apr  9 21:02:05 2017
New Revision: 316665
URL: https://svnweb.freebsd.org/changeset/base/316665

Log:
  Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32
  This brings us changes we needed in ck_epoch.

Modified:
  head/sys/compat/linuxkpi/common/src/linux_rcu.c
  head/sys/contrib/ck/include/ck_epoch.h
  head/sys/contrib/ck/src/ck_epoch.c

Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c
==
--- head/sys/compat/linuxkpi/common/src/linux_rcu.c Sun Apr  9 20:59:12 
2017(r316664)
+++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Sun Apr  9 21:02:05 
2017(r316665)
@@ -105,7 +105,7 @@ linux_rcu_runtime_init(void *arg __unuse
ck_epoch_record_t *record;
 
record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO);
-   ck_epoch_register(&linux_epoch, record);
+   ck_epoch_register(&linux_epoch, record, NULL);
 
DPCPU_ID_SET(i, linux_reader_epoch_record, record);
}
@@ -116,7 +116,7 @@ linux_rcu_runtime_init(void *arg __unuse
 
record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO);
 
-   ck_epoch_register(&linux_epoch, &record->epoch_record);
+   ck_epoch_register(&linux_epoch, &record->epoch_record, NULL);
mtx_init(&record->head_lock, "LRCU-HEAD", NULL, MTX_DEF);
mtx_init(&record->sync_lock, "LRCU-SYNC", NULL, MTX_DEF);
TASK_INIT(&record->task, 0, linux_rcu_cleaner_func, record);
@@ -170,14 +170,14 @@ linux_srcu_get_record(void)
 * NOTE: The only records that are unregistered and can be
 * recycled are srcu_epoch_records.
 */
-   record = (struct srcu_epoch_record *)ck_epoch_recycle(&linux_epoch);
+   record = (struct srcu_epoch_record *)ck_epoch_recycle(&linux_epoch, 
NULL);
if (__predict_true(record != NULL))
return (record);
 
record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO);
mtx_init(&record->read_lock, "SRCU-READ", NULL, MTX_DEF | 
MTX_NOWITNESS);
mtx_init(&record->sync_lock, "SRCU-SYNC", NULL, MTX_DEF | 
MTX_NOWITNESS);
-   ck_epoch_register(&linux_epoch, &record->epoch_record);
+   ck_epoch_register(&linux_epoch, &record->epoch_record, NULL);
 
return (record);
 }

Modified: head/sys/contrib/ck/include/ck_epoch.h
==
--- head/sys/contrib/ck/include/ck_epoch.h  Sun Apr  9 20:59:12 2017
(r316664)
+++ head/sys/contrib/ck/include/ck_epoch.h  Sun Apr  9 21:02:05 2017
(r316665)
@@ -83,6 +83,7 @@ struct ck_epoch_ref {
 };
 
 struct ck_epoch_record {
+   ck_stack_entry_t record_next;
struct ck_epoch *global;
unsigned int state;
unsigned int epoch;
@@ -92,17 +93,16 @@ struct ck_epoch_record {
} local CK_CC_CACHELINE;
unsigned int n_pending;
unsigned int n_peak;
-   unsigned long n_dispatch;
+   unsigned int n_dispatch;
+   void *ct;
ck_stack_t pending[CK_EPOCH_LENGTH];
-   ck_stack_entry_t record_next;
 } CK_CC_CACHELINE;
 typedef struct ck_epoch_record ck_epoch_record_t;
 
 struct ck_epoch {
unsigned int epoch;
-   char pad[CK_MD_CACHELINE - sizeof(unsigned int)];
-   ck_stack_t records;
unsigned int n_free;
+   ck_stack_t records;
 };
 typedef struct ck_epoch ck_epoch_t;
 
@@ -110,7 +110,14 @@ typedef struct ck_epoch ck_epoch_t;
  * Internal functions.
  */
 void _ck_epoch_addref(ck_epoch_record_t *, ck_epoch_section_t *);
-void _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *);
+bool _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *);
+
+CK_CC_FORCE_INLINE static void *
+ck_epoch_record_ct(const ck_epoch_record_t *record)
+{
+
+   return ck_pr_load_ptr(&record->ct);
+}
 
 /*
  * Marks the beginning of an epoch-protected section.
@@ -160,9 +167,10 @@ ck_epoch_begin(ck_epoch_record_t *record
 }
 
 /*
- * Marks the end of an epoch-protected section.
+ * Marks the end of an epoch-protected section. Returns true if no more
+ * sections exist for the caller.
  */
-CK_CC_FORCE_INLINE static void
+CK_CC_FORCE_INLINE static bool
 ck_epoch_end(ck_epoch_record_t *record, ck_epoch_section_t *section)
 {
 
@@ -170,15 +178,19 @@ ck_epoch_end(ck_epoch_record_t *record, 
ck_pr_store_uint(&record->active, record->active - 1);
 
if (section != NULL)
-   _ck_epoch_delref(record, section);
+   return _ck_epoch_delref(record, section);
 
-   return;
+   return record->active == 0;
 }
 
 /*
  * Defers the execution of the function pointed to by the "cb"
  * argument until an epoch counter loop. This allows for a
  * non-blocking deferral.
+ *
+ * We can get away without a fence here due to the monotonic nature
+ * of the epoch counter. Worst ca

svn commit: r316666 - head/sys/fs/nfs

2017-04-09 Thread Rick Macklem
Author: rmacklem
Date: Sun Apr  9 21:06:21 2017
New Revision: 31
URL: https://svnweb.freebsd.org/changeset/base/31

Log:
  Fix the NFSv4.1 client for NFSERR_BADSESSION recovery via ReclaimComplete.
  
  For the ReclaimComplete operation, the RPC layer should not loop on
  NFSERR_BADSESSION. If it does, the recovery thread (nfscl) can get stuck
  looping and will not do a recovery.
  This patch fixes it so it does not loop. This bug only affects NFSv4.1 and
  only when a server reboots.
  
  Tested by:cperciva
  PR:   215886
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cSun Apr  9 21:02:05 2017
(r316665)
+++ head/sys/fs/nfs/nfs_commonsubs.cSun Apr  9 21:06:21 2017
(r31)
@@ -148,7 +148,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_
{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Test StateID */
{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Want Delegation */
{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy ClientID */
-   { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Reclaim Complete */
+   { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Reclaim Complete */
 };
 #endif /* !APPLEKEXT */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316667 - head/sys/fs/nfsclient

2017-04-09 Thread Rick Macklem
Author: rmacklem
Date: Sun Apr  9 21:50:21 2017
New Revision: 316667
URL: https://svnweb.freebsd.org/changeset/base/316667

Log:
  Fix the NFSv4 client hndling of a stale write verifier in the Commit 
operation.
  
  When the NFSv4 client Commit operation encountered a stale write verifier,
  it erroneously mapped that to EIO. This could have caused recently written
  data to be lost when a server crashes/reboots between an UNSTABLE write
  and the subsequent commit. This patch fixes this.
  The bug was only for the NFSv4 client and did not affect NFSv3.
  
  Tested by:cperciva
  PR:   215887
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Sun Apr  9 21:06:21 2017
(r31)
+++ head/sys/fs/nfsclient/nfs_clport.c  Sun Apr  9 21:50:21 2017
(r316667)
@@ -1196,7 +1196,7 @@ nfscl_maperr(struct thread *td, int erro
 {
struct proc *p;
 
-   if (error < 1)
+   if (error < 1 || error >= NFSERR_STALEWRITEVERF)
return (error);
if (td != NULL)
p = td->td_proc;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src

2017-04-09 Thread Conrad Meyer
On Sun, Apr 9, 2017 at 2:02 PM, Olivier Houchard  wrote:
> Author: cognet
> Date: Sun Apr  9 21:02:05 2017
> New Revision: 316665
> URL: https://svnweb.freebsd.org/changeset/base/316665
>
> Log:
>   Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32
>   This brings us changes we needed in ck_epoch.

Out of curiosity — what changes did we need, and why?

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

Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src

2017-04-09 Thread Olivier Houchard
On Sun, Apr 09, 2017 at 03:49:57PM -0700, Conrad Meyer wrote:
> On Sun, Apr 9, 2017 at 2:02 PM, Olivier Houchard  wrote:
> > Author: cognet
> > Date: Sun Apr  9 21:02:05 2017
> > New Revision: 316665
> > URL: https://svnweb.freebsd.org/changeset/base/316665
> >
> > Log:
> >   Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32
> >   This brings us changes we needed in ck_epoch.
> 
> Out of curiosity ??? what changes did we need, and why?
> 

Hi Conrad,

What ck_epoch lacked was any way to do priority propagation, which led
to some nice deadlocks to the linuxkpi folks.

Regards,

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


svn commit: r316668 - in stable/11/sys: netinet netinet6

2017-04-09 Thread Mike Karels
Author: karels
Date: Mon Apr 10 01:26:12 2017
New Revision: 316668
URL: https://svnweb.freebsd.org/changeset/base/316668

Log:
  Fix reference count leak with L2 caching.
  
  MFC r315956
  
  ip_forward, TCP/IPv6, and probably SCTP leaked references to L2 cache
  entry because they used their own routes on the stack, not in_pcb routes.
  The original model for route caching was callers that provided a route
  structure to ip{,6}input() would keep the route, and this model was used
  for L2 caching as well. Instead, change L2 caching to be done by default
  only when using a route structure in the in_pcb; the pcb deallocation
  code frees L2 as well as L3 cacches. A separate change will add route
  caching to TCP/IPv6.
  
  Another suggestion was to have the transport protocols indicate willingness
  to use L2 caching, but this approach keeps the changes in the network
  level
  
  Reviewed by:ae gnn
  MFC after:  2 weeks
  Differential Revision:  https://reviews.freebsd.org/D10059

Modified:
  stable/11/sys/netinet/in_pcb.c
  stable/11/sys/netinet/ip_output.c
  stable/11/sys/netinet6/ip6_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/in_pcb.c
==
--- stable/11/sys/netinet/in_pcb.c  Sun Apr  9 21:50:21 2017
(r316667)
+++ stable/11/sys/netinet/in_pcb.c  Mon Apr 10 01:26:12 2017
(r316668)
@@ -326,6 +326,12 @@ in_pcballoc(struct socket *so, struct in
 #endif
inp->inp_gencnt = ++pcbinfo->ipi_gencnt;
refcount_init(&inp->inp_refcount, 1);   /* Reference from inpcbinfo */
+
+   /*
+* Routes in inpcb's can cache L2 as well; they are guaranteed
+* to be cleaned up.
+*/
+   inp->inp_route.ro_flags = RT_LLE_CACHE;
INP_LIST_WUNLOCK(pcbinfo);
 #if defined(IPSEC) || defined(IPSEC_SUPPORT) || defined(MAC)
 out:

Modified: stable/11/sys/netinet/ip_output.c
==
--- stable/11/sys/netinet/ip_output.c   Sun Apr  9 21:50:21 2017
(r316667)
+++ stable/11/sys/netinet/ip_output.c   Mon Apr 10 01:26:12 2017
(r316668)
@@ -241,8 +241,7 @@ ip_output(struct mbuf *m, struct mbuf *o
if (ro == NULL) {
ro = &iproute;
bzero(ro, sizeof (*ro));
-   } else
-   ro->ro_flags |= RT_LLE_CACHE;
+   }
 
 #ifdef FLOWTABLE
if (ro->ro_rt == NULL)

Modified: stable/11/sys/netinet6/ip6_output.c
==
--- stable/11/sys/netinet6/ip6_output.c Sun Apr  9 21:50:21 2017
(r316667)
+++ stable/11/sys/netinet6/ip6_output.c Mon Apr 10 01:26:12 2017
(r316668)
@@ -493,8 +493,7 @@ ip6_output(struct mbuf *m0, struct ip6_p
if (ro == NULL) {
ro = &ip6route;
bzero((caddr_t)ro, sizeof(*ro));
-   } else
-   ro->ro_flags |= RT_LLE_CACHE;
+   }
ro_pmtu = ro;
if (opt && opt->ip6po_rthdr)
ro = &opt->ip6po_route;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316669 - head/sys/fs/nfsclient

2017-04-09 Thread Rick Macklem
Author: rmacklem
Date: Mon Apr 10 01:28:01 2017
New Revision: 316669
URL: https://svnweb.freebsd.org/changeset/base/316669

Log:
  Avoid starvation of the server crash recovery thread for the NFSv4 client.
  
  This patch gives a requestor of the exclusive lock on the client state
  in the NFSv4 client priority over shared lock requestors. This avoids
  the server crash recovery thread being starved out by other threads doing
  RPCs.
  
  Tested by:cperciva
  PR:   216087
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Mon Apr 10 01:26:12 2017
(r316668)
+++ head/sys/fs/nfsclient/nfs_clstate.c Mon Apr 10 01:28:01 2017
(r316669)
@@ -797,8 +797,18 @@ nfscl_getcl(struct mount *mp, struct ucr
(mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0)
igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL,
NFSCLSTATEMUTEXPTR, mp);
-   if (!igotlock)
+   if (igotlock == 0) {
+   /*
+* Call nfsv4_lock() with "iwantlock == 0" so that it will
+* wait for a pending exclusive lock request.  This gives the
+* exclusive lock request priority over this shared lock
+* request.
+* An exclusive lock on nfsc_lock is used mainly for server
+* crash recoveries.
+*/
+   nfsv4_lock(&clp->nfsc_lock, 0, NULL, NFSCLSTATEMUTEXPTR, mp);
nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, mp);
+   }
if (igotlock == 0 && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
/*
 * Both nfsv4_lock() and nfsv4_getref() know to check
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316670 - head/sys/arm/freescale/imx

2017-04-09 Thread Ian Lepore
Author: ian
Date: Mon Apr 10 02:46:39 2017
New Revision: 316670
URL: https://svnweb.freebsd.org/changeset/base/316670

Log:
  Add support for imx6ul soc.

Modified:
  head/sys/arm/freescale/imx/imx_iomux.c

Modified: head/sys/arm/freescale/imx/imx_iomux.c
==
--- head/sys/arm/freescale/imx/imx_iomux.c  Mon Apr 10 01:28:01 2017
(r316669)
+++ head/sys/arm/freescale/imx/imx_iomux.c  Mon Apr 10 02:46:39 2017
(r316670)
@@ -79,6 +79,7 @@ static struct ofw_compat_data compat_dat
{"fsl,imx6dl-iomuxc",   true},
{"fsl,imx6q-iomuxc",true},
{"fsl,imx6sl-iomuxc",   true},
+   {"fsl,imx6ul-iomuxc",   true},
{"fsl,imx6sx-iomuxc",   true},
{"fsl,imx53-iomuxc",true},
{"fsl,imx51-iomuxc",true},
@@ -223,6 +224,9 @@ iomux_attach(device_t dev)
case IMXSOC_6Q:
sc->last_gpreg = 13;
break;
+   case IMXSOC_6UL:
+   sc->last_gpreg = 14;
+   break;
default:
device_printf(dev, "Unknown SoC type\n");
return (ENXIO);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316671 - stable/10/sys/dev/hyperv/storvsc

2017-04-09 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Apr 10 03:09:12 2017
New Revision: 316671
URL: https://svnweb.freebsd.org/changeset/base/316671

Log:
  MFC 316519
  
  hyperv/storvsc: Fixup SRB status.
  
  This unbreaks GEN2 Hyper-V cd support.
  
  Submitted by:   Hongjiang Zhang 
  Reviewed by:dexuan@
  Sponsored by:   Microsoft
  Differential Revision:  https://reviews.freebsd.org/D10212

Modified:
  stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c   Mon Apr 10 
02:46:39 2017(r316670)
+++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c   Mon Apr 10 
03:09:12 2017(r316671)
@@ -2148,19 +2148,20 @@ storvsc_io_done(struct hv_storvsc_reques
 
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+   int srb_status = SRB_STATUS(vm_srb->srb_status);
if (vm_srb->scsi_status == SCSI_STATUS_OK) {
const struct scsi_generic *cmd;
 
cmd = (const struct scsi_generic *)
((ccb->ccb_h.flags & CAM_CDB_POINTER) ?
 csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes);
-   if (vm_srb->srb_status != SRB_STATUS_SUCCESS) {
+   if (srb_status != SRB_STATUS_SUCCESS) {
/*
 * If there are errors, for example, invalid LUN,
 * host will inform VM through SRB status.
 */
if (bootverbose) {
-   if (vm_srb->srb_status == 
SRB_STATUS_INVALID_LUN) {
+   if (srb_status == SRB_STATUS_INVALID_LUN) {
xpt_print(ccb->ccb_h.path,
"invalid LUN %d for op: %s\n",
vm_srb->lun,
@@ -2168,7 +2169,7 @@ storvsc_io_done(struct hv_storvsc_reques
} else {
xpt_print(ccb->ccb_h.path,
"Unknown SRB flag: %d for op: %s\n",
-   vm_srb->srb_status,
+   srb_status,
scsi_op_desc(cmd->opcode, NULL));
}
}
@@ -2191,7 +2192,7 @@ storvsc_io_done(struct hv_storvsc_reques
}
 
if (cmd->opcode == INQUIRY &&
-   vm_srb->srb_status == SRB_STATUS_SUCCESS) {
+   srb_status == SRB_STATUS_SUCCESS) {
int resp_xfer_len, resp_buf_len, data_len;
uint8_t *resp_buf = (uint8_t *)csio->data_ptr;
struct scsi_inquiry_data *inq_data =

Modified: stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h
==
--- stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h  Mon Apr 10 02:46:39 
2017(r316670)
+++ stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h  Mon Apr 10 03:09:12 
2017(r316671)
@@ -242,17 +242,16 @@ struct vstor_packet {
 #define SRB_STATUS_PENDING 0x00
 #define SRB_STATUS_SUCCESS 0x01
 #define SRB_STATUS_ABORTED 0x02
-#define SRB_STATUS_ABORT_FAILED0x03
 #define SRB_STATUS_ERROR   0x04
-#define SRB_STATUS_BUSY0x05
-
+#define SRB_STATUS_INVALID_LUN  0x20
 /**
  * SRB Status Masks (can be combined with above status codes)
  */
 #define SRB_STATUS_QUEUE_FROZEN 0x40
 #define SRB_STATUS_AUTOSENSE_VALID  0x80
-#define SRB_STATUS_INVALID_LUN  0X20
 
+#define SRB_STATUS(status) \
+   ((status) & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
 /*
  * SRB Flag Bits
  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316672 - stable/10/sys/dev/hyperv/netvsc

2017-04-09 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Apr 10 03:23:57 2017
New Revision: 316672
URL: https://svnweb.freebsd.org/changeset/base/316672

Log:
  MFC 316520
  
  hyperv/hn: Fixat RNDIS rxfilter after the successful RNDIS init.
  
  Under certain conditions on certain versions of Hyper-V, the RNDIS
  rxfilter is _not_ zero on the hypervisor side after the successful
  RNDIS initialization, which breaks the assumption of any following
  code (well, it breaks the RNDIS API contract actually).  Clear the
  RNDIS rxfilter explicitly, drain packets sneaking through, and drain
  the interrupt taskqueues scheduled due to the stealth packets.
  
  Reported by:dexuan@
  Sponsored by:   Microsoft
  Differential Revision:  https://reviews.freebsd.org/D10230

Modified:
  stable/10/sys/dev/hyperv/netvsc/hn_rndis.c
  stable/10/sys/dev/hyperv/netvsc/hn_rndis.h
  stable/10/sys/dev/hyperv/netvsc/if_hn.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c
==
--- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c  Mon Apr 10 03:09:12 2017
(r316671)
+++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c  Mon Apr 10 03:23:57 2017
(r316672)
@@ -980,16 +980,19 @@ hn_rndis_query_hwcaps(struct hn_softc *s
 }
 
 int
-hn_rndis_attach(struct hn_softc *sc, int mtu)
+hn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done)
 {
int error;
 
+   *init_done = 0;
+
/*
 * Initialize RNDIS.
 */
error = hn_rndis_init(sc);
if (error)
return (error);
+   *init_done = 1;
 
/*
 * Configure NDIS offload settings.

Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.h
==
--- stable/10/sys/dev/hyperv/netvsc/hn_rndis.h  Mon Apr 10 03:09:12 2017
(r316671)
+++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.h  Mon Apr 10 03:23:57 2017
(r316672)
@@ -33,7 +33,7 @@
 
 struct hn_softc;
 
-inthn_rndis_attach(struct hn_softc *sc, int mtu);
+inthn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done);
 void   hn_rndis_detach(struct hn_softc *sc);
 inthn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags);
 inthn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt);

Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c
==
--- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 03:09:12 2017
(r316671)
+++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 03:23:57 2017
(r316672)
@@ -256,6 +256,7 @@ static void hn_rndis_rx_data(struct hn
const void *, int);
 static voidhn_rndis_rx_status(struct hn_softc *,
const void *, int);
+static voidhn_rndis_init_fixat(struct hn_softc *, int);
 
 static voidhn_nvs_handle_notify(struct hn_softc *,
const struct vmbus_chanpkt_hdr *);
@@ -321,6 +322,8 @@ static void hn_resume_mgmt(struct hn_s
 static voidhn_suspend_mgmt_taskfunc(void *, int);
 static voidhn_chan_drain(struct hn_softc *,
struct vmbus_channel *);
+static voidhn_disable_rx(struct hn_softc *);
+static voidhn_drain_rxtx(struct hn_softc *, int);
 static voidhn_polling(struct hn_softc *, u_int);
 static voidhn_chan_polling(struct vmbus_channel *, u_int);
 
@@ -2256,6 +2259,18 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v
/* If the VF is active, inject the packet through the VF */
ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp;
 
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+   /*
+* NOTE:
+* See the NOTE of hn_rndis_init_fixat().  This
+* function can be reached, immediately after the
+* RNDIS is initialized but before the ifnet is
+* setup on the hn_attach() path; drop the unexpected
+* packets.
+*/
+   return (0);
+   }
+
if (dlen <= MHLEN) {
m_new = m_gethdr(M_NOWAIT, MT_DATA);
if (m_new == NULL) {
@@ -4685,6 +4700,27 @@ hn_synth_attachable(const struct hn_soft
return (true);
 }
 
+/*
+ * Make sure that the RX filter is zero after the successful
+ * RNDIS initialization.
+ *
+ * NOTE:
+ * Under certain conditions on certain versions of Hyper-V,
+ * the RNDIS rxfilter is _not_ zero on the hypervisor side
+ * after the successful RNDIS initialization, which breaks
+ * the assumption of any following code (well, it breaks the
+ *

svn commit: r316673 - stable/11/sys/dev/hyperv/storvsc

2017-04-09 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Apr 10 04:59:44 2017
New Revision: 316673
URL: https://svnweb.freebsd.org/changeset/base/316673

Log:
  MFC 316519
  
  hyperv/storvsc: Fixup SRB status.
  
  This unbreaks GEN2 Hyper-V cd support.
  
  Submitted by:   Hongjiang Zhang 
  Reviewed by:dexuan@
  Sponsored by:   Microsoft
  Differential Revision:  https://reviews.freebsd.org/D10212

Modified:
  stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c   Mon Apr 10 
03:23:57 2017(r316672)
+++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c   Mon Apr 10 
04:59:44 2017(r316673)
@@ -2148,19 +2148,20 @@ storvsc_io_done(struct hv_storvsc_reques
 
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+   int srb_status = SRB_STATUS(vm_srb->srb_status);
if (vm_srb->scsi_status == SCSI_STATUS_OK) {
const struct scsi_generic *cmd;
 
cmd = (const struct scsi_generic *)
((ccb->ccb_h.flags & CAM_CDB_POINTER) ?
 csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes);
-   if (vm_srb->srb_status != SRB_STATUS_SUCCESS) {
+   if (srb_status != SRB_STATUS_SUCCESS) {
/*
 * If there are errors, for example, invalid LUN,
 * host will inform VM through SRB status.
 */
if (bootverbose) {
-   if (vm_srb->srb_status == 
SRB_STATUS_INVALID_LUN) {
+   if (srb_status == SRB_STATUS_INVALID_LUN) {
xpt_print(ccb->ccb_h.path,
"invalid LUN %d for op: %s\n",
vm_srb->lun,
@@ -2168,7 +2169,7 @@ storvsc_io_done(struct hv_storvsc_reques
} else {
xpt_print(ccb->ccb_h.path,
"Unknown SRB flag: %d for op: %s\n",
-   vm_srb->srb_status,
+   srb_status,
scsi_op_desc(cmd->opcode, NULL));
}
}
@@ -2191,7 +2192,7 @@ storvsc_io_done(struct hv_storvsc_reques
}
 
if (cmd->opcode == INQUIRY &&
-   vm_srb->srb_status == SRB_STATUS_SUCCESS) {
+   srb_status == SRB_STATUS_SUCCESS) {
int resp_xfer_len, resp_buf_len, data_len;
uint8_t *resp_buf = (uint8_t *)csio->data_ptr;
struct scsi_inquiry_data *inq_data =

Modified: stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h
==
--- stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h  Mon Apr 10 03:23:57 
2017(r316672)
+++ stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h  Mon Apr 10 04:59:44 
2017(r316673)
@@ -242,17 +242,16 @@ struct vstor_packet {
 #define SRB_STATUS_PENDING 0x00
 #define SRB_STATUS_SUCCESS 0x01
 #define SRB_STATUS_ABORTED 0x02
-#define SRB_STATUS_ABORT_FAILED0x03
 #define SRB_STATUS_ERROR   0x04
-#define SRB_STATUS_BUSY0x05
-
+#define SRB_STATUS_INVALID_LUN  0x20
 /**
  * SRB Status Masks (can be combined with above status codes)
  */
 #define SRB_STATUS_QUEUE_FROZEN 0x40
 #define SRB_STATUS_AUTOSENSE_VALID  0x80
-#define SRB_STATUS_INVALID_LUN  0X20
 
+#define SRB_STATUS(status) \
+   ((status) & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
 /*
  * SRB Flag Bits
  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316674 - stable/11/sys/dev/hyperv/netvsc

2017-04-09 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Apr 10 05:17:18 2017
New Revision: 316674
URL: https://svnweb.freebsd.org/changeset/base/316674

Log:
  MFC 316520
  
  hyperv/hn: Fixat RNDIS rxfilter after the successful RNDIS init.
  
  Under certain conditions on certain versions of Hyper-V, the RNDIS
  rxfilter is _not_ zero on the hypervisor side after the successful
  RNDIS initialization, which breaks the assumption of any following
  code (well, it breaks the RNDIS API contract actually).  Clear the
  RNDIS rxfilter explicitly, drain packets sneaking through, and drain
  the interrupt taskqueues scheduled due to the stealth packets.
  
  Reported by:dexuan@
  Sponsored by:   Microsoft
  Differential Revision:  https://reviews.freebsd.org/D10230

Modified:
  stable/11/sys/dev/hyperv/netvsc/hn_rndis.c
  stable/11/sys/dev/hyperv/netvsc/hn_rndis.h
  stable/11/sys/dev/hyperv/netvsc/if_hn.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c
==
--- stable/11/sys/dev/hyperv/netvsc/hn_rndis.c  Mon Apr 10 04:59:44 2017
(r316673)
+++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.c  Mon Apr 10 05:17:18 2017
(r316674)
@@ -979,16 +979,19 @@ hn_rndis_query_hwcaps(struct hn_softc *s
 }
 
 int
-hn_rndis_attach(struct hn_softc *sc, int mtu)
+hn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done)
 {
int error;
 
+   *init_done = 0;
+
/*
 * Initialize RNDIS.
 */
error = hn_rndis_init(sc);
if (error)
return (error);
+   *init_done = 1;
 
/*
 * Configure NDIS offload settings.

Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.h
==
--- stable/11/sys/dev/hyperv/netvsc/hn_rndis.h  Mon Apr 10 04:59:44 2017
(r316673)
+++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.h  Mon Apr 10 05:17:18 2017
(r316674)
@@ -33,7 +33,7 @@
 
 struct hn_softc;
 
-inthn_rndis_attach(struct hn_softc *sc, int mtu);
+inthn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done);
 void   hn_rndis_detach(struct hn_softc *sc);
 inthn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags);
 inthn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt);

Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c
==
--- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 04:59:44 2017
(r316673)
+++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 05:17:18 2017
(r316674)
@@ -261,6 +261,7 @@ static void hn_rndis_rx_data(struct hn
const void *, int);
 static voidhn_rndis_rx_status(struct hn_softc *,
const void *, int);
+static voidhn_rndis_init_fixat(struct hn_softc *, int);
 
 static voidhn_nvs_handle_notify(struct hn_softc *,
const struct vmbus_chanpkt_hdr *);
@@ -328,6 +329,8 @@ static void hn_resume_mgmt(struct hn_s
 static voidhn_suspend_mgmt_taskfunc(void *, int);
 static voidhn_chan_drain(struct hn_softc *,
struct vmbus_channel *);
+static voidhn_disable_rx(struct hn_softc *);
+static voidhn_drain_rxtx(struct hn_softc *, int);
 static voidhn_polling(struct hn_softc *, u_int);
 static voidhn_chan_polling(struct vmbus_channel *, u_int);
 
@@ -2267,6 +2270,18 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v
/* If the VF is active, inject the packet through the VF */
ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp;
 
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+   /*
+* NOTE:
+* See the NOTE of hn_rndis_init_fixat().  This
+* function can be reached, immediately after the
+* RNDIS is initialized but before the ifnet is
+* setup on the hn_attach() path; drop the unexpected
+* packets.
+*/
+   return (0);
+   }
+
if (dlen <= MHLEN) {
m_new = m_gethdr(M_NOWAIT, MT_DATA);
if (m_new == NULL) {
@@ -4711,6 +4726,27 @@ hn_synth_attachable(const struct hn_soft
return (true);
 }
 
+/*
+ * Make sure that the RX filter is zero after the successful
+ * RNDIS initialization.
+ *
+ * NOTE:
+ * Under certain conditions on certain versions of Hyper-V,
+ * the RNDIS rxfilter is _not_ zero on the hypervisor side
+ * after the successful RNDIS initialization, which breaks
+ * the assumption of any following code (well, it breaks the
+ *

svn commit: r316675 - head/sys/dev/syscons

2017-04-09 Thread Bruce Evans
Author: bde
Date: Mon Apr 10 06:19:09 2017
New Revision: 316675
URL: https://svnweb.freebsd.org/changeset/base/316675

Log:
  Special rendering methods for removing mouse cursors cannot be removed
  like I hoped, since they are needed for removing parts over the border.
  Continue fixing bugs in them.
  
  In the vga planar mode renderer, remove removal of the part of the
  image over the text window.  This was hard-coded for nearly 8x16 fonts
  and in practice didn't remove enough for 8x8 fonts.  This used the
  wrong attribute over cutmarked regions.  The caller refreshes with the
  correct attribute later, so the attribute bug only caused flicker.
  The caller uses the same hard-coding, so the refreshes fix up all the
  spots with the wrong attribute, but keep missing the missed spots.
  This still gives trails of bits of cursors for cursor motions in the
  affected configurations (mainly depth 4 modes with 8x8) fonts.  8x14
  fonts barely escape the problem since although the cursor is drawn
  as 16x16, its active part is only 9x13 and the active part fits in
  the hard-coded 2x2 character cell window for 8x14 fonts.  8x8 fonts
  need a 2x3 window.
  
  In the fb non-sparc64 renderer, the buggy image removal was buggier
  and was already avoided by returning before it.  Remove it completely
  and fix nearby style bugs.  It was essentially the same as for the vga
  planar mode renderer (obfuscated by swapping x and y).  This was buggier
  since fb should handle more types of hardware so the hard-coding is
  wronger.
  
  The remaining fb image removal is also buggier.  It never supported
  software cursors drawn into the border, and the hardware cursor is
  probably broken by other bugs to be fixed soon.

Modified:
  head/sys/dev/syscons/scgfbrndr.c
  head/sys/dev/syscons/scvgarndr.c

Modified: head/sys/dev/syscons/scgfbrndr.c
==
--- head/sys/dev/syscons/scgfbrndr.cMon Apr 10 05:17:18 2017
(r316674)
+++ head/sys/dev/syscons/scgfbrndr.cMon Apr 10 06:19:09 2017
(r316675)
@@ -335,28 +335,14 @@ static void 
 gfb_mouse(scr_stat *scp, int x, int y, int on)
 {
 #ifdef __sparc64__
-   vidd_putm(scp->sc->adp, x, y, mouse_pointer,
-   on ? 0x : 0x0, 22, 12);
+   vidd_putm(scp->sc->adp, x, y, mouse_pointer,
+   on ? 0x : 0x0, 22, 12);
 #else
-   int i, pos;
-
if (on) {
-
-   /* Display the mouse pointer image... */
vidd_putm(scp->sc->adp, x, y, mouse_pointer,
0x, 16, 8);
} else {
-
-   /*
-  Erase the mouse cursor image by redrawing the text
-  underneath it...
-   */
-   return;
-   pos = x*scp->xsize + y;
-   i = (y < scp->xsize - 1) ? 2 : 1;
-   (*scp->rndr->draw)(scp, pos, i, FALSE);
-   if (x < scp->ysize - 1)
-   (*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE);
+   /* XXX: removal is incomplete for h/w cursors and borders. */
}
 #endif
 }

Modified: head/sys/dev/syscons/scvgarndr.c
==
--- head/sys/dev/syscons/scvgarndr.cMon Apr 10 05:17:18 2017
(r316674)
+++ head/sys/dev/syscons/scvgarndr.cMon Apr 10 06:19:09 2017
(r316675)
@@ -1101,21 +1101,16 @@ remove_pxlmouse_planar(scr_stat *scp, in
 {
vm_offset_t p;
int col, row;
-   int pos;
int line_width;
int ymax;
int i;
 
-   /* erase the mouse cursor image */
+   /*
+* The caller will remove parts of the mouse image over the text
+* window better than we can do.  Remove only parts over the border.
+*/
col = x/8 - scp->xoff;
row = y/scp->font_size - scp->yoff;
-   pos = row*scp->xsize + col;
-   i = (col < scp->xsize - 1) ? 2 : 1;
-   (*scp->rndr->draw)(scp, pos, i, FALSE);
-   if (row < scp->ysize - 1)
-   (*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE);
-
-   /* paint border if necessary */
line_width = scp->sc->adp->va_line_width;
outw(GDCIDX, 0x0005);   /* read mode 0, write mode 0 */
outw(GDCIDX, 0x0003);   /* data rotate/function select */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"