Module Name:    src
Committed By:   snj
Date:           Mon Mar 29 00:23:12 UTC 2010

Modified Files:
        src/sys/arch/xen/x86 [netbsd-5]: xen_bus_dma.c

Log Message:
Pull up following revision(s) (requested by jym in ticket #1334):
        sys/arch/xen/x86/xen_bus_dma.c: revision 1.20
Although Xen's documentation states that the address_bits field is not used
by XENMEM_decrease_reservation, it is checked by the hypervisor. In certain
circumstances (stack leak), the field could have an improper value, leading
to a fail of the hypercall.
Set it to 0 ("no addressing restriction") to avoid that.
Patch tested by Sam Fourman and h...@.
This should fix the rare "failed allocating DMA memory" encountered
under NetBSD dom0.


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.1 -r1.11.8.2 src/sys/arch/xen/x86/xen_bus_dma.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/arch/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.1 src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.2
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.1	Sat Jan 30 19:14:20 2010
+++ src/sys/arch/xen/x86/xen_bus_dma.c	Mon Mar 29 00:23:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_bus_dma.c,v 1.11.8.1 2010/01/30 19:14:20 snj Exp $	*/
+/*	$NetBSD: xen_bus_dma.c,v 1.11.8.2 2010/03/29 00:23:12 snj Exp $	*/
 /*	NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.11.8.1 2010/01/30 19:14:20 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.11.8.2 2010/03/29 00:23:12 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -99,6 +99,7 @@
 		res.extent_start = &mfn;
 		res.nr_extents = 1;
 		res.extent_order = 0;
+		res.address_bits = 0;
 		res.domid = DOMID_SELF;
 		if (HYPERVISOR_memory_op(XENMEM_decrease_reservation, &res)
 		    < 0) {

Reply via email to