Re: mmap port from 9 not working

2019-07-21 Thread Laurie Jennings
 On Sunday, July 21, 2019, 10:44:14 AM EDT, Konstantin Belousov 
 wrote:

On Sun, Jul 21, 2019 at 03:48:03AM +, Laurie Jennings wrote:
> I have some custom stuff I'm porting from Freebsd 9.x using mmap. I get a 
> pointer from the kernel via an ioctl and I map it into a shared buffer.
> char *kptr;   // mem ptr from kernel
> fd=open("/dev/kmem",O_RDWR);memp=mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,(off_t)
>  ptr);
> 
> This worked perfectly in 9; memp I had a shared block of memory between the 
> kernel and user space.
> In 11.3 this returns an errno 22, which is pretty murky. I did notice that 
> off_t doesnt yield an actual offset; I've tried putting in the correct value 
> manuallybut it just fails and fails.I've tried read only also. 
> Please Help!

| Start with providing (and looking yourself) at the output of kdump/ktrace
| around the failing mmap.  The checks for correctness of the mmap(2) arguments
| were greatly improved during years after FreeBSD 9.
Since posting this I found a thread that said something about mmap no longer 
supporting /dev/kmem. If that's that case I need to find another method. No 
sense spending a day debugging something thatisn't supposed to work. 
SHOULD this still work? This always worked fine with non-wired memory but maybe 
things have changed since 9. 



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


Re: filesystem mount problem

2019-07-21 Thread Ian Lepore
On Sun, 2019-07-21 at 15:07 -0400, AN wrote:
> Hi:
> 
> FreeBSD FreeBSD_13 13.0-CURRENT FreeBSD 13.0-CURRENT #102 r350187:
> Sat Jul 
> 20 19:04:30 EDT 2019 
> root@FreeBSD_13:/usr/obj/usr/src/amd64.amd64/sys/MYKERNEL  amd64
> 1300036
> 
> I would appreciate some help with the following problem.
> 
> /etc/fstab:
> # Device  Mountpoint  FStype  Options DumpPass#
> /dev/ada0p2   noneswapsw  0   0
> /dev/ada0p3   /   ufs rw  1   1
> linprocfs   /compat/linux/proclinprocfs   rw  0   0
> tmpfs/compat/linux/dev/shmtmpfs   rw,mode=17770   
> 0
> 
> 
> # df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ada0p3428G245G149G62%/
> devfs  1.0K1.0K  0B   100%/dev
> linprocfs  4.0K4.0K  0B   100%/compat/linux/proc
> tmpfs   47G4.0K 47G 0%/compat/linux/dev/shm
> tmpfs   20M604K 19M 3%/tmp
> 
> I don't understand why the /tmp is being mounted.  It is causing
> problems 
> because when I try to run portupgrade it fails for lack of space.  If
> I 
> forcibly unmount it everything breaks.
> 
> # umount -v /tmp
> umount: unmount of /tmp failed: Device busy
> [root@FreeBSD_13 ~]# umount -vf /tmp
> tmpfs: unmount from /tmp
> [root@FreeBSD_13 ~]# df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ada0p3428G245G149G62%/
> devfs  1.0K1.0K  0B   100%/dev
> linprocfs  4.0K4.0K  0B   100%/compat/linux/proc
> tmpfs   47G4.0K 47G 0%/compat/linux/dev/shm
> [root@FreeBSD_13 ~]# vinagre
> Unable to init server: Could not connect to 127.0.0.1: Connection
> refused
> 
> (vinagre:27111): Gtk-WARNING **: 15:04:21.599: cannot open display:
> :0
> 
> Any help would be appreciated, thanks in advance.
> 

The problem isn't that /tmp is tmpfs, the problem is that it's being
mounted by /etc/rc.d/tmp as a 20MB filesystem because tmpsize="20m" is
the default.  You could set tmpsize to some bigger value in rc.conf, or
you can add an explicit mount for /tmp in fstab so that you get the
full (47G on your system) capacity that's available:

 tmpfs /tmp tmpfs rw 0 0

-- Ian


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


Re: vmx0: watchdog timeout on queue 2, no interrupts on BSP

2019-07-21 Thread Patrick Kelsey


