CVS commit: src/distrib/sets/lists/xdebug

2022-07-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 17 05:51:30 UTC 2022

Modified Files:
src/distrib/sets/lists/xdebug: md.cats

Log Message:
properly mark glint_drv.so.1.debug obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/xdebug/md.cats

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/xdebug/md.cats
diff -u src/distrib/sets/lists/xdebug/md.cats:1.20 src/distrib/sets/lists/xdebug/md.cats:1.21
--- src/distrib/sets/lists/xdebug/md.cats:1.20	Fri Jul 15 10:44:21 2022
+++ src/distrib/sets/lists/xdebug/md.cats	Sun Jul 17 05:51:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: md.cats,v 1.20 2022/07/15 10:44:21 mrg Exp $
+# $NetBSD: md.cats,v 1.21 2022/07/17 05:51:29 mrg Exp $
 ./usr/X11R7/lib/modules/extensions/libcfb32_g.a		xdebug-obsolete	xorg,obsolete
 ./usr/X11R7/lib/modules/extensions/libcfb_g.a		xdebug-obsolete	xorg,obsolete
 ./usr/X11R7/lib/modules/extensions/libdbe_g.a		xdebug-obsolete	xorg,obsolete
@@ -39,7 +39,7 @@
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/cirrus_alpine.so.1.debug	xdebug-obsolete	obsolete
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/cirrus_drv.so.1.debug	xdebug-xf86-video-cirrus-debug		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/cirrus_laguna.so.1.debug	xdebug-obsolete	obsolete
-./usr/libdata/debug/usr/X11R7/lib/modules/drivers/glint_drv.so.1.debug	xdebug-obsolete		xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/glint_drv.so.1.debug	xdebug-obsolete		obsolete
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/i128_drv.so.1.debug	xdebug-xf86-video-i128-debug		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/i740_drv.so.1.debug	xdebug-xf86-video-i740-debug		xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/kbd_drv.so.2.debug	xdebug-xf86-input-keyboard-debug		xorg,debug



CVS commit: src/distrib/sets/lists/xdebug

2022-07-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 17 05:51:30 UTC 2022

Modified Files:
src/distrib/sets/lists/xdebug: md.cats

Log Message:
properly mark glint_drv.so.1.debug obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/xdebug/md.cats

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: xsrc/external/mit/xorg-server/dist/hw

2022-07-16 Thread Izumi Tsutsui
> thanks.  i didn't want to go further than necessary to
> unbreak builds etc, but i did consider this too.

No problem, it's responsibility of the Tier-II maintainer(s)
to adapt MD (DDX) servers to DIX APIs.

Note both Xsun and X68k servers work at least on emulators
(though there is something wrong around the kernel scheduler
 that stops responding..).

---
Izumi Tsutsui


CVS commit: src

2022-07-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 16 22:36:06 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_135.c
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add more details to message about pointer alignment

The previous message 'may cause alignment problem' was not detailed
enough to be actionable, it didn't give the necessary insight to why
lint was complaining at all.

The new message 'increases alignment from 1 to 4' or 'from 2 to 8'
describes the potentially problematic conversion, and together with the
involved type names, it allows an informed decision about whether lint's
warning is warranted or not.

In a typical NetBSD build, this warning is in the top 10.  The number of
these warnings depends on the architecture, it is typically between 800
and 1600.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.474 -r1.475 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.10 src/tests/usr.bin/xlint/lint1/msg_135.c:1.11
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.10	Sat Jun 11 11:52:13 2022
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sat Jul 16 22:36:06 2022
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_135.c,v 1.10 2022/06/11 11:52:13 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.11 2022/07/16 22:36:06 rillig Exp $	*/
 # 3 "msg_135.c"
 
-// Test for message: converting '%s' to '%s' may cause alignment problem [135]
+// Test for message: converting '%s' to '%s' increases alignment from %u to %u [135]
 
 /* lint1-extra-flags: -h */
 
