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


Default branch: MAIN


Revision 1.141 / (download) - annotate - [select for diffs], Sat Aug 20 23:49:31 2022 UTC (19 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, 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
Changes since 1.140: +3 -2 lines
Diff to previous 1.140 (colored)

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) - annotate - [select for diffs], Sat Nov 6 20:42:56 2021 UTC (2 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.139: +3 -16 lines
Diff to previous 1.139 (colored)

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) - annotate - [select for diffs], Mon Nov 1 05:07:15 2021 UTC (2 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.138: +3 -3 lines
Diff to previous 1.138 (colored)

Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name.  NFC.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Oct 27 04:14:59 2021 UTC (2 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.137: +5 -5 lines
Diff to previous 1.137 (colored)

Use the signal trampoline version constants from <sys/signal.h>.

Revision 1.136.2.1 / (download) - annotate - [select for diffs], Mon Dec 14 14:37:46 2020 UTC (3 years, 4 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.136: +11 -7 lines
Diff to previous 1.136 (colored) next main 1.137 (colored)

Sync w/ HEAD.

Revision 1.137 / (download) - annotate - [select for diffs], Fri Nov 20 17:44:56 2020 UTC (3 years, 4 months ago) by thorpej
Branch: 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
Changes since 1.136: +11 -7 lines
Diff to previous 1.136 (colored)

malloc(9) -> kmem(9)

Revision 1.136 / (download) - annotate - [select for diffs], Sat Apr 25 15:26:16 2020 UTC (3 years, 11 months ago) by bouyer
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored)

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) - annotate - [select for diffs], Sat Apr 25 11:23:55 2020 UTC (3 years, 11 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.133: +12 -9 lines
Diff to previous 1.133 (colored) next main 1.134 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.135 / (download) - annotate - [select for diffs], Fri Apr 24 16:27:27 2020 UTC (3 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.134: +5 -4 lines
Diff to previous 1.134 (colored)

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) - annotate - [select for diffs], Thu Apr 23 16:16:14 2020 UTC (3 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.133: +9 -7 lines
Diff to previous 1.133 (colored)

use shortcut variables for readability.

Revision 1.115.4.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:03:30 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.115.4.1: +175 -145 lines
Diff to previous 1.115.4.1 (colored) to branchpoint 1.115 (colored) next main 1.116 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.133 / (download) - annotate - [select for diffs], Thu Dec 12 02:15:42 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: 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
Changes since 1.132: +5 -5 lines
Diff to previous 1.132 (colored)

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) - annotate - [select for diffs], Wed Nov 27 11:11:17 2019 UTC (4 years, 4 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.125.2.1: +29 -33 lines
Diff to previous 1.125.2.1 (colored) to branchpoint 1.125 (colored) next main 1.126 (colored)

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) - annotate - [select for diffs], Wed Nov 27 09:16:58 2019 UTC (4 years, 4 months ago) by rin
Branch: MAIN
Changes since 1.131: +81 -4 lines
Diff to previous 1.131 (colored)

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) - annotate - [select for diffs], Thu Nov 21 14:02:33 2019 UTC (4 years, 4 months ago) by martin
Branch: netbsd-9
Changes since 1.125: +10 -8 lines
Diff to previous 1.125 (colored)

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) - annotate - [select for diffs], Wed Nov 20 19:37:51 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.130: +8 -9 lines
Diff to previous 1.130 (colored)

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) - annotate - [select for diffs], Wed Nov 20 10:57:08 2019 UTC (4 years, 4 months ago) by rin
Branch: MAIN
Changes since 1.129: +10 -8 lines
Diff to previous 1.129 (colored)

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) - annotate - [select for diffs], Sun Nov 10 21:16:22 2019 UTC (4 years, 5 months ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.128: +3 -9 lines
Diff to previous 1.128 (colored)

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) - annotate - [select for diffs], Thu Sep 26 01:39:22 2019 UTC (4 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.127: +5 -5 lines
Diff to previous 1.127 (colored)

- 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) - annotate - [select for diffs], Wed Aug 21 12:46:56 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.126: +25 -87 lines
Diff to previous 1.126 (colored)

Style and remove dead stuff.

Revision 1.126 / (download) - annotate - [select for diffs], Wed Aug 21 12:33:12 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.125: +29 -33 lines
Diff to previous 1.125 (colored)

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) - annotate - [select for diffs], Sat Jul 20 18:25:11 2019 UTC (4 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.124: +25 -3 lines
Diff to previous 1.124 (colored)

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) - annotate - [select for diffs], Wed Jun 26 12:30:12 2019 UTC (4 years, 9 months ago) by mgorny
Branch: MAIN
Changes since 1.123: +4 -2 lines
Diff to previous 1.123 (colored)

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) - annotate - [select for diffs], Mon Jun 10 22:05:47 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.115: +93 -256 lines
Diff to previous 1.115 (colored)

Sync with HEAD

Revision 1.123 / (download) - annotate - [select for diffs], Tue Jun 4 16:30:19 2019 UTC (4 years, 10 months ago) by mgorny
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.122: +29 -27 lines
Diff to previous 1.122 (colored)

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) - annotate - [select for diffs], Tue Jun 4 16:29:53 2019 UTC (4 years, 10 months ago) by mgorny
Branch: MAIN
Changes since 1.121: +24 -2 lines
Diff to previous 1.121 (colored)

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) - annotate - [select for diffs], Sun May 19 08:46:15 2019 UTC (4 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.120: +4 -4 lines
Diff to previous 1.120 (colored)

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) - annotate - [select for diffs], Fri Apr 5 07:48:05 2019 UTC (5 years ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.105.2.2: +9 -7 lines
Diff to previous 1.105.2.2 (colored) to branchpoint 1.105 (colored) next main 1.106 (colored)

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) - annotate - [select for diffs], Sun Mar 24 15:58:32 2019 UTC (5 years ago) by maxv
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.119: +9 -8 lines
Diff to previous 1.119 (colored)

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) - annotate - [select for diffs], Fri Mar 1 11:06:55 2019 UTC (5 years, 1 month ago) by pgoyette
Branch: MAIN
Changes since 1.118: +5 -5 lines
Diff to previous 1.118 (colored)

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) - annotate - [select for diffs], Wed Jan 30 13:32:57 2019 UTC (5 years, 2 months ago) by martin
Branch: netbsd-7-0
Changes since 1.92: +5 -3 lines
Diff to previous 1.92 (colored) next main 1.93 (colored)

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) - annotate - [select for diffs], Wed Jan 30 13:29:52 2019 UTC (5 years, 2 months ago) by martin
Branch: netbsd-7-1
Changes since 1.92: +5 -3 lines
Diff to previous 1.92 (colored) next main 1.93 (colored)

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) - annotate - [select for diffs], Wed Jan 30 13:27:28 2019 UTC (5 years, 2 months ago) by martin
Branch: netbsd-7
Changes since 1.92: +5 -3 lines
Diff to previous 1.92 (colored) next main 1.93 (colored)

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) - annotate - [select for diffs], Sun Jan 27 18:43:08 2019 UTC (5 years, 2 months ago) by martin
Branch: netbsd-8
Changes since 1.105.2.1: +5 -3 lines
Diff to previous 1.105.2.1 (colored) to branchpoint 1.105 (colored)

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) - annotate - [select for diffs], Sun Jan 27 02:08:37 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.117: +32 -218 lines
Diff to previous 1.117 (colored)

Merge the [pgoyette-compat] branch

Revision 1.115.2.19 / (download) - annotate - [select for diffs], Fri Jan 25 09:36:08 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.115.2.18: +3 -4 lines
Diff to previous 1.115.2.18 (colored) to branchpoint 1.115 (colored) next main 1.116 (colored)

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) - annotate - [select for diffs], Thu Jan 24 04:08:09 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.17: +4 -2 lines
Diff to previous 1.115.2.17 (colored) to branchpoint 1.115 (colored)

Rework placement of the new netbsd32_machine32_hook

Revision 1.115.2.17 / (download) - annotate - [select for diffs], Thu Jan 24 03:27:23 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.16: +11 -4 lines
Diff to previous 1.115.2.16 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Tue Jan 22 07:42:40 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.15: +4 -9 lines
Diff to previous 1.115.2.15 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Mon Jan 21 06:49:27 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.14: +3 -3 lines
Diff to previous 1.115.2.14 (colored) to branchpoint 1.115 (colored)

No need to declare the hook_call() function for void hooks.  So
remove and simplify.

