Allow comments in /etc/bsd.re-config

2022-10-20 Thread Lyndon Nerenberg (VE7TFX/VE6BBM)
It would be handy if bsd.re-config allowed comments so
we can annotate why we're frobbing those kernel settings
(and to allow version control headers).  Diff attached.

--lyndon
Index: ukcutil.c
===
RCS file: /cvs/src/usr.sbin/config/ukcutil.c,v
retrieving revision 1.26
diff -u -r1.26 ukcutil.c
--- ukcutil.c   20 Nov 2021 03:13:37 -  1.26
+++ ukcutil.c   21 Oct 2022 03:29:22 -
@@ -1319,9 +1319,12 @@
}
ask_cmd();
 
-   if (cmd.cmd[0] == '\0') {
+   switch (cmd.cmd[0]) {
+   case 0:
if (cmdfile != NULL)
return 1;
+   goto again;
+   case '#':
goto again;
}
for (i = 0; cmd_table[i].cmd != NULL; i++)


acpisbs: constify battery check table

2022-10-20 Thread Klemens Nanni
Another global that can go to .rodata:
8227fec0 g O .data  0420 acpisbs_battery_checks

Builds fine on amd64, but I don't have access to this hardware.

Tests? OK?

diff --git a/sys/dev/acpi/acpisbs.c b/sys/dev/acpi/acpisbs.c
index 7fd85860f79..252588da591 100644
--- a/sys/dev/acpi/acpisbs.c
+++ b/sys/dev/acpi/acpisbs.c
@@ -58,7 +58,7 @@
(SMBUS_READ_##kind == SMBUS_READ_BLOCK ? SMBUS_DATA_SIZE : 2), \
#val, senst, sens }
 
-struct acpisbs_battery_check {
+const struct acpisbs_battery_check {
uint8_t mode;
uint8_t command;
size_t  offset;
@@ -230,7 +230,8 @@ acpisbs_read(struct acpisbs_softc *sc)
int i;
 
for (i = 0; i < nitems(acpisbs_battery_checks); i++) {
-   struct acpisbs_battery_check check = acpisbs_battery_checks[i];
+   const struct acpisbs_battery_check check =
+   acpisbs_battery_checks[i];
void *p = (void *)>sc_battery + check.offset;
 
acpi_smbus_read(sc, check.mode, check.command, check.len, p);
@@ -273,7 +274,8 @@ acpisbs_setup_sensors(struct acpisbs_softc *sc)
nitems(acpisbs_battery_checks), M_DEVBUF, M_WAITOK | M_ZERO);
 
for (i = 0; i < nitems(acpisbs_battery_checks); i++) {
-   struct acpisbs_battery_check check = acpisbs_battery_checks[i];
+   const struct acpisbs_battery_check check =
+   acpisbs_battery_checks[i];
 
if (check.sensor_type < 0)
continue;
@@ -301,7 +303,8 @@ acpisbs_refresh_sensors(struct acpisbs_softc *sc)
int i;
 
for (i = 0; i < nitems(acpisbs_battery_checks); i++) {
-   struct acpisbs_battery_check check = acpisbs_battery_checks[i];
+   const struct acpisbs_battery_check check =
+   acpisbs_battery_checks[i];
void *p = (void *)>sc_battery + check.offset;
uint16_t *ival = (uint16_t *)p;
 



Re: macppc hw.power, machdep.lidaction, machdep.pwraction

2022-10-20 Thread George Koehler
On Sun, 16 Oct 2022 18:05:28 +0200
Mark Kettenis  wrote:

> The consensus is that calling prsignal() from interrupt context isn't
> safe.  See dev/fdt/dapmic.c for a way to avoid that.

I put prsignal() in interrupt context after "grep -R 'prsignal.*USR2'"
found other files that might do the same,

arch/arm64/dev/aplsmc.c
  aplmbox_intr -> sc_rx_callback = rtkit_rx_callback -> rtkit_poll
  -> callback = aplsmc_callback -> aplsmc_handle_notification
  -> prsignal
arch/sparc64/dev/power.cpower_intr -> prsignal
arch/sparc64/dev/rtc.c  rtc_intr -> prsignal
arch/sparc64/dev/sbus.c sbus_overtemp -> prsignal
dev/pv/pvbus.c
  virtio_pci_config_intr -> sc_config_change = vmmci_config_change
  -> pvbus_shutdown -> prsignal

I have edited adb.c in this diff to act like dapmic.c and use
task_add(9) to call prsignal() from process context.  (This diff
still has the #if 0 in pm_env_intr; I will delete it.)

Index: arch/macppc/dev/adb.c
===
RCS file: /cvs/src/sys/arch/macppc/dev/adb.c,v
retrieving revision 1.46
diff -u -p -r1.46 adb.c
--- arch/macppc/dev/adb.c   2 Jul 2022 08:50:41 -   1.46
+++ arch/macppc/dev/adb.c   20 Oct 2022 18:29:42 -
@@ -89,6 +89,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -242,6 +243,11 @@ intadb_intr(void *arg);
 void   adb_cuda_autopoll(void);
 void   adb_cuda_fileserver_mode(void);
 
+#ifndef SMALL_KERNEL
+void   adb_shutdown(void *);
+struct task adb_shutdown_task = TASK_INITIALIZER(adb_shutdown, NULL);
+#endif
+
 #ifdef ADB_DEBUG
 /*
  * print_single
@@ -831,6 +837,49 @@ adb_soft_intr(void)
}
 }
 
+#ifndef SMALL_KERNEL
+void
+adb_shutdown(void *arg)
+{
+   extern int allowpowerdown;
+
+   if (allowpowerdown == 1) {
+   allowpowerdown = 0;
+   prsignal(initprocess, SIGUSR2);
+   }
+}
+#endif /* !SMALL_KERNEL */
+
+void
+adb_lid_closed_intr(void)
+{
+#ifndef SMALL_KERNEL
+   switch (lid_action) {
+   case 1:
+   /* Suspend. */
+   break;
+   case 2:
+   /* Hibernate. */
+   break;
+   }
+#endif
+}
+
+void
+adb_power_button_intr(void)
+{
+#ifndef SMALL_KERNEL
+   switch (pwr_action) {
+   case 1:
+   task_add(systq, _shutdown_task);
+   break;
+   case 2:
+   /* Suspend. */
+   break;
+   }
+#endif
+}
+
 
 /*
  * This is my version of the ADBOp routine. It mainly just calls the
@@ -1597,6 +1646,7 @@ adbattach(struct device *parent, struct 
adbHardware = ADB_HW_CUDA;
else if (strcmp(ca->ca_name, "via-pmu") == 0) {
adbHardware = ADB_HW_PMU;
+   pm_in_adbattach(sc->sc_dev.dv_xname);
 
/*
 * Bus reset can take a long time if no adb devices are
Index: arch/macppc/dev/pm_direct.c
===
RCS file: /cvs/src/sys/arch/macppc/dev/pm_direct.c,v
retrieving revision 1.31
diff -u -p -r1.31 pm_direct.c
--- arch/macppc/dev/pm_direct.c 18 Sep 2022 21:36:41 -  1.31
+++ arch/macppc/dev/pm_direct.c 20 Oct 2022 18:29:42 -
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -142,6 +143,9 @@ signed char pm_receive_cmd_type[] = {
  -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
 };
 
+int pm_old_env;
+struct ksensor pm_lid_sens;
+struct ksensordev pm_sensdev;
 
 /*
  * Define the private functions
@@ -161,6 +165,10 @@ intpm_send(u_char);
 void   pm_adb_get_TALK_result(PMData *);
 void   pm_adb_get_ADB_data(PMData *);
 
+void   pm_env_intr(PMData *);
+
+
+extern int hw_power;
 
 /*
  * These variables are in adb_direct.c.
@@ -413,6 +421,21 @@ pmgrop(PMData *pmdata)
return rval;
 }
 
+void
+pm_in_adbattach(const char *devname)
+{
+   /* A PowerBook (including iBook) has a lid. */
+   if (strncmp(hw_prod, "PowerBook", 9) == 0) {
+   strlcpy(pm_sensdev.xname, devname,
+   sizeof(pm_sensdev.xname));
+   strlcpy(pm_lid_sens.desc, "lid open",
+   sizeof(pm_lid_sens.desc));
+   pm_lid_sens.type = SENSOR_INDICATOR;
+   sensor_attach(_sensdev, _lid_sens);
+   sensordev_install(_sensdev);
+   pm_lid_sens.value = 1; /* This is a guess. */
+   }
+}
 
 /*
  * My PM interrupt routine for the PB Duo series and the PB 5XX series
@@ -456,9 +479,11 @@ pm_intr(void)
case 0x16:  /* ADB device event */
case 0x18:
case 0x1e:
-   case PMU_INT_WAKEUP:
pm_adb_get_ADB_data();
break;
+   case PMU_INT_ENVIRONMENT:
+   pm_env_intr();
+   break;
default:
 #ifdef ADB_DEBUG
if (adb_debug)
@@ -664,6 +689,41 @@ pm_adb_get_ADB_data(PMData *pmdata)
 }
 
 void
+pm_env_intr(PMData *pmdata)
+{
+   int env, 

Re: 7.2 miniroot pointed to /pub/OpenBSD/snapshots for sets

2022-10-20 Thread Stuart Henderson
On 2022/10/20 09:44, Heppler, J. Scott wrote:
> I was testing the full setup for a lightweight desktop I posted on
> https://daemonforums.org/showpost.php?p=67677=1
> 
> My downloaded miniroot:
> -rw-r--r--1 jsh   jsh  5832704 Oct 20 08:51 miniroot72.img
> 
> The system had previously been running snapshot, but I had selected
> Install(I) and whole disk GPT(G).  The whole disk should have been
> newly formatted.  /etc/installurl came up as my nearest mirror:
> mirrors.sonic.net which I had previously used for the snapshot install.
> 
> If it's working - sorry for the noise.

For an install (rather than an upgrade) it's not based on what you've
installed on the individual machine before; when install is done
the source URL is sent to ftpinstall.cgi which offers it back via
ftplist.cgi for further installs from the same IP address.

The mechanism for saving the full directory or not is in install.sub
around line 1850.



Re: 7.2 miniroot pointed to /pub/OpenBSD/snapshots for sets

2022-10-20 Thread Heppler, J. Scott

I was testing the full setup for a lightweight desktop I posted on
https://daemonforums.org/showpost.php?p=67677=1

My downloaded miniroot:
-rw-r--r--1 jsh   jsh  5832704 Oct 20 08:51 miniroot72.img

The system had previously been running snapshot, but I had selected
Install(I) and whole disk GPT(G).  The whole disk should have been
newly formatted.  /etc/installurl came up as my nearest mirror:
mirrors.sonic.net which I had previously used for the snapshot install.

If it's working - sorry for the noise.

On Oct 20, 2022: 17:32, Stuart Henderson wrote:

On 2022/10/20 09:05, Heppler, J. Scott wrote:

Using the miniroot img from https://cdn.openbsd.org/pub/OpenBSD/7.2, the
set retrival still points to snapshots.


You (or someone else using the same IP) must have done an install from a
full URL previously rather than picking a mirror from the list.

Check 'ftp -Vo- https://ftplist1.openbsd.org/cgi-bin/ftplist.cgi | head'



--
J. Scott Heppler

Penguin Innovations

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



NOTICE: This e-mail message and any attachments may
contain legally privileged and confidential information intended
solely for the use of the intended recipients. If you are not an
intended recipient, you are hereby notified that you have
received this message in error and any review, dissemination,
distribution, copying, or other unauthorized use of this email
and any attachment is strictly prohibited. If you have received
this email in error, please notify the sender immediately and
delete the message and any attachments from your system.



Re: 7.2 miniroot pointed to /pub/OpenBSD/snapshots for sets

2022-10-20 Thread Stuart Henderson
On 2022/10/20 09:05, Heppler, J. Scott wrote:
> Using the miniroot img from https://cdn.openbsd.org/pub/OpenBSD/7.2, the
> set retrival still points to snapshots.

You (or someone else using the same IP) must have done an install from a
full URL previously rather than picking a mirror from the list.

Check 'ftp -Vo- https://ftplist1.openbsd.org/cgi-bin/ftplist.cgi | head'



Re: 7.2 miniroot pointed to /pub/OpenBSD/snapshots for sets

2022-10-20 Thread Klemens Nanni
On Thu, Oct 20, 2022 at 09:05:42AM -0700, Heppler, J. Scott wrote:
> Using the miniroot img from https://cdn.openbsd.org/pub/OpenBSD/7.2, the
> set retrival still points to snapshots.

Can't confirm, default install points at 7.2/ for me:

$ ftp https://cdn.openbsd.org/pub/OpenBSD/7.2/amd64/miniroot72.img
...

$ cksum miniroot72.img
4172576271 5832704 miniroot72.img

$ vmctl create -s5G 72.img
vmctl: raw imagefile created

$ doas vmctl start -c -Li1 -d miniroot72.img -d 72.img mr72
...
OpenBSD 7.2 (RAMDISK_CD) #725: Tue Sep 27 12:02:48 MDT 2022
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
...
Welcome to the OpenBSD/amd64 7.2 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? i
...
Which network interface do you wish to configure? (or 'done') [vio0] 
IPv4 address for vio0? (or 'autoconf' or 'none') [autoconf] 
IPv6 address for vio0? (or 'autoconf' or 'none') [none] 
...
Location of sets? (disk http nfs or 'done') [http] 
HTTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] 
HTTP Server? (hostname, list#, 'done' or '?') cdn.openbsd.org
Server directory? [pub/OpenBSD/7.2/amd64] 

Select sets by entering a set name, a file name pattern or 'all'. 
De-select
sets by prepending a '-', e.g.: '-game*'. Selected sets are labelled 
'[X]'.
[X] bsd   [X] comp72.tgz[X] xbase72.tgz   [X] 
xserv72.tgz
[X] bsd.rd[X] man72.tgz [X] xshare72.tgz
[X] base72.tgz[X] game72.tgz[X] xfont72.tgz
Set name(s)? (or 'abort' or 'done') [done]



7.2 miniroot pointed to /pub/OpenBSD/snapshots for sets

2022-10-20 Thread Heppler, J. Scott

Using the miniroot img from https://cdn.openbsd.org/pub/OpenBSD/7.2, the
set retrival still points to snapshots.


--
J. Scott Heppler

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



Re: asmc: constify global product table

2022-10-20 Thread Joerg Jung
On Wed, Oct 19, 2022 at 02:39:33PM +, Klemens Nanni wrote:
> Looking at symbols in /bsd .data again for .rodata candidates:
> 82281b70 l O .data  1688 asmc_prods
> 
> amsc(4) never writes, but a const table requires a const softc member:
> 
> 263 for (i = 0; asmc_prods[i].pr_name && !sc->sc_prod; i++)
> 264 if (!strncasecmp(asmc_prods[i].pr_name, hw_prod,
> 265 strlen(asmc_prods[i].pr_name)))
> 266 sc->sc_prod = _prods[i];
> 267 if (!sc->sc_prod)
> 268 return;
> 
> Builds fine on amd64.  I don't have Apple hardware to test:
> 820ce550 l O .rodata1688 asmc_prods
> 
> 
> Feedback? Objection? OK?

Tested and works for me.

ok jung@

 
> Index: dev/acpi/asmc.c
> ===
> RCS file: /cvs/src/sys/dev/acpi/asmc.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 asmc.c
> --- dev/acpi/asmc.c   21 Dec 2021 20:53:46 -  1.4
> +++ dev/acpi/asmc.c   19 Oct 2022 14:10:01 -
> @@ -75,7 +75,7 @@ struct asmc_softc {
>   bus_space_tag_t  sc_iot;
>   bus_space_handle_t   sc_ioh;
>  
> - struct asmc_prod*sc_prod;
> + const struct asmc_prod  *sc_prod;
>   uint8_t  sc_nfans;  /* number of fans */
>   uint8_t  sc_lightlen;   /* light data len */
>   uint8_t  sc_backlight;  /* keyboard backlight value */
> @@ -119,7 +119,7 @@ const char *asmc_hids[] = {
>   "APP0001", NULL
>  };
>  
> -static struct asmc_prod asmc_prods[] = {
> +static const struct asmc_prod asmc_prods[] = {
>   { "MacBookAir", 1, {
>   "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TBXT", "TC0C", "TC0D",
>   "TC0E", "TC0F", "TC0P", "TC1C", "TC1E", "TC2C", "TCFP", "TCGC",
> 



Re: Towards unlocking mmap(2) & munmap(2)

2022-10-20 Thread Martin Pieuchot
On 11/09/22(Sun) 12:26, Martin Pieuchot wrote:
> Diff below adds a minimalist set of assertions to ensure proper locks
> are held in uvm_mapanon() and uvm_unmap_remove() which are the guts of
> mmap(2) for anons and munmap(2).
> 
> Please test it with WITNESS enabled and report back.

New version of the diff that includes a lock/unlock dance  in 
uvm_map_teardown().  While grabbing this lock should not be strictly
necessary because no other reference to the map should exist when the
reaper is holding it, it helps make progress with asserts.  Grabbing
the lock is easy and it can also save us a lot of time if there is any
reference counting bugs (like we've discovered w/ vnode and swapping).

Please test and report back.

Index: uvm/uvm_addr.c
===
RCS file: /cvs/src/sys/uvm/uvm_addr.c,v
retrieving revision 1.31
diff -u -p -r1.31 uvm_addr.c
--- uvm/uvm_addr.c  21 Feb 2022 10:26:20 -  1.31
+++ uvm/uvm_addr.c  20 Oct 2022 14:09:30 -
@@ -416,6 +416,8 @@ uvm_addr_invoke(struct vm_map *map, stru
!(hint >= uaddr->uaddr_minaddr && hint < uaddr->uaddr_maxaddr))
return ENOMEM;
 
+   vm_map_assert_anylock(map);
+
error = (*uaddr->uaddr_functions->uaddr_select)(map, uaddr,
entry_out, addr_out, sz, align, offset, prot, hint);
 
Index: uvm/uvm_fault.c
===
RCS file: /cvs/src/sys/uvm/uvm_fault.c,v
retrieving revision 1.132
diff -u -p -r1.132 uvm_fault.c
--- uvm/uvm_fault.c 31 Aug 2022 01:27:04 -  1.132
+++ uvm/uvm_fault.c 20 Oct 2022 14:09:30 -
@@ -1626,6 +1626,7 @@ uvm_fault_unwire_locked(vm_map_t map, va
struct vm_page *pg;
 
KASSERT((map->flags & VM_MAP_INTRSAFE) == 0);
+   vm_map_assert_anylock(map);
 
/*
 * we assume that the area we are unwiring has actually been wired
Index: uvm/uvm_map.c
===
RCS file: /cvs/src/sys/uvm/uvm_map.c,v
retrieving revision 1.298
diff -u -p -r1.298 uvm_map.c
--- uvm/uvm_map.c   16 Oct 2022 16:16:37 -  1.298
+++ uvm/uvm_map.c   20 Oct 2022 14:09:31 -
@@ -491,6 +491,8 @@ uvmspace_dused(struct vm_map *map, vaddr
vaddr_t stack_begin, stack_end; /* Position of stack. */
 
KASSERT(map->flags & VM_MAP_ISVMSPACE);
+   vm_map_assert_anylock(map);
+
vm = (struct vmspace *)map;
stack_begin = MIN((vaddr_t)vm->vm_maxsaddr, (vaddr_t)vm->vm_minsaddr);
stack_end = MAX((vaddr_t)vm->vm_maxsaddr, (vaddr_t)vm->vm_minsaddr);
@@ -570,6 +572,8 @@ uvm_map_isavail(struct vm_map *map, stru
if (addr + sz < addr)
return 0;
 
+   vm_map_assert_anylock(map);
+
/*
 * Kernel memory above uvm_maxkaddr is considered unavailable.
 */
@@ -1457,6 +1461,8 @@ uvm_map_mkentry(struct vm_map *map, stru
entry->guard = 0;
entry->fspace = 0;
 
+   vm_map_assert_wrlock(map);
+
/* Reset free space in first. */
free = uvm_map_uaddr_e(map, first);
uvm_mapent_free_remove(map, free, first);
@@ -1584,6 +1590,8 @@ boolean_t
 uvm_map_lookup_entry(struct vm_map *map, vaddr_t address,
 struct vm_map_entry **entry)
 {
+   vm_map_assert_anylock(map);
+
*entry = uvm_map_entrybyaddr(>addr, address);
return *entry != NULL && !UVM_ET_ISHOLE(*entry) &&
(*entry)->start <= address && (*entry)->end > address;
@@ -1704,6 +1712,8 @@ uvm_map_is_stack_remappable(struct vm_ma
vaddr_t end = addr + sz;
struct vm_map_entry *first, *iter, *prev = NULL;
 
+   vm_map_assert_anylock(map);
+
if (!uvm_map_lookup_entry(map, addr, )) {
printf("map stack 0x%lx-0x%lx of map %p failed: no mapping\n",
addr, end, map);
@@ -1868,6 +1878,8 @@ uvm_mapent_mkfree(struct vm_map *map, st
vaddr_t  addr;  /* Start of freed range. */
vaddr_t  end;   /* End of freed range. */
 
+   UVM_MAP_REQ_WRITE(map);
+
prev = *prev_ptr;
if (prev == entry)
*prev_ptr = prev = NULL;
@@ -1996,10 +2008,7 @@ uvm_unmap_remove(struct vm_map *map, vad
if (start >= end)
return 0;
 
-   if ((map->flags & VM_MAP_INTRSAFE) == 0)
-   splassert(IPL_NONE);
-   else
-   splassert(IPL_VM);
+   vm_map_assert_wrlock(map);
 
/* Find first affected entry. */
entry = uvm_map_entrybyaddr(>addr, start);
@@ -2526,6 +2535,8 @@ uvm_map_teardown(struct vm_map *map)
 
KASSERT((map->flags & VM_MAP_INTRSAFE) == 0);
 
+   vm_map_lock(map);
+
/* Remove address selectors. */
uvm_addr_destroy(map->uaddr_exe);
map->uaddr_exe = NULL;
@@ -2567,6 +2578,8 @@ uvm_map_teardown(struct vm_map *map)
entry = TAILQ_NEXT(entry, dfree.deadq);
}
 
+   

hyperv(4): ifnetlist read: replace kernel lock with shared net lock

2022-10-20 Thread Klemens Nanni
Looking at users of the global interface list `ifnetlist', drivers like
this read out an IP or MAC address to report to the hypervisor.

None of this modifies any of the fields in the global list, they
iterate over and read from it.

net/if_var.h documents the `if_list' member as kernel lock protected,
but I think this is no longer true -- there are drivers solely relying
on the net lock for it, see vmt(4) or mld6_fasttimeo().

So as a start, treat the exclusive kernel lock for a shared net lock
which currently protects the list.

The current kernel lock was added in 2016 with the initial code in
r1.9 "Handle IP address information requests".

Did I miss anything?

Can somebody run this on a Generation 1 Virtual Machine for me?
I don't have access to HyperV.

diff --git a/sys/dev/pv/hypervic.c b/sys/dev/pv/hypervic.c
index 9c7f70dd96f..02a67c162fc 100644
--- a/sys/dev/pv/hypervic.c
+++ b/sys/dev/pv/hypervic.c
@@ -870,7 +870,7 @@ kvp_get_ip_info(struct hv_kvp *kvp, const uint8_t *mac, 
uint8_t *family,
return (-1);
}
 
-   KERNEL_LOCK();
+   NET_LOCK_SHARED();
s = splnet();
 
TAILQ_FOREACH(ifp, , if_list) {
@@ -879,7 +879,7 @@ kvp_get_ip_info(struct hv_kvp *kvp, const uint8_t *mac, 
uint8_t *family,
}
if (ifp == NULL) {
splx(s);
-   KERNEL_UNLOCK();
+   NET_UNLOCK_SHARED();
return (-1);
}
 
@@ -920,7 +920,7 @@ kvp_get_ip_info(struct hv_kvp *kvp, const uint8_t *mac, 
uint8_t *family,
ifa = ifa6ll;
else {
splx(s);
-   KERNEL_UNLOCK();
+   NET_UNLOCK_SHARED();
return (-1);
}
}
@@ -957,7 +957,7 @@ kvp_get_ip_info(struct hv_kvp *kvp, const uint8_t *mac, 
uint8_t *family,
}
 
splx(s);
-   KERNEL_UNLOCK();
+   NET_UNLOCK_SHARED();
 
return (0);
 }