The NetBSD Project

CVS log for src/sys/arch/amd64/amd64/netbsd32_machdep.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / arch / amd64 / amd64

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.141: download - view: text, markup, annotated - select for diffs
Sat Aug 20 23:49:31 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +3 -2 lines
x86: Move definition of struct pmap to pmap_private.h.

This makes pmap_resident_count and pmap_wired_count out-of-line
functions instead of inline.  No functional change intended
otherwise.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Sat Nov 6 20:42:56 2021 UTC (3 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -16 lines
COMPAT_NETBSD32 is all about running the 32-bit flavor of native
binaries on a 64-bit platform[*], as such:
- Make the logic about which "sendsig" flavor to call MI (as it is in the
  native 64-bit environment) and follow the same rules as the native 32-bit
  environment.
- Make COMPAT_NETBSD32 x COMPAT_16 work the same as it would in the
  native 32-bit environment by providing a netbsd32_sendsig_sigcontext_16_hook,
  rather than overriding the entire sendsig logic with a netbsd32_sendsig_hook.
- In netbsd32___sigaction_sigtramp(), make sure the compat_netbsd32_16
  module is loaded if the trampoline version specifies a sigcontext style
  handler, otherwise return EINVAL so that libc can try again with siginfo
  style.

[*] ...except for arm32, which uses it to mean "run 32-bit OABI binaries
from the 32-bit EABI environment".  Doing it this way was arguably a mistake,
but we are stuck with it for now, so support it by providing a machine-
dependent override for netbsd32_sendsig() that also disables the corresponding
logic in netbsd32___sigaction_sigtramp().

Fixes PR kern/56487.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Mon Nov 1 05:07:15 2021 UTC (3 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +3 -3 lines
Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name.  NFC.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Wed Oct 27 04:14:59 2021 UTC (3 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +5 -5 lines
Use the signal trampoline version constants from <sys/signal.h>.

Revision 1.136.2.1: download - view: text, markup, annotated - select for diffs
Mon Dec 14 14:37:46 2020 UTC (3 years, 11 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.136: preferred, colored; next MAIN 1.137: preferred, colored
Changes since revision 1.136: +11 -7 lines
Sync w/ HEAD.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Fri Nov 20 17:44:56 2020 UTC (4 years ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +11 -7 lines
malloc(9) -> kmem(9)

Revision 1.136: download - view: text, markup, annotated - select for diffs
Sat Apr 25 15:26:16 2020 UTC (4 years, 7 months ago) by bouyer
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +2 -2 lines
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor

Revision 1.133.6.1: download - view: text, markup, annotated - select for diffs
Sat Apr 25 11:23:55 2020 UTC (4 years, 7 months ago) by bouyer
Branches: bouyer-xenpvh
Diff to: previous 1.133: preferred, colored; next MAIN 1.134: preferred, colored
Changes since revision 1.133: +12 -9 lines
Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.135: download - view: text, markup, annotated - select for diffs
Fri Apr 24 16:27:27 2020 UTC (4 years, 7 months ago) by maxv
Branches: MAIN
CVS tags: bouyer-xenpvh-base2
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +5 -4 lines
Give the ldt a fixed size of one page (512 slots), and drop the variable-
sized mechanism that was too complex.

This fixes a race between USER_LDT and SVS: during context switches, the
way SVS installs the new ldt relies on the ldt pointer AND the ldt size,
but both cannot be accessed atomically at the same time.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Thu Apr 23 16:16:14 2020 UTC (4 years, 7 months ago) by christos
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +9 -7 lines
use shortcut variables for readability.

Revision 1.115.4.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:03:30 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.115.4.1: preferred, colored; branchpoint 1.115: preferred, colored; next MAIN 1.116: preferred, colored
Changes since revision 1.115.4.1: +175 -145 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Dec 12 02:15:42 2019 UTC (5 years ago) by pgoyette
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base1, bouyer-xenpvh-base, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: bouyer-xenpvh
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +5 -5 lines
Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !

Revision 1.125.2.2: download - view: text, markup, annotated - select for diffs
Wed Nov 27 11:11:17 2019 UTC (5 years ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Diff to: previous 1.125.2.1: preferred, colored; branchpoint 1.125: preferred, colored; next MAIN 1.126: preferred, colored
Changes since revision 1.125.2.1: +29 -33 lines
Pull up following revision(s) (requested by msaitoh in ticket #488):

	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.126

Don't depend on #ifdef USER_LDT in cpu_mcontext32_validate(), but rather on
whether the proc uses a user-set LDT. Same as check_sigcontext32().

Revision 1.132: download - view: text, markup, annotated - select for diffs
Wed Nov 27 09:16:58 2019 UTC (5 years ago) by rin
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +81 -4 lines
Add support for PT_[GS]ETXMMREGS requests for COMPAT_NETBSD32 on amd64.

For this purpose, PT_[GS]ETXMMREGS are added to amd64/ptrace.h. These
are intended for internal usage for COMPAT_NETBSD32, and therefore not
exposed to userland.

Thanks to kamil, mgorny, and pgoyette for their kind review!

XXX
pullup to netbsd-9

Revision 1.125.2.1: download - view: text, markup, annotated - select for diffs
Thu Nov 21 14:02:33 2019 UTC (5 years ago) by martin
Branches: netbsd-9
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +10 -8 lines
Pull up following revision(s) (requested by rin in ticket #460):

	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.130

Fix netbsd32_process_write_dbregs() for amd64:
- Zero-clear regs64 so that random values are not written into the
   preserved registers.
- Cast 32-bit registers (int) to u_int, in order to avoid undesired
   sign extension when filled into 64-bit registers (long).

XXX
pullup to netbsd-9

Revision 1.131: download - view: text, markup, annotated - select for diffs
Wed Nov 20 19:37:51 2019 UTC (5 years ago) by pgoyette
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +8 -9 lines
Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation.  Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Nov 20 10:57:08 2019 UTC (5 years ago) by rin
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +10 -8 lines
Fix netbsd32_process_write_dbregs() for amd64:

- Zero-clear regs64 so that random values are not written into the
  preserved registers.
- Cast 32-bit registers (int) to u_int, in order to avoid undesired
  sign extension when filled into 64-bit registers (long).

XXX
pullup to netbsd-9

Revision 1.129: download - view: text, markup, annotated - select for diffs
Sun Nov 10 21:16:22 2019 UTC (5 years, 1 month ago) by chs
Branches: MAIN
CVS tags: phil-wifi-20191119
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +3 -9 lines
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Thu Sep 26 01:39:22 2019 UTC (5 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +5 -5 lines
- promote regs from int to u_int in comparisons with unsigned constants
- cast -1 to __greg32_t which is unsigned and the LHS.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Wed Aug 21 12:46:56 2019 UTC (5 years, 3 months ago) by maxv
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +25 -87 lines
Style and remove dead stuff.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Wed Aug 21 12:33:12 2019 UTC (5 years, 3 months ago) by maxv
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +29 -33 lines
Don't depend on #ifdef USER_LDT in cpu_mcontext32_validate(), but rather on
whether the proc uses a user-set LDT. Same as check_sigcontext32().

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sat Jul 20 18:25:11 2019 UTC (5 years, 4 months ago) by christos
Branches: MAIN
CVS tags: netbsd-9-base
Branch point for: netbsd-9
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +25 -3 lines
Restore the ability to debug a 32 bit process from a 64 bit debugger:
- add a function to validate a 64 bit context in 32 bit mode to write registers
- remove 32 bit checks from read and write register functions
- check for pc to fit in 32 bits.
proposed in tech-kern, ok maxv.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Wed Jun 26 12:30:12 2019 UTC (5 years, 5 months ago) by mgorny
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +4 -2 lines
Implement PT_GETXSTATE and PT_SETXSTATE

Introduce two new ptrace() requests: PT_GETXSTATE and PT_SETXSTATE,
that provide access to the extended (and extensible) set of FPU
registers on amd64 and i386.  At the moment, this covers AVX (YMM)
and AVX-512 (ZMM, opmask) registers.  It can be easily extended
to cover further register types without breaking backwards
compatibility.

PT_GETXSTATE issues the XSAVE instruction with all kernel-supported
extended components enabled.  The data is copied into 'struct xstate'
(which -- unlike the XSAVE area itself -- has stable format
and offsets).

PT_SETXSTATE issues the XRSTOR instruction to restore the register
values from user-provided 'struct xstate'.  The function replaces only
the specific XSAVE components that are listed in 'xs_rfbm' field,
making it possible to issue partial updates.

Both syscalls take a 'struct iovec' pointer rather than a direct
argument.  This requires the caller to explicitly specify the buffer
size.  As a result, existing code will continue to work correctly
when the structure is extended (performing partial reads/updates).

Revision 1.115.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:05:47 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +93 -256 lines
Sync with HEAD

Revision 1.123: download - view: text, markup, annotated - select for diffs
Tue Jun 4 16:30:19 2019 UTC (5 years, 6 months ago) by mgorny
Branches: MAIN
CVS tags: phil-wifi-20190609
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +29 -27 lines
compat32: Implement PT_GETDBREGS and PT_SETDBREGS

Uncomment and improve the implementation of compat32 support for
PT_GETDBREGS and PT_SETDBREGS requests.

The new implementation uses x86_dbregs_read() and x86_dbregs_write()
function instead of accessing pcb directly.  While this might be
a little slower, it guarantees that the needed pcb field is allocated
correctly.

Furthermore, the code introduces necessary sanity checks
for PT_SETDBREGS arguments.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Tue Jun 4 16:29:53 2019 UTC (5 years, 6 months ago) by mgorny
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +24 -2 lines
compat32: Translate userland PT_* request values into kernel codes

Currently, the compat32 passes PT_* request values to kernel functions
without translation.  This works fine for low PT_* requests that happen
to have the same values both on i386 and amd64.  However, for requests
higher than PT_SETFPREGS, the value passed from userland (matching i386
const) does not match the correct kernel (amd64) request.  As a result,
e.g. when compat32 process calls PT_GETDBREGS, kernel actually processes
it as PT_SETSTEP.

To resolve this, introduce support for compat32 PT_* request
translation.  The interface is based on PTRACE_TRANSLATE_REQUEST32 macro
that is defined to a mapping function on architectures needing it.
In case of amd64, this function maps userland i386 PT_* values into
appropriate amd64 PT_* values.

For the time being, the two additional PT_GETXMMREGS and PT_SETXMMREGS
requests are unsupported due to lack of matching free amd64 constant.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Sun May 19 08:46:15 2019 UTC (5 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +4 -4 lines
Rename

	fpu_save_area_clear -> fpu_clear
	fpu_save_area_reset -> fpu_sigreset

Clearer, and reduces a future diff. No real functional change.

Revision 1.105.2.3: download - view: text, markup, annotated - select for diffs
Fri Apr 5 07:48:05 2019 UTC (5 years, 8 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Diff to: previous 1.105.2.2: preferred, colored; branchpoint 1.105: preferred, colored; next MAIN 1.106: preferred, colored
Changes since revision 1.105.2.2: +9 -7 lines
Pull up following revision(s) (requested by maxv):

	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.120
	sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.57
	sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.44
	sys/arch/amd64/amd64/machdep.c: revision 1.328
	sys/arch/amd64/amd64/machdep.c: revision 1.329

Fix a tiny race in setregs and linux_setregs. Between the moment we set
pcb_flags to zero, and the moment cpu_segregs64_zero resets pcb_gs, we may
be preempted.

If this happens, and if the calling LWP was a 32bit thread, when switching
back to that LWP, the context switcher sees that PCB_COMPAT32 is not set in
pcb_flags and tries to perform a 64bit context switch; but pcb_gs contains
a 32bit GDT descriptor, and not a 64bit GS.base value. The wrmsr therefore
faults because the value is non-canonical, and this fault is fatal.

Rearrange the code so that the update of pcb_flags and pcb_gs/pcb_fs is non
interruptible. This fixes the problem, tested with a reproducer (which
therefore doesn't work anymore).

Likely fixes PR/53993.

Disable preemption when setting PCB_COMPAT32, to prevent a context switch
before cpu_fsgs_reload() finishes, otherwise we write garbage in the GDT.

On NetBSD-current it is harmless, however in NetBSD-8 it might cause
panics, because NetBSD-8 uses the old SegRegs model and under this model
we reload %fs and %gs during switches.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun Mar 24 15:58:32 2019 UTC (5 years, 8 months ago) by maxv
Branches: MAIN
CVS tags: isaki-audio2-base, isaki-audio2
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +9 -8 lines
Disable preemption when setting PCB_COMPAT32, to prevent a context switch
before cpu_fsgs_reload() finishes, otherwise we write garbage in the GDT.
On NetBSD-current it is harmless, however in NetBSD-8 it might cause
panics, because NetBSD-8 uses the old SegRegs model and under this model
we reload %fs and %gs during switches.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Fri Mar 1 11:06:55 2019 UTC (5 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +5 -5 lines
Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.

Revision 1.92.8.1: download - view: text, markup, annotated - select for diffs
Wed Jan 30 13:32:57 2019 UTC (5 years, 10 months ago) by martin
Branches: netbsd-7-0
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +5 -3 lines
Pull up following revision(s) (requested by maxv in ticket #1677):

	sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
	sys/arch/arm/arm/sig_machdep.c: revision 1.51
	sys/arch/i386/i386/machdep.c: revision 1.813
	sys/arch/alpha/alpha/machdep.c: revision 1.352
	sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
	sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
	sys/arch/sparc64/sparc64/machdep.c: revision 1.289
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
	sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
	sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
	sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
	sys/arch/mips/mips/sig_machdep.c: revision 1.24
	sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
	sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.

Revision 1.92.12.1: download - view: text, markup, annotated - select for diffs
Wed Jan 30 13:29:52 2019 UTC (5 years, 10 months ago) by martin
Branches: netbsd-7-1
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +5 -3 lines
Pull up following revision(s) (requested by maxv in ticket #1677):

	sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
	sys/arch/arm/arm/sig_machdep.c: revision 1.51
	sys/arch/i386/i386/machdep.c: revision 1.813
	sys/arch/alpha/alpha/machdep.c: revision 1.352
	sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
	sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
	sys/arch/sparc64/sparc64/machdep.c: revision 1.289
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
	sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
	sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
	sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
	sys/arch/mips/mips/sig_machdep.c: revision 1.24
	sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
	sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.

Revision 1.92.4.1: download - view: text, markup, annotated - select for diffs
Wed Jan 30 13:27:28 2019 UTC (5 years, 10 months ago) by martin
Branches: netbsd-7
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +5 -3 lines
Pull up following revision(s) (requested by maxv in ticket #1677):

	sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
	sys/arch/arm/arm/sig_machdep.c: revision 1.51
	sys/arch/i386/i386/machdep.c: revision 1.813
	sys/arch/alpha/alpha/machdep.c: revision 1.352
	sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
	sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
	sys/arch/sparc64/sparc64/machdep.c: revision 1.289
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
	sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
	sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
	sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
	sys/arch/mips/mips/sig_machdep.c: revision 1.24
	sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
	sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.

Revision 1.105.2.2: download - view: text, markup, annotated - select for diffs
Sun Jan 27 18:43:08 2019 UTC (5 years, 10 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.105.2.1: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.1: +5 -3 lines
Pull up following revision(s) (requested by maxv in ticket #1173):
	sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
	sys/arch/arm/arm/sig_machdep.c: revision 1.51
	sys/arch/i386/i386/machdep.c: revision 1.813
	sys/arch/alpha/alpha/machdep.c: revision 1.352
	sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
	sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
	sys/arch/sparc64/sparc64/machdep.c: revision 1.289
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
	sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
	sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
	sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
	sys/arch/mips/mips/sig_machdep.c: revision 1.24
	sys/arch/riscv/riscv/sig_machdep.c: revision 1.2
	sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
	sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sun Jan 27 02:08:37 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +32 -218 lines
Merge the [pgoyette-compat] branch

Revision 1.115.2.19: download - view: text, markup, annotated - select for diffs
Fri Jan 25 09:36:08 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.115.2.18: preferred, colored; branchpoint 1.115: preferred, colored; next MAIN 1.116: preferred, colored
Changes since revision 1.115.2.18: +3 -4 lines
Move the netbsd32_machine32_hook into the main kernel with most of
the other hooks.

Although this hook might better belong in compat/netbsd32/ code,
there are some machines without a netbsd32 module (for example, i386
and sgimips) which still have consumers/users of this hook.  :(

Revision 1.115.2.18: download - view: text, markup, annotated - select for diffs
Thu Jan 24 04:08:09 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.17: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.17: +4 -2 lines
Rework placement of the new netbsd32_machine32_hook

Revision 1.115.2.17: download - view: text, markup, annotated - select for diffs
Thu Jan 24 03:27:23 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.16: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.16: +11 -4 lines
Replace weak symbol definition for machine32 with a hook.  Our in-kernel
linker doesn't handle weak symbols, so this prevented us from loading the
compat_linux32 module.

XXX There don't seem to be any other consumers of machine32 (nor does
XXX there seem to be any consumers of machine_arch32), even though it
XXX is defined for aarch64, arm32, and riscv).

Revision 1.115.2.16: download - view: text, markup, annotated - select for diffs
Tue Jan 22 07:42:40 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.15: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.15: +4 -9 lines
Convert the MODULE_{,VOID_}HOOK_CALL macros to do everything in-line
rather than defining an intermediate hook##call function.  Almost
all of the hooks are called only once, and although we lose the
ability of doing things like

	if (MODULE_HOOK_CALL(...) == 0) ...

we simplify things quite a bit.  With this change, we no longer need
to have both declaration and definition macros, and the definition
no longer needs to have both prototype argument list and a "real"
argument list.

FWIW, the above if now needs to written as

	int ret;

	MODULE_HOOK_CALL(..., ret);
	if (ret == 0) ...

with appropriate use of braces {}.

Revision 1.115.2.15: download - view: text, markup, annotated - select for diffs
Mon Jan 21 06:49:27 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.14: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.14: +3 -3 lines
No need to declare the hook_call() function for void hooks.  So
remove and simplify.

Revision 1.115.2.14: download - view: text, markup, annotated - select for diffs
Mon Jan 14 13:34:26 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.13: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.13: +4 -4 lines
Create a variant of the HOOK macros that handles hook routines of
type void, and use them where appropriate.

Revision 1.115.2.13: download - view: text, markup, annotated - select for diffs
Sun Jan 13 10:49:49 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.12: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.12: +5 -5 lines
Remove the HOOK2 versions of the MODULE_HOOK macros.  There were
only a few uses, and using them led to some lack of clarity in the
code.  Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.

Revision 1.115.2.12: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:01:31 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.11: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.11: +3 -3 lines
Sync with HEAD, resolve a few conflicts

Revision 1.117: download - view: text, markup, annotated - select for diffs
Tue Nov 27 14:09:53 2018 UTC (6 years ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +5 -3 lines
Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.

Revision 1.115.2.11: download - view: text, markup, annotated - select for diffs
Sat Sep 29 21:36:13 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.10: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.10: +3 -4 lines
In MODULE_HOOK_CALL_DECL we don't need to provide the actual argument
list for calling the hook function, nor do we need to provide the
default value (for when the hook has not been set).

Revision 1.115.2.10: download - view: text, markup, annotated - select for diffs
Sat Sep 29 07:34:12 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.9: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.9: +4 -2 lines
Allocate the netbsd32_sendsig_hook in the main compat_netbsd32 code
(where it call be called) and not in a subsidiary module which may
not even exist.

Revision 1.115.2.9: download - view: text, markup, annotated - select for diffs
Sat Sep 29 06:19:42 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.8: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.8: +2 -5 lines
Remove some spurious declarations.

Revision 1.115.2.8: download - view: text, markup, annotated - select for diffs
Thu Sep 27 01:34:38 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.7: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.7: +3 -2 lines
Make sure we pick up the definition of COMPAT_NETBSD32

Revision 1.115.2.7: download - view: text, markup, annotated - select for diffs
Mon Sep 24 23:47:07 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.6: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.6: +6 -4 lines
Adjust declaration of netbsd32_sendsig_siginfo() too.

Remove the attempted initialization of the former function pointer; this
is now handled by the "default" argument in MODULE_HOOK_CALL() macro.

Revision 1.115.2.6: download - view: text, markup, annotated - select for diffs
Mon Sep 24 23:37:59 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.5: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.5: +5 -3 lines
Make the netbsd32_sendsig_siginfo() routine return an int, to conform
to the MP-safe HOOKs mechanism.

Revision 1.115.2.5: download - view: text, markup, annotated - select for diffs
Mon Sep 24 23:25:24 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.4: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.4: +4 -4 lines
Provide required args when calling the default (un-hooked) routine.

Revision 1.115.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 24 22:56:45 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.3: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.3: +9 -4 lines
Convert yet another function pointer to the MP-safe mechanism

Revision 1.115.2.3: download - view: text, markup, annotated - select for diffs
Fri Sep 14 08:38:37 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.2: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.2: +6 -69 lines
OMG it builds!

Finish rearranging the amd64 MD compat_netbsd32 code.

XXX Other architectures will be dealt with later.

Revision 1.115.2.2: download - view: text, markup, annotated - select for diffs
Fri Sep 14 05:37:08 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115.2.1: preferred, colored; branchpoint 1.115: preferred, colored
Changes since revision 1.115.2.1: +26 -158 lines
Work in progress - get the arch-specific netbsd32_machdep.c code to
build as a module.

XXX Doesn't work when the code is built-in to the kernel.

Revision 1.115.2.1: download - view: text, markup, annotated - select for diffs
Sat Jul 28 04:37:26 2018 UTC (6 years, 4 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +4 -8 lines
Sync with HEAD

Revision 1.116: download - view: text, markup, annotated - select for diffs
Thu Jul 26 09:29:08 2018 UTC (6 years, 4 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +4 -8 lines
Rework dbregs, to switch the registers during context switches, and not on
each user->kernel transition via userret. Reloads of DR6/DR7 are expensive
on both native and xen.

Revision 1.105.2.1: download - view: text, markup, annotated - select for diffs
Thu Dec 21 19:53:28 2017 UTC (6 years, 11 months ago) by snj
Branches: netbsd-8
CVS tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +41 -60 lines
Pull up following revision(s) (requested by christos in ticket #444):
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.114
Keep fs/gs the same for the signal context; otherwise calling things
like __lwp_getprivate_fast() from a signal handler (that uses %gs) die.
Merge context building code.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Thu Dec 7 23:11:50 2017 UTC (7 years ago) by christos
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +66 -2 lines
Save maxv@ some work and put back the compat_13_sigreturn changes that allow
amd64 to run ancient i386 binaries.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Thu Dec 7 16:22:22 2017 UTC (7 years ago) by christos
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +41 -60 lines
Keep fs/gs the same for the signal context; otherwise calling things
like __lwp_getprivate_fast() from a signal handler (that uses %gs) die.

Merge context building code.

Revision 1.79.2.3: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:35:47 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.79.2.2: preferred, colored; branchpoint 1.79: preferred, colored; next MAIN 1.80: preferred, colored
Changes since revision 1.79.2.2: +265 -153 lines
update from HEAD

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sat Dec 2 15:36:24 2017 UTC (7 years ago) by maxv
Branches: MAIN
CVS tags: tls-maxphys-base-20171202
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +2 -66 lines
Remove a piece of COMPAT_13, that I mistakenly didn't commit three
hours ago (in my change to drop COMPAT_13 on amd64).

Revision 1.112: download - view: text, markup, annotated - select for diffs
Thu Oct 19 10:01:09 2017 UTC (7 years, 1 month ago) by maxv
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +34 -34 lines
Always mask the 16 bits of the segregs in the trapframe. We don't zero-
extend the uint64_t's when building it, so we're leaking 48 bits of kernel
stack to userland.

Having said that, it appears that I unintentionally fixed most of this
issue in locore.S::rev1.127 - by building the frame with interrupts
disabled, we are implicitly guaranteeing that the structure doesn't get
overwritten by the kernel. Which means, we are leaking to userland data
that comes from userland anyway.

(still other places with this issue, but I'll fix them differently)

Revision 1.111: download - view: text, markup, annotated - select for diffs
Sun Oct 15 12:49:53 2017 UTC (7 years, 1 month ago) by maxv
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +3 -3 lines
Use two separate functions: cpu_segregs32_zero and cpu_segregs64_zero. The
way segment registers work on amd64 will diverge between 32bit and 64bit
LWPs.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Sun Oct 15 11:36:15 2017 UTC (7 years, 1 month ago) by maxv
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -3 lines
Make sure the 32bit LWPs don't have MDL_IRET set. That's not a problem
right now, but will be in the future.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Sun Sep 17 09:41:35 2017 UTC (7 years, 2 months ago) by maxv
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +4 -4 lines
Remove the second argument from USERMODE and KERNELMODE, it is unused
now that we don't have vm86 anymore.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Aug 31 15:41:14 2017 UTC (7 years, 3 months ago) by maxv
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +5 -4 lines
check sc_eip in the ldt branch too

Revision 1.92.6.6: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:51:28 2017 UTC (7 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.92.6.5: preferred, colored; branchpoint 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92.6.5: +197 -36 lines
Sync with HEAD

Revision 1.107: download - view: text, markup, annotated - select for diffs
Tue Jul 25 18:03:56 2017 UTC (7 years, 4 months ago) by maxv
Branches: MAIN
CVS tags: nick-nhusb-base-20170825
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +23 -24 lines
This branch must be static, otherwise there is a condition under which
the KASSERT in startlwp32 would be triggered.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Jul 22 13:00:42 2017 UTC (7 years, 4 months ago) by maxv
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +27 -17 lines
Branch for USER_LDT.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Thu Jun 1 02:45:05 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +2 -10 lines
remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.98.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:53:21 2017 UTC (7 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98: +182 -22 lines
Sync with HEAD

Revision 1.95.2.3: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:09 2017 UTC (7 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.95.2.2: preferred, colored; branchpoint 1.95: preferred, colored; next MAIN 1.96: preferred, colored
Changes since revision 1.95.2.2: +183 -23 lines
Sync with HEAD

Revision 1.104: download - view: text, markup, annotated - select for diffs
Thu Feb 23 03:34:22 2017 UTC (7 years, 9 months ago) by kamil
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +54 -4 lines
Introduce PT_GETDBREGS and PT_SETDBREGS in ptrace(2) on i386 and amd64

This interface is modeled after FreeBSD API with the usage.

This replaced previous watchpoint API. The previous one was introduced
recently in NetBSD-current and remove its spurs without any
backward-compatibility.

Design choices for Debug Register accessors:
 - exec() (TRAP_EXEC event) must remove debug registers from LWP
 - debug registers are only per-LWP, not per-process globally
 - debug registers must not be inherited after (v)forking a process
 - debug registers must not be inherited after forking a thread
 - a debugger is responsible to set global watchpoints/breakpoints with the
   debug registers, to achieve this PTRACE_LWP_CREATE/PTRACE_LWP_EXIT event
   monitoring function is designed to be used
 - debug register traps must generate SIGTRAP with si_code TRAP_DBREG
 - debugger is responsible to retrieve debug register state to distinguish
   the exact debug register trap (DR6 is Status Register on x86)
 - kernel must not remove debug register traps after triggering a trap event
   a debugger is responsible to detach this trap with appropriate PT_SETDBREGS
   call (DR7 is Control Register on x86)
 - debug registers must not be exposed in mcontext
 - userland must not be allowed to set a trap on the kernel

Implementation notes on i386 and amd64:
 - the initial state of debug register is retrieved on boot and this value is
   stored in a local copy (initdbregs), this value is used to initialize dbreg
   context after PT_GETDBREGS
 - struct dbregs is stored in pcb as a pointer and by default not initialized
 - reserved registers (DR4-DR5, DR9-DR15) are ignored

Further ideas:
 - restrict this interface with securelevel

Tested on real hardware i386 (Intel Pentium IV) and amd64 (Intel i7).

This commit enables 390 debug register ATF tests in kernel/arch/x86.
All tests are passing.

This commit does not cover netbsd32 compat code. Currently other interface
PT_GET_SIGINFO/PT_SET_SIGINFO is required in netbsd32 compat code in order to
validate reliably PT_GETDBREGS/PT_SETDBREGS.

This implementation does not cover FreeBSD specific defines in their
<x86/reg.h>: DBREG_DR7_LOCAL_ENABLE, DBREG_DR7_GLOBAL_ENABLE, DBREG_DR7_LEN_1
etc. These values tend to be reinvented by each tracer on its own. GNU
Debugger (GDB) works with NetBSD debug registers after adding this patch:

--- gdb/amd64bsd-nat.c.orig	2016-02-10 03:19:39.000000000 +0000
+++ gdb/amd64bsd-nat.c
@@ -167,6 +167,10 @@ amd64bsd_target (void)

 #ifdef HAVE_PT_GETDBREGS

+#ifndef DBREG_DRX
+#define	DBREG_DRX(d,x)	((d)->dr[(x)])
+#endif
+
 static unsigned long
 amd64bsd_dr_get (ptid_t ptid, int regnum)
 {


Another reason to stop introducing unpopular defines covering machine
specific register macros is that these value varies across generations of
the same CPU family.

GDB demo:
  (gdb) c
  Continuing.

  Watchpoint 2: traceme

  Old value = 0
  New value = 16
  main (argc=1, argv=0x7f7fff79fe30) at test.c:8
  8               printf("traceme=%d\n", traceme);

(Currently the GDB interface is not reliable due to NetBSD support bugs)

Sponsored by <The NetBSD Foundation>

Revision 1.103: download - view: text, markup, annotated - select for diffs
Tue Feb 14 09:03:48 2017 UTC (7 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +5 -4 lines
Check %eip with USER_LDT too.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Thu Feb 9 08:38:25 2017 UTC (7 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +24 -6 lines
No, do not just copy code from i386 and expect it to work on amd64. There
are several structural differences. At least two issues here: segment
registers that could fault in kernel mode with userland TLS, and a non-
canonical %eip on iret.

Not even tested, but just obvious. By the way, I believe this function is
still buggy since we don't call cpu_fsgs_reload while %fs/%gs could have
been reloaded.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Mon Feb 6 16:34:37 2017 UTC (7 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +25 -15 lines
In cpu_mcontext32_validate, allow the registers to have different locations
if the LDT is user-set.

I am intentionally not allowing this in check_sigcontext32, because I don't
think Wine uses it.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Mon Feb 6 16:02:17 2017 UTC (7 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +83 -2 lines
Add the USER_LDT sysarch options in netbsd32. We don't translate 'desc',
since if we ever implement USER_LDT we will only allow 8-byte-sized
entries, which have the same layout on amd64 and i386.

Revision 1.92.6.5: download - view: text, markup, annotated - select for diffs
Sun Feb 5 13:40:01 2017 UTC (7 years, 10 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.92.6.4: preferred, colored; branchpoint 1.92: preferred, colored
Changes since revision 1.92.6.4: +4 -2 lines
Sync with HEAD

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sun Feb 5 08:52:11 2017 UTC (7 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +3 -3 lines
Remove #if 0 on USER_LDT.

Revision 1.95.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:09 2017 UTC (7 years, 11 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.95.2.1: preferred, colored; branchpoint 1.95: preferred, colored
Changes since revision 1.95.2.1: +4 -2 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.98: download - view: text, markup, annotated - select for diffs
Thu Dec 15 12:04:17 2016 UTC (7 years, 11 months ago) by kamil
Branches: MAIN
CVS tags: pgoyette-localcount-20170107, nick-nhusb-base-20170204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +4 -2 lines
Add support for hardware assisted watchpoints/breakpoints API in ptrace(2)

Add new ptrace(2) calls:
 - PT_COUNT_WATCHPOINTS - count the number of available hardware watchpoints
 - PT_READ_WATCHPOINT   - read struct ptrace_watchpoint from the kernel state
 - PT_WRITE_WATCHPOINT  - write new struct ptrace_watchpoint state, this
                          includes enabling and disabling watchpoints

The ptrace_watchpoint structure contains MI and MD parts:

typedef struct ptrace_watchpoint {
	int		pw_index;	/* HW Watchpoint ID (count from 0) */
	lwpid_t		pw_lwpid;	/* LWP described */
	struct mdpw	pw_md;		/* MD fields */
} ptrace_watchpoint_t;

For example amd64 defines MD as follows:
struct mdpw {
	void	*md_address;
	int	 md_condition;
	int	 md_length;
};

These calls are protected with the __HAVE_PTRACE_WATCHPOINTS guard.

Tested on amd64, initial support added for i386 and XEN.

Sponsored by <The NetBSD Foundation>

Revision 1.92.6.4: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:54:49 2016 UTC (8 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.92.6.3: preferred, colored; branchpoint 1.92: preferred, colored
Changes since revision 1.92.6.3: +50 -20 lines
Sync with HEAD

Revision 1.95.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 4 14:48:57 2016 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +50 -20 lines
Sync with HEAD

Revision 1.97: download - view: text, markup, annotated - select for diffs
Wed Oct 19 09:44:00 2016 UTC (8 years, 1 month ago) by skrll
Branches: MAIN
CVS tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +50 -20 lines
PR kern/51514: ptrace(2) fails for 32-bit process on 64-bit kernel

Updated from the original patch in the PR by me.

Revision 1.92.6.3: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:55:23 2016 UTC (8 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.92.6.2: preferred, colored; branchpoint 1.92: preferred, colored
Changes since revision 1.92.6.2: +6 -6 lines
Sync with HEAD

Revision 1.96: download - view: text, markup, annotated - select for diffs
Fri Sep 2 07:51:05 2016 UTC (8 years, 3 months ago) by maxv
Branches: MAIN
CVS tags: nick-nhusb-base-20161004, localcount-20160914
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +3 -3 lines
Fix argument (does not compile anyway).

Revision 1.92.6.2: download - view: text, markup, annotated - select for diffs
Sun Dec 27 12:09:28 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.92.6.1: preferred, colored; branchpoint 1.92: preferred, colored
Changes since revision 1.92.6.1: +8 -7 lines
Sync with HEAD (as of 26th Dec)

Revision 1.95: download - view: text, markup, annotated - select for diffs
Thu Nov 26 13:15:34 2015 UTC (9 years ago) by martin
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226
Branch point for: pgoyette-localcount
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +5 -4 lines
We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Nov 22 13:41:24 2015 UTC (9 years ago) by maxv
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +6 -6 lines
KNF a bit, so I don't get scared each time I open a file

Revision 1.92.6.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:17:51 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -21 lines
Sync with HEAD

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Dec 14 21:27:49 2014 UTC (9 years, 11 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -21 lines
Move the empty sigreturn functions to their own files to allow the compat
module to load by itself.

Revision 1.79.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:02:42 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.79.2.1: preferred, colored; branchpoint 1.79: preferred, colored
Changes since revision 1.79.2.1: +34 -112 lines
Rebase to HEAD as of a few days ago.

Revision 1.74.4.5: download - view: text, markup, annotated - select for diffs
Thu May 22 11:39:28 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.74.4.4: preferred, colored; branchpoint 1.74: preferred, colored; next MAIN 1.75: preferred, colored
Changes since revision 1.74.4.4: +34 -112 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.81.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 17:44:54 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.81: preferred, colored; next MAIN 1.82: preferred, colored
Changes since revision 1.81: +34 -123 lines
sync with head

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sat Feb 15 22:20:41 2014 UTC (10 years, 9 months ago) by dsl
Branches: MAIN
CVS tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: nick-nhusb, netbsd-7-1, netbsd-7-0, netbsd-7
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +9 -16 lines
Load and save the fpu registers (for copies to/from userspace) using
  helper functions in arch/x86/x86/fpu.c
They (hopefully) ensure that we write to the entire buffer and don't load
  values that might cause faults in kernel.
Also zero out the 'pad' field of the i386 mcontext fp area that I think
  once contained the registers of any Weitek fpu.
  Dunno why it wasn't pasrt of the union.
Some of these copies could be removed if the code directly copied the save
  area to/from userspace addresses.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Feb 15 10:11:14 2014 UTC (10 years, 9 months ago) by dsl
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +17 -34 lines
Remove all references to MDL_USEDFPU and deferred fpu initialisation.
The cost of zeroing the save area on exec is minimal.
This stops the FP registers of a random process being used the first
  time an lwp uses the fpu.
sendsig_siginfo() and get_mcontext() now unconditionally copy the FP
registers.
I'll remove the double-copy for signal handlers soon.
get_mcontext() might have been leaking kernel memory to userspace - and
  may still do so if i386_use_fxsave is false (short copies).

Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Feb 11 20:17:16 2014 UTC (10 years, 10 months ago) by dsl
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +3 -3 lines
Move sys/arch/amd64/amd64/fpu.c and sys/arch/amd64/include/fpu.h
into sys/arch/x86 in preparation for using the same code for i386.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Fri Feb 7 22:40:22 2014 UTC (10 years, 10 months ago) by dsl
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +13 -87 lines
Convert the amd64 build to use x86/cpu_extended_state.h so that the fpu
  definitions match those of i386.
Mostly just structure and field renames, in addition:
1) process_xmm_to_s87() and process_s87_to_xmm() moved into
   x86/convert_xmm_s87.c so they can be used by amd64's netbsd32 code.
2) The linux signal code simplified to use a structure copy for ths fxsave
   data - it matches the hardware definition and won't change.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sat Jan 25 05:09:59 2014 UTC (10 years, 10 months ago) by christos
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +7 -4 lines
provide propert address defaults for topdown and bottomup allocation

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Jan 4 00:10:02 2014 UTC (10 years, 11 months ago) by dsl
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +7 -5 lines
Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
  of the fp save area to all the process_read_fpregs() and
  process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
  just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
  to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Wed Jan 1 18:57:15 2014 UTC (10 years, 11 months ago) by dsl
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +4 -3 lines
Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun Dec 1 01:05:16 2013 UTC (11 years ago) by christos
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +20 -14 lines
revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes

Revision 1.84: download - view: text, markup, annotated - select for diffs
Mon Nov 11 11:10:45 2013 UTC (11 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +6 -3 lines
NetBSD 6.99.26: Switch i386 and amd64 to the x87 default control word
as initial value for new processes. This means that long double
computations get the expected 63bit mantissa. Binaries tagged as
compiled for 6.99.25 and older get the old value.

Add a simple test case to ensure that double and long double computation
are working correctly.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sat Nov 2 00:41:58 2013 UTC (11 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +3 -3 lines
sprinkle __diagused

Revision 1.82: download - view: text, markup, annotated - select for diffs
Wed Oct 23 20:18:50 2013 UTC (11 years, 1 month ago) by drochner
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +14 -20 lines
Use the MI "pcu" framework for bookkeeping of npx/fpu states on x86.
This reduces the amount of MD code enormously, and makes it easier
to implement support for newer CPU features which require more fpu
state, or for fpu usage by the kernel.
For access to FPU state across CPUs, an xcall kthread is used now
rather than a dedicated IPI.
No user visible changes intended.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Jun 25 21:08:07 2013 UTC (11 years, 5 months ago) by dsl
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +25 -14 lines
Improve the dodgy code that writes the FP regs into core dumps of 32bit apps.
(I'm not pretending it is correct yet!)
The 'struct fpreg32' (written to coredumps) is shorter than 'struct save87'
so netbsd32_process_read_fpregs() hadn't better write to the extra items.
Doing so overwrites stack in coredump_note() in core_elf32.c - I'm amazed
it doesn't cause a panic!
Also correct (I think) the code and data addresses associated with the FP
unit.
This probably wants pulling up.

Revision 1.79.2.1: download - view: text, markup, annotated - select for diffs
Mon Feb 25 00:28:19 2013 UTC (11 years, 9 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +4 -5 lines
resync with head

Revision 1.74.4.4: download - view: text, markup, annotated - select for diffs
Wed Jan 23 00:05:38 2013 UTC (11 years, 10 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.74.4.3: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.4.3: +4 -5 lines
sync with head

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Dec 31 16:20:17 2012 UTC (11 years, 11 months ago) by dsl
Branches: MAIN
CVS tags: yamt-pagecache-base8, khorben-n900, agc-symver-base, agc-symver
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +4 -5 lines
Move the two fields used to save some i387 state on the last fpu trap
  into their own sub-structure of the pcb (from 'struct savefpu').
They only (seem) to be used in some code that generates core dumps
  for 32bit processes (code that might be broken as well!).
'struct safefpu' is now identical to 'struct fxsave64'. One (or both)
  needs extending to support AVX - might need to be dynamically sized.
Removed all the __aligned(16) except for the one in struct pcb itself.
  Only the copy used for the fsave instruction need be aligned.

Revision 1.74.4.3: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:18:44 2012 UTC (12 years, 1 month ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.74.4.2: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.4.2: +26 -14 lines
sync with head

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Jul 15 15:17:56 2012 UTC (12 years, 4 months ago) by dsl
Branches: MAIN
CVS tags: yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +3 -9 lines
Rename MDP_IRET to MDL_IRET since it is an lwp flag, not a proc one.
Add an MDL_COMPAT32 flag to the lwp's md_flags, set it for 32bit lwps
  and use it to force 'return to user' with iret (as is done when
  MDL_IRET is set).
Split the iret/sysret code paths much later.
Remove all the replicated code for 32bit system calls - which was only
  needed so that iret was always used.
frameasm.h for XEN contains '#define swapgs', while XEN probable never
  needs swapgs, this is likely to be confusing.
Add a SWAPGS which is a nop on XEN and swapgs otherwise.
(I've not yet checked all the swapgs in files that include frameasm.h)
Simple x86 programs still work.
Hijack 6.99.9 kernel bump (needed for compat32 modules)

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sun Jul 8 20:14:11 2012 UTC (12 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +7 -7 lines
The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.

Revision 1.30.2.4: download - view: text, markup, annotated - select for diffs
Tue Jun 12 23:23:26 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-4
Diff to: previous 1.30.2.3: preferred, colored; branchpoint 1.30: preferred, colored; next MAIN 1.31: preferred, colored
Changes since revision 1.30.2.3: +22 -2 lines
Pull up following revision(s) (requested by spz in ticket #1450):
	sys/arch/amd64/amd64/machdep.c: revision 1.184
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.30.2.1.6.1: download - view: text, markup, annotated - select for diffs
Tue Jun 12 23:21:42 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-4-0
Diff to: previous 1.30.2.1: preferred, colored; next MAIN 1.30.2.2: preferred, colored
Changes since revision 1.30.2.1: +22 -2 lines
Pull up following revision(s) (requested by spz in ticket #1450):
	sys/arch/amd64/amd64/machdep.c: revision 1.184
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.55.4.4: download - view: text, markup, annotated - select for diffs
Tue Jun 12 23:18:13 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2
Diff to: previous 1.55.4.3: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.4.3: +22 -2 lines
Pull up following revision(s) (requested by spz in ticket #1773):
	sys/arch/amd64/amd64/machdep.c: revision 1.184
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.55.4.3.2.1: download - view: text, markup, annotated - select for diffs
Tue Jun 12 23:18:07 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-5-1
CVS tags: netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE
Diff to: previous 1.55.4.3: preferred, colored; next MAIN 1.55.4.4: preferred, colored
Changes since revision 1.55.4.3: +22 -2 lines
Pull up following revision(s) (requested by spz in ticket #1773):
	sys/arch/amd64/amd64/machdep.c: revision 1.184
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.55.6.3: download - view: text, markup, annotated - select for diffs
Tue Jun 12 23:17:58 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-5-0
Diff to: previous 1.55.6.2: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.6.2: +22 -2 lines
Pull up following revision(s) (requested by spz in ticket #1773):
	sys/arch/amd64/amd64/machdep.c: revision 1.184
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.74.10.2: download - view: text, markup, annotated - select for diffs
Tue Jun 12 23:13:07 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-6
CVS tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Diff to: previous 1.74.10.1: preferred, colored; branchpoint 1.74: preferred, colored; next MAIN 1.75: preferred, colored
Changes since revision 1.74.10.1: +20 -0 lines
Pull up following revision(s) (requested by spz in ticket #337):
	sys/arch/amd64/amd64/machdep.c: revision 1.184
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Tue Jun 12 22:16:05 2012 UTC (12 years, 6 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +20 -2 lines
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.

Revision 1.74.8.2: download - view: text, markup, annotated - select for diffs
Sat Jun 2 11:08:47 2012 UTC (12 years, 6 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.74.8.1: preferred, colored; branchpoint 1.74: preferred, colored; next MAIN 1.75: preferred, colored
Changes since revision 1.74.8.1: +5 -6 lines
sync to latest -current.

Revision 1.74.4.2: download - view: text, markup, annotated - select for diffs
Wed May 23 10:07:39 2012 UTC (12 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.74.4.1: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.4.1: +5 -6 lines
sync with head.

Revision 1.74.10.1: download - view: text, markup, annotated - select for diffs
Mon May 21 15:25:56 2012 UTC (12 years, 6 months ago) by riz
Branches: netbsd-6
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +5 -6 lines
Pull up following revision(s) (requested by martin in ticket #274):
	sys/arch/amd64/amd64/process_machdep.c: revision 1.20
	sys/kern/sys_lwp.c: revision 1.54
	sys/arch/sparc64/sparc64/machdep.c: revision 1.267
	sys/arch/mips/mips/cpu_subr.c: revision 1.16
	sys/arch/vax/vax/machdep.c: revision 1.188
	sys/sys/lwp.h: revision 1.161
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.98
	sys/arch/alpha/alpha/machdep.c: revision 1.339
	sys/compat/sys/ucontext.h: revision 1.6
	sys/arch/hppa/hppa/hppa_machdep.c: revision 1.28
	distrib/sets/lists/tests/mi: revision 1.469
	sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.42
	tests/lib/libc/sys/t_lwp_create.c: revision 1.1
	tests/lib/libc/sys/Makefile: revision 1.23
	sys/arch/arm/arm/sig_machdep.c: revision 1.42
	sys/arch/amd64/include/mcontext.h: revision 1.15
	sys/arch/amd64/amd64/machdep.c: revision 1.183
	sys/arch/sh3/sh3/sh3_machdep.c: revision 1.99
	sys/arch/i386/i386/machdep.c: revision 1.727
	sys/compat/netbsd32/netbsd32_lwp.c: revision 1.13
	sys/arch/sparc/sparc/machdep.c: revision 1.319
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.76
	sys/arch/m68k/m68k/sig_machdep.c: revision 1.49
	sys/sys/ucontext.h: revision 1.16
	sys/arch/mips/mips/netbsd32_machdep.c: revision 1.9
	lib/libc/sys/_lwp_create.2: revision 1.5
Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.
To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.
Add an exhaustive atf test case, based partly on code from Joel Sing.
Should finally fix the remaining open part of PR kern/43903.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Mon May 21 14:15:17 2012 UTC (12 years, 6 months ago) by martin
Branches: MAIN
CVS tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +5 -6 lines
Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.

Revision 1.74.4.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:05:58 2012 UTC (12 years, 7 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +2 -40 lines
sync with head

Revision 1.74.8.1: download - view: text, markup, annotated - select for diffs
Fri Feb 24 09:11:26 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +2 -40 lines
sync to -current.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Sun Feb 19 21:06:01 2012 UTC (12 years, 9 months ago) by rmind
Branches: MAIN
CVS tags: yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +2 -40 lines
Remove COMPAT_SA / KERN_SA.  Welcome to 6.99.3!
Approved by core@.

Revision 1.68.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:04:47 2011 UTC (13 years, 6 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68: +17 -10 lines
Sync with HEAD.

Revision 1.55.8.2: download - view: text, markup, annotated - select for diffs
Fri May 20 08:11:19 2011 UTC (13 years, 6 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.55.8.1: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.8.1: +7 -4 lines
bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).

Revision 1.57.2.4: download - view: text, markup, annotated - select for diffs
Mon Mar 28 23:04:34 2011 UTC (13 years, 8 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.57.2.3: preferred, colored; branchpoint 1.57: preferred, colored; next MAIN 1.58: preferred, colored
Changes since revision 1.57.2.3: +17 -10 lines
Sync with HEAD. TODO before merge:
- shortcut for suspend code in sysmon, when powerd(8) is not running.
Borrow ``xs_watch'' thread context?
- bug hunting in xbd + xennet resume. Rings are currently thrashed upon
resume, so current implementation force flush them on suspend. It's not
really needed.

Revision 1.61.4.2: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:49:15 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.61.4.1: preferred, colored; branchpoint 1.61: preferred, colored; next MAIN 1.62: preferred, colored
Changes since revision 1.61.4.1: +52 -31 lines
sync with head

Revision 1.68.4.2: download - view: text, markup, annotated - select for diffs
Sat Mar 5 15:09:29 2011 UTC (13 years, 9 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.68.4.1: preferred, colored; branchpoint 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68.4.1: +12 -6 lines
Sync with HEAD

Revision 1.74: download - view: text, markup, annotated - select for diffs
Fri Mar 4 22:25:24 2011 UTC (13 years, 9 months ago) by joerg
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, netbsd-6-base, jym-xensuspend-nbase, jym-xensuspend-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase
Branch point for: yamt-pagecache, netbsd-6, jmcneill-usbmp
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +3 -3 lines
Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Thu Feb 24 04:28:44 2011 UTC (13 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +10 -4 lines
Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Wed Feb 23 03:31:49 2011 UTC (13 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +3 -3 lines
C&P error

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Feb 23 02:58:38 2011 UTC (13 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +3 -3 lines
Fix ucontext32_t on AMD64. Add optional compile time assertions for
ucontext_t and ucontext32_t to ensure that they don't change.
Provide the constants for AMD64, ARM, i386, and M68K.

Revision 1.68.4.1: download - view: text, markup, annotated - select for diffs
Tue Feb 8 16:19:10 2011 UTC (13 years, 10 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +7 -6 lines
Sync with HEAD

Revision 1.70: download - view: text, markup, annotated - select for diffs
Mon Feb 7 03:54:45 2011 UTC (13 years, 10 months ago) by chs
Branches: MAIN
CVS tags: uebayasi-xip-base7, bouyer-quota2-base
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +6 -11 lines
move macros for validating fs/gs to segments.h and use them
in the linux32 code as well.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Wed Jan 26 21:44:31 2011 UTC (13 years, 10 months ago) by njoly
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +12 -6 lines
Do mask the upper 16 bits, when sanity checking fs/gs register values.
Fix my own PR/43842.

Revision 1.57.2.3: download - view: text, markup, annotated - select for diffs
Mon Jan 10 00:37:28 2011 UTC (13 years, 11 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.57.2.2: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.2: +3 -3 lines
Sync with HEAD

Revision 1.68: download - view: text, markup, annotated - select for diffs
Wed Nov 17 18:22:17 2010 UTC (14 years ago) by dholland
Branches: MAIN
CVS tags: matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +3 -3 lines
Fix build with COMPAT_13.

Revision 1.57.2.2: download - view: text, markup, annotated - select for diffs
Sun Oct 24 22:47:52 2010 UTC (14 years, 1 month ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.57.2.1: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.1: +77 -54 lines
Sync with HEAD

Revision 1.61.2.3: download - view: text, markup, annotated - select for diffs
Fri Oct 22 07:20:57 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.61.2.2: preferred, colored; branchpoint 1.61: preferred, colored; next MAIN 1.62: preferred, colored
Changes since revision 1.61.2.2: +2 -2 lines
Sync with HEAD (-D20101022).

Revision 1.50.2.5: download - view: text, markup, annotated - select for diffs
Sat Oct 9 03:31:37 2010 UTC (14 years, 2 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.50.2.4: preferred, colored; branchpoint 1.50: preferred, colored; next MAIN 1.51: preferred, colored
Changes since revision 1.50.2.4: +4 -4 lines
sync with head

Revision 1.55.6.2: download - view: text, markup, annotated - select for diffs
Tue Sep 7 19:38:44 2010 UTC (14 years, 3 months ago) by bouyer
Branches: netbsd-5-0
Diff to: previous 1.55.6.1: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.6.1: +4 -4 lines
Pull up following revision(s) (requested by chs in ticket #1449):
	sys/arch/amd64/amd64/netbsd32_machdep.c: revisions 1.66, 1.67
	sys/arch/amd64/include/segments.h: revision 1.21
in check_mcontext32(), accept the LDT selector for 32-bit user code
as well as the GDT selector.  fixes PR 43835.
accept the LDT selector in check_sigcontext32() too.

Revision 1.55.4.3: download - view: text, markup, annotated - select for diffs
Tue Sep 7 19:38:20 2010 UTC (14 years, 3 months ago) by bouyer
Branches: netbsd-5
CVS tags: netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, matt-nb5-pq3-base, matt-nb5-pq3
Branch point for: netbsd-5-1
Diff to: previous 1.55.4.2: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.4.2: +4 -4 lines
Pull up following revision(s) (requested by chs in ticket #1449):
	sys/arch/amd64/amd64/netbsd32_machdep.c: revisions 1.66, 1.67
	sys/arch/amd64/include/segments.h: revision 1.21
in check_mcontext32(), accept the LDT selector for 32-bit user code
as well as the GDT selector.  fixes PR 43835.
accept the LDT selector in check_sigcontext32() too.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Sep 5 20:52:38 2010 UTC (14 years, 3 months ago) by chs
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +3 -3 lines
accept the LDT selector in check_sigcontext32() too.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sun Sep 5 20:14:39 2010 UTC (14 years, 3 months ago) by chs
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -3 lines
in check_mcontext32(), accept the LDT selector for 32-bit user code
as well as the GDT selector.  fixes PR 43835.

Revision 1.61.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 17 06:43:52 2010 UTC (14 years, 3 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.61.2.1: preferred, colored; branchpoint 1.61: preferred, colored
Changes since revision 1.61.2.1: +54 -40 lines
Sync with HEAD.

Revision 1.50.2.4: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:51:33 2010 UTC (14 years, 4 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.50.2.3: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.2.3: +62 -46 lines
sync with head.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sun Aug 8 18:13:54 2010 UTC (14 years, 4 months ago) by chs
Branches: MAIN
CVS tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +6 -4 lines
Fix several panics that can be caused by applications using
bad segment register values with setcontext() or sigreturn().

Revision 1.55.6.1: download - view: text, markup, annotated - select for diffs
Fri Jul 16 18:43:58 2010 UTC (14 years, 4 months ago) by riz
Branches: netbsd-5-0
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +7 -4 lines
Apply patches (requested by chs in ticket #1424):
	sys/arch/amd64/amd64/netbsd32_machdep.c:         patch
	sys/arch/i386/i386/trap.c:                       patch
Fix several panics that can be caused by applications using
bad segment register values with setcontext() or sigreturn().

Revision 1.55.4.2: download - view: text, markup, annotated - select for diffs
Fri Jul 16 18:40:39 2010 UTC (14 years, 4 months ago) by riz
Branches: netbsd-5
Diff to: previous 1.55.4.1: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.4.1: +7 -4 lines
Apply patches (requested by chs in ticket #1424):
	sys/arch/amd64/amd64/netbsd32_machdep.c:         patch
	sys/arch/i386/i386/trap.c:                       patch
Fix several panics that can be caused by applications using
bad segment register values with setcontext() or sigreturn().

Revision 1.64: download - view: text, markup, annotated - select for diffs
Wed Jul 7 01:14:52 2010 UTC (14 years, 5 months ago) by chs
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +37 -25 lines
add the guts of TLS support on amd64.  based on joerg's patch,
reworked by me to support 32-bit processes as well.
we now keep %fs and %gs loaded with the user values
while in the kernel, which means we don't need to
reload them when returning to user mode.

Revision 1.61.4.1: download - view: text, markup, annotated - select for diffs
Sun May 30 05:16:36 2010 UTC (14 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +23 -21 lines
sync with head

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue May 11 02:34:39 2010 UTC (14 years, 7 months ago) by joerg
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +17 -17 lines
Fix indentation

Revision 1.61.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:39:04 2010 UTC (14 years, 7 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +8 -6 lines
Sync with HEAD.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Fri Apr 23 19:18:09 2010 UTC (14 years, 7 months ago) by rmind
Branches: MAIN
CVS tags: uebayasi-xip-base1
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +8 -6 lines
Remove lwp_uc_pool, replace it with kmem(9), plus add some consistency.
As discussed, a while ago, with ad@.

Revision 1.55.8.1: download - view: text, markup, annotated - select for diffs
Wed Apr 21 00:33:53 2010 UTC (14 years, 7 months ago) by matt
Branches: matt-nb5-mips64
CVS tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +8 -2 lines
sync to netbsd-5

Revision 1.50.2.3: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:01:58 2010 UTC (14 years, 9 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.50.2.2: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.2.2: +24 -11 lines
sync with head

Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu Dec 10 14:13:49 2009 UTC (15 years ago) by matt
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +3 -3 lines
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds).  Should result in no code differences.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Nov 21 03:11:01 2009 UTC (15 years ago) by rmind
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +17 -10 lines
Use lwp_getpcb() on x86 MD code, clean from struct user usage.

Revision 1.57.2.1: download - view: text, markup, annotated - select for diffs
Sun Nov 1 13:58:49 2009 UTC (15 years, 1 month ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +9 -2 lines
Sync with HEAD.

Revision 1.30.2.3: download - view: text, markup, annotated - select for diffs
Sun Oct 18 15:22:38 2009 UTC (15 years, 1 month ago) by bouyer
Branches: netbsd-4
Diff to: previous 1.30.2.2: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.2: +8 -2 lines
Pull up following revision(s) (requested by mlelstv in ticket #1363):
	sys/arch/i386/isa/npx.c: revision 1.132 via patch
	sys/arch/amd64/amd64/fpu.c: revision 1.29 via patch
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.59 via patch
	sys/arch/amd64/amd64/machdep.c: revision 1.105 via patch
	sys/arch/i386/i386/machdep.c: revision 1.647 via patch
PR port-i386/39299 FPU use in signal handlers is unsafe
Ensure FP state is reset, if FP is used in a signal handler.
Fixes PR kern/39299 for 32bit code.

Revision 1.55.4.1: download - view: text, markup, annotated - select for diffs
Sat Oct 3 23:34:48 2009 UTC (15 years, 2 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +8 -2 lines
Pull up following revision(s) (requested by mlelstv in ticket #1048):
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.59
Ensure FP state is reset, if FP is used in a signal handler.
Fixes PR kern/39299 for 32bit code.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Fri Sep 25 13:56:32 2009 UTC (15 years, 2 months ago) by mlelstv
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +8 -2 lines
Ensure FP state is reset, if FP is used in a signal handler.
Fixes PR kern/39299 for 32bit code.

Revision 1.50.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 19 18:45:54 2009 UTC (15 years, 3 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.50.2.1: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.2.1: +3 -2 lines
sync with head.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun Aug 16 17:12:47 2009 UTC (15 years, 3 months ago) by pgoyette
Branches: MAIN
CVS tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +3 -2 lines
Repair more fallout from the exec_aout.h change.

No guarantee that these are the "right" things to do, but they do allow
building of port-amd64 again.

Revision 1.50.2.1: download - view: text, markup, annotated - select for diffs
Mon May 4 08:10:32 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +57 -15 lines
sync with head.

Revision 1.55.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:15:54 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55: +13 -8 lines
Sync with HEAD.

Revision 1.47.6.3: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:27:49 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.47.6.2: preferred, colored; branchpoint 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47.6.2: +53 -9 lines
Sync with HEAD.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Thu Dec 18 15:42:33 2008 UTC (15 years, 11 months ago) by cegger
Branches: MAIN
CVS tags: yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, mjf-devfs2-base, jymxensuspend-base
Branch point for: jym-xensuspend
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +11 -8 lines
malloc -> kmem

Revision 1.51.4.2: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:12:58 2008 UTC (16 years ago) by haad
Branches: haad-dm
Diff to: previous 1.51.4.1: preferred, colored; branchpoint 1.51: preferred, colored; next MAIN 1.52: preferred, colored
Changes since revision 1.51.4.1: +4 -2 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Nov 19 18:35:58 2008 UTC (16 years ago) by ad
Branches: MAIN
CVS tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +4 -2 lines
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime

Revision 1.30.2.2: download - view: text, markup, annotated - select for diffs
Tue Nov 18 22:33:28 2008 UTC (16 years ago) by bouyer
Branches: netbsd-4
Diff to: previous 1.30.2.1: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.2.1: +4 -3 lines
Pull up following revision(s) (requested by sborrill in ticket #1173):
	sys/arch/x86/include/mtrr.h: revision 1.4
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.54
	sys/arch/x86/x86/mtrr_i686.c: revision 1.18
hack around PR#38480:
- rename MTRR_I686_NVAR to MTRR_I686_NVAR_MAX, still set to 8
- store mtrr VCNT value into i686_mtrr_vcnt.  if it is less than 8,
   zero out the relevant parts of mtrr_raw[].msraddr
- replace all usage of MTRR_I686_NVAR with either i686_mtrr_vcnt or
   with MTRR_I686_NVAR_MAX as appropriate
- in i686_mtrr_reload() and mtrr_init_first() don't use mtrr_raw[]
   addresses of 0
still needs a bunch of reworking to handle VCNT > 8 case.
Ensure optional MTRR sections are built if MTRR is enabled (missing
Fix build due to changes in revision 1.4 of sys/arch/x86/include/mtrr.h

Revision 1.51.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:15:39 2008 UTC (16 years, 1 month ago) by haad
Branches: haad-dm
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +46 -7 lines
Sync with HEAD.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Wed Oct 15 06:51:17 2008 UTC (16 years, 1 month ago) by wrstuden
Branches: MAIN
CVS tags: netbsd-5-base, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5-0, netbsd-5, matt-nb5-mips64
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +40 -2 lines
Merge wrstuden-revivesa into HEAD.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Mon Oct 13 12:49:07 2008 UTC (16 years, 2 months ago) by sborrill
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +6 -5 lines
Ensure optional MTRR sections are built if MTRR is enabled (missing #include
"opt_mtrr.h").
Fix build due to changes in revision 1.4 of sys/arch/x86/include/mtrr.h

Revision 1.50.4.6: download - view: text, markup, annotated - select for diffs
Sun Sep 28 21:23:32 2008 UTC (16 years, 2 months ago) by skrll
Branches: wrstuden-revivesa
Diff to: previous 1.50.4.5: preferred, colored; branchpoint 1.50: preferred, colored; next MAIN 1.51: preferred, colored
Changes since revision 1.50.4.5: +38 -2 lines
Adapt the SA COMPAT_NETBSD32 stuff to this branch.

Revision 1.47.6.2: download - view: text, markup, annotated - select for diffs
Sun Sep 28 10:39:45 2008 UTC (16 years, 2 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.47.6.1: preferred, colored; branchpoint 1.47: preferred, colored
Changes since revision 1.47.6.1: +2 -2 lines
Sync with HEAD.

Revision 1.50.4.5: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:38:48 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.50.4.4: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.4.4: +4 -4 lines
Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Sep 19 01:58:16 2008 UTC (16 years, 2 months ago) by pgoyette
Branches: MAIN
CVS tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -3 lines
Fix apparent (and obvious) typo in previous.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu Sep 18 21:28:45 2008 UTC (16 years, 2 months ago) by dsl
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +4 -4 lines
Clear all the correct flags when calling a signal handler.

Revision 1.50.4.4: download - view: text, markup, annotated - select for diffs
Mon Jun 23 04:30:05 2008 UTC (16 years, 5 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.50.4.3: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.4.3: +2 -4 lines
Sync w/ -current. 34 merge conflicts to follow.

Revision 1.48.2.2: download - view: text, markup, annotated - select for diffs
Wed Jun 4 02:04:40 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.48.2.1: preferred, colored; branchpoint 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48.2.1: +2 -4 lines
sync with head

Revision 1.47.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:21:48 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +27 -20 lines
Sync with HEAD.

Revision 1.50.4.3: download - view: text, markup, annotated - select for diffs
Fri May 23 04:30:03 2008 UTC (16 years, 6 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.50.4.2: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.4.2: +4 -2 lines
Re-add userret hook. Add a new define, SA_NO_USERRET, which
indicates that upcall support should NOT be included. Add this
for all non-netbsd emulations. They will never be SA apps, so
let's make the invarient pretty blatant.

NetBSD code should include both sys/sa.h and sys/savar.h.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Wed May 21 14:10:28 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl
Branch point for: haad-dm
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +2 -4 lines
Remove unneeded playing about with kernel_lock.

Revision 1.48.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:31:27 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +21 -12 lines
sync with head.

Revision 1.50.4.2: download - view: text, markup, annotated - select for diffs
Wed May 14 19:54:09 2008 UTC (16 years, 7 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.50.4.1: preferred, colored; branchpoint 1.50: preferred, colored
Changes since revision 1.50.4.1: +16 -16 lines
Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.

Revision 1.50.4.1: download - view: text, markup, annotated - select for diffs
Sat May 10 23:48:43 2008 UTC (16 years, 7 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +16 -16 lines
Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Thu Apr 24 18:39:20 2008 UTC (16 years, 7 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base2, yamt-nfs-mp-base2, yamt-nfs-mp-base, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +12 -12 lines
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Mon Apr 21 19:06:42 2008 UTC (16 years, 7 months ago) by tls
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +11 -2 lines
Work around PR38480 by making it possible to omit options MTRR from
amd64 INSTALL kernels -- and doing so.  At least you can now get an
INSTALL kernel onto a box with this odd MTRR configuration to debug it.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Wed Apr 16 21:51:03 2008 UTC (16 years, 7 months ago) by cegger
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +8 -8 lines
use POSIX integer types

Revision 1.43.10.3: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:03:53 2008 UTC (16 years, 8 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.43.10.2: preferred, colored; branchpoint 1.43: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43.10.2: +5 -5 lines
sync with HEAD

Revision 1.44.2.1: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:04:20 2008 UTC (16 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44: +5 -5 lines
Sync with HEAD.

Revision 1.17.2.5: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:35:18 2008 UTC (16 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.17.2.4: preferred, colored; branchpoint 1.17: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17.2.4: +85 -12 lines
sync with head

Revision 1.44.8.2: download - view: text, markup, annotated - select for diffs
Sat Jan 19 12:14:09 2008 UTC (16 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.44.8.1: preferred, colored; branchpoint 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44.8.1: +3 -3 lines
Sync with HEAD

Revision 1.47: download - view: text, markup, annotated - select for diffs
Tue Jan 15 14:50:09 2008 UTC (16 years, 10 months ago) by joerg
Branches: MAIN
CVS tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base, ad-socklock-base1
Branch point for: mjf-devfs2
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +5 -5 lines
Introduce optional cpu_offline_md to execute MD actions at the end of
cpu_offline. Use this on amd64/i386 to force a FPU save. As this was
triggered by npxsave_cpu/fpusave_cpu not working for a different CPU,
remove the cpu_info argument and adjust npxsave_*/fpusave_* to use bool
for the save.

OK ad@

Revision 1.43.10.2: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:44:46 2008 UTC (16 years, 11 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.43.10.1: preferred, colored; branchpoint 1.43: preferred, colored
Changes since revision 1.43.10.1: +82 -9 lines
sync with HEAD

Revision 1.44.8.1: download - view: text, markup, annotated - select for diffs
Wed Jan 2 21:47:01 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
CVS tags: bouyer-xeni386-merge1
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +82 -9 lines
Sync with HEAD

Revision 1.44.4.1: download - view: text, markup, annotated - select for diffs
Wed Dec 26 19:41:57 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44: +82 -9 lines
Sync with head.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Mon Dec 24 17:35:00 2007 UTC (16 years, 11 months ago) by hamajima
Branches: MAIN
CVS tags: vmlocking2-base3, matt-armv6-base
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +75 -2 lines
Add compat_13_netbsd32_sigreturn() for 32bits programs with COMPAT_13+EXEC_AOUT.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Thu Dec 20 23:02:38 2007 UTC (16 years, 11 months ago) by dsl
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +9 -9 lines
Convert all the system call entry points from:
    int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.

Revision 1.43.10.1: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:14:08 2007 UTC (17 years, 1 month ago) by matt
Branches: matt-armv6
CVS tags: matt-armv6-prevmlocking
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
sync with HEAD

Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed Oct 17 19:53:01 2007 UTC (17 years, 1 month ago) by garbled
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, jmcneill-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: vmlocking2, mjf-devfs, bouyer-xeni386
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.

Revision 1.39.2.3: download - view: text, markup, annotated - select for diffs
Wed Oct 3 19:22:09 2007 UTC (17 years, 2 months ago) by garbled
Branches: ppcoea-renovation
Diff to: previous 1.39.2.2: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.2.2: +3 -3 lines
Sync with HEAD

Revision 1.17.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:22:32 2007 UTC (17 years, 3 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.17.2.3: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.3: +17 -24 lines
sync with head.

Revision 1.37.2.4: download - view: text, markup, annotated - select for diffs
Sun Jul 15 13:15:22 2007 UTC (17 years, 5 months ago) by ad
Branches: vmlocking
Diff to: previous 1.37.2.3: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37.2.3: +3 -3 lines
Sync with head.

Revision 1.37.4.1: download - view: text, markup, annotated - select for diffs
Wed Jul 11 19:57:34 2007 UTC (17 years, 5 months ago) by mjf
Branches: mjf-ufs-trans
Diff to: previous 1.37: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37: +14 -19 lines
Sync with head.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sun Jul 8 10:19:21 2007 UTC (17 years, 5 months ago) by pooka
Branches: MAIN
CVS tags: yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base, ppcoea-renovation-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, jmcneill-pm, hpcarm-cleanup, bouyer-xenamd64
Branch point for: matt-armv6
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +3 -3 lines
Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL.  Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."

Revision 1.39.2.2: download - view: text, markup, annotated - select for diffs
Tue Jun 26 18:11:58 2007 UTC (17 years, 5 months ago) by garbled
Branches: ppcoea-renovation
Diff to: previous 1.39.2.1: preferred, colored
Changes since revision 1.39.2.1: +4 -7 lines
Sync with HEAD.

Revision 1.37.2.3: download - view: text, markup, annotated - select for diffs
Sat Jun 9 23:54:51 2007 UTC (17 years, 6 months ago) by ad
Branches: vmlocking
Diff to: previous 1.37.2.2: preferred, colored
Changes since revision 1.37.2.2: +4 -7 lines
Sync with head.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Jun 4 23:15:01 2007 UTC (17 years, 6 months ago) by xtraeme
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +4 -7 lines
Ansify, de-__P(), unregister.

Revision 1.37.2.2: download - view: text, markup, annotated - select for diffs
Sun May 27 12:26:58 2007 UTC (17 years, 6 months ago) by ad
Branches: vmlocking
Diff to: previous 1.37.2.1: preferred, colored
Changes since revision 1.37.2.1: +6 -6 lines
Sync with head.

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Tue May 22 17:26:32 2007 UTC (17 years, 6 months ago) by matt
Branches: ppcoea-renovation
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
Update to HEAD.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Mon May 21 08:10:38 2007 UTC (17 years, 6 months ago) by fvdl
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +18 -16 lines
Revert fs/gs changes until I figure out issues with them.

Revision 1.32.2.5: download - view: text, markup, annotated - select for diffs
Thu May 17 13:40:49 2007 UTC (17 years, 6 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.32.2.4: preferred, colored; branchpoint 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.4: +16 -18 lines
sync with head.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Fri May 11 14:01:46 2007 UTC (17 years, 7 months ago) by fvdl
Branches: MAIN
CVS tags: yamt-idlelwp-base8
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +16 -18 lines
Don't save/restore %fs and %gs in trapframe. The kernel won't touch them.
Instead, save/restore them on context switch. For 32bit processes, save/restore
the selector values only, for 64bit processes, save/restore the appropriate
MSRs. Iff the defaults have been changed.

Revision 1.32.2.4: download - view: text, markup, annotated - select for diffs
Mon May 7 10:54:51 2007 UTC (17 years, 7 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.32.2.3: preferred, colored; branchpoint 1.32: preferred, colored
Changes since revision 1.32.2.3: +6 -6 lines
sync with head.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Apr 16 19:12:17 2007 UTC (17 years, 7 months ago) by ad
Branches: MAIN
Branch point for: ppcoea-renovation
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +6 -6 lines
Share the sysarch stuff between the x86 ports. PR kern/36046.

Revision 1.37.2.1: download - view: text, markup, annotated - select for diffs
Tue Apr 10 13:22:50 2007 UTC (17 years, 8 months ago) by ad
Branches: vmlocking
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -9 lines
Sync with head.

Revision 1.32.2.3: download - view: text, markup, annotated - select for diffs
Sat Mar 24 14:54:32 2007 UTC (17 years, 8 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.32.2.2: preferred, colored; branchpoint 1.32: preferred, colored
Changes since revision 1.32.2.2: +7 -9 lines
sync with head.

Revision 1.37.6.1: download - view: text, markup, annotated - select for diffs
Sun Mar 18 00:06:31 2007 UTC (17 years, 8 months ago) by reinoud
Branches: reinoud-bufcleanup
Diff to: previous 1.37: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37: +7 -9 lines
First attempt to bring branch in sync with HEAD

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Mar 16 22:23:30 2007 UTC (17 years, 8 months ago) by dsl
Branches: MAIN
CVS tags: thorpej-atomic-base, thorpej-atomic
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -9 lines
Use NETBSD32PTR64() and NETBSD32PTR32() throughout.

Revision 1.32.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 05:46:17 2007 UTC (17 years, 9 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.32.2.1: preferred, colored; branchpoint 1.32: preferred, colored
Changes since revision 1.32.2.1: +6 -8 lines
Sync with HEAD.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Mar 4 14:36:12 2007 UTC (17 years, 9 months ago) by yamt
Branches: MAIN
Branch point for: vmlocking, reinoud-bufcleanup, mjf-ufs-trans
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +4 -6 lines
fix fallout from caddr_t changes.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Mar 4 05:59:12 2007 UTC (17 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +6 -6 lines
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.32.2.1: download - view: text, markup, annotated - select for diffs
Tue Feb 27 16:48:43 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +34 -7 lines
- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.17.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:05:40 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.17.2.2: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.2: +57 -60 lines
sync with head.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon Feb 19 15:10:04 2007 UTC (17 years, 9 months ago) by cube
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +17 -2 lines
Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Feb 18 20:22:25 2007 UTC (17 years, 9 months ago) by ad
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +18 -6 lines
Sync signal delivery routines with i386. sendsig_reset() was not being
called, and so delivered signals were not being masked.

From cube@, with minor mods by me.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Feb 17 22:31:37 2007 UTC (17 years, 9 months ago) by pavel
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -3 lines
Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Feb 9 21:55:01 2007 UTC (17 years, 10 months ago) by ad
Branches: MAIN
CVS tags: post-newlock2-merge
Branch point for: yamt-idlelwp
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +25 -55 lines
Merge newlock2 to head.

Revision 1.25.2.6: download - view: text, markup, annotated - select for diffs
Tue Jan 30 13:49:33 2007 UTC (17 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.25.2.5: preferred, colored; branchpoint 1.25: preferred, colored; next MAIN 1.26: preferred, colored
Changes since revision 1.25.2.5: +16 -52 lines
Remove support for SA. Ok core@.

Revision 1.25.2.5: download - view: text, markup, annotated - select for diffs
Fri Jan 12 01:00:40 2007 UTC (17 years, 11 months ago) by ad
Branches: newlock2
Diff to: previous 1.25.2.4: preferred, colored; branchpoint 1.25: preferred, colored
Changes since revision 1.25.2.4: +11 -12 lines
Sync with head.

Revision 1.25.2.4: download - view: text, markup, annotated - select for diffs
Thu Jan 11 22:22:56 2007 UTC (17 years, 11 months ago) by ad
Branches: newlock2
Diff to: previous 1.25.2.3: preferred, colored; branchpoint 1.25: preferred, colored
Changes since revision 1.25.2.3: +10 -3 lines
Checkpoint work in progress.

Revision 1.30.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 6 13:18:16 2007 UTC (17 years, 11 months ago) by bouyer
Branches: netbsd-4
CVS tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, matt-nb4-arm-base, matt-nb4-arm
Branch point for: netbsd-4-0
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +10 -11 lines
Pull up following revision(s) (requested by elad in ticket #316):
	share/examples/secmodel/secmodel_example.c: revision 1.10 via patch
	sys/arch/i386/i386/sys_machdep.c: revision 1.79
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.31
	share/man/man9/secmodel_bsd44.9: revision 1.9
	sys/arch/vax/vax/mem.c: revision 1.34 via patch
	sys/arch/sh3/sh3/mem.c: revision 1.23 via patch
	sys/arch/sh5/sh5/mem.c: revision 1.14 via patch
	sys/secmodel/bsd44/secmodel_bsd44_suser.c: revision 1.22 via patch
	sys/arch/powerpc/powerpc/mem.c: revision 1.27 via patch
	sys/arch/x86/x86/x86_machdep.c: revision 1.5
	sys/arch/alpha/alpha/machdep.c: revision 1.291
	sys/arch/arm/arm32/mem.c: revision 1.17 via patch
	sys/secmodel/bsd44/secmodel_bsd44_securelevel.c: revision 1.20
	sys/sys/kauth.h: revision 1.29 via patch
	sys/arch/amd64/amd64/sys_machdep.c: revision 1.10
	share/man/man9/kauth.9: revision 1.43 via patch
	sys/arch/xen/i386/sys_machdep.c: revision 1.10
	sys/kern/kern_auth.c: revision 1.35
	sys/arch/pc532/pc532/mem.c: revision 1.43 via patch
Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.

Revision 1.17.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:45:22 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.17.2.1: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.1: +17 -14 lines
sync with head.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Tue Dec 26 10:43:44 2006 UTC (17 years, 11 months ago) by elad
Branches: MAIN
CVS tags: newlock2-nbase, newlock2-base
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +10 -11 lines
Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.

Revision 1.26.2.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:15:46 2006 UTC (18 years ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.26.2.1: preferred, colored; branchpoint 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26.2.1: +4 -4 lines
sync with head.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Nov 21 15:02:18 2006 UTC (18 years ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3 lines
adjust limits takes struct proc again.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Nov 21 14:32:27 2006 UTC (18 years ago) by christos
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +4 -4 lines
From Nicolas Joly:

> It seems that 32bits programs, running under compat_netbsd32, using
> setrlimit force all other programs to have their maximum data size
> fixed at 3GB, where native 64bits apps used 8GB previously.

I tracked this one to the `netbsd32_adjust_limits()' function (called
when creating a new process under compat_netbsd32), where data and
stack limits are set without checking for shared `p_limit' structure
(p_limit->p_refcnt > 1). This explain the side effect where processes
have their limits changed when a compat_netbsd32 (or compat_linux32)
program is run.

The fix is to use `dosetrlimit()' to ensure the needed copy-on-write
behaviour for shared structure.

Revision 1.25.2.3: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:29:03 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.25.2.2: preferred, colored; branchpoint 1.25: preferred, colored
Changes since revision 1.25.2.2: +8 -7 lines
Sync with head.

Revision 1.25.2.2: download - view: text, markup, annotated - select for diffs
Fri Nov 17 16:34:32 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.25.2.1: preferred, colored; branchpoint 1.25: preferred, colored
Changes since revision 1.25.2.1: +16 -17 lines
Checkpoint work in progress.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Oct 23 12:11:47 2006 UTC (18 years, 1 month ago) by pooka
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3 lines
apply const where necessary

Revision 1.26.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:04:31 2006 UTC (18 years, 1 month ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -4 lines
sync with head

Revision 1.25.2.1: download - view: text, markup, annotated - select for diffs
Fri Oct 20 19:32:18 2006 UTC (18 years, 1 month ago) by ad
Branches: newlock2
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -3 lines
The signal mask/stack will be per-LWP shortly.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue Sep 19 22:03:10 2006 UTC (18 years, 2 months ago) by elad
Branches: MAIN
CVS tags: yamt-splraiseipl-base2
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -4 lines
Lose (void *) casts on the machdep scope authorization wrapper. Update
documentation.

Revision 1.20.6.6: download - view: text, markup, annotated - select for diffs
Thu Sep 14 12:31:07 2006 UTC (18 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.20.6.5: preferred, colored; branchpoint 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20.6.5: +7 -6 lines
sync with head.

Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:37:05 2006 UTC (18 years, 3 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20: +126 -25 lines
sync with head

Revision 1.26: download - view: text, markup, annotated - select for diffs
Fri Sep 8 20:58:57 2006 UTC (18 years, 3 months ago) by elad
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9
Branch point for: yamt-splraiseipl
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +7 -6 lines
First take at security model abstraction.

- Add a few scopes to the kernel: system, network, and machdep.

- Add a few more actions/sub-actions (requests), and start using them as
  opposed to the KAUTH_GENERIC_ISSUSER place-holders.

- Introduce a basic set of listeners that implement our "traditional"
  security model, called "bsd44". This is the default (and only) model we
  have at the moment.

- Update all relevant documentation.

- Add some code and docs to help folks who want to actually use this stuff:

  * There's a sample overlay model, sitting on-top of "bsd44", for
    fast experimenting with tweaking just a subset of an existing model.

    This is pretty cool because it's *really* straightforward to do stuff
    you had to use ugly hacks for until now...

  * And of course, documentation describing how to do the above for quick
    reference, including code samples.

All of these changes were tested for regressions using a Python-based
testsuite that will be (I hope) available soon via pkgsrc. Information
about the tests, and how to write new ones, can be found on:

	http://kauth.linbsd.org/kauthwiki

NOTE FOR DEVELOPERS: *PLEASE* don't add any code that does any of the
following:

  - Uses a KAUTH_GENERIC_ISSUSER kauth(9) request,
  - Checks 'securelevel' directly,
  - Checks a uid/gid directly.

(or if you feel you have to, contact me first)

This is still work in progress; It's far from being done, but now it'll
be a lot easier.

Relevant mailing list threads:

http://mail-index.netbsd.org/tech-security/2006/01/25/0011.html
http://mail-index.netbsd.org/tech-security/2006/03/24/0001.html
http://mail-index.netbsd.org/tech-security/2006/04/18/0000.html
http://mail-index.netbsd.org/tech-security/2006/05/15/0000.html
http://mail-index.netbsd.org/tech-security/2006/08/01/0000.html
http://mail-index.netbsd.org/tech-security/2006/08/25/0000.html

Many thanks to YAMAMOTO Takashi, Matt Thomas, and Christos Zoulas for help
stablizing kauth(9).

Full credit for the regression tests, making sure these changes didn't break
anything, goes to Matt Fleming and Jaime Fournier.

Happy birthday Randi! :)

Revision 1.20.6.5: download - view: text, markup, annotated - select for diffs
Sun Sep 3 15:22:41 2006 UTC (18 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.20.6.4: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.6.4: +5 -2 lines
sync with head.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Aug 30 14:01:57 2006 UTC (18 years, 3 months ago) by cube
Branches: MAIN
CVS tags: yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: newlock2
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +5 -2 lines
Let this compile under "no options COREDUMP".

Revision 1.20.6.4: download - view: text, markup, annotated - select for diffs
Fri Aug 11 15:41:00 2006 UTC (18 years, 4 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.20.6.3: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.6.3: +8 -8 lines
sync with head

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Jul 23 22:06:04 2006 UTC (18 years, 4 months ago) by ad
Branches: MAIN
CVS tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +8 -8 lines
Use the LWP cached credentials where sane.

Revision 1.17.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 14:48:19 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +121 -23 lines
sync with head.

Revision 1.20.4.2: download - view: text, markup, annotated - select for diffs
Thu Jun 1 22:34:10 2006 UTC (18 years, 6 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.20.4.1: preferred, colored; branchpoint 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20.4.1: +5 -4 lines
Sync with head.

Revision 1.21.2.2: download - view: text, markup, annotated - select for diffs
Wed May 24 15:47:50 2006 UTC (18 years, 6 months ago) by tron
Branches: peter-altq
Diff to: previous 1.21.2.1: preferred, colored; branchpoint 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21.2.1: +3 -2 lines
Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.20.6.3: download - view: text, markup, annotated - select for diffs
Wed May 24 10:56:33 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.20.6.2: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.6.2: +5 -4 lines
sync with head.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun May 14 21:55:09 2006 UTC (18 years, 7 months ago) by elad
Branches: MAIN
CVS tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, chap-midi
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +5 -4 lines
integrate kauth.

Revision 1.20.8.4: download - view: text, markup, annotated - select for diffs
Fri May 12 14:50:52 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.20.8.3: preferred, colored; branchpoint 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20.8.3: +3 -2 lines
include sys/kauth.h where appropriate.

Revision 1.20.4.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:37:11 2006 UTC (18 years, 7 months ago) by simonb
Branches: simonb-timecounters
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +116 -19 lines
Sync with head.

Revision 1.20.8.3: download - view: text, markup, annotated - select for diffs
Wed Apr 19 02:31:58 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.20.8.2: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.8.2: +116 -19 lines
sync with head - hopefully this will work

Revision 1.20.6.2: download - view: text, markup, annotated - select for diffs
Sat Apr 1 12:06:07 2006 UTC (18 years, 8 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.20.6.1: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.6.1: +38 -2 lines
sync with head.

Revision 1.21.2.1: download - view: text, markup, annotated - select for diffs
Fri Mar 31 09:44:55 2006 UTC (18 years, 8 months ago) by tron
Branches: peter-altq
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +38 -2 lines
Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed Mar 29 23:07:50 2006 UTC (18 years, 8 months ago) by cube
Branches: MAIN
CVS tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, elad-kernelauth-base
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +38 -2 lines
Add the netbsd32 MD bits for sparc64 and amd64 to support SA.

Many thanks to all who helped for that little project, notably Martin
Husemann for teaching me a bit about the very special sparc64 world.

Revision 1.20.6.1: download - view: text, markup, annotated - select for diffs
Mon Mar 13 09:06:51 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +80 -19 lines
sync with head.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Mar 12 20:25:25 2006 UTC (18 years, 9 months ago) by cube
Branches: MAIN
CVS tags: yamt-pdpolicy-base2, peter-altq-base
Branch point for: peter-altq
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +80 -19 lines
Support the generation of coredumps for 32-bits binaries under
COMPAT_NETBSD32.  They haven't worked for 5 years.

Silently agreed by the tech-kern readers.

XXX sparc64 MD glue still lacking.
XXX The FPU registers on i386 are not dumped correctly, according to my
XXX tests.  It shouldn't be much work for someone who has the slightest
XXX idea of how that stuff is supposed to be laid out on i386.

Revision 1.20.8.2: download - view: text, markup, annotated - select for diffs
Fri Mar 10 14:53:59 2006 UTC (18 years, 9 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.20.8.1: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.8.1: +4 -4 lines
generic_authorize() -> kauth_authorize_generic().

Revision 1.20.8.1: download - view: text, markup, annotated - select for diffs
Wed Mar 8 00:43:05 2006 UTC (18 years, 9 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +4 -4 lines
Adapt to kernel authorization KPI.

I expect *some* lossage here...

Revision 1.18.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 15 10:02:36 2006 UTC (18 years, 10 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.18: preferred, colored; next MAIN 1.19: preferred, colored
Changes since revision 1.18: +4 -4 lines
sync with head.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Jan 14 17:14:46 2006 UTC (18 years, 10 months ago) by hamajima
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, elad-kernelauth
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +3 -3 lines
fix compile error for ktrace-lwp.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Jan 11 09:30:45 2006 UTC (18 years, 11 months ago) by cube
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -3 lines
Add support for VM_TOPDOWN, and use it unconditionally (just like i386).

For COMPAT_NETBSD32 binaries, use VM_TOPDOWN layout too, and sync some
parameters with their i386 counterpart.

OK'd by fvdl@.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:16:21 2005 UTC (19 years ago) by christos
Branches: MAIN
Branch point for: yamt-uio_vmspace
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -2 lines
merge ktrace-lwp.

Revision 1.2.2.5: download - view: text, markup, annotated - select for diffs
Thu Nov 10 13:50:24 2005 UTC (19 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.2.2.4: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.4: +18 -21 lines
Sync with HEAD. Here we go again...

Revision 1.11.10.1: download - view: text, markup, annotated - select for diffs
Sun Sep 18 20:09:49 2005 UTC (19 years, 2 months ago) by tron
Branches: netbsd-3
CVS tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +10 -2 lines
Pull up following revision(s) (requested by fvdl in ticket #798):
	sys/compat/sunos/sunos_exec.c: revision 1.47
	sys/compat/pecoff/pecoff_emul.c: revision 1.11
	sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.45
	sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.12
	sys/sys/proc.h: revision 1.198
	sys/compat/mach/mach_exec.c: revision 1.56
	sys/compat/freebsd/freebsd_exec.c: revision 1.27
	sys/arch/sparc64/include/vmparam.h: revision 1.27
	sys/kern/kern_resource.c: revision 1.91
	sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.88
	sys/compat/osf1/osf1_exec.c: revision 1.39
	sys/compat/svr4_32/svr4_32_resource.c: revision 1.5
	sys/compat/ultrix/ultrix_misc.c: revision 1.99
	sys/compat/svr4_32/svr4_32_exec.h: revision 1.9
	sys/kern/exec_elf32.c: revision 1.103
	sys/compat/aoutm68k/aoutm68k_exec.c: revision 1.19
	sys/compat/sunos32/sunos32_exec.c: revision 1.20
	sys/compat/hpux/hpux_exec.c: revision 1.46
	sys/compat/darwin/darwin_exec.c: revision 1.40
	sys/kern/sysv_shm.c: revision 1.83
	sys/uvm/uvm_extern.h: revision 1.99
	sys/uvm/uvm_mmap.c: revision 1.89
	sys/kern/kern_exec.c: revision 1.195
	sys/compat/netbsd32/netbsd32.h: revision 1.31
	sys/arch/sparc64/sparc64/svr4_32_machdep.c: revision 1.20
	sys/compat/svr4/svr4_exec.c: revision 1.56
	sys/compat/irix/irix_exec.c: revision 1.41
	sys/compat/ibcs2/ibcs2_exec.c: revision 1.63
	sys/compat/svr4_32/svr4_32_exec.c: revision 1.16
	sys/arch/amd64/include/vmparam.h: revision 1.8
	sys/compat/linux/common/linux_exec.c: revision 1.73
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2
Tested on amd64, compile-tested on sparc64.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Jul 3 17:18:02 2005 UTC (19 years, 5 months ago) by cube
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Branch point for: yamt-lazymbuf
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +4 -4 lines
Constify machine32 and machine_arch32.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sun Jul 3 16:53:46 2005 UTC (19 years, 5 months ago) by cube
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +3 -2 lines
Make COMPAT_NETBSD32 emulate hw.machine.  While it might seem wrong to do
so, it introduces breakage because a lot of applications make assumptions
from its value.  It's especially bad in the sparc64 case, where 64-bits
instructions can be used in 32-bits addressing mode.  However, there are
other means to know the capabilities of the CPU.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Jun 10 05:10:12 2005 UTC (19 years, 6 months ago) by matt
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +15 -19 lines
Rework the coredump code to have no explicit knownledge of how coredump
i/o is done.  Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o.  This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Jun 2 10:29:04 2005 UTC (19 years, 6 months ago) by drochner
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -4 lines
remove __UNCONST which is not needed anymore

Revision 1.13: download - view: text, markup, annotated - select for diffs
Wed Jun 1 13:04:32 2005 UTC (19 years, 6 months ago) by blymn
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +4 -3 lines
Cast away const for siginfo structure as the function prototype does not
have const.

Revision 1.11.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:28:00 2005 UTC (19 years, 7 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +10 -2 lines
sync with -current

Revision 1.2.2.4: download - view: text, markup, annotated - select for diffs
Fri Apr 1 14:26:50 2005 UTC (19 years, 8 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.2.2.3: preferred, colored
Changes since revision 1.2.2.3: +10 -2 lines
Sync with HEAD.

Revision 1.11.6.1: download - view: text, markup, annotated - select for diffs
Sat Mar 26 18:19:16 2005 UTC (19 years, 8 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +10 -2 lines
sync with head.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Mar 26 05:12:34 2005 UTC (19 years, 8 months ago) by fvdl
Branches: MAIN
CVS tags: yamt-km-base4, kent-audio2-base
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +10 -2 lines
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.

* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.

Revision 1.2.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:12:07 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.2.2.2: preferred, colored
Changes since revision 1.2.2.2: +2 -2 lines
Fix the sync with head I botched.

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:31:13 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.2.2.1: preferred, colored
Changes since revision 1.2.2.1: +4 -5 lines
Sync with HEAD.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Sep 17 14:11:21 2004 UTC (20 years, 2 months ago) by skrll
Branches: MAIN
CVS tags: yamt-km-base3, yamt-km-base2, yamt-km-base, netbsd-3-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, netbsd-3, kent-audio2
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -5 lines
There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe

Revision 1.2.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:31:30 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +366 -23 lines
Sync with HEAD

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Mar 25 15:32:27 2004 UTC (20 years, 8 months ago) by drochner
Branches: MAIN
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +15 -2 lines
remove sigcontext-style signal delivery code

Revision 1.9: download - view: text, markup, annotated - select for diffs
Fri Feb 20 18:11:16 2004 UTC (20 years, 9 months ago) by drochner
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +16 -2 lines
Provide a dummy cpu_exec_aout_makecmds() to make a kernel
with COMPAT_NETBSD32+COMPAT_AOUT link.
netbsd-1.3/i386 binaries are running now.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Wed Feb 11 01:01:37 2004 UTC (20 years, 10 months ago) by matt
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -3 lines
32-bit corefiles should use a MID for i386, not xf86_64.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Oct 21 01:45:25 2003 UTC (21 years, 1 month ago) by fvdl
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +3 -3 lines
Fix int vs. NULL comparison.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Oct 13 18:47:10 2003 UTC (21 years, 2 months ago) by fvdl
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +335 -23 lines
Define a 32bit compat version of the siginfo sendsig, and rename the
old one to reflect it's COMPAT_16 status.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Fri Sep 26 21:28:45 2003 UTC (21 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -2 lines
Add needed header file.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Sep 26 18:04:11 2003 UTC (21 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -3 lines
catch up with const sigset_t *

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Jul 14 23:32:31 2003 UTC (21 years, 5 months ago) by lukem
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +4 -1 lines
__KERNEL_RCSID()

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Jun 23 11:01:03 2003 UTC (21 years, 5 months ago) by martin
Branches: MAIN
Branch point for: ktrace-lwp
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -1 lines
Make sure to include opt_foo.h if a defflag option FOO is used.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Apr 26 18:39:30 2003 UTC (21 years, 7 months ago) by fvdl
Branches: MAIN
Rename the x86_64 port to amd64, as this is the actual name used for
the processor family now. x86_64 is kept as the MACHINE_ARCH value,
since it's already widely used (by e.g. the toolchain, etc), and
by other operating systems.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>