svn commit: r248513 - in projects/efika_mx: etc/mtree etc/rc.d lib/libc/sys lib/libvmmapi sbin/geom/class/eli sbin/ldconfig share/examples share/examples/bhyve share/man/man4 sys/amd64/amd64 sys/ar...

Aleksandr Rybalko ray at FreeBSD.org
Tue Mar 19 14:39:24 UTC 2013


Author: ray
Date: Tue Mar 19 14:39:19 2013
New Revision: 248513
URL: http://svnweb.freebsd.org/changeset/base/248513

Log:
  MFC @r248511.

Added:
  projects/efika_mx/share/examples/bhyve/
     - copied from r248511, head/share/examples/bhyve/
Modified:
  projects/efika_mx/etc/mtree/BSD.usr.dist
  projects/efika_mx/etc/rc.d/savecore
  projects/efika_mx/lib/libc/sys/mlock.2
  projects/efika_mx/lib/libvmmapi/vmmapi.c
  projects/efika_mx/lib/libvmmapi/vmmapi.h
  projects/efika_mx/sbin/geom/class/eli/geom_eli.c
  projects/efika_mx/sbin/ldconfig/ldconfig.8
  projects/efika_mx/share/examples/Makefile
  projects/efika_mx/share/man/man4/iwn.4
  projects/efika_mx/share/man/man4/psm.4
  projects/efika_mx/sys/amd64/amd64/pmap.c
  projects/efika_mx/sys/arm/arm/pmap-v6.c
  projects/efika_mx/sys/arm/arm/pmap.c
  projects/efika_mx/sys/cam/cam_periph.c
  projects/efika_mx/sys/cddl/compat/opensolaris/sys/sig.h
  projects/efika_mx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  projects/efika_mx/sys/dev/atkbdc/psm.c
  projects/efika_mx/sys/dev/fdt/fdt_common.c
  projects/efika_mx/sys/dev/fdt/simplebus.c
  projects/efika_mx/sys/dev/puc/pucdata.c
  projects/efika_mx/sys/dev/usb/serial/u3g.c
  projects/efika_mx/sys/dev/usb/usbdevs
  projects/efika_mx/sys/fs/nfsclient/nfs_clbio.c
  projects/efika_mx/sys/geom/geom.h
  projects/efika_mx/sys/geom/geom_io.c
  projects/efika_mx/sys/geom/geom_vfs.c
  projects/efika_mx/sys/i386/i386/pmap.c
  projects/efika_mx/sys/i386/xen/pmap.c
  projects/efika_mx/sys/ia64/ia64/pmap.c
  projects/efika_mx/sys/kern/kern_sig.c
  projects/efika_mx/sys/kern/kern_synch.c
  projects/efika_mx/sys/kern/subr_bus_dma.c
  projects/efika_mx/sys/kern/subr_param.c
  projects/efika_mx/sys/kern/subr_sleepqueue.c
  projects/efika_mx/sys/kern/subr_trap.c
  projects/efika_mx/sys/kern/vfs_bio.c
  projects/efika_mx/sys/kern/vfs_cluster.c
  projects/efika_mx/sys/mips/mips/pmap.c
  projects/efika_mx/sys/modules/dtrace/fbt/Makefile
  projects/efika_mx/sys/net/pfil.c
  projects/efika_mx/sys/net/pfil.h
  projects/efika_mx/sys/netpfil/ipfw/ip_fw2.c
  projects/efika_mx/sys/netpfil/ipfw/ip_fw_private.h
  projects/efika_mx/sys/nfsclient/nfs_bio.c
  projects/efika_mx/sys/powerpc/aim/mmu_oea64.c
  projects/efika_mx/sys/powerpc/powerpc/pmap_dispatch.c
  projects/efika_mx/sys/sparc64/sparc64/pmap.c
  projects/efika_mx/sys/sys/bio.h
  projects/efika_mx/sys/sys/buf.h
  projects/efika_mx/sys/sys/mount.h
  projects/efika_mx/sys/sys/mouse.h
  projects/efika_mx/sys/sys/param.h
  projects/efika_mx/sys/sys/signalvar.h
  projects/efika_mx/sys/sys/sleepqueue.h
  projects/efika_mx/sys/sys/systm.h
  projects/efika_mx/sys/vm/vm.h
  projects/efika_mx/sys/vm/vm_init.c
  projects/efika_mx/sys/vm/vm_kern.c
  projects/efika_mx/usr.sbin/bhyve/acpi.c
  projects/efika_mx/usr.sbin/bhyve/bhyverun.c
  projects/efika_mx/usr.sbin/bhyve/bhyverun.h
  projects/efika_mx/usr.sbin/bhyve/mptbl.c
  projects/efika_mx/usr.sbin/bhyve/pci_emul.c
  projects/efika_mx/usr.sbin/bhyve/pci_virtio_block.c
  projects/efika_mx/usr.sbin/bhyve/pci_virtio_net.c
  projects/efika_mx/usr.sbin/bhyvectl/bhyvectl.c
  projects/efika_mx/usr.sbin/bhyveload/bhyveload.8
  projects/efika_mx/usr.sbin/bhyveload/bhyveload.c
  projects/efika_mx/usr.sbin/moused/moused.c
Directory Properties:
  projects/efika_mx/   (props changed)
  projects/efika_mx/lib/libc/   (props changed)
  projects/efika_mx/lib/libvmmapi/   (props changed)
  projects/efika_mx/sbin/   (props changed)
  projects/efika_mx/share/man/man4/   (props changed)
  projects/efika_mx/sys/   (props changed)
  projects/efika_mx/sys/cddl/contrib/opensolaris/   (props changed)
  projects/efika_mx/usr.sbin/bhyve/   (props changed)
  projects/efika_mx/usr.sbin/bhyvectl/   (props changed)
  projects/efika_mx/usr.sbin/bhyveload/   (props changed)

