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


Default branch: MAIN
Current tag: MAIN


Revision 1.90 / (download) - annotate - [select for diffs], Tue Mar 28 19:55:42 2023 UTC (11 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: triaxx-drm, thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.89: +29 -13 lines
Diff to previous 1.89 (colored)

x86/bus_dma.c: Sprinkle KASSERTMSG.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Aug 20 23:48:51 2022 UTC (18 months, 4 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.88: +3 -2 lines
Diff to previous 1.88 (colored)

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) - annotate - [select for diffs], Sat Aug 13 06:59:56 2022 UTC (19 months ago) by skrll
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored)

Fix an inverted KASSERTMSG test from the #ifdef DIAGNOSTIC panic -> KASSERT
conversion.

Revision 1.87 / (download) - annotate - [select for diffs], Fri Aug 12 15:01:26 2022 UTC (19 months ago) by riastradh
Branch: MAIN
Changes since 1.86: +24 -44 lines
Diff to previous 1.86 (colored)

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) - annotate - [select for diffs], Fri Aug 12 13:44:12 2022 UTC (19 months ago) by riastradh
Branch: MAIN
Changes since 1.85: +60 -21 lines
Diff to previous 1.85 (colored)

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) - annotate - [select for diffs], Wed Jul 13 00:12:20 2022 UTC (20 months ago) by riastradh
Branch: MAIN
Changes since 1.84: +12 -5 lines
Diff to previous 1.84 (colored)

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) - annotate - [select for diffs], Sat Jan 22 15:10:32 2022 UTC (2 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.83: +8 -8 lines
Diff to previous 1.83 (colored)

Ensure bus_dmatag_subregion is called with an inclusive max_addr
everywhere.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Oct 7 12:52:27 2021 UTC (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.82: +6 -6 lines
Diff to previous 1.82 (colored)

KNF. No functional change.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Mar 14 18:08:38 2020 UTC (4 years ago) by ad
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-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
Changes since 1.81: +5 -7 lines
Diff to previous 1.81 (colored)

- 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) - annotate - [select for diffs], Thu Nov 14 16:23:52 2019 UTC (4 years, 4 months ago) by maxv
Branch: 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
Changes since 1.80: +8 -2 lines
Diff to previous 1.80 (colored)

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) - annotate - [select for diffs], Fri Oct 4 06:27:42 2019 UTC (4 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.79: +13 -2 lines
Diff to previous 1.79 (colored)

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) - annotate - [select for diffs], Fri Jun 14 03:35:31 2019 UTC (4 years, 9 months ago) by mrg
Branch: MAIN
CVS Tags: netbsd-9-base, 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
Changes since 1.78: +4 -3 lines
Diff to previous 1.78 (colored)

KASSERT() -> KASSERTMSG() message in _bus_dmamem_alloc_range().

Revision 1.78 / (download) - annotate - [select for diffs], Sun Apr 21 06:37:21 2019 UTC (4 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.77: +4 -4 lines
Diff to previous 1.77 (colored)

Rename the PTE bits.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Jul 31 19:29:19 2017 UTC (6 years, 7 months ago) by jdolecek
Branch: 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
Changes since 1.76: +3 -4 lines
Diff to previous 1.76 (colored)

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) - annotate - [select for diffs], Thu Jun 1 02:45:08 2017 UTC (6 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, 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
Changes since 1.75: +2 -6 lines
Diff to previous 1.75 (colored)

remove checks for failure after memory allocation calls that cannot fail:

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

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

Revision 1.75 / (download) - annotate - [select for diffs], Thu Jan 5 09:08:44 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: 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
Changes since 1.74: +7 -5 lines
Diff to previous 1.74 (colored)

Update the dmamp argument only when the allocation succeeded.

Revision 1.74 / (download) - annotate - [select for diffs], Tue Oct 27 18:49:26 2015 UTC (8 years, 4 months ago) by christos
Branch: 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
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored)

fix operator precedence.

Revision 1.73 / (download) - annotate - [select for diffs], Tue Oct 27 18:19:05 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.72: +4 -3 lines
Diff to previous 1.72 (colored)

make sure we have a cookie before we try to clear it.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Oct 27 15:53:58 2015 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.71: +19 -18 lines
Diff to previous 1.71 (colored)

