Module Name: src Committed By: jym Date: Sat Jun 30 22:50:37 UTC 2012
Modified Files: src/sys/arch/amd64/include: pmap.h src/sys/arch/xen/include: xenpmap.h src/sys/arch/xen/x86: x86_xpmap.c xen_bus_dma.c src/sys/arch/xen/xen: balloon.c if_xennet_xenbus.c xen_machdep.c xennetback_xenbus.c Log Message: Extend the xpmap API, as described in [1]. This change is mechanical and avoids exposing the MD phys_to_machine/machine_to_phys tables directly. Added: - xpmap_ptom handles PFN (pseudo physical) to MFN (machine frame number) translations, and is under control of the domain. - xpmap_mtop is its counterpart (MFN to PFN), and is under control of hypervisor. xpmap_ptom_map() map a pseudo-phys address to a machine address xpmap_ptom_unmap() unmap a pseudo-phys address (invalidation) xpmap_ptom_isvalid() check for pseudo-phys address validity The parameters are physical/machine addresses, like bus_dma/bus_space(9). As x86 MFNs are tracked by u_long (Xen's choice) while machine addresses can be 64 bits entities (PAE), use ptoa() to avoid truncation when bit shifting by PAGE_SHIFT. I kept the same namespace (xpmap_) to avoid code churn. [1] http://mail-index.netbsd.org/port-xen/2009/05/09/msg004951.html XXX will document ptoa/atop/trunc_page separately. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/include/pmap.h cvs rdiff -u -r1.36 -r1.37 src/sys/arch/xen/include/xenpmap.h cvs rdiff -u -r1.45 -r1.46 src/sys/arch/xen/x86/x86_xpmap.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/xen/x86/xen_bus_dma.c cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/xen/balloon.c cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/if_xennet_xenbus.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/xen/xen_machdep.c cvs rdiff -u -r1.48 -r1.49 src/sys/arch/xen/xen/xennetback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.