> On Jul 21, 2019, at 4:17 PM, Andriy Gapon  wrote:
> 
>> On 20/07/2019 20:08, Patrick Kelsey wrote:
>> 
>> 
>> On Fri, Jul 19, 2019 at 10:07 AM Andriy Gapon > > wrote:
>> 
>> 
>>Recently we experienced a strange problem.
>>We noticed a lot of these messages in the logs:
>>vmx0: watchdog timeout on queue 2
>>(always queue 2)
>>Also, we noticed that connections to some end points did not work at all
>>while others worked without problems.  I assume that that was because
>>specific flows got assigned to that queue 2.
>> 
>>Further investigation has shown that none of interrupts assigned to the
>>BSP has ever fired (since boot, of course).  That included vmx0:rx2 and
>>vmx0:tx2.  But also interrupts for other drivers as well.
>> 
>>Trying to get more information I rebooted the system and the problem
>>disappeared.
>> 
>>Has anyone seen anything like that?
>>Any thoughts on possible causes?
>>Any suggestions what to check if/when the problem reoccurs?
>> 
>>Thanks!
>> 
>> 
>> If you are running head at or after r347221 or stable/12 at or after
>> r349112, then this could be due to
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239118 (see Comment 4
>> - short story is that an iflib change has broken the vmx driver).
> 
> I am not sure if that bug could lead to all interrupts on the core
> getting disabled (for all drivers), and right at the boot time.

I am not sure either, but it’s the kind of bug that breaks the design of the 
vmx driver in such a way that its state can get corrupted to the point where 
the kernel can panic.  I haven’t fully analyzed the potential scope of memory 
corruption / hardware state corruption that can occur (because the fix for the 
issue is already apparent), so I am freely considering it to include elements 
beyond the device and driver itself.

If you are saying that zero vmx queue interrupts have occurred anywhere in the 
system, then I would rule out any connection to this as a prerequisite for the 
corruption to occur is having at least one such interrupt.

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


Re: vmx0: watchdog timeout on queue 2, no interrupts on BSP

2019-07-21 Thread Andriy Gapon
On 20/07/2019 20:08, Patrick Kelsey wrote:
> 
> 
> On Fri, Jul 19, 2019 at 10:07 AM Andriy Gapon  > wrote:
> 
> 
> Recently we experienced a strange problem.
> We noticed a lot of these messages in the logs:
> vmx0: watchdog timeout on queue 2
> (always queue 2)
> Also, we noticed that connections to some end points did not work at all
> while others worked without problems.  I assume that that was because
> specific flows got assigned to that queue 2.
> 
> Further investigation has shown that none of interrupts assigned to the
> BSP has ever fired (since boot, of course).  That included vmx0:rx2 and
> vmx0:tx2.  But also interrupts for other drivers as well.
> 
> Trying to get more information I rebooted the system and the problem
> disappeared.
> 
> Has anyone seen anything like that?
> Any thoughts on possible causes?
> Any suggestions what to check if/when the problem reoccurs?
> 
> Thanks!
> 
> 
> If you are running head at or after r347221 or stable/12 at or after
> r349112, then this could be due to
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239118 (see Comment 4
> - short story is that an iflib change has broken the vmx driver).

I am not sure if that bug could lead to all interrupts on the core
getting disabled (for all drivers), and right at the boot time.


-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: filesystem mount problem

2019-07-21 Thread Trond Endrestøl
On Sun, 21 Jul 2019 15:07-0400, AN wrote:

> I don't understand why the /tmp is being mounted.  It is causing problems
> because when I try to run portupgrade it fails for lack of space.  If I
> forcibly unmount it everything breaks.

tmpmfs is set to "AUTO" in /etc/defaults/rc.conf.

Try setting tmpmfs="NO" in /etc/rc.conf, reboot, and see if this 
prohibits the creation of /tmp as a tmpfs.

You can also set PKG_TMPDIR or TMPDIR to point to, say, /var/tmp. 

E.g.:

export PKG_TMPDIR=/var/tmp

or

setenv PKG_TMPDIR /var/tmp

> # umount -v /tmp
> umount: unmount of /tmp failed: Device busy
> [root@FreeBSD_13 ~]# umount -vf /tmp
> tmpfs: unmount from /tmp
> [root@FreeBSD_13 ~]# df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ada0p3428G245G149G62%/
> devfs  1.0K1.0K  0B   100%/dev
> linprocfs  4.0K4.0K  0B   100%/compat/linux/proc
> tmpfs   47G4.0K 47G 0%/compat/linux/dev/shm