Revision 1.115.2.14 / (download) - annotate - [select for diffs], Mon Jan 14 13:34:26 2019 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.13: +4 -4 lines
Diff to previous 1.115.2.13 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Sun Jan 13 10:49:49 2019 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.12: +5 -5 lines
Diff to previous 1.115.2.12 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Wed Dec 26 14:01:31 2018 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.11: +3 -3 lines
Diff to previous 1.115.2.11 (colored) to branchpoint 1.115 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.117 / (download) - annotate - [select for diffs], Tue Nov 27 14:09:53 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.116: +5 -3 lines
Diff to previous 1.116 (colored)

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) - annotate - [select for diffs], Sat Sep 29 21:36:13 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.10: +3 -4 lines
Diff to previous 1.115.2.10 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Sat Sep 29 07:34:12 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.9: +4 -2 lines
Diff to previous 1.115.2.9 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Sat Sep 29 06:19:42 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.8: +2 -5 lines
Diff to previous 1.115.2.8 (colored) to branchpoint 1.115 (colored)

Remove some spurious declarations.

Revision 1.115.2.8 / (download) - annotate - [select for diffs], Thu Sep 27 01:34:38 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.7: +3 -2 lines
Diff to previous 1.115.2.7 (colored) to branchpoint 1.115 (colored)

Make sure we pick up the definition of COMPAT_NETBSD32

Revision 1.115.2.7 / (download) - annotate - [select for diffs], Mon Sep 24 23:47:07 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.6: +6 -4 lines
Diff to previous 1.115.2.6 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Mon Sep 24 23:37:59 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.5: +5 -3 lines
Diff to previous 1.115.2.5 (colored) to branchpoint 1.115 (colored)

Make the netbsd32_sendsig_siginfo() routine return an int, to conform
to the MP-safe HOOKs mechanism.

Revision 1.115.2.5 / (download) - annotate - [select for diffs], Mon Sep 24 23:25:24 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.4: +4 -4 lines
Diff to previous 1.115.2.4 (colored) to branchpoint 1.115 (colored)

Provide required args when calling the default (un-hooked) routine.

Revision 1.115.2.4 / (download) - annotate - [select for diffs], Mon Sep 24 22:56:45 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.3: +9 -4 lines
Diff to previous 1.115.2.3 (colored) to branchpoint 1.115 (colored)

Convert yet another function pointer to the MP-safe mechanism

Revision 1.115.2.3 / (download) - annotate - [select for diffs], Fri Sep 14 08:38:37 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.2: +6 -69 lines
Diff to previous 1.115.2.2 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Fri Sep 14 05:37:08 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115.2.1: +26 -158 lines
Diff to previous 1.115.2.1 (colored) to branchpoint 1.115 (colored)

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) - annotate - [select for diffs], Sat Jul 28 04:37:26 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.115: +4 -8 lines
Diff to previous 1.115 (colored)

Sync with HEAD

Revision 1.116 / (download) - annotate - [select for diffs], Thu Jul 26 09:29:08 2018 UTC (5 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Changes since 1.115: +4 -8 lines
Diff to previous 1.115 (colored)

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) - annotate - [select for diffs], Thu Dec 21 19:53:28 2017 UTC (6 years, 3 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.105: +41 -60 lines
Diff to previous 1.105 (colored)

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) - annotate - [select for diffs], Thu Dec 7 23:11:50 2017 UTC (6 years, 4 months ago) by christos
Branch: 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
Changes since 1.114: +66 -2 lines
Diff to previous 1.114 (colored)

Save maxv@ some work and put back the compat_13_sigreturn changes that allow
amd64 to run ancient i386 binaries.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Dec 7 16:22:22 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.113: +41 -60 lines
Diff to previous 1.113 (colored)

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) - annotate - [select for diffs], Sun Dec 3 11:35:47 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.79.2.2: +265 -153 lines
Diff to previous 1.79.2.2 (colored) to branchpoint 1.79 (colored) next main 1.80 (colored)

update from HEAD