- 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.71 / (download) - annotate - [select for diffs], Tue Dec 24 15:42:56 2013 UTC (10 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base-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
Changes since 1.70: +5 -5 lines
Diff to previous 1.70 (colored)

use __func__

Revision 1.70 / (download) - annotate - [select for diffs], Tue Jul 2 22:39:45 2013 UTC (10 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.69: +7 -4 lines
Diff to previous 1.69 (colored)

make a diagnostic message more informative.

Revision 1.69 / (download) - annotate - [select for diffs], Sat Dec 8 12:36:31 2012 UTC (11 years, 3 months ago) by kiyohara
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.68: +10 -2 lines
Diff to previous 1.68 (colored)

#ifdef - #endif-ed. NMCA, NISA, NNPX, NIOAPIC, LAPIC, MPBIOS and MULTIPROCESSOR.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Oct 14 18:28:04 2011 UTC (12 years, 5 months ago) by bouyer
Branch: 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
Changes since 1.67: +4 -3 lines
Diff to previous 1.67 (colored)

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) - annotate - [select for diffs], Wed Sep 28 01:45:49 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.66: +6 -8 lines
Diff to previous 1.66 (colored)

Cosmetic: join some if-statements, remove superfluous parentheses.  No
change in the generated assembly.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Sep 28 01:38:19 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.65: +5 -5 lines
Diff to previous 1.65 (colored)

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) - annotate - [select for diffs], Wed Sep 28 01:35:58 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.64: +10 -2 lines
Diff to previous 1.64 (colored)

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) - annotate - [select for diffs], Wed Sep 28 01:33:26 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.63: +38 -5 lines
Diff to previous 1.63 (colored)

Add an untested implementation of bus_dmamap_load_raw(9).

Revision 1.63 / (download) - annotate - [select for diffs], Tue Sep 27 23:44:18 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.62: +4 -4 lines
Diff to previous 1.62 (colored)

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) - annotate - [select for diffs], Tue Sep 27 23:33:35 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored)

In _bus_dmamap_load_busaddr(), change sgsize from an int to a bus_size_t.

Revision 1.61 / (download) - annotate - [select for diffs], Tue Sep 27 23:25:55 2011 UTC (12 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.60: +4 -4 lines
Diff to previous 1.60 (colored)

Make the 'size' argument of _bus_dmamap_load_busaddr() a bus_size_t for
consistency's sake.

Revision 1.60 / (download) - annotate - [select for diffs], Tue Sep 13 17:59:46 2011 UTC (12 years, 6 months ago) by dyoung
Branch: MAIN
Changes since 1.59: +4 -4 lines
Diff to previous 1.59 (colored)

For consistency, call a bus_dma_tag_t bdt instead of bst.  No functional
change intended.

Revision 1.59 / (download) - annotate - [select for diffs], Thu Sep 1 15:10:31 2011 UTC (12 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.58: +321 -50 lines
Diff to previous 1.58 (colored)

Add bus_dma overrides. From dyoung

Revision 1.58 / (download) - annotate - [select for diffs], Mon Jul 25 20:33:20 2011 UTC (12 years, 7 months ago) by dyoung
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.57: +3 -4 lines
Diff to previous 1.57 (colored)

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) - annotate - [select for diffs], Fri Jul 1 18:21:31 2011 UTC (12 years, 8 months ago) by dyoung
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

#include <sys/bus.h> instead of <machine/bus.h>.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Nov 6 11:46:03 2010 UTC (13 years, 4 months ago) by uebayasi
Branch: 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
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored)

Machine dependent code is considered as part of UVM.  Include
internal API header.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Sep 24 20:55:19 2010 UTC (13 years, 5 months ago) by jakllsch
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored)

fix copy/paste/modify error in a diagnostic panic message

Revision 1.54 / (download) - annotate - [select for diffs], Mon Mar 22 22:03:30 2010 UTC (14 years ago) by bouyer
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10, uebayasi-xip-base2, uebayasi-xip-base1
Changes since 1.53: +23 -6 lines
Diff to previous 1.53 (colored)

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.53 / (download) - annotate - [select for diffs], Fri Feb 26 19:25:07 2010 UTC (14 years ago) by jym
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

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) - annotate - [select for diffs], Fri Nov 6 23:10:10 2009 UTC (14 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip
Changes since 1.51: +8 -5 lines
Diff to previous 1.51 (colored)

Don't call _bus_dmamem_free() when _bus_dmamem_alloc() fails.
Fixes PR/42208

Revision 1.51 / (download) - annotate - [select for diffs], Tue Apr 21 21:30:01 2009 UTC (14 years, 11 months ago) by cegger
Branch: 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
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@

Revision 1.50 / (download) - annotate - [select for diffs], Sat Apr 18 08:51:45 2009 UTC (14 years, 11 months ago) by cegger
Branch: MAIN
Changes since 1.49: +9 -30 lines
Diff to previous 1.49 (colored)

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) - annotate - [select for diffs], Sat Mar 14 14:46:08 2009 UTC (15 years ago) by dsl
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

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) - annotate - [select for diffs], Fri Feb 20 05:54:40 2009 UTC (15 years, 1 month ago) by cegger
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Changes since 1.47: +1 -3 lines
Diff to previous 1.47 (colored)

