1. Technical Field of the Invention
The embodiments of the invention relate to processing systems and, more particularly, to systems having multiple processors or processing cores.
2. Description of Related Art
In today's highly technology oriented environment, processing systems are implemented in just about any device that provides data manipulation or user interaction. More familiar devices that implement a processor include personal computers, laptop computers, tablet computers, servers, mobile phones, gaming consoles, televisions, digital video recorders and players, set-top boxes, instrumentation, communication devices and appliances. These are just examples and are not inclusive of devices that implement processing units or systems.
In many devices, the processing unit may have multiple processors or processing cores in order to provide higher performance and/or multi-tasking. In some of these multi-processor systems, when multiple applications or programs are running, access control is typically needed to separate the functionality of the applications running on multiple processors. Separation or segregation of different applications and/or tasks running on different processors ensures that one application does not interfere with the execution of another. Likewise data assigned to one processor should not be accessed by another processor, unless that data is shared between the two processors. Therefore, one aspect of this separation is the controlling of bus accesses each application may make to the rest of the system.
Typical bus access control in a CPU (Central Processing Unit), whether single or multiple processors, is performed by a system Memory Management Unit (MMU) under control of an Operating System (OS) software. Because the MMU relies on software and the OS, subversion in the programming or bugs in the system may lead to unintended bus access control, which could lead to an access violation across the separation zone.
For example, in a multi-processor system, in which one processor environment provides trusted or secure operations while another operates in an unsecure or restricted environment, there is a substantial possibility of an incursion from the unsecure zone into the secure zone, when the OS is managing the separation. For example, in a set-top box that allows a user to receive television signals and also allows the user to access the Internet, the secure environment may run applications pertaining to the reception and displaying of certain channels provided by a cable or satellite provider. The unsecure environment in the set-top box may be the applications that allow a user to access the Internet for web browsing, gaming, etc. In this example, the content provider (e.g. cable or satellite provider) would not want the user or anyone else to access the applications pertaining to the channels. However, if there is commonality in software that controls the accesses to both environments, such as running the same OS to manage accesses in both environments, then there is a higher risk of a violation. Thus, such a violation, whether intentional or non intentional, could result in an unsecure breach into the secure applications of the set-top box, such as a web-induced breech into the television channels.
Accordingly, there is a need to obtain a much more efficient way to provide a separation of processor environments which does not rely strictly on the system OS.
The embodiments of the present invention may be practiced in a variety of computing circuits, devices and/or systems that utilize multiple processors, processing cores and/or processing circuits. The illustrations herein describe a processing module, a processor or a CPU (e.g. CPU1, CPU2) for a device that provides a processing function in the described embodiments. However, it is appreciated that a variety of other devices and/or nomenclature may be used in other embodiments to provide for the processing function in practicing the invention. Furthermore, the particular example embodiments implement the hardware controls for bus access in a secondary (or L2) cache. In other embodiments, other levels of cache may implement the invention to control bus access. The invention may be readily adapted to other usages where multiple processing environments (zones, domains, etc.) exist, in which separation and/or segregation between two or more zones is to be implemented.
SC 13 is coupled to a Bus Interface Unit (BIU) 19, which interfaces SC 13 to a bus that is used for accessing other portions of system 10 (henceforth noted as system portion 14). System portion 14 exemplifies other portions of system 10 that may be accessed by BIU 19 and may include (but not limited to) memory, peripherals, other cache or storage devices, bridges, buses, registers, etc. In one embodiment, system portion 14 is representative of a Random Access Memory (RAM), in which SC 13 communicates with the memory via BIU 19. Generally, Static RAM (SRAM) devices or circuitry is utilized for cache memories, such as SC 13, and Dynamic RAM (DRAM) devices or circuitry is utilized for memory. However, the cache and memory may not be limited to such devices and other devices may be readily used in other embodiments.
In a typical operation, when one of the processing modules 11, 12 generates a request to access system portion 14, a tag address is generated for a hit in its L1 cache. When a cache line miss occurs in the L1 cache, the address tag is passed to SC (or L2 cache) 13 for a hit in SC 13. When a cache line miss occurs in SC 13, SC 13 then accesses system portion 14 corresponding to the address request. When system portion 14 being accessed is a memory, the fetch is a data access pertaining to the memory. Since SC 13 is an inclusive cache, any cache line hit in SC 13 ensures a hit in L1 cache. It is appreciated that general operations of cache memories, including cache line hits and misses, victimizing a cache line, or maintaining cache coherency are known in the art.
When the access is to memory, SC 13 accesses a location in memory via a bus and BIU 19. Generally, when a processing module generates an access request, an address is generated and, typically translated, to provide either a physical address or a virtual address that corresponds to a location in memory. As noted above, the memory may be RAM memory, or it may be other types of memory, including hard disk, flash, etc. Furthermore, although not shown, other components may reside between SC 13 and system portion 14 shown in
As shown in
As noted in the Background section above, a number of devices utilize multiple processors or processing cores to run separate programs, applications, etc. In a situation where one zone is not to have access to a second zone, one way to ensure this separation is by checking the accesses to the system portion 14. That is, by ensuring accesses that are allocated to the Processing Module A are not accessed by Processing Module B, unless the location of the access is a shared location, applications running on Processing Module B may be prevented from breaching the functional separation 16. One way to achieve this protection is to provide an access check and access control to ensure that the correct processing module is accessing a permitted location for that processing module. Since SC 13 is at the highest common hierarchical level to Processing Module A and Processing Module B, placing the access control at this level ensures that accesses generated below SC 13 fall within the protection.
Also as noted in the Background section above, having the system OS, or other types of operating software, provide the access control is a detriment, since these types of programs may be accessed and readily breached. In order to ensure that software programming is not the base access control for controlling system access from SC 13, embodiments of the invention rely on hardware controls to establish and maintain the bus access control. Accordingly, as shown in
In operation, when initialized, ACM 15 executes a set-up routine to establish the functional separation of Processing Module A and Processing Module B within SC 13. As described in detail below, ACM 15 sets the locations of system portion 14 that may be accessed by Processing Module A and Processing Module B and this control is established within SC 13. Since all accesses to BIU 19 from Processing Module A and Processing Module B traverses through SC 13, address mapping control within SC 13 ensures the capture of all access requests generated by Processing Module A and Processing Module B. When a particular access request comes from a particular processing module, an access check may be performed within SC 13 to check if that particular processing module has authorization to access the location specified for the particular access request.
Because ACM 15 is a separate processing device from Processing Module A and Processing Module B and because ACM 15 is a dedicated processor or processing device to perform the initialization operation to set the location partition definition in SC 13, the OS is not the main entity setting the zone separation. ACM 15, upon initialization connects with SC 13 to set addresses (or address range) corresponding to locations of system portion 14, which may be accessed by SC 13 for Processing Module A and to set addresses (or address range) corresponding to locations system portion 14 which may be accessed by SC 13 for Processing Module B. This address setting in SC 13 is permitted only by ACM 15 and not permitted by either of the processing modules 11, 12. Once set, any access from Processing Module A or Processing Module B to system portion 14 have the address generated by the requesting processing module checked with the ACM set up addresses in SC 13. If the access check passes, that processing module access is permitted and SC 13 communicates to transfer data between SC 13 and system portion 14. However, when the access check fails, SC 13 is prevented from making the access (such as for data transfer).
Strictly as an example, in this manner, a set-top box provider may program ACM 15 to reserve certain locations of system portion 14 for use by the Zone A. Processing Module A would provide various secure functions (when Zone A is set up as the secure zone), such as setting the set-top box to receive certain cable or satellite channels. ACM 15 may be used to set the addresses of locations that may be accessed by Processing Module B as well. This is typically done at initialization, such as at turn-on, boot, reset, etc. Once SC 13 is programmed with addresses that are reserved for Processing Module A and Processing Module B, Processing Module B may be loaded with OS programming, applications programming, etc. If for example, the set-top box is to have Internet access capability, Zone B may provide that function. During operation, all accesses to memory generated by Processing Module B are checked with the addresses locations stored in SC 13 to ensure that Processing Module B is permitted access to that location. In this manner, unauthorized access attempts to system portion 14 from a non-secure Zone B (whether by user attempt, entry through public connections, etc.) are caught in SC 13, before such an access is permitted. Furthermore, since only ACM 15 has the ability to change the address set-up in SC 13, other programming attempts through Zone B, OS, applications program, etc. are not successful. More detailed embodiments of system 10 are illustrated in
SC 23 also includes cache control module 31, access check module 32 and control registers 33. SC 23 also includes one or more data banks 30 to store the cached data. When one of the CPUs 21, 22, makes an address access, it first checks its primary cache for a hit. When a miss occurs, the request is passed to cache control module 31 of SC 23. Cache control module translates the address and attempts for a hit in data bank 30. Generally, address tags are compared to determine if data bank 30 contains a valid cache line corresponding to the tag. Cache control module 31 also performs other functions such as maintaining data coherence, victimizing, as well as other functions normally performed for caches. However, beyond normal operations for caches, SC 23 includes control registers 33 and access check module 32 to provide the access check function earlier described in reference to
During initialization, ACM 25 programs control registers 33 to define what locations in memory 24 are accessible by each of the CPUs. A variety of control register configurations may be used for control registers 33 to define which locations in memory may be accessed by each CPU.
Register 43 contains values that determine which CPU has access to the specified address range determined by registers 41, 42. Register 43 also determines if an allowed access type is a read access and/or a write access to the specified address range. In one embodiment, a bit is set for CPU1 read (R) access right, a bit for CPU1 write (W) access right, a bit for CPU2 read access right and a bit for CPU2 write access right. The bits of register 43 may be set in any combination to determine which CPU may access the address range and which type of access (read and/or write) is permitted. For example, setting only the CPU1 read and CPU1 write access bits would allow SC 23 to permit read and write accesses to the specified range of address locations by CPU1. This would be the instance when CPU1 and CPU2 are sandboxed to separate the two zones, in which CPU2 would be prevented from accessing the specified address range. Register 44 is used to contain values pertaining to various other controls that may be placed on the specified address range defined by registers 41, 42. For example, ReadCheck or WriteCheck operations may be set using values in control register 44.
Control registers 33 may be comprised of a number of such register sets 40. When multiple registers sets 40 are utilized, the memory may be mapped into isolated regions for CPU1 and CPU2.
It is to be noted that a plurality of register sets provide for a plurality of mapping regions. In one embodiment, eight register sets 40 are used to define eight mapping regions of the memory. In another embodiment, memory 24 is pre-mapped into eight distinct regions and a register set is assigned to each region. The values in registers 41, 42 provide offsets within that region that are controlled for access by each of the CPUs. Other schemes may be used as well. It is also to be noted that registers are described herein, such as control registers 33. However, it is to be noted that storage devices, other than registers, may be used in other embodiments to provide the storage functionality.
Furthermore, in some instances, certain locations in memory may be regarded as shared space, where that shared space is accessible by both CPUs.
Referring again to
Furthermore, in one embodiment, a dedicated ACM port 34 is used to couple ACM 25 to control registers 33. That is, ACM 25 is coupled to control registers 33 through dedicated port 34, so that no other component may access control registers 33 to program control registers 33. Thus, only ACM 25 has the capability of programming the values into control registers 33.
Then, in the example operation, when the two CPUs are to be separated into the two afore-mentioned Privileged and Restricted Zones for sandbox mode operation, control registers 33 are accessed for an access check by access check module 32 to determine if the particular processor has rights to access the address location for the type of access attempted. For example, when CPU2 requests an access to a location in memory, cache control module 31 provides the address tag to determine a hit in a cache line of data bank 30. At the same time, the address is checked in the control registers to determine if CPU2 has access rights to a region that particular location resides in and for the type of access (read/write) attempted. If the access rights check does not confirm a permission to access that location, then the access attempt is not permitted. An error signal, exception or some other indication signaling an unauthorized access attempt is made known to the system. If the address location fits within a range of addresses permitted for that access, then SC 30 makes the access to memory, provided the type of access is also permitted.
A similar scenario may apply to an access by CPU1 as well. In one embodiment, CPU1 and CPU2 are both segregated into separate and distinct zones when in a sandboxing mode. In another embodiment, the trusted CPU1 is set up having its own segregated regions of memory and also given access rights over some or all address ranges of memory mapped portions of CPU2. In some embodiments, it may be desirable to turn off the sandbox mode, which separates the zones. In that instance, the system turns off the sandbox mode and the control registers 33 are ignored. The two CPUs then would operate normally as a two CPU processing machine without implementing the access check control as described above with the use of control registers 33.
In certain situations or systems, there may be an instance when data is not cached. In order to provide for sandbox protection to uncached data, in an alternative embodiment, a second access check is provided somewhere in a pathway to other portions of the system. For example, with system 20 of
Each processing core includes a processor execution pipeline 60, instruction cache 61, data cache 62 and processor interface 63. Note that “A” is appended to the item number for those items associated with the Privileged Zone and “B” is appended to the item number for those items associated with the Restricted Zone. The instruction cache and the data cache are equivalent to the primary cache of
SC 23 includes an interface 64A to couple to respective core interface 63A in the Privileged Zone and interface 64B to couple to respective core interface 63B in the Restricted Zone. Note that one interface 64 is associated with a given core. Thus, four interfaces 64 are used for a quad core system. SC data bank 30 is a multi-banked cache that is coupled to interfaces 64 via data switch 77 for transfer of data between the data banks and the CPUs. SC data bank 30 is also coupled to interface 35 via data switch 77 for transfer of data between the data banks and memory 24. In the example, two interfaces 35 are shown coupled to two separate memory buses, noted as SCB Memory Bus0 and SCB Memory Bus1. Two buses are used in
ACM port 34 is illustrated in the lower right corner and is used as a dedicated port to couple to ACM 25. As shown, ACM port 34 is coupled to control registers 33, so that ACM 25 may program the set of registers of the control registers 33. The access check module 32 is coupled to control registers 33 for providing the access check as described earlier above.
Cache control module 31 of
As noted above, when an access request is received at module 70, in parallel with the tag checking, access check module 32 performs the access rights check by accessing control registers 33 to determine if the attempted access request from a particular processor is within the authorized address range for that processor. A type (read/write) check is also performed to determine if that particular type of access is granted for that processor for the specified address. When the access rights check passes, access check module authorizes the access. If the check fails, an indication is sent to module 74 and module 74 ensures that data switch 77 is not activated to perform the data transfer through data switch 77.
It is to be noted that
As noted above in reference to
In addition to the access check to control bus access in a multi-processor system, where some of the processors share resources, the ownership of these resources should be tracked and restricted to match the access separation. A data asset, such as a cache line or a transient entry in a write buffer may be present in the system as a result of allowed bus accesses from multiple processors. Each asset should be systematically tracked for ownership as it traverses the system. Without hardware-managed ownership tracking, there is no secure way to separate the access rights to the data items traversing the system.
In order to ensure data ownership and to track ownership throughout the processor-SC level of the hierarchy, ownership flags are attached to a data asset and travels with the data asset at the upper hierarchy level of the processor and the secondary cache. Accordingly, as shown in
In
In
With the particular operation of SC 23, the access rights flags are attached to the tag and a corresponding flag bit is set based on which processor filled the cache line. Since SC 23 caches both CPU1 and CPU2 entries, the access rights flags determine which CPU has ownership to the cached data corresponding to the cache line. When data associated with the cache line travels within the system at the processor-SC hierarchy level, such as in the pipeline stages of SC 23, the flags are also present. When a processor requests access to a particular asset, the associated access rights flags are checked to determine ownership. If the data item has its flag set corresponding to the requesting processor, the access to the data item is granted. Otherwise, the attempt to access the data item fails. Optionally, accesses attempting to violate another CPU's data are reported to the system and/or to the CPU having ownership of the data item.
Accordingly, ownership tracking is provided within SC 23 by use of access rights flag bits that are attached to a data item or asset. In one embodiment, the data item is a tag associated with a cache line. By associating a hard bit with the data item, ownership of that data item may be tracked within SC 23, so that unauthorized access to the data item by another processor is prevented. Tracking the ownership throughout SC 23 allows for secure separation of accesses without the involvement of the OS and/or application software. Furthermore, it is to be noted that the ownership flag usage need not be limited to SC 23. The ownership flags may be used at other levels than the Secondary Cache. The technique may be used with other sub-systems as well.
Furthermore, it is to be noted that the access rights flag bits to indicate ownership are in addition to any cache coherency protocol, such as MSI, MESI, MOSI, MOESI, etc., protocols used to maintain cache coherency. Accordingly, SC may implement the access rights flag bits in addition to one of the cache coherency protocols and the access rights flag bits should not be confused with the ownership bit assigned for maintaining coherency.
Thus, a scheme to maintain bus access control and to track data assets in a cache memory utilized by multiple processing modules, processors or processor cores to obtain secure separation between separated processing zones is described. The dedicated hardware protection provided in the cache memory is less susceptible to access by other programs running on the system, such as an OS or applications software.
It is further to be noted that there are many applications for implementing various embodiments of the invention. As noted, one environment is the implementation of the invention for sandbox operations when more than one processing modules, processors (or sets of processors) or cores are to be separated or segregated into different zones. In one implementation, one zone is a Privileged Zone, while the second is a Restricted Zone. Examples of this usage are in set-top box functionality, whether provided in a separate set-top box or integrated into a television unit, or some other renderer. In one application, the Privileged Zone would run the functions set by a cable or satellite provider for receiving content, such as television channels, paid content, etc. The Restricted Zone may be utilized to run user or public based applications or connect to a public communication link, such as web browsing on the Internet via an Internet pathway, and/or providing wireless (e.g. Wi-Fi, WiMax, hotspot) communication access. Other examples abound.
Likewise, another example is the use of an embodiment of the invention in mobile devices in which the Privileged Zone is used to run mobile communications that connect to a wireless provider of the device, such as a cellular telephone provider, while the Restricted Zone may be used to run user accessed applications on the handheld device and/or provide connection to a wireless router or local hotspot for accessing the Internet. Similarly, other examples include, gaming consoles, personal computers (PCs), notebook or laptop computers, tablet computers, as well as others.
As may also be used herein, the terms “processing module”, “processing circuit”, and/or “processing unit” may be a single processing device or a plurality of processing devices. Such a processing device may be a microprocessor, micro-controller, digital signal processor, microcomputer, central processing unit, field programmable gate array, programmable logic device, state machine, logic circuitry, analog circuitry, digital circuitry, and/or any device that manipulates signals (analog and/or digital) based on hard coding of the circuitry and/or operational instructions. The processing module, module, processing circuit, and/or processing unit may be, or further include, memory and/or an integrated memory element, which may be a single memory device, a plurality of memory devices, and/or embedded circuitry of another processing module, module, processing circuit, and/or processing unit. Such a memory device may be a read-only memory, random access memory, volatile memory, non-volatile memory, static memory, dynamic memory, flash memory, cache memory, and/or any device that stores digital information. Note that if the processing module, module, processing circuit, and/or processing unit includes more than one processing device, the processing devices may be centrally located (e.g., directly coupled together via a wired and/or wireless bus structure) or may be distributed (e.g., cloud computing via indirect coupling via a local area network and/or a wide area network). Further note that if the processing module, module, processing circuit, and/or processing unit implements one or more of its functions via a state machine, analog circuitry, digital circuitry, and/or logic circuitry, the memory and/or memory element storing the corresponding operational instructions may be embedded within, or external to, the circuitry comprising the state machine, analog circuitry, digital circuitry, and/or logic circuitry. Still further note that, the memory element may store, and the processing module, module, processing circuit, and/or processing unit executes, hard coded and/or operational instructions corresponding to at least some of the steps and/or functions illustrated in one or more of the Figures. Such a memory device or memory element can be included in an article of manufacture.
The embodiments of the invention have been described above with the aid of method steps illustrating the performance of specified functions and relationships thereof. The boundaries and sequence of these functional building blocks and method steps have been arbitrarily defined herein for convenience of description. Alternate boundaries and sequences can be defined so long as the specified functions and relationships are appropriately performed. Any such alternate boundaries or sequences are thus within the scope and spirit of the claimed invention. Further, the boundaries of these functional building blocks have been arbitrarily defined for convenience of description. Alternate boundaries could be defined as long as the certain significant functions are appropriately performed. Similarly, flow diagram blocks may also have been arbitrarily defined herein to illustrate certain significant functionality. To the extent used, the flow diagram block boundaries and sequence could have been defined otherwise and still perform the certain significant functionality. Such alternate definitions of both functional building blocks and flow diagram blocks and sequences are thus within the scope and spirit of the claimed invention. One of average skill in the art will also recognize that the functional building blocks, and other illustrative blocks, modules and components herein, can be implemented as illustrated or by discrete components, application specific integrated circuits, processors executing appropriate software and the like or any combination thereof.
The invention has also been described, at least in part, in terms of one or more embodiments. An embodiment of the present invention is used herein to illustrate the present invention, an aspect thereof, a feature thereof, a concept thereof, and/or an example thereof. A physical embodiment of an apparatus, an article of manufacture, a machine, and/or of a process that embodies the present invention may include one or more of the aspects, features, concepts, examples, etc. described with reference to one or more of the embodiments discussed herein. Further, from figure to figure, the embodiments may incorporate the same or similarly named functions, steps, modules, etc. that may use the same or different reference numbers and, as such, the functions, steps, modules, etc. may be the same or similar functions, steps, modules, etc. or different ones.
The term “module” is used in the description of the various embodiments of the present invention. A module includes a processing module, a functional block, hardware, and/or software stored on memory for performing one or more functions as may be described herein. Note that, if the module is implemented via hardware, the hardware may operate independently and/or in conjunction software and/or firmware. As used herein, a module may contain one or more sub-modules, each of which may be one or more modules.
While particular combinations of various functions and features of the invention have been expressly described herein, other combinations of these features and functions are likewise possible. The invention is not limited by the particular examples disclosed herein and expressly incorporates these other combinations.
This application is related to U.S. patent application titled “Tracking ownership of data assets in a multi-processor system” (Docket No. BP24375), having application Ser. No. ______ and a filing date of ______.