@@ -12,7 +12,7 @@ read_uint(const unsigned short **pp)
 {
 	unsigned val;
 
-	/* expect+1: warning: converting 'pointer to const unsigned short' to 'pointer to const unsigned int' may cause alignment problem [135] */
+	/* expect+1: warning: converting 'pointer to const unsigned short' to 'pointer to const unsigned int' increases alignment from 2 to 4 [135] */
 	val = *(const unsigned *)(*pp);
 	pp += sizeof(unsigned);
 	return val;

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.181 src/usr.bin/xlint/lint1/err.c:1.182
--- src/usr.bin/xlint/lint1/err.c:1.181	Tue Jul  5 22:50:41 2022
+++ src/usr.bin/xlint/lint1/err.c	Sat Jul 16 22:36:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.181 2022/07/05 22:50:41 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.182 2022/07/16 22:36:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: err.c,v 1.181 2022/07/05 22:50:41 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.182 2022/07/16 22:36:06 rillig Exp $");
 #endif
 
 #include 
@@ -190,7 +190,7 @@ static const char *const msgs[] = {
 	"conversion from '%s' to '%s' may lose accuracy",	  /* 132 */
 	"conversion of pointer to '%s' loses bits",		  /* 133 */
 	"conversion of pointer to '%s' may lose bits",		  /* 134 */
-	"converting '%s' to '%s' may cause alignment problem",	  /* 135 */
+	"converting '%s' to '%s' increases alignment from %u to %u",  /* 135 */
 	"cannot do pointer arithmetic on operand of unknown size",/* 136 */
 	"",			/* unused */			  /* 137 */
 	"unknown operand size, op '%s'",			  /* 138 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.474 src/usr.bin/xlint/lint1/tree.c:1.475
--- src/usr.bin/xlint/lint1/tree.c:1.474	Fri Jul  8 21:19:07 2022
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul 16 22:36:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.474 2022/07/08 21:19:07 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.475 2022/07/16 22:36:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.474 2022/07/08 21:19:07 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.475 2022/07/16 22:36:06 rillig Exp $");
 #endif
 
 #include 
@@ -2656,8 +2656,10 @@ convert_pointer_from_pointer(type_t *ntp
 	if (hflag && alignment_in_bits(nstp) > alignment_in_bits(ostp) &&
 	ost != CHAR && ost != UCHAR &&
 	!is_incomplete(ostp)) {
-		/* converting '%s' to '%s' may cause alignment problem */
-		warning(135, type_name(otp), type_name(ntp));
+		/* converting '%s' to '%s' increases alignment ... */
+		warning(135, type_name(otp), type_name(ntp),
+		alignment_in_bits(ostp) / CHAR_SIZE,
+		alignment_in_bits(nstp) / CHAR_SIZE);
 	}
 
 	if (cflag && should_warn_about_pointer_cast(nstp, nst, ostp, ost)) {



CVS commit: src

2022-07-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 16 22:36:06 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_135.c
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add more details to message about pointer alignment

The previous message 'may cause alignment problem' was not detailed
enough to be actionable, it didn't give the necessary insight to why
lint was complaining at all.

The new message 'increases alignment from 1 to 4' or 'from 2 to 8'
describes the potentially problematic conversion, and together with the
involved type names, it allows an informed decision about whether lint's
warning is warranted or not.

In a typical NetBSD build, this warning is in the top 10.  The number of
these warnings depends on the architecture, it is typically between 800
and 1600.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.474 -r1.475 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/xlint/lint1

2022-07-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 16 22:23:38 UTC 2022

Modified Files:
src/usr.bin/xlint/lint1: debug.c

Log Message:
lint: add missing space before func_proto_sym in debug mode


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/debug.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/xlint/lint1

2022-07-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 16 22:23:38 UTC 2022

Modified Files:
src/usr.bin/xlint/lint1: debug.c

Log Message:
lint: add missing space before func_proto_sym in debug mode


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/debug.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.22 src/usr.bin/xlint/lint1/debug.c:1.23
--- src/usr.bin/xlint/lint1/debug.c:1.22	Sun Jul  3 14:15:38 2022
+++ src/usr.bin/xlint/lint1/debug.c	Sat Jul 16 22:23:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.22 2022/07/03 14:15:38 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.23 2022/07/16 22:23:38 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.22 2022/07/03 14:15:38 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.23 2022/07/16 22:23:38 rillig Exp $");
 #endif
 
 #include 
@@ -422,7 +422,7 @@ debug_dinfo(const dinfo_t *d) // NOLINT(
 		d->d_func_def_pos.p_uniq);
 	for (const sym_t *sym = d->d_func_proto_syms;
 	 sym != NULL; sym = sym->s_next)
-		debug_sym("func_proto_sym(", sym, ")");
+		debug_sym(" func_proto_sym(", sym, ")");
 	debug_printf("\n");
 
 	if (d->d_enclosing != NULL) {



CVS commit: src/distrib/sets/lists/xserver

2022-07-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul 16 19:46:51 UTC 2022

Modified Files:
src/distrib/sets/lists/xserver: md.ibmnws md.prep

Log Message:
s3 driver is not available here either.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/distrib/sets/lists/xserver/md.ibmnws
cvs rdiff -u -r1.31 -r1.32 src/distrib/sets/lists/xserver/md.prep

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/xserver

2022-07-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul 16 19:46:51 UTC 2022

Modified Files:
src/distrib/sets/lists/xserver: md.ibmnws md.prep

Log Message:
s3 driver is not available here either.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/distrib/sets/lists/xserver/md.ibmnws
cvs rdiff -u -r1.31 -r1.32 src/distrib/sets/lists/xserver/md.prep

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/xserver/md.ibmnws
diff -u src/distrib/sets/lists/xserver/md.ibmnws:1.15 src/distrib/sets/lists/xserver/md.ibmnws:1.16
--- src/distrib/sets/lists/xserver/md.ibmnws:1.15	Fri Jul 15 04:47:56 2022
+++ src/distrib/sets/lists/xserver/md.ibmnws	Sat Jul 16 19:46:50 2022
@@ -1,4 +1,4 @@
-# $NetBSD: md.ibmnws,v 1.15 2022/07/15 04:47:56 mrg Exp $
+# $NetBSD: md.ibmnws,v 1.16 2022/07/16 19:46:50 mrg Exp $
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/Xorg	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/gtf	xserver-xorg-server-bin	xorg
@@ -9,8 +9,8 @@
 ./usr/X11R7/lib/modules/drivers/kbd_drv.so.2		xserver-xf86-input-keyboard-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/mouse_drv.so		xserver-xf86-input-mouse-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/mouse_drv.so.1		xserver-xf86-input-mouse-drivers	xorg
-./usr/X11R7/lib/modules/drivers/s3_drv.so		xserver-xf86-video-s3-drivers	xorg
-./usr/X11R7/lib/modules/drivers/s3_drv.so.0		xserver-xf86-video-s3-drivers	xorg
+./usr/X11R7/lib/modules/drivers/s3_drv.so		xserver-obsolete	obsolete
+./usr/X11R7/lib/modules/drivers/s3_drv.so.0		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/vga_drv.so		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/vga_drv.so.4		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/ws_drv.so		xserver-xf86-input-ws-drivers	xorg
@@ -92,7 +92,7 @@
 ./usr/X11R7/man/cat4/exa.0xserver-xf86-video-exa-catman	.cat,xorg
 ./usr/X11R7/man/cat4/kbd.0xserver-xf86-input-keyboard-catman	.cat,xorg
 ./usr/X11R7/man/cat4/mousedrv.0xserver-xf86-input-mouse-catman	.cat,xorg
-./usr/X11R7/man/cat4/s3.0xserver-xf86-video-s3-catman	.cat,xorg
+./usr/X11R7/man/cat4/s3.0xserver-obsolete	obsolete
 ./usr/X11R7/man/cat4/vga.0xserver-obsolete	obsolete
 ./usr/X11R7/man/cat4/ws.0xserver-xf86-input-ws-catman	.cat,xorg
 ./usr/X11R7/man/cat5/xorg.conf.0			xserver-xorg-server-catman	.cat,xorg
@@ -102,7 +102,7 @@
 ./usr/X11R7/man/html4/exa.htmlxserver-xf86-video-exa-htmlman	html,xorg
 ./usr/X11R7/man/html4/kbd.htmlxserver-xf86-input-keyboard-htmlman	html,xorg
 ./usr/X11R7/man/html4/mousedrv.html			xserver-xf86-input-mouse-htmlman	html,xorg
-./usr/X11R7/man/html4/s3.htmlxserver-xf86-video-s3-htmlman	html,xorg
+./usr/X11R7/man/html4/s3.htmlxserver-obsolete	obsolete
 ./usr/X11R7/man/html4/vga.htmlxserver-obsolete	obsolete
 ./usr/X11R7/man/html4/ws.htmlxserver-xf86-input-ws-htmlman	html,xorg
 ./usr/X11R7/man/html5/xorg.conf.html			xserver-xorg-server-htmlman	html,xorg
@@ -112,7 +112,7 @@
 ./usr/X11R7/man/man4/exa.4xserver-xf86-video-exa-man	.man,xorg
 ./usr/X11R7/man/man4/kbd.4xserver-xf86-input-keyboard-man	.man,xorg
 ./usr/X11R7/man/man4/mousedrv.4xserver-xf86-input-mouse-man	.man,xorg
-./usr/X11R7/man/man4/s3.4xserver-xf86-video-s3-man	.man,xorg
+./usr/X11R7/man/man4/s3.4xserver-obsolete	obsolete
 ./usr/X11R7/man/man4/vga.4xserver-obsolete	obsolete
 ./usr/X11R7/man/man4/ws.4xserver-xf86-input-ws-man	.man,xorg
 ./usr/X11R7/man/man5/xorg.conf.5			xserver-xorg-server-man	.man,xorg

Index: src/distrib/sets/lists/xserver/md.prep
diff -u src/distrib/sets/lists/xserver/md.prep:1.31 src/distrib/sets/lists/xserver/md.prep:1.32
--- src/distrib/sets/lists/xserver/md.prep:1.31	Fri Jul 15 04:47:56 2022
+++ src/distrib/sets/lists/xserver/md.prep	Sat Jul 16 19:46:50 2022
@@ -1,4 +1,4 @@
-# $NetBSD: md.prep,v 1.31 2022/07/15 04:47:56 mrg Exp $
+# $NetBSD: md.prep,v 1.32 2022/07/16 19:46:50 mrg Exp $
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/Xorg	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/gtf	xserver-xorg-server-bin	xorg
@@ -17,8 +17,8 @@
 ./usr/X11R7/lib/modules/drivers/mga_drv.so.2		xserver-xf86-video-mga-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/mouse_drv.so		xserver-xf86-input-mouse-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/mouse_drv.so.1		xserver-xf86-input-mouse-drivers	xorg
-./usr/X11R7/lib/modules/drivers/s3_drv.so		xserver-xf86-video-s3-drivers	xorg
-./usr/X11R7/lib/modules/drivers/s3_drv.so.0		xserver-xf86-video-s3-drivers	xorg
+./usr/X11R7/lib/modules/drivers/s3_drv.so		xserver-obsolete	obsolete
+./usr/X11R7/lib/modules/drivers/s3_drv.so.0		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/vga_drv.so		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/vga_drv.so.4		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/ws_drv.so		xserver-xf86-input-ws-drivers	xor

CVS commit: src/sbin/gpt

2022-07-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 16 12:57:14 UTC 2022

Modified Files:
src/sbin/gpt: gpt.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/gpt/gpt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/gpt/gpt.h
diff -u src/sbin/gpt/gpt.h:1.42 src/sbin/gpt/gpt.h:1.43
--- src/sbin/gpt/gpt.h:1.42	Sun May 24 18:42:20 2020
+++ src/sbin/gpt/gpt.h	Sat Jul 16 12:57:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.h,v 1.42 2020/05/24 18:42:20 jmcneill Exp $	*/
+/*	$NetBSD: gpt.h,v 1.43 2022/07/16 12:57:14 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2002 Marcel Moolenaar
@@ -85,7 +85,7 @@ gpt_t	gpt_open(const char *, int, int, o
 #define GPT_TIMESTAMP	0x20
 #define GPT_SYNC	0x40
 #define GPT_HYBRID	0x80
-#define GPT_OPTDEV  0x8000
+#define GPT_OPTDEV	0x8000
 
 void*	gpt_read(gpt_t, off_t, size_t);
 off_t	gpt_last(gpt_t);



CVS commit: src/sbin/gpt

2022-07-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 16 12:57:14 UTC 2022

Modified Files:
src/sbin/gpt: gpt.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/gpt/gpt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/wscons

2022-07-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 16 10:57:59 UTC 2022

Modified Files:
src/sys/dev/wscons: wsdisplay_vcons.c

Log Message:
modify screen before updating cache.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/wscons/wsdisplay_vcons.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/wscons/wsdisplay_vcons.c
diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.53 src/sys/dev/wscons/wsdisplay_vcons.c:1.54
--- src/sys/dev/wscons/wsdisplay_vcons.c:1.53	Sun May 16 08:46:38 2021
+++ src/sys/dev/wscons/wsdisplay_vcons.c	Sat Jul 16 10:57:59 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: wsdisplay_vcons.c,v 1.53 2021/05/16 08:46:38 mlelstv Exp $ */
+/*	$NetBSD: wsdisplay_vcons.c,v 1.54 2022/07/16 10:57:59 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2005, 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.53 2021/05/16 08:46:38 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.54 2022/07/16 10:57:59 mlelstv Exp $");
 
 #include 
 #include 
@@ -1003,11 +1003,11 @@ vcons_erasecols_cached(void *cookie, int
 	struct vcons_data *vd = scr->scr_vd;
 	int i, pos = row * ri->ri_cols + startcol;
 
+	vd->erasecols(cookie, row, startcol, ncols, fillattr);
 	for (i = pos; i < ncols; i++) {
-		vd->chars[i] = 0x20;
-		vd->attrs[i] = fillattr;
+		vd->chars[i] = scr->scr_chars[i];
+		vd->attrs[i] = scr->scr_attrs[i];
 	}
-	vd->erasecols(cookie, row, startcol, ncols, fillattr);
 }
 #endif
 



CVS commit: src/sys/dev/wscons

2022-07-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 16 10:57:59 UTC 2022

Modified Files:
src/sys/dev/wscons: wsdisplay_vcons.c

Log Message:
modify screen before updating cache.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/wscons/wsdisplay_vcons.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/vmstat

2022-07-16 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jul 16 10:36:19 UTC 2022

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
When operating on core files or /dev/mem when using the -M option,
use 64-bit math to calculate pool sizes.  Fixes overflow errors for
pools larger than 4GB and gives the correct output with "vmstat -m"
for in use, total allocation and utilisation numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.254 src/usr.bin/vmstat/vmstat.c:1.255
--- src/usr.bin/vmstat/vmstat.c:1.254	Sat Jul 16 09:32:27 2022
+++ src/usr.bin/vmstat/vmstat.c	Sat Jul 16 10:36:19 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.254 2022/07/16 09:32:27 simonb Exp $ */
+/* $NetBSD: vmstat.c,v 1.255 2022/07/16 10:36:19 simonb Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.254 2022/07/16 09:32:27 simonb Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.255 2022/07/16 10:36:19 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -1578,7 +1578,7 @@ dopool(int verbose, int wide)
 {
 	int first, ovflw;
 	void *addr;
-	long total, inuse, this_total, this_inuse;
+	uint64_t total, inuse, this_total, this_inuse;
 	struct {
 		uint64_t pt_nget;
 		uint64_t pt_nfail;
@@ -1674,8 +1674,8 @@ dopool(int verbose, int wide)
 			PRWORD(ovflw, " 0x%0*x", 6, 1,
 			pp->pr_flags | pp->pr_roflags);
 
-		this_inuse = pp->pr_nout * pp->pr_size;
-		this_total = pp->pr_npages * pa.pa_pagesz;
+		this_inuse = (uint64_t)pp->pr_nout * pp->pr_size;
+		this_total = (uint64_t)pp->pr_npages * pa.pa_pagesz;
 		if (pp->pr_roflags & PR_RECURSIVE) {
 			/*
 			 * Don't count in-use memory, since it's part
@@ -1714,7 +1714,8 @@ dopool(int verbose, int wide)
 	inuse /= KILO;
 	total /= KILO;
 	(void)printf(
-	"\nIn use %ldK, total allocated %ldK; utilization %.1f%%\n",
+	"\nIn use %" PRIu64 "K, "
+	"total allocated %" PRIu64 "K; utilization %.1f%%\n",
 	inuse, total, (100.0 * inuse) / total);
 }
 



CVS commit: src/usr.bin/vmstat

2022-07-16 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jul 16 10:36:19 UTC 2022

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
When operating on core files or /dev/mem when using the -M option,
use 64-bit math to calculate pool sizes.  Fixes overflow errors for
pools larger than 4GB and gives the correct output with "vmstat -m"
for in use, total allocation and utilisation numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/kern

2022-07-16 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jul 16 10:20:21 UTC 2022

Modified Files:
src/sys/kern: subr_pool.c

Log Message:
Use 64-bit math to calculate pool sizes.  Fixes overflow errors for
pools larger than 4GB and gives the correct output for kernel pool pages
in "vmstat -s" output.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/kern/subr_pool.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/kern

2022-07-16 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jul 16 10:20:21 UTC 2022

Modified Files:
src/sys/kern: subr_pool.c

Log Message:
Use 64-bit math to calculate pool sizes.  Fixes overflow errors for
pools larger than 4GB and gives the correct output for kernel pool pages
in "vmstat -s" output.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/kern/subr_pool.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.284 src/sys/kern/subr_pool.c:1.285
--- src/sys/kern/subr_pool.c:1.284	Sun May 29 10:47:40 2022
+++ src/sys/kern/subr_pool.c	Sat Jul 16 10:20:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.284 2022/05/29 10:47:40 andvar Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.285 2022/07/16 10:20:21 simonb Exp $	*/
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018,
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.284 2022/05/29 10:47:40 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.285 2022/07/16 10:20:21 simonb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1795,10 +1795,11 @@ pool_totalpages_locked(void)
 	uint64_t total = 0;
 
 	TAILQ_FOREACH(pp, &pool_head, pr_poollist) {
-		uint64_t bytes = pp->pr_npages * pp->pr_alloc->pa_pagesz;
+		uint64_t bytes =
+		(uint64_t)pp->pr_npages * pp->pr_alloc->pa_pagesz;
 
 		if ((pp->pr_roflags & PR_RECURSIVE) != 0)
-			bytes -= (pp->pr_nout * pp->pr_size);
+			bytes -= ((uint64_t)pp->pr_nout * pp->pr_size);
 		total += bytes;
 	}
 



CVS commit: src/usr.bin/vmstat

2022-07-16 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jul 16 09:32:27 UTC 2022

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
Move the call to getnlist() to after we check if kvm_openfiles(3) succeeded.
Avoids a coredump when called with "vmstat -M /dev/mem".


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.253 src/usr.bin/vmstat/vmstat.c:1.254
--- src/usr.bin/vmstat/vmstat.c:1.253	Thu May 19 13:57:03 2022
+++ src/usr.bin/vmstat/vmstat.c	Sat Jul 16 09:32:27 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.253 2022/05/19 13:57:03 simonb Exp $ */
+/* $NetBSD: vmstat.c,v 1.254 2022/07/16 09:32:27 simonb Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.253 2022/05/19 13:57:03 simonb Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.254 2022/07/16 09:32:27 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -422,12 +422,14 @@ main(int argc, char *argv[])
 		kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf);
 	} else {
 		kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
-		getnlist(todo);
 	}
 
 	if (kd == NULL)
 		errx(EXIT_FAILURE, "%s", errbuf);
 
+	if (memf != NULL)
+		getnlist(todo);	/* Only need this if a core is specified. */
+
 	if (todo & VMSTAT) {
 		struct winsize winsize;
 



CVS commit: src/usr.bin/vmstat

2022-07-16 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jul 16 09:32:27 UTC 2022

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
Move the call to getnlist() to after we check if kvm_openfiles(3) succeeded.
Avoids a coredump when called with "vmstat -M /dev/mem".


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:28:39 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc: mfii(4): Support Newer devices up to SAS39{08,16} (Aero).


To generate a diff of this commit:
cvs rdiff -u -r1.2890 -r1.2891 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2890 src/doc/CHANGES:1.2891
--- src/doc/CHANGES:1.2890	Sun Jul 10 19:28:00 2022
+++ src/doc/CHANGES	Sat Jul 16 07:28:39 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2890 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2891 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -623,3 +623,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[yhardy 20220630]
 	installboot(8): Add -u option to set U-Boot search paths.
 		[brook 20220710]
+	mfii(4): Support Newer devices up to SAS39{08,16} (Aero).
+		[msaitoh 20220716]



CVS commit: src/doc

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:28:39 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc: mfii(4): Support Newer devices up to SAS39{08,16} (Aero).


To generate a diff of this commit:
cvs rdiff -u -r1.2890 -r1.2891 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man4

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:25:52 UTC 2022

Modified Files:
src/share/man/man4: mfii.4

Log Message:
Update supported devices.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/mfii.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/mfii.4
diff -u src/share/man/man4/mfii.4:1.2 src/share/man/man4/mfii.4:1.3
--- src/share/man/man4/mfii.4:1.2	Sat Nov 24 20:31:29 2018
+++ src/share/man/man4/mfii.4	Sat Jul 16 07:25:51 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mfii.4,v 1.2 2018/11/24 20:31:29 wiz Exp $
+.\"	$NetBSD: mfii.4,v 1.3 2022/07/16 07:25:51 msaitoh Exp $
 .\"	$OpenBSD: mfii.4,v 1.7 2018/03/27 07:01:42 jsg Exp $
 .\"
 .\" Copyright (c) 2012 David Gwynne 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd March 27, 2018
+.Dd July 16, 2022
 .Dt MFII 4
 .Os
 .Sh NAME
@@ -37,6 +37,14 @@ SAS3008
 .It
 SAS3108
 .It
+SAS3216
+.It
+SAS3224
+.It
+SAS3316
+.It
+SAS3324
+.It
 SAS3404
 .It
 SAS3408
@@ -48,6 +56,10 @@ SAS3504
 SAS3508
 .It
 SAS3516
+.It
+SAS3908
+.It
+SAS3916
 .El
 .Pp
 These controllers support RAID 0, RAID 1, RAID 5, RAID 6, RAID 10, RAID 50 and



CVS commit: src/share/man/man4

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:25:52 UTC 2022

Modified Files:
src/share/man/man4: mfii.4

Log Message:
Update supported devices.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/mfii.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:23:51 UTC 2022

Modified Files:
src/sys/dev/pci: mfii.c

Log Message:
Enable Aero.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mfii.c
diff -u src/sys/dev/pci/mfii.c:1.25 src/sys/dev/pci/mfii.c:1.26
--- src/sys/dev/pci/mfii.c:1.25	Sat Jul 16 07:13:03 2022
+++ src/sys/dev/pci/mfii.c	Sat Jul 16 07:23:51 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfii.c,v 1.25 2022/07/16 07:13:03 msaitoh Exp $ */
+/* $NetBSD: mfii.c,v 1.26 2022/07/16 07:23:51 msaitoh Exp $ */
 /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.25 2022/07/16 07:13:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.26 2022/07/16 07:23:51 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -608,7 +608,6 @@ static const struct mfii_iop mfii_iop_35
 	0
 };
 
-#if 0
 static const struct mfii_iop mfii_iop_aero = {
 	MFII_BAR_35,
 	MFII_IOP_NUM_SGE_LOC_35,
@@ -619,7 +618,6 @@ static const struct mfii_iop mfii_iop_ae
 	MFII_SGE_END_OF_LIST,
 	MFII_IOP_QUIRK_REGREAD | MFII_IOP_HAS_32BITDESC_BIT
 };
-#endif
 
 struct mfii_device {
 	pcireg_t		mpd_vendor;
@@ -663,7 +661,6 @@ static const struct mfii_device mfii_dev
 	/* Harpoon */
 	{ PCI_VENDOR_SYMBIOS,	PCI_PRODUCT_SYMBIOS_MEGARAID_3508,
 	&mfii_iop_35 },
-#if 0
 	/* Aero */
 	{ PCI_VENDOR_SYMBIOS,	PCI_PRODUCT_SYMBIOS_MEGARAID_39XX_2,
 	&mfii_iop_aero },
@@ -673,7 +670,6 @@ static const struct mfii_device mfii_dev
 	&mfii_iop_aero },
 	{ PCI_VENDOR_SYMBIOS,	PCI_PRODUCT_SYMBIOS_MEGARAID_38XX_3,
 	&mfii_iop_aero }
-#endif
 };
 
 static const struct mfii_iop *mfii_find_iop(struct pci_attach_args *);



CVS commit: src/sys/dev/pci

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:23:51 UTC 2022

Modified Files:
src/sys/dev/pci: mfii.c

Log Message:
Enable Aero.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:13:03 UTC 2022

Modified Files:
src/sys/dev/pci: mfii.c

Log Message:
 It seems that a logical volume number and the target ID is different
on newer systems. It's observed on an Aero. Add sc->sc_ld[X].ld_target_id
to keep the target ID and use it for scsipi layer. Now sdX is attached
on Aero system. Tested by Mark Davies.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-07-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jul 16 07:13:03 UTC 2022

Modified Files:
src/sys/dev/pci: mfii.c

Log Message:
 It seems that a logical volume number and the target ID is different
on newer systems. It's observed on an Aero. Add sc->sc_ld[X].ld_target_id
to keep the target ID and use it for scsipi layer. Now sdX is attached
on Aero system. Tested by Mark Davies.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mfii.c
diff -u src/sys/dev/pci/mfii.c:1.24 src/sys/dev/pci/mfii.c:1.25
--- src/sys/dev/pci/mfii.c:1.24	Sat Jul 16 06:52:41 2022
+++ src/sys/dev/pci/mfii.c	Sat Jul 16 07:13:03 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfii.c,v 1.24 2022/07/16 06:52:41 msaitoh Exp $ */
+/* $NetBSD: mfii.c,v 1.25 2022/07/16 07:13:03 msaitoh Exp $ */
 /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.24 2022/07/16 06:52:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.25 2022/07/16 07:13:03 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -355,6 +355,7 @@ struct mfii_softc {
 	struct {
 		bool		ld_present;
 		char		ld_dev[16];	/* device name sd? */
+		int		ld_target_id;
 	}			sc_ld[MFII_MAX_LD_EXT];
 	int			sc_target_lds[MFII_MAX_LD_EXT];
 	bool			sc_max256vd;
@@ -942,6 +943,7 @@ mfii_attach(device_t parent, device_t se
 	for (i = 0; i < sc->sc_ld_list.mll_no_ld; i++) {
 		int target = sc->sc_ld_list.mll_list[i].mll_ld.mld_target;
 		sc->sc_target_lds[target] = i;
+		sc->sc_ld[i].ld_target_id = target;
 	}
 
 	/* enable interrupts */
@@ -1452,6 +1454,7 @@ mfii_aen_ld_update(struct mfii_softc *sc
 		DNPRINTF(MFII_D_MISC, "%s: target %d: state %d\n",
 		DEVNAME(sc), target, sc->sc_ld_list.mll_list[i].mll_state);
 		newlds[target] = i;
+		sc->sc_ld[i].ld_target_id = target;
 	}
 
 	for (i = 0; i < MFII_MAX_LD_EXT; i++) {
@@ -2339,9 +2342,10 @@ mfii_scsi_cmd_io(struct mfii_softc *sc, 
 	struct scsipi_periph *periph = xs->xs_periph;
 	struct mpii_msg_scsi_io *io = ccb->ccb_request;
 	struct mfii_raid_context *ctx = (struct mfii_raid_context *)(io + 1);
-	int segs;
+	int segs, target;
 
-	io->dev_handle = htole16(periph->periph_target);
+	target = sc->sc_ld[periph->periph_target].ld_target_id;
+	io->dev_handle = htole16(target);
 	io->function = MFII_FUNCTION_LDIO_REQUEST;
 	io->sense_buffer_low_address = htole32(ccb->ccb_sense_dva);
 	io->sgl_flags = htole16(0x02); /* XXX */
@@ -2368,7 +2372,7 @@ mfii_scsi_cmd_io(struct mfii_softc *sc, 
 	ctx->type_nseg = sc->sc_iop->ldio_ctx_type_nseg;
 	ctx->timeout_value = htole16(0x14); /* XXX */
 	ctx->reg_lock_flags = htole16(sc->sc_iop->ldio_ctx_reg_lock_flags);
-	ctx->virtual_disk_target_id = htole16(periph->periph_target);
+	ctx->virtual_disk_target_id = htole16(target);
 
 	if (mfii_load_ccb(sc, ccb, ctx + 1,
 	ISSET(xs->xs_control, XS_CTL_NOSLEEP)) != 0)
@@ -2399,8 +2403,10 @@ mfii_scsi_cmd_cdb(struct mfii_softc *sc,
 	struct scsipi_periph *periph = xs->xs_periph;
 	struct mpii_msg_scsi_io *io = ccb->ccb_request;
 	struct mfii_raid_context *ctx = (struct mfii_raid_context *)(io + 1);
+	int target;
 
-	io->dev_handle = htole16(periph->periph_target);
+	target = sc->sc_ld[periph->periph_target].ld_target_id;
+	io->dev_handle = htole16(target);
 	io->function = MFII_FUNCTION_LDIO_REQUEST;
 	io->sense_buffer_low_address = htole32(ccb->ccb_sense_dva);
 	io->sgl_flags = htole16(0x02); /* XXX */
@@ -2425,7 +2431,7 @@ mfii_scsi_cmd_cdb(struct mfii_softc *sc,
 	}
 	memcpy(io->cdb, xs->cmd, xs->cmdlen);
 
-	ctx->virtual_disk_target_id = htole16(periph->periph_target);
+	ctx->virtual_disk_target_id = htole16(target);
 
 	if (mfii_load_ccb(sc, ccb, ctx + 1,
 	ISSET(xs->xs_control, XS_CTL_NOSLEEP)) != 0)