Modified: projects/efika_mx/etc/mtree/BSD.usr.dist
==============================================================================
--- projects/efika_mx/etc/mtree/BSD.usr.dist	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/etc/mtree/BSD.usr.dist	Tue Mar 19 14:39:19 2013	(r248513)
@@ -217,6 +217,8 @@
             ..
             atf
             ..
+            bhyve
+            ..
             bootforth
             ..
             csh

Modified: projects/efika_mx/etc/rc.d/savecore
==============================================================================
--- projects/efika_mx/etc/rc.d/savecore	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/etc/rc.d/savecore	Tue Mar 19 14:39:19 2013	(r248513)
@@ -23,6 +23,9 @@ savecore_prestart()
 		return 1
 		;;
 	[Aa][Uu][Tt][Oo])
+		if [ ! -L /dev/dumpdev ]; then
+			return 1
+		fi
 		dumpdev=`/bin/realpath /dev/dumpdev`
 		;;
 	esac

Modified: projects/efika_mx/lib/libc/sys/mlock.2
==============================================================================
--- projects/efika_mx/lib/libc/sys/mlock.2	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/lib/libc/sys/mlock.2	Tue Mar 19 14:39:19 2013	(r248513)
@@ -28,7 +28,7 @@
 .\"	@(#)mlock.2	8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd December 25, 2012
+.Dd March 18, 2013
 .Dt MLOCK 2
 .Os
 .Sh NAME
@@ -138,7 +138,12 @@ is set to 0 and the caller is not the su
 .It Bq Er EINVAL
 The address given is not page aligned or the length is negative.
 .It Bq Er ENOMEM
-Some portion of the indicated address range is not allocated.
+Some or all of the address range specified by the addr and len
+arguments does not correspond to valid mapped pages in the address space
+of the process.
+.It Bq Er ENOMEM
+Locking the pages mapped by the specified range would exceed a limit on
+the amount of memory that the process may lock.
 .El
 .Sh "SEE ALSO"
 .Xr fork 2 ,

Modified: projects/efika_mx/lib/libvmmapi/vmmapi.c
==============================================================================
--- projects/efika_mx/lib/libvmmapi/vmmapi.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/lib/libvmmapi/vmmapi.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -48,8 +48,16 @@ __FBSDID("$FreeBSD$");
 
 #include "vmmapi.h"
 
+#define	GB	(1024 * 1024 * 1024UL)
+
 struct vmctx {
 	int	fd;
+	uint32_t lowmem_limit;
+	enum vm_mmap_style vms;
+	size_t	lowmem;
+	char	*lowmem_addr;
+	size_t	highmem;
+	char	*highmem_addr;
 	char	*name;
 };
 
@@ -90,6 +98,7 @@ vm_open(const char *name)
 	assert(vm != NULL);
 
 	vm->fd = -1;
+	vm->lowmem_limit = 3 * GB;
 	vm->name = (char *)(vm + 1);
 	strcpy(vm->name, name);
 
@@ -151,8 +160,22 @@ vm_get_memory_seg(struct vmctx *ctx, vm_
 	return (error);
 }
 
-int
-vm_setup_memory(struct vmctx *ctx, vm_paddr_t gpa, size_t len, char **mapaddr)
+uint32_t
+vm_get_lowmem_limit(struct vmctx *ctx)
+{
+
+	return (ctx->lowmem_limit);
+}
+
+void
+vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit)
+{
+
+	ctx->lowmem_limit = limit;
+}
+
+static int
+setup_memory_segment(struct vmctx *ctx, vm_paddr_t gpa, size_t len, char **addr)
 {
 	int error;
 	struct vm_memory_segment seg;
@@ -165,20 +188,69 @@ vm_setup_memory(struct vmctx *ctx, vm_pa
 	seg.gpa = gpa;
 	seg.len = len;
 	error = ioctl(ctx->fd, VM_MAP_MEMORY, &seg);
-	if (error == 0 && mapaddr != NULL) {
-		*mapaddr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
+	if (error == 0 && addr != NULL) {
+		*addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
 				ctx->fd, gpa);
 	}
 	return (error);
 }
 
-char *
-vm_map_memory(struct vmctx *ctx, vm_paddr_t gpa, size_t len)
+int
+vm_setup_memory(struct vmctx *ctx, size_t memsize, enum vm_mmap_style vms)
+{
+	char **addr;
+	int error;
+
+	/* XXX VM_MMAP_SPARSE not implemented yet */
+	assert(vms == VM_MMAP_NONE || vms == VM_MMAP_ALL);
+	ctx->vms = vms;
+
+	/*
+	 * If 'memsize' cannot fit entirely in the 'lowmem' segment then
+	 * create another 'highmem' segment above 4GB for the remainder.
+	 */
+	if (memsize > ctx->lowmem_limit) {
+		ctx->lowmem = ctx->lowmem_limit;
+		ctx->highmem = memsize - ctx->lowmem;
+	} else {
+		ctx->lowmem = memsize;
+		ctx->highmem = 0;
+	}
+
+	if (ctx->lowmem > 0) {
+		addr = (vms == VM_MMAP_ALL) ? &ctx->lowmem_addr : NULL;
+		error = setup_memory_segment(ctx, 0, ctx->lowmem, addr);
+		if (error)
+			return (error);
+	}
+
+	if (ctx->highmem > 0) {
+		addr = (vms == VM_MMAP_ALL) ? &ctx->highmem_addr : NULL;
+		error = setup_memory_segment(ctx, 4*GB, ctx->highmem, addr);
+		if (error)
+			return (error);
+	}
+
+	return (0);
+}
+
+void *
+vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len)
 {
 
-	/* Map 'len' bytes of memory at guest physical address 'gpa' */
-	return ((char *)mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
-		     ctx->fd, gpa));
+	/* XXX VM_MMAP_SPARSE not implemented yet */
+	assert(ctx->vms == VM_MMAP_ALL);
+
+	if (gaddr < ctx->lowmem && gaddr + len <= ctx->lowmem)
+		return ((void *)(ctx->lowmem_addr + gaddr));
+
+	if (gaddr >= 4*GB) {
+		gaddr -= 4*GB;
+		if (gaddr < ctx->highmem && gaddr + len <= ctx->highmem)
+			return ((void *)(ctx->highmem_addr + gaddr));
+	}
+
+	return (NULL);
 }
 
 int