> [root@FreeBSD_13 ~]# vinagre
> Unable to init server: Could not connect to 127.0.0.1: Connection refused
> 
> (vinagre:27111): Gtk-WARNING **: 15:04:21.599: cannot open display: :0

This is expected when /tmp/.X11-unix/X0 ceases to exist, among other 
files within /tmp.

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


Re: filesystem mount problem

2019-07-21 Thread Christoph Moench-Tegeder
## AN (a...@neu.net):

> tmpfs   47G4.0K 47G 0%/compat/linux/dev/shm
> tmpfs   20M604K 19M 3%/tmp

> I don't understand why the /tmp is being mounted.  It is causing problems 
> because when I try to run portupgrade it fails for lack of space.  If I 
> forcibly unmount it everything breaks.

Either you have set "tmpmfs" in rc.conf to "YES", or your /tmp
(before mounting the tmpfs) is not writable (in which case the
default "tmpmfs" setting of "AUTO" resorts to mounting the tmpfs).
Sset "tmpmfs" to "NO" and make sure you've got a writeable /tmp.
See /etc/rc.d/tmp for reference. (The scripts itself seem to not
have been changed since 12 or so).

Regards,
Christoph

-- 
Spare Space
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


filesystem mount problem

2019-07-21 Thread AN

Hi:

FreeBSD FreeBSD_13 13.0-CURRENT FreeBSD 13.0-CURRENT #102 r350187: Sat Jul 
20 19:04:30 EDT 2019 
root@FreeBSD_13:/usr/obj/usr/src/amd64.amd64/sys/MYKERNEL  amd64 1300036


I would appreciate some help with the following problem.

/etc/fstab:
# DeviceMountpoint  FStype  Options DumpPass#
/dev/ada0p2 noneswapsw  0   0
/dev/ada0p3 /   ufs rw  1   1
linprocfs   /compat/linux/proc  linprocfs   rw  0   0
tmpfs/compat/linux/dev/shm  tmpfs   rw,mode=17770   0


# df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ada0p3428G245G149G62%/
devfs  1.0K1.0K  0B   100%/dev
linprocfs  4.0K4.0K  0B   100%/compat/linux/proc
tmpfs   47G4.0K 47G 0%/compat/linux/dev/shm
tmpfs   20M604K 19M 3%/tmp

I don't understand why the /tmp is being mounted.  It is causing problems 
because when I try to run portupgrade it fails for lack of space.  If I 
forcibly unmount it everything breaks.


# umount -v /tmp
umount: unmount of /tmp failed: Device busy
[root@FreeBSD_13 ~]# umount -vf /tmp
tmpfs: unmount from /tmp
[root@FreeBSD_13 ~]# df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ada0p3428G245G149G62%/
devfs  1.0K1.0K  0B   100%/dev
linprocfs  4.0K4.0K  0B   100%/compat/linux/proc
tmpfs   47G4.0K 47G 0%/compat/linux/dev/shm
[root@FreeBSD_13 ~]# vinagre
Unable to init server: Could not connect to 127.0.0.1: Connection refused

(vinagre:27111): Gtk-WARNING **: 15:04:21.599: cannot open display: :0

Any help would be appreciated, thanks in advance.

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


Re: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread Evilham

On dg., jul. 21 2019, Cristian Pogolsha wrote:


Hi,

Thank you for the instructions. I have a question related to
post-installation. My system doesn't boot after installing and 
rebooting
the system. It just doesn't find the partition on the drive. I 
get a blank
screen when selecting from the boot media list. What 
partitioning scheme
did you use for your installation? Or is this problem 
addressable with step

#2 in your instructions? Putting in the boot/loader.conf ->
set.hw.pci.mcfg=0?


The **hw.pci.mcfg=0** line in /boot/loader.conf is so that your 
booting won't hang the same way it did on installation without 
manual parameters, shouldn't be related to your current issue.
Remember to add the comment linking to the bug as well, so that 
you can remove it when those changes land in -CURRENT
Also add yourself to the CC field in the bug, that way you can 
help test those changes.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231760q

Your current issue sounds like a problem with the way you 
installed / set up the system and is probably better for 
freebsd-questions:

https://lists.freebsd.org/mailman/listinfo/freebsd-questions

FWIW: I boot using EFI from ZFS in a geli-encrypted partition in a 
GPT disk, I recall some manual fiddling but those were likely 
because I needed sth particular.

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