Revision 1.113 / (download) - annotate - [select for diffs], Sat Dec 2 15:36:24 2017 UTC (6 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.112: +2 -66 lines
Diff to previous 1.112 (colored)

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) - annotate - [select for diffs], Thu Oct 19 10:01:09 2017 UTC (6 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.111: +34 -34 lines
Diff to previous 1.111 (colored)

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) - annotate - [select for diffs], Sun Oct 15 12:49:53 2017 UTC (6 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored)

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) - annotate - [select for diffs], Sun Oct 15 11:36:15 2017 UTC (6 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored)

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) - annotate - [select for diffs], Sun Sep 17 09:41:35 2017 UTC (6 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.108: +4 -4 lines
Diff to previous 1.108 (colored)

Remove the second argument from USERMODE and KERNELMODE, it is unused
now that we don't have vm86 anymore.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Aug 31 15:41:14 2017 UTC (6 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.107: +5 -4 lines
Diff to previous 1.107 (colored)

check sc_eip in the ldt branch too

Revision 1.92.6.6 / (download) - annotate - [select for diffs], Mon Aug 28 17:51:28 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.92.6.5: +197 -36 lines
Diff to previous 1.92.6.5 (colored) to branchpoint 1.92 (colored) next main 1.93 (colored)

Sync with HEAD

Revision 1.107 / (download) - annotate - [select for diffs], Tue Jul 25 18:03:56 2017 UTC (6 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20170825
Changes since 1.106: +23 -24 lines
Diff to previous 1.106 (colored)

This branch must be static, otherwise there is a condition under which
the KASSERT in startlwp32 would be triggered.

Revision 1.106 / (download) - annotate - [select for diffs], Sat Jul 22 13:00:42 2017 UTC (6 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.105: +27 -17 lines
Diff to previous 1.105 (colored)

Branch for USER_LDT.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:05 2017 UTC (6 years, 10 months ago) by chs
Branch: 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
Changes since 1.104: +2 -10 lines
Diff to previous 1.104 (colored)

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) - annotate - [select for diffs], Fri Apr 21 16:53:21 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.98: +182 -22 lines
Diff to previous 1.98 (colored) next main 1.99 (colored)

Sync with HEAD

Revision 1.95.2.3 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:09 2017 UTC (7 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.95.2.2: +183 -23 lines
Diff to previous 1.95.2.2 (colored) to branchpoint 1.95 (colored) next main 1.96 (colored)

Sync with HEAD

Revision 1.104 / (download) - annotate - [select for diffs], Thu Feb 23 03:34:22 2017 UTC (7 years, 1 month ago) by kamil
Branch: 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
Changes since 1.103: +54 -4 lines
Diff to previous 1.103 (colored)

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) - annotate - [select for diffs], Tue Feb 14 09:03:48 2017 UTC (7 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.102: +5 -4 lines
Diff to previous 1.102 (colored)

Check %eip with USER_LDT too.

Revision 1.102 / (download) - annotate - [select for diffs], Thu Feb 9 08:38:25 2017 UTC (7 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.101: +24 -6 lines
Diff to previous 1.101 (colored)

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) - annotate - [select for diffs], Mon Feb 6 16:34:37 2017 UTC (7 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.100: +25 -15 lines
Diff to previous 1.100 (colored)

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) - annotate - [select for diffs], Mon Feb 6 16:02:17 2017 UTC (7 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.99: +83 -2 lines
Diff to previous 1.99 (colored)

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) - annotate - [select for diffs], Sun Feb 5 13:40:01 2017 UTC (7 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.92.6.4: +4 -2 lines
Diff to previous 1.92.6.4 (colored) to branchpoint 1.92 (colored)

Sync with HEAD

Revision 1.99 / (download) - annotate - [select for diffs], Sun Feb 5 08:52:11 2017 UTC (7 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

Remove #if 0 on USER_LDT.

Revision 1.95.2.2 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:09 2017 UTC (7 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.95.2.1: +4 -2 lines
Diff to previous 1.95.2.1 (colored) to branchpoint 1.95 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.98 / (download) - annotate - [select for diffs], Thu Dec 15 12:04:17 2016 UTC (7 years, 4 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, nick-nhusb-base-20170204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.97: +4 -2 lines
Diff to previous 1.97 (colored)

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) - annotate - [select for diffs], Mon Dec 5 10:54:49 2016 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.92.6.3: +50 -20 lines
Diff to previous 1.92.6.3 (colored) to branchpoint 1.92 (colored)

Sync with HEAD

Revision 1.95.2.1 / (download) - annotate - [select for diffs], Fri Nov 4 14:48:57 2016 UTC (7 years, 5 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.95: +50 -20 lines
Diff to previous 1.95 (colored)

Sync with HEAD

Revision 1.97 / (download) - annotate - [select for diffs], Wed Oct 19 09:44:00 2016 UTC (7 years, 5 months ago) by skrll
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204
Changes since 1.96: +50 -20 lines
Diff to previous 1.96 (colored)

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) - annotate - [select for diffs], Wed Oct 5 20:55:23 2016 UTC (7 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.92.6.2: +6 -6 lines
Diff to previous 1.92.6.2 (colored) to branchpoint 1.92 (colored)

Sync with HEAD

Revision 1.96 / (download) - annotate - [select for diffs], Fri Sep 2 07:51:05 2016 UTC (7 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20161004, localcount-20160914
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

Fix argument (does not compile anyway).

Revision 1.92.6.2 / (download) - annotate - [select for diffs], Sun Dec 27 12:09:28 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.92.6.1: +8 -7 lines
Diff to previous 1.92.6.1 (colored) to branchpoint 1.92 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.95 / (download) - annotate - [select for diffs], Thu Nov 26 13:15:34 2015 UTC (8 years, 4 months ago) by martin
Branch: 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
Changes since 1.94: +5 -4 lines
Diff to previous 1.94 (colored)

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) - annotate - [select for diffs], Sun Nov 22 13:41:24 2015 UTC (8 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.93: +6 -6 lines
Diff to previous 1.93 (colored)

KNF a bit, so I don't get scared each time I open a file

Revision 1.92.6.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:17:51 2015 UTC (9 years ago) by skrll
Branch: nick-nhusb
Changes since 1.92: +2 -21 lines
Diff to previous 1.92 (colored)

Sync with HEAD

Revision 1.93 / (download) - annotate - [select for diffs], Sun Dec 14 21:27:49 2014 UTC (9 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406
Changes since 1.92: +2 -21 lines
Diff to previous 1.92 (colored)

Move the empty sigreturn functions to their own files to allow the compat
module to load by itself.

Revision 1.79.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:02:42 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.79.2.1: +34 -112 lines
Diff to previous 1.79.2.1 (colored) to branchpoint 1.79 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.74.4.5 / (download) - annotate - [select for diffs], Thu May 22 11:39:28 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.74.4.4: +34 -112 lines
Diff to previous 1.74.4.4 (colored) to branchpoint 1.74 (colored) next main 1.75 (colored)

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) - annotate - [select for diffs], Sun May 18 17:44:54 2014 UTC (9 years, 11 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.81: +34 -123 lines
Diff to previous 1.81 (colored) next main 1.82 (colored)

sync with head

Revision 1.92 / (download) - annotate - [select for diffs], Sat Feb 15 22:20:41 2014 UTC (10 years, 2 months ago) by dsl
Branch: 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
Changes since 1.91: +9 -16 lines
Diff to previous 1.91 (colored)

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) - annotate - [select for diffs], Sat Feb 15 10:11:14 2014 UTC (10 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.90: +17 -34 lines
Diff to previous 1.90 (colored)

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) - annotate - [select for diffs], Tue Feb 11 20:17:16 2014 UTC (10 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

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) - annotate - [select for diffs], Fri Feb 7 22:40:22 2014 UTC (10 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.88: +13 -87 lines
Diff to previous 1.88 (colored)

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) - annotate - [select for diffs], Sat Jan 25 05:09:59 2014 UTC (10 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.87: +7 -4 lines
Diff to previous 1.87 (colored)

provide propert address defaults for topdown and bottomup allocation

Revision 1.87 / (download) - annotate - [select for diffs], Sat Jan 4 00:10:02 2014 UTC (10 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.86: +7 -5 lines
Diff to previous 1.86 (colored)

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) - annotate - [select for diffs], Wed Jan 1 18:57:15 2014 UTC (10 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.85: +4 -3 lines
Diff to previous 1.85 (colored)

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) - annotate - [select for diffs], Sun Dec 1 01:05:16 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.84: +20 -14 lines
Diff to previous 1.84 (colored)

revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes

Revision 1.84 / (download) - annotate - [select for diffs], Mon Nov 11 11:10:45 2013 UTC (10 years, 5 months ago) by joerg
Branch: MAIN
Changes since 1.83: +6 -3 lines
Diff to previous 1.83 (colored)

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) - annotate - [select for diffs], Sat Nov 2 00:41:58 2013 UTC (10 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.82: +3 -3 lines
Diff to previous 1.82 (colored)

sprinkle __diagused

Revision 1.82 / (download) - annotate - [select for diffs], Wed Oct 23 20:18:50 2013 UTC (10 years, 5 months ago) by drochner
Branch: MAIN
Changes since 1.81: +14 -20 lines
Diff to previous 1.81 (colored)

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) - annotate - [select for diffs], Tue Jun 25 21:08:07 2013 UTC (10 years, 9 months ago) by dsl
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.80: +25 -14 lines
Diff to previous 1.80 (colored)

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) - annotate - [select for diffs], Mon Feb 25 00:28:19 2013 UTC (11 years, 1 month ago) by tls
Branch: tls-maxphys
Changes since 1.79: +4 -5 lines
Diff to previous 1.79 (colored)

resync with head

Revision 1.74.4.4 / (download) - annotate - [select for diffs], Wed Jan 23 00:05:38 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.74.4.3: +4 -5 lines
Diff to previous 1.74.4.3 (colored) to branchpoint 1.74 (colored)

sync with head

Revision 1.80 / (download) - annotate - [select for diffs], Mon Dec 31 16:20:17 2012 UTC (11 years, 3 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base8, khorben-n900, agc-symver-base, agc-symver
Changes since 1.79: +4 -5 lines
Diff to previous 1.79 (colored)

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) - annotate - [select for diffs], Tue Oct 30 17:18:44 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.74.4.2: +26 -14 lines
Diff to previous 1.74.4.2 (colored) to branchpoint 1.74 (colored)

sync with head

Revision 1.79 / (download) - annotate - [select for diffs], Sun Jul 15 15:17:56 2012 UTC (11 years, 9 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.78: +3 -9 lines
Diff to previous 1.78 (colored)

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) - annotate - [select for diffs], Sun Jul 8 20:14:11 2012 UTC (11 years, 9 months ago) by dsl
Branch: MAIN
Changes since 1.77: +7 -7 lines
Diff to previous 1.77 (colored)

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) - annotate - [select for diffs], Tue Jun 12 23:23:26 2012 UTC (11 years, 10 months ago) by riz
Branch: netbsd-4
Changes since 1.30.2.3: +22 -2 lines
Diff to previous 1.30.2.3 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored)

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) - annotate - [select for diffs], Tue Jun 12 23:21:42 2012 UTC (11 years, 10 months ago) by riz
Branch: netbsd-4-0
Changes since 1.30.2.1: +22 -2 lines
Diff to previous 1.30.2.1 (colored) next main 1.30.2.2 (colored)

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) - annotate - [select for diffs], Tue Jun 12 23:18:13 2012 UTC (11 years, 10 months ago) by riz
Branch: 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
Changes since 1.55.4.3: +22 -2 lines
Diff to previous 1.55.4.3 (colored) to branchpoint 1.55 (colored) next main 1.56 (colored)

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) - annotate - [select for diffs], Tue Jun 12 23:18:07 2012 UTC (11 years, 10 months ago) by riz
Branch: netbsd-5-1
CVS Tags: netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE
Changes since 1.55.4.3: +22 -2 lines
Diff to previous 1.55.4.3 (colored) next main 1.55.4.4 (colored)

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) - annotate - [select for diffs], Tue Jun 12 23:17:58 2012 UTC (11 years, 10 months ago) by riz
Branch: netbsd-5-0
Changes since 1.55.6.2: +22 -2 lines
Diff to previous 1.55.6.2 (colored) to branchpoint 1.55 (colored) next main 1.56 (colored)

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) - annotate - [select for diffs], Tue Jun 12 23:13:07 2012 UTC (11 years, 10 months ago) by riz
Branch: 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
Changes since 1.74.10.1: +20 -0 lines
Diff to previous 1.74.10.1 (colored) to branchpoint 1.74 (colored) next main 1.75 (colored)

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) - annotate - [select for diffs], Tue Jun 12 22:16:05 2012 UTC (11 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.76: +20 -2 lines
Diff to previous 1.76 (colored)

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) - annotate - [select for diffs], Sat Jun 2 11:08:47 2012 UTC (11 years, 10 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.74.8.1: +5 -6 lines
Diff to previous 1.74.8.1 (colored) to branchpoint 1.74 (colored) next main 1.75 (colored)

sync to latest -current.

Revision 1.74.4.2 / (download) - annotate - [select for diffs], Wed May 23 10:07:39 2012 UTC (11 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.74.4.1: +5 -6 lines
Diff to previous 1.74.4.1 (colored) to branchpoint 1.74 (colored)

sync with head.

Revision 1.74.10.1 / (download) - annotate - [select for diffs], Mon May 21 15:25:56 2012 UTC (11 years, 10 months ago) by riz
Branch: netbsd-6
Changes since 1.74: +5 -6 lines
Diff to previous 1.74 (colored)

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) - annotate - [select for diffs], Mon May 21 14:15:17 2012 UTC (11 years, 10 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.75: +5 -6 lines
Diff to previous 1.75 (colored)

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) - annotate - [select for diffs], Tue Apr 17 00:05:58 2012 UTC (12 years ago) by yamt
Branch: yamt-pagecache
Changes since 1.74: +2 -40 lines
Diff to previous 1.74 (colored)

sync with head

Revision 1.74.8.1 / (download) - annotate - [select for diffs], Fri Feb 24 09:11:26 2012 UTC (12 years, 1 month ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.74: +2 -40 lines
Diff to previous 1.74 (colored)

sync to -current.

Revision 1.75 / (download) - annotate - [select for diffs], Sun Feb 19 21:06:01 2012 UTC (12 years, 1 month ago) by rmind
Branch: 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
Changes since 1.74: +2 -40 lines
Diff to previous 1.74 (colored)

Remove COMPAT_SA / KERN_SA.  Welcome to 6.99.3!
Approved by core@.

Revision 1.68.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:04:47 2011 UTC (12 years, 10 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.68: +17 -10 lines
Diff to previous 1.68 (colored) next main 1.69 (colored)

Sync with HEAD.

Revision 1.55.8.2 / (download) - annotate - [select for diffs], Fri May 20 08:11:19 2011 UTC (12 years, 11 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.55.8.1: +7 -4 lines
Diff to previous 1.55.8.1 (colored) to branchpoint 1.55 (colored) next main 1.56 (colored)

bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).

Revision 1.57.2.4 / (download) - annotate - [select for diffs], Mon Mar 28 23:04:34 2011 UTC (13 years ago) by jym
Branch: jym-xensuspend
Changes since 1.57.2.3: +17 -10 lines
Diff to previous 1.57.2.3 (colored) to branchpoint 1.57 (colored) next main 1.58 (colored)

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) - annotate - [select for diffs], Sat Mar 5 20:49:15 2011 UTC (13 years, 1 month ago) by rmind
Branch: rmind-uvmplock
Changes since 1.61.4.1: +52 -31 lines
Diff to previous 1.61.4.1 (colored) to branchpoint 1.61 (colored) next main 1.62 (colored)

sync with head

Revision 1.68.4.2 / (download) - annotate - [select for diffs], Sat Mar 5 15:09:29 2011 UTC (13 years, 1 month ago) by bouyer
Branch: bouyer-quota2
Changes since 1.68.4.1: +12 -6 lines
Diff to previous 1.68.4.1 (colored) to branchpoint 1.68 (colored) next main 1.69 (colored)

Sync with HEAD

Revision 1.74 / (download) - annotate - [select for diffs], Fri Mar 4 22:25:24 2011 UTC (13 years, 1 month ago) by joerg
Branch: 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
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

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) - annotate - [select for diffs], Thu Feb 24 04:28:44 2011 UTC (13 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.72: +10 -4 lines
Diff to previous 1.72 (colored)

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) - annotate - [select for diffs], Wed Feb 23 03:31:49 2011 UTC (13 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

C&P error

Revision 1.71 / (download) - annotate - [select for diffs], Wed Feb 23 02:58:38 2011 UTC (13 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored)

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) - annotate - [select for diffs], Tue Feb 8 16:19:10 2011 UTC (13 years, 2 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.68: +7 -6 lines
Diff to previous 1.68 (colored)

Sync with HEAD

Revision 1.70 / (download) - annotate - [select for diffs], Mon Feb 7 03:54:45 2011 UTC (13 years, 2 months ago) by chs
Branch: MAIN
CVS Tags: uebayasi-xip-base7, bouyer-quota2-base
Changes since 1.69: +6 -11 lines
Diff to previous 1.69 (colored)

move macros for validating fs/gs to segments.h and use them
in the linux32 code as well.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Jan 26 21:44:31 2011 UTC (13 years, 2 months ago) by njoly
Branch: MAIN
Changes since 1.68: +12 -6 lines
Diff to previous 1.68 (colored)

Do mask the upper 16 bits, when sanity checking fs/gs register values.
Fix my own PR/43842.

Revision 1.57.2.3 / (download) - annotate - [select for diffs], Mon Jan 10 00:37:28 2011 UTC (13 years, 3 months ago) by jym
Branch: jym-xensuspend
Changes since 1.57.2.2: +3 -3 lines
Diff to previous 1.57.2.2 (colored) to branchpoint 1.57 (colored)

Sync with HEAD

Revision 1.68 / (download) - annotate - [select for diffs], Wed Nov 17 18:22:17 2010 UTC (13 years, 5 months ago) by dholland
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored)

Fix build with COMPAT_13.

Revision 1.57.2.2 / (download) - annotate - [select for diffs], Sun Oct 24 22:47:52 2010 UTC (13 years, 5 months ago) by jym
Branch: jym-xensuspend
Changes since 1.57.2.1: +77 -54 lines
Diff to previous 1.57.2.1 (colored) to branchpoint 1.57 (colored)

Sync with HEAD

Revision 1.61.2.3 / (download) - annotate - [select for diffs], Fri Oct 22 07:20:57 2010 UTC (13 years, 5 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.61.2.2: +2 -2 lines
Diff to previous 1.61.2.2 (colored) to branchpoint 1.61 (colored) next main 1.62 (colored)

Sync with HEAD (-D20101022).

Revision 1.50.2.5 / (download) - annotate - [select for diffs], Sat Oct 9 03:31:37 2010 UTC (13 years, 6 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.50.2.4: +4 -4 lines
Diff to previous 1.50.2.4 (colored) to branchpoint 1.50 (colored) next main 1.51 (colored)

sync with head

Revision 1.55.6.2 / (download) - annotate - [select for diffs], Tue Sep 7 19:38:44 2010 UTC (13 years, 7 months ago) by bouyer
Branch: netbsd-5-0
Changes since 1.55.6.1: +4 -4 lines
Diff to previous 1.55.6.1 (colored) to branchpoint 1.55 (colored)

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) - annotate - [select for diffs], Tue Sep 7 19:38:20 2010 UTC (13 years, 7 months ago) by bouyer
Branch: 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
Changes since 1.55.4.2: +4 -4 lines
Diff to previous 1.55.4.2 (colored) to branchpoint 1.55 (colored)

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) - annotate - [select for diffs], Sun Sep 5 20:52:38 2010 UTC (13 years, 7 months ago) by chs
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

accept the LDT selector in check_sigcontext32() too.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Sep 5 20:14:39 2010 UTC (13 years, 7 months ago) by chs
Branch: MAIN
Changes since 1.65: +3 -3 lines
Diff to previous 1.65 (colored)

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) - annotate - [select for diffs], Tue Aug 17 06:43:52 2010 UTC (13 years, 8 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.61.2.1: +54 -40 lines
Diff to previous 1.61.2.1 (colored) to branchpoint 1.61 (colored)

Sync with HEAD.

Revision 1.50.2.4 / (download) - annotate - [select for diffs], Wed Aug 11 22:51:33 2010 UTC (13 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.50.2.3: +62 -46 lines
Diff to previous 1.50.2.3 (colored) to branchpoint 1.50 (colored)

sync with head.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Aug 8 18:13:54 2010 UTC (13 years, 8 months ago) by chs
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Changes since 1.64: +6 -4 lines
Diff to previous 1.64 (colored)

Fix several panics that can be caused by applications using
bad segment register values with setcontext() or sigreturn().

Revision 1.55.6.1 / (download) - annotate - [select for diffs], Fri Jul 16 18:43:58 2010 UTC (13 years, 9 months ago) by riz
Branch: netbsd-5-0
Changes since 1.55: +7 -4 lines
Diff to previous 1.55 (colored)

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) - annotate - [select for diffs], Fri Jul 16 18:40:39 2010 UTC (13 years, 9 months ago) by riz
Branch: netbsd-5
Changes since 1.55.4.1: +7 -4 lines
Diff to previous 1.55.4.1 (colored) to branchpoint 1.55 (colored)

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) - annotate - [select for diffs], Wed Jul 7 01:14:52 2010 UTC (13 years, 9 months ago) by chs
Branch: MAIN
Changes since 1.63: +37 -25 lines
Diff to previous 1.63 (colored)

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) - annotate - [select for diffs], Sun May 30 05:16:36 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.61: +23 -21 lines
Diff to previous 1.61 (colored)