Modified: projects/efika_mx/lib/libvmmapi/vmmapi.h
==============================================================================
--- projects/efika_mx/lib/libvmmapi/vmmapi.h	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/lib/libvmmapi/vmmapi.h	Tue Mar 19 14:39:19 2013	(r248513)
@@ -32,24 +32,26 @@
 struct vmctx;
 enum x2apic_state;
 
+/*
+ * Different styles of mapping the memory assigned to a VM into the address
+ * space of the controlling process.
+ */
+enum vm_mmap_style {
+	VM_MMAP_NONE,		/* no mapping */
+	VM_MMAP_ALL,		/* fully and statically mapped */
+	VM_MMAP_SPARSE,		/* mappings created on-demand */
+};
+
 int	vm_create(const char *name);
 struct vmctx *vm_open(const char *name);
 void	vm_destroy(struct vmctx *ctx);
 size_t	vmm_get_mem_total(void);
 size_t	vmm_get_mem_free(void);
 int	vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len);
-/*
- * Create a memory segment of 'len' bytes in the guest physical address space
- * at offset 'gpa'.
- *
- * If 'mapaddr' is not NULL then this region is mmap'ed into the address
- * space of the calling process. If there is an mmap error then *mapaddr
- * will be set to MAP_FAILED.
- */
-
-int	vm_setup_memory(struct vmctx *ctx, vm_paddr_t gpa, size_t len,
-		      char **mapaddr);
-char *  vm_map_memory(struct vmctx *ctx, vm_paddr_t gpa, size_t len);
+int	vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s);
+void	*vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len);
+uint32_t vm_get_lowmem_limit(struct vmctx *ctx);
+void	vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit);
 int	vm_set_desc(struct vmctx *ctx, int vcpu, int reg,
 		    uint64_t base, uint32_t limit, uint32_t access);
 int	vm_get_desc(struct vmctx *ctx, int vcpu, int reg,

Modified: projects/efika_mx/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- projects/efika_mx/sbin/geom/class/eli/geom_eli.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sbin/geom/class/eli/geom_eli.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -259,6 +259,8 @@ struct g_command class_commands[] = {
 
 static int verbose = 0;
 
+#define	BUFSIZE	1024
+
 static int
 eli_protect(struct gctl_req *req)
 {
@@ -344,7 +346,7 @@ static int
 eli_genkey_files(struct gctl_req *req, bool new, const char *type,
     struct hmac_ctx *ctxp, char *passbuf, size_t passbufsize)
 {
-	char *p, buf[MAXPHYS], argname[16];
+	char *p, buf[BUFSIZE], argname[16];
 	const char *file;
 	int error, fd, i;
 	ssize_t done;
@@ -431,7 +433,7 @@ eli_genkey_passphrase_prompt(struct gctl
 		}
 
 		if (new) {
-			char tmpbuf[BUFSIZ];
+			char tmpbuf[BUFSIZE];
 
 			p = readpassphrase("Reenter new passphrase: ",
 			    tmpbuf, sizeof(tmpbuf),
@@ -460,7 +462,7 @@ static int
 eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new,
     struct hmac_ctx *ctxp)
 {
-	char passbuf[MAXPHYS];
+	char passbuf[BUFSIZE];
 	bool nopassphrase;
 	int nfiles;
 

Modified: projects/efika_mx/sbin/ldconfig/ldconfig.8
==============================================================================
--- projects/efika_mx/sbin/ldconfig/ldconfig.8	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sbin/ldconfig/ldconfig.8	Tue Mar 19 14:39:19 2013	(r248513)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 11, 2005
+.Dd March 19, 2013
 .Dt LDCONFIG 8
 .Os
 .Sh NAME
@@ -162,21 +162,6 @@ In
 addition to building a set of hints for quick lookup, it also serves to
 specify the trusted collection of directories from which shared objects can
 be safely loaded.
-.Sh ENVIRONMENT
-.Bl -tag -width OBJFORMATxxx -compact
-.It Ev OBJFORMAT
-Overrides
-.Pa /etc/objformat
-(see below) to determine whether
-.Fl aout
-or
-.Fl elf
-is the default.
-If set, its value should be either
-.Ql aout
-or
-.Ql elf .
-.El
 .Sh FILES
 .Bl -tag -width /var/run/ld-elf.so.hintsxxx -compact
 .It Pa /var/run/ld.so.hints
@@ -196,17 +181,6 @@ invocations with
 Conventional configuration files containing directory names for
 invocations with
 .Fl 32 .
-.It Pa /etc/objformat
-Determines whether
-.Fl aout
-or
-.Fl elf
-is the default.
-If present, it must consist of a single line
-containing either
-.Ql OBJFORMAT=aout
-or
-.Ql OBJFORMAT=elf .
 .El
 .Sh SEE ALSO
 .Xr ld 1 ,

Modified: projects/efika_mx/share/examples/Makefile
==============================================================================
--- projects/efika_mx/share/examples/Makefile	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/share/examples/Makefile	Tue Mar 19 14:39:19 2013	(r248513)
@@ -7,6 +7,7 @@
 LDIRS=	BSD_daemon \
 	FreeBSD_version \
 	IPv6 \
+	bhyve \
 	bootforth \
 	csh \
 	cvsup \
@@ -42,6 +43,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	FreeBSD_version/Makefile \
 	FreeBSD_version/README \
 	IPv6/USAGE \
+	bhyve/vmrun.sh \
 	bootforth/README \
 	bootforth/boot.4th \
 	bootforth/frames.4th \

Modified: projects/efika_mx/share/man/man4/iwn.4
==============================================================================
--- projects/efika_mx/share/man/man4/iwn.4	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/share/man/man4/iwn.4	Tue Mar 19 14:39:19 2013	(r248513)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2012
+.Dd March 19, 2013
 .Dt IWN 4
 .Os
 .Sh NAME
@@ -100,8 +100,7 @@ driver provides support for:
 .Pp
 .Nm
 supports
-.Cm station ,
-.Cm adhoc ,
+.Cm station
 and
 .Cm monitor
 mode operation.

Modified: projects/efika_mx/share/man/man4/psm.4
==============================================================================
--- projects/efika_mx/share/man/man4/psm.4	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/share/man/man4/psm.4	Tue Mar 19 14:39:19 2013	(r248513)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2012
+.Dd March 18, 2013
 .Dt PSM 4
 .Os
 .Sh NAME
@@ -339,6 +339,12 @@ at boot-time.
 This will enable
 .Nm
 to handle packets from guest devices (sticks) and extra buttons.
+Similarly, extended support for IBM/Lenovo TrackPoint can be enabled
+by setting
+.Va hw.psm.trackpoint_support
+to
+.Em 1
+at boot-time.
 .Pp
 Tap and drag gestures can be disabled by setting
 .Va hw.psm.tap_enabled
@@ -832,8 +838,8 @@ In contrast, some pad products, e.g.\& s
 and Interlink VersaPad, treat the tapping action
 as fourth button events.
 .Pp
-It is reported that ALPS GlidePoint, Synaptics Touchpad, and
-Interlink VersaPad require
+It is reported that ALPS GlidePoint, Synaptics Touchpad, IBM/Lenovo
+TrackPoint, and Interlink VersaPad require
 .Em INITAFTERSUSPEND
 flag in order to recover from suspended state.
 This flag is automatically set when one of these devices is detected by the

Modified: projects/efika_mx/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/efika_mx/sys/amd64/amd64/pmap.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/amd64/amd64/pmap.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -4235,6 +4235,8 @@ pmap_copy_page(vm_page_t msrc, vm_page_t
 	pagecopy((void *)src, (void *)dst);
 }
 
+int unmapped_buf_allowed = 1;
+
 void
 pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
     vm_offset_t b_offset, int xfersize)

Modified: projects/efika_mx/sys/arm/arm/pmap-v6.c
==============================================================================
--- projects/efika_mx/sys/arm/arm/pmap-v6.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/arm/arm/pmap-v6.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -3312,6 +3312,8 @@ pmap_copy_page_generic(vm_paddr_t src, v
 	mtx_unlock(&cmtx);
 }
 
+int unmapped_buf_allowed = 1;
+
 void
 pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
     vm_offset_t b_offset, int xfersize)

Modified: projects/efika_mx/sys/arm/arm/pmap.c
==============================================================================
--- projects/efika_mx/sys/arm/arm/pmap.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/arm/arm/pmap.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -4428,6 +4428,8 @@ pmap_copy_page(vm_page_t src, vm_page_t 
 #endif
 }
 
+int unmapped_buf_allowed = 1;
+
 void
 pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
     vm_offset_t b_offset, int xfersize)

Modified: projects/efika_mx/sys/cam/cam_periph.c
==============================================================================
--- projects/efika_mx/sys/cam/cam_periph.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/cam/cam_periph.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -734,6 +734,8 @@ cam_periph_mapmem(union ccb *ccb, struct
 	case XPT_CONT_TARGET_IO:
 		if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
 			return(0);
+		KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR,
+		    ("not VADDR for SCSI_IO %p %x\n", ccb, ccb->ccb_h.flags));
 
 		data_ptrs[0] = &ccb->csio.data_ptr;
 		lengths[0] = ccb->csio.dxfer_len;
@@ -743,6 +745,8 @@ cam_periph_mapmem(union ccb *ccb, struct
 	case XPT_ATA_IO:
 		if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
 			return(0);
+		KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR,
+		    ("not VADDR for ATA_IO %p %x\n", ccb, ccb->ccb_h.flags));
 
 		data_ptrs[0] = &ccb->ataio.data_ptr;
 		lengths[0] = ccb->ataio.dxfer_len;

Modified: projects/efika_mx/sys/cddl/compat/opensolaris/sys/sig.h
==============================================================================
--- projects/efika_mx/sys/cddl/compat/opensolaris/sys/sig.h	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/cddl/compat/opensolaris/sys/sig.h	Tue Mar 19 14:39:19 2013	(r248513)
@@ -55,7 +55,7 @@ issig(int why)
 		p = td->td_proc;
 		PROC_LOCK(p);
 		mtx_lock(&p->p_sigacts->ps_mtx);
-		sig = cursig(td, SIG_STOP_ALLOWED);
+		sig = cursig(td);
 		mtx_unlock(&p->p_sigacts->ps_mtx);
 		PROC_UNLOCK(p);
 		if (sig != 0)

Modified: projects/efika_mx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- projects/efika_mx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -919,7 +919,8 @@ dsl_check_snap_cb(const char *name, void
 	char *dsname;
 
 	dsname = kmem_asprintf("%s@%s", name, da->snapname);
-	VERIFY(nvlist_add_boolean(da->nvl, dsname) == 0);
+	fnvlist_add_boolean(da->nvl, dsname);
+	kmem_free(dsname, strlen(dsname) + 1);
 
 	return (0);
 }

Modified: projects/efika_mx/sys/dev/atkbdc/psm.c
==============================================================================
--- projects/efika_mx/sys/dev/atkbdc/psm.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/dev/atkbdc/psm.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -260,6 +260,38 @@ typedef struct synapticsaction {
 	int			in_vscroll;
 } synapticsaction_t;
 
+enum {
+	TRACKPOINT_SYSCTL_SENSITIVITY,
+	TRACKPOINT_SYSCTL_NEGATIVE_INERTIA,
+	TRACKPOINT_SYSCTL_UPPER_PLATEAU,
+	TRACKPOINT_SYSCTL_BACKUP_RANGE,
+	TRACKPOINT_SYSCTL_DRAG_HYSTERESIS,
+	TRACKPOINT_SYSCTL_MINIMUM_DRAG,
+	TRACKPOINT_SYSCTL_UP_THRESHOLD,
+	TRACKPOINT_SYSCTL_THRESHOLD,
+	TRACKPOINT_SYSCTL_JENKS_CURVATURE,
+	TRACKPOINT_SYSCTL_Z_TIME,
+	TRACKPOINT_SYSCTL_PRESS_TO_SELECT,
+	TRACKPOINT_SYSCTL_SKIP_BACKUPS
+};
+
+typedef struct trackpointinfo {
+	struct sysctl_ctx_list sysctl_ctx;
+	struct sysctl_oid *sysctl_tree;
+	int	sensitivity;
+	int	inertia;
+	int	uplateau;
+	int	reach;
+	int	draghys;
+	int	mindrag;
+	int	upthresh;
+	int	threshold;
+	int	jenks;
+	int	ztime;
+	int	pts;
+	int	skipback;
+} trackpointinfo_t;
+
 /* driver control block */
 struct psm_softc {		/* Driver status information */
 	int		unit;
@@ -274,6 +306,8 @@ struct psm_softc {		/* Driver status inf
 	synapticshw_t	synhw;		/* Synaptics hardware information */
 	synapticsinfo_t	syninfo;	/* Synaptics configuration */
 	synapticsaction_t synaction;	/* Synaptics action context */
+	int		tphw;		/* TrackPoint hardware information */
+	trackpointinfo_t tpinfo;	/* TrackPoint configuration */
 	mousemode_t	mode;		/* operation mode */
 	mousemode_t	dflt_mode;	/* default operation mode */
 	mousestatus_t	status;		/* accumulated mouse movement */
@@ -344,6 +378,9 @@ TUNABLE_INT("hw.psm.tap_enabled", &tap_e
 static int synaptics_support = 0;
 TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support);
 
+static int trackpoint_support = 0;
+TUNABLE_INT("hw.psm.trackpoint_support", &trackpoint_support);
+
 static int verbose = PSM_DEBUG;
 TUNABLE_INT("debug.psm.loglevel", &verbose);
 
@@ -432,6 +469,7 @@ static probefunc_t	enable_4dmouse;
 static probefunc_t	enable_4dplus;
 static probefunc_t	enable_mmanplus;
 static probefunc_t	enable_synaptics;
+static probefunc_t	enable_trackpoint;
 static probefunc_t	enable_versapad;
 
 static struct {
@@ -466,6 +504,8 @@ static struct {
 	  0x80, MOUSE_PS2_PACKETSIZE, enable_kmouse },
 	{ MOUSE_MODEL_VERSAPAD,		/* Interlink electronics VersaPad */
 	  0xe8, MOUSE_PS2VERSA_PACKETSIZE, enable_versapad },
+	{ MOUSE_MODEL_TRACKPOINT,	/* IBM/Lenovo TrackPoint */
+	  0xc0, MOUSE_PS2_PACKETSIZE, enable_trackpoint },
 	{ MOUSE_MODEL_GENERIC,
 	  0xc0, MOUSE_PS2_PACKETSIZE, NULL },
 };
@@ -707,6 +747,7 @@ model_name(int model)
 		{ MOUSE_MODEL_4D,		"4D Mouse" },
 		{ MOUSE_MODEL_4DPLUS,		"4D+ Mouse" },
 		{ MOUSE_MODEL_SYNAPTICS,	"Synaptics Touchpad" },
+		{ MOUSE_MODEL_TRACKPOINT,	"IBM/Lenovo TrackPoint" },
 		{ MOUSE_MODEL_GENERIC,		"Generic PS/2 mouse" },
 		{ MOUSE_MODEL_UNKNOWN,		"Unknown" },
 	};
@@ -1452,7 +1493,7 @@ psmattach(device_t dev)
 		sc->config |= PSM_CONFIG_INITAFTERSUSPEND;
 		break;
 	default:
-		if (sc->synhw.infoMajor >= 4)
+		if (sc->synhw.infoMajor >= 4 || sc->tphw > 0)
 			sc->config |= PSM_CONFIG_INITAFTERSUSPEND;
 		break;
 	}
@@ -3442,6 +3483,7 @@ psmsoftintr(void *arg)
 				goto next;
 			break;
 
+		case MOUSE_MODEL_TRACKPOINT:
 		case MOUSE_MODEL_GENERIC:
 		default:
 			break;
@@ -4474,6 +4516,233 @@ enable_synaptics(KBDC kbdc, struct psm_s
 	return (TRUE);
 }
 
+/* IBM/Lenovo TrackPoint */
+static int
+trackpoint_command(KBDC kbdc, int cmd, int loc, int val)
+{
+	const int seq[] = { 0xe2, cmd, loc, val };
+	int i;
+
+	for (i = 0; i < nitems(seq); i++)
+		if (send_aux_command(kbdc, seq[i]) != PSM_ACK)
+			return (EIO);
+	return (0);
+}
+
+#define	PSM_TPINFO(x)	offsetof(struct psm_softc, tpinfo.x)
+#define	TPMASK		0
+#define	TPLOC		1
+#define	TPINFO		2
+
+static int
+trackpoint_sysctl(SYSCTL_HANDLER_ARGS)
+{
+	static const int data[][3] = {
+		{ 0x00, 0x4a, PSM_TPINFO(sensitivity) },
+		{ 0x00, 0x4d, PSM_TPINFO(inertia) },
+		{ 0x00, 0x60, PSM_TPINFO(uplateau) },
+		{ 0x00, 0x57, PSM_TPINFO(reach) },
+		{ 0x00, 0x58, PSM_TPINFO(draghys) },
+		{ 0x00, 0x59, PSM_TPINFO(mindrag) },
+		{ 0x00, 0x5a, PSM_TPINFO(upthresh) },
+		{ 0x00, 0x5c, PSM_TPINFO(threshold) },
+		{ 0x00, 0x5d, PSM_TPINFO(jenks) },
+		{ 0x00, 0x5e, PSM_TPINFO(ztime) },
+		{ 0x01, 0x2c, PSM_TPINFO(pts) },
+		{ 0x08, 0x2d, PSM_TPINFO(skipback) }
+	};
+	struct psm_softc *sc;
+	int error, newval, *oldvalp;
+	const int *tp;
+
+	if (arg1 == NULL || arg2 < 0 || arg2 >= nitems(data))
+		return (EINVAL);
+	sc = arg1;
+	tp = data[arg2];
+	oldvalp = (int *)((intptr_t)sc + tp[TPINFO]);
+	newval = *oldvalp;
+	error = sysctl_handle_int(oidp, &newval, 0, req);
+	if (error != 0)
+		return (error);
+	if (newval == *oldvalp)
+		return (0);
+	if (newval < 0 || newval > (tp[TPMASK] == 0 ? 255 : 1))
+		return (EINVAL);
+	error = trackpoint_command(sc->kbdc, tp[TPMASK] == 0 ? 0x81 : 0x47,
+	    tp[TPLOC], tp[TPMASK] == 0 ? newval : tp[TPMASK]);
+	if (error != 0)
+		return (error);
+	*oldvalp = newval;
+
+	return (0);
+}
+
+static void
+trackpoint_sysctl_create_tree(struct psm_softc *sc)
+{
+
+	if (sc->tpinfo.sysctl_tree != NULL)
+		return;
+
+	/* Attach extra trackpoint sysctl nodes under hw.psm.trackpoint */
+	sysctl_ctx_init(&sc->tpinfo.sysctl_ctx);
+	sc->tpinfo.sysctl_tree = SYSCTL_ADD_NODE(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_STATIC_CHILDREN(_hw_psm), OID_AUTO, "trackpoint", CTLFLAG_RD,
+	    0, "IBM/Lenovo TrackPoint");
+
+	/* hw.psm.trackpoint.sensitivity */
+	sc->tpinfo.sensitivity = 0x64;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "sensitivity", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_SENSITIVITY,
+	    trackpoint_sysctl, "I",
+	    "Sensitivity");
+
+	/* hw.psm.trackpoint.negative_inertia */
+	sc->tpinfo.inertia = 0x06;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "negative_inertia", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_NEGATIVE_INERTIA,
+	    trackpoint_sysctl, "I",
+	    "Negative inertia factor");
+
+	/* hw.psm.trackpoint.upper_plateau */
+	sc->tpinfo.uplateau = 0x61;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "upper_plateau", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_UPPER_PLATEAU,
+	    trackpoint_sysctl, "I",
+	    "Transfer function upper plateau speed");
+
+	/* hw.psm.trackpoint.backup_range */
+	sc->tpinfo.reach = 0x0a;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "backup_range", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_BACKUP_RANGE,
+	    trackpoint_sysctl, "I",
+	    "Backup range");
+
+	/* hw.psm.trackpoint.drag_hysteresis */
+	sc->tpinfo.draghys = 0xff;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "drag_hysteresis", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_DRAG_HYSTERESIS,
+	    trackpoint_sysctl, "I",
+	    "Drag hysteresis");
+
+	/* hw.psm.trackpoint.minimum_drag */
+	sc->tpinfo.mindrag = 0x14;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "minimum_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_MINIMUM_DRAG,
+	    trackpoint_sysctl, "I",
+	    "Minimum drag");
+
+	/* hw.psm.trackpoint.up_threshold */
+	sc->tpinfo.upthresh = 0xff;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "up_threshold", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_UP_THRESHOLD,
+	    trackpoint_sysctl, "I",
+	    "Up threshold for release");
+
+	/* hw.psm.trackpoint.threshold */
+	sc->tpinfo.threshold = 0x08;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "threshold", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_THRESHOLD,
+	    trackpoint_sysctl, "I",
+	    "Threshold");
+
+	/* hw.psm.trackpoint.jenks_curvature */
+	sc->tpinfo.jenks = 0x87;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "jenks_curvature", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_JENKS_CURVATURE,
+	    trackpoint_sysctl, "I",
+	    "Jenks curvature");
+
+	/* hw.psm.trackpoint.z_time */
+	sc->tpinfo.ztime = 0x26;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "z_time", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_Z_TIME,
+	    trackpoint_sysctl, "I",
+	    "Z time constant");
+
+	/* hw.psm.trackpoint.press_to_select */
+	sc->tpinfo.pts = 0x00;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "press_to_select", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_PRESS_TO_SELECT,
+	    trackpoint_sysctl, "I",
+	    "Press to Select");
+
+	/* hw.psm.trackpoint.skip_backups */
+	sc->tpinfo.skipback = 0x00;
+	SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx,
+	    SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO,
+	    "skip_backups", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY,
+	    sc, TRACKPOINT_SYSCTL_SKIP_BACKUPS,
+	    trackpoint_sysctl, "I",
+	    "Skip backups from drags");
+}
+
+static int
+enable_trackpoint(KBDC kbdc, struct psm_softc *sc)
+{
+	int id;
+
+	kbdc = sc->kbdc;
+
+	if (send_aux_command(kbdc, 0xe1) != PSM_ACK ||
+	    read_aux_data(kbdc) != 0x01)
+		return (FALSE);
+	id = read_aux_data(kbdc);
+	if (id < 0x01)
+		return (FALSE);
+	if (sc != NULL)
+		sc->tphw = id;
+	if (!trackpoint_support)
+		return (FALSE);
+
+	if (sc != NULL) {
+		/* Create sysctl tree. */
+		trackpoint_sysctl_create_tree(sc);
+
+		trackpoint_command(kbdc, 0x81, 0x4a, sc->tpinfo.sensitivity);
+		trackpoint_command(kbdc, 0x81, 0x4d, sc->tpinfo.inertia);
+		trackpoint_command(kbdc, 0x81, 0x60, sc->tpinfo.uplateau);
+		trackpoint_command(kbdc, 0x81, 0x57, sc->tpinfo.reach);
+		trackpoint_command(kbdc, 0x81, 0x58, sc->tpinfo.draghys);
+		trackpoint_command(kbdc, 0x81, 0x59, sc->tpinfo.mindrag);
+		trackpoint_command(kbdc, 0x81, 0x5a, sc->tpinfo.upthresh);
+		trackpoint_command(kbdc, 0x81, 0x5c, sc->tpinfo.threshold);
+		trackpoint_command(kbdc, 0x81, 0x5d, sc->tpinfo.jenks);
+		trackpoint_command(kbdc, 0x81, 0x5e, sc->tpinfo.ztime);
+		if (sc->tpinfo.pts == 0x01)
+			trackpoint_command(kbdc, 0x47, 0x2c, 0x01);
+		if (sc->tpinfo.skipback == 0x01)
+			trackpoint_command(kbdc, 0x47, 0x2d, 0x08);
+
+		sc->hw.hwid = id;
+		sc->hw.buttons = 3;
+	}
+
+	return (TRUE);
+}
+
 /* Interlink electronics VersaPad */
 static int
 enable_versapad(KBDC kbdc, struct psm_softc *sc)

