| History log of /src/sys/dev/dtv |
| Revision | Date | Author | Comments |
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.9 | 03-Sep-2018 |
riastradh | Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation.
To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
|
| 1.8 | 01-Jun-2017 |
chs | branches: 1.8.8; 1.8.10; 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.
|
| 1.7 | 09-Aug-2011 |
jmcneill | branches: 1.7.12; 1.7.30; modify the dtv device api so hardware drivers can be loaded independently of the dtv module
|
| 1.6 | 16-Jul-2011 |
jmcneill | Fix a locking problem with the demux, and while here do a bit of housekeeping and documentation.
|
| 1.5 | 13-Jul-2011 |
jmcneill | add section filter support
|
| 1.4 | 12-Jul-2011 |
jmcneill | - use separate locks for ingress and egress queues - increase ts block and buffer sizes
|
| 1.3 | 09-Jul-2011 |
jmcneill | use %zu to print size_t
|
| 1.2 | 09-Jul-2011 |
jmcneill | don't kmem_alloc with IPL_VM mutex locked, spotted by rmind
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.7.30.1 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.7.12.1 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.8.10.1 | 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.8.8.1 | 06-Sep-2018 |
pgoyette | Sync with HEAD
Resolve a couple of conflicts (result of the uimin/uimax changes)
|
| 1.11 | 30-May-2020 |
jdolecek | allocate memory for dtv_ts_section using kmem_alloc() in dtv_demux_read(), instead of on-stack
XXX compile-tested only
|
| 1.10 | 24-Feb-2019 |
jmcneill | Pass 0xff instead of true to memset when setting "all PIDs" mode in the PID filter
|
| 1.9 | 03-Sep-2018 |
riastradh | Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation.
To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
|
| 1.8 | 30-Nov-2017 |
christos | branches: 1.8.2; 1.8.4; add fo_name so we can identify the fileops in a simple way.
|
| 1.7 | 01-Jun-2017 |
chs | 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.
|
| 1.6 | 09-Aug-2014 |
jmcneill | branches: 1.6.4; IPL_VM -> IPL_SCHED to avoid taking kernel lock
|
| 1.5 | 17-Oct-2013 |
christos | remove unused variable
|
| 1.4 | 16-Jul-2011 |
jmcneill | branches: 1.4.2; 1.4.12; 1.4.16; Fix a locking problem with the demux, and while here do a bit of housekeeping and documentation.
|
| 1.3 | 14-Jul-2011 |
jmcneill | sections can't be > 4KB
|
| 1.2 | 13-Jul-2011 |
jmcneill | dtv_demux_write: make sure to unlock muted in all error paths
|
| 1.1 | 13-Jul-2011 |
jmcneill | add section filter support
|
| 1.4.16.1 | 18-May-2014 |
rmind | sync with head
|
| 1.4.12.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.4.12.1 | 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
| 1.4.2.1 | 22-May-2014 |
yamt | 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")
|
| 1.6.4.1 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.8.4.1 | 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.8.2.1 | 06-Sep-2018 |
pgoyette | Sync with HEAD
Resolve a couple of conflicts (result of the uimin/uimax changes)
|
| 1.14 | 31-Mar-2022 |
pgoyette | For device modules that provide both auto-config and /dev/xxx interfaces, make sure that initialization and destruction follow the proper sequence. This is triggered by the recent changes to the devsw stuff; per riastradh@ the required call sequence is:
devsw_attach() config_init_component() or config_cf*_attach() ... config_fini_component() or config_cf*_detach() devsw_detach()
While here, add a few missing calls to some of the detach routines.
Testing of these changes has been limited to: 1. compile without build break 2. no related test failures from atf 3. modload/modunload work as well as before.
No functional device testing done, since I don't have any of these devices. Let me know of any damage I might cause here!
XXX Some of the modules affected by this commit are already XXX broken; see kern/56772. This commit does not break any additional modules (as far as I know).
|
| 1.13 | 24-Jul-2021 |
skrll | #include <sys/param.h> for COHERENCY_UNIT and some KNF while I'm here.
|
| 1.12 | 28-Oct-2017 |
riastradh | branches: 1.12.22; Kill some more extern struct cfdriver declarations.
Down with externs in .c!
|
| 1.11 | 09-Aug-2014 |
jmcneill | IPL_VM -> IPL_SCHED to avoid taking kernel lock
|
| 1.10 | 25-Jul-2014 |
dholland | Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
|
| 1.9 | 16-Mar-2014 |
dholland | branches: 1.9.2; Change (mostly mechanically) every cdevsw/bdevsw I can find to use designated initializers.
I have not built every extant kernel so I have probably broken at least one build; however I've also found and fixed some wrong cdevsw/bdevsw entries so even if so I think we come out ahead.
|
| 1.8 | 09-Aug-2011 |
jmcneill | branches: 1.8.2; 1.8.12; 1.8.16; modify the dtv device api so hardware drivers can be loaded independently of the dtv module
|
| 1.7 | 16-Jul-2011 |
jmcneill | Fix a locking problem with the demux, and while here do a bit of housekeeping and documentation.
|
| 1.6 | 13-Jul-2011 |
jmcneill | add missing mutex_destroy on detach
|
| 1.5 | 13-Jul-2011 |
jmcneill | add section filter support
|
| 1.4 | 12-Jul-2011 |
jmcneill | - use separate locks for ingress and egress queues - increase ts block and buffer sizes
|
| 1.3 | 09-Jul-2011 |
jmcneill | allow this to be compiled into the kernel
|
| 1.2 | 09-Jul-2011 |
jmcneill | don't kmem_alloc with IPL_VM mutex locked, spotted by rmind
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.8.16.1 | 18-May-2014 |
rmind | sync with head
|
| 1.8.12.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.8.12.1 | 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
| 1.8.2.1 | 22-May-2014 |
yamt | 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")
|
| 1.9.2.1 | 10-Aug-2014 |
tls | Rebase.
|
| 1.12.22.1 | 01-Aug-2021 |
thorpej | Sync with HEAD.
|
| 1.3 | 13-Jul-2011 |
jmcneill | add section filter support
|
| 1.2 | 09-Jul-2011 |
jmcneill | don't kmem_alloc with IPL_VM mutex locked, spotted by rmind
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.5 | 09-Aug-2011 |
jmcneill | modify the dtv device api so hardware drivers can be loaded independently of the dtv module
|
| 1.4 | 16-Jul-2011 |
apb | Reinstate #include <dev/dtv/dtvif.h> which was incorrectly removed in the previous commit.
|
| 1.3 | 16-Jul-2011 |
apb | Instead of returning an integer between 0 and 31 (scaled by 1<<24), use (0.5 + x/2 - 1/x) as an approximation to log2(x) for x from 1 to 2, and scale the input to fit this range. Now the error is always less than 0.2%.
Also add an test program, hidden behind #ifdef TEST_DTV_MATH, to print a table of expected and actual results, and the errors.
|
| 1.2 | 16-Jul-2011 |
jmcneill | add sys/types.h
|
| 1.1 | 15-Jul-2011 |
jmcneill | add dtv_intlog10 implementation, from apb@
|
| 1.1 | 09-Aug-2011 |
jmcneill | add dtv_math.h
|
| 1.6 | 27-Dec-2019 |
msaitoh | s/transfered/transferred/
|
| 1.5 | 03-Sep-2018 |
riastradh | Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation.
To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
|
| 1.4 | 09-Nov-2017 |
riastradh | branches: 1.4.2; 1.4.4; Guess pool_cache_get(pc, 0) means PR_WAITOK here.
Earlier on in the same context we use kmem_alloc(sz, KM_SLEEP).
|
| 1.3 | 01-Jun-2017 |
chs | branches: 1.3.2; 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.
|
| 1.2 | 09-Aug-2014 |
jmcneill | branches: 1.2.4; IPL_VM -> IPL_SCHED to avoid taking kernel lock
|
| 1.1 | 09-Jul-2011 |
jmcneill | branches: 1.1.12; add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.1.12.2 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.1.12.1 | 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
| 1.2.4.1 | 28-Aug-2017 |
skrll | Sync with HEAD
|
| 1.3.2.1 | 27-Feb-2018 |
martin | Pull up following revision(s) (requested by mrg in ticket #593): sys/dev/marvell/mvxpsec.c: revision 1.2 sys/arch/m68k/m68k/pmap_motorola.c: revision 1.70 sys/opencrypto/crypto.c: revision 1.102 sys/arch/sparc64/sparc64/pmap.c: revision 1.308 sys/ufs/chfs/chfs_malloc.c: revision 1.5 sys/arch/powerpc/oea/pmap.c: revision 1.95 sys/sys/pool.h: revision 1.80,1.82 sys/kern/subr_pool.c: revision 1.209-1.216,1.219-1.220 sys/arch/alpha/alpha/pmap.c: revision 1.262 sys/kern/uipc_mbuf.c: revision 1.173 sys/uvm/uvm_fault.c: revision 1.202 sys/sys/mbuf.h: revision 1.172 sys/kern/subr_extent.c: revision 1.86 sys/arch/x86/x86/pmap.c: revision 1.266 (via patch) sys/dev/dtv/dtv_scatter.c: revision 1.4
Allow only one pending call to a pool's backing allocator at a time. Candidate fix for problems with hanging after kva fragmentation related to PR kern/45718.
Proposed on tech-kern: https://mail-index.NetBSD.org/tech-kern/2017/10/23/msg022472.html Tested by bouyer@ on i386.
This makes one small change to the semantics of pool_prime and pool_setlowat: they may fail with EWOULDBLOCK instead of ENOMEM, if there is a pending call to the backing allocator in another thread but we are not actually out of memory. That is unlikely because nearly always these are used during initialization, when the pool is not in use.
Define the new flag too for previous commit.
pool_grow can now fail even when sleeping is ok. Catch this case in pool_get and retry.
Assert that pool_get failure happens only with PR_NOWAIT. This would have caught the mistake I made last week leading to null pointer dereferences all over the place, a mistake which I evidently poorly scheduled alongside maxv's change to the panic message on x86 for null pointer dereferences.
Since pr_lock is now used to wait for two things now (PR_GROWING and PR_WANTED) we need to loop for the condition we wanted. make the KASSERTMSG/panic strings consistent as '%s: [%s], __func__, wchan' Handle the ERESTART case from pool_grow()
don't pass 0 to the pool flags Guess pool_cache_get(pc, 0) means PR_WAITOK here. Earlier on in the same context we use kmem_alloc(sz, KM_SLEEP).
use PR_WAITOK everywhere. use PR_NOWAIT.
Don't use 0 for PR_NOWAIT
use PR_NOWAIT instead of 0
panic ex nihilo -- PR_NOWAITing for zerot
Add assertions that either PR_WAITOK or PR_NOWAIT are set. - fix an assert; we can reach there if we are nowait or limitfail. - when priming the pool and failing with ERESTART, don't decrement the number of pages; this avoids the issue of returning an ERESTART when we get to 0, and is more correct. - simplify the pool_grow code, and don't wakeup things if we ENOMEM.
In pmap_enter_ma(), only try to allocate pves if we might need them, and even if that fails, only fail the operation if we later discover that we really do need them. This implements the requirement that pmap_enter(PMAP_CANFAIL) must not fail when replacing an existing mapping with the first mapping of a new page, which is an unintended consequence of the changes from the rmind-uvmplock branch in 2011.
The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write). If that fails and leaves the old pmap entry in place, then UVM won't hold the right locks when it eventually retries. This entanglement of the UVM and pmap locking was done in rmind-uvmplock in order to improve performance, but it also means that the UVM state and pmap state need to be kept in sync more than they did before. It would be possible to handle this in the UVM code instead of in the pmap code, but these pmap changes improve the handling of low memory situations in general, and handling this in UVM would be clunky, so this seemed like the better way to go.
This somewhat indirectly fixes PR 52706, as well as the failing assertion about "uvm_page_locked_p(old_pg)". (but only on x86, various other platforms will need their own changes to handle this issue.) In uvm_fault_upper_enter(), if pmap_enter(PMAP_CANFAIL) fails, assert that the pmap did not leave around a now-stale pmap mapping for an old page. If such a pmap mapping still existed after we unlocked the vm_map, the UVM code would not know later that it would need to lock the lower layer object while calling the pmap to remove or replace that stale pmap mapping. See PR 52706 for further details. hopefully workaround the irregularly "fork fails in init" problem. if a pool is growing, and the grower is PR_NOWAIT, mark this. if another caller wants to grow the pool and is also PR_NOWAIT, busy-wait for the original caller, which should either succeed or hard-fail fairly quickly.
implement the busy-wait by unlocking and relocking this pools mutex and returning ERESTART. other methods (such as having the caller do this) were significantly more code and this hack is fairly localised. ok chs@ riastradh@
Don't release the lock in the PR_NOWAIT allocation. Move flags setting after the acquiring the mutex. (from Tobias Nygren) apply the change from arch/x86/x86/pmap.c rev. 1.266 commitid vZRjvmxG7YTHLOfA:
In pmap_enter_ma(), only try to allocate pves if we might need them, and even if that fails, only fail the operation if we later discover that we really do need them. If we are replacing an existing mapping, reuse the pv structure where possible.
This implements the requirement that pmap_enter(PMAP_CANFAIL) must not fail when replacing an existing mapping with the first mapping of a new page, which is an unintended consequence of the changes from the rmind-uvmplock branch in 2011.
The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write). If that fails and leaves the old pmap entry in place, then UVM won't hold the right locks when it eventually retries. This entanglement of the UVM and pmap locking was done in rmind-uvmplock in order to improve performance, but it also means that the UVM state and pmap state need to be kept in sync more than they did before. It would be possible to handle this in the UVM code instead of in the pmap code, but these pmap changes improve the handling of low memory situations in general, and handling this in UVM would be clunky, so this seemed like the better way to go.
This somewhat indirectly fixes PR 52706 on the remaining platforms where this problem existed.
|
| 1.4.4.2 | 08-Apr-2020 |
martin | Merge changes from current as of 20200406
|
| 1.4.4.1 | 10-Jun-2019 |
christos | Sync with HEAD
|
| 1.4.2.1 | 06-Sep-2018 |
pgoyette | Sync with HEAD
Resolve a couple of conflicts (result of the uimin/uimax changes)
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.4 | 19-Apr-2018 |
christos | s/static inline/static __inline/g for consistency.
|
| 1.3 | 09-Aug-2011 |
jmcneill | branches: 1.3.52; modify the dtv device api so hardware drivers can be loaded independently of the dtv module
|
| 1.2 | 15-Jul-2011 |
jmcneill | add dtv_intlog10 implementation, from apb@
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.3.52.1 | 22-Apr-2018 |
pgoyette | Sync with HEAD
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.3 | 28-Oct-2017 |
riastradh | Add some #includes to make a few more header files compile.
|
| 1.2 | 10-Jul-2011 |
jmcneill | branches: 1.2.12; add DMX_PES_foo -> DMX_PES_foo0 aliases for dmx_pes_type_t types
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.2.12.1 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.3 | 28-Oct-2017 |
riastradh | Add some #includes to make a few more header files compile.
|
| 1.2 | 13-Jul-2011 |
jmcneill | branches: 1.2.12; fe_sec_voltage_t: add SEC_VOLTAGE_OFF
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.2.12.1 | 03-Dec-2017 |
jdolecek | update from HEAD
|
| 1.2 | 09-Jul-2011 |
jmcneill | allow this to be compiled into the kernel
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.6 | 09-Aug-2011 |
jmcneill | modify the dtv device api so hardware drivers can be loaded independently of the dtv module
|
| 1.5 | 16-Jul-2011 |
jmcneill | Fix a locking problem with the demux, and while here do a bit of housekeeping and documentation.
|
| 1.4 | 13-Jul-2011 |
jmcneill | add section filter support
|
| 1.3 | 12-Jul-2011 |
jmcneill | - use separate locks for ingress and egress queues - increase ts block and buffer sizes
|
| 1.2 | 09-Jul-2011 |
jmcneill | don't kmem_alloc with IPL_VM mutex locked, spotted by rmind
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|
| 1.4 | 09-Aug-2011 |
jmcneill | modify the dtv device api so hardware drivers can be loaded independently of the dtv module
|
| 1.3 | 15-Jul-2011 |
jmcneill | add dtv_intlog10 implementation, from apb@
|
| 1.2 | 13-Jul-2011 |
jmcneill | add section filter support
|
| 1.1 | 09-Jul-2011 |
jmcneill | add digital TV framework which implements a subset of Linux DVB APIs
|