sync with head

Revision 1.63 / (download) - annotate - [select for diffs], Tue May 11 02:34:39 2010 UTC (13 years, 11 months ago) by joerg
Branch: MAIN
Changes since 1.62: +17 -17 lines
Diff to previous 1.62 (colored)

Fix indentation

Revision 1.61.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:39:04 2010 UTC (13 years, 11 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.61: +8 -6 lines
Diff to previous 1.61 (colored)

Sync with HEAD.

Revision 1.62 / (download) - annotate - [select for diffs], Fri Apr 23 19:18:09 2010 UTC (13 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.61: +8 -6 lines
Diff to previous 1.61 (colored)

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) - annotate - [select for diffs], Wed Apr 21 00:33:53 2010 UTC (13 years, 11 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.55: +8 -2 lines
Diff to previous 1.55 (colored)

sync to netbsd-5

Revision 1.50.2.3 / (download) - annotate - [select for diffs], Thu Mar 11 15:01:58 2010 UTC (14 years, 1 month ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.50.2.2: +24 -11 lines
Diff to previous 1.50.2.2 (colored) to branchpoint 1.50 (colored)

sync with head

Revision 1.61 / (download) - annotate - [select for diffs], Thu Dec 10 14:13:49 2009 UTC (14 years, 4 months ago) by matt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

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) - annotate - [select for diffs], Sat Nov 21 03:11:01 2009 UTC (14 years, 4 months ago) by rmind
Branch: MAIN
Changes since 1.59: +17 -10 lines
Diff to previous 1.59 (colored)

Use lwp_getpcb() on x86 MD code, clean from struct user usage.

Revision 1.57.2.1 / (download) - annotate - [select for diffs], Sun Nov 1 13:58:49 2009 UTC (14 years, 5 months ago) by jym
Branch: jym-xensuspend
Changes since 1.57: +9 -2 lines
Diff to previous 1.57 (colored)

Sync with HEAD.

Revision 1.30.2.3 / (download) - annotate - [select for diffs], Sun Oct 18 15:22:38 2009 UTC (14 years, 6 months ago) by bouyer
Branch: netbsd-4
Changes since 1.30.2.2: +8 -2 lines
Diff to previous 1.30.2.2 (colored) to branchpoint 1.30 (colored)

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) - annotate - [select for diffs], Sat Oct 3 23:34:48 2009 UTC (14 years, 6 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1
Changes since 1.55: +8 -2 lines
Diff to previous 1.55 (colored)

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) - annotate - [select for diffs], Fri Sep 25 13:56:32 2009 UTC (14 years, 6 months ago) by mlelstv
Branch: MAIN
Changes since 1.58: +8 -2 lines
Diff to previous 1.58 (colored)

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) - annotate - [select for diffs], Wed Aug 19 18:45:54 2009 UTC (14 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.50.2.1: +3 -2 lines
Diff to previous 1.50.2.1 (colored) to branchpoint 1.50 (colored)

sync with head.

Revision 1.58 / (download) - annotate - [select for diffs], Sun Aug 16 17:12:47 2009 UTC (14 years, 8 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Changes since 1.57: +3 -2 lines
Diff to previous 1.57 (colored)

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) - annotate - [select for diffs], Mon May 4 08:10:32 2009 UTC (14 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.50: +57 -15 lines
Diff to previous 1.50 (colored)

sync with head.

Revision 1.55.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:15:54 2009 UTC (15 years, 2 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.55: +13 -8 lines
Diff to previous 1.55 (colored) next main 1.56 (colored)

Sync with HEAD.

Revision 1.47.6.3 / (download) - annotate - [select for diffs], Sat Jan 17 13:27:49 2009 UTC (15 years, 3 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.47.6.2: +53 -9 lines
Diff to previous 1.47.6.2 (colored) to branchpoint 1.47 (colored) next main 1.48 (colored)

Sync with HEAD.

Revision 1.57 / (download) - annotate - [select for diffs], Thu Dec 18 15:42:33 2008 UTC (15 years, 4 months ago) by cegger
Branch: 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
Changes since 1.56: +11 -8 lines
Diff to previous 1.56 (colored)

malloc -> kmem

Revision 1.51.4.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:12:58 2008 UTC (15 years, 4 months ago) by haad
Branch: haad-dm
Changes since 1.51.4.1: +4 -2 lines
Diff to previous 1.51.4.1 (colored) to branchpoint 1.51 (colored) next main 1.52 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Nov 19 18:35:58 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.55: +4 -2 lines
Diff to previous 1.55 (colored)

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) - annotate - [select for diffs], Tue Nov 18 22:33:28 2008 UTC (15 years, 5 months ago) by bouyer
Branch: netbsd-4
Changes since 1.30.2.1: +4 -3 lines
Diff to previous 1.30.2.1 (colored) to branchpoint 1.30 (colored)

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) - annotate - [select for diffs], Sun Oct 19 22:15:39 2008 UTC (15 years, 6 months ago) by haad
Branch: haad-dm
Changes since 1.51: +46 -7 lines
Diff to previous 1.51 (colored)

Sync with HEAD.

Revision 1.55 / (download) - annotate - [select for diffs], Wed Oct 15 06:51:17 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: 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
Changes since 1.54: +40 -2 lines
Diff to previous 1.54 (colored)

Merge wrstuden-revivesa into HEAD.

Revision 1.54 / (download) - annotate - [select for diffs], Mon Oct 13 12:49:07 2008 UTC (15 years, 6 months ago) by sborrill
Branch: MAIN
Changes since 1.53: +6 -5 lines
Diff to previous 1.53 (colored)

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) - annotate - [select for diffs], Sun Sep 28 21:23:32 2008 UTC (15 years, 6 months ago) by skrll
Branch: wrstuden-revivesa
Changes since 1.50.4.5: +38 -2 lines
Diff to previous 1.50.4.5 (colored) to branchpoint 1.50 (colored) next main 1.51 (colored)

Adapt the SA COMPAT_NETBSD32 stuff to this branch.

Revision 1.47.6.2 / (download) - annotate - [select for diffs], Sun Sep 28 10:39:45 2008 UTC (15 years, 6 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.47.6.1: +2 -2 lines
Diff to previous 1.47.6.1 (colored) to branchpoint 1.47 (colored)

Sync with HEAD.

Revision 1.50.4.5 / (download) - annotate - [select for diffs], Wed Sep 24 16:38:48 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.50.4.4: +4 -4 lines
Diff to previous 1.50.4.4 (colored) to branchpoint 1.50 (colored)

Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Sep 19 01:58:16 2008 UTC (15 years, 7 months ago) by pgoyette
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

Fix apparent (and obvious) typo in previous.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Sep 18 21:28:45 2008 UTC (15 years, 7 months ago) by dsl
Branch: MAIN
Changes since 1.51: +4 -4 lines
Diff to previous 1.51 (colored)

Clear all the correct flags when calling a signal handler.

Revision 1.50.4.4 / (download) - annotate - [select for diffs], Mon Jun 23 04:30:05 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.50.4.3: +2 -4 lines
Diff to previous 1.50.4.3 (colored) to branchpoint 1.50 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.48.2.2 / (download) - annotate - [select for diffs], Wed Jun 4 02:04:40 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.48.2.1: +2 -4 lines
Diff to previous 1.48.2.1 (colored) to branchpoint 1.48 (colored) next main 1.49 (colored)

sync with head

Revision 1.47.6.1 / (download) - annotate - [select for diffs], Mon Jun 2 13:21:48 2008 UTC (15 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.47: +27 -20 lines
Diff to previous 1.47 (colored)

Sync with HEAD.

Revision 1.50.4.3 / (download) - annotate - [select for diffs], Fri May 23 04:30:03 2008 UTC (15 years, 10 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.50.4.2: +4 -2 lines
Diff to previous 1.50.4.2 (colored) to branchpoint 1.50 (colored)

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) - annotate - [select for diffs], Wed May 21 14:10:28 2008 UTC (15 years, 10 months ago) by ad
Branch: 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
Changes since 1.50: +2 -4 lines
Diff to previous 1.50 (colored)

Remove unneeded playing about with kernel_lock.

Revision 1.48.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:31:27 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-pf42
Changes since 1.48: +21 -12 lines
Diff to previous 1.48 (colored)

sync with head.

Revision 1.50.4.2 / (download) - annotate - [select for diffs], Wed May 14 19:54:09 2008 UTC (15 years, 11 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.50.4.1: +16 -16 lines
Diff to previous 1.50.4.1 (colored) to branchpoint 1.50 (colored)

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) - annotate - [select for diffs], Sat May 10 23:48:43 2008 UTC (15 years, 11 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.50: +16 -16 lines
Diff to previous 1.50 (colored)

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) - annotate - [select for diffs], Thu Apr 24 18:39:20 2008 UTC (15 years, 11 months ago) by ad
Branch: 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
Changes since 1.49: +12 -12 lines
Diff to previous 1.49 (colored)

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) - annotate - [select for diffs], Mon Apr 21 19:06:42 2008 UTC (15 years, 11 months ago) by tls
Branch: MAIN
Changes since 1.48: +11 -2 lines
Diff to previous 1.48 (colored)

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) - annotate - [select for diffs], Wed Apr 16 21:51:03 2008 UTC (16 years ago) by cegger
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.47: +8 -8 lines
Diff to previous 1.47 (colored)

use POSIX integer types

Revision 1.43.10.3 / (download) - annotate - [select for diffs], Sun Mar 23 02:03:53 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.43.10.2: +5 -5 lines
Diff to previous 1.43.10.2 (colored) to branchpoint 1.43 (colored) next main 1.44 (colored)

sync with HEAD

Revision 1.44.2.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:04:20 2008 UTC (16 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.44: +5 -5 lines
Diff to previous 1.44 (colored) next main 1.45 (colored)

Sync with HEAD.

Revision 1.17.2.5 / (download) - annotate - [select for diffs], Mon Jan 21 09:35:18 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.17.2.4: +85 -12 lines
Diff to previous 1.17.2.4 (colored) to branchpoint 1.17 (colored) next main 1.18 (colored)

sync with head

Revision 1.44.8.2 / (download) - annotate - [select for diffs], Sat Jan 19 12:14:09 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.44.8.1: +3 -3 lines
Diff to previous 1.44.8.1 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored)

Sync with HEAD

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jan 15 14:50:09 2008 UTC (16 years, 3 months ago) by joerg
Branch: 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
Changes since 1.46: +5 -5 lines
Diff to previous 1.46 (colored)

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) - annotate - [select for diffs], Wed Jan 9 01:44:46 2008 UTC (16 years, 3 months ago) by matt
Branch: matt-armv6
Changes since 1.43.10.1: +82 -9 lines
Diff to previous 1.43.10.1 (colored) to branchpoint 1.43 (colored)