Modified: projects/efika_mx/sys/dev/fdt/fdt_common.c
==============================================================================
--- projects/efika_mx/sys/dev/fdt/fdt_common.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/dev/fdt/fdt_common.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -421,12 +421,11 @@ fdt_regsize(phandle_t node, u_long *base
 int
 fdt_reg_to_rl(phandle_t node, struct resource_list *rl)
 {
-	u_long count;
+	u_long end, count, start;
 	pcell_t *reg, *regptr;
 	pcell_t addr_cells, size_cells;
 	int tuple_size, tuples;
 	int i, rv;
-	bus_space_handle_t start, end;
 	long busaddr, bussize;
 
 	if (fdt_addrsize_cells(OF_parent(node), &addr_cells, &size_cells) != 0)

Modified: projects/efika_mx/sys/dev/fdt/simplebus.c
==============================================================================
--- projects/efika_mx/sys/dev/fdt/simplebus.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/dev/fdt/simplebus.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -135,6 +135,8 @@ EARLY_DRIVER_MODULE(simplebus, fdtbus, s
     0, 0, BUS_PASS_BUS);
 EARLY_DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass,
     0, 0, BUS_PASS_BUS);
+DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0,
+    0);
 
 static int
 simplebus_probe(device_t dev)
@@ -145,7 +147,7 @@ simplebus_probe(device_t dev)
 
 	device_set_desc(dev, "Flattened device tree simple bus");
 
