History log of /openbsd-current/sys/arch/i386/i386/db_memrw.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.19 23-Feb-2024 cheloha

ddb(4): db_read_bytes/db_write_bytes: change dst/src parameter to void*

Almost all db_read_bytes() callers cast the destination buffer
argument to char*, which suggests the API's prototype is incompatible
with how the API is actually used.

Change db_read_bytes() and db_write_bytes() to take a void* as the
destination/source buffer parameter so callers don't need to cast the
argument.

With input from bluhm@. Bugs caught by Clemens Gossnitzer (ASCII
approximation of name).

Thread: https://marc.info/?l=openbsd-tech&m=170740813021636&w=2

ok bluhm@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE
# 1.18 23-Sep-2020 deraadt

shuffle "extern int cpu_pae" into cpu.h, as the number of users will soon
increase.
ok kettenis


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.17 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.16 18-Dec-2015 gerhard

Prevent uvm_fault() when hitting a breakpoint by restoring the original
page protection bits.

Go ahead, mlarkin@


Revision tags: OPENBSD_5_8_BASE
# 1.15 12-Apr-2015 mlarkin

Bring PAE code back to life, in a different form. This diff (via bluhm then
to deraadt, then myself) brings the PAE pmap on i386 (not touched in any
significant way for years) closer to the current non-PAE pmap and allows
us to take a big next step toward better i386 W^X in the kernel (similar to
what we did a few months ago on amd64). Unlike the original PAE pmap, this
diff will not be supporting > 4GB physical memory on i386 - this effort is
specifically geared toward providing W^X (via NX) only.

There still seems to be a bug removing certain pmap entries when PAE is
enabled, so I'm leaving PAE mode disabled for the moment until we can
figure out what is going on, but with this diff in the tree hopefully
others can help.

The pmap functions now operate through function pointers, due to the need
to support both non-PAE and PAE forms. My unscientific testing showed
less than 0.3% (a third of a percent) slowdown with this approach during
a base build.

Discussed for months with guenther, kettenis, and deraadt.

ok kettenis@, deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.14 14-Sep-2014 jsg

remove uneeded proc.h includes
ok mpi@ kspillner@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.13 23-Apr-2011 deraadt

Don't leave the kernel code/rodata writeable for DDB. Make ddb enable
writes in the pte momentarily. Modified the code stolen from amd64.
ok miod


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 20-Feb-2007 tom

Revert PAE pmap for now, until the strange bug is found. This stops
the freezes many of us are seeing (especially on amd64 machines running
OpenBSD/i386).

Much testing by nick@ (as always - thanks!), hugh@, ian@, kettenis@
and Sam Smith (s (at) msmith (dot) net).

Requested by, input from, and ok deraadt@ ok art@, kettenis@, miod@


Revision tags: OPENBSD_4_0_BASE
# 1.11 11-May-2006 mickey

kill trainling spaces


# 1.10 10-May-2006 mickey

in db_write_bytes correctly restore pte prot after write; this is not a big deal as kernel .text is not writable anyway; found by aaron


# 1.9 27-Apr-2006 mickey

implement separate PAE pmap that allows access to 64g of physmem
if supported by the cpu(s). currently not enabled by default and
not compiled into ramdisks. this grows paddr_t to 64bit but yet
leaves bus_addr_t at 32bits. measures are taken to favour dmaable
memory allocation from below 4g line such that buffer cache is
already allocated form below, pool backend allocator prefers lower
memory and then finally bounce buffers are used as last resort.
PAE is engaged only if global variable cpu_pae is manually set
to non-zero and there is physical memory present above 4g.
simplify pcibios address math to use u_long as we always will
be in the 32bit space.


Revision tags: OPENBSD_3_9_BASE
# 1.8 22-Nov-2005 mickey

do not manually inline kvtopte() macro; no func change


# 1.7 13-Nov-2005 martin

convert more MD macros to their MI counterparts, this time
i386_round_page(), i386_trunc_page(), i386_btop() and i386_ptob()


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A
# 1.6 16-Jan-2003 art

Getting rid of vm_offset_t


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE UBC_BASE UBC_SYNC_B
# 1.5 28-Nov-2001 art

branches: 1.5.2;
Don't use pmap_update when we mean tlbflush. make pmap_update into a noop.


# 1.4 06-Nov-2001 miod

Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.3 05-May-2001 art