backout rev. 1.47.
per request from dyoung@ and cube@

Revision 1.47 / (download) - annotate - [select for diffs], Thu Feb 19 23:34:14 2009 UTC (15 years, 1 month ago) by cegger
Branch: MAIN
Changes since 1.46: +5 -3 lines
Diff to previous 1.46 (colored)

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.46 / (download) - annotate - [select for diffs], Sat Nov 15 10:47:53 2008 UTC (15 years, 4 months ago) by skrll
Branch: MAIN
CVS Tags: mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

Typo in comment.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Jun 28 17:23:01 2008 UTC (15 years, 8 months ago) by bouyer
Branch: 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
Changes since 1.44: +18 -3 lines
Diff to previous 1.44 (colored)

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.44 / (download) - annotate - [select for diffs], Fri Jun 13 09:53:46 2008 UTC (15 years, 9 months ago) by bjs
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

"functin" -> "function" (no "functional" change, har har)

Revision 1.43 / (download) - annotate - [select for diffs], Wed Jun 4 12:41:42 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
Branch point for: simonb-wapbl
Changes since 1.42: +6 -6 lines
Diff to previous 1.42 (colored)

vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Apr 28 20:23:40 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Changes since 1.41: +2 -9 lines
Diff to previous 1.41 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.41 / (download) - annotate - [select for diffs], Sun Apr 27 11:37:48 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.40: +4 -4 lines
Diff to previous 1.40 (colored)

- 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.40 / (download) - annotate - [select for diffs], Wed Nov 28 16:44:46 2007 UTC (16 years, 3 months ago) by ad
Branch: 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
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

Remove remaining CPUCLASS_386 tests.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Oct 17 19:58:16 2007 UTC (16 years, 5 months ago) by garbled
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: mjf-devfs
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Merge the ppcoea-renovation branch to HEAD.

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

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

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

Revision 1.38 / (download) - annotate - [select for diffs], Fri Oct 12 13:38:08 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base3, vmlocking-base, ppcoea-renovation-base
Branch point for: bouyer-xenamd64
Changes since 1.37: +2 -6 lines
Diff to previous 1.37 (colored)

crit_enter/crit_exit are now available.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Sep 26 19:48:42 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base2
Changes since 1.36: +130 -4 lines
Diff to previous 1.36 (colored)

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.36 / (download) - annotate - [select for diffs], Wed Aug 29 23:38:05 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Changes since 1.35: +34 -37 lines
Diff to previous 1.35 (colored)

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 / (download) - annotate - [select for diffs], Sun Mar 4 06:01:08 2007 UTC (17 years ago) by christos
Branch: 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
Changes since 1.34: +9 -9 lines
Diff to previous 1.34 (colored)

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

Revision 1.34 / (download) - annotate - [select for diffs], Wed Feb 21 20:41:27 2007 UTC (17 years ago) by mrg
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.33: +48 -2 lines
Diff to previous 1.33 (colored)

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

Merge newlock2 to head.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Nov 16 01:32:39 2006 UTC (17 years, 4 months ago) by christos
Branch: 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
Changes since 1.31: +15 -15 lines
Diff to previous 1.31 (colored)

