Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable hardware stack zeroing. #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Enable hardware stack zeroing. #111

wants to merge 1 commit into from

Commits on Jun 3, 2024

  1. Enable hardware stack zeroing.

    This replaces the software stack zeroing path with offload to a hardware
    engine, when available.  The hardware zeroing pipeline is controlled by
    the ZTOP SCR (currently assumed to be number 27).  This zeroes from the
    top of the capability in ZTOP to the bottom.
    
    We assume that short-lived cross-compartment calls or returns from
    deeply nested calls will result in ranges where each is a subset of
    another, so we try to coalesce.
    
    If we're about to zero a region that is a superset of the current
    zeroing region, we skip it, otherwise we wait for the previous zeroing
    region to finish.  This is a fairly simple approach but was chosen
    because adding a lot of instructions in this path can rapidly offset the
    benefits.
    
    0.3% speedup on Sonata.
    2% speedup on the Ibex SAFE simulator.
    
    The difference here is largely due to the UART at 115,200 b/s being
    *very* slow in comparison to the CPU and so the test suite is mostly
    waiting to write debug messages.  The simulator UART can write one
    character per cycle.  The allocator portion of the test suite (which
    does a lot of work per message) is around 1% faster.
    
    The test suite crashes on the Arty A7, which may be a bug in the A7
    version but may be a bug in this code and so we shouldn't merge it yet.
    davidchisnall committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    e4710f6 View commit details
    Browse the repository at this point in the history