PMAP_NEW and UVM are no longer optional on i386.


Revision tags: OPENBSD_2_9_BASE
# 1.2 22-Mar-2001 niklas

branches: 1.2.2;
Merge in NetBSD's PMAP_NEW, still disabled


Revision tags: OPENBSD_2_8_BASE
# 1.1 05-Jul-2000 hugh

Decouple memory access functions from db_interface.c so they can be
shared with upcoming KGDB. As per NetBSD.
Ok'd by niklas.


# 1.18 23-Sep-2020 deraadt

shuffle "extern int cpu_pae" into cpu.h, as the number of users will soon
increase.
ok kettenis


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.17 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.16 18-Dec-2015 gerhard

Prevent uvm_fault() when hitting a breakpoint by restoring the original
page protection bits.

Go ahead, mlarkin@


Revision tags: OPENBSD_5_8_BASE
# 1.15 12-Apr-2015 mlarkin

Bring PAE code back to life, in a different form. This diff (via bluhm then
to deraadt, then myself) brings the PAE pmap on i386 (not touched in any
significant way for years) closer to the current non-PAE pmap and allows
us to take a big next step toward better i386 W^X in the kernel (similar to
what we did a few months ago on amd64). Unlike the original PAE pmap, this
diff will not be supporting > 4GB physical memory on i386 - this effort is
specifically geared toward providing W^X (via NX) only.

There still seems to be a bug removing certain pmap entries when PAE is
enabled, so I'm leaving PAE mode disabled for the moment until we can
figure out what is going on, but with this diff in the tree hopefully
others can help.

The pmap functions now operate through function pointers, due to the need
to support both non-PAE and PAE forms. My unscientific testing showed
less than 0.3% (a third of a percent) slowdown with this approach during
a base build.

Discussed for months with guenther, kettenis, and deraadt.

ok kettenis@, deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.14 14-Sep-2014 jsg

remove uneeded proc.h includes
ok mpi@ kspillner@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.13 23-Apr-2011 deraadt

Don't leave the kernel code/rodata writeable for DDB. Make ddb enable
writes in the pte momentarily. Modified the code stolen from amd64.
ok miod


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 20-Feb-2007 tom

Revert PAE pmap for now, until the strange bug is found. This stops
the freezes many of us are seeing (especially on amd64 machines running
OpenBSD/i386).

Much testing by nick@ (as always - thanks!), hugh@, ian@, kettenis@
and Sam Smith (s (at) msmith (dot) net).

Requested by, input from, and ok deraadt@ ok art@, kettenis@, miod@


Revision tags: OPENBSD_4_0_BASE
# 1.11 11-May-2006 mickey

kill trainling spaces


# 1.10 10-May-2006 mickey

in db_write_bytes correctly restore pte prot after write; this is not a big deal as kernel .text is not writable anyway; found by aaron


# 1.9 27-Apr-2006 mickey

implement separate PAE pmap that allows access to 64g of physmem
if supported by the cpu(s). currently not enabled by default and
not compiled into ramdisks. this grows paddr_t to 64bit but yet
leaves bus_addr_t at 32bits. measures are taken to favour dmaable
memory allocation from below 4g line such that buffer cache is
already allocated form below, pool backend allocator prefers lower
memory and then finally bounce buffers are used as last resort.
PAE is engaged only if global variable cpu_pae is manually set
to non-zero and there is physical memory present above 4g.
simplify pcibios address math to use u_long as we always will
be in the 32bit space.


Revision tags: OPENBSD_3_9_BASE
# 1.8 22-Nov-2005 mickey

do not manually inline kvtopte() macro; no func change


# 1.7 13-Nov-2005 martin

convert more MD macros to their MI counterparts, this time
i386_round_page(), i386_trunc_page(), i386_btop() and i386_ptob()


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A
# 1.6 16-Jan-2003 art

Getting rid of vm_offset_t


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE UBC_BASE UBC_SYNC_B
# 1.5 28-Nov-2001 art

branches: 1.5.2;
Don't use pmap_update when we mean tlbflush. make pmap_update into a noop.


# 1.4 06-Nov-2001 miod

Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.3 05-May-2001 art

PMAP_NEW and UVM are no longer optional on i386.


Revision tags: OPENBSD_2_9_BASE
# 1.2 22-Mar-2001 niklas

branches: 1.2.2;
Merge in NetBSD's PMAP_NEW, still disabled


