fix "_nfiles" references for crash dump

2018-09-03 Thread Naoki Fukaumi
hi tech@, "_nfiles" was renamed to "_numfiles" by this commit, https://marc.info/?l=openbsd-cvs&m=147199491615345&w=2 then fstat/pstat put following errors, # fstat -M bsd.0.core -N bsd.0 fstat: _nfiles: no such symbol # pstat -f -M bsd.0.core -N bsd.0 pstat: kvm_getfiles: _nfiles: no such

iostat: add "sp" column for CP_SPIN

2018-09-03 Thread Naoki Fukaumi
hi tech@, new cpu state, CP_SPIN, was added, https://marc.info/?l=openbsd-cvs&m=152630109526317&w=2 but there is no column for it in the header of iostat, $ iostat tty sd0 cpu tin tout KB/t t/s MB/s us ni sy in id 01 11.473 0.04 0 0 0 0 0100

amd64: update PTDpaddr with new PA of PML4 for libkvm

2019-02-13 Thread Naoki Fukaumi
Hi Mike Larkin, since pmap_kernel is randomized, savecore(libkvm) cannot save core dump from dump device. (savecore: magic number mismatch) updating PTDpaddr fixes this issue. by the way, is there any problem to use proc0.p_addr->u_pcb.pcb_cr3 instead of PTDpaddr in cpu_dump()? -- FUKAUMI Naoki

Re: amd64: update PTDpaddr with new PA of PML4 for libkvm

2019-02-13 Thread Naoki Fukaumi
Hi, From: Mike Larkin Subject: Re: amd64: update PTDpaddr with new PA of PML4 for libkvm Date: Wed, 13 Feb 2019 01:01:28 -0800 > On Wed, Feb 13, 2019 at 05:40:45PM +0900, Naoki Fukaumi wrote: >> Hi Mike Larkin, >> >> since pmap_kernel is randomized, savecore(libkvm) can

Re: amd64: update PTDpaddr with new PA of PML4 for libkvm

2019-02-14 Thread Naoki Fukaumi
Hi, From: Mike Larkin Subject: Re: amd64: update PTDpaddr with new PA of PML4 for libkvm Date: Wed, 13 Feb 2019 01:01:28 -0800 > On Wed, Feb 13, 2019 at 05:40:45PM +0900, Naoki Fukaumi wrote: >> Hi Mike Larkin, >> >> since pmap_kernel is randomized, savecore(libkvm) can

fix kvm(3) support for netstat -r

2019-03-13 Thread Naoki Fukaumi
hi tech@, netstat -r with -A/-M (which uses kvm(3)) was broken since in-kernel routing table implementation was changed to ART-based. this patch adds support for ART-based implementation in netstat. kernel and src build ok. by the way, is "netstat -r with -A on live system" really needed? it ne

watchdog(4): limit watchdog period

2019-06-07 Thread Naoki Fukaumi
hi tech@, setting kern.watchdog.period to negative value is currently allowed, but many watchdog device drivers don't handle it properly. it will enable timer with uninteded period without auto refreshing, so machine will be rebooted at some point. some drivers handle negative value, but results

ipmi(4): limit watchdog period

2019-06-07 Thread Naoki Fukaumi
hi tech@, here is patch for ipmi(4). watchdog timer on ipmi(4) is 16bit, and unit is 100ms. round down a value greater than (UINT16_MAX / 10) to the maximum value. -- FUKAUMI Naoki Index: sys/dev/ipmi.c === RCS file: /cvs/src/sys/d

ipmi(4): don't block interrupts/systq long time

2019-06-07 Thread Naoki Fukaumi
hi tech@, here is another patch for another issue for ipmi(4). ipmi_sendcmd() and ipmi_recvcmd() are always called in order/pairs as a single task of a single-threaded taskq, remove mutex from there. this avoids interrupts blocked long time. task for watchdog can be long lived, use own taskq ins

Re: ipmi(4): don't block interrupts/systq long time

2019-06-09 Thread Naoki Fukaumi
hi patrick keshishian, From: patrick keshishian Subject: Re: ipmi(4): don't block interrupts/systq long time Date: Fri, 7 Jun 2019 19:24:15 -0700 >> Index: sys/dev/ipmi.c >> === >> RCS file: /cvs/src/sys/dev/ipmi.c,v >> retrieving r

mfii(4): use MFII_FUNCTION_PASSTHRU_IO for MFI commands

2018-03-05 Thread Naoki Fukaumi
Hi tech@, while trying to add bio(4) support to mfii(4), we noticed that SAS2208 based card with cache memory hangs on boot. https://marc.info/?t=14773842861&r=1&w=2 after investigation, we made conclusion that MPII SCSI PASSTHRU feature need to be used for sending MFI commands (such as DCMD

mfii(4): add bio(4) support

2018-03-05 Thread Naoki Fukaumi
Hi tech@, This patch adds bio(4) support for mfii(4). # with "mfii(4): use MFII_FUNCTION_PASSTHRU_IO for MFI commands" most parts are taken from mfi(4), plus fix for rebuilding (bioctl -R). --- sys/dev/ic/mfireg.h +++ sys/dev/ic/mfireg.h @@ -139,6 +139,9 @@ #define MR_DCMD_CONF_GET

Re: mfii(4): add bio(4) support