Re: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread Evilham

On ds., jul. 20 2019, Evilham wrote:

Serious issue:
I was just debugging this right now, more infos with a proper
bug
report will come, but I think the system encounters a deadlock
sometimes with the drm-kmod / amdgpu which results in a kernel
panic.
It is a serious issue, but it allows me to use the computer 
for

work,
it doesn't happen every couple hours, but it does happen a
couple
times a day.

FWIW, this is part of the crashlog:

WARNING !drm_modeset_is_locked(>mutex) failed at
/wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-6365030/drivers/gpu/drm/drm_atomic_helper.c:821
[Multiple times...]
kernel trap 22 with interrupts disabled
 kernel trap 22 with interrupts
 disabled
kernel trap 22 with interrupts disabled
kernel trap 22 with interrupts disabled
 panic: spin lock held too long



And this is why I wanted to do more debugging before raising an 
issue :-).


It kept happening without drm-kmod but the backtrace was 
different, which allowed me to reduce it to a piece of alpha 
Software I use pretty much all the time: WireGuard.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239351

So, update: there is no *serious* issue when using the ThinkPad 
A485, it works mostly fine with minor annoyances (including the 
fact that installation media won't work out of the box).

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


Re: mmap port from 9 not working

2019-07-21 Thread Konstantin Belousov
On Sun, Jul 21, 2019 at 03:48:03AM +, Laurie Jennings wrote:
> I have some custom stuff I'm porting from Freebsd 9.x using mmap. I get a 
> pointer from the kernel via an ioctl and I map it into a shared buffer.
> char *kptr;   // mem ptr from kernel
> fd=open("/dev/kmem",O_RDWR);memp=mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,(off_t)
>  ptr);
> 
> This worked perfectly in 9; memp I had a shared block of memory between the 
> kernel and user space.
> In 11.3 this returns an errno 22, which is pretty murky. I did notice that 
> off_t doesnt yield an actual offset; I've tried putting in the correct value 
> manuallybut it just fails and fails.I've tried read only also. 
> Please Help!

Start with providing (and looking yourself) at the output of kdump/ktrace
around the failing mmap.  The checks for correctness of the mmap(2) arguments
were greatly improved during years after FreeBSD 9.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread Cristian Pogolsha
Hi,

Thank you for the instructions. I have a question related to
post-installation. My system doesn't boot after installing and rebooting
the system. It just doesn't find the partition on the drive. I get a blank
screen when selecting from the boot media list. What partitioning scheme
did you use for your installation? Or is this problem addressable with step
#2 in your instructions? Putting in the boot/loader.conf ->
set.hw.pci.mcfg=0?

Thank you very much,
Cristian
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


mmap port from 9 not working

2019-07-21 Thread Laurie Jennings
I have some custom stuff I'm porting from Freebsd 9.x using mmap. I get a 
pointer from the kernel via an ioctl and I map it into a shared buffer.
char *kptr;   // mem ptr from kernel
fd=open("/dev/kmem",O_RDWR);memp=mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,(off_t)
 ptr);

This worked perfectly in 9; memp I had a shared block of memory between the 
kernel and user space.
In 11.3 this returns an errno 22, which is pretty murky. I did notice that 
off_t doesnt yield an actual offset; I've tried putting in the correct value 
manuallybut it just fails and fails.I've tried read only also. 
Please Help!
Laurie
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: acpi issues on FreeBSD-current_r350103 on Thinkpad A485

2019-07-21 Thread StaffSilence
Having same issue with an i915 inside a hp envy

On July 19, 2019 3:15:11 PM PDT, Cristian Pogolsha  wrote:
>Hi,
>
>I tried recently to boot FreeBSD current r350103 on a Thinkpad A485.
>It's
>the AMD Ryzen equivalent of the T480. During the boot I encountered
>this
>ACPI related error
>https://drive.google.com/file/d/1dzgSonn6Cuc1YrDeAUYSqHZlcmzaDY2Y/view
>Sorry that I'm posting images instead of plain text. I have no idea how
>to
>do kernel dumps during the bootload of a live image. I would be happy
>to
>post more information if required, let me know how I can do it.
>
>Thank you,
>Cristian
>___
>freebsd-current@freebsd.org mailing list
>https://lists.freebsd.org/mailman/listinfo/freebsd-current
>To unsubscribe, send any mail to
>"freebsd-current-unsubscr...@freebsd.org"
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"