-	return (BUS_PROBE_DEFAULT);
+	return (BUS_PROBE_GENERIC);
 }
 
 static int

Modified: projects/efika_mx/sys/dev/puc/pucdata.c
==============================================================================
--- projects/efika_mx/sys/dev/puc/pucdata.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/dev/puc/pucdata.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -629,6 +629,7 @@ const struct puc_cfg puc_pci_devices[] =
 	    "Exar XR17V258IV",
 	    DEFAULT_RCLK * 8,
 	    PUC_PORT_8S, 0x10, 0, -1,
+	    .config_function = puc_config_exar
 	},
 
 	/* The XR17V358 uses the 125MHz PCIe clock as its reference clock. */

Modified: projects/efika_mx/sys/dev/usb/serial/u3g.c
==============================================================================
--- projects/efika_mx/sys/dev/usb/serial/u3g.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/dev/usb/serial/u3g.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -242,6 +242,8 @@ static const STRUCT_USB_HOST_ID u3g_devs
 	U3G_DEV(DELL, U5730_2, 0),
 	U3G_DEV(DELL, U5730_3, 0),
 	U3G_DEV(DELL, U740, 0),
+	U3G_DEV(DLINK, DWR510_CD, U3GINIT_SCSIEJECT),
+	U3G_DEV(DLINK, DWR510, 0),
 	U3G_DEV(DLINK3, DWM652, 0),
 	U3G_DEV(HP, EV2200, 0),
 	U3G_DEV(HP, HS2300, 0),

Modified: projects/efika_mx/sys/dev/usb/usbdevs
==============================================================================
--- projects/efika_mx/sys/dev/usb/usbdevs	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/dev/usb/usbdevs	Tue Mar 19 14:39:19 2013	(r248513)
@@ -1516,6 +1516,8 @@ product DLINK DSB650TX3		0x400b	10/100 E
 product DLINK DSB650TX2		0x4102	10/100 Ethernet
 product DLINK DSB650		0xabc1	10/100 Ethernet
 product DLINK DUBH7		0xf103	DUB-H7 USB 2.0 7-Port Hub
+product DLINK DWR510_CD		0xa805	DWR-510 CD-ROM Mode
+product DLINK DWR510		0x7e12	DWR-510
 product DLINK2 DWA120		0x3a0c	DWA-120
 product DLINK2 DWA120_NF	0x3a0d	DWA-120 (no firmware)
 product DLINK2 DWLG122C1	0x3c03	DWL-G122 c1

Modified: projects/efika_mx/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- projects/efika_mx/sys/fs/nfsclient/nfs_clbio.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/fs/nfsclient/nfs_clbio.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -484,7 +484,7 @@ ncl_bioread(struct vnode *vp, struct uio
 	    case VREG:
 		NFSINCRGLOBAL(newnfsstats.biocache_reads);
 		lbn = uio->uio_offset / biosize;
-		on = uio->uio_offset & (biosize - 1);
+		on = uio->uio_offset - (lbn * biosize);
 
 		/*
 		 * Start the read ahead(s), as required.
@@ -1029,7 +1029,7 @@ flush_and_restart:
 	do {
 		NFSINCRGLOBAL(newnfsstats.biocache_writes);
 		lbn = uio->uio_offset / biosize;
-		on = uio->uio_offset & (biosize-1);
+		on = uio->uio_offset - (lbn * biosize);
 		n = MIN((unsigned)(biosize - on), uio->uio_resid);
 again:
 		/*
@@ -1847,7 +1847,7 @@ ncl_meta_setsize(struct vnode *vp, struc
 		 */
 		error = vtruncbuf(vp, cred, nsize, biosize);
 		lbn = nsize / biosize;
-		bufsize = nsize & (biosize - 1);
+		bufsize = nsize - (lbn * biosize);
 		bp = nfs_getcacheblk(vp, lbn, bufsize, td);
  		if (!bp)
  			return EINTR;

Modified: projects/efika_mx/sys/geom/geom.h
==============================================================================
--- projects/efika_mx/sys/geom/geom.h	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/geom/geom.h	Tue Mar 19 14:39:19 2013	(r248513)
@@ -205,6 +205,7 @@ struct g_provider {
 	u_int			flags;
 #define G_PF_WITHER		0x2
 #define G_PF_ORPHAN		0x4
+#define	G_PF_ACCEPT_UNMAPPED	0x8
 
 	/* Two fields for the implementing class to use */
 	void			*private;

Modified: projects/efika_mx/sys/geom/geom_io.c
==============================================================================
--- projects/efika_mx/sys/geom/geom_io.c	Tue Mar 19 14:36:28 2013	(r248512)
+++ projects/efika_mx/sys/geom/geom_io.c	Tue Mar 19 14:39:19 2013	(r248513)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2002 Poul-Henning Kamp
  * Copyright (c) 2002 Networks Associates Technology, Inc.
+ * Copyright (c) 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * This software was developed for the FreeBSD Project by Poul-Henning Kamp
@@ -8,6 +9,9 @@
  * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
  * DARPA CHATS research program.
  *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -44,6 +48,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/ktr.h>
 #include <sys/proc.h>
 #include <sys/stack.h>
+#include <sys/sysctl.h>
 
 #include <sys/errno.h>
 #include <geom/geom.h>
@@ -51,6 +56,13 @@ __FBSDID("$FreeBSD$");
 #include <sys/devicestat.h>
 
 #include <vm/uma.h>
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_page.h>
+#include <vm/vm_object.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_map.h>
 
 static struct g_bioq g_bio_run_down;
 static struct g_bioq g_bio_run_up;
@@ -180,12 +192,17 @@ g_clone_bio(struct bio *bp)
 		/*
 		 *  BIO_ORDERED flag may be used by disk drivers to enforce
 		 *  ordering restrictions, so this flag needs to be cloned.
+		 *  BIO_UNMAPPED should be inherited, to properly indicate
+		 *  which way the buffer is passed.
 		 *  Other bio flags are not suitable for cloning.
 		 */
-		bp2->bio_flags = bp->bio_flags & BIO_ORDERED;
+		bp2->bio_flags = bp->bio_flags & (BIO_ORDERED | BIO_UNMAPPED);
 		bp2->bio_length = bp->bio_length;
 		bp2->bio_offset = bp->bio_offset;
 		bp2->bio_data = bp->bio_data;
+		bp2->bio_ma = bp->bio_ma;
+		bp2->bio_ma_n = bp->bio_ma_n;
+		bp2->bio_ma_offset = bp->bio_ma_offset;
 		bp2->bio_attribute = bp->bio_attribute;
 		/* Inherit classification info from the parent */
 		bp2->bio_classifier1 = bp->bio_classifier1;
@@ -210,11 +227,15 @@ g_duplicate_bio(struct bio *bp)
 	struct bio *bp2;
 
 	bp2 = uma_zalloc(biozone, M_WAITOK | M_ZERO);
+	bp2->bio_flags = bp->bio_flags & BIO_UNMAPPED;
 	bp2->bio_parent = bp;
 	bp2->bio_cmd = bp->bio_cmd;
 	bp2->bio_length = bp->bio_length;
 	bp2->bio_offset = bp->bio_offset;
 	bp2->bio_data = bp->bio_data;
+	bp2->bio_ma = bp->bio_ma;
+	bp2->bio_ma_n = bp->bio_ma_n;
+	bp2->bio_ma_offset = bp->bio_ma_offset;
 	bp2->bio_attribute = bp->bio_attribute;
 	bp->bio_children++;
 #ifdef KTR
@@ -575,6 +596,83 @@ g_io_deliver(struct bio *bp, int error)
 	return;
 }
 
+SYSCTL_DECL(_kern_geom);
+
+static long transient_maps;
+SYSCTL_LONG(_kern_geom, OID_AUTO, transient_maps, CTLFLAG_RD,
+    &transient_maps, 0,
+    "Total count of the transient mapping requests");
+u_int transient_map_retries = 10;
+SYSCTL_UINT(_kern_geom, OID_AUTO, transient_map_retries, CTLFLAG_RW,
+    &transient_map_retries, 0,
+    "Max count of retries used before giving up on creating transient map");
+int transient_map_hard_failures;
+SYSCTL_INT(_kern_geom, OID_AUTO, transient_map_hard_failures, CTLFLAG_RD,
+    &transient_map_hard_failures, 0,
+    "Failures to establish the transient mapping due to retry attempts "
+    "exhausted");
+int transient_map_soft_failures;
+SYSCTL_INT(_kern_geom, OID_AUTO, transient_map_soft_failures, CTLFLAG_RD,
+    &transient_map_soft_failures, 0,
+    "Count of retried failures to establish the transient mapping");

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-projects mailing list