2018-03-05 Thread Naoki Fukaumi
Hi, From: YASUOKA Masahiko Subject: Re: mfii(4): add bio(4) support Date: Tue, 06 Mar 2018 08:14:44 +0900 (JST) >> most parts are taken from mfi(4), plus fix for rebuilding (bioctl -R). > > Do I understand the rebuilding problem correctly? > > - mfii_makegood() and mfii_makespare() are added b

ipmi(4): don't panic if ipmi_sendcmd() fails

2018-03-05 Thread Naoki Fukaumi
Hi tech@, sending IPMI command can fail for some reason (e.g. during BMC reset, and possibly BMC is just busy?), then it should be better to return error than panic(). --- sys/dev/ipmi.c +++ sys/dev/ipmi.c @@ -1039,10 +1039,10 @@ ipmi_cmd_poll(struct ipmi_cmd *c) { mtx_enter(&c->c_sc->sc

workaround for buggy bios_memmap?

2018-03-05 Thread Naoki Fukaumi
Hi tech@, I'm using FreeBSD bhyve to run OpenBSD/amd64 VM for testing biosboot. (well, I know efiboot works fine on bhyve, but I want to try biosboot) it seems bhyve's BIOS has buggy(?) entry in bios_memmap(E820 table). >> OpenBSD/amd64 BOOT 3.34 boot> m m Region 0: type 1 at 0x0 for 639KB

Re: workaround for buggy bios_memmap?

2018-03-06 Thread Naoki Fukaumi
Hi, From: Mike Larkin Subject: Re: workaround for buggy bios_memmap? Date: Mon, 5 Mar 2018 23:41:23 -0800 >> is there any better workaround/idea to solve this issue? >> > > maybe report it upstream to bhyve if you think this really is a bhyve issue? well, yes, bhyve issue should be reported t

Re: mfii(4): add bio(4) support

2018-03-08 Thread Naoki Fukaumi
Hi, thank you for your feedback! From: Jonathan Matthew Subject: Re: mfii(4): add bio(4) support Date: Thu, 8 Mar 2018 19:18:28 +1000 > On Mon, Mar 05, 2018 at 09:49:16PM +0900, Naoki Fukaumi wrote: >> Hi tech@, >> >> This patch adds bio(4) support for mfii(4). &g

Re: mfii(4): add bio(4) support

2018-03-18 Thread Naoki Fukaumi
Hi, thank you for committing (part of) fixes. From: Jonathan Matthew Subject: Re: mfii(4): add bio(4) support Date: Mon, 12 Mar 2018 12:06:31 +1000 > On Mon, Mar 05, 2018 at 09:49:16PM +0900, Naoki Fukaumi wrote: >> Hi tech@, >> >> This patch adds bio(4) support for mfii(

Re: mfii(4): add bio(4) support

2018-03-18 Thread Naoki Fukaumi
Hi, about BBU detection, From: Jonathan Matthew Subject: Re: mfii(4): add bio(4) support Date: Thu, 8 Mar 2018 21:56:53 +1000 >> > I also don't get a sensor for the battery. I haven't looked into this yet. >> > Any idea why that would happen? >> >> could you try following (only 1st hunk, only

Re: mfii(4): use MFII_FUNCTION_PASSTHRU_IO for MFI commands

2018-05-14 Thread Naoki Fukaumi
Hi Jonathan Matthew, here is updated patch. could you review it? while trying to add bio(4) support to mfii(4), we noticed that SAS2208 based card with cache memory hangs on boot. https://marc.info/?t=14773842861&r=1&w=2 after investigation, we made conclusion that MPII SCSI PASSTHRU

Re: mfii(4): add bio(4) support

2018-05-14 Thread Naoki Fukaumi
Hi Jonathan Matthew, here is updated patch. could you review it? This patch adds bio(4) support for mfii(4). from mfi(4) with following addition/fixes, * make "bioctl -R" work after hot swapping Currently "bioctl -R" works only if disk state is "Offline" (set by "bioctl -O") and it doesn

Re: mfii(4): add bio(4) support

2018-05-17 Thread Naoki Fukaumi
Hi, From: Jonathan Matthew Subject: Re: mfii(4): add bio(4) support Date: Fri, 18 May 2018 15:30:31 +1000 > On 15/05/18 14:13, Naoki Fukaumi wrote: >> Hi Jonathan Matthew, >> here is updated patch. could you review it? > > I've just committed a series of changes base

Re: mfi(4): Make "bioctl -R" work after hot swapping

2018-06-04 Thread Naoki Fukaumi
Hi Jonathan Matthew, From: YASUOKA Masahiko Subject: Re: mfi(4): Make "bioctl -R" work after hot swapping Date: Tue, 24 Apr 2018 20:20:40 +0900 (JST) > On Thu, 29 Jun 2017 17:14:41 +0900 (JST) > FUKAUMI Naoki wrote: >> Currently "bioctl -R" works only if disk state is "Offline" (set by >> "bioc

ipmi(4): fix panic() with witness(4)

2018-06-14 Thread Naoki Fukaumi
Hi tech@, ipmi(4) enabled -current kernel gets following panic() on boot, panic: acquiring blockable sleep lock with spinlock or critical section held (kernel_lock) &kernel_lock @ /home/fukaumi/src/sys/arch/amd64/amd64/intr.c:525 Stopped at db_enter+0x12: popq%r11 TIDPIDUID