sancus-tee / sancus-core

Minimal OpenMSP430 hardware extensions for isolation and attestation
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Fix zero read on DMA peripheral access #21

Closed martonbognar closed 4 years ago

martonbognar commented 4 years ago

This pull request fixes a bug which caused some memory reads by the execution unit to return 0 if a DMA device accesses a memory-mapped I/O address in the same clock cycle.

The execution unit code now checks the eu_per_en signal instead of the per_en to decide whether it needs to access the peripheral data output bus. (The latter signal is high when a DMA device accesses a MMIO address, while the former is only high if the execution unit initiates the access.)

The pull request also contains a test for this fix.

jovanbulck commented 4 years ago

Looks great! Thanks for the fix and test case :+1: