Peripheral access control using a bitmask indicating peripheral access settings
The use of programmable access control identifiers and controllers in SoCs manages peripheral access based on mode, addressing firmware access issues and enhancing security by preventing unauthorized interactions.
Patent Information
- Application Number
- JP2024505099
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-11-29
- Filing Date
- 2023-01-04
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2043-01-04
AI Technical Summary
In systems on a chip (SoCs), firmware has unrestricted access to all peripherals, leading to potential malfunctions or malicious interference between peripherals, necessitating improved access control to protect against accidental or malicious access.
Implementing programmable access control identifiers and access controllers to manage access to peripherals based on mode of operation, using bitmasks to determine access permissions for each task, ensuring secure and controlled access.
This approach enhances security by preventing unauthorized access, reducing the need for complex software, and allowing for smaller or cheaper processors by isolating peripheral access, thus mitigating risks of malfunction or malicious interference.
Smart Images

Figure 2024536673000001_ABST
Abstract
Description
[Technical Field]
[0001] (Related patent applications) This application claims priority to Indian Patent Application No. 202211000733 filed on January 6, 2022, the contents of which are incorporated herein by reference for all purposes.
[0002] (Technical field) The present disclosure relates to electronic devices that include peripherals, and more particularly to peripheral access control using a bitmask that indicates the access settings of the peripherals. [Background technology]
[0003] A system-on-chip, also known as a system-on-chip or SoC, is an integrated circuit (IC) that integrates an electronic or computer system on a single chip. An SoC typically includes at least one processor, such as a central processing unit (CPU), microcontroller, or microprocessor (MPU), and various peripheral devices, such as input / output ports, internal memory, and analog input and output blocks, such as a wireless modem, a graphics processing unit (GPU), and / or one or more coprocessors, all on a single substrate or microchip. SoCs can be designed for various functions, such as signal processing, wireless communication, or artificial intelligence.
[0004] In some SoCs, firmware executing on the processor has complete access to all peripherals on the SoC, regardless of the processor's current operating mode, e.g., privileged mode or user mode. This can lead to malfunctions or other undesirable results. For example, a faulty or malicious firmware device driver corresponding to one peripheral can mistakenly (or maliciously) access and corrupt another peripheral, e.g., by modifying registers provided within the other peripheral.
[0005] For example, there is a need for improved, low-cost access control for peripherals located within an SoC or other electronic device to protect the peripherals from faulty or malicious firmware. Summary of the Invention
[0006] Systems and methods are provided for controlling access to peripheral devices within an electronic device (e.g., an SoC or other electronic device) to, for example, protect the peripheral devices from accidental or malicious access. Some examples provide a programmable (e.g., updatable) access control identifier corresponding to each peripheral device and a respective access controller for controlling access to the respective peripheral device based at least on the access control identifier. The access control identifier may include one or more bits, referred to herein as access control bits. The access control identifier may be used to protect the peripheral device during execution of a user-space task (e.g., a device driver operation associated with a selected peripheral device). For example, to execute a respective task (e.g., a device driver operation) associated with a selected peripheral device, a transaction host (e.g., a processor) may execute supervisor firmware or other supervisor code to program (e.g., set or update) the respective access control identifier in an access control register to (a) enable the respective task to access the selected peripheral device and (b) prohibit the respective task from accessing other peripheral devices, e.g., prohibit the respective task from accidental or malicious access to registers within any of the other peripheral devices. In some examples, the access controller may allow a transaction host (e.g., a processor) to program, e.g., set or update, respective access control identifiers to allow supervisor code access to all peripherals during privileged mode operation, e.g., execution of associated supervisor firmware.
[0007] In some examples, a respective bit mask is stored for each task (e.g., device driver operation), and the bit mask for each task indicates a respective access setting for each peripheral device for executing the respective task. Prior to executing each task, the transaction host can access the bit mask associated with each task and program (e.g., set or update) a respective access control identifier in the access control register. The programmed respective access control identifier is accessible and usable by the access controller associated with the respective peripheral device to control access to the respective peripheral device during execution of the respective task.
[0008] In some applications, the access control identifier and access controller can eliminate the need for complex software, thus allowing for smaller or cheaper processors, for example in SoCs.
[0009] One aspect provides an electronic device including a transaction host, a first peripheral device, a second peripheral device, a first access controller connected to the first peripheral device, a second access controller connected to the second peripheral device, and an access control register that stores a first access control identifier for the first peripheral device and a second access control identifier for the second peripheral device, wherein the first access controller receives an access request for access to the first peripheral device by the transaction host, performs an access decision for the first peripheral device based on at least the first access control identifier for the first peripheral device, and grants or denies transaction host access to the first peripheral device based on the access decision.
[0010] In some examples, the transaction host comprises a processor or a direct memory access (DMA) engine.
[0011] In some examples, the transaction host comprises a bridge that receives a request from an external host, separate from the electronic device, to access the first peripheral.
[0012] In some examples, the first access control identifier includes one or more first access control bits and the second access control identifier includes one or more second access control bits.
[0013] In some examples, the electronic device includes firmware executable by the transaction host to program at least one of the first access control identifier and the second access control identifier based on an operational mode of the transaction host.
[0014] In some examples, the electronic device comprises firmware executable by the transaction host to dynamically program at least one of a first access control identifier for a first peripheral device and a second access control identifier for a second peripheral device between (a) an access permission setting that allows the transaction host to access the respective peripheral device and (b) an access prohibition setting that prohibits the transaction host from accessing the respective peripheral device.
[0015] In some examples, the electronic device comprises firmware executable by the transaction host to program the first access control identifier and the second access control identifier, which includes: (a) programming both the first access control identifier and the second access control identifier to an access permission setting that enables access by the transaction host to both the first peripheral device and the second peripheral device for privileged mode operation of the transaction host; (b) programming the first access control identifier to an access permission setting to enable access to the first peripheral device and the second access control identifier to an access prohibition setting to prohibit access to the second peripheral device for first user mode operation of the transaction host to perform operations related to the first peripheral device; and (c) programming the first access control identifier to an access prohibition setting to prohibit access to the first peripheral device and the second access control identifier to an access permission setting to enable access to the second peripheral device for second user mode operation of the transaction host to perform operations related to the second peripheral device.
[0016] In some examples, the access controller performs an access decision for the first peripheral device based at least on (a) a peripheral-specific access control identifier for the first peripheral device and (b) an operational mode signal indicating either a privileged mode of the transaction host or a user mode of the transaction host.
[0017] In some examples, the first access control identifier for the first peripheral device and the second access control identifier for the second peripheral device each indicate either (a) a restricted access setting that allows access to the respective peripheral device only in a transaction host privileged mode, or (b) an open access setting that allows access to the respective peripheral device in both a transaction host privileged mode and a transaction host user mode.
[0018] In some examples, the electronic device includes firmware executable by the transaction host to program at least one of the first access control identifier and the second access control identifier between a restricted access setting and an open access setting.
[0019] In some examples, the access controller (a) determines to enable access to the first peripheral device if the first access control identifier for the first peripheral device indicates an open access setting and the operational mode signal indicates a privileged mode of the transaction host, (b) determines to enable access to the first peripheral device if the first access control identifier for the first peripheral device indicates an open access setting and the operational mode signal indicates a user mode of the transaction host, (c) determines to enable access to the first peripheral device if the first access control identifier for the first peripheral device indicates a restricted access setting and the operational mode signal indicates a privileged mode of the transaction host, and (d) determines to prohibit access to the first peripheral device if the first access control identifier for the first peripheral device indicates a restricted access setting and the operational mode signal indicates a user mode of the transaction host.
[0020] In some examples, the transaction host is selectively operable in a privileged mode and a user mode, and at least one of the first access control identifier and the second access control identifier is programmable only in the privileged mode of the transaction host.
[0021] In some examples, the electronic device includes firmware executing on a transaction host, and allowing or prohibiting access to the first peripheral device includes allowing or prohibiting access to the first peripheral device by the firmware executing on the transaction host.
[0022] In some examples, the access control register is provided within a designated peripheral of the plurality of peripherals.
[0023] In some examples, the electronic device includes an additional transaction host, the first access control identifier and the second access control identifier are associated with the transaction host, and the access control register stores a third access control identifier for the first peripheral device associated with the additional transaction host and a fourth access control identifier for the second peripheral device associated with the additional transaction host. The access controller receives an additional access request for access to the first peripheral device by the additional transaction host, makes an additional access decision for the first peripheral device based on (a) the access request identifier identifying the additional transaction host and (b) the third access control identifier, and grants or denies access to the first peripheral device by the additional transaction host based on the additional access decision.
[0024] In some examples, the electronic device is a system-on-chip (SoC) device.
[0025] Another aspect provides a method in an electronic device including a transaction host, a first peripheral device, a second peripheral device, and an access control register, the method including storing, in the access control register, (a) a first access control identifier for the first peripheral device and (b) a second access control identifier for the second peripheral device. A first access controller associated with the first peripheral device receives a request by the transaction host to access the first peripheral device. The first access controller performs an access decision to grant or deny access to the first peripheral device based on at least the first access control identifier for the first peripheral device, and grants or denies access to the first peripheral device based on the access decision.
[0026] In some examples, the method includes executing, by the transaction host, firmware to program at least one of the first access control identifier and the second access control identifier based on an operational mode of the transaction host.
[0027] In some examples, the method includes executing firmware, by the transaction host, to dynamically program at least one of a first access control identifier for the first peripheral device and a second access control identifier for the second peripheral device between (a) an access permission setting that allows the transaction host to access the respective peripheral device and (b) an access prohibition setting that prohibits the transaction host from accessing the respective peripheral device.
[0028] In some examples, the method includes executing firmware by the transaction host to program a first access control identifier and a second access control identifier, the method including: (a) for privileged mode operation of the transaction host, setting both the first access control identifier and the second access control identifier to an access permission setting that enables the transaction host to access both the first peripheral device and the second peripheral device, respectively; (b) for first user mode operation of the transaction host to perform an operation associated with the first peripheral device, setting the first access control identifier to an access permission setting and setting the second access control identifier to an access prohibition setting that prohibits access to the second peripheral device; and (c) for second user mode operation of the transaction host to perform an operation associated with the second peripheral device, setting the first access control identifier to an access prohibition setting and setting the second access control identifier to the access permission setting.
[0029] In some examples, the method includes performing, by the first access controller, an access decision to grant or deny access to the first peripheral device based at least on (a) a first access control identifier for the first peripheral device and (b) an operational mode signal indicating either a privileged mode of the transaction host or a user mode of the transaction host.
[0030] In some examples, the first access control identifier for the first peripheral device and the second access control identifier for the second peripheral device each indicate either (a) a restricted access setting that prohibits access to the respective peripheral device in a user mode of the transaction host, or (b) an open access setting that allows access to the respective peripheral device in both a privileged mode of the transaction host and a user mode of the transaction host.
[0031] In some examples, the method includes executing firmware by the transaction host to dynamically program at least one of the first access control identifier and the second access control identifier between a restricted access setting and an open access setting.
[0032] In some examples, performing the access decision to allow or prohibit access to the first peripheral device includes: (a) enabling access to the first peripheral device if the peripheral-specific access control identifier for the first peripheral device indicates an open access setting and the operational mode signal indicates a privileged mode of the transaction host; (b) enabling access to the first peripheral device if the first access control identifier for the first peripheral device indicates an open access setting and the operational mode signal indicates a user mode of the transaction host; (c) enabling access to the first peripheral device if the first access control identifier for the first peripheral device indicates a restricted access setting and the operational mode signal indicates a privileged mode of the transaction host; and (d) prohibiting access to the first peripheral device if the first access control identifier for the first peripheral device indicates a restricted access setting and the operational mode signal indicates a user mode of the transaction host.
[0033] In some examples, the method includes enabling programming of the first access control identifier in a privileged mode of the transaction host and disallowing programming of the first access control identifier in a user mode of the transaction host.
[0034] Another aspect provides a method in an electronic device including a transaction host, a first peripheral device, a second peripheral device, and an access control register, including storing a first access control identifier for the first peripheral device and a second access control identifier for the second peripheral device in the access control register. The transaction host sets the first access control identifier and the second access control identifier to enable access to the first peripheral device and the second peripheral device, respectively, and the transaction host performs privileged mode operations at a first time. Subsequently, the transaction host (a) sets the first access control identifier to enable access to the first peripheral device by the transaction host, and (b) sets the second access control identifier to prohibit access to the second peripheral device by the transaction host, and performs user mode operations with respect to the first peripheral device at a second time.
[0035] In some examples, the transaction host (a) sets a first access control identifier to prohibit access by the transaction host to a first peripheral device, (b) sets a second access control identifier to enable access by the transaction host to a second peripheral device, and at a third time, performs a user mode operation with respect to the second peripheral device.
[0036] Another aspect provides an electronic device including a first peripheral, a second peripheral, a non-transitory memory, an access control register, a transaction host, a first access controller, and a second access controller. The non-transitory memory stores (a) supervisor firmware including access control identifier management instructions, (b) computer-readable code including a first task associated with the first peripheral, and (c) a first bit mask corresponding to the first task, the first bit mask indicating respective access settings of the first peripheral and the second peripheral for executing the first task. The access control register includes a first access control identifier for the first peripheral and a second access control identifier for the second peripheral. The transaction host executes the access control identifier management instructions in the supervisor firmware to program a first access control identifier and a second access control identifier in an access control register based on a first bit mask corresponding to the first task, and executes the first task associated with the first peripheral device after programming the first access control identifier and the second access control identifier in the access control register based on the first bit mask. The first access controller controls access to the first peripheral device based at least on the first access control identifier in the access control register programmed based on the first bit mask, and the second access controller controls access to the second peripheral device based at least on the second access control identifier in the access control register programmed based on the first bit mask.
[0037] In some examples, the electronic device is a system-on-chip (SoC) device.
[0038] In some examples, the transaction host comprises a processor or a direct memory access (DMA) engine.
[0039] In some examples, the first bit mask and the second bit mask are stored in a bit mask data structure in non-transitory memory.
[0040] In some examples, the first bitmask includes one or more first bitmask bits indicating an access setting for a first peripheral device for performing the first task and one or more second bitmask bits indicating an access setting for a second peripheral device for performing the first task, the first access control identifier includes one or more first access control bits, and the second access control identifier includes one or more second first access control bits.
[0041] In some examples, the computer-readable code includes a second task associated with a second peripheral device, the non-transitory memory stores a second bit mask corresponding to the second task, the second bit mask indicating respective access settings of the first peripheral device and the second peripheral device for executing the second task, and the transaction host (a) executes access control identifier management instructions in the supervisor firmware to program a first access control identifier and a second access control identifier in an access control register based on the second bit mask corresponding to the second task, and (b) executes the second task associated with the second peripheral device after programming the first access control identifier and the second access control identifier in the access control register based on the second bit mask.
[0042] In some examples, the non-transitory memory includes a non-privileged portion that stores computer-readable code including a first task and a second task, supervisor firmware that includes access control identifier management instructions, and a privileged portion that stores a first bitmask corresponding to the first task.
[0043] In some examples, the access controller receives an access request from a transaction host to access a first peripheral device to perform a first task, makes an access decision on the first peripheral device based at least on a first access control identifier programmed based on a first bit mask corresponding to the first task, and allows or prohibits the transaction host from accessing the first peripheral device based on the access decision.
[0044] In some examples, the first access controller performs access decisions for the first peripheral device based at least on (a) a first access control identifier programmed by the transaction host based on a first bit mask corresponding to the first task, and (b) an operating mode signal indicating either a privileged mode of the transaction host or a user mode of the transaction host.
[0045] In some examples, a first bitmask corresponding to a first task indicates that (a) the first task has been assigned a peripheral access permission for a first peripheral device, and (b) the first task has not been assigned a peripheral access permission for a second peripheral device.
[0046] In some examples, the first bit mask corresponding to the first task indicates that (a) the first task has been assigned a peripheral access permission for the first peripheral device and (b) the first task has not been assigned a peripheral access permission for the second peripheral device. The access control identifier management instruction programs a first access control identifier and a second access control identifier in an access control register based on the first bit mask before execution of the first task, including (a) programming the first access control identifier to an access permission value that allows access to the first peripheral device during execution of the first task, and (b) programming the second access control identifier to an access prohibition value that prohibits access to the second peripheral device during execution of the first task. The first access controller permits access to the first peripheral device during execution of the first task based on the access permission value of the first access control identifier, and the second access controller prohibits access to the second peripheral device during execution of the first task based on the access prohibition value of the second access control identifier.
[0047] In some examples, the transaction host selectively operates in a privileged mode and a user mode, and a first bit mask corresponding to a first task indicates that (a) the first task has been assigned a peripheral access permission for a first peripheral device and (b) the first task has not been assigned a peripheral access permission for a second peripheral device. The access control identifier management instruction programs a first access control identifier and a second access control identifier in an access control register based on the first bit mask before execution of the first task, including (a) programming the first access control identifier to an open access setting for the first peripheral device that allows access to the first peripheral device in both the privileged mode and the user mode of the transaction host, and (b) programming the second access control identifier to a restricted access value for the second peripheral device that allows access to the second peripheral device in the privileged mode of the transaction host but does not allow access to the second peripheral device in the user mode.
[0048] In some examples, the access control register is provided in a third peripheral device.
[0049] Another aspect provides a method. The method includes, in an electronic device including a transaction host, a first peripheral device, a second peripheral device, and an access control register including a first access control identifier for the first peripheral device and a second access control identifier for the second peripheral device, storing: (a) computer-readable code including a first task associated with the first peripheral device; and (b) a first bit mask corresponding to the first task, the first bit mask indicating respective access settings of the first peripheral device and the second peripheral device for executing the first task. Before executing the first task, the transaction host executes an access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask. After programming the first access control identifier and the second access control identifier in the access control register based on the first bit mask, the transaction host executes the first task associated with the first peripheral device. During execution of the first task, a first access controller associated with the first peripheral device controls access to the first peripheral device based at least on a first access control identifier in an access control register programmed based on the first bit mask, and a second access controller associated with the second peripheral device controls access to the second peripheral device based at least on a second access control identifier in an access control register programmed based on the first bit mask.
[0050] In some examples, the method includes storing computer-readable code including a second task associated with a second peripheral device and storing a second bit mask corresponding to the second task, the second bit mask indicating respective access settings of the first peripheral device and the second peripheral device for executing the second task. Before executing the second task, the transaction host executes an access control identifier management instruction to program a first access control identifier and a second access control identifier in an access control register based on the second bit mask corresponding to the second task. After programming the first access control identifier and the second access control identifier in the access control register based on the second bit mask, the transaction host executes the second task associated with the second peripheral device. During execution of the second task, a first access controller associated with the first peripheral device controls access to the first peripheral device based at least on a first access control identifier in an access control register programmed based on the second bit mask, and a second access controller associated with the second peripheral device controls access to the second peripheral device based at least on a second access control identifier in an access control register programmed based on the second bit mask.
[0051] In some examples, controlling access to the first peripheral device by the first access controller based at least on the first access control identifier programmed based on the first bit mask includes: the first access controller receiving an access request from the transaction host to access the first peripheral device to perform the first task; making an access decision on the first peripheral device based at least on the first access control identifier programmed based on the first bit mask; and permitting or prohibiting the transaction host from accessing the first peripheral device based on the access decision.
[0052] In some examples, the method includes the first access controller making an access decision for the first peripheral device based at least on (a) a first access control identifier programmed based on the first bit mask and (b) an operational mode signal indicating either a privileged mode of the transaction host or a user mode of the transaction host.
[0053] In some examples, the first bit mask corresponding to the first task indicates that (a) the first task has been assigned a peripheral access permission for the first peripheral device and (b) the first task has not been assigned a peripheral access permission for the second peripheral device. Executing the access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask corresponding to the first task includes (a) programming the first access control identifier to an access permission value that allows access to the first peripheral device during execution of the first task, and (b) programming the second access control identifier to an access prohibition value that prohibits access to the second peripheral device during execution of the first task. During execution of the first task, a first access controller associated with the first peripheral device permits access to the first peripheral device based on the access permission value of the first access control identifier, and a second access controller associated with the second peripheral device prohibits access to the second peripheral device based on the access prohibition value of the second access control identifier.
[0054] In some examples, the transaction host selectively operates in a privileged mode and a user mode, and a first bit mask corresponding to a first task indicates that (a) the first task has been assigned a peripheral access permission for a first peripheral device and (b) the first task has not been assigned a peripheral access permission for a second peripheral device. Executing the access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask corresponding to the first task includes (a) programming the first access control identifier to an open access value for the first peripheral device that allows access to the first peripheral device in both the privileged mode and the user mode of the transaction host, and (b) programming the second access control identifier to a restricted access value for the second peripheral device that allows access to the second peripheral device in the privileged mode of the transaction host but does not allow access to the second peripheral device in the user mode. During execution of the first task, a first access controller associated with the first peripheral device allows access to the first peripheral device in both the privileged mode and the user mode of the transaction host based on the open access value of the first access control identifier, and a second access controller associated with the second peripheral device prohibits access to the second peripheral device in the privileged mode of the transaction host but does not prohibit access to the second peripheral device in the user mode of the transaction host based on the restricted access value of the second access control identifier. [Brief explanation of the drawings]
[0055] Exemplary aspects of the present disclosure are described below in conjunction with the accompanying drawings, in which: [Figure 1] FIG. 1 illustrates an exemplary electronic device (e.g., SoC) that utilizes access control identifiers to control access to peripherals, according to one example. [Figure 2] 2 illustrates additional aspects of the exemplary electronic device of FIG. 1, according to one example. [Figure 3] FIG. 1 illustrates another exemplary electronic device that utilizes access control identifiers to control access to peripherals, according to one example. [Figure 4A] 3A-3C illustrate circuit diagrams of exemplary logic circuits provided in each access controller, according to some examples. [Figure 4B] 3A-3C illustrate circuit diagrams of exemplary logic circuits provided in each access controller, according to some examples. [Figure 4C] 3A-3C illustrate circuit diagrams of exemplary logic circuits provided in each access controller, according to some examples. [Figure 4D] 3A-3C illustrate circuit diagrams of exemplary logic circuits provided in each access controller, according to some examples. [Figure 5] 1 is a flowchart of an exemplary method for controlling access to peripherals in an electronic device using access control identifiers stored in access control registers. [Figure 6] 1 is a flowchart of an exemplary method for controlling access to peripherals in an electronic device using a first exemplary access control identifier scheme. [Figure 7] 10 is a flowchart of an exemplary method for controlling access to peripherals in an electronic device using a second exemplary access control identifier scheme. [Figure 8] 1 is a flowchart of an exemplary method for controlling access to peripherals in an electronic device for both privileged mode operation and user mode operation, according to one example. [Figure 9] 1 is a flowchart of an exemplary method for controlling access to peripheral devices using a task-related bitmask.
[0056] It will be understood that reference numerals for any illustrated element that appear in multiple different drawings have the same meaning throughout the multiple drawings, and that any mention or discussion herein of any illustrated element in the context of any particular drawing also applies to each other drawing in which the same illustrated element appears. DETAILED DESCRIPTION OF THE INVENTION
[0057] 1 illustrates an exemplary electronic device 100 that utilizes access control identifiers to control access to peripherals, according to one example. The access control identifiers may be programmable, e.g., each access control identifier may be set and / or updated over time. The electronic device 100 includes a transaction host 102, peripherals 104, an access controller 106, and an access control register 110 that stores an access control identifier 112. The components of the electronic device 100 may be communicatively coupled to each other by any one or more types of communication links 114, such as a bus, a wire, or other type of link. In some examples, the access controller 106 may be coupled between the bus and each peripheral 104, or alternatively, may be indirectly coupled to the bus and operable to make access decisions for selected communications with peripherals 104a-104n coupled to the bus.
[0058] In some examples, the electronic device 100 is a system-on-chip (SoC) device. In other examples, the electronic device 100 may be a multi-chip system including a transaction host 102 provided on one chip and peripherals 104 provided on separate chip(s). The transaction host 102 may comprise any device capable of initiating the execution of tasks associated with each peripheral 104, for example, to access registers provided for each peripheral 104. For example, the transaction host 102 may include a processor, such as a microprocessor, microcontroller, central processing unit (CPU), processor core(s), direct memory access (DMA) engine, or any other type of computer processor. As another example, the transaction host 102 may include a bridge connected to an external host 116 (e.g., including a processor separate from the electronic device 100) to enable the external host 116 to access at least one peripheral 104.
[0059] Peripherals 104 (e.g., including input / output devices and / or other peripheral devices) are any devices that provide input, output, or data storage capabilities for electronic device 100, such as one or more PCI Express interfaces, Ethernet interfaces, USB interfaces, I / O interfaces, and the like. 2The interface may include an Inter-Integrated Circuit (C) interface, a direct memory access (DMA) controller, an interrupt controller, an analog-to-digital converter (ADC), a Wi-Fi interface, a Bluetooth interface, a Global System for Mobile Communications (General Packet Radio Service, GSM) interface, a General Packet Radio Service (GPRS) interface, a Global Positioning System (GPS) interface, a 3G interface, a 4G interface, a 5G interface, a universal asynchronous receiver-transmitter (UART), a Controller Area Network Flexible Data-Rate (CAN-FD) interface, a general-purpose input / output (GPIO) interface, a display device interface, a modem, a graphics processing unit (GPU), or a co-processor.
[0060] Electronic device 100 may include any number of peripherals 104. While the exemplary electronic device 100 shown in FIG. 1 includes peripherals 104a-104n, it should be understood that electronic device 100 may include any number of one or more peripherals.
[0061] Each access controller 106 may be coupled to a corresponding peripheral device 104 to control (e.g., allow or prohibit) access to each peripheral device 104, for example, by a device driver (firmware) executed by the transaction host 102. For example, as described below with reference to FIG. 2, the transaction host 102 may execute firmware to perform various tasks related to the peripheral devices 104. For example, the transaction host 102 may execute a device driver corresponding to each peripheral device 104a-104n to perform tasks (e.g., device driver tasks) related to each peripheral device 104a-104n. The access controller 106 may control (e.g., allow or prohibit) access to each peripheral device 104 for each task executed by the transaction host 102.
[0062] As shown, the electronic device 100 may include respective access controllers 106a-106n corresponding to respective peripherals 104a-104n. For example, a first access controller 106a may be coupled between the transaction host 102 and the first peripheral 104a to control access by the transaction host 102 to the first peripheral 104a, a second access controller 106b may be coupled between the transaction host 102 and the second peripheral 104b to control access by the transaction host 102 to the second peripheral 104b, and so on. For example, the first access controller 106a may allow a first task (e.g., associated with a first device driver corresponding to the first peripheral 104a) to access the first peripheral 104a and prohibit a second task (e.g., associated with a second device driver corresponding to the second peripheral 104b) from accessing the first peripheral 104a. Similarly, the second access controller 106b can allow a second task (associated with a second device driver corresponding to the second peripheral device 104b) to access the second peripheral device 104b and prohibit a first task (associated with a first device driver corresponding to the first peripheral device 104a) from accessing the second peripheral device 104b.
[0063] Each access controller 106a-106n may include electronic circuitry that controls (e.g., allows or prohibits) access by the transaction host 102 to the respective peripheral device 104a-104n based on a respective access control identifier 112 stored in the access control register 110 and, in some alternative examples, additional access control input data. As discussed below, the additional access control input data may include, for example, (a) an operational mode signal (OMS) 120 that indicates an operational mode of the transaction host 102, and / or (b) an access request identifier (discussed below with reference to FIG. 3 for an example including multiple transaction hosts 102) that identifies the respective transaction host 102 requesting access to the respective peripheral device 104.
[0064] In some examples, the access control identifiers (also referred to herein as “AC identifiers”) 112 stored in the access control register 110 include respective access control identifiers 112a-112n corresponding to respective peripheral devices 104a-104n, such as a first access control identifier 112a corresponding to the first peripheral device 104a, a second access control identifier 112b corresponding to the second peripheral device 104b, etc. Each access control identifier 112a-112n for each peripheral device 104a-104n may include one bit, multiple bits, or other data indicating an access setting for the respective peripheral device 104a-104n. For example, the first access control identifier 112a may include one or more bits indicating an access setting for the first peripheral device 104a, and the second access control identifier 112a may include one or more bits indicating an access setting for the second peripheral device 104b. Access control register 110 may include a single register or multiple registers of any suitable size, including, for example, one or more 8-bit, 32-bit, or 64-bit registers.
[0065] 2, before executing a respective task (e.g., a firmware task), the transaction host 102 may program (e.g., set or update) the value of each access control identifier 112a-112n based on the peripheral access permission assigned to the respective task. As described below, the electronic device 100 may store a respective bit mask for each task indicating the peripheral access permission for the respective task, e.g., the respective bit mask for each task indicating whether the respective task is assigned (or not assigned) peripheral access permission for the respective peripheral device 104a-104n. For example, the electronic device 100 may store a first bitmask for a first task indicating that the first task has been assigned a peripheral access permission to the first peripheral device 104a but not a peripheral access permission to the second peripheral device 104b, and may store a second bitmask for a second task indicating that the second task has been assigned a peripheral access permission to the second peripheral device 104b but not a peripheral access permission to the first peripheral device 104a. In some examples, peripheral access permissions may be assigned to each task (using a respective bitmask for each task) by a code developer (e.g., a firmware developer), for example, based on the device(s) that may be required or utilized by the respective task. In some examples, each access controller 106a-106n associated with each peripheral device 104a-104n makes an access decision for accessing each peripheral device 104a-104n based on the respective access control identifier 112a-112n corresponding to each peripheral device 104a-104n.In another example, each access controller 106a-106n associated with each peripheral device 104a-104n makes an access decision to access each peripheral device 104a-104n based on (a) a respective access control identifier 112a-112n corresponding to each peripheral device 104a-104n and (b) an operating mode signal 120 indicating the current operating mode of the transaction host 102 (e.g., privileged mode or user mode).
[0066] In another example, multiple processing hosts 102 are provided, and each access controller 106a-106n associated with each peripheral device 104a-104n makes an access decision for accessing each peripheral device 104a-104n by a requesting transaction host 102 (or multiple transaction hosts 102) (e.g., the access control register 110 stores, for each transaction host 102, a respective set of access control identifiers 112a-112n for the peripheral devices 104a-104n). The access control register 110 then stores, for each transaction host 102, a respective set of access control identifiers 112a-112n for the peripheral devices 104a-104n. In another example, multiple processing hosts 102 are provided, and each access controller 106a-106n associated with each peripheral device 104a-104n makes an access decision for accessing each peripheral device 104a-104n by one requesting transaction host 102 (or multiple transaction hosts 102) based on (a) a transaction host identifier identifying the requesting transaction host 102, (b) a respective access control identifier 112a-112n corresponding to each peripheral device 104a-104n and the requesting transaction host 102 (e.g., the access control register 110 stores, for each transaction host 102, a respective set of access control identifiers 112a-112n for the peripheral devices 104a-104n), and (c) an operating mode signal 120 indicating the current operating mode (e.g., privileged mode or user mode) of the requesting transaction host 102.
[0067] Generally, when a transaction host 102 attempts to access a respective peripheral device 104, e.g., a first peripheral device 104a, the first access controller 106a may (a) receive an access request from the transaction host 102 for access to the first peripheral device 104a, (b) access an access control identifier 112 for the first peripheral device 104a from the access control register 110, (c) make an access decision based on the first access control identifier 112a (and, in some examples, additional access control input data), and (d) grant or deny access to the first peripheral device 104a by the transaction host 102 in response to the access decision.
[0068] In a first example, as shown in Table 1 below, each access control identifier 112a-112n is programmable between the following access control identifier (AC_ID) values: (a) an access permission setting (e.g., AC_ID value=[0]) that allows the transaction host 102 (e.g., running a device driver or other firmware) to access each peripheral device 104a-104n; (b) an access prohibition setting (eg, AC_ID value=[1]) that prohibits the transaction host 102 (eg, running a device driver or other firmware) from accessing each peripheral device 104a-104n;
[0069] Table 1. Access control identifier scheme for the first example. [Table 1]
[0070] In some examples, each access controller 106a-106n may store or have access to a look-up table (LUT) containing the data of Table 1, which the respective access controller 106a-106n may access to make access decisions. In some examples, each access controller 106a-106n may store its respective LUT in memory 107, e.g., a read-only memory (ROM) device (a respective instance of memory 107 may be provided within the respective access controller 106a-106n, or the memory 107 may be otherwise accessible to the respective access controller 106a-106n). In other examples, each access controller 106a-106n may implement the decisions specified in Table 1 using an appropriate instance of logic circuitry 108. For example, as described below with reference to FIG. 4A, each access controller 106a-106n may include logic circuitry 108 including a NOT gate (or inverter) for processing the access control identifier input to the respective access controller 106a-106n. (In another example, the meaning of the AC_ID value can be reversed, e.g., AC_ID=0 indicates a no-access setting and AC_ID=1 indicates an access-allowed setting, and the NOT gate can be omitted.)
[0071] In a first example (i.e., implementing the scheme shown in Table 1), the transaction host 102 may execute its respective firmware (e.g., access control identifier management instructions 214 provided in computer-readable supervisor code 206, e.g., embodied in firmware, as shown in FIG. 2 described below) to dynamically program the access control identifiers 112a-112n, e.g., in real time, according to the scheme described above, based on the transaction host's current operating mode (e.g., privileged mode or user mode) and / or prior to initiating a task related to a particular peripheral device 104a-104n (e.g., using a device driver corresponding to the particular peripheral device 104a-104n). For example: (a) Before starting a privileged mode task associated with any peripheral device 104a-104n, the transaction host 102 may program the AC identifier 112a-112n to 0 (allowing the transaction host 102 to access the peripheral device 104a-104n). (b) before starting a user-mode task associated with the first peripheral device 104a, the transaction host 102 may program the AC identifier 112a to 0 and the AC identifiers 112b...112n to 1 (allowing the transaction host 102 to access the first peripheral device 104a and prohibiting access to peripherals 104b...104n); and (c) Before initiating a user-mode task associated with the second peripheral device 104b, the transaction host 102 may program the AC identifier 112b to 0 and program the AC identifiers 112a, 112c...112n to 1 (allowing the transaction host 102 access to the second peripheral device 104b and prohibiting access to the peripherals 104a, 104c...104n).
[0072] In a first example, each access controller 106a-106n associated with a particular peripheral device 104a-104n makes an access decision to access the particular peripheral device 104a-104n based on the current value of the respective access control identifier 112a-112n corresponding to the particular peripheral device 104a-104n, for example, without further needing an operational mode signal indicating the current operational mode of the transaction host 102. For example, when a first access controller 106a associated with a first peripheral device 104a receives an access request from the transaction host 102 to access the first peripheral device 104a, the first access controller 106a accesses the respective AC identifier 112a corresponding to the first peripheral device 104a, and based on the AC identifier 112a, allows the transaction host 102 to access the first peripheral device 104a if the AC_ID value=0, or prohibits the transaction host 102 from accessing the first peripheral device 104a if the AC_ID value=1.
[0073] According to the scheme of the first example described above, in one illustrative instance, the transaction host 102 may execute a first user space task associated with the first peripheral device 104a using a first peripheral device driver corresponding to the first peripheral device 104a, and thus may program the AC identifier 112a to 0 (e.g., using the access control identifier management instruction 214 shown in FIG. 2 ) before executing the first task. When the first access controller 106a receives a request to access the first peripheral device 104a from the first peripheral device driver, the first access controller 106a may access the AC identifier 112a and, in response to the value of the AC identifier 112a=0, enable access to the first peripheral device 104a. In another example instance, the transaction host 102 may execute a second user space task associated with a second peripheral device 104b using a second peripheral device driver corresponding to the second peripheral device 104b, and may therefore program the AC identifier 112b to 0 to enable access to the second peripheral device 104b and program the AC identifier 112a to 1 to prohibit access to the first peripheral device 104a. If the first access controller 106a receives a request from the second peripheral device driver to access the first peripheral device 104a (e.g., an erroneous or malicious request from the second peripheral device driver), the first access controller 106a may access the AC identifier 112a and, in response to the value of the AC identifier 112a=1, prohibit access to the first peripheral device 104a. In yet another example instance, the transaction host 102 may execute a privileged task (e.g., contained in supervisor firmware) related to the first peripheral device 104a or the second peripheral device 104b, and therefore, before executing such privileged task, may program the AC identifier 112a to 0 or the AC identifier 112b to 0, respectively, thereby enabling access to the first peripheral device 104a by the first peripheral device driver corresponding to the first peripheral device 104a or the second peripheral device driver corresponding to the second peripheral device 104b.
[0074] In a second example, as shown in Table 2 below, each access control identifier 112a-112n is programmable between the following access control identifier (AC_ID) values: (a) an open access setting (e.g., AC_ID value=[0]) that allows access to each peripheral device 104 a-104 n by the transaction host 102 (e.g., running a device driver or other firmware) regardless of the current operating mode of the transaction host 102 (e.g., privileged mode or user mode); and (b) With a restricted access setting (e.g., AC_ID value = [1]) that allows the transaction host 102 (e.g., running a device driver or other firmware) to access each peripheral device 104a-104n only in the privileged mode of the transaction host 102.
[0075] Table 2. Access control identifier scheme for the second example. [Table 2]
[0076] In some examples, each access controller 106a-106n can store or have access to a LUT containing the data of Table 2, and each access controller 106a-106n can access the LUT to make access decisions. In some examples, each access controller 106a-106n can store its LUT in a respective instance of memory 107, for example, in a read-only memory (ROM) device (an instance of memory 107 may be provided within each access controller 106a-106n, or memory 107 may be otherwise accessible to each access controller 106a-106n). In other examples, each access controller 106a-106n can implement the decisions specified in Table 2 using a respective instance of appropriate logic circuitry 108. For example, as described below with reference to FIG. 4B, each access controller 106a-106n can include logic circuitry 108 including NOT and OR gates for processing access control identifiers input to each access controller 106a-106n.
[0077] In a second example (i.e., implementing the scheme shown in Table 2), the transaction host 102 may execute its respective firmware (e.g., access control identifier management instructions 214 shown in FIG. 2) to dynamically program the access control identifiers 112a-112n, e.g., in real time, according to the scheme described above, based on the transaction host's current operating mode (e.g., privileged mode or user mode) and / or to initiate tasks related to a particular peripheral device 104a-104n (e.g., using a device driver corresponding to the particular peripheral device 104a-104n). For example: (a) To initiate a task associated with the first peripheral device 104a (regardless of the operating mode of the transaction host 102), the transaction host 102 can program the AC identifier 112a to 0 and program the AC identifiers 112b, 112c... 112n to 1 (allowing the transaction host 102 to access the first peripheral device 104a in both the privileged and user modes of the transaction host 102, and prohibiting the transaction host 102 from accessing the peripherals 104b, 104c... 104n in the user mode of the transaction host 102, as described below); and (b) To initiate a task associated with the second peripheral device 104b (regardless of the operating mode of the transaction host 102), the transaction host 102 can program the AC identifier 112b to 0 and program the AC identifiers 112a, 112c...112n to 1 (allowing the transaction host 102 to access the second peripheral device 104b in both the privileged mode and the user mode of the transaction host 102, and prohibiting the transaction host 102 from accessing the peripheral devices 104a, 104c...104n in the user mode of the transaction host 102, as described below).
[0078] In a second example, each access controller 106a-106n associated with a particular peripheral 104a-104n makes an access decision to access the particular peripheral 104a-104n based on (a) the current value of the respective access control identifier 112a-112n corresponding to the particular peripheral 104a-104n, and (b) an operational mode signal 120 indicating the operational mode (privileged mode or user mode) of the transaction host 102. For example, when a first access controller 106a associated with a first peripheral 104a receives an access request to access the first peripheral 104a from the transaction host 102, the first access controller 106a accesses (a) the AC identifier 112a corresponding to the first peripheral 104a and (b) the operational mode signal 120, and determines whether to allow the transaction host 102 to access the first peripheral 104a based on the scheme defined by Table 2. In particular, the first access controller 106a determines to allow the transaction host 102 to access the first peripheral device 104a unless both (a) the AC_ID value = 1 (restricted access setting) and (b) the operating mode signal value = 0 (user mode).
[0079] According to the scheme of the second example described above, in one illustrative instance, the transaction host 102 may initiate a user-mode task associated with the first peripheral device 104a and, therefore, may program the AC identifier 112a to 0 to initiate such a task. When the first access controller 106a receives a request to access the first peripheral device driver from the first peripheral device 104a, the first access controller 106a may (a) access the AC identifier 112a, (b) access the operation mode signal 120, (c) perform an access decision to allow the first peripheral device driver to access the first peripheral device 104a if the operation mode signal 120 indicates either user mode (operation mode signal value=0) or privileged mode (operation mode signal value=1), or prohibit the first peripheral device driver from accessing the first peripheral device 104a otherwise, and (d) permit or prohibit the first peripheral device driver from accessing the first peripheral device 104a based on the access decision.
[0080] In another example instance, the transaction host 102 may initiate a user-mode task associated with a second peripheral device 104b using a second peripheral device driver corresponding to the second peripheral device 104b, and may therefore program the AC identifier 112b to 0 (i.e., open access to the second peripheral device 104b) and program the AC identifier 112a to 1 (i.e., restricting access to the first peripheral device 104a). When the first access controller 106a receives a request to access the first peripheral device 104a from the second peripheral device driver, the first access controller 106a may (a) access the AC identifier 112a, (b) access the operation mode signal 120, (c) perform an access decision to allow or prohibit access by the second peripheral device driver to the first peripheral device 104a, in particular, decide to allow access if the operation mode signal 120 indicates a privileged mode (operation mode signal value = 1), and decide to prohibit access if the operation mode signal 120 indicates a user mode (operation mode signal value = 0), and (d) allow or prohibit access by the second peripheral device driver to the first peripheral device 104a based on the access decision.
[0081] As shown in FIG. 1, each access controller 106a-106n can receive as inputs (a) an access request (ACR) for a respective peripheral device 104a-104n, (b) a respective AC identifier 112a-112n, and (optionally) (c) an operational mode signal 120, and can process the received inputs to make an access decision for the respective peripheral device 104a-104n. For simplicity, the access request (ACR shown in FIGS. 1-2 and TH_id shown in FIG. 3) and the optional operational mode signal (120 in FIGS. 1-2 and 120a-120n in FIG. 3) are shown in FIGS. 1-3 as being sent only to access controller 106a. It should be understood that the access request and the optional operational mode signal can similarly be sent to access controllers 106b-106n for operation associated with the respective access controllers 106b-106n.
[0082] As mentioned above, in some examples, each access controller 106a-106n of the exemplary electronic device 100 may include (or have access to) a respective look-up table (LUT) stored in memory 107 (e.g., ROM), which defines a respective access decision for each AC_ID value (e.g., according to the scheme defined by Table 1 above) or which defines a respective access decision for each combination of AC_ID value and operational mode signal value (e.g., according to the scheme defined by Table 2 above). In other examples, for example, as shown in FIGS. 4A and 4B described below, each access controller 106a-106n may comprise an instance of logic circuitry 108 including one or more logic gates, e.g., a NOT gate (e.g., implementing the scheme defined by Table 1 above) or a NOT gate and an OR gate (e.g., implementing the scheme defined by Table 2 above).
[0083] In some examples, the electronic device 100 may include AC identifier programming firmware executable by the transaction host 102 to dynamically program one, some, or all of the AC identifiers 112a-112n, e.g., to initiate a task associated with each of the peripherals 104a-104n, e.g., based on the transaction host's operating mode and / or based on the respective peripheral 104a-104n selected for access (referred to herein as the access-requested peripheral 104a-104n). Additionally, in some examples, as described below with reference to FIG. 2, the access control register 110 may be provided in a dedicated peripheral, which (like the peripherals 104a-104n) may be access-controlled by a respective access controller; e.g., the AC identifier programming firmware may only access the access control register 110 (e.g., to program the AC identifier 112a-112n) in a privileged mode of the transaction host 102 and may not access the access control register 110 in a user mode of the transaction host 102.
[0084] 2 illustrates additional features and aspects of the electronic device (e.g., SoC) 100 of FIG. 1, according to an example. As described above, the electronic device 100 includes a transaction host 102, peripherals 104a-104n, access controllers 106a-106n, and an access control register 110 that stores access control identifiers 112a-112n. The components of the electronic device 100 may be communicatively coupled to one another by any one or more types of communication links 114, such as buses, wires, or other types of links. As described above, each access controller 106a-106n utilizes its respective access control identifier 112a-112n (and optionally additional input data) to control access to its respective peripheral device 104a-104n, for example, based on the operating mode (e.g., privileged mode or user mode) of the transaction host 102 and / or based on the peripheral device 104a-104n for which access is requested (i.e., the peripheral device 104a-104n for which access is requested). The access controllers 106a-106n may implement any of the various exemplary schemes described above, for example, using the access control identifier schemes shown in Table 1 or Table 2 described above.
[0085] 2, an access control register 110 including an access control identifier 112a-112n may be provided for a dedicated peripheral 104ac, and a corresponding access controller 106ac may be provided to control access to the peripheral 104ac, e.g., similar to the access controllers 106a-106n that control access to the peripherals 104a-102n, respectively. For example, the access controller 106ac may control access to the peripheral 104ac based on an operational mode signal 120 from the transaction host 102 and (optionally) a respective AC identifier 112ac. In some examples, the access controller 106ac may control access to the peripheral 104ac based on the operational mode signal 120 from the transaction host 102. In other examples, the access controller 106ac may operate similarly to the access controllers 106a-106n, e.g., using an access control identifier scheme such as shown in Table 1 or Table 2 described above, based on the respective AC identifier 112ac and / or the operational mode signal 120.
[0086] 2, electronic device 100 may also include non-transitory memory 202 that stores various firmware and other data. Non-transitory memory 202 (also referred to as memory 202) may include one or more read-only memories (ROMs), such as flash ROMs, erasable programmable ROMs (EPROMs), electrically erasable programmable ROMs (EEPROMs), flash memory, or any other suitable type(s) and number(s) of memory device(s).
[0087] As shown, the memory 202 may include a privileged section 202a and a non-privileged section (or user section) 202b. The non-privileged section 202b may store computer-readable user space code 208 embodied in firmware, such as device drivers and / or other user space firmware associated with each of the peripherals 104a-104n. The user space code (e.g., user space firmware) 208 may include functionality that requires or can utilize access to only selected resources (e.g., selected ones of the peripherals 104a-104n). For example, the user space code 208 may include device drivers or other firmware that include respective tasks 220a-220n that require or can utilize access to selected peripherals 104a-104n, for example, to access data stored in respective registers 214a-214n provided in each of the peripherals 104a-104n. Thus, device drivers that traditionally operate as supervisor firmware may be operated as user space firmware with access to only selected resources (e.g., selected peripherals 104a-104n), thereby providing the enhanced security described herein.
[0088] The privilege section 202a may store supervisor code (e.g., supervisor firmware) 206 and a bit mask data structure 230. The bit mask data structure 230 may include bit masks 232a-232n corresponding to tasks 230a-230n, respectively, where each bit mask 232n for each task 230n indicates a respective access setting for each peripheral 104a-104n, e.g., whether each task 230n has been assigned peripheral access permission to each peripheral 104a-104n. For example, referring to FIG. 2, a task 1 bitmask 232a corresponding to “task 1” 220a may indicate that “task 1” 220a is assigned a peripheral access permission for the first peripheral device 104a but not the second peripheral device 104b, and a task 2 bitmask 232b corresponding to “task 2” 220b may indicate that “task 2” 220b is assigned a peripheral access permission for the second peripheral device 104b but not the first peripheral device 104a.
[0089] In some examples, each bit mask 232a-232n for each task 220a-220n may include one or more bits (also referred to herein as "bit mask bits") or other data indicating whether the respective task 220a-220n has been assigned a peripheral access permission to each of the peripherals 104a-104n. For example, task 1 bit mask 232a corresponding to "task 1" 220a may include one or more first bit mask bits or other data indicating that "task 1" 220a has been assigned a peripheral access permission to the first peripheral 104a and one or more second bit mask bits or other data indicating that "task 1" 220a has not been assigned a peripheral access permission to the second peripheral 104b.
[0090] The supervisor code (e.g., supervisor firmware) 206 may include a scheduler 212 and access control identifier management instructions 214. The scheduler 212 is executed by the transaction host 102 to manage the execution of the user space code (e.g., user space firmware) 208, including, for example, tasks 220a-220n. The access control identifier management instructions 214 are executable by the transaction host 102 to (a) access bit masks 232a-232n and (b) program the values of the access control identifiers 112a-112n in the access control register 110 based on the respective bit masks 232a-232n corresponding to the respective tasks 220a-220n being executed. In some examples, e.g., in a particular implementation of the first exemplary access control identifier scheme described above (see Table 1), the transaction host 102 may utilize bit masks 232a-232n for user mode operations (e.g., executing each of tasks 220a-220n in user mode) but not for privileged mode operations (e.g., executing each of tasks 220a-220n in privileged mode). (In other implementations of the first exemplary access control identifier scheme (shown in Table 1), the transaction host 102 may utilize bit masks 232a-232n for both user mode and privileged mode operations.)
[0091] For example, before executing "task 1" 220a, the transaction host 102 may execute the access control identifier management instruction 214 to program the values of the access control identifiers 112a-112n in the access control registers 110 based on the task 1 bitmask 232a and / or based on the operating mode (e.g., privileged mode or user mode) of the transaction host 102. Exemplary implementations are provided under both the first exemplary access control identifier scheme described above (see Table 1) and the second exemplary access control identifier scheme described above (see Table 2).
[0092] Example 1: First Exemplary Access Control Identifier Scheme (Table 1) Under the first exemplary access control identifier scheme described above (see Table 1), the transaction host 102 can utilize the task 1 bitmask 232a to execute "task 1" 220a in user mode, but not to execute "task 1" 220a in privileged mode. For example, prior to executing "task 1" 220a in user mode, the transaction host 102 may execute the access control identifier management instructions 214 to (a) identify that "task 1" 220a is executing in user mode of the transaction host 102, (b) access a first bit mask 232a indicating that "task 1" 220a is assigned peripheral access permission to the first peripheral device 104a but not the second peripheral device 104b, and (c) based on the first bit mask 232a and the current operating mode (user mode), program the first access control identifier 112a to an access permission value (AC_ID value = 0) that allows access to the first peripheral device 104a during user mode execution of "task 1" 220a, and (b) program the second access control identifier 112b to an access prohibition value (AC_ID value = 0) that prohibits access to the second peripheral device 104b during user mode execution of "task 1" 220a. In contrast, prior to executing "task 1" 220a in privileged mode (under the first exemplary access control identifier scheme shown in Table 1 above), the transaction host 102 may execute the access control identifier management instruction 214 to program both the first access control identifier 112a and the second access control identifier 112b to an access permission value (AC_ID value=0) that enables access to both the first peripheral device 104a and the second peripheral device 104b during privileged mode execution of "task 1" 220a. In this situation, the transaction host 102 may ignore the task 1 bitmask 232a because all peripheral devices 104a-104n are accessible for privileged mode operation.
[0093] As noted above, in another example utilizing the first exemplary access control identifier scheme (shown in Table 1), the transaction host 102 may utilize bit masks 232a-232n for both user mode and privileged mode operations.
[0094] Example 2: Second Exemplary Access Control Identifier Scheme (Table 2) Under the second exemplary access control identifier scheme described above (see Table 2), prior to executing "task 1" 220a (in either user mode or privileged mode), the transaction host 102 may execute control bit management instructions 214 to (a) program a first access control identifier 112a to an open access setting (AC_ID value=0) for the first peripheral device 104a, which allows access to the first peripheral device 104a in both privileged mode and user mode of the transaction host 102, and (b) program a second access control identifier 112b to a restricted access setting (AC_ID value=1) for the second peripheral device 104b, which allows access to the second peripheral device 104b in privileged mode of the transaction host 102, but not in user mode.
[0095] 3 illustrates another exemplary electronic device 300 that utilizes programmable access control identifiers to control access to peripherals, according to one example. The electronic device 300 may be generally similar to the exemplary electronic device 100 described above, but includes multiple transaction hosts 102a-102n, as well as peripherals 104a-104n and 104ac, access controllers 106a-106n and 106ac, and an access control register 110 within the peripheral 104ac that stores an access control identifier 112. The components of the electronic device 100 may be communicatively coupled to one another by any one or more types of communication links 114, such as a bus, a wire, or other type of link.
[0096] Each access controller 106a-106n and 106ac can utilize its respective access control identifier 112 (and optionally additional input data) to control access to its respective peripheral device 104a-104n and 104ac based on, for example, (a) the access-requested peripheral device 104a-104n, (b) the respective transaction host 102a-102n requesting access to the access-requested peripheral device 104a-104n (referred to herein as the access-requesting transaction host 102a-102n), and (c) the operating mode signal 120a-120n (e.g., privileged mode or user mode) of the access-requesting transaction host 102a-102n.
[0097] The access control register 110 can store an AC identifier array 113 that includes a set of respective AC identifiers 112 for each transaction host 102a-102n, which in turn includes a respective AC identifier 112 for each peripheral device 104a-104n and (optionally) peripheral device 104ac. Table 3 below shows an exemplary AC identifier array 113 for multiple transaction hosts 102a-102n and multiple peripheral devices 104a-104n and 104ac.
[0098] Table 3. Exemplary AC Identifier Array 113 is, for example, electronic device 300, including multiple transaction hosts 102a-102n and multiple peripherals 104a-104n and 104ac. [Table 3]
[0099] The values of the AC identifiers 112 in the AC identifier array 113 may be used by the respective access controllers 106a-106n and 106ac to determine access by the respective transaction hosts 102a-102n to the respective peripheral devices 104a-104n and 104ac.
[0100] In one example, the value of the AC identifier 112 in the AC identifier array 113 may indicate an access-granted status (AC_ID value=0) or an access-denied status (AC_ID value=1), for example, as described above with respect to Table 1. In such an example, when an access-request transaction host 102a-102n attempts to access an access-requested peripheral device 104a-104n or 104ac, the access controller 106a-106n or 106ac corresponding to the access-requested peripheral device 104a-104n or 104ac (a) receives an access request including a transaction host identifier (TH_id) from the access-request transaction host 102a-102n, and (b) retrieves the transaction host identifier (TH_id) of the access-request transaction host 102a-102n from the AC identifier array 113 stored in the access control register 110. id) and the value of the AC identifier 112 corresponding to the peripheral device 104a-104n or 104ac for which access is requested; (c) based on the identified AC identifier 112, make an access decision to grant or deny access by the access-request transaction host 102a-102n to the peripheral device 104a-104n or 104ac for which access is requested (i.e., grant access if AC_ID value=0, deny access if AC_ID value=1); and (d) based on the access decision, grant or deny access to the peripheral device 104a-104n or 104ac for which access is requested.
[0101] In another example, the value of the AC identifier 112 in the AC identifier array 113 may indicate an open access status (AC_ID value=0) or a restricted access status (AC_ID value=1), for example, as described above with respect to Table 2. In such an example, when an access-request transaction host 102a-102n attempts to access an access-requested peripheral device 104a-104n or 104ac, the access controller 106a-106n or 106ac corresponding to the access-requested peripheral device 104a-104n or 104ac (a) receives an access request including a TH_id from the access-request transaction host 102a-102n, (b) receives a respective operation mode signal 120a-120n from the access-request transaction host 102a-102n indicating the operation mode (privileged mode or user mode) of the access-request transaction host 102a-102n, and (c) receives the AC identifier 112 value stored in the AC identifier array 113 stored in the access control register 110. 3, (d) identify the value of the AC identifier 112 corresponding to the access-request transaction host 102a-102n and the access-requested peripheral device 104a-104n or 104ac (based on the received TH_id); (e) perform an access decision based on the identified value of the AC identifier 112 and the operating mode of the access-request transaction host 102a-102n to grant or deny access to the access-requested peripheral device 104a-104n or 104ac, for example according to the scheme described above with respect to Table 2; and (f) grant or deny access to the access-requested peripheral device 104a-104n or 104ac based on the access decision.
[0102] As described above, in some examples, each access controller 106a-106n of the exemplary electronic device 100 may include a respective instance of memory 107 that stores a look-up table (LUT), or alternatively, a respective instance of logic circuitry 108, to implement the access decision scheme defined by Table 1 or Table 2 above.
[0103] Regarding the latter, FIGS. 4A-4D show circuit diagrams of example logic circuitry 108 provided within each access controller 106a-106n (and optionally, access controller 106ac), according to some examples.
[0104] First, FIGS. 4A and 4B illustrate an example logic circuit 108 of an example electronic device that includes one transaction host 102 (eg, the example electronic device 100 shown in FIGS. 1 and 2).
[0105] 4A shows an exemplary logic circuit 108a that implements the access control identifier scheme according to the first example described above, i.e., as shown above in Table 1. The logic circuit 108a includes a NOT gate (or inverter) 402 that inverts the value of each access control identifier 112 and outputs a value that defines the access decision.
[0106] 4B illustrates an exemplary logic circuit 108b according to the second example described above, i.e., implementing the access control identifier scheme shown above in Table 2. Logic circuit 108b includes a NOT gate (or inverter) 402 that inverts the value of each access control identifier 112, and an OR gate 404 that processes the value output by NOT gate 402 with operational mode signal 120 and outputs a value that defines an access decision.
[0107] 4C and 4D next illustrate an example logic circuit 108 for an example electronic device that includes multiple transaction hosts 102, such as the example electronic device 300 shown in FIG.
[0108] 4C illustrates an exemplary logic circuit 108c that implements the access control identifier scheme shown in Table 1 above according to the first example above, i.e., with multiple transaction hosts 102. The logic circuit 108c includes a multiplexer (MUX) 406 that receives (a) an AC identifier 112 value for each transaction host 102 and (b) an access request identifier (TH_id) identifying each transaction host 102 requesting access to a respective peripheral device 104, selects the respective AC identifier 112 value associated with each transaction host 102 in response to the access request identifier (TH_id), and forwards the selected AC_ID value to a NOT gate (or inverter) 402 that inverts the AC_ID value and outputs a value that defines an access decision.
[0109] In other examples, the meanings of the example AC_ID values set forth in Tables 1, 2, and / or 3 may be reversed, e.g., AC_ID=0 indicates a no-access or restricted access setting, and AC_ID=1 indicates an allowed or open access setting. In such examples, NOT gate (inverter) 402 may be omitted from logic circuits 108a-108d shown in Figures 4A-4D.
[0110] 4D illustrates an exemplary logic circuit 108d that implements the access control identifier scheme according to the second example described above, i.e., the one shown in Table 2 above. Logic circuit 108d receives (a) the value of the AC identifier 112 for each transaction host 102 and (b) an access request identifier (TH_id) identifying each transaction host 102 requesting access to each peripheral device 104, and includes a multiplexer (MUX) 406 that selects the value of the AC identifier 112 associated with each transaction host 102 in response to the access request identifier (TH_id), with the selected AC_ID value being forwarded to a NOT gate 402 that inverts the AC_ID value. Logic circuit 108d further includes an OR gate 404 that processes the value output by NOT gate 402 with the operating mode signal 120 of each transaction host 102 and outputs a value that defines an access decision.
[0111] 5 is a flowchart of an example method 500 for controlling access to peripherals in an electronic device including a transaction host, a first peripheral, a second peripheral, and an access control register. In some examples, the electronic device may be the example electronic device 100 or electronic device 300 described above. At 502, a first access control identifier for the first peripheral and a second access control identifier for the second peripheral are stored in the access control register. For example, the first access control identifier and the second access control identifier may be programmed by the transaction host prior to performing a respective task (e.g., a device driver task), e.g., based on an operational mode of the transaction host and / or based on a respective peripheral (e.g., the first peripheral, the second peripheral, or another peripheral) that will be accessed to perform the respective task.
[0112] At 504, during execution of the respective tasks, a first access controller associated with the first peripheral device receives a request for access to the first peripheral device from a transaction host. For example, the transaction host may be executing a device driver task corresponding to the first peripheral device. In some examples, the access request from the transaction host optionally includes an operational mode signal indicating a privileged mode or a user mode of the transaction host.
[0113] At 506, the first access controller accesses a first access control identifier for the first peripheral device from the access control register. At 508, the first access controller performs an access decision to alternately permit or prohibit access to the first peripheral device by the transaction host based on at least the accessed first access control identifier for the first peripheral device, e.g., using a respective LUT stored in memory or, e.g., using a respective logic circuit such as shown in any of FIGS. 4A-4D. For example, the first access controller may perform the access decision according to the access control identifier scheme described above with respect to Table 1. In some examples, the first access controller may also use the optionally received operation mode signal (see 504 above) as another input for the access decision. For example, the first access controller may perform the access decision according to the access control identifier scheme described above with respect to Table 2 based on the first access control identifier and the operation mode indicated by the optional operation mode signal.
[0114] At 510, the first access controller grants or denies access to the first peripheral device based on the access decision. For example, to deny access to the first peripheral device, the first access controller can force a "chip select" signal (also called a "peripheral select" signal) associated with the requested transaction from a value of 1 (indicating that the first peripheral device is targeted / selected) to a value of 0 (indicating that the first peripheral device is not targeted / selected) so that the first peripheral device will ignore the transaction. Alternatively, to allow access to the first peripheral device, the first access controller can leave the chip select signal value unchanged (value of 1) or force the chip select signal associated with the requested transaction from a value of 0 to a value of 1 so that the first peripheral device will process the transaction. (In the alternative, other chip select signal values may be defined to indicate whether the respective peripheral is targeted / selected. For example, a system may define that a chip select signal value=0 indicates that the peripheral is targeted / selected, and a chip select signal value=1 indicates that the peripheral is not targeted / selected.)
[0115] 6 is a flowchart of an example method 600 for controlling access to peripherals in an electronic device including a transaction host, a plurality of peripherals, and an access control register that stores access control identifiers (AC identifiers) for each of the plurality of peripherals. In some examples, the electronic device may be the example electronic device 100 or electronic device 300 described above, and method 600 may correspond to the access control identifier scheme described above with respect to Table 1.
[0116] At 602, the transaction host programs AC identifiers for multiple peripherals, e.g., based on the transaction host's planned operation. In this example, for privileged mode operation, the transaction host sets the AC identifier for each peripheral to an access permission setting (AC_ID value=0) that allows the transaction host to access the respective peripheral. In some examples, the transaction host can execute access control identifier management instructions provided in the supervisor firmware to access and program the AC identifiers. In some examples, the transaction host can ignore the bit mask when setting the AC identifier for privileged mode operation, since all peripherals are accessible during privileged mode operation.
[0117] At 604, the transaction host operates in a privileged mode, e.g., by executing associated supervisor code, e.g., supervisor firmware. At 606, while the transaction host is operating in the privileged mode, each access controller corresponding to each peripheral of the plurality of peripherals enables access to each peripheral based on the access permission setting of the respective AC identifier (AC_ID value=0) for the respective peripheral, e.g., using a respective LUT stored in a memory or using a respective logic circuit, as shown in Figure 4A (single transaction host scenario) or Figure 4C (multiple transaction host scenario).
[0118] At 608, while the transaction host is operating in privileged mode (AC identifier programmed to 0), supervisor firmware executed by the transaction host identifies each task associated with a selected peripheral (“peripheral N”) to be executed in user mode. At 610, before executing each task associated with peripheral N, the transaction host accesses a respective bit mask associated with each task, the respective bit mask indicating access settings of the multiple peripherals (including peripheral N) for executing the respective task, and programs AC identifiers of the multiple peripherals based on the respective bit masks. In this example, the transaction host (a) programs the AC identifier of peripheral N to an access permission setting (AC_ID value = 0) that allows access to peripheral N during user mode execution of the respective task, and (b) programs the AC identifiers of the other peripherals of the multiple peripherals to an access prohibition setting (AC_ID value = 1) that prohibits access to each respective peripheral during user mode execution of the respective task.
[0119] At 612, the transaction host transitions from privileged mode to user mode and executes a respective task associated with peripheral device N. At 614, to execute a respective task associated with peripheral device N, the access controller corresponding to peripheral device N enables access to peripheral device N (e.g., access to a register within peripheral device N) based on the access permission setting (AC_ID value=0) of the AC identifier of peripheral device N (programmed based on the respective bit masks associated with the respective tasks), e.g., using a respective LUT stored in memory or using a respective logic circuit, as shown in FIG. 4A (single transaction host scenario) or FIG. 4C (multiple transaction host scenario). If the transaction host attempts to access any of the other peripherals, the access controller corresponding to each of the other peripherals prohibits access to the other peripherals based on the access prohibition setting (AC_ID value=1) of the respective AC identifier for the other peripherals, e.g., using a respective LUT or logic circuit, as shown in FIG. 4A or 4C.
[0120] At 616, the transaction host completes the respective task associated with peripheral device N. At 618, the transaction host may identify the next transaction host activity to execute in user mode. For example, as shown at 620, if the supervisor firmware executed by the transaction host identifies the next peripheral-related task (related to the same peripheral device or a different peripheral device) to execute in user mode, the method may return to 610, and the transaction host programs the AC identifiers accordingly to execute the next task (e.g., based on the respective bit masks associated with the next task). As another example, as shown at 622, if the supervisor firmware executed by the transaction host identifies a supervisory or privileged operation to be executed, the method may return to 602, and the transaction host (optionally) programs the AC identifiers of multiple peripheral devices to an access permission setting (AC_ID value=0) (e.g., ignoring the respective bit masks) to enable access by the transaction host to the respective peripherals during the supervisory or privileged operation, as described above. In some instances or situations, it may be unnecessary to program the AC identifier for supervisor or privileged operations (because a transaction host executing supervisor code may have access to all registers), and therefore the AC identifier programming in 602 may be omitted or may be optional.
[0121] 7 is a flowchart of an example method 700 for controlling access to peripherals in an electronic device including a transaction host, a plurality of peripherals, and an access control register that stores access control identifiers (AC identifiers) for each of the plurality of peripherals. In some examples, the electronic device may be the example electronic device 100 or the example electronic device 300 described above, and the method 700 may correspond to the access control identifier scheme described above with respect to Table 2.
[0122] At 702, the transaction host programs AC identifiers for multiple peripheral devices, for example, based on the transaction host's planned operation. In this example, for privileged mode operation, the transaction host sets the AC identifier for each peripheral device to a restricted access setting (AC_ID value=1). In some examples, the transaction host can execute access control identifier management instructions provided in the supervisor firmware to access and program the AC identifiers.
[0123] At 704, the transaction host operates in privileged mode, for example, by executing associated supervisor firmware. At 706, while the transaction host is operating in privileged mode (AC identifier programmed to 1), each access controller corresponding to each peripheral among the multiple peripherals enables access to the respective peripheral, for example, using a respective LUT stored in memory or using a respective logic circuit, as shown, for example, in FIG. 4B (single transaction host scenario) or FIG. 4D (multiple transaction host scenario). Each request by the transaction host to access a respective peripheral may include an operation mode signal indicating the privileged mode of the transaction host (e.g., operation mode signal value = 1 according to the control bit scheme shown in Table 2). For each request by the transaction host to access a respective peripheral, each access controller corresponding to the respective peripheral can determine whether to enable or prohibit access to the respective peripheral based on (a) the respective AC identifier for the respective peripheral and (optionally in a multiple transaction host scenario) the respective transaction host, and (b) the operation mode signal indicating the privileged mode (e.g., operation mode signal value = 1), according to the control bit scheme shown in Table 2 above. More specifically, each access controller enables access to each peripheral device based on the privilege mode (eg, operation mode signal value=1) of each transaction host.
[0124] At 708, while the transaction host is operating in privileged mode, supervisor firmware executed by the transaction host identifies respective tasks to be performed associated with a selected peripheral (“peripheral N”) of the plurality of peripherals in user mode. At 710, before executing each task associated with peripheral N in user mode, the transaction host accesses respective bit masks associated with the respective tasks, the respective bit masks indicating access settings of the plurality of peripherals (including peripheral N) for executing the respective tasks, and programs AC identifiers of the plurality of peripherals associated with the transaction host based on the respective bit masks. In this example, the transaction host (a) programs the AC identifier of peripheral N to an open permission setting (AC_ID value=0) and (b) programs the AC identifiers of other peripherals of the plurality of peripherals associated with the transaction host to a restricted access setting (AC_ID value=1) in accordance with the control bit scheme shown in Table 2 above.
[0125] At 712, the transaction host transitions from privileged mode to user mode and executes the respective tasks associated with peripheral device N. At 714, to execute the respective tasks associated with peripheral device N, the access controller corresponding to peripheral device N enables access to peripheral device N (e.g., access to registers within peripheral device N) based on (a) an open access setting (AC_ID value=0), e.g., using a respective LUT stored in memory or using a respective logic circuit, e.g., as shown in FIG. 4B (single transaction host scenario) or FIG. 4D (multiple transaction host scenario). If the transaction host attempts to access any of the other peripherals, the respective access controllers corresponding to the other peripherals prohibit access to the other peripherals based on (a) a restricted access setting (AC_ID value=1) and (b) the user mode of the transaction host (operation mode signal value=0), e.g., using a respective LUT or logic circuit, according to Table 2, e.g., as shown in FIG. 4B or 4D.
[0126] At 716, the transaction host completes each task associated with peripheral N in user mode. At 718, the transaction host may identify the next transaction host activity to perform. For example, as shown at 720, if the supervisor firmware executed by the transaction host identifies the next peripheral-related task (associated with the same peripheral or a different peripheral) to be performed in user mode, the method may return to 710, where the transaction host programs the AC identifiers accordingly to perform the next task (e.g., based on the respective bit mask associated with the next task). As another example, as shown at 722, if the supervisor firmware executed by the transaction host identifies a supervisory operation or a privileged operation to be performed in privileged mode, the method may return to 702, where the transaction host programs the AC identifiers of the multiple peripherals to the restricted access setting (AC_ID value=1), as described above.
[0127] 8 is a flowchart of an example method 800 for controlling access to peripherals in an electronic device including a transaction host, a first peripheral, a second peripheral, and an access control register that stores respective access control identifiers (AC identifiers). In some examples, the electronic device may be example electronic device 100 or electronic device 300 described above, and method 800 may correspond to the access control identifier scheme described above, for example, with respect to any of Table 1, Table 2, or Table 3 described above.
[0128] At 802, a first access control identifier for a first peripheral device and a second access control identifier for a second peripheral device are stored in an access control register. The transaction host can dynamically program the first access control identifier and the second access control identifier over time to perform different types of operations, e.g., privileged mode operations and user mode operations, including operations associated with the first and second peripheral devices. In some examples, the transaction host can execute access control identifier management instructions provided in supervisor firmware to dynamically program the first access control identifier and the second access control identifier before performing respective tasks (e.g., device driver tasks).
[0129] For example, at 804, for a privileged mode operation, the transaction host sets a first access control identifier and a second access control identifier to enable access to a first peripheral device and a second peripheral device, respectively. In some examples or situations, programming an AC identifier for a privileged mode operation may be unnecessary (because a transaction host executing supervisor code may have access to all registers), and thus, the AC identifier programming at 804 may be omitted or may be optional. In some examples, the transaction host sets the first and second access control identifiers according to an access bit scheme such as described above with respect to any of Table 1, Table 2, or Table 3 above. At 806, the transaction host performs a privileged mode operation at a first time, and thus, at 806, the operation mode signal indicates privileged mode.
[0130] At 808, for a user-mode operation (user-mode task) associated with the first peripheral device, the transaction host accesses respective bit masks associated with the user-mode task, the bit masks indicating access settings for at least the first and second peripheral devices, and programs AC identifiers for at least the first and second peripheral devices based on the respective bit masks. In this example, the transaction host (a) sets a first access control identifier to enable access to the first peripheral device by the transaction host in user mode, and (b) sets a second access control identifier to prohibit access to the second peripheral device by the transaction host in user mode. In some examples, the transaction host sets the first and second access control identifiers according to an access bit scheme such as described above with respect to any of Table 1, Table 2, or Table 3 above. At 810, the transaction host executes the user-mode task associated with the first peripheral device at a second time, and therefore, at 810, the operation mode signal indicates user mode.
[0131] The transaction host can continue to dynamically program the first access control identifier and the second access control identifier over time in this manner to perform different types of operations, e.g., privileged mode operations and user mode operations, including operations associated with the first and second peripheral devices.
[0132] 9 is a flowchart of an example method 900 for controlling access to peripherals using task-related bit masks in an electronic device including a transaction host, a first peripheral, a second peripheral, and an access control register including a first access control identifier for the first peripheral and a second access control identifier for the second peripheral. At 902, computer-readable code is stored including a first task associated with the first peripheral and a first bit mask corresponding to the first task, the first bit mask indicating respective access settings of the first peripheral and the second peripheral for executing the first task. At 904, the transaction host, prior to executing the first task, executes access control identifier management instructions to program the first access control identifier and the second access control identifier in the access control register based on (a) the first bit mask corresponding to the first task, and, in some implementations, (b) an operational mode of the transaction host. At 906, after updating the first access control identifier and the second access control identifier in the access control register, the transaction host executes a first task associated with the first peripheral device. At 908, during execution of the first task, a first access controller associated with the first peripheral device controls access to the first peripheral device based at least on the first access control identifier in the access control register programmed based on the first bit mask. At 910, also during execution of the first task, a second access controller associated with the second peripheral device controls access to the second peripheral device based at least on the second access control identifier in the access control register programmed based on the first bit mask.
Claims
1. 1. An electronic device comprising: A first peripheral device; A second peripheral device; and A non-transitory memory, comprising: Supervisor firmware including access control identifier management instructions; computer readable code including a first task associated with the first peripheral device; a non-transitory memory that stores a first bitmask corresponding to the first task, the first bitmask indicating access settings of each of the first peripheral device and the second peripheral device for executing the first task; an access control register containing a first access control identifier for the first peripheral device and a second access control identifier for the second peripheral device; A transaction host, executing the access control identifier management instruction in the supervisor firmware to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask corresponding to the first task; a transaction host for performing the first task associated with the first peripheral device after updating the first access control identifier and the second access control identifier in the access control register based on the first bit mask; a first access controller for controlling access to the first peripheral device based at least on the first access control identifier in the access control register programmed based on the first bit mask; a second access controller for controlling access to the second peripheral device based at least on the second access control identifier in the access control register programmed based on the first bit mask; An electronic device comprising:
2. The electronic device of claim 1 , wherein the electronic device is a system-on-chip (SoC) device.
3. The electronic device of claim 1 or 2, wherein the transaction host comprises a processor or a direct memory access (DMA) engine.
4. The electronic device of claim 1 , wherein the first bitmask and the second bitmask are stored in a bitmask data structure in the non-transitory memory.
5. the first bitmask includes one or more first bitmask bits indicating an access setting for the first peripheral device to perform the first task, and one or more second bitmask bits indicating an access setting for the second peripheral device to perform the first task; 5. The electronic device of claim 1, wherein the first access control identifier comprises one or more first access control bits and the second access control identifier comprises one or more second first access control bits.
6. the computer readable code includes a second task associated with the second peripheral device; the non-transitory memory stores a second bitmask corresponding to the second task, the second bitmask indicating respective access settings of the first peripheral and the second peripheral for executing the second task; The transaction host: executing the access control identifier management instruction in the supervisor firmware to program the first access control identifier and the second access control identifier in the access control register based on the second bit mask corresponding to the second task; 6. The electronic device of claim 1, further comprising: a first access control identifier and a second access control identifier in the access control register based on the second bit mask, and then executing the second task associated with the second peripheral device.
7. The non-transitory memory comprises: a non-privileged portion storing the computer readable code including the first task and the second task; 7. The electronic device of claim 1, further comprising: a privileged portion that stores the supervisor firmware including the access control identifier management instruction and the first bitmask corresponding to the first task.
8. The first access controller receiving an access request from the transaction host to access the first peripheral device to perform the first task; performing an access decision for the first peripheral device based at least on the first access control identifier programmed based on the first bitmask corresponding to the first task; The electronic device of claim 1 , further comprising: a transaction host that is configured to allow or prohibit access to the first peripheral device based on the access decision.
9. 9. The electronic device of claim 8, wherein the first access controller performs the access decision for the first peripheral based at least on (a) the first access control identifier programmed by the transaction host based on the first bit mask corresponding to the first task, and (b) an operational mode signal indicating either a privileged mode of the transaction host or a user mode of the transaction host.
10. 10. The electronic device of claim 1, wherein the first bitmask corresponding to the first task indicates: (a) that the first task has been assigned a peripheral access permission for the first peripheral device; and (b) that the first task has not been assigned a peripheral access permission for the second peripheral device.
11. the first bitmask corresponding to the first task indicates that (a) the first task is assigned a peripheral access permission for the first peripheral device, and (b) the first task is not assigned a peripheral access permission for the second peripheral device; the access control identifier management instruction programs the first access control identifier and the second access control identifier in the access control register based on the first bit mask before execution of the first task, which includes: (a) updating the first access control identifier to an access permission value that enables access to the first peripheral device during execution of the first task; and (b) updating the second access control identifier to an access prohibition value that prohibits access to the second peripheral device during execution of the first task; the first access controller grants access to the first peripheral device during execution of the first task based on the access permission value of the first access control identifier; The electronic device of claim 10 , wherein the second access controller is configured to prohibit access to the second peripheral during execution of the first task based on the access prohibition value of the second access control identifier.
12. the transaction host selectively operates in a privileged mode and a user mode; the first bitmask corresponding to the first task indicates that (a) the first task is assigned a peripheral access permission for the first peripheral device, and (b) the first task is not assigned a peripheral access permission for the second peripheral device; 12. The electronic device of claim 1, wherein the access control identifier management instruction programs the first access control identifier and the second access control identifier in the access control register based on the first bit mask before execution of the first task, comprising: (a) updating the first access control identifier to an open access setting for the first peripheral device that enables access to the first peripheral device in both the privileged mode and the user mode of the transaction host; and (b) updating the second access control identifier to a limited access value for the second peripheral device that enables access to the second peripheral device in the privileged mode of the transaction host but does not allow access to the second peripheral device in the user mode.
13. An electronic device according to any preceding claim, wherein the access control register is provided in a third peripheral.
14. 1. A method comprising: In an electronic device including a transaction host, a first peripheral, a second peripheral, and an access control register including a first access control identifier for the first peripheral and a second access control identifier for the second peripheral, the method comprising: storing: (a) computer readable code including a first task associated with the first peripheral; and (b) a first bit mask corresponding to the first task, the first bit mask indicating respective access settings of the first peripheral and the second peripheral for performing the first task; executing, by the transaction host before executing the first task, an access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask corresponding to the first task; after updating the first access control identifier and the second access control identifier in the access control register based on the first bit mask, the transaction host executes the first task associated with the first peripheral device; During execution of the first task, a first access controller associated with the first peripheral device controlling access to the first peripheral device based at least on the first access control identifier in the access control register programmed based on the first bit mask; a second access controller associated with the second peripheral device controlling access to the second peripheral device based at least on the second access control identifier in the access control register programmed based on the first bitmask; A method comprising:
15. storing computer readable code including a second task associated with the second peripheral device; storing a second bitmask corresponding to the second task, the second bitmask indicating respective access settings of the first peripheral and the second peripheral for executing the second task; executing, by the transaction host before executing the second task, the access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the second bit mask corresponding to the second task; after updating the first access control identifier and the second access control identifier in the access control register based on the second bit mask, the transaction host executes the second task associated with the second peripheral device; During execution of the second task, controlling access to the first peripheral device by the first access controller associated with the first peripheral device based at least on the first access control identifier in the access control register programmed based on the second bit mask; and a second access controller associated with the second peripheral device controlling access to the second peripheral device based at least on the second access control identifier in the access control register programmed based on the second bitmask.
16. The step of the first access controller controlling access to the first peripheral device based at least on the first access control identifier programmed based on the first bit mask includes: receiving, by the first access controller, an access request from the transaction host to access the first peripheral device to perform the first task; the first access controller making an access decision for the first peripheral device based at least on the first access control identifier programmed based on the first bitmask; The method according to claim 14 or 15, further comprising the step of: the first access controller allowing or prohibiting the transaction host from accessing the first peripheral device based on the access decision.
17. 17. The method of claim 16, further comprising the step of: the first access controller making the access decision for the first peripheral device based at least on (a) the first access control identifier programmed based on the first bit mask, and (b) an operational mode signal indicative of either a privileged mode of the transaction host or a user mode of the transaction host.
18. the first bitmask corresponding to the first task indicates that (a) the first task is assigned a peripheral access permission for the first peripheral device, and (b) the first task is not assigned a peripheral access permission for the second peripheral device; the step of executing the access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask corresponding to the first task includes the steps of: (a) updating, during execution of the first task, the first access control identifier to an access permission value that enables access to the first peripheral device; and (b) updating, during execution of the first task, the second access control identifier to an access prohibition value that prohibits access to the second peripheral device; During execution of the first task, the first access controller associated with the first peripheral device grants access to the first peripheral device based on the access permission value of the first access control identifier; 18. The method of claim 14, wherein the second access controller associated with the second peripheral device prohibits access to the second peripheral device based on the access prohibition value of the second access control identifier.
19. the transaction host selectively operates in a privileged mode and a user mode; the first bitmask corresponding to the first task indicates that (a) the first task is assigned a peripheral access permission for the first peripheral device, and (b) the first task is not assigned a peripheral access permission for the second peripheral device; the step of executing the access control identifier management instruction to program the first access control identifier and the second access control identifier in the access control register based on the first bit mask corresponding to the first task includes the steps of: (a) updating the first access control identifier to an open access value for the first peripheral device that allows access to the first peripheral device in both the privileged mode and the user mode of the transaction host; and (b) updating the second access control identifier to a restricted access value for the second peripheral device that allows access to the second peripheral device in the privileged mode of the transaction host but does not allow access to the second peripheral device in the user mode; During execution of the first task, the first access controller associated with the first peripheral device grants access to the first peripheral device in both the privileged mode and the user mode of the transaction host based on the open access value of the first access control identifier; 19. The method of claim 14, wherein the second access controller associated with the second peripheral device prohibits access to the second peripheral device in the privileged mode of the transaction host based on the limited access value of the second access control identifier, but does not prohibit access to the second peripheral device in the user mode of the transaction host.
Citation Information
Patent Citations
Data processing system and method with peripheral device access protection
JP2006523347A
Information processor, and access control method therefor
JP2007334432A
Data processor, and method for protecting peripheral device in data processor
JP2009134400A
System and method for per-task memory protection for a non-programmable bus master
US20140223047A1
