Stack Pointer Boundary Address Monitor for PMP Detection Failures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing Physical Memory Protection (PMP) mechanism fails to detect when a stack pointer moves significantly and crosses the entire guard region, leading to detection failures.
Innovation Solution
An address monitor device and method that include a boundary address register, a stack pointer register, and a comparator to monitor the boundary address of a stack and compare it with the stack pointer to determine if an interrupt command should be outputted.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If the PMP mechanism uses a guard region to detect stack pointer violations, then the detection capability is improved for small movements, but the detection reliability deteriorates when the stack pointer moves large distances and crosses the entire guard region
Solution Approach 1:
The guard region is divided into multiple segments with each having its own boundary address register. Instead of a single guard region, the stack boundary is divided into multiple smaller regions, each monitored independently. This segmentation ensures that even large stack pointer movements are detected by triggering multiple boundary checks, resolving the contradiction between detection precision and reliability.
Solution Approach 2:
The boundary address register is configured to monitor the boundary address in advance before the stack pointer can cross it. By preliminarily setting up the boundary address and using the comparator to check against this pre-established boundary, the system detects violations before they occur, improving both detection capability and reliability for large movements.
2Productivity
If the stack pointer moves large distances, then the stack usage efficiency is improved, but the detection reliability of the PMP mechanism deteriorates
Solution Approach 1:
By segmenting the guard region into multiple smaller regions with individual boundary address registers, the system allows larger stack pointer movements while maintaining detection reliability. Each segment can be independently monitored, enabling efficient stack usage patterns that would otherwise cause detection failures in a single large guard region.
Data Source
AI summary
An address monitor device includes a boundary address register, a stack pointer register, and a comparator. The boundary address register is configured to monitor a boundary address of a stack based on a usage state of a stack pointer. The stack pointer register is configured to obtain a usage address of the stack at present based on the usage state of the stack pointer. The comparator is configured to compare the stack pointer and the boundary address for determining whether to output an interrupt command.