Revision tags: OPENBSD_2_8_BASE
# 1.1 05-Jul-2000 hugh

Decouple memory access functions from db_interface.c so they can be
shared with upcoming KGDB. As per NetBSD.
Ok'd by niklas.


Revision tags: OPENBSD_6_2_BASE
# 1.17 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.16 18-Dec-2015 gerhard

Prevent uvm_fault() when hitting a breakpoint by restoring the original
page protection bits.

Go ahead, mlarkin@


Revision tags: OPENBSD_5_8_BASE
# 1.15 12-Apr-2015 mlarkin

Bring PAE code back to life, in a different form. This diff (via bluhm then
to deraadt, then myself) brings the PAE pmap on i386 (not touched in any
significant way for years) closer to the current non-PAE pmap and allows
us to take a big next step toward better i386 W^X in the kernel (similar to
what we did a few months ago on amd64). Unlike the original PAE pmap, this
diff will not be supporting > 4GB physical memory on i386 - this effort is
specifically geared toward providing W^X (via NX) only.

There still seems to be a bug removing certain pmap entries when PAE is
enabled, so I'm leaving PAE mode disabled for the moment until we can
figure out what is going on, but with this diff in the tree hopefully
others can help.

The pmap functions now operate through function pointers, due to the need
to support both non-PAE and PAE forms. My unscientific testing showed
less than 0.3% (a third of a percent) slowdown with this approach during
a base build.

Discussed for months with guenther, kettenis, and deraadt.

ok kettenis@, deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.14 14-Sep-2014 jsg

remove uneeded proc.h includes
ok mpi@ kspillner@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.13 23-Apr-2011 deraadt

Don't leave the kernel code/rodata writeable for DDB. Make ddb enable
writes in the pte momentarily. Modified the code stolen from amd64.
ok miod


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 20-Feb-2007 tom

Revert PAE pmap for now, until the strange bug is found. This stops
the freezes many of us are seeing (especially on amd64 machines running
OpenBSD/i386).

Much testing by nick@ (as always - thanks!), hugh@, ian@, kettenis@
and Sam Smith (s (at) msmith (dot) net).

Requested by, input from, and ok deraadt@ ok art@, kettenis@, miod@


Revision tags: OPENBSD_4_0_BASE
# 1.11 11-May-2006 mickey

kill trainling spaces


# 1.10 10-May-2006 mickey

in db_write_bytes correctly restore pte prot after write; this is not a big deal as kernel .text is not writable anyway; found by aaron


# 1.9 27-Apr-2006 mickey

implement separate PAE pmap that allows access to 64g of physmem
if supported by the cpu(s). currently not enabled by default and
not compiled into ramdisks. this grows paddr_t to 64bit but yet
leaves bus_addr_t at 32bits. measures are taken to favour dmaable
memory allocation from below 4g line such that buffer cache is
already allocated form below, pool backend allocator prefers lower
memory and then finally bounce buffers are used as last resort.
PAE is engaged only if global variable cpu_pae is manually set
to non-zero and there is physical memory present above 4g.
simplify pcibios address math to use u_long as we always will
be in the 32bit space.


Revision tags: OPENBSD_3_9_BASE
# 1.8 22-Nov-2005 mickey

do not manually inline kvtopte() macro; no func change


# 1.7 13-Nov-2005 martin

convert more MD macros to their MI counterparts, this time
i386_round_page(), i386_trunc_page(), i386_btop() and i386_ptob()


Revision tags: OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A
# 1.6 16-Jan-2003 art

Getting rid of vm_offset_t


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE UBC_BASE UBC_SYNC_B
# 1.5 28-Nov-2001 art

branches: 1.5.2;
Don't use pmap_update when we mean tlbflush. make pmap_update into a noop.


# 1.4 06-Nov-2001 miod

Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)


Revision tags: OPENBSD_3_0_BASE
# 1.3 05-May-2001 art

PMAP_NEW and UVM are no longer optional on i386.


Revision tags: OPENBSD_2_9_BASE
# 1.2 22-Mar-2001 niklas

branches: 1.2.2;
Merge in NetBSD's PMAP_NEW, still disabled


Revision tags: OPENBSD_2_8_BASE
# 1.1 05-Jul-2000 hugh

Decouple memory access functions from db_interface.c so they can be
shared with upcoming KGDB. As per NetBSD.
Ok'd by niklas.