CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: jym Date: Sun Mar 11 16:16:44 UTC 2012 Modified Files: src/sys/arch/xen/x86: cpu.c Log Message: Typo fix. To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/arch/xen/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jym Date: Sun Mar 11 16:28:02 UTC 2012 Modified Files: src/sys/arch/x86/include: pmap.h Log Message: Alternate PTEs got killed a few weeks ago. Clean up unused prototypes. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/arch/x86/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: jym Date: Sun Mar 11 17:14:30 UTC 2012 Modified Files: src/sys/arch/xen/x86: xen_pmap.c Log Message: Split the map/unmap code from the sync/flush code: move xpq_flush_queue() calls after pmap_{,un}map_recursive_entries() so that pmap's handlers handle the flush themselves. Now pmap_{,un}map_recursive_entries() do what their names imply, nothing more. Fix pmap_xen_suspend()'s comment: APDPs are now gone. pmap's handlers are called deep during kernel save/restore. We already are at IPL_VM + kpreemption disabled. No need to wrap the xpq_flush_queue() with splvm/splx. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/x86/xen_pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Thu Apr 19 18:00:35 UTC 2012 Modified Files: src/sys/arch/amd64/acpi: acpi_wakecode.S src/sys/arch/amd64/amd64: locore.S mptramp.S src/sys/arch/i386/acpi: acpi_wakecode.S src/sys/arch/i386/i386: locore.S mptramp.S Log Message: Set the CR0_AM bit so processes can enable alignment check errors under x86 through PSL_AC bit. ATF test incoming shortly. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/acpi/acpi_wakecode.S cvs rdiff -u -r1.67 -r1.68 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amd64/amd64/mptramp.S cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/acpi/acpi_wakecode.S cvs rdiff -u -r1.97 -r1.98 src/sys/arch/i386/i386/locore.S cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/i386/mptramp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Thu Apr 19 18:07:05 UTC 2012 Modified Files: src/sys/arch/i386/i386: locore.S Log Message: Mirror what is done for amd64 boot and ACPI wakeup code by setting CR0_WP (write protection bit) early on boot. Although it is set later via cpu_init(), this can help tracking down invalid writes to pages mapped as read only from ring 0. No regression observed when booting under anita (QEMU) or a P4 host. Depending on your hardware or setup, you may trigger code paths I have overlooked. So if your machine does not start properly, or you get page faults early during boot, please report them to me. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/arch/i386/i386/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: jym Date: Fri Apr 20 00:40:32 UTC 2012 Modified Files: src/tests/lib/libc/gen: t_siginfo.c Log Message: ATF test for SIGBUS => BUS_ADRALN (invalid address alignment). That one is tedious to test under x86: alignment exceptions are not reported by this architecture unless you ask for them explicitely (by setting the PSL_AC bit). The brokenness does not end there: %cr2 should contain the address where the unaligned access occured, alas, it does not. I am not aware of other architectures where this could happen. Still, my knowledge is limited; if there is one, feel free to send me a mail and I will update the test accordingly. Adding insult to injury, this test can fail in various funny ways with VMs: - under x86 QEMU, no trap() happens. As ring 3 code stays almost untouched by QEMU VMM, I suppose the exception can only be triggered when the host itself is capable of catching unaligned accesses. - under Virtual Box with HVM support, i386 works fine, but amd64 fails with a SIGILL (Illegal instruction) that happens right before entering the signal handler. No idea why, and trying to debug it with gdb freezes the VM (including ddb breaks). Anyway, tested with: - i386: P4 host, anita, Virtual Box HVM (Mac OS X) - amd64: anita, Virtual Box HVM (Mac OS X) XXX I would appreciate if someone could test it under a real amd64 host with an up-to-date kernel, so I can reasonably assume that the culprit is Virtual Box and not our amd64 port (my test machine being off line I cannot do it myself). Results from other arches would be a plus too. Initial issue reported by Nicolas Joly on port-amd64. Thanks! To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/gen/t_siginfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jym Date: Fri Apr 20 18:28:43 UTC 2012 Modified Files: src/sys/arch/x86/include: psl.h Log Message: PSL_AC is user-settable. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/include/psl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/man/man2
Module Name:src Committed By: jym Date: Mon Apr 23 17:44:39 UTC 2012 Modified Files: src/share/man/man2: siginfo.2 Log Message: Note that si_addr may be inaccurate on certain architectures. Example: i386/amd64 alignement fault can drive to SIGBUS (when configured so by process), however the faulty address returned by the CPU is not reliable. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man2/siginfo.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jym Date: Sat May 5 15:08:29 UTC 2012 Modified Files: src/sys/arch/x86/include: specialreg.h Log Message: Add latest CR4 bits: - CR4_VMXE: VMX operations, used for hardware virtualization. - CR4_SMXE: SMX operations, used for safer Mode Extensions (ground for Intel's TXT - Trusted Execution Technology - platform). - CR4_FSGSBASE: enable *FSBASE and *GSBASE instructions, for R/W access to FS/GS segment base addresses. - CR4_PCIDE: enable Process Context IDentifiers (other architectures may call these "address space identifiers"). - CR4_OSXSAVE: enable xsave and xrestore instructions - CR4_SMEP: Supervisor Mode Execution Prevention. Allows enforcing --x rights from cpl 0. >From Intel® 64 and IA-32 Architectures Software Developer’s Manual, March 2012. Align declarations. CPUID_* bits for these features follow. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x86/include/specialreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Mon May 7 02:12:35 UTC 2012 Modified Files: src/sys/arch/i386/i386: db_memrw.c Log Message: I am not quite sure that __data_start (set through location counter) is a char... declare it as int, like amd64. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/i386/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Mon May 7 02:15:34 UTC 2012 Modified Files: src/sys/arch/i386/i386: db_memrw.c Log Message: Remove XXXSMP comment and explain why no TLB shootdown is required here. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/i386/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Mon May 7 02:32:09 UTC 2012 Modified Files: src/sys/arch/i386/i386: db_memrw.c Log Message: Use pmap_pte_*bits macros to set/clear bits in a PTE. Remove pmap_pte_flush calls as these operations are synchronously flushed under Xen; they should not be cached. XXX the code can be shared between i386 and amd64, but I will merge them once I figure out why db_write_text() can cause page faults for certain CPUs in long mode (code looks correct, but single stepping or adding debug printf's makes the bug magically disappear... sigh) Bug reported by David Laight on port-amd64@ when attempting to set breakpoints through ddb(4). To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/i386/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Mon May 7 12:12:04 UTC 2012 Modified Files: src/sys/arch/amd64/amd64: db_memrw.c src/sys/arch/i386/i386: db_memrw.c Log Message: Use the current destination address to compute PTE, not the address of origin. Harmless, except when db_write_text() passes a page boundary. >From Bug Hunting. XXX has to be pulled up to -5 and -6. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/amd64/db_memrw.c cvs rdiff -u -r1.28 -r1.29 src/sys/arch/i386/i386/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: jym Date: Mon May 7 12:20:27 UTC 2012 Modified Files: src/sys/arch/amd64/amd64: db_memrw.c Log Message: invlpg on a non canonical address is a noop, so no chance to invalidate the TLB and the CPU will not notice the access right change. This results in write protection faults in supervisor mode when patching kernel code through ddb(4) (originally mapped as read only). Bug reported by David Laight on port-amd64@ (thanks!), patch and test by me. i386 is unaffected as PG_LGFRAME does not mask the sign bits. For the sake of correctness, use VA_SIGN_NEG(...) anyway. XXX this is the patch that will be pulled-up to -5 and -6. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/amd64/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Mon May 7 12:23:05 UTC 2012 Modified Files: src/sys/arch/i386/i386: db_memrw.c Log Message: For correctness: do not forget VA_SIGN_NEG(). To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/i386/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Mon May 7 17:45:29 UTC 2012 Modified Files: src/sys/arch/amd64/conf: files.amd64 src/sys/arch/i386/conf: files.i386 src/sys/arch/x86/conf: files.x86 src/sys/arch/xen/conf: files.xen Added Files: src/sys/arch/x86/x86: db_memrw.c Removed Files: src/sys/arch/amd64/amd64: db_memrw.c src/sys/arch/i386/i386: db_memrw.c Log Message: Merge i386 and amd64 version of db_memrw.c. Use this opportunity to skip calculating the VA of the page. Let the CPU deal with the invalidation itself through invlpg + destination address to avoid converting between canonical/non canonical forms. To generate a diff of this commit: cvs rdiff -u -r1.11 -r0 src/sys/arch/amd64/amd64/db_memrw.c cvs rdiff -u -r1.74 -r1.75 src/sys/arch/amd64/conf/files.amd64 cvs rdiff -u -r1.362 -r1.363 src/sys/arch/i386/conf/files.i386 cvs rdiff -u -r1.30 -r0 src/sys/arch/i386/i386/db_memrw.c cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/conf/files.x86 cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/db_memrw.c cvs rdiff -u -r1.125 -r1.126 src/sys/arch/xen/conf/files.xen Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: jym Date: Tue Jun 5 22:28:11 UTC 2012 Modified Files: src/sys/kern: subr_pool.c Log Message: As pool reclaiming is unlikely to happen at interrupt or softint context, re-enable the portion of code that allows invalidation of CPU-bound pool caches. Two reasons: - CPU cached objects being invalidated, the probability of fetching an obsolete object from the pool_cache(9) is greatly reduced. This speeds up pool_cache_get() quite a bit as it does not have to keep destroying objects until it finds an updated one when an invalidation is in progress. - for situations where we have to ensure that no obsolete object remains after a state transition (canonical example: pmap mappings between Xen VM restoration), invalidating all pool_cache(9) is the safest way to go. As it uses xcall(9) to broadcast the execution of pool_cache_transfer(), pool_cache_invalidate() cannot be called from interrupt or softint context (scheduling a xcall(9) can put a LWP to sleep). pool_cache_xcall() => pool_cache_transfer() to reflect its use. Invalidation being a costly process (1000s objects may be destroyed), all places where pool_cache_invalidate() may be called from interrupt/softint context will now get caught by the proper KASSERT(), and fixed. Ping me when you see one. Tested under i386 and amd64 by running ATF suite within 64MiB HVM domains (tried triggering pgdaemon a few times). No objection on tech-kern@. XXX a similar fix has to be pulled up to NetBSD-6, but with a more conservative approach. See http://mail-index.netbsd.org/tech-kern/2012/05/29/msg013245.html To generate a diff of this commit: cvs rdiff -u -r1.195 -r1.196 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
Module Name:src Committed By: jym Date: Tue Jun 5 22:51:47 UTC 2012 Modified Files: src/external/cddl/osnet/sys/kern: misc.c src/sys/kern: subr_pool.c src/sys/rump/librump/rumpkern: memalloc.c vm.c src/sys/sys: pool.h src/sys/uvm: uvm_pdaemon.c Log Message: Now that pool_cache_invalidate() is synchronous and can handle per-CPU caches, merge together pool_drain_start() and pool_drain_end() into bool pool_drain(struct pool **ppp); "bool" value indicates whether reclaiming was fully done (true) or not (false) "ppp" will contain a pointer to the pool that was drained (optional). See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/kern/misc.c cvs rdiff -u -r1.196 -r1.197 src/sys/kern/subr_pool.c cvs rdiff -u -r1.15 -r1.16 src/sys/rump/librump/rumpkern/memalloc.c cvs rdiff -u -r1.126 -r1.127 src/sys/rump/librump/rumpkern/vm.c cvs rdiff -u -r1.74 -r1.75 src/sys/sys/pool.h cvs rdiff -u -r1.105 -r1.106 src/sys/uvm/uvm_pdaemon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: jym Date: Sun Jun 24 13:56:10 UTC 2012 Modified Files: src/sys/arch/xen/x86: cpu.c Log Message: Update comment: we stopped using xcall to sync PTP between CPUs. pmap_kpm_sync_xcall => xen_kpm_sync To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/arch/xen/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen
Module Name:src Committed By: jym Date: Sun Jun 24 18:31:53 UTC 2012 Modified Files: src/sys/arch/xen/include: xenpmap.h src/sys/arch/xen/x86: xen_pmap.c Log Message: Enable the map/unmap recursive mapping functions for all Xen ports for save/restore. For an unknown reason (to me) Xen refuses to update VM translations when the entry is pointing back to itself (which is precisely what our recursive VM model does). So enable the functions that take care of this, which will avoid all sort of memory corruption upon restore leading domU to trample upon itself. Save/restore works again for amd64. The occasional domU frontend corruption is still present, but is harmless to dom0. Now we have a working shell and ddb inside domU, that helps debugging a tiny bit. XXX pull-up to -6. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/arch/xen/include/xenpmap.h cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/x86/xen_pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Wed Jun 27 00:37:10 UTC 2012 Modified Files: src/sys/arch/amd64/amd64: machdep.c src/sys/arch/i386/conf: XEN3_DOMU src/sys/arch/i386/i386: locore.S machdep.c src/sys/arch/xen/conf: files.xen src/sys/arch/xen/include: xenpmap.h src/sys/arch/xen/include/i386: hypercalls.h src/sys/arch/xen/x86: x86_xpmap.c xen_bus_dma.c src/sys/arch/xen/xen: balloon.c if_xennet_xenbus.c privcmd.c xennetback_xenbus.c Log Message: Retire XEN_COMPAT_030001 as detailed on port-xen@: http://mail-index.netbsd.org/port-xen/2012/06/25/msg007431.html The xen_p2m API comes next. ok bouyer@. Tested on i386 PAE and amd64 (Xen 3.3 on private test bed, and Xen 3.4 for Amazon EC2). FWIW, Amazon always reported: hypervisor0 at mainbus0: Xen version 3.4.3-kaos_t1micro multiple times for Europe and US West-1, so I guess they are now at 3.4 (32 and 64 bits). To generate a diff of this commit: cvs rdiff -u -r1.186 -r1.187 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.43 -r1.44 src/sys/arch/i386/conf/XEN3_DOMU cvs rdiff -u -r1.100 -r1.101 src/sys/arch/i386/i386/locore.S cvs rdiff -u -r1.728 -r1.729 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.126 -r1.127 src/sys/arch/xen/conf/files.xen cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/include/xenpmap.h cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/include/i386/hypercalls.h cvs rdiff -u -r1.44 -r1.45 src/sys/arch/xen/x86/x86_xpmap.c cvs rdiff -u -r1.23 -r1.24 src/sys/arch/xen/x86/xen_bus_dma.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/xen/balloon.c cvs rdiff -u -r1.59 -r1.60 src/sys/arch/xen/xen/if_xennet_xenbus.c cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/xen/privcmd.c cvs rdiff -u -r1.47 -r1.48 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.
CVS commit: src/sys/arch
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.
CVS commit: src/sys/arch/xen
Module Name:src Committed By: jym Date: Sat Jun 30 23:36:20 UTC 2012 Modified Files: src/sys/arch/xen/x86: xen_bus_dma.c src/sys/arch/xen/xen: balloon.c if_xennet_xenbus.c xengnt.c xennetback_xenbus.c Log Message: Use setter to set xenguest_handles. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/x86/xen_bus_dma.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/xen/balloon.c cvs rdiff -u -r1.61 -r1.62 src/sys/arch/xen/xen/if_xennet_xenbus.c cvs rdiff -u -r1.23 -r1.24 src/sys/arch/xen/xen/xengnt.c cvs rdiff -u -r1.49 -r1.50 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.
CVS commit: src
Module Name:src Committed By: jym Date: Mon Jul 2 21:10:31 UTC 2012 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile uvm.9 Log Message: Document atop(9), ptoa(9), round_page(9) and trunc_page(9). To generate a diff of this commit: cvs rdiff -u -r1.1767 -r1.1768 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.365 -r1.366 src/share/man/man9/Makefile cvs rdiff -u -r1.106 -r1.107 src/share/man/man9/uvm.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Sun Jul 22 19:30:19 UTC 2012 Modified Files: src/sys/arch/xen/xen: xen_machdep.c Log Message: Don't leak stack content when reading the Xen suspend value. XXX pull-up to -6. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/xen/xen_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Mon Jul 23 01:31:02 UTC 2012 Modified Files: src/sys/arch/xen/xen: xbdback_xenbus.c Log Message: Add more ratechecks to avoid console spam when the backend gets a stream of errors. Remove the unused xbdi_errps (error per second) variable. Errors should rather be tracked in absolute, with a threshold that forces a time penalty to the xbdback thread when frontend goes nuts. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/xen/xbdback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: jym Date: Wed Aug 8 23:24:40 UTC 2012 Modified Files: src/doc: CHANGES.prev Log Message: Document virtio(4) addition in CHANGES. Noticed by Emmanuel Kasper on tech-kern@. virtio(4) is the VirtIO protocol used by KVM to drastically improve the performance of virtualized peripherals. virtio(4) originally written by minoura@; imported in src by hannken@ around 2011-10-30. To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/doc/CHANGES.prev Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/secmodel
Module Name:src Committed By: jym Date: Mon Jan 28 00:51:30 UTC 2013 Modified Files: src/sys/secmodel/extensions: secmodel_extensions.c src/sys/secmodel/securelevel: secmodel_securelevel.c Log Message: Re-instate backwards compatible security.models.bsd44.{curtain,securelevel}. They were mistakenly removed when curtain and securelevel moved to secmodel_extensions(9). Reported by tls@ on tech-security@. XXX will ask for pull-up for -6. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/secmodel/extensions/secmodel_extensions.c cvs rdiff -u -r1.28 -r1.29 \ src/sys/secmodel/securelevel/secmodel_securelevel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jym Date: Sat Apr 3 23:17:05 UTC 2010 Modified Files: src/sys/arch/x86/include: specialreg.h Log Message: Fix the comments about cpuid flags, according cpuid documentation by Intel and AMD. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/x86/include/specialreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: jym Date: Sun Apr 18 15:24:54 UTC 2010 Modified Files: src/sys/arch/amd64/amd64: locore.S Log Message: When kernel remaps to high memory in amd64 locore, the GDT used before becomes invalid. As such, split it in two parts, one for use when system boots in low memory, and one for use when it jumps to high memory. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/arch/amd64/amd64/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jym Date: Sun Apr 18 15:25:53 UTC 2010 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Fix a test semantic in cpu_probe(): check that the CPU currently probed is the first one booting by comparing its struct cpu_info address with cpu_info_primary, rather than supposing that cpu_feature variables are set to 0. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jym Date: Sun Apr 18 23:47:52 UTC 2010 Modified Files: src/sys/arch/amd64/amd64: locore.S machdep.c mptramp.S procfs_machdep.c src/sys/arch/i386/i386: genassym.cf machdep.c procfs_machdep.c src/sys/arch/i386/isa: npx.c src/sys/arch/x86/include: cpu.h cpuvar.h mpbiosreg.h specialreg.h src/sys/arch/x86/x86: cpu.c cpu_topology.c identcpu.c mpbios.c patch.c pmap.c tsc.c via_padlock.c x86_machdep.c src/sys/arch/xen/x86: cpu.c src/sys/compat/linux32/arch/amd64: linux32_exec.h src/sys/compat/linux32/common: linux32_exec_elf32.c Log Message: This patch fixes the NX regression issue observed on amd64 kernels, where per-page execution right was disabled (therefore leading to the inability of the kernel to detect fraudulent use of memory mappings marked as not being executable). - replace cpu_feature and ci_feature_flags variables by cpu_feature and ci_feat_val arrays. This makes it cleaner and brings kernel code closer to the design of cpuctl(8). A warning will be raised for each CPU that does not expose the same features as the Boot Processor (BP). - the blacklist of CPU features is now a macro defined in the specialreg.h header, instead of hardcoding it inside MD initialization code; fix comments. - replace checks against CPUID_TSC with the cpu_hascounter() function. - clean up the code in init_x86_64(), as cpu_feature variables are set inside cpu_probe(). - use cpu_init_msrs() for i386. It will be eventually used later for NX feature under i386 PAE kernels. - remove code that checks for CPUID_NOX in amd64 mptramp.S, this is already performed by cpu_hatch() through cpu_init_msrs(). - remove cpu_signature and feature_flags members from struct mpbios_proc (they were never used). This patch was tested with i386 MONOLITHIC, XEN3PAE_DOM0 and XEN3_DOM0 under a native i386 host, and amd64 GENERIC, XEN3_DOM0 via QEMU virtual machines. XXX Should kernel rev be bumped? XXX A similar patch should be pulled-up for NetBSD-5, hopefully tomorrow. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.143 -r1.144 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/amd64/mptramp.S cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amd64/amd64/procfs_machdep.c cvs rdiff -u -r1.85 -r1.86 src/sys/arch/i386/i386/genassym.cf cvs rdiff -u -r1.684 -r1.685 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/i386/procfs_machdep.c cvs rdiff -u -r1.135 -r1.136 src/sys/arch/i386/isa/npx.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/mpbiosreg.h cvs rdiff -u -r1.39 -r1.40 src/sys/arch/x86/include/specialreg.h cvs rdiff -u -r1.69 -r1.70 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/x86/cpu_topology.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x86/x86/mpbios.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/patch.c cvs rdiff -u -r1.106 -r1.107 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x86/x86/tsc.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/via_padlock.c cvs rdiff -u -r1.39 -r1.40 src/sys/arch/x86/x86/x86_machdep.c cvs rdiff -u -r1.42 -r1.43 src/sys/arch/xen/x86/cpu.c cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux32/arch/amd64/linux32_exec.h cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_exec_elf32.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: jym Date: Tue Apr 20 15:42:21 UTC 2010 Modified Files: src/sys/arch/amd64/amd64: mptramp.S Log Message: Enable the NX bit feature early in the MP trampoline code (do not rely on cpu_init_msrs() to do it). Having NX bit set on a page will raise a #GP on fetch if NXE is not enabled, which can happen early when structures (like idlelwp) are allocated with just rw- rights. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/amd64/mptramp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Thu Apr 22 21:02:25 UTC 2010 Modified Files: src/sys/arch/i386/i386: pmc.c Log Message: CPUID_TSC => cpu_hascounter(). This one was missing in my cpu_feature rework patch. Should fix the i386/ALL build issue many have reported. Thanks! To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/i386/pmc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jym Date: Thu Apr 22 21:47:32 UTC 2010 Modified Files: src/sys/arch/x86/x86: via_padlock.c Log Message: Uses cpu_feature, so include To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/via_padlock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Tue May 4 23:27:14 UTC 2010 Modified Files: src/sys/arch/amd64/amd64: machdep.c src/sys/arch/i386/i386: machdep.c trap.c src/sys/arch/i386/include: pte.h src/sys/arch/x86/include: specialreg.h src/sys/arch/x86/x86: pmap.c src/sys/arch/xen/x86: cpu.c Log Message: Enable the NX bit feature for Xen i386pae and amd64 kernels. Tested with Xen 3.1 and Xen 3.3, dom0 and domU, by bouyer@ and j...@. Ok bou...@. To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.686 -r1.687 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.256 -r1.257 src/sys/arch/i386/i386/trap.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/include/pte.h cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/include/specialreg.h cvs rdiff -u -r1.107 -r1.108 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: jym Date: Tue May 4 23:31:54 UTC 2010 Modified Files: src/doc: CHANGES Log Message: xen: Enable no-execute bit feature for i386pae and amd64 kernels. To generate a diff of this commit: cvs rdiff -u -r1.1390 -r1.1391 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/sys/dev/isa
Module Name:src Committed By: jym Date: Sun May 23 23:50:37 UTC 2010 Modified Files: src/sys/dev/isa: i82365_isasubr.c Log Message: Cast the sum of iobase and iosize to long, not just iobase. Avoids size warnings during build when bus_addr_t is 64 bits. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/dev/isa/i82365_isasubr.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/isapnp
Module Name:src Committed By: jym Date: Sun May 23 23:53:36 UTC 2010 Modified Files: src/sys/dev/isapnp: i82365_isapnp.c Log Message: PRIxPADDR instead of %lx to print bus_addr_t/paddr_t variables. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/isapnp/i82365_isapnp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Wed Jul 14 14:42:40 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c Log Message: Fix typo in comment. To generate a diff of this commit: cvs rdiff -u -r1.687 -r1.688 src/sys/arch/i386/i386/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Thu Jul 15 18:55:27 UTC 2010 Modified Files: src/sys/arch/i386/i386: locore.S Log Message: In Xen PAE case, fix argument size passed to init386(), by pushing the upper bits onto stack (we do not expect first_avail to be above 4GiB, so assume their value is 0). Remove macros (PROC0PDIR and PROC0STACK) that were never used. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/arch/i386/i386/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: jym Date: Thu Jul 15 18:58:41 UTC 2010 Modified Files: src/sys/arch/i386/include: pmap.h Log Message: Purely cosmetic: move L2_SLOT_KERNBASE out of the PAE #ifdef/#endif block. To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/arch/i386/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: jym Date: Thu Jul 15 19:02:26 UTC 2010 Modified Files: src/sys/arch/x86/include: pmap.h Log Message: Make the comment about PDPpaddr more thorough. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jym Date: Thu Jul 15 21:14:32 UTC 2010 Modified Files: src/sys/arch/x86/x86: pmap.c Log Message: Check the virtual address 'va' for each PDIR_SLOT_PTE entry. PDP_SIZE is 4 with PAE (Xen only currently), 1 otherwise: loop should be unrolled when PDP_SIZE is 1. pmap_alloc_level() is used by pmap_growkernel(), the PDE is a kernel mapping: mark it so with PG_k. While here, use pmap_pa2pte() for physical address 'pa'. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.111 -r1.112 src/sys/arch/x86/x86/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Thu Jul 15 22:19:19 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c Log Message: pte0 is used to map the page required by bioscall() trampoline code, so add VM_PROT_EXECUTE protection for it. Currently, this does not change much, as page execute permission is not enforced for i386 (except for Xen, where BIOS calls are not used anyway). To generate a diff of this commit: cvs rdiff -u -r1.688 -r1.689 src/sys/arch/i386/i386/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Thu Jul 15 23:20:34 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c src/sys/arch/xen/x86: x86_xpmap.c Log Message: With Xen, PDPpaddr should contain a guest physical address (== PFN). To generate a diff of this commit: cvs rdiff -u -r1.689 -r1.690 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/x86/x86_xpmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Sat Jul 24 00:45:57 UTC 2010 Modified Files: src/sys/arch/i386/conf: GENERIC src/sys/arch/i386/i386: bioscall.S kvm86call.S locore.S machdep.c mptramp.S multiboot.c src/sys/arch/i386/include: pmap.h src/sys/arch/x86/include: cpu.h pmap.h src/sys/arch/x86/x86: cpu.c pmap.c src/sys/arch/xen/x86: cpu.c x86_xpmap.c xenfunc.c Log Message: Welcome PAE inside i386 current. This patch is inspired by work previously done by Jeremy Morse, ported by me to -current, merged with the work previously done for port-xen, together with additionals fixes and improvements. PAE option is disabled by default in GENERIC (but will be enabled in ALL in the next few days). In quick, PAE switches the CPU to a mode where physical addresses become 36 bits (64 GiB). Virtual address space remains at 32 bits (4 GiB). To cope with the increased size of the physical address, they are manipulated as 64 bits variables by kernel and MMU. When supported by the CPU, it also allows the use of the NX/XD bit that provides no-execution right enforcement on a per physical page basis. Notes: - reworked locore.S - introduce cpu_load_pmap(), used to switch pmap for the curcpu. Due to the different handling of pmap mappings with PAE vs !PAE, Xen vs native, details are hidden within this function. This helps calling it from assembly, as some features, like BIOS calls, switch to pmap_kernel before mapping trampoline code in low memory. - some changes in bioscall and kvm86_call, to reflect the above. - the L3 is "pinned" per-CPU, and is only manipulated by a reduced set of functions within pmap. To track the L3, I added two elements to struct cpu_info, namely ci_l3_pdirpa (PA of the L3), and ci_l3_pdir (the L3 VA). Rest of the code considers that it runs "just like" a normal i386, except that the L2 is 4 pages long (PTP_LEVELS is still 2). - similar to the ci_pae_l3_pdir{,pa} variables, amd64's xen_current_user_pgd becomes an element of cpu_info (slowly paving the way for MP world). - bootinfo_source struct declaration is modified, to cope with paddr_t size change with PAE (it is not correct to assume that bs_addr is a paddr_t when compiled with PAE - it should remain 32 bits). bs_addrs is now a void * array (in bootloader's code under i386/stand/, the bs_addrs is a physaddr_t, which is an unsigned long). - fixes in multiboot code (same reason as bootinfo): paddr_t size change. I used Elf32_* types, use RELOC() where necessary, and move the memcpy() functions out of the if/else if (I do not expect sym and str tables to overlap with ELF). - 64 bits atomic functions for pmap - all pmap_pdirpa access are now done through the pmap_pdirpa macro. It hides the L3/L2 stuff from PAE, as well as the pm_pdirpa change in struct pmap (it now becomes a PDP_SIZE array, with or without PAE). - manipulation of recursive mappings ( PDIR_SLOT_{,A}PTEs ) is done via loops on PDP_SIZE. See also http://mail-index.netbsd.org/port-i386/2010/07/17/msg002062.html No objection raised on port-i386@ and port-...@r for about a week. XXX kvm(3) will be fixed in another patch to properly handle both PAE and !PAE kernel dumps (VA => PA macros are slightly different, and need proper 64 bits PA support in kvm_i386). XXX Mixing PAE and !PAE modules may lead to unwanted/unexpected results. This cannot be solved easily, and needs lots of thinking before being declared safe (paddr_t/bus_addr_t size handling, PD/PT macros abstractions). To generate a diff of this commit: cvs rdiff -u -r1.988 -r1.989 src/sys/arch/i386/conf/GENERIC cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/i386/bioscall.S cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/i386/kvm86call.S cvs rdiff -u -r1.92 -r1.93 src/sys/arch/i386/i386/locore.S cvs rdiff -u -r1.690 -r1.691 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/i386/mptramp.S cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/i386/multiboot.c cvs rdiff -u -r1.106 -r1.107 src/sys/arch/i386/include/pmap.h cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/include/pmap.h cvs rdiff -u -r1.72 -r1.73 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.112 -r1.113 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.46 -r1.47 src/sys/arch/xen/x86/cpu.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/xen/x86/x86_xpmap.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/x86/xenfunc.c 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
Module Name:src Committed By: jym Date: Sat Jul 24 23:09:32 UTC 2010 Modified Files: src/share/man/man4: options.4 Log Message: Document PAE. To generate a diff of this commit: cvs rdiff -u -r1.393 -r1.394 src/share/man/man4/options.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/mach
Module Name:src Committed By: jym Date: Sun Jul 25 11:25:57 UTC 2010 Modified Files: src/sys/compat/mach: mach_exec.c Log Message: Add reference to mach_syscallnames. Spotted by compiling ALL. To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/compat/mach/mach_exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jym Date: Mon Jul 26 22:33:25 UTC 2010 Modified Files: src/sys/arch/i386/conf: ALL src/sys/arch/i386/pci: pcibios.c piixpcib.c src/sys/arch/i386/pnpbios: pnpbios.c src/sys/arch/x86/pci: pci_addr_fixup.c src/sys/compat/ndis: subr_ndis.c src/sys/dev/ic: ciss.c src/sys/dev/isa: isadma.c src/sys/dev/pci: cz.c if_sk.c if_wm.c yds.c Log Message: Add PAE to ALL kernel, so that most paddr_t format string errors get caught during compilation. While here, fix the compilation for ALL. To generate a diff of this commit: cvs rdiff -u -r1.261 -r1.262 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/pci/pcibios.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/pci/piixpcib.c cvs rdiff -u -r1.69 -r1.70 src/sys/arch/i386/pnpbios/pnpbios.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/pci/pci_addr_fixup.c cvs rdiff -u -r1.22 -r1.23 src/sys/compat/ndis/subr_ndis.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/ciss.c cvs rdiff -u -r1.64 -r1.65 src/sys/dev/isa/isadma.c cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/cz.c cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_sk.c cvs rdiff -u -r1.213 -r1.214 src/sys/dev/pci/if_wm.c cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/yds.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: jym Date: Mon Jul 26 22:40:11 UTC 2010 Modified Files: src/doc: CHANGES Log Message: Announce PAE for i386. To generate a diff of this commit: cvs rdiff -u -r1.1421 -r1.1422 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/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Wed Jul 28 17:05:51 UTC 2010 Modified Files: src/sys/arch/i386/i386: mptramp.S Log Message: Enable the NX bit feature early in i386 MP trampoline code (do not rely on cpu_init_msrs() to do it). Having NX bit set on a page will raise a #GP on fetch if NXE is not enabled, which can happen early when structures (like idlelwp) are allocated with just rw- rights. NX is enabled with PAE (if host supports it). Exact same issue as for amd64, some weeks ago. Same player, shoot again... To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/i386/mptramp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jym Date: Sat Aug 7 22:31:58 UTC 2010 Modified Files: src/sys/arch/x86/x86: est.c Log Message: Use aprint_debug_dev(). Caught thanks to coccinelle. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/est.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: jym Date: Sun Aug 8 00:48:46 UTC 2010 Modified Files: src/sys/arch/x86/x86: intel_busclock.c Log Message: Some core i7 CPUs report model 0c. In this case, check for the extended model value. Required to avoid faulting on rdmsr(MSR_FSB_FREQ) early during boot. Will ask for a pull-up. This affects GENERIC, and most likely, install iso too. XXX quick hack. Obtaining FSB through ACPI should be cleaner. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/intel_busclock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jym Date: Sat Aug 14 18:28:59 UTC 2010 Modified Files: src/sys/dev/ieee1394: firewire.c src/sys/netinet6: esp_aesctr.c esp_core.c Log Message: Fix some code paths where pointers are dereferenced after checking that they are NULL (oops?) XXX pull-ups for NetBSD-4 and NetBSD-5. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/ieee1394/firewire.c cvs rdiff -u -r1.12 -r1.13 src/sys/netinet6/esp_aesctr.c cvs rdiff -u -r1.45 -r1.46 src/sys/netinet6/esp_core.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/spi
Module Name:src Committed By: jym Date: Sat Aug 14 20:49:22 UTC 2010 Modified Files: src/sys/dev/spi: spi.c Log Message: Fix the while condition: sleep while the SPI_F_DONE bit is not set. '!' takes precedence over bitwise operation '&', so use parenthesis. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/spi/spi.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/sun
Module Name:src Committed By: jym Date: Sat Aug 14 20:52:05 UTC 2010 Modified Files: src/sys/dev/sun: sunkbd.c Log Message: Flush tty only when K_TXBUSY is not set. '!' takes precedence over bitwise operation '&', so use parenthesis. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sun/sunkbd.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/usb
Module Name:src Committed By: jym Date: Sat Aug 14 21:01:26 UTC 2010 Modified Files: src/sys/dev/usb: if_atu.c Log Message: Only print the debug message about failed remapping when ATU_QUIRK_NO_REMAP is not set in the atu_quirk flags. '!' takes precedence over bitwise operation '&', so use parenthesis. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/if_atu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Mon Aug 16 19:39:06 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c src/sys/arch/x86/include: cpu.h Log Message: Add machdep.pae sysctl(7) for i386. Thanks to Paul and Joerg for their reviews. In kernel, it matches the 'i386_use_pae' variable (0: kernel does not use PAE, 1: kernel uses PAE). Will be used by i386 kvm(3) to know the functions that should get called for VA => PA translations. To generate a diff of this commit: cvs rdiff -u -r1.692 -r1.693 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Tue Aug 17 22:24:05 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c Log Message: Use SYSCTL_DESCR() To generate a diff of this commit: cvs rdiff -u -r1.693 -r1.694 src/sys/arch/i386/i386/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: jym Date: Tue Sep 14 21:34:03 UTC 2010 Modified Files: src/sys/arch/i386/include: pte.h Log Message: Add ULL suffix to PG_NX when it is defined. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/i386/include/pte.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/miscfs/procfs
Module Name:src Committed By: jym Date: Wed Sep 15 21:37:36 UTC 2010 Modified Files: src/sys/miscfs/procfs: procfs_map.c Log Message: Use PRIxVADDR to print vaddr_t elements. Wrap lines. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/miscfs/procfs/procfs_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/lib/libsa
Module Name:src Committed By: jym Date: Thu Sep 16 00:26:50 UTC 2010 Modified Files: src/sys/lib/libsa: loadfile_elf32.c Log Message: Use standard ELF types for ELF code, instead of paddr_t. paddr_t should only be used for low level code, like virtual memory internals. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/lib/libsa/loadfile_elf32.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libkvm
Module Name:src Committed By: jym Date: Sun Sep 19 02:07:01 UTC 2010 Modified Files: src/lib/libkvm: kvm_alpha.c kvm_arm.c kvm_file.c kvm_getloadavg.c kvm_i386.c kvm_m68k.c kvm_m68k.h kvm_m68k_cmn.c kvm_mips.c kvm_powerpc.c kvm_powerpc64.c kvm_private.h kvm_proc.c kvm_sh3.c kvm_sparc.c kvm_sparc64.c kvm_sun2.c kvm_sun3.c kvm_sun3x.c kvm_vax.c kvm_x86_64.c Log Message: Ansify and KNF all functions within kvm(3). No objection on current-us...@. Used as ground for u_long => vaddr_t/paddr_t replacements in kvm(3) private functions. Compile tested for all arches. See also: http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/lib/libkvm/kvm_alpha.c cvs rdiff -u -r1.4 -r1.5 src/lib/libkvm/kvm_arm.c src/lib/libkvm/kvm_m68k.h cvs rdiff -u -r1.26 -r1.27 src/lib/libkvm/kvm_file.c \ src/lib/libkvm/kvm_i386.c cvs rdiff -u -r1.8 -r1.9 src/lib/libkvm/kvm_getloadavg.c cvs rdiff -u -r1.16 -r1.17 src/lib/libkvm/kvm_m68k.c \ src/lib/libkvm/kvm_private.h src/lib/libkvm/kvm_vax.c cvs rdiff -u -r1.13 -r1.14 src/lib/libkvm/kvm_m68k_cmn.c \ src/lib/libkvm/kvm_sparc64.c cvs rdiff -u -r1.18 -r1.19 src/lib/libkvm/kvm_mips.c cvs rdiff -u -r1.9 -r1.10 src/lib/libkvm/kvm_powerpc.c \ src/lib/libkvm/kvm_sun3x.c cvs rdiff -u -r1.2 -r1.3 src/lib/libkvm/kvm_powerpc64.c cvs rdiff -u -r1.84 -r1.85 src/lib/libkvm/kvm_proc.c cvs rdiff -u -r1.6 -r1.7 src/lib/libkvm/kvm_sh3.c src/lib/libkvm/kvm_x86_64.c cvs rdiff -u -r1.30 -r1.31 src/lib/libkvm/kvm_sparc.c cvs rdiff -u -r1.3 -r1.4 src/lib/libkvm/kvm_sun2.c cvs rdiff -u -r1.12 -r1.13 src/lib/libkvm/kvm_sun3.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libkvm
Module Name:src Committed By: jym Date: Sun Sep 19 11:37:40 UTC 2010 Modified Files: src/lib/libkvm: kvm_powerpc.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libkvm/kvm_powerpc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libkvm
Module Name:src Committed By: jym Date: Mon Sep 20 23:23:16 UTC 2010 Modified Files: src/lib/libkvm: kvm.c kvm_alpha.c kvm_arm.c kvm_hppa.c kvm_i386.c kvm_m68k.c kvm_m68k.h kvm_m68k_cmn.c kvm_mips.c kvm_powerpc.c kvm_powerpc64.c kvm_private.h kvm_proc.c kvm_sh3.c kvm_sparc.c kvm_sparc64.c kvm_sun2.c kvm_sun3.c kvm_sun3x.c kvm_vax.c kvm_x86_64.c Log Message: Change kvm_pa2off() and kvm_kvatop() prototypes (private to kvm(3)): -int _kvm_kvatop(kvm_t *, u_long, u_long *); -off_t _kvm_pa2off(kvm_t *, u_long); +int _kvm_kvatop(kvm_t *, vaddr_t, paddr_t *); +off_t _kvm_pa2off(kvm_t *, paddr_t); Basically, use vaddr_t for VA and paddr_t for PA. In addition, for variables representing addresses, use paddr_t or vaddr_t, depending on the context. For most arches, vaddr_t and paddr_t are equivalent to unsigned long. However, the change was needed for exotic situations, like i386 PAE, were unsigned long is not suitable for PA which are 64 bits long. As this required a complete change of the function prototypes, all arches had to be adapted accordingly. Core files from before this commit should still work with the new code; I did not see any direct dependency between core's structure and kvatop/pa2off. The change was compile tested for all arches, as it impacts all of them. See also: http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/lib/libkvm/kvm.c cvs rdiff -u -r1.24 -r1.25 src/lib/libkvm/kvm_alpha.c cvs rdiff -u -r1.5 -r1.6 src/lib/libkvm/kvm_arm.c src/lib/libkvm/kvm_hppa.c \ src/lib/libkvm/kvm_m68k.h cvs rdiff -u -r1.27 -r1.28 src/lib/libkvm/kvm_i386.c cvs rdiff -u -r1.17 -r1.18 src/lib/libkvm/kvm_m68k.c \ src/lib/libkvm/kvm_private.h src/lib/libkvm/kvm_vax.c cvs rdiff -u -r1.14 -r1.15 src/lib/libkvm/kvm_m68k_cmn.c \ src/lib/libkvm/kvm_sparc64.c cvs rdiff -u -r1.19 -r1.20 src/lib/libkvm/kvm_mips.c cvs rdiff -u -r1.11 -r1.12 src/lib/libkvm/kvm_powerpc.c cvs rdiff -u -r1.3 -r1.4 src/lib/libkvm/kvm_powerpc64.c cvs rdiff -u -r1.85 -r1.86 src/lib/libkvm/kvm_proc.c cvs rdiff -u -r1.7 -r1.8 src/lib/libkvm/kvm_sh3.c src/lib/libkvm/kvm_x86_64.c cvs rdiff -u -r1.31 -r1.32 src/lib/libkvm/kvm_sparc.c cvs rdiff -u -r1.4 -r1.5 src/lib/libkvm/kvm_sun2.c cvs rdiff -u -r1.13 -r1.14 src/lib/libkvm/kvm_sun3.c cvs rdiff -u -r1.10 -r1.11 src/lib/libkvm/kvm_sun3x.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: jym Date: Tue Sep 21 00:18:05 UTC 2010 Modified Files: src/sys/arch/i386/include: types.h Log Message: Promote paddr_t to 64 bits for i386 userland (non PAE and PAE). paddr_t has limited interest in userland, and should only be used by specific code like kvm(3) (for VA => PA translations). To support non PAE and PAE kernels simultaneously in kvm(3), promote paddr_t to 64 bits. No objection on current-us...@. See also: http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html Kernel remains untouched by this change. In-kernel 64 bits for paddr_t is for a future commit (Yes, I do not forget about that :) ) To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/i386/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libkvm
Module Name:src Committed By: jym Date: Sun Sep 26 22:28:05 UTC 2010 Modified Files: src/lib/libkvm: kvm_file.c kvm_getloadavg.c kvm_m68k_cmn.c kvm_private.h kvm_proc.c Log Message: Define KREAD() inside kvm_private.h, for reusability. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/lib/libkvm/kvm_file.c cvs rdiff -u -r1.9 -r1.10 src/lib/libkvm/kvm_getloadavg.c cvs rdiff -u -r1.15 -r1.16 src/lib/libkvm/kvm_m68k_cmn.c cvs rdiff -u -r1.18 -r1.19 src/lib/libkvm/kvm_private.h cvs rdiff -u -r1.86 -r1.87 src/lib/libkvm/kvm_proc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: jym Date: Sat Oct 2 21:52:15 UTC 2010 Modified Files: src/sys/dev/pci: agp.c src/sys/sys: agpio.h Log Message: Revert christos@ fix for the i386 paddr_t change and agp_allocate. Make 'physical' element of the struct agp_allocate an uint32_t. This is similar to what other kernels do (at least Solaris and Linux). This patch should make xserver work again within an i386 userland in a 64 bits paddr_t world. Thanks to Iain Hibbert for reporting the break, and providing initial hints. See http://mail-index.netbsd.org/current-users/2010/09/27/msg014418.html To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/agp.c cvs rdiff -u -r1.8 -r1.9 src/sys/sys/agpio.h 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
Module Name:src Committed By: jym Date: Sat Oct 2 22:49:06 UTC 2010 Modified Files: src/share/man/man4: agp.4 Log Message: Update agp(4) to reflect the agp_allocate modification. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/agp.4 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
Module Name:src Committed By: jym Date: Sat Oct 2 22:51:50 UTC 2010 Modified Files: src/share/man/man4: agp.4 Log Message: Bump date. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/agp.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: jym Date: Sat Oct 2 22:53:50 UTC 2010 Modified Files: src/sys/arch/i386/include: pte.h Log Message: Update the comment for PG_PS when used with PAE. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/include/pte.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: jym Date: Sat Oct 2 22:54:47 UTC 2010 Modified Files: src/sys/arch/i386/i386: dumpsys.c Log Message: dump is not used here. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/i386/dumpsys.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: jym Date: Tue Oct 5 23:48:16 UTC 2010 Modified Files: src/lib/libkvm: Makefile kvm_i386.c src/sys/arch/i386/i386: dumpsys.c src/sys/arch/i386/include: kcore.h Added Files: src/lib/libkvm: kvm_i386pae.c Log Message: Import PAE support for kvm(3): - add kvm_i386pae.c (used for PAE memory translations), and update Makefile for libkvm build. - in pdppaddr: pass a flag to indicate PAE mode. Use a bit ignored by the MMU. Mask address with PG_FRAME to avoid side effects. Tested with vmstat(1)/netstat(1) to debug core files of PAE and !PAE kernels. Older kernel dumps will default to native i386 (!PAE) mode. XXX Currently, savecore(8) will fail to dump a PAE kernel in a !PAE environment (and reciprocally). So you need to sync and reboot with a kernel of the same mode as the one that crashed. Once the dump is successful, this does not matter anymore. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/lib/libkvm/Makefile cvs rdiff -u -r1.28 -r1.29 src/lib/libkvm/kvm_i386.c cvs rdiff -u -r0 -r1.1 src/lib/libkvm/kvm_i386pae.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/i386/dumpsys.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/include/kcore.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Tue Jun 7 16:41:14 UTC 2011 Modified Files: src/sys/arch/xen/xen: xbdback_xenbus.c Log Message: Be more consistent for event handler naming with block backend: it is xbdback(4) rather than xbd(4), and use i for identifier separation (like xvif(4)). The name is not used outside from event counters (vmstat -i), so should be transparent to Xen block scripts. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/xen/xen/xbdback_xenbus.c 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
Module Name:src Committed By: jym Date: Tue Jun 7 17:13:43 UTC 2011 Modified Files: src/share/man/man4: xbdback.4 Log Message: Document the naming convention. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/xbdback.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen
Module Name:src Committed By: jym Date: Sat Jul 2 19:07:56 UTC 2011 Modified Files: src/sys/arch/xen/xen: evtchn.c src/sys/arch/xen/xenbus: xenbus_comms.c Log Message: Remove all return error checks for event_set_handler(...). It either succeeds or end in panic. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/xen/xen/evtchn.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/xenbus/xenbus_comms.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
Module Name:src Committed By: jym Date: Fri Jul 15 11:29:31 UTC 2011 Modified Files: src/sys/dev/pci: if_bnx.c if_bnxvar.h Log Message: Use a workqueue(9) to defer allocation of TX packets. Loosely inspired from the OpenBSD bnx(4) driver. Tested by Roger Pau Monné, roger.pau at entel.upc.edu. Fixes kern/45051. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/if_bnx.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_bnxvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: jym Date: Sun Jul 17 15:16:59 UTC 2011 Modified Files: src/sys/arch/amd64/amd64: machdep.c Log Message: CR4_PAE is always set to 1 under amd64, so indicate that PAE mode is enabled. Can be useful for 32-bits test runs on amd64 hosts. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/arch/amd64/amd64/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc
Module Name:src Committed By: jym Date: Mon Jul 18 23:16:11 UTC 2011 Modified Files: src/tests/lib/libc/sys: Makefile t_mprotect.c Added Files: src/tests/lib/libc/arch: Makefile.exec_prot src/tests/lib/libc/arch/alpha: exec_prot_support.c return_one.S src/tests/lib/libc/arch/arm: exec_prot_support.c return_one.S src/tests/lib/libc/arch/hppa: exec_prot_support.c return_one.S src/tests/lib/libc/arch/i386: exec_prot_support.c return_one.S src/tests/lib/libc/arch/ia64: exec_prot_support.c return_one.S src/tests/lib/libc/arch/m68k: exec_prot_support.c return_one.S src/tests/lib/libc/arch/mips: exec_prot_support.c return_one.S src/tests/lib/libc/arch/powerpc: exec_prot_support.c return_one.S src/tests/lib/libc/arch/powerpc64: exec_prot_support.c return_one.S src/tests/lib/libc/arch/sh3: exec_prot_support.c return_one.S src/tests/lib/libc/arch/sparc: exec_prot_support.c return_one.S src/tests/lib/libc/arch/sparc64: exec_prot_support.c return_one.S src/tests/lib/libc/arch/vax: exec_prot_support.c return_one.S src/tests/lib/libc/arch/x86_64: exec_prot_support.c return_one.S src/tests/lib/libc/common: exec_prot.h Log Message: Add a simple test case to check executable mapping rights for mprotect(2). - provide an exec_prot_support() routine so $ARCH can indicate whether it supports execution protection or not, and skip test accordingly. - have a trivial 'return_one' shellcode to copy anywhere in a page, and call it. The decision to keep the assembly solution is mine, reasons are twofold: - all pure-C implementations cannot be controlled easily: bounds detection (beginning/end) of return_one is unpredictable, or requires the use of overkill solutions like libelf. Using dlsym(3) was a good proposal, however I can't use it to know the end address of the payload. It makes copying of the shellcode a bit more difficult: using a constant may be too small (code has not been entirely copied, and can lead to errors that can be erroneously detected as "test passed"), or too big (depending on where it is mapped in memory, copying past the end of the function may trigger SIGSEGV). - I have to ensure that the resulting assembly is the most compact possible, especially as it will be reused to test other parts of memory (stack, data, rodata, etc.). Only i386 and amd64 are implemented so far. Others will come in due time. FWIW, writing the exec_prot_support() callback and the return_one payload should be enough. Writing callback requires good knowledge of the platform, depending on chip revision, CPU, board, MMU... the protection level may vary. Current files are put under lib/libc/arch/* and lib/libc/common/. Feel free to move them around the tests/ tree. Keep in mind that the common/ and arch/ code will be used outside of libc, so please do not hide them too deep in the tree. I checked a few architectures via build.sh cross-compile, and will keep an eye on buildbot for potential build breakage. Feel free to contact me in case you see any, of course. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/Makefile.exec_prot cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/alpha/exec_prot_support.c \ src/tests/lib/libc/arch/alpha/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/arm/exec_prot_support.c \ src/tests/lib/libc/arch/arm/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/hppa/exec_prot_support.c \ src/tests/lib/libc/arch/hppa/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/i386/exec_prot_support.c \ src/tests/lib/libc/arch/i386/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/ia64/exec_prot_support.c \ src/tests/lib/libc/arch/ia64/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/m68k/exec_prot_support.c \ src/tests/lib/libc/arch/m68k/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/mips/exec_prot_support.c \ src/tests/lib/libc/arch/mips/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/powerpc/exec_prot_support.c \ src/tests/lib/libc/arch/powerpc/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/powerpc64/exec_prot_support.c \ src/tests/lib/libc/arch/powerpc64/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/sh3/exec_prot_support.c \ src/tests/lib/libc/arch/sh3/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/sparc/exec_prot_support.c \ src/tests/lib/libc/arch/sparc/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/sparc64/exec_prot_support.c \ src/tests/lib/libc/arch/sparc64/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/vax/exec_prot_support.c \ src/tests/lib/libc/arch/vax/return_one.S cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/arch/x86_64/exec_prot_support.c \ src/tests/lib/libc/arch/x86_64/return_one
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: jym Date: Wed Jul 20 22:53:44 UTC 2011 Modified Files: src/tests/lib/libc/sys: t_mprotect.c Log Message: Modify exec test to be more resilient regarding partial exec protection: skip test instead of returning a failure that could be misinterpreted. Suggested by Jukka in private mail. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_mprotect.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch
Module Name:src Committed By: jym Date: Fri Jul 22 22:50:56 UTC 2011 Modified Files: src/crypto/external/bsd/openssl/lib/libcrypto/arch/i386: aesni-586.S aesni-x86.S src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64: aesni-x86_64.S Log Message: Turn AES NI support code into something more readable. i386 and amd64 both tested with their own chroot. No regression observed. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/i386/aesni-586.S cvs rdiff -u -r1.2 -r1.3 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/i386/aesni-x86.S cvs rdiff -u -r1.1 -r1.2 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aesni-x86_64.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: jym Date: Sat Jul 23 11:38:28 UTC 2011 Modified Files: src/sys/kern: init_sysctl.c Log Message: When KERN_SA is not defined, kern.no_sa_support is a constant (1). So add CTLFLAG_IMMEDIATE to flags. Make the macro block logically reversed so it looks more natural when reading. Reported by Peter Tworek on tech-kern@. To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/sys/kern/init_sysctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/man/man9
Module Name:src Committed By: jym Date: Sat Jul 23 16:02:15 UTC 2011 Modified Files: src/share/man/man9: driver.9 Log Message: struct device => device_t. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/driver.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/man/man9
Module Name:src Committed By: jym Date: Sat Jul 23 16:04:35 UTC 2011 Modified Files: src/share/man/man9: driver.9 Log Message: And struct cfdata => cfdata_t too... To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/driver.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Sun Jul 24 23:56:34 UTC 2011 Modified Files: src/sys/arch/xen/xen: xbdback_xenbus.c Log Message: Add more comments to xbdback(4) code. These make the continuations a bit easier to follow (and understand). Helped tracking down a regression between save/restore xbdback(4) states. A few minor fixes, which are merely cosmetic: - call graph is (somewhat) more readable - rework the xbdback_do_io routine with a switch statement, so as to trigger a panic() in case an invalid operation passed through the sanity checks. panic might be overkill here, but I am sure to catch errrors in case it happens. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/xen/xbdback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Mon Jul 25 00:02:39 UTC 2011 Modified Files: src/sys/arch/xen/xen: xbd_xenbus.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/xen/xen/xbd_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Mon Jul 25 00:06:49 UTC 2011 Modified Files: src/sys/arch/xen/xen: xbd_xenbus.c Log Message: And... explain xbd(4). To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/arch/xen/xen/xbd_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [jym-xensuspend] src/sys/arch/xen
Module Name:src Committed By: jym Date: Mon Jul 25 00:18:28 UTC 2011 Modified Files: src/sys/arch/xen/xen [jym-xensuspend]: evtchn.c if_xennet_xenbus.c xbd_xenbus.c src/sys/arch/xen/xenbus [jym-xensuspend]: xenbus_comms.c Log Message: Pull-up to my branch some of the improvements I committed to HEAD, but forgot to reflect here. Improvements in the attachement routines: in case of error, don't forget to free() the allocated rings. Should not happen anyway, more a matter of staying clean. To generate a diff of this commit: cvs rdiff -u -r1.42.2.6 -r1.42.2.7 src/sys/arch/xen/xen/evtchn.c cvs rdiff -u -r1.33.2.11 -r1.33.2.12 src/sys/arch/xen/xen/if_xennet_xenbus.c cvs rdiff -u -r1.38.2.10 -r1.38.2.11 src/sys/arch/xen/xen/xbd_xenbus.c cvs rdiff -u -r1.12.2.3 -r1.12.2.4 src/sys/arch/xen/xenbus/xenbus_comms.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64
Module Name:src Committed By: jym Date: Mon Jul 25 19:11:49 UTC 2011 Modified Files: src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64: aesni-x86_64.S Log Message: Get rid of the "rep ret" trick in places where it is not needed. FWIW, the "rep ret" trick is recommended by AMD as a branch prediction optimization in certain circumstances (quoting their manual): - any kind of branch (either conditional or unconditional) that has the single-byte near-return RET instruction as its target - a conditional branch that occurs in the code directly before the single-byte near-return RET instruction. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aesni-x86_64.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Fri Jul 29 22:16:05 UTC 2011 Modified Files: src/sys/arch/xen/xen: balloon.c clock.c Log Message: Move xen.balloon to machdep in the sysctl(7) tree. It does not really belong to either kern or hw. Rename machdep.xen_timepush_ticks to xen.timepush_ticks, so it can live under the same tree as the balloon node, machdep.xen. ok bouyer@. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/xen/balloon.c cvs rdiff -u -r1.54 -r1.55 src/sys/arch/xen/xen/clock.c 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/man4.x86
Module Name:src Committed By: jym Date: Sat Jul 30 09:39:20 UTC 2011 Modified Files: src/share/man/man4/man4.x86: balloon.4 Log Message: Reflect my change for Xen sysctl(7) nodes: kern.xen.balloon -> machdep.xen.balloon. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/man4.x86/balloon.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: jym Date: Sun Jul 31 18:00:54 UTC 2011 Modified Files: src/sys/arch/xen/x86: xen_shm_machdep.c Log Message: Fix typo in comment. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/x86/xen_shm_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: jym Date: Sun Aug 21 10:00:13 UTC 2011 Modified Files: src/sys/arch/xen/x86: x86_xpmap.c Log Message: Merge err printf with the panic(9) message. Also fix the if () {...} statement with braces, to avoid calling panic() every time. Hi cherry! To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/xen/x86/x86_xpmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/etc
Module Name:src Committed By: jym Date: Mon Aug 22 18:54:06 UTC 2011 Modified Files: src/etc: Makefile src/etc/defaults: Makefile rc.conf Added Files: src/etc/etc.amd64: rc.conf src/etc/etc.i386: rc.conf Log Message: Modify etc/defaults/Makefile so that architectures can specify an additional rc.conf file. This one should reside under etc/etc.${MACHINE}/, and will get automatically appended to etc/defaults/rc.conf at build time if present. This is used by i386 and amd64 to append a small MD rc.conf(5) configuration at the end of the defaults/rc.conf file, so that powerd(8) can be started by default when we are running in a Xen environment. This is needed to support save/restore functions for domains. >From all the alternatives proposed to fix that issue (from /etc/rc.conf parsing in postinstall to etc/defaults/rc.conf arch-hooks) I believe this one will appease everyone because it: - does not touch etc/defaults/rc.conf template file, - patches it at build time for MD hooks only when required, - does not need to parse/modify a user-specified file like /etc/rc.conf (which is a complex, error-prone operation), - only enables powerd(8) by default when conditions are met (Xen environment) while still allowing root to shoot himself in the foot if he wants to override this manually in /etc/rc.conf. See also http://mail-index.netbsd.org/tech-userlevel/2011/07/25/msg005246.html To generate a diff of this commit: cvs rdiff -u -r1.391 -r1.392 src/etc/Makefile cvs rdiff -u -r1.3 -r1.4 src/etc/defaults/Makefile cvs rdiff -u -r1.113 -r1.114 src/etc/defaults/rc.conf cvs rdiff -u -r0 -r1.1 src/etc/etc.amd64/rc.conf cvs rdiff -u -r0 -r1.1 src/etc/etc.i386/rc.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/etc
Module Name:src Committed By: jym Date: Mon Aug 22 20:48:39 UTC 2011 Modified Files: src/etc/defaults: Makefile Added Files: src/etc/etc.amd64: rc.conf.append src/etc/etc.i386: rc.conf.append Removed Files: src/etc/etc.amd64: rc.conf src/etc/etc.i386: rc.conf Log Message: Arch-specific rc.conf files are not really autonomous rc.conf files, they are appended to the end of etc/defaults/rc.conf. So rename them to rc.conf.append for clarity, as suggested by mrg@. Adapt Makefile accordingly. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/etc/defaults/Makefile cvs rdiff -u -r1.1 -r0 src/etc/etc.amd64/rc.conf cvs rdiff -u -r0 -r1.1 src/etc/etc.amd64/rc.conf.append cvs rdiff -u -r1.1 -r0 src/etc/etc.i386/rc.conf cvs rdiff -u -r0 -r1.1 src/etc/etc.i386/rc.conf.append Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Wed Aug 24 20:49:34 UTC 2011 Modified Files: src/sys/arch/xen/xen: xbdback_xenbus.c Log Message: Protect xbdback(4) ring indexes from overflowing; leave the continuation prematurely in case they do, to avoid looping "endlessly" (or at least a very long time) at IPL_BIO while trying to handle requests. This should not happen in a nominal scenario, but the ring can get corrupted for whatever reason (memory errors, domU failures or exploitation). To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/xen/xen/xbdback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [jym-xensuspend] src/sys/arch/xen/xen
Module Name:src Committed By: jym Date: Wed Aug 24 21:37:05 UTC 2011 Modified Files: src/sys/arch/xen/xen [jym-xensuspend]: xen_machdep.c Log Message: Now that Xen sysctl(7) moved under machdep, create a machdep.xen.suspend node to command suspension. To generate a diff of this commit: cvs rdiff -u -r1.4.12.8 -r1.4.12.9 src/sys/arch/xen/xen/xen_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [jym-xensuspend] src/sys/arch
Module Name:src Committed By: jym Date: Sat Aug 27 15:37:33 UTC 2011 Modified Files: src/sys/arch/amd64/amd64 [jym-xensuspend]: busfunc.S cpufunc.S db_disasm.c db_interface.c fpu.c genassym.cf linux32_sigcode.S locore.S machdep.c mainbus.c rbus_machdep.c vector.S src/sys/arch/amd64/conf [jym-xensuspend]: GENERIC INSTALL INSTALL_XEN3_DOMU Makefile.amd64 XEN3_DOM0 XEN3_DOMU files.amd64 majors.amd64 src/sys/arch/amd64/include [jym-xensuspend]: Makefile ansi.h db_machdep.h frameasm.h intrdefs.h param.h pmap.h types.h src/sys/arch/i386 [jym-xensuspend]: Makefile src/sys/arch/i386/acpi [jym-xensuspend]: npx_acpi.c src/sys/arch/i386/conf [jym-xensuspend]: ALL GENERIC GENERIC_PS2TINY GENERIC_TINY INSTALL INSTALL_FLOPPY INSTALL_TINY INSTALL_XEN3PAE_DOMU INSTALL_XEN3_DOMU MONOLITHIC Makefile.i386 NET4501 XBOX XEN3_DOM0 XEN3_DOMU files.i386 std.i386 src/sys/arch/i386/eisa [jym-xensuspend]: eisa_machdep.c src/sys/arch/i386/i386 [jym-xensuspend]: apmbios.c busfunc.S db_interface.c gdt.c genassym.cf i386func.S machdep.c mainbus.c rbus_machdep.c vector.S src/sys/arch/i386/include [jym-xensuspend]: Makefile ansi.h asm.h cdefs.h cpu.h db_machdep.h frame.h frameasm.h intrdefs.h mca_machdep.h pmap.h types.h src/sys/arch/i386/isa [jym-xensuspend]: ahc_isa.c cmos.c isapnp_machdep.c lms.c mms.c npx.c npx_isa.c src/sys/arch/i386/mca [jym-xensuspend]: mca_machdep.c src/sys/arch/i386/pci [jym-xensuspend]: ali1543.c amd756.c elan520.c gcscehci.c geode.c geodecntr.c geodewdg.c gscpcib.c opti82c558.c opti82c700.c pceb.c pci_intr_fixup.c pcmb.c piix.c piixpcib.c sis85c503.c via8231.c via82c586.c viapcib.c src/sys/arch/i386/pnpbios [jym-xensuspend]: atppc_pnpbios.c com_pnpbios.c ess_pnpbios.c fdc_pnpbios.c joy_pnpbios.c lm_pnpbios.c lpt_pnpbios.c npx_pnpbios.c pciide_pnpbios.c pnpbios.c pnpbiosvar.h sb_pnpbios.c wss_pnpbios.c ym_pnpbios.c src/sys/arch/i386/stand [jym-xensuspend]: Makefile.booters Makefile.inc src/sys/arch/i386/stand/boot [jym-xensuspend]: Makefile.boot boot2.c src/sys/arch/i386/stand/bootxx [jym-xensuspend]: Makefile.bootxx pbr.S src/sys/arch/i386/stand/cdboot [jym-xensuspend]: Makefile src/sys/arch/i386/stand/dosboot [jym-xensuspend]: Makefile src/sys/arch/i386/stand/fatboot [jym-xensuspend]: Makefile.fat src/sys/arch/i386/stand/lib [jym-xensuspend]: Makefile Makefile.inc bios_disk.S biosdisk.c biosgetrtc.S biosgetsystime.S biosmem.S biosmemps2.S biosreboot.S bootmenu.c conio.S cpufunc.S dosfile.c exec.c getextmemx.c libi386.h parseutils.c pcio.c src/sys/arch/i386/stand/libsa [jym-xensuspend]: nfs.c src/sys/arch/i386/stand/mbr [jym-xensuspend]: Makefile Makefile.mbr src/sys/arch/i386/stand/netboot [jym-xensuspend]: Makefile.netboot dev_net.c src/sys/arch/i386/stand/netboot/ne2000_isa [jym-xensuspend]: Makefile src/sys/arch/i386/stand/pxeboot [jym-xensuspend]: Makefile dev_net.c main.c src/sys/arch/i386/xbox [jym-xensuspend]: xbox.c xboxfb.c xboxlcd.c src/sys/arch/x86/acpi [jym-xensuspend]: Makefile.wakecode.inc acpi_cpu_md.c acpi_wakeup.c src/sys/arch/x86/conf [jym-xensuspend]: files.x86 src/sys/arch/x86/include [jym-xensuspend]: Makefile acpi_machdep.h bootinfo.h cpu.h cpuvar.h i82093reg.h i82489var.h intr.h isa_machdep.h mpconfig.h pci_machdep_common.h pio.h pmap.h pmap_pv.h specialreg.h src/sys/arch/x86/isa [jym-xensuspend]: isa_machdep.c src/sys/arch/x86/pci [jym-xensuspend]: agp_machdep.c amdpcib_hpet.c amdtemp.c files.pci fwhrng.c ichlpcib.c pchb.c pchbvar.h pci_addr_fixup.c pci_bus_fixup.c pci_intr_machdep.c pci_machdep.c pcib.c rdcpcib.c src/sys/arch/x86/x86 [jym-xensuspend]: bus_dma.c bus_space.c consinit.c coretemp.c cpu.c genfb_machdep.c intr.c lapic.c mp.c mpacpi.c pmap.c tsc.c via_padlock.c viac7temp.c x86_autoconf.c x86_machdep.c src/sys/arch/xen/conf [jym-xensuspend]: Makefile.xen files.xen std.xen src/sys/arch/xen/i386 [jym-xensuspend]: npx_hv.c src/sys/arch/xen/include [jym-xensuspend]: evtchn.h hypervisor.h intr.h xenpmap.h src/sys/arch/xen/include/i386 [jym-xensuspend]: hypercalls.h src/sys/arch/xen/include/xen3-public/io [jym-xensuspend]: ring.h src/sys/arch/xen/x86 [jym-xensuspend]: consinit.c cpu.c intr.c mainbus.c x86_xpmap.c xen_bus_dma.c xen_pmap.c xen_shm_machdep.c xenfunc.c src/sys/arch/xen/xen [jym-xensuspend]: balloon.c clock.c evtchn.c
CVS commit: [jym-xensuspend] src/sys/arch/xen
Module Name:src Committed By: jym Date: Sat Aug 27 15:44:09 UTC 2011 Modified Files: src/sys/arch/xen/include [jym-xensuspend]: xen.h src/sys/arch/xen/x86 [jym-xensuspend]: hypervisor_machdep.c Log Message: Further sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.30.8.5 -r1.30.8.6 src/sys/arch/xen/include/xen.h cvs rdiff -u -r1.11.8.8 -r1.11.8.9 src/sys/arch/xen/x86/hypervisor_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.