The NetBSD Project

CVS log for src/sys/arch/x86/x86/bus_dma.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.89.4.2: download - view: text, markup, annotated - select for diffs
Fri Oct 4 11:40:52 2024 UTC (2 months ago) by martin
Branches: netbsd-10
Diff to: previous 1.89.4.1: preferred, colored; branchpoint 1.89: preferred, colored; next MAIN 1.90: preferred, colored
Changes since revision 1.89.4.1: +8 -3 lines
Pull up following revision(s) (requested by rin in ticket #928):

	sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.25
	sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c: revision 1.7
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/priv.h: revision 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_acpi.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.h: revision 1.6
	sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.49
	sys/external/bsd/drm2/include/linux/mxm-wmi.h: revision 1.1
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_pcie.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c: revision 1.13
	sys/external/bsd/common/include/linux/bitops.h: revision 1.17
	sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.40
	sys/external/bsd/drm2/linux/linux_pci.c: revision 1.30
	sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.h: revision 1.5
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_pcie.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mxm/nouveau_nvkm_subdev_mxm_base.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c: revision 1.12
	sys/external/bsd/drm2/dist/drm/radeon/radeon_rv770.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_sorgm200.c: revision 1.3
	sys/external/bsd/common/include/linux/printk.h: revision 1.14
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c: revision 1.10
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vi.c: revision 1.4
	sys/external/bsd/drm2/include/linux/acpi.h: revision 1.11
	sys/external/bsd/drm2/drm/drm_cdevsw.c: revision 1.31
	sys/external/bsd/drm2/dist/drm/radeon/radeon_si.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/display/intel_acpi.h: revision 1.5
	sys/external/bsd/drm2/include/acpi/video.h: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.h: revision 1.4
	sys/arch/sparc64/include/pci_machdep.h: revision 1.31
	sys/arch/sparc64/dev/pci_machdep.c: revision 1.83
	sys/external/bsd/drm2/include/linux/kref.h: revision 1.14
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c: revision 1.12
	sys/external/bsd/drm2/linux/linux_dma_buf.c: revision 1.17
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_shadowacpi.c: revision 1.4
	sys/external/bsd/drm2/drm/drm_module.c: revision 1.32
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.h: revision 1.8
	sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c: revision 1.7
	sys/external/bsd/drm2/include/linux/smp.h: revision 1.5
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_si.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.20
	sys/arch/x86/x86/bus_dma.c: revision 1.91
	sys/external/bsd/drm2/radeon/files.radeon: revision 1.40
	sys/external/bsd/drm2/include/acpi/acpi_bus.h: revision 1.1
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h: revision 1.5
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.21
	sys/external/bsd/common/include/asm/barrier.h: revision 1.20
	sys/external/bsd/drm2/include/linux/nbsd-namespace-acpi.h: revision 1.2
	sys/external/bsd/common/include/asm/barrier.h: revision 1.21
	sys/modules/drmkms/drmkms_pci.h: revision 1.1
	sys/external/bsd/drm2/dist/drm/drm_dp_helper.c: revision 1.17
	sys/external/bsd/drm2/radeon/radeon_pci.c: revision 1.23
	sys/external/bsd/drm2/linux/linux_xa.c: revision 1.4
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.23
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.24
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.25
	sys/external/bsd/drm2/linux/linux_pci.c: revision 1.26
	sys/dev/pci/pcivar.h: revision 1.120
	sys/arch/xen/include/pci_machdep.h: revision 1.24
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.26
	sys/external/bsd/drm2/linux/linux_pci.c: revision 1.27
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.27
	sys/external/bsd/drm2/linux/linux_pci.c: revision 1.28
	sys/external/bsd/drm2/dist/drm/radeon/radeon_cik.c: revision 1.8
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.28
	sys/external/bsd/drm2/linux/linux_pci.c: revision 1.29
	sys/external/bsd/drm2/include/linux/pci.h: revision 1.57
	sys/external/bsd/drm2/include/linux/pci.h: revision 1.58
	sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_display.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_hwmgr.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c: revision 1.3
	share/man/man9/bus_dma.9: revision 1.69
	sys/external/bsd/drm2/drm/drm_gem_cma_helper.c: revision 1.15
	sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/radeon/radeon.h: revision 1.12
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cik.c: revision 1.7
	sys/dev/acpi/acpi_mcfg.c: revision 1.29
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_acpi.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/radeon/radeon_r600.c: revision 1.7
	sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.13
	sys/modules/amdgpu/Makefile: revision 1.9
	sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.14
	sys/external/bsd/common/linux/linux_tasklet.c: revision 1.12
	sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/device.h: revision 1.10
	sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.23
	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu.h: revision 1.9
	sys/external/bsd/drm2/include/linux/interval_tree.h: revision 1.14
	sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.26
	sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_smu7_hwmgr.c: revision 1.5
	sys/dev/pci/pci.c: revision 1.168
	sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.27
	sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c: revision 1.9
	sys/external/bsd/drm2/pci/files.drmkms_pci: revision 1.18
	sys/external/bsd/drm2/linux/linux_sync_file.c: revision 1.3
	sys/external/bsd/drm2/amdgpu/files.amdgpu: revision 1.31
	sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_tegra.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.24
	sys/arch/xen/xen/xpci_xenbus.c: revision 1.29

drm: Eliminate __HAVE_ATOMIC_AS_MEMBAR conditionals.
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html

linux asm/barrier.h: Fix !MULTIPROCESSOR build.

remove "nouveau" from a comment.  noted by jmcneill.

drm: KASSERT(A && B) -> KASSERT(A); KASSERT(B)
comment a function that has a clear overbounds read but it isn't used.
found by GCC 12.

nix the NetBSD specific GEM_BUG_ON().
avoids GCC 12 warnings, and matches upstream closer.
avoid uninitialised variable usage in drm_gem_cma_create_internal().
in the case nothing has returned 'error', 'nsegs' and the dma info
are (potentially) uninitialised, so consider this an error.
found by GCC 12.

avoid a GCC 12 warning.
there's a 1-element long array and a loop conditional that tries to see
if indexes for it are not identical.  as these indexes will always both
be 0, the only valid index, the condition is always false.  GCC 12
triggers a strange warning on this code that can never run (see below),
so simply assert the array size is 1 and comment the rest.
amdgpu_dc_stream.c:470:55: error: array subscript [0, 0] is outside array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
  470 |                                 stream->writeback_info[j] = stream->writeback_info[i];

convert a KASSERT() into an if () panic() sequence to appease GCC 12.
OK riastradh@.

drm: Fix conditionals around drmkms_pci and agp.
Kernel should build now with all pci drm drivers stripped out but
DRM_LEGACY still enabled.  (Might not be very useful, but it'll
build.  Maybe we should also have DRM_LEGACY_PCI so those drivers can
be modloaded later.)

drmkms: Fix module build.
avoid an unlikely array bounds issue picked up by GCC 12.
nvkm_pcie_speed() can return -1, which is then used as an array index,
so make this default return PCIe 1.0 speeds.

drm: enable almost all PCIe functionality
linux_pci.c revisions 1.24 and 1.25 implemented most of the remaining
missing PCIe backends, but only enabled them for some amdgpu portions.
this enables all code marked with "XXX amdgpu pcie", "XXX radeon pcie",
and "XXX pcie speed".  for most of it, simply removing #ifndefs __NetBSD__
to enable compliation was required, once the new "bus->max_bus_speed"
member was added to struct pci_bus.  add an "always fails" backend for
pci_enable_atomic_ops_to_root() which seems to only be necessary
for virtual GPU functionality (and could be implemented if needed.)
tested on radeon 5450, 7750, R7 240 [radeon], and RX 550 [amdgpu], and
nvidia 750 and 1030 [nouveau].
this still does not quite work on nvidia cards.  there are two problems
that remain:
- the call to set the link speed is skipped because the speed is set
  to the default value of "-1".  nvkm_pcie_set_link() will actually
  determine the right value for this and for some cards, calling this
  function if the current speed is -1 helps set the link speed.  it
  may be that on linux other paths we don't have enabled properly
  would set this (there's one via debugfs, and a jetson specific one,
  though perhaps setting either AC or DC speed values as boot options
  (after hooking up these for netbsd) would currently work.
- worse, cards newer than kepler - geforce 900, 1000, and newer, are
  all lacking the backing support to set pcie link speed.  the GT 1030
  card i have been testing with remains at pcie 1.0.

radeon: fix and enable ACPI methods for getting ROM BIOS
The hacky way of getting the BIOS mapped only works on x86. ACPI
should be preferred if available. Makes BIOS reading though VFCT
work on aarch64 with EDK2. (But only if EDK2 has POSTed the GPU.)
XXX amdgpu should get the same treatment.

drm: put_cpu() should enable preemption, not disable it again

drm(4): make pr_debug equivalent to aprint_debug
significantly reduces the default spam from amdgpu(4).

drm: Set CONFIG_ACPI in linux/acpi.h and make it build.

Leave a little ACPI-related functionality disabled for now, like
getting EDID out of ACPI -- needs a bit more work to make this work,
and I don't have hardware to work on that.
Should help with failures of the forms:
- unable to locate a BIOS ROM
- bios: unable to locate usable image
on various machines.

radeon_acpi.c: ifdef out unused function on NetBSD.
Should fix syzkaller build.

drm(4): Fix st_rdev in stat.
dminor->index already has the 64*type adjustment, as allocated in
drm_minor_alloc.
PR kern/58180

linux_sync_file: Fix missing init/fini steps.
Noted by rjs@.
PR kern/58210

ttm: Sync ttm_bo_uvm_fault_idle better with Linux.
PR xsrc/58133
ttm: Undo mistake in previous.

PR xsrc/58133
linux: Add a few more cases to pci_get_class.
Should fix crash on boot with amdgpu now that the ACPI business is
enabled.

i915: Fix dmabuf mmap object.

drm: Fix missing bounds checks in dma buf mmap.

drm_gem.c: Fix sense of assertion.
This is the opposite of WARN_ON.
Noted by rjs@.

drm_gem.c: Enable drm_gem_fence_array_add now that we emulate xa.
linux_xa: Delete and replace collision in xa_store as intended.
Don't free the colliding node that's still in the tree.
Noted by rjs@.

i915_gem_mman.c: Apply mmap types via pmap flags.
This way, userland gets buffers mapped write-combining or uncached as
needed.
PR xsrc/58307

x86: Teach bus_dmamem_map about BUS_DMA_PREFETCHABLE.
PR port-amd64/58308

bus_dma(9): Document BUS_DMA_PREFETCHABLE.
Like BUS_DMA_NOCACHE.  Doesn't absolve you of the need for
bus_dmamap_sync, but if you later pass the vaddr to bus_dmamap_load,
the DMA map might notice the mapping is write-combining and use this
to make bus_dmamap_sync cheaper.
PR kern/58309

nouveau_nvkm_subdev_instmem_gk20a.c: Use BUS_DMA_PREFETCHABLE.
Matches Linux's pgprot_writecombine.
Unclear where the appropriate bus_dmamap_sync happens, or is supposed
to happen -- not using it would be wrong, but asking for a
prefetchable mapping may paper over symptoms, at least!

ttm: Sync more with Linux.
Add the original copyright and attribution since this is now,
intentionally, a modified copy of the original and not just roughly
the same algorithm.

ttm: Respect PGO_ALLPAGES.
Not sure this is useful but it reduces XXX's and makes this match
udv_fault better so it's easier to understand.

ttm: Sync cacheability flag logic with Linux.

ttm: Add XXX about readahead fault failures.

pci: Pass cookie through pci_find_device, pci_enumerate_bus, take 2.
New functions pci_find_device1 and pci_enumerate_bus1 have the cookie
argument.  Existing symbols pci_find_device and pci_enumerate_bus are
now wrappers for the cookieless version.
This will allow pci_find_device callers to pass a cookie through to
the match function so they can keep state or pass in extra parameters
like b/d/f numbers, which will allow us to nix some horrible kludges
in the Linux PCI API emulation for drm (and, perhaps, Intel wifi).
This change drops the symbol pci_probe_device, in favour of a new
pci_probe_device1 with the cookie argument.  But I don't think that
requires a revbump because it's only called by MD pci_enumerate_bus1
implementations, which don't live in modules anyway.
Take 2: Make sure to handle NULL match function.
linux_pci: Nix pci enumeration kludges.
Now that we can pass a cookie through, this stuff will be a little
less fragile.

i915: Omit needless i915_gem_object_pin/unpin_pages cycle in fault.
vm_fault_cpu and vm_fault_gtt, called by i915_gem_fault, already do
the pinning and unpinning internally, so there is no need for
i915_gem_fault to do it.
No functional change intended, except that the transient pin count
will be one lower than before during the fault routine (but it will
still be positive).

i915: Match Linux fault routine return code actions.
Omit needless EINTR interception -- this is now handled by
i915_error_to_vmf_fault.
Earlier revert was over a false alarm -- bisection shows the new
warnings arose from linux_pci.c 1.29 here:
https://mail-index.netbsd.org/source-changes/2024/06/23/msg151929.html

linux_pci: Fix shifto in pci_get_class.
It looks like Linux's pci_get_class also matches the interface part
of the PCI class register (but not the revision part), and I hadn't
noticed that in the previous shim structured differently.

With GCC12 kernel ALL/amd64 triggers "'sor' may be used uninitialized".
If "sublinks & 3" is zero GCC is right and sor[1] may be returned unitialized.
Fix by initializing "sor" to zero to return -1 instead of uninitialized value.
Ok: Taylor R Campbell <riastradh@>

amdgpu: Map BAR 2, not BAR 5, on pre-bonaire chips.
PR kern/58384

amdgpu: Map consecutive pages, not the same one over and over again.
PR kern/58385

linux/bitops: Fix overestimate for BITS_TO_LONGS(9)
Fortunately, this seems harmless except for allocating
excessive buffer memory.
Pointed out by nonaka@, OK riastradh@.

Revision 1.89.4.1: download - view: text, markup, annotated - select for diffs
Fri Sep 20 10:47:52 2024 UTC (2 months, 2 weeks ago) by martin
Branches: netbsd-10
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +29 -13 lines
Pull up following revision(s) (requested by rin in ticket #881):

	sys/arch/x86/x86/bus_dma.c: revision 1.90

x86/bus_dma.c: Sprinkle KASSERTMSG.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Tue Jun 4 21:42:58 2024 UTC (6 months ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +8 -3 lines
x86: Teach bus_dmamem_map about BUS_DMA_PREFETCHABLE.

PR port-amd64/58308

Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Mar 28 19:55:42 2023 UTC (20 months, 2 weeks ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +29 -13 lines
x86/bus_dma.c: Sprinkle KASSERTMSG.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Aug 20 23:48:51 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
CVS tags: 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, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +3 -2 lines
x86: Split most of pmap.h into pmap_private.h or vmparam.h.

This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.

Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:

1. CPU-specific (different for i386/amd64) definitions used by...

2. common definitions, including Xenisms like xpmap_ptetomach,
   further used by...

3. more CPU-specific inlines for pmap_pte_* operations

So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3.  Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.

No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.

Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:

VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS

Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sat Aug 13 06:59:56 2022 UTC (2 years, 3 months ago) by skrll
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +3 -3 lines
Fix an inverted KASSERTMSG test from the #ifdef DIAGNOSTIC panic -> KASSERT
conversion.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Fri Aug 12 15:01:26 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +24 -44 lines
x86/bus_dma: #ifdef DIAGNOSTIC panic -> KASSERT

While here, use some better types and avoid integer overflow in the
diagnostic tests.

No functional change intended except in the case of bugs anyway.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Fri Aug 12 13:44:12 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +60 -21 lines
x86: Adjust fences issued in bus_dmamap_sync after bouncing.

And expand the comment on the lfence for POSTREAD before bouncing.

Net change:

op                      before bounce       after bounce
                                        old             new
PREREAD                 nop             lfence          sfence
PREWRITE                nop             mfence          sfence
PREREAD|PREWRITE        nop             mfence          sfence
POSTREAD                lfence          lfence          nop[*]
POSTWRITE               nop             mfence          nop
POSTREAD|POSTWRITE      lfence          mfence          nop[*]

The case of PREREAD is as follows:

1. loads and stores before DMA buffer may be allocated for the purpose
2. bus_dmamap_sync(BUS_DMASYNC_PREREAD)
3. store to register or DMA descriptor to trigger DMA

The register or DMA descriptor may be in any type of memory (or I/O).

lfence at (2) is _not enough_ to ensure stores at (1) have completed
before the store in (3) in case the register or DMA descriptor lives
in wc/wc+ memory, or the store to it is non-temporal: in that case,
it may executed early before all the stores in (1) have completed.

On the other hand, lfence at (2) is _not needed_ to ensure loads in
(1) have completed before the store in (3), because x86 never
reorders load;store to store;load.  So we may need to enforce
store/store ordering, but not any other ordering, hence sfence.

The case of PREWRITE is as follows:

1. stores to DMA buffer (and loads from it, before allocated)
2. bus_dmamap_sync(BUS_DMASYNC_PREWRITE)
3. store to register or DMA descriptor to trigger DMA

Ensuring prior loads have completed is not necessary because x86
never reorders load;store to store;load (and in any case, the device
isn't changing the DMA buffer, so it's safe to read over and over
again).  But we must ensure the stores in (1) have completed before
the store in (3).  So we need sfence, in case either the DMA buffer
or the register or the DMA descriptor is in wc/wc+ memory or either
store is non-temporal.  But we don't need mfence.

The case of POSTREAD is as follows:

1. load from register or DMA descriptor notifying DMA completion
2. bus_dmamap_sync(BUS_DMASYNC_POSTREAD)
   (a) lfence [*]
   (b) if bouncing, memcpy(userbuf, bouncebuf, ...)
   (c) ???
3. loads from DMA buffer to use data, and stores to reuse buffer

This certainly needs an lfence to prevent the loads at (3) from being
executed early -- but bus_dmamap_sync already issues lfence in that
case at 2(a), before it conditionally loads from the bounce buffer
into the user's buffer.  So we don't need any _additional_ fence
_after_ bouncing at 2(c).

The case of POSTWRITE is as follows:

1. load from register or DMA descriptor notifying DMA completion
2. bus_dmamap_sync(BUS_DMASYNC_POSTWRITE)
3. loads and stores to reuse buffer

Stores at (3) will never be executed early because x86 never reorders
load;store to store;load for any memory types.  Loads at (3) are
harmless because the device isn't changing the buffer -- it's
supposed to be fixed from the time of PREWRITE to the time of
POSTWRITE as far as the CPU can witness.

Proposed on port-amd64 last month:

https://mail-index.netbsd.org/port-amd64/2022/07/16/msg003593.html

Reference:

AMD64 Architecture Programmer's Manual, Volume 2: System Programming,
24593--Rev. 3.38--November 2021, Sec. 7.4.2 Memory Barrier Interaction
with Memory Types, Table 7-3, p. 196.
https://www.amd.com/system/files/TechDocs/24593.pdf

Revision 1.85: download - view: text, markup, annotated - select for diffs
Wed Jul 13 00:12:20 2022 UTC (2 years, 4 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +12 -5 lines
x86: Move lfence into _bus_dmamap_sync and comment it.

No functional change intended.  This just keeps the bus_dma_* and
_bus_dma_* functions organized more consistently.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sat Jan 22 15:10:32 2022 UTC (2 years, 10 months ago) by skrll
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +8 -8 lines
Ensure bus_dmatag_subregion is called with an inclusive max_addr
everywhere.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Thu Oct 7 12:52:27 2021 UTC (3 years, 2 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +6 -6 lines
KNF. No functional change.

Revision 1.77.4.3: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:04:11 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.77.4.2: preferred, colored; branchpoint 1.77: preferred, colored; next MAIN 1.78: preferred, colored
Changes since revision 1.77.4.2: +19 -1 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.77.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:07:58 2020 UTC (4 years, 8 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.77.4.1: preferred, colored; branchpoint 1.77: preferred, colored
Changes since revision 1.77.4.1: +5 -7 lines
Merge changes from current as of 20200406

Revision 1.82: download - view: text, markup, annotated - select for diffs
Sat Mar 14 18:08:38 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +5 -7 lines
- Hide the details of SPCF_SHOULDYIELD and related behind a couple of small
  functions: preempt_point() and preempt_needed().

- preempt(): if the LWP has exceeded its timeslice in kernel, strip it of
  any priority boost gained earlier from blocking.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Thu Nov 14 16:23:52 2019 UTC (5 years ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-20191119, is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +8 -2 lines
Add support for Kernel Memory Sanitizer (kMSan). It detects uninitialized
memory used by the kernel at run time, and just like kASan and kCSan, it
is an excellent feature. It has already detected 38 uninitialized variables
in the kernel during my testing, which I have since discreetly fixed.

We use two shadows:
 - "shad", to track uninitialized memory with a bit granularity (1:1).
   Each bit set to 1 in the shad corresponds to one uninitialized bit of
   real kernel memory.
 - "orig", to track the origin of the memory with a 4-byte granularity
   (1:1). Each uint32_t cell in the orig indicates the origin of the
   associated uint32_t of real kernel memory.

The memory consumption of these shadows is consequent, so at least 4GB of
RAM is recommended to run kMSan.

The compiler inserts calls to specific __msan_* functions on each memory
access, to manage both the shad and the orig and detect uninitialized
memory accesses that change the execution flow (like an "if" on an
uninitialized variable).

We mark as uninit several types of memory buffers (stack, pools, kmem,
malloc, uvm_km), and check each buffer passed to copyout, copyoutstr,
bwrite, if_transmit_lock and DMA operations, to detect uninitialized memory
that leaves the system. This allows us to detect kernel info leaks in a way
that is more efficient and also more user-friendly than KLEAK.

Contrary to kASan, kMSan requires comprehensive coverage, ie we cannot
tolerate having one non-instrumented function, because this could cause
false positives. kMSan cannot instrument ASM functions, so I converted
most of them to __asm__ inlines, which kMSan is able to instrument. Those
that remain receive special treatment.

Contrary to kASan again, kMSan uses a TLS, so we must context-switch this
TLS during interrupts. We use different contexts depending on the interrupt
level.

The orig tracks precisely the origin of a buffer. We use a special encoding
for the orig values, and pack together in each uint32_t cell of the orig:
 - a code designating the type of memory (Stack, Pool, etc), and
 - a compressed pointer, which points either (1) to a string containing
   the name of the variable associated with the cell, or (2) to an area
   in the kernel .text section which we resolve to a symbol name + offset.

This encoding allows us not to consume extra memory for associating
information with each cell, and produces a precise output, that can tell
for example the name of an uninitialized variable on the stack, the
function in which it was pushed on the stack, and the function where we
accessed this uninitialized variable.

kMSan is available with LLVM, but not with GCC.

The code is organized in a way that is similar to kASan and kCSan, so it
means that other architectures than amd64 can be supported.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Fri Oct 4 06:27:42 2019 UTC (5 years, 2 months ago) by maxv
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +13 -2 lines
Add DMA instrumentation in KASAN. We note the original buffer and length in
the map, and check the buffer on each bus_dmamap_sync. This allows us to
find DMA buffer overflows and UAFs, which couldn't be found before because
the device accesses to memory are outside of KASAN's control.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Fri Jun 14 03:35:31 2019 UTC (5 years, 5 months ago) by mrg
Branches: MAIN
CVS tags: netbsd-9-base, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +4 -3 lines
KASSERT() -> KASSERTMSG() message in _bus_dmamem_alloc_range().

Revision 1.77.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:06:53 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +4 -4 lines
Sync with HEAD

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sun Apr 21 06:37:21 2019 UTC (5 years, 7 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-20190609
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +4 -4 lines
Rename the PTE bits.

Revision 1.68.12.3: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:36:50 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.68.12.2: preferred, colored; branchpoint 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68.12.2: +26 -27 lines
update from HEAD

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

Revision 1.77: download - view: text, markup, annotated - select for diffs
Mon Jul 31 19:29:19 2017 UTC (7 years, 4 months ago) by jdolecek
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, 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, pgoyette-compat, nick-nhusb-base-20170825, isaki-audio2-base, isaki-audio2
Branch point for: phil-wifi
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +3 -4 lines
modify code handling mismatch of nsegs in _bus_dmamem_alloc_range() to
a KASSERT() - plain return leaks memory, and this condition should
never trigger unless there is bug in uvm_pglistalloc(), so it seems
to be waste to check this

other ports usually simply do not check this, with exception of arm,
which does even full cleanup (checks it and calls uvm_pglistfree())

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

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

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

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

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

Revision 1.75: download - view: text, markup, annotated - select for diffs
Thu Jan 5 09:08:44 2017 UTC (7 years, 11 months ago) by msaitoh
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +7 -5 lines
Update the dmamp argument only when the allocation succeeded.

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

Revision 1.68.16.1: download - view: text, markup, annotated - select for diffs
Sun Nov 15 20:52:15 2015 UTC (9 years ago) by bouyer
Branches: netbsd-6-1
Diff to: previous 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68: +22 -20 lines
Pull up following revision(s) (requested by christos in ticket #1339):
	sys/arch/x86/x86/bus_dma.c: revision 1.72
	sys/arch/x86/x86/bus_dma.c: revision 1.73
	sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.

Revision 1.68.14.1: download - view: text, markup, annotated - select for diffs
Sun Nov 15 20:52:09 2015 UTC (9 years ago) by bouyer
Branches: netbsd-6-0
Diff to: previous 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68: +22 -20 lines
Pull up following revision(s) (requested by christos in ticket #1339):
	sys/arch/x86/x86/bus_dma.c: revision 1.72
	sys/arch/x86/x86/bus_dma.c: revision 1.73
	sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.

Revision 1.68.8.1: download - view: text, markup, annotated - select for diffs
Sun Nov 15 20:52:03 2015 UTC (9 years ago) by bouyer
Branches: netbsd-6
Diff to: previous 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68: +22 -20 lines
Pull up following revision(s) (requested by christos in ticket #1339):
	sys/arch/x86/x86/bus_dma.c: revision 1.72
	sys/arch/x86/x86/bus_dma.c: revision 1.73
	sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.

Revision 1.71.4.1: download - view: text, markup, annotated - select for diffs
Sun Nov 8 00:31:00 2015 UTC (9 years, 1 month ago) by riz
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, 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-1
Diff to: previous 1.71: preferred, colored; next MAIN 1.72: preferred, colored
Changes since revision 1.71: +22 -20 lines
Pull up following revision(s) (requested by christos in ticket #1011):
	sys/arch/x86/x86/bus_dma.c: revision 1.72
	sys/arch/x86/x86/bus_dma.c: revision 1.73
	sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.

Revision 1.71.8.1: download - view: text, markup, annotated - select for diffs
Sun Nov 8 00:30:48 2015 UTC (9 years, 1 month ago) by riz
Branches: netbsd-7-0
CVS tags: netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Diff to: previous 1.71: preferred, colored; next MAIN 1.72: preferred, colored
Changes since revision 1.71: +22 -20 lines
Pull up following revision(s) (requested by christos in ticket #1011):
	sys/arch/x86/x86/bus_dma.c: revision 1.72
	sys/arch/x86/x86/bus_dma.c: revision 1.73
	sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Oct 27 18:49:26 2015 UTC (9 years, 1 month ago) by christos
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, localcount-20160914
Branch point for: pgoyette-localcount
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +4 -4 lines
fix operator precedence.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Tue Oct 27 18:19:05 2015 UTC (9 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +4 -3 lines
make sure we have a cookie before we try to clear it.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Tue Oct 27 15:53:58 2015 UTC (9 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +19 -18 lines
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.

Revision 1.68.12.2: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:03:29 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.68.12.1: preferred, colored; branchpoint 1.68: preferred, colored
Changes since revision 1.68.12.1: +7 -4 lines
Rebase to HEAD as of a few days ago.

Revision 1.68.2.2: download - view: text, markup, annotated - select for diffs
Thu May 22 11:40:13 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.68.2.1: preferred, colored; branchpoint 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68.2.1: +7 -4 lines
sync with head.

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

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

Revision 1.69.2.2: download - view: text, markup, annotated - select for diffs
Sun May 18 17:45:30 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.69.2.1: preferred, colored; branchpoint 1.69: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.2.1: +5 -5 lines
sync with head

Revision 1.71: download - view: text, markup, annotated - select for diffs
Tue Dec 24 15:42:56 2013 UTC (10 years, 11 months ago) by christos
Branches: MAIN
CVS tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-base, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1
Branch point for: nick-nhusb, netbsd-7-0, netbsd-7
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +5 -5 lines
use __func__

Revision 1.69.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 28 23:59:24 2013 UTC (11 years, 3 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +7 -4 lines
sync with head

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Jul 2 22:39:45 2013 UTC (11 years, 5 months ago) by christos
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +7 -4 lines
make a diagnostic message more informative.

Revision 1.68.12.1: download - view: text, markup, annotated - select for diffs
Mon Feb 25 00:29:05 2013 UTC (11 years, 9 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +10 -2 lines
resync with head

Revision 1.68.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 16 05:33:10 2013 UTC (11 years, 10 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +10 -2 lines
sync with (a bit old) head

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sat Dec 8 12:36:31 2012 UTC (12 years ago) by kiyohara
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +10 -2 lines
#ifdef - #endif-ed. NMCA, NISA, NNPX, NIOAPIC, LAPIC, MPBIOS and MULTIPROCESSOR.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Fri Oct 14 18:28:04 2011 UTC (13 years, 2 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, 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-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, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, tls-maxphys, netbsd-6-1, netbsd-6-0, netbsd-6
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +4 -3 lines
Both bdt_ov->ov_dmamap_sync() and bus_dmamap_sync() return void,
so don't write return bdt_ov->ov_dmamap_sync(). Pointed out by njoly@

Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed Sep 28 01:45:49 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +6 -8 lines
Cosmetic: join some if-statements, remove superfluous parentheses.  No
change in the generated assembly.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Wed Sep 28 01:38:19 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +5 -5 lines
After bouncing in bus_dmamap_load{,_mbuf,_uio}, call bus_dmamap_load(9)
instead of _bus_dmamap_load() so that a bus_dmamap_load(9) override has
a shot at loading the map.

XXX Perhaps bounce buffers should be rewritten in terms of bus_dma(9)
XXX overrides.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Wed Sep 28 01:35:58 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +10 -2 lines
In bus_dma_tag_create(9), copy important properties (e.g., bounce
parameters) from the parent tag.

In bus_dma_tag_create(), increase the reference count on a parent
bus_dma_tag_t (if applicable), and decrease the reference count in
bus_dma_tag_destroy().

Don't let bus_dmatag_destroy(9) destroy an overridden bus_dma_tag_t.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Wed Sep 28 01:33:26 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +38 -5 lines
Add an untested implementation of bus_dmamap_load_raw(9).

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Sep 27 23:44:18 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +4 -4 lines
Instead of declaring _bus_dmamap_load_busaddr() static inline, make
it static and let the compiler decide about inlining.  This reduces
the code size on both amd64 and i386, and the smaller code is probably
faster code.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Tue Sep 27 23:33:35 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +3 -3 lines
In _bus_dmamap_load_busaddr(), change sgsize from an int to a bus_size_t.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Tue Sep 27 23:25:55 2011 UTC (13 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +4 -4 lines
Make the 'size' argument of _bus_dmamap_load_busaddr() a bus_size_t for
consistency's sake.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Tue Sep 13 17:59:46 2011 UTC (13 years, 3 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +4 -4 lines
For consistency, call a bus_dma_tag_t bdt instead of bst.  No functional
change intended.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Sep 1 15:10:31 2011 UTC (13 years, 3 months ago) by christos
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +321 -50 lines
Add bus_dma overrides. From dyoung

Revision 1.46.4.5: download - view: text, markup, annotated - select for diffs
Sat Aug 27 15:37:30 2011 UTC (13 years, 3 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.46.4.4: preferred, colored; branchpoint 1.46: preferred, colored; next MAIN 1.47: preferred, colored
Changes since revision 1.46.4.4: +4 -5 lines
Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Mon Jul 25 20:33:20 2011 UTC (13 years, 4 months ago) by dyoung
Branches: MAIN
CVS tags: jym-xensuspend-nbase, jym-xensuspend-base
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +3 -4 lines
In _bus_dmamap_load_busaddr(), just return 0 instead of assigning an
intermediate variable (int error = 0;) and returning that (return
error;).

Revision 1.57: download - view: text, markup, annotated - select for diffs
Fri Jul 1 18:21:31 2011 UTC (13 years, 5 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +3 -3 lines
#include <sys/bus.h> instead of <machine/bus.h>.

Revision 1.53.2.2: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:52:29 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.53.2.1: preferred, colored; branchpoint 1.53: preferred, colored; next MAIN 1.54: preferred, colored
Changes since revision 1.53.2.1: +4 -4 lines
sync with head

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

Revision 1.45.6.1: download - view: text, markup, annotated - select for diffs
Fri Nov 19 23:19:12 2010 UTC (14 years ago) by riz
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, matt-nb5-pq3-base, matt-nb5-pq3
Diff to: previous 1.45: preferred, colored; next MAIN 1.46: preferred, colored
Changes since revision 1.45: +23 -6 lines
Pull up following revision(s) (requested by bouyer in ticket #1348):
	sys/arch/x86/x86/bus_dma.c: revision 1.54
	sys/arch/xen/x86/xen_bus_dma.c: revision 1.21
bus_dmamem_alloc() may not get a boundary smaller than size, but
it's perfectly valid for bus_dmamap_create() to do so (a contigous
transfers will then split in multiple segment).
Fix _xen_bus_dmamem_alloc_range() and _bus_dmamem_alloc_range() to
allow a boundary limit smaller than size:
- compute appropriate boundary for uvm_pglistalloc(), wich doesn't
  accept boundary < size
- also take care of boundary when deciding to start a new segment.
While there, remove useless boundary argument to _xen_alloc_contig().
Fix the boundary-related issue of PR port-amd64/42980

Revision 1.52.2.5: download - view: text, markup, annotated - select for diffs
Tue Nov 9 06:06:31 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.52.2.4: preferred, colored; branchpoint 1.52: preferred, colored; next MAIN 1.53: preferred, colored
Changes since revision 1.52.2.4: +2 -7 lines
Sync with HEAD.

Revision 1.52.2.4: download - view: text, markup, annotated - select for diffs
Tue Nov 9 06:03:40 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.52.2.3: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.3: +6 -2 lines
Sync with HEAD.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat Nov 6 11:46:03 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: MAIN
CVS tags: uebayasi-xip-base7, uebayasi-xip-base6, uebayasi-xip-base5, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +3 -3 lines
Machine dependent code is considered as part of UVM.  Include
internal API header.

Revision 1.46.4.3: download - view: text, markup, annotated - select for diffs
Sun Oct 24 22:48:18 2010 UTC (14 years, 1 month ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.46.4.2: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.4.2: +31 -11 lines
Sync with HEAD

Revision 1.52.2.3: download - view: text, markup, annotated - select for diffs
Fri Oct 22 07:21:42 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.52.2.2: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.2: +1 -1 lines
Sync with HEAD (-D20101022).

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

Revision 1.55: download - view: text, markup, annotated - select for diffs
Fri Sep 24 20:55:19 2010 UTC (14 years, 2 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +3 -3 lines
fix copy/paste/modify error in a diagnostic panic message

Revision 1.41.2.4: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:52:56 2010 UTC (14 years, 4 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.41.2.3: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.3: +23 -6 lines
sync with head.

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

Revision 1.52.2.2: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:39:58 2010 UTC (14 years, 7 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.52.2.1: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.2.1: +22 -5 lines
Sync with HEAD.

Revision 1.52.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 28 08:25:33 2010 UTC (14 years, 7 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -2 lines
Adjustment for uvm/uvm_page.h.  More to follow later.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Mon Mar 22 22:03:30 2010 UTC (14 years, 8 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-nfs-mp-base10, uebayasi-xip-base2, uebayasi-xip-base1
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +23 -6 lines
bus_dmamem_alloc() may not get a boundary smaller than size, but
it's perfectly valid for bus_dmamap_create() to do so (a contigous
transfers will then split in multiple segment).
Fix _xen_bus_dmamem_alloc_range() and _bus_dmamem_alloc_range() to
allow a boundary limit smaller than size:
- compute appropriate boundary for uvm_pglistalloc(), wich doesn't
  accept boundary < size
- also take care of boundary when deciding to start a new segment.
While there, remove useless boundary argument to _xen_alloc_contig().
Fix the boundary-related issue of PR port-amd64/42980

Revision 1.41.2.3: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:03:08 2010 UTC (14 years, 9 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.41.2.2: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.2: +9 -6 lines
sync with head

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Feb 26 19:25:07 2010 UTC (14 years, 9 months ago) by jym
Branches: MAIN
CVS tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -3 lines
Fixes regarding paddr_t/pd_entry_t types in MD x86 code, exposed by PAE:

- NBPD_* macros are set to the types that better match their architecture
(UL for i386 and amd64, ULL for i386 PAE) - will revisit when paddr_t is
set to 64 bits for i386 non-PAE.

- type fixes in printf/printk messages (Use PRIxPADDR when printing paddr_t
values, instead of %lx - paddr_t/pd_entry_t being 64 bits with PAE)

- remove casts that are no more needed now that Xen2 support has been dropped

Some fixes are from jmorse@ patches for PAE.

Compile + tested for i386 GENERIC and XEN3 kernels. Only compile tested for
amd64.

Reviewed by bouyer@.

See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Nov 6 23:10:10 2009 UTC (15 years, 1 month ago) by dsl
Branches: MAIN
CVS tags: uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +8 -5 lines
Don't call _bus_dmamem_free() when _bus_dmamem_alloc() fails.
Fixes PR/42208

Revision 1.46.4.2: download - view: text, markup, annotated - select for diffs
Sun Nov 1 13:58:17 2009 UTC (15 years, 1 month ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.46.4.1: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.4.1: +0 -0 lines
Sync with HEAD.

Revision 1.46.4.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:18:45 2009 UTC (15 years, 7 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +10 -31 lines
Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.41.2.2: download - view: text, markup, annotated - select for diffs
Mon May 4 08:12:10 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.41.2.1: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.1: +31 -37 lines
sync with head.

Revision 1.45.4.2: download - view: text, markup, annotated - select for diffs
Tue Apr 28 07:34:57 2009 UTC (15 years, 7 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.45.4.1: preferred, colored; branchpoint 1.45: preferred, colored; next MAIN 1.46: preferred, colored
Changes since revision 1.45.4.1: +10 -31 lines
Sync with HEAD.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Tue Apr 21 21:30:01 2009 UTC (15 years, 7 months ago) by cegger
Branches: MAIN
CVS tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +3 -3 lines
change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@

Revision 1.50: download - view: text, markup, annotated - select for diffs
Sat Apr 18 08:51:45 2009 UTC (15 years, 7 months ago) by cegger
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +9 -30 lines
Introduce PMAP_NOCACHE as first PMAP MD bit in x86. Make use of it in pmap_enter().
This safes one extra TLB flush when mapping dma-safe memory.
Presented on tech-kern@, port-i386@ and port-amd64@
ok ad@

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sat Mar 14 14:46:08 2009 UTC (15 years, 9 months ago) by dsl
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +3 -3 lines
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Fri Feb 20 05:54:40 2009 UTC (15 years, 9 months ago) by cegger
Branches: MAIN
CVS tags: nick-hppapmap-base2
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +1 -3 lines
backout rev. 1.47.
per request from dyoung@ and cube@

Revision 1.47: download - view: text, markup, annotated - select for diffs
Thu Feb 19 23:34:14 2009 UTC (15 years, 9 months ago) by cegger
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +5 -3 lines
bus_dmamap_create(): on failure, reset dmamp or drivers
like nfe(4) try to call bus_dmamap_destroy() on an invalid dmamap in their error path.

Revision 1.45.4.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:17:09 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -3 lines
Sync with HEAD.

Revision 1.40.14.4: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:28:38 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.40.14.3: preferred, colored; branchpoint 1.40: preferred, colored; next MAIN 1.41: preferred, colored
Changes since revision 1.40.14.3: +1 -1 lines
Sync with HEAD.

Revision 1.45.2.1: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:13:38 2008 UTC (16 years ago) by haad
Branches: haad-dm
Diff to: previous 1.45: preferred, colored; next MAIN 1.46: preferred, colored
Changes since revision 1.45: +3 -3 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sat Nov 15 10:47:53 2008 UTC (16 years ago) by skrll
Branches: MAIN
CVS tags: mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -3 lines
Typo in comment.

Revision 1.19.2.5: download - view: text, markup, annotated - select for diffs
Sun Sep 28 15:57:50 2008 UTC (16 years, 2 months ago) by jdc
Branches: netbsd-3
Diff to: previous 1.19.2.4: preferred, colored; branchpoint 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19.2.4: +18 -3 lines
Pull up revisions:
  sys/arch/amd64/include/cpufunc.h	patch
  sys/arch/i386/include/cpufunc.h	patch
  sys/arch/x86/x86/bus_dma.c		1.45 via patch
requested by bouyer in ticket 1945.

Revision 1.42.2.2: download - view: text, markup, annotated - select for diffs
Thu Sep 18 04:33:38 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.42.2.1: preferred, colored; branchpoint 1.42: preferred, colored; next MAIN 1.43: preferred, colored
Changes since revision 1.42.2.1: +18 -3 lines
Sync with wrstuden-revivesa-base-2.

Revision 1.32.4.1: download - view: text, markup, annotated - select for diffs
Thu Sep 4 08:46:44 2008 UTC (16 years, 3 months ago) by skrll
Branches: wrstuden-fixsa
Diff to: previous 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32: +18 -3 lines
Sync with netbsd-4.

Revision 1.32.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 31 16:38:22 2008 UTC (16 years, 3 months ago) by jdc
Branches: netbsd-4
CVS tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base
Diff to: previous 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32: +18 -3 lines
Pull up revision 1.45 (requested by bouyer in ticket #1165).

port-i386/38935: Add appropriate x86_lfence or x86_mfence calls to
bus_dmamap_sync(), depending on the BUS_DMASYNC flag. This makes sure
that the kernel reads data from main memory in the intended order.

Revision 1.43.2.2: download - view: text, markup, annotated - select for diffs
Thu Jul 3 18:37:57 2008 UTC (16 years, 5 months ago) by simonb
Branches: simonb-wapbl
Diff to: previous 1.43.2.1: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43.2.1: +18 -3 lines
Sync with head.

Revision 1.40.14.3: download - view: text, markup, annotated - select for diffs
Sun Jun 29 09:33:02 2008 UTC (16 years, 5 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.40.14.2: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.14.2: +17 -2 lines
Sync with HEAD.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sat Jun 28 17:23:01 2008 UTC (16 years, 5 months ago) by bouyer
Branches: MAIN
CVS tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, netbsd-5-base, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, 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, netbsd-5-0, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5, haad-dm
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +18 -3 lines
port-i386/38935: Add appropriate x86_lfence or x86_mfence calls to
bus_dmamap_sync(), depending on the BUS_DMASYNC flag. This makes sure
that the kernel reads data from main memory in the intended order.

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

Revision 1.43.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 18 16:32:54 2008 UTC (16 years, 5 months ago) by simonb
Branches: simonb-wapbl
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +3 -3 lines
Sync with head.

Revision 1.40.16.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 09:14:20 2008 UTC (16 years, 5 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.40.16.1: preferred, colored; branchpoint 1.40: preferred, colored; next MAIN 1.41: preferred, colored
Changes since revision 1.40.16.1: +7 -7 lines
sync with head.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri Jun 13 09:53:46 2008 UTC (16 years, 6 months ago) by bjs
Branches: MAIN
CVS tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +3 -3 lines
"functin" -> "function" (no "functional" change, har har)

Revision 1.40.14.2: download - view: text, markup, annotated - select for diffs
Thu Jun 5 19:14:34 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.40.14.1: preferred, colored; branchpoint 1.40: preferred, colored
Changes since revision 1.40.14.1: +4 -4 lines
Sync with HEAD.

Also fix build.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Jun 4 12:41:42 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
Branch point for: simonb-wapbl
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +6 -6 lines
vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.

Revision 1.40.14.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:22:51 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +4 -11 lines
Sync with HEAD.

Revision 1.40.16.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:33:04 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +4 -11 lines
sync with head.

Revision 1.41.2.1: download - view: text, markup, annotated - select for diffs
Fri May 16 02:23:28 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +2 -9 lines
sync with head.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Apr 28 20:23:40 2008 UTC (16 years, 7 months ago) by martin
Branches: MAIN
CVS tags: yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +2 -9 lines
Remove clause 3 and 4 from TNF licenses

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Apr 27 11:37:48 2008 UTC (16 years, 7 months ago) by ad
Branches: MAIN
CVS tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +4 -4 lines
- Rename crit_enter/crit_exit to kpreempt_disable/kpreempt_enable.
  DragonflyBSD uses the crit names for something quite different.
- Add a kpreempt_disabled function for diagnostic assertions.
- Add inline versions of kpreempt_enable/kpreempt_disable for primitives.
- Make some more changes for preemption safety to the x86 pmap.

Revision 1.35.20.2: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:49:52 2008 UTC (16 years, 11 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.35.20.1: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.20.1: +3 -3 lines
sync with HEAD

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Sat Dec 8 18:18:11 2007 UTC (17 years ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39: +3 -3 lines
Sync with HEAD.

Revision 1.21.2.6: download - view: text, markup, annotated - select for diffs
Fri Dec 7 17:26:58 2007 UTC (17 years ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.21.2.5: preferred, colored; branchpoint 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21.2.5: +3 -3 lines
sync with head

Revision 1.35.2.7: download - view: text, markup, annotated - select for diffs
Mon Dec 3 18:40:11 2007 UTC (17 years ago) by ad
Branches: vmlocking
Diff to: previous 1.35.2.6: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.2.6: +3 -3 lines
Sync with HEAD.

Revision 1.35.18.4: download - view: text, markup, annotated - select for diffs
Mon Dec 3 16:14:20 2007 UTC (17 years ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.35.18.3: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.18.3: +3 -3 lines
Sync with HEAD.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Nov 28 16:44:46 2007 UTC (17 years ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base, yamt-pf42-X, yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jmcneill-pm-base, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, ad-socklock-base1
Branch point for: yamt-pf42, mjf-devfs2
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -3 lines
Remove remaining CPUCLASS_386 tests.

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

Revision 1.21.2.5: download - view: text, markup, annotated - select for diffs
Sat Oct 27 11:28:59 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.21.2.4: preferred, colored; branchpoint 1.21: preferred, colored
Changes since revision 1.21.2.4: +130 -8 lines
sync with head.

Revision 1.35.18.3: download - view: text, markup, annotated - select for diffs
Fri Oct 26 15:43:44 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.35.18.2: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.18.2: +2 -6 lines
Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.38.2.1: download - view: text, markup, annotated - select for diffs
Wed Oct 17 21:38:18 2007 UTC (17 years, 1 month ago) by bouyer
Branches: bouyer-xenamd64
Diff to: previous 1.38: preferred, colored; next MAIN 1.39: preferred, colored
Changes since revision 1.38: +2 -2 lines
amd64 (aka x86-64) support for Xen. Based on the OpenBSD port done by
Mathieu Ropert in 2006.
DomU-only for now. An INSTALL_XEN3_DOMU kernel with a ramdisk will boot to
sysinst if you're lucky. Often it panics because a runable LWP has
a NULL stack (really, it's all of l->l_addr which is has been zeroed out
while the process was on the queue !)
TODO:
- bug fixes :)
- Most of the xpq_* functions should be shared with xen/i386
- The xen/i386 assembly bootstrap code should be remplaced with the C
  version in xenamd64/amd64/xpmap.c
- see if a config(5) trick could allow to merge xenamd64 back to xen or amd64.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Oct 17 19:58:16 2007 UTC (17 years, 1 month ago) by garbled
Branches: MAIN
CVS tags: yamt-x86pmap-base4, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: mjf-devfs
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +2 -2 lines
Merge the ppcoea-renovation branch to HEAD.

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

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

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

Revision 1.35.10.2: download - view: text, markup, annotated - select for diffs
Tue Oct 16 18:23:58 2007 UTC (17 years, 1 month ago) by garbled
Branches: ppcoea-renovation
Diff to: previous 1.35.10.1: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.10.1: +2 -6 lines
Sync with HEAD

Revision 1.36.2.2: download - view: text, markup, annotated - select for diffs
Sun Oct 14 11:47:51 2007 UTC (17 years, 2 months ago) by yamt
Branches: yamt-x86pmap
Diff to: previous 1.36.2.1: preferred, colored; branchpoint 1.36: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.1: +2 -6 lines
sync with head.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Oct 12 13:38:08 2007 UTC (17 years, 2 months ago) by ad
Branches: MAIN
CVS tags: yamt-x86pmap-base3, vmlocking-base, ppcoea-renovation-base
Branch point for: bouyer-xenamd64
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -6 lines
crit_enter/crit_exit are now available.

Revision 1.35.2.6: download - view: text, markup, annotated - select for diffs
Tue Oct 9 15:22:07 2007 UTC (17 years, 2 months ago) by ad
Branches: vmlocking
Diff to: previous 1.35.2.5: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.2.5: +4 -4 lines
Sync with head.

Revision 1.35.2.5: download - view: text, markup, annotated - select for diffs
Tue Oct 9 13:38:44 2007 UTC (17 years, 2 months ago) by ad
Branches: vmlocking
Diff to: previous 1.35.2.4: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.2.4: +132 -4 lines
Sync with head.

Revision 1.36.2.1: download - view: text, markup, annotated - select for diffs
Sat Oct 6 15:33:34 2007 UTC (17 years, 2 months ago) by yamt
Branches: yamt-x86pmap
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +130 -4 lines
sync with head.

Revision 1.35.10.1: download - view: text, markup, annotated - select for diffs
Wed Oct 3 19:25:52 2007 UTC (17 years, 2 months ago) by garbled
Branches: ppcoea-renovation
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +162 -39 lines
Sync with HEAD

Revision 1.35.18.2: download - view: text, markup, annotated - select for diffs
Tue Oct 2 18:27:50 2007 UTC (17 years, 2 months ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.35.18.1: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.18.1: +130 -4 lines
Sync with HEAD.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Sep 26 19:48:42 2007 UTC (17 years, 2 months ago) by ad
Branches: MAIN
CVS tags: yamt-x86pmap-base2
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +130 -4 lines
x86 changes for pcc and LKMs.

- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.

Revision 1.35.18.1: download - view: text, markup, annotated - select for diffs
Mon Sep 3 16:47:46 2007 UTC (17 years, 3 months ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +34 -37 lines
Sync with HEAD.

Revision 1.21.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:31:23 2007 UTC (17 years, 3 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.21.2.3: preferred, colored; branchpoint 1.21: preferred, colored
Changes since revision 1.21.2.3: +41 -44 lines
sync with head.

Revision 1.35.14.1: download - view: text, markup, annotated - select for diffs
Mon Sep 3 10:19:52 2007 UTC (17 years, 3 months ago) by skrll
Branches: nick-csl-alignment
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +34 -37 lines
Sync with HEAD.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Aug 29 23:38:05 2007 UTC (17 years, 3 months ago) by ad
Branches: MAIN
CVS tags: yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +34 -37 lines
Merge most x86 changes from the vmlocking branch, except the threaded soft
interrupt stuff. This is mostly comprised of changes to the pmap modules to
work on multiprocessor systems without kernel_lock, and changes to speed up
tlb shootdowns.

Revision 1.35.2.4: download - view: text, markup, annotated - select for diffs
Thu Aug 23 12:12:51 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.35.2.3: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.2.3: +5 -15 lines
- Use pmap_pte_setbits, pmap_pte_clearbits.
- Shoot down a range instead of single pages in bus_space.c.

Revision 1.35.2.3: download - view: text, markup, annotated - select for diffs
Tue Aug 21 23:58:50 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.35.2.2: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.2.2: +12 -3 lines
amd64 changes, as yet untested:

- Adapt to vmlocking branch.
- Apply TLB shootdown and pv allocation changes to the pmap.
- Make it build.

Revision 1.35.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 21 10:34:10 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.35.2.1: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.2.1: +26 -32 lines
- Update PTEs atomically. Only shoot down if the mappings were in use.
- _bus_dmamem_unmap: don't shootdown, pmap_remove() will do it for us.
- Assume that pmap_update() will wait for the TLB shootdown to complete.

Revision 1.35.2.1: download - view: text, markup, annotated - select for diffs
Sun Jul 29 10:18:51 2007 UTC (17 years, 4 months ago) by ad
Branches: vmlocking
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +13 -15 lines
- When zeroing/copying pages, use SSE2 movtni to avoid polluting the cache.
- By default, align assembly routines on 32-byte starting boundaries.
- There are now 8 interrupt priority levels, half of which are softints.
  Update intrdefs.h to match.
- Always clear/set spinlock words - removes lots of ifdefs.
- Remove the horrible ci_self150 hack that I introduced.
- Overhaul how TLB shootdown is performed. Inspired by a similar change in
  OpenBSD but implemented quite differently. This should be a lot faster
  but I have not benchmarked it yet.

Revision 1.33.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 05:51:46 2007 UTC (17 years, 9 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.33.2.1: preferred, colored; branchpoint 1.33: preferred, colored; next MAIN 1.34: preferred, colored
Changes since revision 1.33.2.1: +9 -9 lines
Sync with HEAD.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sun Mar 4 06:01:08 2007 UTC (17 years, 9 months ago) by christos
Branches: MAIN
CVS tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, nick-csl-alignment-base, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: vmlocking, ppcoea-renovation, nick-csl-alignment, matt-armv6, jmcneill-pm
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +9 -9 lines
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

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

Revision 1.21.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:08:50 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.21.2.2: preferred, colored; branchpoint 1.21: preferred, colored
Changes since revision 1.21.2.2: +49 -3 lines
sync with head.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Feb 21 20:41:27 2007 UTC (17 years, 9 months ago) by mrg
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +48 -2 lines
add a pair of new bus_dma(9) functions:
	int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.

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

Revision 1.30.2.2: download - view: text, markup, annotated - select for diffs
Tue Jan 30 13:49:39 2007 UTC (17 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.30.2.1: preferred, colored; branchpoint 1.30: preferred, colored; next MAIN 1.31: preferred, colored
Changes since revision 1.30.2.1: +3 -3 lines
Remove support for SA. Ok core@.

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

Revision 1.30.4.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:16:42 2006 UTC (18 years ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.30.4.1: preferred, colored; branchpoint 1.30: preferred, colored; next MAIN 1.31: preferred, colored
Changes since revision 1.30.4.1: +15 -15 lines
sync with head.

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

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Nov 16 01:32:39 2006 UTC (18 years ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-base-1, newlock2-nbase, newlock2-base, netbsd-4-base, 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, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Branch point for: wrstuden-fixsa, netbsd-4
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +15 -15 lines
__unused removal on arguments; approved by core.

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

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Oct 12 01:30:44 2006 UTC (18 years, 2 months ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base2
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +17 -16 lines
- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.19.2.4: download - view: text, markup, annotated - select for diffs
Sat Sep 16 11:18:59 2006 UTC (18 years, 2 months ago) by ghen
Branches: netbsd-3
CVS tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-1-RELEASE, netbsd-3-1
Diff to: previous 1.19.2.3: preferred, colored; branchpoint 1.19: preferred, colored
Changes since revision 1.19.2.3: +5 -5 lines
Pull up following revision(s) (requested by bouyer in ticket #1510):
	sys/arch/xen/x86/xen_bus_dma.c: revision 1.7
	sys/arch/xen/x86/xen_bus_dma.c: revision 1.8
	sys/arch/x86/include/bus_private.h: revision 1.6
	sys/arch/x86/x86/bus_dma.c: revision 1.30
	sys/arch/xen/include/bus_private.h: revision 1.7
Some bus_dma(9) fixes for Xen:
- Attempt to gracefully recover from a failed decrease_reservation or
  increase_reservation, by avoiding physical memory loss.
- always store a machine address in ds_addr; this avoids some mistakes
  where machine address would in some case be freed at physical address, or
  mapped as physical address.
Wrap some printfs in #ifdef DEBUG, as we should not leak memory any more when
bus_dma memory allocation fails.

Revision 1.29.12.1: download - view: text, markup, annotated - select for diffs
Thu Sep 14 04:43:08 2006 UTC (18 years, 3 months ago) by riz
Branches: abandoned-netbsd-4
Diff to: previous 1.29: preferred, colored; next MAIN 1.30: preferred, colored
Changes since revision 1.29: +5 -5 lines
Pull up following revision(s) (requested by bouyer in ticket #150):
	sys/arch/xen/x86/xen_bus_dma.c: revision 1.7
	sys/arch/xen/x86/xen_bus_dma.c: revision 1.8
	sys/arch/x86/include/bus_private.h: revision 1.6
	sys/arch/x86/x86/bus_dma.c: revision 1.30
	sys/arch/xen/include/bus_private.h: revision 1.7
Some bus_dma(9) fixes for Xen:
- Attempt to gracefully recover from a failed decrease_reservation or
  increase_reservation, by avoiding physical memory loss.
- always store a machine address in ds_addr; this avoids some mistakes
  where machine address would in some case be freed at physical address, or
  mapped as physical address.
Wrap some printfs in #ifdef DEBUG, as we should not leak memory any more when
bus_dma memory allocation fails.

Revision 1.28.2.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:44:49 2006 UTC (18 years, 3 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28: +32 -48 lines
sync with head

Revision 1.29.2.1: download - view: text, markup, annotated - select for diffs
Sun Sep 3 15:23:37 2006 UTC (18 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.29: preferred, colored; next MAIN 1.30: preferred, colored
Changes since revision 1.29: +5 -5 lines
sync with head.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Mon Aug 28 19:58:57 2006 UTC (18 years, 3 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +5 -5 lines
Some bus_dma(9) fixes for Xen:
- Attempt to gracefully recover from a failed decrease_reservation or
  increase_reservation, by avoiding physical memory loss.
- always store a machine address in ds_addr; this avoids some mistakes
  where machine address would in some case be freed at physical address, or
  mapped as physical address.

Revision 1.21.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 14:58:06 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +122 -122 lines
sync with head.

Revision 1.28.4.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:38:09 2006 UTC (18 years, 7 months ago) by simonb
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28: +29 -45 lines
Sync with head.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Wed Mar 1 12:38:12 2006 UTC (18 years, 9 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, simonb-timecounters-base, peter-altq-base, peter-altq, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, elad-kernelauth, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base
Branch point for: yamt-pdpolicy, abandoned-netbsd-4
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +29 -45 lines
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.

Revision 1.27.2.2: download - view: text, markup, annotated - select for diffs
Tue Feb 7 10:19:33 2006 UTC (18 years, 10 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.27.2.1: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27.2.1: +29 -45 lines
adapt x86 bus_dma.

Revision 1.27.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 15 10:02:39 2006 UTC (18 years, 10 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3 lines
sync with head.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sat Jan 14 23:49:59 2006 UTC (18 years, 11 months ago) by christos
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3 lines
Protect against uio_lwp being NULL from Pavel Cahyna

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Dec 24 20:07:42 2005 UTC (18 years, 11 months ago) by perry
Branches: MAIN
Branch point for: yamt-uio_vmspace
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -4 lines
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:19:47 2005 UTC (19 years ago) by christos
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +4 -4 lines
merge ktrace-lwp.

Revision 1.6.2.8: download - view: text, markup, annotated - select for diffs
Sun Dec 11 10:28:39 2005 UTC (19 years ago) by christos
Branches: ktrace-lwp
Diff to: previous 1.6.2.7: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.2.7: +5 -3 lines
Sync with head.

Revision 1.24.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 29 21:23:04 2005 UTC (19 years ago) by yamt
Branches: yamt-readahead
Diff to: previous 1.24: preferred, colored; next MAIN 1.25: preferred, colored
Changes since revision 1.24: +5 -3 lines
sync with head.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Nov 24 13:08:34 2005 UTC (19 years ago) by yamt
Branches: MAIN
CVS tags: yamt-readahead-base3, ktrace-lwp-base
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +5 -3 lines
bus_dmamem_map: honour BUS_DMA_NOWAIT.  noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!

Revision 1.6.2.7: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:00:20 2005 UTC (19 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.6.2.6: preferred, colored
Changes since revision 1.6.2.6: +114 -97 lines
Sync with HEAD. Here we go again...

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue Sep 20 04:48:10 2005 UTC (19 years, 2 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base2, yamt-readahead-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-readahead
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +23 -13 lines
Turn bounce buffer stats into evcnts and enable them by default.

Revision 1.19.2.3: download - view: text, markup, annotated - select for diffs
Thu Aug 25 20:57:24 2005 UTC (19 years, 3 months ago) by tron
Branches: netbsd-3
CVS tags: netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Diff to: previous 1.19.2.2: preferred, colored; branchpoint 1.19: preferred, colored
Changes since revision 1.19.2.2: +6 -6 lines
Pull up following revision(s) (requested by bouyer in ticket #697):
	sys/arch/x86/x86/bus_dma.c: revision 1.23
	sys/arch/x86/include/bus_private.h: revision 1.3
	sys/arch/xen/include/bus_private.h: revision 1.3
Rename _PRIVATE_BUS_DMAMEM_ALLOC_RANGE to _BUS_DMAMEM_ALLOC_RANGE for
consistency with other macros defined in bus_private.h. Pointed out by
YAMAMOTO Takashi.

Revision 1.19.2.2: download - view: text, markup, annotated - select for diffs
Thu Aug 25 20:20:08 2005 UTC (19 years, 3 months ago) by tron
Branches: netbsd-3
Diff to: previous 1.19.2.1: preferred, colored; branchpoint 1.19: preferred, colored
Changes since revision 1.19.2.1: +67 -63 lines
Pull up following revision(s) (requested by bouyer in ticket #695):
	sys/arch/x86/x86/bus_dma.c: revision 1.22
	sys/arch/x86/include/bus_private.h: revision 1.2
More adjustements to deal with Xen's physical <=> machine addresses mappings:
- Allow _bus_dmamem_alloc_range to be provided from external source:
  Use a _PRIVATE_BUS_DMAMEM_ALLOC_RANGE macro, defined to
  _bus_dmamem_alloc_range by default.
- avail_end is the end of the physical address range. Define a macro
 _BUS_AVAIL_END (defined by default to avail_end) and use it instead.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Aug 22 11:09:39 2005 UTC (19 years, 3 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +6 -6 lines
Rename _PRIVATE_BUS_DMAMEM_ALLOC_RANGE to _BUS_DMAMEM_ALLOC_RANGE for
consistency with other macros defined in bus_private.h. Pointed out by
YAMAMOTO Takashi.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Aug 20 19:18:11 2005 UTC (19 years, 3 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +69 -65 lines
More adjustements to deal with Xen's physical <=> machine addresses mappings:
- Allow _bus_dmamem_alloc_range to be provided from external source:
  Use a _PRIVATE_BUS_DMAMEM_ALLOC_RANGE macro, defined to
  _bus_dmamem_alloc_range by default.
- avail_end is the end of the physical address range. Define a macro
 _BUS_AVAIL_END (defined by default to avail_end) and use it instead.

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

Revision 1.19.2.1: download - view: text, markup, annotated - select for diffs
Thu Apr 21 18:41:18 2005 UTC (19 years, 7 months ago) by tron
Branches: netbsd-3
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +26 -23 lines
Pull up revision 1.21 (requested by yamt in ticket #175):
tweak x86 bus_dma code so that it can be used by xen port.
- distinguish paddr_t and bus_addr_t.
  for xen, use bus_addr_t in the sense of machine address.
- move _X86_BUS_DMA_PRIVATE part of bus.h into bus_private.h.
- remove special handling of xen_shm.  we can always grab
  machine address from pte.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sat Apr 16 07:53:35 2005 UTC (19 years, 8 months ago) by yamt
Branches: MAIN
CVS tags: kent-audio2-base
Branch point for: yamt-lazymbuf
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +24 -21 lines
tweak x86 bus_dma code so that it can be used by xen port.

- distinguish paddr_t and bus_addr_t.
  for xen, use bus_addr_t in the sense of machine address.
- move _X86_BUS_DMA_PRIVATE part of bus.h into bus_private.h.
- remove special handling of xen_shm.  we can always grab
  machine address from pte.

Revision 1.6.2.6: download - view: text, markup, annotated - select for diffs
Fri Apr 1 14:28:58 2005 UTC (19 years, 8 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.6.2.5: preferred, colored
Changes since revision 1.6.2.5: +13 -6 lines
Sync with HEAD.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Apr 1 11:59:36 2005 UTC (19 years, 8 months ago) by yamt
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +6 -4 lines
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.

Revision 1.17.6.2: download - view: text, markup, annotated - select for diffs
Sat Mar 19 08:33:21 2005 UTC (19 years, 8 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.17.6.1: preferred, colored; branchpoint 1.17: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17.6.1: +10 -8 lines
sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Mar 9 19:04:46 2005 UTC (19 years, 9 months ago) by matt
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +9 -4 lines
Add a dm_maxsegsz public member to bus_dmamap_t.  This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create).  dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.

Revision 1.6.2.5: download - view: text, markup, annotated - select for diffs
Fri Mar 4 16:39:14 2005 UTC (19 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.6.2.4: preferred, colored
Changes since revision 1.6.2.4: +3 -6 lines
Sync with HEAD.

Hi Perry!

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Feb 19 21:40:21 2005 UTC (19 years, 9 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -6 lines
g/c obsolete comment for _bus_dmamap_load_buffer()

Revision 1.17.6.1: download - view: text, markup, annotated - select for diffs
Tue Jan 25 13:01:08 2005 UTC (19 years, 10 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +6 -4 lines
- convert i386 to new apis.
- remove a pmap bootstrap kludge, which is no longer needed.

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

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

Revision 1.6.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:43:05 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.6.2.1: preferred, colored
Changes since revision 1.6.2.1: +201 -229 lines
Sync with HEAD

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Jun 20 18:04:08 2004 UTC (20 years, 5 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +34 -34 lines
Remove the "ID" component of the x86 bus_dma flags, since these are no
longer "ISA DMA" specific flags.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Jun 12 17:22:04 2004 UTC (20 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -4 lines
remove XXX comments which are no longer true.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Jun 12 17:18:13 2004 UTC (20 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +34 -104 lines
ANSIfy.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Jun 12 17:16:44 2004 UTC (20 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +34 -57 lines
simplify x86 bus_dma implementation.
(rather than passing &lastaddr and &seg around,
use and update bus_dmamap_t directly.)

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Jun 12 17:14:55 2004 UTC (20 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +119 -46 lines
- introduce _bus_dmamap_load_paddr, which takes (paddr, size) and
  add the range to the map, and use it for _bus_dmamap_load_{buffer,mbuf}.
- _bus_dmamap_load_mbuf: in the case of M_EXT_PAGES, deal with vm_pages
  directly rather than doing pmap_extract on given kva.

as a side effect, do a segment coalescing and boundary checks for mbufs.

ok'ed by Frank van der Linden and Jason Thorpe on tech-kern@.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Jun 12 17:10:04 2004 UTC (20 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +24 -35 lines
simplify x86 bus_dma internal "load" functions.
(by eliminating a variable "first" and using seg == -1 instead.)

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sat Jun 5 07:31:31 2004 UTC (20 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +12 -5 lines
unexport following x86 bus_dma internal functions.
        _bus_dma_alloc_bouncebuf
        _bus_dma_free_bouncebuf
        _bus_dmamap_load_buffer

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue May 11 11:31:34 2004 UTC (20 years, 7 months ago) by yamt
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +5 -2 lines
_bus_dmamap_load_mbuf: check bounce_thresh in the case when we have paddr hint.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Oct 28 22:49:51 2003 UTC (21 years, 1 month ago) by mycroft
Branches: MAIN
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -5 lines
In _bus_dma_uiomove():
* Don't punt after the first iov in the UIO_SYSSPACE case.  Not that this ever
  happens in practice right now.
* If we get through the loop, error==0 by definition, so just return 0.
* Eliminate bogus initializer.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Oct 25 18:39:40 2003 UTC (21 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -3 lines
Fix uninitialized variable warning

Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu Aug 7 16:30:34 2003 UTC (21 years, 4 months ago) by agc
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +3 -7 lines
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.6.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 2 15:25:36 2003 UTC (21 years, 5 months ago) by darrenr
Branches: ktrace-lwp
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +4 -4 lines
Apply the aborted ktrace-lwp changes to a specific branch.  This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it.  This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Jun 29 22:29:09 2003 UTC (21 years, 5 months ago) by fvdl
Branches: MAIN
Branch point for: ktrace-lwp
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +2 -2 lines
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Jun 28 14:21:13 2003 UTC (21 years, 5 months ago) by darrenr
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +4 -4 lines
Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Jun 11 21:36:49 2003 UTC (21 years, 6 months ago) by fvdl
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +7 -7 lines
Avoid bad free() calls for failed allocations. From enami.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed May 7 21:33:58 2003 UTC (21 years, 7 months ago) by fvdl
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +552 -43 lines
Generalize bounce buffers, and use them for 32 bit PCI if needed.
Make ALLOCNOW the default iff bouncing might be needed (this has
no effect on i386 because ISA DMA devices already had to use
ALLOCNOW, and PCI isn't bounced (yet), since we don't do > 4G
at this point for i386.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed Apr 9 18:51:36 2003 UTC (21 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +32 -4 lines
Use cached physical addresses for mbufs and clusters to save having
to extract the physical address from the virtual.

On the ARM, also use the "read-only at MMU" indication to avoid a
redundant cache clean operation.

Other platforms should use these two as examples of how to use these
new pool/mbuf features to improve network performance.  Note this requires
a platform to provide a working POOL_VTOPHYS().

Part 3 in a series of simple patches contributed by Wasabi Systems
to improve network performance.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Mar 12 00:09:52 2003 UTC (21 years, 9 months ago) by thorpej
Branches: MAIN
Split bus_space and bus_dma into separate files.

Diff request

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

Log view options

CVSweb <webmaster@jp.NetBSD.org>