Re: Pimp my APU

2023-11-11 Thread Stefan Kapfhammer
https://pcengines.ch/howto.htm#gpio -Stefan

  Ronald Dahlgren  hat am 11.11.2023 01:03
  CET geschrieben: I’ve got several APUs and a couple Alix boards.
  The s1 button should work as a power / reset button out of the box.
  On Fri, Nov 10, 2023 at 6:54 PM Anders Andersson 
  wrote:

I'm running OpenBSD on my (recently EOL) APU4 and I'm wondering
how much of the "extra" hardware is expected to work on OpenBSD.

1) On the back of the board is a button "S1" and three status
LEDs, The documentation says they are handled by the AMD FCH
south bridge. Is there a way to control these in software from
OpenBSD?

2) There are 16 additional GPIO on a header, via the Nuvoton
NCT5104D chip on the LPC bus. I've seen a few patches circulating
that mentions gpio and the wbsio(4) driver but I could not figure
out if anything has been committed or not.

3) There is a simple watchdog timer in the NCT5104D that can be
connected to the reset line. Would this be implemented? I'm not
sure it's really useful, I assume there's an integrated watchdog
in the CPU.

Would be interested in hearing from any OpenBSD APUx user who put
these to good use!

// Anders

  >


Re: proting hammer2fs

2023-11-11 Thread Stuart Henderson
On 2023-11-11, hammer2_zfs  wrote:

sigh, not this again

There's no point in people pointing at repos where the authors are
clearly uninterested in OpenBSD hoping that somebody else (who probably
won't have deep knowledge of the code involved on at least one side or
the other) will do the work.

> the other type hammer2 ports created by bradla.
> [ https://github.com/bradla/OpenBSD-Hammer2 ]
>
> bradia's version:
> could run:
> /sbin/newfs_hammer2 - seems to work...
> /sbin/hammer2 - seems to work
>
> have problem:
> /sbin/mount_hammer2 - using this on a valid hammer2 filesystem will crash 
> OpenBSD
> sys/hammer2 - vfs layer needs a lot of work

Also: dead since 2014.

> Wouldn't combining these two versions work perfectly?

no.




Re: Pimp my APU

2023-11-11 Thread Stuart Henderson
On 2023-11-10, Anders Andersson  wrote:
> I'm running OpenBSD on my (recently EOL) APU4 and I'm wondering how
> much of the "extra" hardware is expected to work on OpenBSD.
>
> 1) On the back of the board is a button "S1" and three status LEDs,
> The documentation says they are handled by the AMD FCH south bridge.
> Is there a way to control these in software from OpenBSD?

see gpio(4), gpioctl(8). you need to assign pins in rc.securelevel
and can then control them after boot.

while you're figuring out how to set it up in the first place, you might
want to temporarily set kern.securelevel=-1 in sysctl.conf.

> 2) There are 16 additional GPIO on a header, via the Nuvoton NCT5104D
> chip on the LPC bus. I've seen a few patches circulating that mentions
> gpio and the wbsio(4) driver but I could not figure out if anything
> has been committed or not.

AFAIK no:

DESCRIPTION
 The wbsio driver provides support for the Winbond LPC Super I/O ICs.
 Only the hardware monitoring function is currently supported.

> 3) There is a simple watchdog timer in the NCT5104D that can be
> connected to the reset line. Would this be implemented?

also AFAIK no.

wbsio(4) has code to probe for the device these days so it's unlikely
to be difficult for someone with an interest in such a thing to add
support for watchdog and/or gpio. Look at other superio drivers which
already have this functionality, in particular look at cvs history
from when it was added. As far as device driver coding goes, adding
GPIO/sensors/watchdog support to an existing driver for a device with
an available datasheet is fairly straightforward and doesn't need deep
coding skills.

>  Would this be implemented? I'm not sure
> it's really useful, I assume there's an integrated watchdog in the
> CPU.

I don't think there's a watchdog in the cpu either.

While I've used watchdogs in the past, my feeling is that they're not
really a good fit for using with standard OpenBSD. OK so the machine
reboots, but then what? You're probably going to hit an unclean
filesystem (and if you're unlucky, it'll trigger during kernel relinking
which takes place in the background - after watchdogd has started -
which is both a time when it's more likely to happen as there's often
memory pressure, and a time when filesystems are seeing more activity
than usual). They seem better suited to a non-standard installation
which avoids RW disk mounts.


-- 
Please keep replies on the mailing list.



Re: pf logging in ascii and send to remote syslog