__unused removal on arguments; approved by core.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Oct 12 01:30:44 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.30: +17 -16 lines
Diff to previous 1.30 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.30 / (download) - annotate - [select for diffs], Mon Aug 28 19:58:57 2006 UTC (17 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.29: +5 -5 lines
Diff to previous 1.29 (colored)

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.29 / (download) - annotate - [select for diffs], Wed Mar 1 12:38:12 2006 UTC (18 years ago) by yamt
Branch: 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
Changes since 1.28: +29 -45 lines
Diff to previous 1.28 (colored)

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.28 / (download) - annotate - [select for diffs], Sat Jan 14 23:49:59 2006 UTC (18 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

Protect against uio_lwp being NULL from Pavel Cahyna

Revision 1.27 / (download) - annotate - [select for diffs], Sat Dec 24 20:07:42 2005 UTC (18 years, 2 months ago) by perry
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Dec 11 12:19:47 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

merge ktrace-lwp.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 24 13:08:34 2005 UTC (18 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-readahead-base3, ktrace-lwp-base
Changes since 1.24: +5 -3 lines
Diff to previous 1.24 (colored)

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.24 / (download) - annotate - [select for diffs], Tue Sep 20 04:48:10 2005 UTC (18 years, 6 months ago) by thorpej
Branch: 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
Changes since 1.23: +23 -13 lines
Diff to previous 1.23 (colored)

Turn bounce buffer stats into evcnts and enable them by default.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 22 11:09:39 2005 UTC (18 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.22: +6 -6 lines
Diff to previous 1.22 (colored)

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) - annotate - [select for diffs], Sat Aug 20 19:18:11 2005 UTC (18 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.21: +69 -65 lines
Diff to previous 1.21 (colored)

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.21 / (download) - annotate - [select for diffs], Sat Apr 16 07:53:35 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Branch point for: yamt-lazymbuf
Changes since 1.20: +24 -21 lines
Diff to previous 1.20 (colored)

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.20 / (download) - annotate - [select for diffs], Fri Apr 1 11:59:36 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.19: +6 -4 lines
Diff to previous 1.19 (colored)

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.19 / (download) - annotate - [select for diffs], Wed Mar 9 19:04:46 2005 UTC (19 years ago) by matt
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.18: +9 -4 lines
Diff to previous 1.18 (colored)

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.18 / (download) - annotate - [select for diffs], Sat Feb 19 21:40:21 2005 UTC (19 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.17: +3 -6 lines
Diff to previous 1.17 (colored)

g/c obsolete comment for _bus_dmamap_load_buffer()

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jun 20 18:04:08 2004 UTC (19 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.16: +34 -34 lines
Diff to previous 1.16 (colored)

Remove the "ID" component of the x86 bus_dma flags, since these are no
longer "ISA DMA" specific flags.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Jun 12 17:22:04 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.15: +2 -4 lines
Diff to previous 1.15 (colored)

remove XXX comments which are no longer true.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jun 12 17:18:13 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.14: +34 -104 lines
Diff to previous 1.14 (colored)

ANSIfy.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 12 17:16:44 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.13: +34 -57 lines
Diff to previous 1.13 (colored)

simplify x86 bus_dma implementation.
(rather than passing &lastaddr and &seg around,
use and update bus_dmamap_t directly.)

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 12 17:14:55 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.12: +119 -46 lines
Diff to previous 1.12 (colored)

- 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) - annotate - [select for diffs], Sat Jun 12 17:10:04 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.11: +24 -35 lines
Diff to previous 1.11 (colored)

simplify x86 bus_dma internal "load" functions.
(by eliminating a variable "first" and using seg == -1 instead.)

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jun 5 07:31:31 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.10: +12 -5 lines
Diff to previous 1.10 (colored)

unexport following x86 bus_dma internal functions.
        _bus_dma_alloc_bouncebuf
        _bus_dma_free_bouncebuf
        _bus_dmamap_load_buffer

Revision 1.10 / (download) - annotate - [select for diffs], Tue May 11 11:31:34 2004 UTC (19 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.9: +5 -2 lines
Diff to previous 1.9 (colored)

_bus_dmamap_load_mbuf: check bounce_thresh in the case when we have paddr hint.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Oct 28 22:49:51 2003 UTC (20 years, 4 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.8: +4 -5 lines
Diff to previous 1.8 (colored)

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) - annotate - [select for diffs], Sat Oct 25 18:39:40 2003 UTC (20 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Fix uninitialized variable warning

Revision 1.7 / (download) - annotate - [select for diffs], Thu Aug 7 16:30:34 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.6: +3 -7 lines
Diff to previous 1.6 (colored)

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 / (download) - annotate - [select for diffs], Sun Jun 29 22:29:09 2003 UTC (20 years, 8 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

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) - annotate - [select for diffs], Sat Jun 28 14:21:13 2003 UTC (20 years, 8 months ago) by darrenr
Branch: MAIN
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

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) - annotate - [select for diffs], Wed Jun 11 21:36:49 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Changes since 1.3: +7 -7 lines
Diff to previous 1.3 (colored)

Avoid bad free() calls for failed allocations. From enami.

Revision 1.3 / (download) - annotate - [select for diffs], Wed May 7 21:33:58 2003 UTC (20 years, 10 months ago) by fvdl
Branch: MAIN
Changes since 1.2: +552 -43 lines
Diff to previous 1.2 (colored)

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) - annotate - [select for diffs], Wed Apr 9 18:51:36 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.1: +32 -4 lines
Diff to previous 1.1 (colored)

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) - annotate - [select for diffs], Wed Mar 12 00:09:52 2003 UTC (21 years ago) by thorpej
Branch: MAIN

Split bus_space and bus_dma into separate files.

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




CVSweb <webmaster@jp.NetBSD.org>