Write-Combine Memory Allocation in PCIe Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for allocating a memory space with a write-combine attribute in PCIe systems are unreliable and complex, as they require manual modification of memory type range registers, which can damage adjacent memory spaces and are difficult to re-allocate due to strict size and alignment rules.
Innovation Solution
A method and apparatus for allocating a memory space with a write-combine attribute by scanning device resources, determining the required size and type, and allocating a contiguous memory space that meets the write-combine attribute requirements, ensuring the starting address is subsequent to non-write-combine memory spaces, thus avoiding interference with existing memory allocations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual modification of memory type range registers is used to allocate write-combine memory space, then the memory space can be allocated with the required attribute, but the allocation process becomes complex and unreliable due to strict size and alignment rules
Solution Approach 1:
The system automatically scans device resources and performs memory space allocation without requiring manual intervention. The BIOS or operating system autonomously identifies devices needing write-combine memory, calculates appropriate addresses, and allocates spaces according to strict rules, eliminating manual modification complexity and improving reliability.
Solution Approach 2:
The system performs preliminary scanning of device resources before allocation to identify which devices require write-combine memory space. This preliminary action allows the system to prepare and allocate memory spaces in advance according to predetermined rules, avoiding complex manual modification processes.
2Reliability
If manual modification of memory type range registers is used, then write-combine attribute can be set, but adjacent memory spaces may be damaged due to strict alignment rules
Solution Approach 1:
The system implements a feedback mechanism where it scans device resources to identify write-combine requirements, then uses this information to automatically allocate memory spaces at safe addresses. This feedback loop ensures that allocation decisions are made with awareness of existing memory layouts, preventing damage to adjacent memory spaces while maintaining write-combine functionality.
Solution Approach 2:
The system allocates write-combine memory spaces at addresses that are predetermined to be safe from interfering with other memory allocations. By planning allocation locations in advance based on scanned device resources, the system prevents harmful effects on adjacent memory spaces before they can occur.
3Ease of operation
If automatic allocation method is used, then the allocation process is simplified and stabilized, but the system must scan and evaluate device resources to determine allocation requirements
Solution Approach 1:
The BIOS or operating system performs automatic resource scanning and evaluation as part of its standard initialization process. This self-service approach integrates memory allocation into existing system routines, simplifying the overall process while the underlying complexity of resource scanning is handled transparently by the system's built-in mechanisms.
Data Source
AI summary
Embodiments of the present invention disclose a method and an apparatus for allocating a memory space with a write-combine attribute, including: determining, when resources of devices are scanned, a type and a size of a resource required by each device; determining, after the scanning of the resources of the devices is completed, a total size of write-combine memory spaces required by all first devices; then determining a starting address used to allocate a write-combine memory space to the first devices; and allocating one memory space jointly to all the first devices and allocating, from the one memory space, a sub-memory space to each first device. According to the embodiments of the present invention, a memory space with a write-combine attribute can be allocated to devices in a more reliable manner and by using a relatively simple allocation method.