2023-11-11 Thread Peter N. M. Hansteen
On Fri, Nov 10, 2023 at 08:23:54PM +0100, Hrvoje Popovski wrote:
> what would be best way to log pf logs in ascii and sent it to remote
> syslog ? I'm aware of pflow but I need ascii pf logs on remote syslog
> server.

something like the good old 
https://home.nuug.no/~peter/pf/newest/log2syslog.html
should still work, I think.

- Peter


-- 
Peter N. M. Hansteen, member of the first RFC 1149 implementation team
https://bsdly.blogspot.com/ https://www.bsdly.net/ https://www.nuug.no/
"Remember to set the evil bit on all malicious network traffic"
delilah spamd[29949]: 85.152.224.147: disconnected after 42673 seconds.



Re: pf logging in ascii and send to remote syslog

2023-11-11 Thread Stuart Henderson
On 2023-11-11, Peter N. M. Hansteen  wrote:
> On Fri, Nov 10, 2023 at 08:23:54PM +0100, Hrvoje Popovski wrote:
>> what would be best way to log pf logs in ascii and sent it to remote
>> syslog ? I'm aware of pflow but I need ascii pf logs on remote syslog
>> server.
>
> something like the good old 
> https://home.nuug.no/~peter/pf/newest/log2syslog.html
> should still work, I think.

Or 
https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/www/faq/pf/logging.html?rev=1.68#syslog

If you don't need _all_ pf logs converting to syslog, you can create a
separate interface "echo up | doas tee /etc/hostname.pflog1" and use
"log to pflog1" on selected rules.



Re: Pimp my APU

2023-11-11 Thread Lucas Gabriel Vuotto
On Sat, Nov 11, 2023 at 10:42:22AM -, Stuart Henderson wrote:
> > 3) There is a simple watchdog timer in the NCT5104D that can be
> > connected to the reset line. Would this be implemented?
> 
> also AFAIK no.
> 
> wbsio(4) has code to probe for the device these days so it's unlikely
> to be difficult for someone with an interest in such a thing to add
> support for watchdog and/or gpio. Look at other superio drivers which
> already have this functionality, in particular look at cvs history
> from when it was added. As far as device driver coding goes, adding
> GPIO/sensors/watchdog support to an existing driver for a device with
> an available datasheet is fairly straightforward and doesn't need deep
> coding skills.

There is https://marc.info/?l=openbsd-tech&m=158113851919238&w=2 from
2020.



Re: Pimp my APU

2023-11-11 Thread Stuart Henderson
On 2023/11/11 11:31, Lucas Gabriel Vuotto wrote:
> On Sat, Nov 11, 2023 at 10:42:22AM -, Stuart Henderson wrote:
> > > 3) There is a simple watchdog timer in the NCT5104D that can be
> > > connected to the reset line. Would this be implemented?
> > 
> > also AFAIK no.
> > 
> > wbsio(4) has code to probe for the device these days so it's unlikely
> > to be difficult for someone with an interest in such a thing to add
> > support for watchdog and/or gpio. Look at other superio drivers which
> > already have this functionality, in particular look at cvs history
> > from when it was added. As far as device driver coding goes, adding
> > GPIO/sensors/watchdog support to an existing driver for a device with
> > an available datasheet is fairly straightforward and doesn't need deep
> > coding skills.
> 
> There is https://marc.info/?l=openbsd-tech&m=158113851919238&w=2 from
> 2020.

Ah that's in a different device - the FCH is in the SoC (system-on-chip)
used in the APU - so the same IC that also contains the CPU, but not
part of the CPU itself.

That looks not too far from being ready, but see Claudio's comments in
the reply.



Re: pf logging in ascii and send to remote syslog

2023-11-11 Thread Hrvoje Popovski
On 11.11.2023. 12:13, Stuart Henderson wrote:
> On 2023-11-11, Peter N. M. Hansteen  wrote:
>> On Fri, Nov 10, 2023 at 08:23:54PM +0100, Hrvoje Popovski wrote:
>>> what would be best way to log pf logs in ascii and sent it to remote
>>> syslog ? I'm aware of pflow but I need ascii pf logs on remote syslog
>>> server.
>>
>> something like the good old 
>> https://home.nuug.no/~peter/pf/newest/log2syslog.html
>> should still work, I think.
> 
> Or 
> https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/www/faq/pf/logging.html?rev=1.68#syslog
> 
> If you don't need _all_ pf logs converting to syslog, you can create a
> separate interface "echo up | doas tee /etc/hostname.pflog1" and use
> "log to pflog1" on selected rules.
> 


