SYSTEM, METHOD AND APPARATUS FOR ACCESSING SHARED MEMORY - Patent application
Memory protection units enforce read/write permissions at crosspoints in data processing networks to prevent unauthorized access and maintain memory coherence, addressing the issue of unauthorized memory corruption.
Patent Information
- Application Number
- JP2021557022
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-03-22
- Filing Date
- 2020-03-17
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2040-03-17
AI Technical Summary
Unauthorized access to shared memory in data processing networks can corrupt memory contents, and simple permission-based filtering is inadequate for maintaining coherence in coherent systems.
Implementing memory protection units (MPUs) at crosspoints in the data processing network to enforce read/write permissions per memory region, intercepting requests, and augmenting them with access permissions, ensuring only authorized actions are performed on shared memory.
Prevents unauthorized access and maintains memory coherence by filtering out unauthorized read/write requests, protecting shared memory contents from corruption.
Smart Images

Figure 0007556877000002 
Figure 0007556877000010 
Figure 0007556877000007
Abstract
Description
Summary of the Invention [Problem to be solved by the invention]
[0001] The present disclosure relates generally to computer memory, and more particularly to schemes for accessing shared memory.
[0002] In many instruction execution systems, shared memory contents can be compromised by unauthorized accesses due to requests to read or write data to the shared memory, which can corrupt the memory contents in undesirable ways. [Brief description of the drawings]
[0003] The accompanying drawings provide visual representations and are used to more completely explain various exemplary embodiments, and may be used to enable those skilled in the art to better understand the disclosed exemplary embodiments and their inherent advantages, in which like reference numerals identify corresponding elements.
[0004] [Figure 1] FIG. 1 is a diagram illustrating an exemplary 1×3 mesh CMN (Coherent Mesh Network) system.
[0005] [Diagram 2] FIG. 2 is a block diagram of a data processing system having a memory protection unit (MPU) according to various embodiments of the present disclosure.
[0006] [Diagram 3] FIG. 3 is a diagram illustrating example memory protection unit (MPU) address domains and permissions, according to various embodiments of the present disclosure.
[0007] [Figure 4] FIG. 4 is a signal flow diagram of a read and write transaction with authorized access according to various embodiments of the present disclosure.
[0008] [Diagram 5] FIG. 5 is a signal flow diagram of a read and write transaction without authorized access according to various embodiments of the present disclosure.
[0009] [Figure 6] FIG. 6 is a signal flow diagram of a snoop transaction according to various embodiments of the disclosure.
[0010] [Figure 7] FIG. 7 is a signal flow diagram of a further snoop transaction according to various embodiments of the present disclosure.
[0011] [Figure 8] FIG. 8 is a signal flow diagram of a further access transaction according to various embodiments of the present disclosure. [Figure 9] FIG. 9 is a signal flow diagram of a further access transaction according to various embodiments of the present disclosure. [Figure 10] FIG. 10 is a signal flow diagram of a further access transaction according to various embodiments of the present disclosure.
[0012] [Figure 11A] FIG. 11A is a flowchart illustrating request filtering according to access permissions, according to various embodiments of the present disclosure. [Figure 11B] FIG. 11B is a flowchart illustrating request filtering according to access permissions, according to various embodiments of the present disclosure.
[0013] [Figure 12] FIG. 12 illustrates an apparatus for filtering requests according to various embodiments of the present disclosure.
[0014] [Figure 13A] FIG. 13A is a diagram illustrating coloring of transaction identifiers by a memory protection unit, according to various embodiments of the present disclosure. [Figure 13B] FIG. 13B is a diagram illustrating coloring of transaction identifiers by a memory protection unit, according to various embodiments of the present disclosure. [Figure 13C] FIG. 13C is a diagram illustrating coloring of transaction identifiers by a memory protection unit, according to various embodiments of the present disclosure. [Figure 13D] FIG. 13D is a diagram illustrating coloring of transaction identifiers by a memory protection unit according to various embodiments of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] While the present disclosure may embrace embodiments in many different forms, it has been illustrated and described in detail with the understanding that the disclosure is to be considered as an example of the principles described and is not intended to limit the disclosure to the specific embodiments shown and described. In the following description, like reference numerals are used to describe the same, similar or corresponding parts in the several views of the drawings.
[0016] In this document, terms indicating relationships, such as first and second or top and bottom, may be used only to distinguish one entity or operation from another entity or action, without necessarily requiring or implying any actual relationship or order between such entities or actions. The terms "comprise," "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements may include only those elements, but may also include other elements that are not expressly listed or that are inherent to such process, method, article, or apparatus. An element preceded by "comprise...a" does not, without further constraints, exclude the presence of additional identical elements in a process, method, article, or apparatus that comprises the element.
[0017] As used throughout this specification, the terms "one embodiment," "particular embodiment," "embodiment," or similar expressions mean that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of the disclosed subject matter. Thus, the appearances of such phrases in various places throughout this specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments, without limitation.
[0018] As used herein, the term "or" should be interpreted as inclusive or to mean any one or any combination. Thus, "A, B, or C" means any of the following: A; B; C; A and B; A and C; B and C; A, B, and C. Exceptions to this definition occur only when combinations of elements, features, steps, or acts are in some respect essentially mutually exclusive.
[0019] For simplicity and clarity of illustration, reference numerals may be repeated among the figures to indicate corresponding or similar elements. Numerous details are described to provide an understanding of the embodiments described herein. The embodiments may be practiced without these details. In other instances, well-known methods, procedures, and components have not been described in detail to avoid obscuring the described embodiments. The description should not be considered as limiting the scope of the embodiments described herein.
[0020] The embodiments described herein show how shared memory contents can be protected from unauthorized accessories in a data processing network by using read / write permissions per master per memory region.
[0021] SUMMARY OF THE DISCLOSURE In accordance with the present disclosure, an improved means for accessing shared memory while preventing unauthorized access is provided.
[0022] FIG. 1 is a schematic diagram of an exemplary data processing network 100. In this simple example, the network is configured as a 1×3 mesh CMN (Coherent Mesh Network). Crosspoints (M×P) provide intersections in the data processing network and are responsible for routing message protocol packets to the correct node based on the target node identifier. One example of a CMN is the Arm® CoreLink™ CMN-600 coherent mesh network designed for intelligent connectivity systems across a wide range of applications including networking infrastructure, storage, servers, HPC, automotive, and industrial solutions. The highly scalable mesh is optimized for the Arm® v8-A processor and can be customized across a wide range of performance points. The data processing network may include a coherent interconnect, such as the ARM® CMN product family based on the ARM® AMBA® 5CHI protocol (ARM® and AMBA® are registered trademarks of Arm Limited). The interconnect specification identifies the devices in the interconnect, as described below.
[0023] A network may include one or more request nodes that act as request masters and initiate data transactions. Exemplary request nodes are listed below: RN-F: A fully coherent request node, such as a central processing unit (CPU), a coherent graphic processing unit (GPU), or other accelerator acting as a request master. RN-I: An I / O coherent request node that tunnels input / output (I / O) traffic, for example, to a Coherent Hub Interface (CHI) or other network interconnect. RN-D: Distributed Virtual Memory (DVM) Request Node supporting DVM traffic
[0024] The network may further include one or more home nodes that receive access requests from the requesting nodes. Each home node may act as a point of coherence and serialization for a given set of memory addresses and may include a snoop filter to monitor data transactions and keep a record of which data lines are stored or owned by one or more nodes. When a memory access is received at a home node, a snoop request may be sent to a node that has a copy of the accessed data in its local cache. Exemplary home nodes include fully coherent home nodes (HN-F) that service normal memory requests and I / O coherent home nodes (HN-I) that are responsible for servicing I / O requests. Such nodes may include cache memories and snoop filters for efficient coherency resolution and therefore send snoops as necessary. Cache memories are typically high-speed random access memories (RAMs) that allow a processor to access cache memories more quickly than it can access normal RAMs.
[0025] In addition, the data processing network includes one or more slave nodes that service requests from a home node if the request cannot be serviced locally within the home node. Examples of slave nodes are a memory controller or a requesting node. Otherwise, the request is serviced by the home node that receives the request.
[0026] As shown in FIG. 1, a fully coherent request node (RNF) 102 is operably coupled to a mesh crosspoint (MXP) 104. The MXP 104 is operably coupled to an MXP 108 and an MXP 114. The MXP 108 is operably coupled to an I / O coherent request node (RNI) 106 and a fully coherent home node (HNF) 110. The MXP 114 is operably coupled to a fully coherent slave node (SNF) 112 and a home node (HND) 118. The request nodes 102, 106 access data by sending requests to the home nodes (HN-F / HN-I) 118, 110. The slave node 112 may be, for example, a dynamic memory controller (DMC).
[0027] For a read access, the home node 118 searches for the input address in the cache memory and the slave node 112. If the address is available in the cache memory, the request is serviced by providing the data. If the data is not available in the cache but there is a hit in the slave node 112, the home node 110 sends a snoop request to the RN-F 102 that contains the cache line to service the request. The snooped RN-F 102 can either send the data back to the home node 110 (so that the home node can service the request) or, depending on the type of snoop request, can send the data directly to the requesting node 106 in a process called DCT (direct cache transfer).
[0028] For a write access from RN-F 102, home node 118 checks whether the request is for a partial write or a full cache line write. Depending on the size of the request, home node 118 may merge the requested data with memory data or snooped data. The merged data may be written back to memory (slave node) or filled into a cache if one exists in the home node, based on the request attributes.
[0029] If the request incurs any error in the home node, such as a cache access error or a snoop error, the home node completes the request by responding with the error condition and may optionally generate an interrupt for the master node to understand the access status.
[0030] Coherent network protocols, such as the AMBA® 5CHI protocol, can specify a variety of action requirements. 1. Read request with data - response contains the data. 2. Read request with no data - The response contains no data. 3. Write request - writing clean / modified data from the requester to cache or memory 4. Cache Maintenance Operation (CMO) - Flushing cache lines to memory such as DRAM, I / O masters or downstream caches, and other memory beyond the home node. 5. Atomic Request - Performs a sub-cache line atomic operation in memory. 6. Evacuation Request - The action of evacuating a cache line into the RN-F cache for future access.
[0031] In a coherent network, various actions are taken to ensure that shared data is maintained coherently. For example, actions can ensure that no node has a non-up-to-date copy of the data. However, read / write access by an unauthorized master can corrupt memory contents, and simple permission-based filtering does not address a coherent system where an unauthorized master can expose corrupted data in many different ways. Thus, in a protected memory system, some desired actions, such as writing modified data to the shared memory, may not be permitted by a particular node. This impacts coherence maintenance.
[0032] The present disclosure relates to protecting memory in a coherent data processing network.
[0033] In one embodiment, a request message from a first requesting node of the data processing network is received at a home node of the data processing network. The request message includes an action request on data associated with a first address in a shared memory of the data processing network and one or more access permissions for the first requesting node for the first memory address. The requested action may be, for example, to read, write, or modify a coherence state of the data associated with the first memory request. The home node determines from the one or more access permissions whether the requested action is permitted by the first requesting node. When the requested action is permitted by the first requesting node, the data associated with the first memory address is accessed from a system cache, a local cache of a second requesting node of the data processing network, or a shared memory according to a coherency protocol. However, when the requested action is not permitted by the first requesting node, a response message is sent to the first requesting node without accessing the data associated with the first memory address.
[0034] The access permissions may be provided by using a memory protection unit (MPU) located at a crosspoint of the data processing network, the MPU having registers configurable to define the access permissions for requests coupled to the network at the crosspoint.
[0035] Figure 2 illustrates a system 200 with an example of a data processing network incorporating a memory protection unit (MPU). Figure 2 illustrates master nodes RN-F 202, RN-I 216, mesh cross points (MXPs) 206, 212, 220, home nodes HN-I 210, HN-F 208, slave nodes SN-F 218, and MPUs 204, 214. The system 200 of Figure 2 may be, for example, a coherent mesh network.
[0036] Each of the requesting node masters (RN-F 202 and RN-I 216) in system 200 is coupled to the network interconnect via a memory protection unit (MPU 204 and 214, respectively). The MPUs (204, 214) contain configurable registers that are programmed with address ranges and corresponding read / write permissions, as shown in FIG.
[0037] As mentioned above, the memory protection unit (MPU) 204, 214 may be a computer hardware unit. The MPU may be implemented as part of a central processing unit (CPU), as part of an interconnect fabric, or as a separate hardware module or block. In some embodiments, the MPU is a scaled-down version of a memory management unit (MMU) that provides only memory protection support and may be implemented in low-power processors that require only memory protection and not other memory management functions such as virtual memory management.
[0038] The first requesting node 202 is coupled to a home node 208 via a first memory protection unit 204 of the data processing system 200. The first memory protection unit 204 receives an action request from the first requesting node 202, determines one or more access permissions assigned to the first requesting node according to the first memory address, and augments the action request with the one or more access permissions for the first requesting node before sending it to the home node 208.
[0039] In one embodiment according to the present disclosure, access permissions are stored in bits of the request that are not used in existing architecture interfaces, allowing memory protection to be added to existing messaging protocols. In another embodiment, an existing field in the request (e.g., a transaction identifier field) is extended to store the access permissions. In yet another embodiment, an additional field is added to the request to store the access permissions.
[0040] FIG. 3 illustrates an example 300 of memory protection unit (MPU) address regions and permissions. MPU region 0, 320(a) through MPU region N, 320(n), where "n" is any suitable number, each have a read region 322, a write region 324, a start address 326, and an end address 328. The number of MPU regions is a design choice, and any suitable number may be used. MPU region 0, 320(a) has an associated read portion 322(a), a write portion 324(a), a start address 326(a), and an end address 328(a). Similarly, MPU region N 320(n) has an associated read portion 322(n), a write portion 324(n), a start address 326(n), and an end address 328(n).
[0041] When a requesting node (e.g., 202 shown in FIG. 2) sends a request to a crosspoint (e.g., 204 shown in FIG. 2), the address from the request is looked up in the MPU against the region represented by start address 326 and end address 328. If a match is found, the corresponding read and write permission attributes for the region 320 are sent along with the request to the home node.
[0042] The MPU may also include default read / write permissions if no region match is found. The HN then uses the R / W permissions to allow access to the memory contents.
[0043] These permission definitions include: R: The request has read permission W: The request has write permission ~R: The request does not have read permission ~W: The request does not have write permission
[0044] A read request from a requesting node to a home node is intercepted by the MPU. The memory address to be read is looked up in a table in the MPU to determine the access permission for the memory address to the requesting node. The MPU then extends the read request with an access permission (AP) and forwards the extended request to the home node. Thus, the flow is as follows: Request node → RN_Req → MPU area search → RN_Req+AP → Home node
[0045] For a snoop request sent by the home node to the RN-F, the snoop address from the snoop request is looked up in the MPU. The snoop response is extended with an access permission, and the extended snoop response is sent back to the home node. The home node can then make a decision using the access permission on the snoop response. The flow is as follows: Home node → HNF_Snp_request → MPU search → Snoop response + AP → Home node
[0046] The home node filters the snoop response based on the R / W access permissions.
[0047] 4 shows an example of a read / write request type with permitted access 400. A first requesting node CPU 402 communicates with a home node 404 and a slave node 406. In the illustrated example, the slave node 406 is a dynamic memory controller (DMC).
[0048] A read request 408 is sent from the CPU 402 to the home node 404 where permission filtering, caching or memory access 411 is performed. In this example, the CPU has read and write (R / W) access permissions to the address and the read request 408 is extended with these permissions. The read request 410 is granted and sent to the DMC 406. In response to the message 410, data 412 is sent from the DMC 406 to the CPU 402.
[0049] An acknowledgement 414 is sent from the CPU 402 to the home node 404 .
[0050] A write request 416 is sent from the CPU 402 to the home node 404. In response, the home node 404 performs permission filtering, cache allocation, or memory write 417. Prior to the memory write, a "buffer ready" message 418 is sent from the home node 404 to the CPU 402 to indicate that the home node is ready to receive the data and has storage available to buffer the data. Data 420 is sent from the CPU 402 to the home node 404, and a write request 422 is sent from the home node 404 to the DMC 406. A "buffer ready" message 426 is sent from the DMC 406 to the home node 404. Finally, if this is a cache line victim, the memory write is performed (427) by the home node 404. Data 428 is sent from the home node 404 to the DMC 406.
[0051] Thus, in some embodiments, the home node responds to the action request according to the extended access permissions. In other words, the home node "filters" the action request according to the extended access permissions. For example, when the action request includes a read request and one or more access permissions do not include read permission, the home node does not service the request and sends dummy data back to the first requesting node.
[0052] When the action request includes a request to write the modified data and the one or more access permissions do not include write permission, the home node discards the modified data and optionally invalidates the modified data at the first requesting node.
[0053] FIG. 5 illustrates an example 500 of access permission based request filtering, according to various embodiments of the present disclosure. A sequence of actions illustrating the flow of information between the CPU, the home node, and the DMC are indicated by arrows. FIG. 5 illustrates a CPU timeline 502, a home node timeline 504, and a DMC timeline 506, with time increasing from top to bottom. The information flows may be generated by hardware in the data processing network, software running on a processor, or a combination thereof.
[0054] The requestor protection mechanism as shown in Figure 5 protects good data from being sent to the CPU 502. The first transaction is a read request 510 from the CPU. A read request 512 is sent from the CPU to the home node. The read request 512 is extended with an access permission (~R / ~W). The home node's permission filter determines from the access permission that reading is not allowed so no cache or memory access is performed at 520. Instead, dummy data 514 is sent from the home node to the CPU and an acknowledgement 518 is sent from the CPU back to the home node.
[0055] The second transaction is a write request 530. A write request message 532 extended with an access permission (~R / ~W) is sent from the CPU to the home node. In response, the home node 504 determines from the access permission that the CPU does not have write permission, and the request is dropped at 540. Before the request is dropped, a "buffer ready" message 534 is sent from the home node to the CPU, and data 536 is sent from the CPU to the home node. However, because the requester does not have write permission, the data 536 is dropped. The data 536 is not written to memory. Alternatively, the home node may send an error message to the CPU in the "buffer ready" message 534.
[0056] 5 illustrates that the requestor protection mechanism provides request filtering based on access permissions, which include read permission, write permission, and snoop permission.
[0057] Read Permission: If the RN does not have read permission for a read request, the home node (HN) will not search its internal cache or snoop the RN-F that may have the cache line. The HN responds to the request with zero data and an error status, indicating that the read request encountered an MPU violation.
[0058] Write permission: If the RN does not have write permission, the HN processes the request but the dirty data from the RN is not updated to memory. The HN can indicate a permission error on the completion response if necessary.
[0059] Snoop Permission: When an RN-F must be snooped for coherency, the permission on the snoop response is checked. If the snooped RN-F sends back data, it is filtered. It is shown in Figure 6 that a snoop response with dirty data is only allowed if the RN-F has write permission.
[0060] When the action request includes a request to read data and a copy of the requested data is stored in the local cache of the second requesting node, the home node may retrieve the data from the second requesting node by sending a snoop message to the second requesting node and receiving a data response. The data response is extended with the access permission of the second requesting node. When the retrieved data is in a modified state, the home node proceeds according to the access permission as shown in Figures 6 and 7 below.
[0061] When the second requesting node has write permission for the modified data and the first requesting node does not have write permission for the modified data, the home node writes the modified data at the first memory address to the shared memory, changes the modified data to clean data, and sends the clean data to the first requesting node.
[0062] When the second requesting node has write permission for the modified data and the first requesting node has write permission for the modified data, the home node transmits the modified data to the first requesting node.
[0063] When the second requesting node does not have permission to write the modified data, the home node obtains clean data from the shared memory at the first memory address, sends the clean data to the first requesting node, and invalidates the data associated with the first memory address at the second requesting node.
[0064] FIG. 6 is a signal flow diagram 600 of snoop central processing unit (CPU) filtering based on access permission. Only if RN-F has write permission, a snoop response with dirty data is allowed. Similarly, if RN-F has read permission, only clean data is allowed. If there is an MPU violation, the data is dropped. The home node fetches the data from the DMC and services the request. As shown in FIG. 6, the signal flow diagram 600 for a read request transaction 610 starts with a first requesting node CPU0. FIG. 6 further shows a CPU0 timeline 602(a), a home node timeline 604, a second requesting node (CPU1) timeline 602(b), and a DMC timeline 606. A read request with read and write permission (R / W) 612 is sent from the first requesting node (CPU0) to the home node. Because CPU0 has read permission, the home node's permission filter allows cache and / or memory access 613. A snoop request 614 is sent from the home node to a second requesting node (CPU1) which is determined to have a copy of the requested data. CPU1 responds by returning modified or "dirty" snoop data 616 to the home node. The snoop data is extended with CPU1's (R / ~W) access permissions. Because CPU1 does not have write permission, the snoop data is dropped by the home node at 618 and a read request 620 is sent from the home node to the DMC to obtain the clean data. The clean data 622 is then sent from the DMC to CPU0 and an acknowledgement 624 is sent from CPU0 to the home node.
[0065] FIG. 7 illustrates another embodiment 700 where a first requesting node (CPU0) has read permission but no write permission (R / W). This method is an example of controlling “clean” data versus “dirty” (modified) data based on access permissions, and shows CPU0 timeline 702(a), home node timeline 704, second requesting node (CPU1) timeline 702(b), and DMC timeline 706. The home node in such a case writes the modified data to the DMC and provides the first requesting node with clean data. If the modified data was provided without the DMC write, a subsequent eviction from the CPU would be dropped (due to write permission filtering), thereby losing the modified data.
[0066] FIG. 7 further illustrates a read request transaction 710 initiated by a first requesting node CPU0. A read request 712 with read permission but no write permission (R / W) is sent to the home node. Because CPU0 has read permission, the permission filter of the home node allows cache and / or memory access (713). A snoop request 714 is sent from the home node to a second requesting node (CPU1). CPU1 sends the modified dirty data 716 extended with (R / W) permission to the home node 704. Because writing is permitted, the home node sends a write request 734 (with R / W permission) to the DMC to begin writing the modified data to memory 735. A "buffer ready" signal 736 is sent from the DMC to the home node, and then the data 738 is sent from the home node to the DMC to complete the write to memory and change the coherence state of the data from modified (dirty) to clean. Clean data 730 is sent from the home node to CPU0, and an acknowledgement 732 is sent from CPU0 to the home node.
[0067] When the action request includes a request to invalidate data at the first address for which the first requesting node does not have write permission and a copy of the data is stored at a second requesting node, the home node retrieves the data associated with the first memory address from the second requesting node, and when the retrieved data is in a modified coherence state, the home node changes the coherence state of the data associated with the first memory address from "modified" to "clean" by writing the retrieved data to a shared memory at the first memory address and invalidates the data associated with the first memory address at the second requesting node.
[0068] FIG. 8 is a signal flow diagram 800 of a method for invalidating request permission filtering. FIG. 8 shows a CPU0 timeline 802(a), a home node timeline 804, a second requesting node (CPU1) timeline 802(b), and a DMC timeline 806. An invalidation transaction 810 is initiated from CPU0. A request to invalidate data stored in another node may be specified as a request to make the data unique. A "unique" request 812 extended with access permissions (R / W) is sent to the home node. The permission filter at the home node converts the request to "clean-unique" at 814. A "snoop-clean-invalidate" request 816 is sent from the home node to CPU1. CPU1 sends modified data 818 extended with (R / W) permissions to the home node to provide the snoop data (818). Completion of the invalidation is sent from the home node to CPU0 in message 820, and an acknowledgement 822 is sent from CPU0 to the home node.
[0069] To prevent the modified data from being lost, the home node sends a write request 824 with (R / W) permission to the DMC. A "buffer ready" signal 826 is sent from the DMC to the home node, and then the data 830 is sent from the home node to the DMC. Thus, the data is written to memory at 832.
[0070] For invalidation request permission, i.e., requests that are of invalidation type and have only read-only permission (e.g., ReadOnceMakeInvalid, MakeUnique, etc.) where the RN (requesting node) can receive a completion with data or no data while invalidating memory content from all downstream or peer caches, the home node converts such requests to non-invasive requests as shown in Figure 8. For example, a MakeUnique request 812 is converted to a CleanUnique request 814, and a ReadOnceMakeInvalid (no label) is converted to a ReadOnceCleanInvalid (no label). Such conversion ensures that existing dirty or modified data in the system is written to memory and that the completion does not corrupt any memory content.
[0071] For CMOs, if the requesting node has read-only permission, the home node performs a similar translation to a non-invasive request. For example, MakeInvalid is translated to CleanInvalid. If the requesting node has neither read nor write permission, the transaction is completed without updating memory.
[0072] Another sequence is a no data request grant where certain request types such as MakeUnique and CleanUnique have a no data completion. If the CPU does not request a grant error notification (bus error), it may erroneously transition to the "clean" status. Clean data is therefore suitable data to store in coherent memory. This data is different from dirty data because it is valid or clear or acceptable. Subsequent snoops to this cache line may expose bad data to other CPUs and memory locations. To avoid this, the home node follows a no data request completion with a snoop request (SnpMakeInvalid) and invalidates the cache line in the RN cache. This ensures that the CPU does not have the cache line in the unique state.
[0073] FIG. 9 is a signal flow diagram 900 of a method of permission filtering of write requests, according to various embodiments. In this context, a timeline 902 of a first requesting node (CPU0), a timeline 904 of a home node (HN-F), and a timeline 906 of a second requesting node (CPU1) are shown. Access request 908 is a "WriteClean" request to write modified (dirty) data to memory to change the status of the data from dirty to clean. However, the access permission extended for the request indicates that CPU0 does not have write permission for the data address. Upon receiving the request, home node HN-F determines that CPU0 does not have write permission. The home node does not snoop CPU1 and does not write the data to memory. The home node sends a completion message 910 back to CPU0, indicating that the home node is ready to receive the data. CPU0 sends the data to the home node in message 912. Thus, in period 914, CPU0 has modified (dirty) "bad" data, but cannot write it to memory. Once the data is written to the home node in message 912, CPU0 changes the status of the data to "clean". However, the data is still "bad". The home node then sends invalidation message 916 to CPU0 to invalidate the data stored in CPU0. CPU0 acknowledges this in message 918. Thus, in period 920, CPU0 indicates the status of the data as "clean", but in period 922, the data is indicated as invalid.
[0074] FIG. 10 is a signal flow diagram of a method for allowing filtering of read requests, according to various embodiments of the present disclosure. The flow diagram includes a timeline 1002 of a first requesting node (CPU0), a timeline 1004 of a home node (HN-F), a timeline 1006 of a second requesting node (CPU1), and a timeline 1008 of a memory controller (DMC). An access request 1010 from the first requesting node (CPU0) is a "ReadShared" request to obtain a copy of data stored in the second requesting node (CPU1). Because CPU0 has read permission for the memory address, the home node sends a snoop message 1012 to CPU1 for the data. In period 1014, the data in CPU1 is "bad" in the sense that it has been modified, but cannot be cleaned by writing it back to memory because CPU1 does not have permission to write the data. However, CPU1 sends the modified (dirty) data back to the home node in a snoop response 1016. The access permission in the snoop response 1016 indicates to the home node that CPU1 does not have write permission and that the data is "bad." The home node sends a read request 1018 to the memory controller (DMC) for clean data. The clean data is sent to the first requesting node (CPU0) in message 1020 and the data is acknowledged by the home node in message 1022. At this point, CPU0 has good data, but CPU1 still has bad data. Therefore, the home node sends an invalidation message 1024 to CPU1, which CPU1 acknowledges (1026). In this way, the "bad" data at CPU1 is not passed to CPU0 and is written to memory from there, and the memory is protected.
[0075] 11A and 11B are a flowchart 1100 of a method for filtering access permissions according to an embodiment of the present disclosure, which may be implemented in hardware in a data processing network.
[0076] 11A, a new request from a first requesting node (RN-F or RN-I) is accessed in block 1102, and an address lookup in the MPU in the MXP is performed in block 1104. In block 1106, R / W (read / write) permission is added to the request.
[0077] The home node (HN-F) receives the request and checks the permissions in block 1108. It is determined whether the permissions are acceptable in decision block 1110. If the permissions are not acceptable, an error response is sent in block 1114, as indicated by the NO branch 1112 from decision block 1110, and the protocol flow is completed.
[0078] If the permissions are deemed acceptable, then a cache / snoop filter lookup is performed at block 1118, as indicated by the yes branch 1116 from decision block 1110. A determination is then made as to whether a snoop is required, at decision block 1120. If not, as indicated by the no branch 1122 from decision block 1120, then flow continues to point "A" and thence to decision block 1124 of FIG.
[0079] Referring now to FIG. 11B, if a snoop to slave node SN-F is not required, as indicated by the NO branch 1126 from decision block 1124, then at block 1130 the protocol flow completes without error.
[0080] If the decision is made to proceed to SN-F, as indicated by the YES branch from decision block 1124, a request is sent to the DMC in block 1158 and a response is received from the DMC in block 1160. As discussed above, in block 1030, the protocol flow completes without error.
[0081] 11A, when a snoop is needed as indicated by the yes branch 1132 from decision block 1120, a snoop is sent from the home node to the node indicated in the snoop filter as having a copy of the data (referred to as "snoopy") at block 1134. The MXP intercepts the snoop request and performs a snoop address lookup in the MPU for snoopy permission at block 1136. The MXP colors the snoop transaction identifier with the MPU permission and forwards the snoop request to snoopy at block 1138. The snoopy then processes the snoop request and sends a snoop response with the colored transaction identifier at block 1140.
[0082] The MXP intercepts the snoop response and populates the MPU permission field from the colored transaction identifier in block 1142 and flow continues to point "B."
[0083] 11B, the home node (HN-F) receives the snoop response and checks snoopy permission at block 1144. It is determined whether the snoopy data can be used or consumed at decision block 1146. If so, as indicated by the yes branch 1148 from decision block 1146, the protocol flow completes without error at block 1130.
[0084] If the snoopy data cannot be consumed, as indicated by the NO branch 1150 from decision block 1146, then it is determined whether the request proceeds to SN-F, at decision block 1152. If it proceeds to SN-F, as indicated by the YES branch from decision block 1152, then the request is sent to the DMC, at block 1158, a DMC response is received, at block 1160, and the protocol flow completes without error, at block 1130.
[0085] If it is determined that the request should not proceed to SN-F, as indicated by NO branch 1154 from decision block 1152, an error response is sent at block 1156 and the protocol flow is completed.
[0086] The snoop request received at snoopy or the second requesting node includes a memory address of the snooped data. This memory address can be used by the MPU to determine the access permission. The snoop response generally does not include a memory address, which may include a transaction identifier. In one embodiment, to extend the snoop response with the access permission, the access permission is associated with the transaction identifier in the MPU when the snoop request is received. This may be done, for example, by storing a table in the MPU. The same transaction identifier in the snoop response is then used to identify the access permission when the snoop response is received from snoopy. In another embodiment, the access permission is added to the transaction identifier message sent to snoopy. Thus, the access permission is stored in the request to snoopy and returned in the response from snoopy. For example, the number of transaction identifiers may be reduced by a factor of four, and the access permission is stored in the two most significant bits of the transaction identifier. The transaction identifier is then said to be "colored" by the access permission. In this embodiment, the memory protection unit intercepts a snoop message to the second requesting node, colors a transaction identifier in the snoop message with one or more access permissions of the second requesting node to provide a colored snoop message, and forwards the colored snoop message to the second requesting node. The memory protection unit then intercepts a snoop response from the second requesting node, decolors the transaction identifier in the snoop response, and forwards the decolored snoop response augmented with the one or more access permissions to the home node.
[0087] In either embodiment, the home node sends a snoop message to the second requesting node or snoopy via the MPU, and the second requesting node sends a snoop response including the snooped data. The second memory protection unit extends the snoop response with one or more access permissions for the second requesting node. This is done by looking up the access permissions using the transaction identifier or, for example, by reading the access permissions from the colored transaction identifier. The home node receives the extended snoop response and drops the snooped data when the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to read the snooped data. The home node also drops the snooped data when the snooped data is modified, and the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to write the modified data. In addition, the snooped data at the second requesting node may be invalidated when the snooped data is dropped at the home node and the coherency protocol allows the second requesting node to retain a copy of the first data.
[0088] When the snooped data is dropped by the home node, the home node retrieves the clean data from the shared memory at the first memory address and sends it to the first requesting node.
[0089] FIG. 12 illustrates an apparatus 1200 for filtering requests according to an embodiment of the present disclosure. The apparatus is used to determine whether to grant access to a shared memory based on an authorized access request or to deny the authorized access request. The apparatus 1200 includes a CPU0 1202(a), a CPU0 1202(n), a module 1204(a), a module 1204(n), a cache 1206(a), a cache 1206(n), a node module 1246, and a DMC 1236. CPU0 1202(a) can be considered as a first processor, or a first CPU master, or a CPU / IO. CPU1 1202(n) can be considered as a second processor or a second CPU master.
[0090] Coherent interconnect 1246 includes cross points (MXP) 1212 and 1220, and home node HN-F 1216. MXP 1212 and 1220 each include a memory protection unit (MPU) (1213 and 1221, respectively).
[0091] CPU0 1202(a) and CPU1 1202(n) communicate bidirectionally with a coherent interconnect 1246 via links 1210, 1242 and 1224, 1226, respectively. The coherent interconnect 1246 communicates bidirectionally with a DMC (memory controller) 1236 via links 1234, 1238. The bidirectional communication may be a data communications bus, a wire, a set of wires, a wireless channel, or other suitable transmission medium that allows data to be transferred (sent and / or received) between components of the device 1200.
[0092] During operation, cache 1206(a) of CPU0 1202(a) sends a data access request to MXP 1212 in interconnect 1246, as indicated by line 1242. The MPU at crosspoint 1212 augments the request with an access grant.
[0093] The MPU at crosspoint 1212 sends the request to home node (HN-F) 1216 via line 1214. HN-F 1216 sends a snoop request to CPU1 (1202(n)) via MXP 1220 on link 1218. The MPU at 1220 colors the transaction identifier in the snoop request with an access permission and forwards the snoop request to cache 1206(n) of CPU 11202(n) via line 1224.
[0094] Following receipt at the cache 1206(n), the data response is transmitted from the cache 1206(n) to the MPU at cross point 1220 via line 1226. The transaction identifier in the data response is decolorized by the MPU and forwarded to the HN-F 1216 via line 1228. The HN-F module 1216 transmits the data to the DMC 1236 via line 1234.
[0095] The HN-F module 1216 sends the data to the MXP 1212 via line 1240. The MXP 1212 transfers the data to the cache 1206(a) of the CPU0 1202(a) via line 1210.
[0096] Thus, in various embodiments, an apparatus is provided that includes a plurality of crosspoint switches, a home node, and an interconnect. The crosspoint switch includes a first memory protection unit and provides an interface to a first requesting node, while the interconnect couples between the plurality of crosspoint switches, the home node, and the shared memory. The home node provides a coherency point for access to the shared memory. The memory protection unit intercepts messages directed to the home node from the first requesting node, augments the intercepted messages with one or more access permissions of the first requesting node, and forwards the augmented messages to the home node. The home node responds to the augmented messages according to the one or more access permissions.
[0097] The message received at the memory protection unit is associated with a first memory address in the shared memory, and the memory protection unit is configured to look up one or more access permissions in an address table of the first memory protection unit in response to the first memory address.
[0098] The home node is configured to send a snoop message in response to an access request from the first requesting node, such that a memory protection unit at the second requesting node receives the snoop message from the home node. In response to the snoop message, the second requesting node transmits a snoop response including the snooped data back to the home node. The memory protection unit at the second requesting node intercepts the snoop response, extends the snoop response with one or more access permissions of the second requesting node, and forwards the extended snoop response to the home node. The home node is further configured to drop the snooped data when the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to read the snooped data, and to drop the snooped data when the snooped data is modified and the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to read the modified data.
[0099] In addition, the home node retrieves the clean data from the shared memory when the snooped data is dropped, and forwards the clean data to the first requesting node.
[0100] When the message from the first requesting node includes a read request for data associated with the first memory address in the shared memory and the one or more access permissions indicate that the first requesting node does not have read permission for the first memory address, the home node may send dummy data to the first requesting node. When the message from the first requesting node includes a write request for the first data, the one or more access permissions indicate that the first requesting node does not have write permission for the first memory address, and the write request is of a type that allows the first requesting node to retain a copy of the first data, the home node may invalidate the first data at the first requesting node. When the one or more access permissions indicate that the first requesting node does not have write permission for the first memory address, the home node may drop the write request.
[0101] The access permission in the snoop response can be obtained by coloring the transaction identifier received in the snoop request.
[0102] Figures 13A-D show the MPU coloring of transaction identifiers. A common transaction identifier is included in all messages that are part of the same transaction, such as messages sent along request links 1242, 1214, 1218, and 1236 and response links 1234, 1238, 1240, and 1210, shown in Figure 12, allowing responses to be associated with requests. According to one embodiment, the transaction identifier may be restricted such that bits of the identifier may be used for access permissions.
[0103] 13A shows a register 1320 having bits 1322(a)...(n), where "n" is any suitable number, for holding a transaction identifier. In this example, register 1320 has two bits 1322(a) and 1322(b) that are not used for the restricted transaction identifier. These may be populated with zeros, for example. Register status 1320, which corresponds to a snoop request, depicted in FIG. 12 as snoop request 1218, is transmitted from HN-F 1216 to MXP 1230.
[0104] FIG. 13B shows a register 1320 having bits 1322(a)...(n), where "n" is any suitable number. The register 1320 has two bits 1322(a) and 1322(b), which are occupied by R and W, respectively. The register status 1320, which corresponds to a snoop request, depicted in FIG. 12 as snoop request 1234, is sent from the MXP 1230 to the cache 1206(n) of the CPU 11202(n). The MPU in the MXP uses the address in the snoop request to obtain an access permission and populates the two unused bits 1322(a) and 1322(b) in the transaction identifier field with the access permission. The transaction identifier is said to be "colored" by the access permission.
[0105] Figure 13C shows a register 1320 having bits 1322(a)...(n), where "n" is any suitable number. Register 1320 has two bits 1322(a) and 1322(b), which are occupied by R and W, respectively. This register status 1320 corresponds to the transaction identifier sent from CPU 11202(n) to MXP 1230 over link 1236 in Figure 12. No change is required in the operation of CPU1, since the CPU will return the same transaction identifier (colored with the access permission) upon receiving it.
[0106] FIG. 13D shows a register 1320 having bits 1322(a)...(n), where "n" is any suitable number. Register 1320 has two bits 1322(a) and 1322(b) that are filled with zeros. Bits 1324(a) and 1324(b) are filled with R and W, respectively. This register 1320 corresponds to a snoop response going to the home node. This indicates that the R and W bits are not present in transaction identifier 1320. The access permissions shown as bits 1324(a) and 1324(b) are removed from the transaction identifier and replaced with zeros in the snoop response sent from MXP 1230 to HN-F 1216 via link 1238 of FIG. 12. The snoop response to the home node is extended with the access permissions.
[0107] As used herein, the term "processor" can encompass or use programmable hardware such as computers, microcontrollers, embedded microcontrollers, microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), and complex programmable logic devices (CPLDs). These hardware examples may also be used in combination to achieve a desired function control module. Computers, microcontrollers, and microprocessors may be programmed using languages such as assembly, C, C++, C#, and the like. FPGAs, ASICs, and CPLDs are often programmed using hardware description languages (HDLs) such as Verilog or VHSIC Hardware Description Language (VHDL) that configure connections between internal hardware modules that have less functionality on the programmable device.
[0108] The present disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, systems, and computer program products according to embodiments described herein. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by hardware, or by executed computer program instructions, or by a combination thereof.
[0109] As will be appreciated by one skilled in the art, the embodiments may be described as a system, a method, or a computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, microcode, etc.), or an embodiment combining software and hardware aspects, all of which may be referred to generally herein as a "circuit," "module," or "system."
[0110] Furthermore, the disclosure may take the form of a non-transitory computer-readable medium storing instructions in a hardware description language (HDL) (such as VHDL or Verilog) that describe the apparatus, or storing a netlist description of the claimed apparatus. Such a description may be used, for example, to configure a field programmable gate array (FPGA), or similar configurable hardware, or may be used as input to design tools for custom integrated circuits.
[0111] The various representative embodiments described in detail herein are presented by way of example and not limitation, and those skilled in the art will understand that various changes in form and detail of the described embodiments may be made resulting in equivalent embodiments that remain within the scope of the appended claims.
Claims
1. 1. A method for memory protection in a data processing network, comprising: receiving, by a first memory protection unit of a data processing network, from a first requesting node of said data processing network, a request for an action on data associated with a first memory address in a shared memory of said data processing network; determining, by the first memory protection unit, one or more access permissions responsive to the first memory address; augmenting, by the first memory protection unit, the action request with the one or more access permissions for the first request node for the first memory address; receiving, at a home node of the data processing network, a request message from a first requesting node of the data processing network, the request message including the action request extended with one or more access permissions for the first requesting node for the first memory address, the first requesting node being coupled to the home node via the first memory protection unit; determining, by the home node, whether a requested action of the action request is permitted by the first requesting node from the one or more access permissions in the extended action request; if the requested action is permitted by the first requesting node, accessing the data associated with the first memory address from a system cache, a local cache of a second requesting node of the data processing network, or the shared memory in accordance with a coherency protocol; if the requested action is not permitted by the first requesting node, sending a response message to the first requesting node without accessing the data associated with the first memory address.
2. The method of claim 1 , wherein when the action request includes a read request and the one or more access permissions do not include a read permission, the response message to the first requesting node includes dummy data.
3. 2. The method of claim 1, wherein the action request includes a request to write modified data, the method further including the home node discarding the modified data when the one or more access permissions do not include write permission.
4. The method of claim 3 , further comprising the home node invalidating the modified data at the first requesting node when the one or more access permissions do not include write permission.
5. The action request includes a read request to access the data associated with the first memory address. obtaining, by the home node, modified data associated with the first memory address from the second requesting node; When the second requesting node has write permission for the modified data, when the first requesting node does not have write permission for the modified data; writing, by the home node, the modified data to the shared memory at the first memory address to change the modified data to clean data; transmitting, by the home node, the clean data to the first requesting node; When the first requesting node has write permission for the modified data, transmitting, by the home node, the modified data to the first requesting node; when the second requesting node does not have write permission for the modified data, retrieving, by the home node, clean data from the shared memory at the first memory address; transmitting, by the home node, the clean data to the first requesting node; and invalidating the data associated with the first memory address at the second requesting node.
6. The action request includes a request to invalidate data at the first memory address for which the first requesting node does not have write permission, and accessing the data associated with the first memory address includes: obtaining, by the home node, data associated with the first memory address from the second requesting node; When the acquired data is in a modified coherence state, writing, by the home node, the retrieved data to the shared memory at the first memory address to change a coherence state of the data associated with the first memory address from "modified" to "clean"; and invalidating the data associated with the first memory address at the second requesting node.
7. the second requesting node is coupled to the home node via a second memory protection unit, and the method further comprises: sending, by the home node, a snoop message to the second requesting node; transmitting, by the second requesting node, a snoop response including the snooped data; augmenting, by the second memory protection unit, the snoop response with one or more access permissions for the second requesting node; receiving, by the home node, the extended snoop response; dropping, by the home node, the snooped data when the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to read the snooped data; dropping, by the home node, the snooped data when the snooped data is modified and one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to write the modified data; The method of claim 1 further comprising:
8. 8. The method of claim 7, further comprising invalidating the snooped data at the second requesting node when the snooped data is dropped by the home node.
9. When the snooped data is dropped by the home node, retrieving, by the home node, clean data from the shared memory at the first memory address; The method of claim 7 , further comprising: transmitting, by the home node, the clean data to the first requesting node.
10. the second memory protection unit comprising: Intercepting the snoop message to the second requesting node; coloring a transaction identifier in the snoop message with the one or more access permissions of the second requesting node to provide a colored snoop message; forwarding the colored snoop message to the second requesting node; intercepting the snoop response from the second requesting node; decoloring the transaction identifier in the snoop response; 8. The method of claim 7, further comprising: forwarding the decolorized snoop response extended with the one or more access permissions to the home node.
11. The action request includes a request to invalidate data associated with the first memory address, and accessing the data associated with the first memory address comprises: obtaining, by the home node, data in the system cache or in the local cache of the second requesting node, the data being in a "modified" coherence state; when the first requesting node does not have write permission for the data; writing the data to the shared memory and changing the coherency state of the data from "modified" to "clean" according to the coherency protocol; and transmitting the data to the first requesting node. and changing the coherence state of the data in the system cache or in the local cache of the second requesting node to "invalid."
12. An apparatus comprising: a plurality of crosspoint switches, a first crosspoint switch of the plurality of crosspoint switches including a first memory protection unit and providing an interface to a first requesting node; A home node; an interconnect coupling the plurality of crosspoint switches, the home node, and a shared memory, the home node providing a coherency point for access to the shared memory; Equipped with The apparatus, wherein the first memory protection unit intercepts a message directed to the home node from the first requesting node, augments the intercepted message with one or more access permissions of the first requesting node, and forwards the augmented message to the home node, and the home node responds to the augmented message in accordance with the one or more access permissions.
13. 13. The apparatus of claim 12, wherein the message is associated with a first memory address in the shared memory, and the first memory protection unit is configured to look up the one or more access permissions in an address table of the first memory protection unit in response to the first memory address.
14. a second crosspoint switch of the plurality of crosspoint switches includes a second memory protection unit and provides an interface to a second requesting node; the home node is configured to send a snoop message to the second requesting node in response to the message from the first requesting node; the second requesting node is configured to transmit a snoop response including the snooped data to the home node in response to the snoop message; the second memory protection unit is configured to intercept the snoop response, extend the snoop response with one or more access permissions of the second requesting node, and forward the extended snoop response to the home node; The home node: dropping the snooped data when the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to read the snooped data; dropping the snooped data when the snooped data is modified and the one or more access permissions for the second requesting node indicate that the second requesting node does not have permission to write the modified data. The apparatus of claim 12 further configured to:
15. 15. The apparatus of claim 14, wherein the home node is further configured to obtain clean data from the shared memory when the snooped data is dropped and forward the clean data to the first requesting node.
16. 13. The apparatus of claim 12, wherein the home node is further configured to send dummy data to the first requesting node when the message from the first requesting node includes a read request for data associated with a first memory address in the shared memory, and the one or more access permissions indicate that the first requesting node does not have permission to read the first memory address.
17. The apparatus of claim 12, further configured: when the message from the first requesting node includes a write request for first data and the one or more access permissions indicate that the first requesting node does not have write permission for the first memory address, the home node invalidates the first data associated with the first memory address at the first requesting node.
18. 20. The apparatus of claim 17, wherein the home node is further configured to drop the write request when the one or more access permissions indicate that the first requesting node does not have write permission for the first memory address.
19. 13. A non-transitory computer readable medium comprising instructions in a hardware description language that describes the apparatus of claim 12.
20. 13. A non-transitory computer readable medium comprising a netlist description of the apparatus of claim 12.
21. An integrated circuit comprising the apparatus of claim 12.
Citation Information
Patent Citations
Data processor and data processing method for controlling access to memory
JP2006216012A
Correction of control data in cache memory
JP2008293494A
Information processing apparatus and unauthorized access prevention method
JP2013140446A
Information processing device, method for controlling information processing device, and arithmetic processing unit
JP2017123051A
Data processing
JP2018109965A