sync with HEAD

Revision 1.44.8.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:47:01 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.44: +82 -9 lines
Diff to previous 1.44 (colored)

Sync with HEAD

Revision 1.44.4.1 / (download) - annotate - [select for diffs], Wed Dec 26 19:41:57 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.44: +82 -9 lines
Diff to previous 1.44 (colored) next main 1.45 (colored)

Sync with head.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Dec 24 17:35:00 2007 UTC (16 years, 3 months ago) by hamajima
Branch: MAIN
CVS Tags: vmlocking2-base3, matt-armv6-base
Changes since 1.45: +75 -2 lines
Diff to previous 1.45 (colored)

Add compat_13_netbsd32_sigreturn() for 32bits programs with COMPAT_13+EXEC_AOUT.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Dec 20 23:02:38 2007 UTC (16 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.44: +9 -9 lines
Diff to previous 1.44 (colored)

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) - annotate - [select for diffs], Tue Nov 6 23:14:08 2007 UTC (16 years, 5 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

sync with HEAD

Revision 1.44 / (download) - annotate - [select for diffs], Wed Oct 17 19:53:01 2007 UTC (16 years, 6 months ago) by garbled
Branch: 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
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

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) - annotate - [select for diffs], Wed Oct 3 19:22:09 2007 UTC (16 years, 6 months ago) by garbled
Branch: ppcoea-renovation
Changes since 1.39.2.2: +3 -3 lines
Diff to previous 1.39.2.2 (colored) next main 1.40 (colored)