Thank you Peter and Stuart that's exactly what I need ...



Re: pf logging in ascii and send to remote syslog

2023-11-11 Thread Daniele B.


"Peter N. M. Hansteen" wrote:

> something like the good old
> https://home.nuug.no/~peter/pf/newest/log2syslog.html should still
> work, I think.
> 
> - Peter


To disable pflogd completely what to you consider best:

ifconfig pflog0 down

or 

pflogd_flags="-f /dev/null"


= Daniele Bonini



Re: pf logging in ascii and send to remote syslog

2023-11-11 Thread Zé Loff
On Sat, Nov 11, 2023 at 06:32:26PM +0100, Daniele B. wrote:
> 
> "Peter N. M. Hansteen" wrote:
> 
> > something like the good old
> > https://home.nuug.no/~peter/pf/newest/log2syslog.html should still
> > work, I think.
> > 
> > - Peter
> 
> 
> To disable pflogd completely what to you consider best:
> 
> ifconfig pflog0 down
> 
> or 
> 
> pflogd_flags="-f /dev/null"
> 
> 
> = Daniele Bonini
> 

rcctl disable pflogd ?

-- 
 



7.3 to 7.4 upgrade: broken X11 in QEMU on M1 Mac

2023-11-11 Thread Nathan Wallace
I have a virtual machine in UTM (which is a MacOS app that provides a
GUI to manage QEMU virtual machines) on my M1 Mac. This VM was running
7.3 and X11 was working fine with the "virtio-ramfb" video card, but
after using `sysupgrade` to upgrade to 7.4, it stopped working
(`startx` just leads to a blank screen). Here's the dmesg from 7.4,
and the Xorg log:

obsd-qemu$ dmesg
OpenBSD 7.4 (GENERIC.MP) #2273: Tue Oct 10 09:45:06 MDT 2023
dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 4285415424 (4086MB)
avail mem = 4071952384 (3883MB)
random: good seed from bootblocks
mainbus0 at root: ACPI
psci0 at mainbus0: PSCI 1.1
efi0 at mainbus0: UEFI 2.7
efi0: EDK II rev 0x1
smbios0 at efi0: SMBIOS 3.0.0
smbios0:
smbios0: QEMU QEMU Virtual Machine
cpu0 at mainbus0 mpidr 0: Unknown, MIDR 0x0
cpu0: 192KB 64b/line 6-way L1 PIPT I-cache, 128KB 64b/line 8-way L1 D-cache
cpu0: 12288KB 128b/line 12-way L2 cache
cpu0: 
TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+PAC,DPB,SpecSEI,PAN+ATS1E1,LO,HPDS,CSV3,CSV2,DIT
cpu1 at mainbus0 mpidr 1: Unknown, MIDR 0x0
cpu1: 192KB 64b/line 6-way L1 PIPT I-cache, 128KB 64b/line 8-way L1 D-cache
cpu1: 12288KB 128b/line 12-way L2 cache
cpu1: 
TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+PAC,DPB,SpecSEI,PAN+ATS1E1,LO,HPDS,CSV3,CSV2,DIT
cpu2 at mainbus0 mpidr 2: Unknown, MIDR 0x0
cpu2: 192KB 64b/line 6-way L1 PIPT I-cache, 128KB 64b/line 8-way L1 D-cache
cpu2: 12288KB 128b/line 12-way L2 cache
cpu2: 
TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+PAC,DPB,SpecSEI,PAN+ATS1E1,LO,HPDS,CSV3,CSV2,DIT
cpu3 at mainbus0 mpidr 3: Unknown, MIDR 0x0
cpu3: 192KB 64b/line 6-way L1 PIPT I-cache, 128KB 64b/line 8-way L1 D-cache
cpu3: 12288KB 128b/line 12-way L2 cache
cpu3: 
TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+PAC,DPB,SpecSEI,PAN+ATS1E1,LO,HPDS,CSV3,CSV2,DIT
apm0 at mainbus0
ampintc0 at mainbus0 nirq 288, ncpu 4 ipi: 0, 1, 2: "interrupt-controller"
ampintcmsi0 at ampintc0: nspi 64
agtimer0 at mainbus0: 24000 kHz
acpi0 at mainbus0: ACPI 6.0
acpi0: sleep states
acpi0: tables DSDT FACP APIC PPTT GTDT MCFG SPCR DBG2 IORT BGRT
acpi0: wakeup devices
acpimcfg0 at acpi0
acpimcfg0: addr 0x401000, bus 0-255
acpiiort0 at acpi0
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
pluart0 at acpi0 COM0 addr 0x900/0x1000 irq 33
pluart0: console
"QEMU0002" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
"LNRO0005" at acpi0 not configured
acpipci0 at acpi0 PCI0
pci0 at acpipci0
0:1:0: rom address conflict 0xfffc/0x4
"Red Hat Host" rev 0x00 at pci0 dev 0 function 0 not configured
virtio0 at pci0 dev 1 function 0 "Qumranet Virtio Network" rev 0x00
vio0 at virtio0: address b2:ea:c3:eb:b9:11
virtio0: msix per-VQ
virtio1 at pci0 dev 2 function 0 "Qumranet Virtio 1.x GPU" rev 0x01
viogpu0 at virtio1: 1280x800, 32bpp
wsdisplay0 at viogpu0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
virtio1: msix per-VQ
azalia0 at pci0 dev 3 function 0 "Intel 82801FB HD Audio" rev 0x01: msi
azalia0: No codecs found
xhci0 at pci0 dev 4 function 0 "NEC xHCI" rev 0x03: msix, xHCI 0.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "NEC xHCI root hub" rev
3.00/1.00 addr 1
xhci1 at pci0 dev 5 function 0 vendor "Red Hat", unknown product
0x000d rev 0x01: msix, xHCI 0.0
usb1 at xhci1: USB revision 3.0
uhub1 at usb1 configuration 1 interface 0 "Red Hat xHCI root hub" rev
3.00/1.00 addr 1
virtio2 at pci0 dev 6 function 0 "Qumranet Virtio Storage" rev 0x00
vioblk0 at

