[asterisk-bugs] [DAHDI-linux 0013500]: [patch] safer MMX support for echo canceller

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jun 29 15:08:06 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=13500 
====================================================================== 
Reported By:                tzafrir
Assigned To:                kpfleming
====================================================================== 
Project:                    DAHDI-linux
Issue ID:                   13500
Category:                   dahdi (the module)
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     closed
Target Version:             2.3.0
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-09-17 04:38 CDT
Last Modified:              2009-06-29 15:08 CDT
====================================================================== 
Summary:                    [patch] safer MMX support for echo canceller
Description: 
ZAPTEL_CONFIG_MMX has had a reputation for being a nice performance
improvement (e.g: by 50% and more), but OTOH also for causing "strange
things". This is because the the floating point context is not properly
saved and using MMX (uses the floating point registers) in an interrupt
context may result in corrupting them to processes.

This patch aims to properly fix that. It does so in an ugly and
i386-specific way (will not even work on x86_64), but it should be a good
starting point. It replaces not only kernel_fpu_begin but also
kernel_fpu_end .

There is some legacy 2.4-only reimplementation of kernel_fpu_begin() which
I chose not to touch.

I also added a compilation warning for the case of using CONFIG_ZAPTEL_MMX
without this fix, as I suspect it is not safe.

The initial patch is vs. zaptel, as I have no relevant EC to test this
with on DAHDI. A dahdi-linux patch is also included, but not actually
tested.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0015167 echo cancellers sec, kb1 and mg2 fail t...
====================================================================== 

---------------------------------------------------------------------- 
 (0107165) kpfleming (administrator) - 2009-06-29 15:08
 https://issues.asterisk.org/view.php?id=13500#c107165 
---------------------------------------------------------------------- 
I've committed the primary part of this issue; I did not commit the 'auto
MMX' patch, because none of the current DAHDI echocans use MMX, and there's
no reason to burden a user's system with saving/restoring registers that
won't be clobbered anyway.

If you want to pursue that patch open another issue and post a patch that
adds a bit to dahdi_echocan_features that indicates whether the echocan
uses MMX or not; then it would be safe to automatically enable save/restore
iff the echocan is going to clobber the registers. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-06-29 15:08 kpfleming      Note Added: 0107165                          
======================================================================




More information about the asterisk-bugs mailing list