Sync with HEAD

Revision 1.17.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:22:32 2007 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.17.2.3: +17 -24 lines
Diff to previous 1.17.2.3 (colored) to branchpoint 1.17 (colored)

sync with head.

Revision 1.37.2.4 / (download) - annotate - [select for diffs], Sun Jul 15 13:15:22 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.37.2.3: +3 -3 lines
Diff to previous 1.37.2.3 (colored) next main 1.38 (colored)

Sync with head.

Revision 1.37.4.1 / (download) - annotate - [select for diffs], Wed Jul 11 19:57:34 2007 UTC (16 years, 9 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.37: +14 -19 lines
Diff to previous 1.37 (colored) next main 1.38 (colored)

Sync with head.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jul 8 10:19:21 2007 UTC (16 years, 9 months ago) by pooka
Branch: 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
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

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) - annotate - [select for diffs], Tue Jun 26 18:11:58 2007 UTC (16 years, 9 months ago) by garbled
Branch: ppcoea-renovation
Changes since 1.39.2.1: +4 -7 lines
Diff to previous 1.39.2.1 (colored)

Sync with HEAD.

Revision 1.37.2.3 / (download) - annotate - [select for diffs], Sat Jun 9 23:54:51 2007 UTC (16 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.37.2.2: +4 -7 lines
Diff to previous 1.37.2.2 (colored)

Sync with head.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jun 4 23:15:01 2007 UTC (16 years, 10 months ago) by xtraeme
Branch: MAIN
Changes since 1.41: +4 -7 lines
Diff to previous 1.41 (colored)

Ansify, de-__P(), unregister.

Revision 1.37.2.2 / (download) - annotate - [select for diffs], Sun May 27 12:26:58 2007 UTC (16 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.37.2.1: +6 -6 lines
Diff to previous 1.37.2.1 (colored)

Sync with head.

Revision 1.39.2.1 / (download) - annotate - [select for diffs], Tue May 22 17:26:32 2007 UTC (16 years, 10 months ago) by matt
Branch: ppcoea-renovation
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Update to HEAD.

Revision 1.41 / (download) - annotate - [select for diffs], Mon May 21 08:10:38 2007 UTC (16 years, 11 months ago) by fvdl
Branch: MAIN
Changes since 1.40: +18 -16 lines
Diff to previous 1.40 (colored)

Revert fs/gs changes until I figure out issues with them.

Revision 1.32.2.5 / (download) - annotate - [select for diffs], Thu May 17 13:40:49 2007 UTC (16 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.32.2.4: +16 -18 lines
Diff to previous 1.32.2.4 (colored) to branchpoint 1.32 (colored) next main 1.33 (colored)

sync with head.

Revision 1.40 / (download) - annotate - [select for diffs], Fri May 11 14:01:46 2007 UTC (16 years, 11 months ago) by fvdl
Branch: MAIN
CVS Tags: yamt-idlelwp-base8
Changes since 1.39: +16 -18 lines
Diff to previous 1.39 (colored)

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) - annotate - [select for diffs], Mon May 7 10:54:51 2007 UTC (16 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.32.2.3: +6 -6 lines
Diff to previous 1.32.2.3 (colored) to branchpoint 1.32 (colored)

sync with head.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Apr 16 19:12:17 2007 UTC (17 years ago) by ad
Branch: MAIN
Branch point for: ppcoea-renovation
Changes since 1.38: +6 -6 lines
Diff to previous 1.38 (colored)

Share the sysarch stuff between the x86 ports. PR kern/36046.

Revision 1.37.2.1 / (download) - annotate - [select for diffs], Tue Apr 10 13:22:50 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.37: +7 -9 lines
Diff to previous 1.37 (colored)

Sync with head.

Revision 1.32.2.3 / (download) - annotate - [select for diffs], Sat Mar 24 14:54:32 2007 UTC (17 years ago) by yamt
Branch: yamt-idlelwp
Changes since 1.32.2.2: +7 -9 lines
Diff to previous 1.32.2.2 (colored) to branchpoint 1.32 (colored)

sync with head.

Revision 1.37.6.1 / (download) - annotate - [select for diffs], Sun Mar 18 00:06:31 2007 UTC (17 years, 1 month ago) by reinoud
Branch: reinoud-bufcleanup
Changes since 1.37: +7 -9 lines
Diff to previous 1.37 (colored) next main 1.38 (colored)

First attempt to bring branch in sync with HEAD

Revision 1.38 / (download) - annotate - [select for diffs], Fri Mar 16 22:23:30 2007 UTC (17 years, 1 month ago) by dsl
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic
Changes since 1.37: +7 -9 lines
Diff to previous 1.37 (colored)

Use NETBSD32PTR64() and NETBSD32PTR32() throughout.

Revision 1.32.2.2 / (download) - annotate - [select for diffs], Mon Mar 12 05:46:17 2007 UTC (17 years, 1 month ago) by rmind
Branch: yamt-idlelwp
Changes since 1.32.2.1: +6 -8 lines
Diff to previous 1.32.2.1 (colored) to branchpoint 1.32 (colored)

Sync with HEAD.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Mar 4 14:36:12 2007 UTC (17 years, 1 month ago) by yamt
Branch: MAIN
Branch point for: vmlocking, reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.36: +4 -6 lines
Diff to previous 1.36 (colored)

fix fallout from caddr_t changes.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Mar 4 05:59:12 2007 UTC (17 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.35: +6 -6 lines
Diff to previous 1.35 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.32.2.1 / (download) - annotate - [select for diffs], Tue Feb 27 16:48:43 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.32: +34 -7 lines
Diff to previous 1.32 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.17.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:05:40 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.17.2.2: +57 -60 lines
Diff to previous 1.17.2.2 (colored) to branchpoint 1.17 (colored)

sync with head.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Feb 19 15:10:04 2007 UTC (17 years, 2 months ago) by cube
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.34: +17 -2 lines
Diff to previous 1.34 (colored)

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) - annotate - [select for diffs], Sun Feb 18 20:22:25 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.33: +18 -6 lines
Diff to previous 1.33 (colored)

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) - annotate - [select for diffs], Sat Feb 17 22:31:37 2007 UTC (17 years, 2 months ago) by pavel
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

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) - annotate - [select for diffs], Fri Feb 9 21:55:01 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Branch point for: yamt-idlelwp
Changes since 1.31: +25 -55 lines
Diff to previous 1.31 (colored)

Merge newlock2 to head.

Revision 1.25.2.6 / (download) - annotate - [select for diffs], Tue Jan 30 13:49:33 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.25.2.5: +16 -52 lines
Diff to previous 1.25.2.5 (colored) to branchpoint 1.25 (colored) next main 1.26 (colored)

Remove support for SA. Ok core@.

Revision 1.25.2.5 / (download) - annotate - [select for diffs], Fri Jan 12 01:00:40 2007 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.25.2.4: +11 -12 lines
Diff to previous 1.25.2.4 (colored) to branchpoint 1.25 (colored)

Sync with head.

Revision 1.25.2.4 / (download) - annotate - [select for diffs], Thu Jan 11 22:22:56 2007 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.25.2.3: +10 -3 lines
Diff to previous 1.25.2.3 (colored) to branchpoint 1.25 (colored)

Checkpoint work in progress.

Revision 1.30.2.1 / (download) - annotate - [select for diffs], Sat Jan 6 13:18:16 2007 UTC (17 years, 3 months ago) by bouyer
Branch: 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
Changes since 1.30: +10 -11 lines
Diff to previous 1.30 (colored)

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) - annotate - [select for diffs], Sat Dec 30 20:45:22 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.17.2.1: +17 -14 lines
Diff to previous 1.17.2.1 (colored) to branchpoint 1.17 (colored)