Re: pf logging in ascii and send to remote syslog

2023-11-11 Thread Daniele B.
Thnx, this seems toasting better..




Logging daemon message in a specific file

2023-11-11 Thread Mik J
Hello,
I would like to log isakmpd and unbound messages in a specific file but I don't 
want them to be logged in messages or daemon.
1) With this first method, the messages are logged in their files but also in 
messages and I don't want them to be logged in messages: I find many queries 
and isakmpd logs in messages

!isakmpd
daemon.*    /var/log/isakmpd.log

!unbound
daemon.*    
/var/unbound/var/queries.log
*.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none /var/log/messages
kern.debug;syslog,user.info /var/log/messages



2) With this second method, the messages are logged in their files but not in 
messages. So I'm happy the way it behaves for isakmpd and unbound because it's 
logged in their files and not in messages.The problem is that any other message 
are not logged in messages. No more syslogs are added to messages.

!!isakmpd
daemon.*    /var/log/isakmpd.log

!!unbound
daemon.*    
/var/unbound/var/queries.log
*.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none /var/log/messages
kern.debug;syslog,user.info /var/log/messages
How can I first filter syslogs so they can be logged in a specific log and 
everything that doesn't match would end in messages.That second solution should 
have done that but it doesn't.
Regards


Re: Logging daemon message in a specific file

2023-11-11 Thread Rosen Iliev

Hello,

man syslog.conf is your friend.

/!!prog/ causes the subsequent block to abort evaluation when a message 
matches, ensuring that only a single set of actions is taken. /!*/ 
 can be used to ensure that 
any ensuing blocks are further evaluated (i.e. cancelling the effect of 
a /!prog/ or /!!prog/).


Regards,

Rosen

On 11/11/2023 20:37, Mik J wrote:

Hello,
I would like to log isakmpd and unbound messages in a specific file but I don't 
want them to be logged in messages or daemon.
1) With this first method, the messages are logged in their files but also in 
messages and I don't want them to be logged in messages: I find many queries 
and isakmpd logs in messages

!isakmpd
daemon.*    /var/log/isakmpd.log

!unbound
daemon.*    
/var/unbound/var/queries.log
*.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none /var/log/messages
kern.debug;syslog,user.info /var/log/messages



2) With this second method, the messages are logged in their files but not in 
messages. So I'm happy the way it behaves for isakmpd and unbound because it's 
logged in their files and not in messages.The problem is that any other message 
are not logged in messages. No more syslogs are added to messages.

!!isakmpd
daemon.*    /var/log/isakmpd.log

!!unbound
daemon.*    
/var/unbound/var/queries.log
*.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none /var/log/messages
kern.debug;syslog,user.info /var/log/messages
How can I first filter syslogs so they can be logged in a specific log and 
everything that doesn't match would end in messages.That second solution should 
have done that but it doesn't.
Regards