sync with head.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Dec 26 10:43:44 2006 UTC (17 years, 3 months ago) by elad
Branch: MAIN
CVS Tags: newlock2-nbase, newlock2-base
Changes since 1.30: +10 -11 lines
Diff to previous 1.30 (colored)

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) - annotate - [select for diffs], Sun Dec 10 07:15:46 2006 UTC (17 years, 4 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.26.2.1: +4 -4 lines
Diff to previous 1.26.2.1 (colored) to branchpoint 1.26 (colored) next main 1.27 (colored)

sync with head.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 21 15:02:18 2006 UTC (17 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

adjust limits takes struct proc again.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Nov 21 14:32:27 2006 UTC (17 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored)

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) - annotate - [select for diffs], Sat Nov 18 21:29:03 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.25.2.2: +8 -7 lines
Diff to previous 1.25.2.2 (colored) to branchpoint 1.25 (colored)

Sync with head.

Revision 1.25.2.2 / (download) - annotate - [select for diffs], Fri Nov 17 16:34:32 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.25.2.1: +16 -17 lines
Diff to previous 1.25.2.1 (colored) to branchpoint 1.25 (colored)

Checkpoint work in progress.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Oct 23 12:11:47 2006 UTC (17 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

apply const where necessary

Revision 1.26.2.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:04:31 2006 UTC (17 years, 5 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored)

sync with head

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Fri Oct 20 19:32:18 2006 UTC (17 years, 6 months ago) by ad
Branch: newlock2
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

The signal mask/stack will be per-LWP shortly.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Sep 19 22:03:10 2006 UTC (17 years, 7 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored)

Lose (void *) casts on the machdep scope authorization wrapper. Update
documentation.

Revision 1.20.6.6 / (download) - annotate - [select for diffs], Thu Sep 14 12:31:07 2006 UTC (17 years, 7 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.20.6.5: +7 -6 lines
Diff to previous 1.20.6.5 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

sync with head.

Revision 1.20.2.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:37:05 2006 UTC (17 years, 7 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.20: +126 -25 lines
Diff to previous 1.20 (colored) next main 1.21 (colored)

sync with head

Revision 1.26 / (download) - annotate - [select for diffs], Fri Sep 8 20:58:57 2006 UTC (17 years, 7 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9
Branch point for: yamt-splraiseipl
Changes since 1.25: +7 -6 lines
Diff to previous 1.25 (colored)

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) - annotate - [select for diffs], Sun Sep 3 15:22:41 2006 UTC (17 years, 7 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.20.6.4: +5 -2 lines
Diff to previous 1.20.6.4 (colored) to branchpoint 1.20 (colored)

sync with head.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Aug 30 14:01:57 2006 UTC (17 years, 7 months ago) by cube
Branch: MAIN
CVS Tags: yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: newlock2
Changes since 1.24: +5 -2 lines
Diff to previous 1.24 (colored)

Let this compile under "no options COREDUMP".

Revision 1.20.6.4 / (download) - annotate - [select for diffs], Fri Aug 11 15:41:00 2006 UTC (17 years, 8 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.20.6.3: +8 -8 lines
Diff to previous 1.20.6.3 (colored) to branchpoint 1.20 (colored)

sync with head

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:04 2006 UTC (17 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.23: +8 -8 lines
Diff to previous 1.23 (colored)

Use the LWP cached credentials where sane.

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 14:48:19 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.17: +121 -23 lines
Diff to previous 1.17 (colored)

sync with head.

Revision 1.20.4.2 / (download) - annotate - [select for diffs], Thu Jun 1 22:34:10 2006 UTC (17 years, 10 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.20.4.1: +5 -4 lines
Diff to previous 1.20.4.1 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

Sync with head.

Revision 1.21.2.2 / (download) - annotate - [select for diffs], Wed May 24 15:47:50 2006 UTC (17 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.21.2.1: +3 -2 lines
Diff to previous 1.21.2.1 (colored) to branchpoint 1.21 (colored) next main 1.22 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.20.6.3 / (download) - annotate - [select for diffs], Wed May 24 10:56:33 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.20.6.2: +5 -4 lines
Diff to previous 1.20.6.2 (colored) to branchpoint 1.20 (colored)

sync with head.

Revision 1.23 / (download) - annotate - [select for diffs], Sun May 14 21:55:09 2006 UTC (17 years, 11 months ago) by elad
Branch: 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
Changes since 1.22: +5 -4 lines
Diff to previous 1.22 (colored)

integrate kauth.

Revision 1.20.8.4 / (download) - annotate - [select for diffs], Fri May 12 14:50:52 2006 UTC (17 years, 11 months ago) by elad
Branch: elad-kernelauth
Changes since 1.20.8.3: +3 -2 lines
Diff to previous 1.20.8.3 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

include sys/kauth.h where appropriate.

Revision 1.20.4.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:37:11 2006 UTC (17 years, 11 months ago) by simonb
Branch: simonb-timecounters
Changes since 1.20: +116 -19 lines
Diff to previous 1.20 (colored)

Sync with head.

Revision 1.20.8.3 / (download) - annotate - [select for diffs], Wed Apr 19 02:31:58 2006 UTC (18 years ago) by elad
Branch: elad-kernelauth
Changes since 1.20.8.2: +116 -19 lines
Diff to previous 1.20.8.2 (colored) to branchpoint 1.20 (colored)

sync with head - hopefully this will work

Revision 1.20.6.2 / (download) - annotate - [select for diffs], Sat Apr 1 12:06:07 2006 UTC (18 years ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.20.6.1: +38 -2 lines
Diff to previous 1.20.6.1 (colored) to branchpoint 1.20 (colored)

sync with head.

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Fri Mar 31 09:44:55 2006 UTC (18 years ago) by tron
Branch: peter-altq
Changes since 1.21: +38 -2 lines
Diff to previous 1.21 (colored)

Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Mar 29 23:07:50 2006 UTC (18 years ago) by cube
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, elad-kernelauth-base
Changes since 1.21: +38 -2 lines
Diff to previous 1.21 (colored)

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) - annotate - [select for diffs], Mon Mar 13 09:06:51 2006 UTC (18 years, 1 month ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.20: +80 -19 lines
Diff to previous 1.20 (colored)

sync with head.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Mar 12 20:25:25 2006 UTC (18 years, 1 month ago) by cube
Branch: MAIN
CVS Tags: yamt-pdpolicy-base2, peter-altq-base
Branch point for: peter-altq
Changes since 1.20: +80 -19 lines
Diff to previous 1.20 (colored)

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) - annotate - [select for diffs], Fri Mar 10 14:53:59 2006 UTC (18 years, 1 month ago) by elad
Branch: elad-kernelauth
Changes since 1.20.8.1: +4 -4 lines
Diff to previous 1.20.8.1 (colored) to branchpoint 1.20 (colored)

generic_authorize() -> kauth_authorize_generic().

Revision 1.20.8.1 / (download) - annotate - [select for diffs], Wed Mar 8 00:43:05 2006 UTC (18 years, 1 month ago) by elad
Branch: elad-kernelauth
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored)

Adapt to kernel authorization KPI.

I expect *some* lossage here...

Revision 1.18.2.1 / (download) - annotate - [select for diffs], Sun Jan 15 10:02:36 2006 UTC (18 years, 3 months ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored) next main 1.19 (colored)

sync with head.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jan 14 17:14:46 2006 UTC (18 years, 3 months ago) by hamajima
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, elad-kernelauth
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

fix compile error for ktrace-lwp.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 11 09:30:45 2006 UTC (18 years, 3 months ago) by cube
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

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) - annotate - [select for diffs], Sun Dec 11 12:16:21 2005 UTC (18 years, 4 months ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

merge ktrace-lwp.

Revision 1.2.2.5 / (download) - annotate - [select for diffs], Thu Nov 10 13:50:24 2005 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.2.2.4: +18 -21 lines
Diff to previous 1.2.2.4 (colored) next main 1.3 (colored)

Sync with HEAD. Here we go again...

Revision 1.11.10.1 / (download) - annotate - [select for diffs], Sun Sep 18 20:09:49 2005 UTC (18 years, 7 months ago) by tron
Branch: 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
Changes since 1.11: +10 -2 lines
Diff to previous 1.11 (colored) next main 1.12 (colored)

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) - annotate - [select for diffs], Sun Jul 3 17:18:02 2005 UTC (18 years, 9 months ago) by cube
Branch: 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
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored)

Constify machine32 and machine_arch32.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 3 16:53:46 2005 UTC (18 years, 9 months ago) by cube
Branch: MAIN
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

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) - annotate - [select for diffs], Fri Jun 10 05:10:12 2005 UTC (18 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.14: +15 -19 lines
Diff to previous 1.14 (colored)

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) - annotate - [select for diffs], Thu Jun 2 10:29:04 2005 UTC (18 years, 10 months ago) by drochner
Branch: MAIN
Changes since 1.13: +3 -4 lines
Diff to previous 1.13 (colored)

remove __UNCONST which is not needed anymore

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jun 1 13:04:32 2005 UTC (18 years, 10 months ago) by blymn
Branch: MAIN
Changes since 1.12: +4 -3 lines
Diff to previous 1.12 (colored)

Cast away const for siginfo structure as the function prototype does not
have const.

Revision 1.11.4.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:28:00 2005 UTC (18 years, 11 months ago) by kent
Branch: kent-audio2
Changes since 1.11: +10 -2 lines
Diff to previous 1.11 (colored) next main 1.12 (colored)

sync with -current

Revision 1.2.2.4 / (download) - annotate - [select for diffs], Fri Apr 1 14:26:50 2005 UTC (19 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.2.2.3: +10 -2 lines
Diff to previous 1.2.2.3 (colored)

Sync with HEAD.

Revision 1.11.6.1 / (download) - annotate - [select for diffs], Sat Mar 26 18:19:16 2005 UTC (19 years ago) by yamt
Branch: yamt-km
Changes since 1.11: +10 -2 lines
Diff to previous 1.11 (colored) next main 1.12 (colored)

sync with head.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Mar 26 05:12:34 2005 UTC (19 years ago) by fvdl
Branch: MAIN
CVS Tags: yamt-km-base4, kent-audio2-base
Changes since 1.11: +10 -2 lines
Diff to previous 1.11 (colored)

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) - annotate - [select for diffs], Tue Sep 21 13:12:07 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.2.2.2: +2 -2 lines
Diff to previous 1.2.2.2 (colored)

Fix the sync with head I botched.

Revision 1.2.2.2 / (download) - annotate - [select for diffs], Sat Sep 18 14:31:13 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.2.2.1: +4 -5 lines
Diff to previous 1.2.2.1 (colored)

Sync with HEAD.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 17 14:11:21 2004 UTC (19 years, 7 months ago) by skrll
Branch: 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
Changes since 1.10: +4 -5 lines
Diff to previous 1.10 (colored)

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) - annotate - [select for diffs], Tue Aug 3 10:31:30 2004 UTC (19 years, 8 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.2: +366 -23 lines
Diff to previous 1.2 (colored)

Sync with HEAD

Revision 1.10 / (download) - annotate - [select for diffs], Thu Mar 25 15:32:27 2004 UTC (20 years ago) by drochner
Branch: 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
Changes since 1.9: +15 -2 lines
Diff to previous 1.9 (colored)

remove sigcontext-style signal delivery code

Revision 1.9 / (download) - annotate - [select for diffs], Fri Feb 20 18:11:16 2004 UTC (20 years, 2 months ago) by drochner
Branch: MAIN
Changes since 1.8: +16 -2 lines
Diff to previous 1.8 (colored)

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) - annotate - [select for diffs], Wed Feb 11 01:01:37 2004 UTC (20 years, 2 months ago) by matt
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

32-bit corefiles should use a MID for i386, not xf86_64.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Oct 21 01:45:25 2003 UTC (20 years, 6 months ago) by fvdl
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

Fix int vs. NULL comparison.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Oct 13 18:47:10 2003 UTC (20 years, 6 months ago) by fvdl
Branch: MAIN
Changes since 1.5: +335 -23 lines
Diff to previous 1.5 (colored)

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) - annotate - [select for diffs], Fri Sep 26 21:28:45 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.4: +3 -2 lines
Diff to previous 1.4 (colored)

Add needed header file.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Sep 26 18:04:11 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

catch up with const sigset_t *

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jul 14 23:32:31 2003 UTC (20 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.2: +4 -1 lines
Diff to previous 1.2 (colored)

__KERNEL_RCSID()

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jun 23 11:01:03 2003 UTC (20 years, 9 months ago) by martin
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Make sure to include opt_foo.h if a defflag option FOO is used.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Apr 26 18:39:30 2003 UTC (20 years, 11 months ago) by fvdl
Branch: 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.

This form allows you to request diff's 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.




CVSweb <webmaster@jp.NetBSD.org>