WO2013111022A1 - Branch prediction logic - Google Patents
Branch prediction logic Download PDFInfo
- Publication number
- WO2013111022A1 WO2013111022A1 PCT/IB2013/050029 IB2013050029W WO2013111022A1 WO 2013111022 A1 WO2013111022 A1 WO 2013111022A1 IB 2013050029 W IB2013050029 W IB 2013050029W WO 2013111022 A1 WO2013111022 A1 WO 2013111022A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- branch prediction
- prediction logic
- operating system
- guest operating
- enable state
- Prior art date
Links
- 238000012545 processing Methods 0.000 claims abstract description 107
- 238000000034 method Methods 0.000 claims description 58
- 230000008569 process Effects 0.000 claims description 42
- 230000004044 response Effects 0.000 claims description 22
- 238000004886 process control Methods 0.000 claims 2
- 238000005457 optimization Methods 0.000 abstract description 3
- 230000015654 memory Effects 0.000 description 146
- 238000004891 communication Methods 0.000 description 130
- 239000000872 buffer Substances 0.000 description 20
- 238000013461 design Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 12
- 230000005540 biological transmission Effects 0.000 description 10
- 238000003860 storage Methods 0.000 description 8
- 230000007246 mechanism Effects 0.000 description 6
- 230000008901 benefit Effects 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 238000013519 translation Methods 0.000 description 4
- 230000002457 bidirectional effect Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000004888 barrier function Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3842—Speculative instruction execution
- G06F9/3848—Speculative instruction execution using hybrid branch prediction, e.g. selection between prediction techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3802—Instruction prefetching
- G06F9/3804—Instruction prefetching for branches, e.g. hedging, branch folding
- G06F9/3806—Instruction prefetching for branches, e.g. hedging, branch folding using address prediction, e.g. return stack, branch history buffer
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3842—Speculative instruction execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3842—Speculative instruction execution
- G06F9/3844—Speculative instruction execution using dynamic branch prediction, e.g. using branch history tables
Definitions
- the invention is generally related to data processing, and in particular to processor architectures and branch prediction logic utilized therein.
- branch prediction attempts to predict, in advance of execution of a conditional branch instruction, whether or not that branch instruction will branch to a different code path or continue along the same code path based upon the result of some comparison performed in association with the branch instruction.
- Branch prediction may be used, for example, to prefetch instructions from a cache or lower level memory to reduce the latency of loading and executing those instructions when the branch instruction is finally resolved.
- branch prediction may be used to initiate execution of instructions from a predicted branch before a branch instruction is resolved, such that the results of those instructions can be committed as soon as possible after the branch instruction is resolved.
- branch prediction logic For example, rely on historical information, and are based upon the assumption that if a branch was taken the last time a branch instruction was executed, a likelihood exists that the branch will be taken the next time that branch instruction is executed.
- a branch history table is used to store entries associated with particular branch instructions so that when those branch instructions are encountered, a prediction may be made based upon data stored in the associated with such branch instructions.
- branch prediction logic in a processor, however, presents a number of challenges. For example, improving the accuracy of branch prediction logic often requires the use of more complex logic, which can slow down branch prediction and add to the amount of logic circuitry required to implement the logic. With history-based branch prediction logic, accuracy is often directly proportional to the amount of historical information stored by the logic; however, increasing the storage capacity of a branch history table requires additional logic circuitry. In many applications, there is a desire to minimize the amount of logic circuitry in a processor chip devoted to branch prediction logic, e.g., to reduce power consumption and/or cost, or to free up additional space to implement other functionality.
- branch prediction algorithms often don't work well for certain types of program code.
- Some program code such as, for example, binary tree searches, exhibit practically random branch characteristics, and a branch decision made during one execution of a branch instruction may provide no insight to what decision will be made the next time the instruction is executed.
- the limited size of a branch prediction table that is shared by multiple threads can result in historical information being frequently discarded as new branch instructions are encountered, such that the historical information for a particular branch instruction may no longer be in the branch prediction table by the time that branch instruction is later executed.
- branch prediction can actually decrease performance when the percentage of mispredicts rises to a level where the penalties of the mispredicts exceed the latencies that would have otherwise occurred if the processing core waited to resolve branch instructions before attempting to execute the instructions in the proper code path.
- Some conventional processor designs have provided an ability to selectively disable branch prediction logic.
- some conventional processor designs have provided an ability to save and restore the state of branch prediction logic.
- History-based branch prediction logic in particular, tends to improve in accuracy over time as more historical information is collected; however, if multiple independent threads are accessing branch prediction logic with a limited amount of storage, the collection of historical information for one thread may cause historical information for other threads to be discarded.
- the branch prediction logic often can be "primed" for different code sections so that historical information collected for those code sections in the past are more likely to be resident in the branch prediction logic the next time those code sections are executed.
- the invention addresses one or more of the problems associated with the prior art by providing virtualization support that permits both a hypervisor and one or more guest operating systems resident in a data processing system and hosted by the hypervisor to selectively enable or disable branch prediction logic through separate hypervisor-mode and guest-mode instructions. By doing so, different branch prediction strategies may be employed for different operating systems and user applications hosted thereby to provide finer grained optimization of the branch prediction logic.
- branch prediction logic in a data processing system is controlled by selectively setting an enable state of branch prediction logic in at least one processing core in response to a hypervisor running on the processing core, selectively overriding the enable state of the branch prediction logic set by the hypervisor in response to a guest operating system running on the processing core and hosted by the hypervisor such that the guest operating system controls the enable state of the branch prediction logic while the processing core is executing the guest operating system, and selectively enabling the branch prediction logic based upon the enable state of the branch prediction logic.
- FIG. 1 is a block diagram of exemplary automated computing machinery including an exemplary computer useful in data processing consistent with embodiments of the present invention.
- FIG. 2 is a block diagram of an exemplary NOC implemented in the computer of FIG. 1.
- FIG. 3 is a block diagram illustrating in greater detail an exemplary implementation of a node from the NOC of FIG. 2.
- FIG. 4 is a block diagram illustrating an exemplary implementation of an IP block from the NOC of FIG. 2.
- FIG. 5 is a block diagram of a data processing system within which may be implemented virtualization support for fine grained control of branch prediction logic consistent with the invention.
- FIG. 6 is a block diagram of an exemplary enable mode control register in the special purpose registers referenced in Fig. 5.
- FIG. 7 is a block diagram of an exemplary process-specific enable mode data structure capable of being used in the data processing system of Fig. 5.
- FIG. 8 is a block diagram of an exemplary thread-specific enable mode data structure capable of being used in the data processing system of Fig. 5.
- FIG. 9 is a flowchart illustrating an exemplary sequence of operations performed by the data processing system of Fig. 5 when performing context switches between hypervisor, guest operating system and user mode program code with selectively enabled brand prediction logic.
- FIG. 10 is a block diagram of an exemplary save mode control register in the special purpose registers referenced in Fig. 5.
- FIG. 11 is a block diagram of an exemplary state load/store unit capable of being used in the data processing system of Fig. 5 to save and restore branch prediction logic state data.
- FIG. 12 is a flowchart illustrating an exemplary sequence of operations performed by the data processing system of Fig. 5 when performing context switches between hypervisor, guest operating system and user mode program code with save and restore of brand prediction logic state.
- FIG. 13 is a flowchart illustrating an exemplary sequence of operations performed to save branch prediction logic state as referenced in Fig. 12.
- FIG. 14 is a flowchart illustrating an exemplary sequence of operations performed to restore branch prediction logic state as referenced in Fig. 12. Detailed Description
- Embodiments consistent with the invention utilize fine grained control of branch prediction logic through multiple levels of a virtualized data processing system to optimize branch prediction for different applications and workloads, thereby improving overall data processing system performance when handling different types of workloads.
- a hypervisor and one or more guest operating systems resident in a data processing system and hosted by the hypervisor are configured to selectively enable or disable branch prediction logic through separate hypervisor-mode and guest-mode instructions.
- a hypervisor and one or more programs, e.g., guest operating systems and/or user processes or applications hosted by the hypervisor to selectively save and restore the state of branch prediction logic through separate hypervisor-mode and guest-mode and/or user-mode instructions.
- a hypervisor may include any number of supervisory-mode programs that are capable of virtualizing or hosting one or more guest operating systems, and may be implemented in variously levels of software, e.g., firmware, a kernel, etc.
- a hypervisor typically virtualizes the underlying hardware in a data processing system and presents an interface to the operating systems hosted thereby so that each operating system operates as if it is the sole operating system resident in the physical hardware of the data processing system.
- a guest operating system is typically an operating system , logical partition, virtual machine or combination thereof that is hosted by an underlying hypervisor, and that supports the execution of one or more user applications running in one or more concurrent processes in the operating system environment.
- a guest operating system essentially virtualizes and allocates hardware resources assigned to the guest operating system to one or more user applications and processes.
- a user application may in turn be any program capable of running within a process in a guest operating system.
- hypervisor program code typically runs in a supervisor or hypervisor-mode, while user applications typically run in a lower priority user-mode.
- Guest operating systems may also run in a supervisor mode or may run in a separate guest-mode that is intermediate the hypervisor and user modes.
- branch prediction logic may incorporate any number of logic designs with the primary goal of minimizing the latency associated with branch instructions.
- Many branch prediction logic designs utilize branch history tables, and many may include other logic such as g-share logic, link stack logic, branch target buffers, etc.
- branch prediction logic is selectively enabled and disabled by any or all of a hypervisor, guest operating systems and user applications and programs.
- enabling or disabling branch prediction logic may be considered to include enabling or disabling all or only a subset of components implemented in a particular branch prediction logic design.
- disabling branch prediction logic may cause a reset of the branch prediction logic, e.g., to clear out entries from a branch prediction table, in some embodiments.
- disabling branch prediction logic may be analogous to "pausing" the logic, e.g., so that predictions are not made, and historical information is not collected, but that the historical information that has already been collected, and other characteristics of the current state of the branch prediction logic, is maintained until the logic is re-enabled, so that no state or historical information is lost.
- the state of branch prediction logic may be selectively saved and restored on behalf of a hypervisor, a guest operating system and/or a user application or program.
- the state that may be saved or restored may include any or all of the data maintained in branch prediction logic that characterizes the overall state of the logic, including, for example, branch table entries, branch target buffer data, link stack entries, g-share data, etc.
- FIG. 1 illustrates exemplary automated computing machinery including an exemplary computer 10 useful in data processing consistent with embodiments of the present invention.
- Computer 10 of Fig. 1 includes at least one computer processor 12 or 'CPU' as well as random access memory 14 ('RAM'), which is connected through a high speed memory bus 16 and bus adapter 18 to processor 12 and to other components of the computer 10.
- 'RAM' random access memory
- RAM 14 Stored in RAM 14 is an application program 20, a module of user- level computer program instructions for carrying out particular data processing tasks such as, for example, word processing, spreadsheets, database operations, video gaming, stock market simulations, atomic quantum process simulations, or other user-level applications. Also stored in RAM 14 is an operating system 22. Operating systems useful in connection with embodiments of the invention include UNIXTM, LinuxTM, Microsoft Windows XPTM, AIXTM, IBM's i5/OSTM, and others as will occur to those of skill in the art. Operating system 22 and application 20 in the example of Fig. 1 are shown in RAM 14, but many components of such software typically are stored in non-volatile memory also, e.g., on a disk drive 24.
- NOC video adapter 26 which may alternatively be referred to as a graphics adapter, is an example of an I/O adapter specially designed for graphic output to a display device 30 such as a display screen or computer monitor.
- NOC video adapter 26 is connected to processor 12 through a high speed video bus 32, bus adapter 18, and the front side bus 34, which is also a high speed bus.
- NOC Coprocessor 28 is connected to processor 12 through bus adapter 18, and front side buses 34 and 36, which is also a high speed bus.
- the NOC coprocessor of Fig. 1 may be optimized, for example, to accelerate particular data processing tasks at the behest of the main processor 12.
- the exemplary NOC video adapter 26 and NOC coprocessor 28 of Fig. 1 each include a NOC, including integrated processor ('IP') blocks, routers, memory
- NOC video adapter and NOC coprocessor are each optimized for programs that use parallel processing and also require fast random access to shared memory. It will be appreciated by one of ordinary skill in the art having the benefit of the instant disclosure, however, that the invention may be implemented in devices and device architectures other than NOC devices and device architectures. The invention is therefore not limited to implementation within an NOC device.
- Computer 10 of Fig. 1 includes disk drive adapter 38 coupled through an expansion bus 40 and bus adapter 18 to processor 12 and other components of the computer 10.
- Disk drive adapter 38 connects non- volatile data storage to the computer 10 in the form of disk drive 24, and may be implemented, for example, using Integrated Drive Electronics ('IDE') adapters, Small Computer System Interface ('SCSI') adapters, and others as will occur to those of skill in the art.
- Non- volatile computer memory also may be implemented for as an optical disk drive, electrically erasable programmable read-only memory (so-called
- Computer 10 also includes one or more input/output ('I/O') adapters 42, which implement user-oriented input/output through, for example, software drivers and computer hardware for controlling output to display devices such as computer display screens, as well as user input from user input devices 44 such as keyboards and mice.
- 'I/O' input/output
- computer 10 includes a communications adapter 46 for data communications with other computers 48 and for data communications with a data communications network 50.
- Such data communications may be carried out serially through RS-232 connections, through external buses such as a Universal Serial Bus ('USB'), through data communications data communications networks such as IP data communications networks, and in other ways as will occur to those of skill in the art.
- Communications adapters implement the hardware level of data communications through which one computer sends data communications to another computer, directly or through a data communications network.
- Examples of communications adapters suitable for use in computer 10 include modems for wired dial-up communications, Ethernet (IEEE 802.3) adapters for wired data communications network communications, and 802.11 adapters for wireless data communications network
- Fig. 2 sets forth a functional block diagram of an example NOC 102 according to embodiments of the present invention.
- the NOC in Fig. 2 is implemented on a 'chip' 100, that is, on an integrated circuit.
- NOC 102 includes integrated processor ('IP') blocks 104, routers 110, memory communications controllers 106, and network interface controllers 108 grouped into interconnected nodes.
- 'IP' integrated processor
- Each IP block 104 is adapted to a router 110 through a memory communications controller 106 and a network interface controller 108.
- Each memory communications controller controls communications between an IP block and memory, and each network interface controller 108 controls inter- IP block communications through routers 110.
- each IP block represents a reusable unit of synchronous or
- IP block' is sometimes expanded as 'intellectual property block,' effectively designating an IP block as a design that is owned by a party, that is the intellectual property of a party, to be licensed to other users or designers of semiconductor circuits. In the scope of the present invention, however, there is no requirement that IP blocks be subject to any particular ownership, so the term is always expanded in this specification as 'integrated processor block.
- IP blocks as specified here, are reusable units of logic, cell, or chip layout design that may or may not be the subject of intellectual property. IP blocks are logic cores that can be formed as ASIC chip designs or FPGA logic designs.
- IP blocks are for NOC design what a library is for computer programming or a discrete integrated circuit component is for printed circuit board design.
- IP blocks may be implemented as generic gate netlists, as complete special purpose or general purpose microprocessors, or in other ways as may occur to those of skill in the art.
- a netlist is a Boolean-algebra representation (gates, standard cells) of an IP block's logical- function, analogous to an assembly-code listing for a high-level program application.
- NOCs also may be implemented, for example, in synthesizable form, described in a hardware description language such as Verilog or VHDL.
- NOCs also may be delivered in lower-level, physical descriptions.
- Analog IP block elements such as SERDES, PLL, DAC, ADC, and so on, may be distributed in a transistor-layout format such as GDSII. Digital elements of IP blocks are sometimes offered in layout format as well.
- IP blocks, as well as other logic circuitry implemented consistent with the invention may be distributed in the form of computer data files, e.g., logic definition program code, that define at various levels of detail the functionality and/or layout of the circuit arrangements implementing such logic.
- Computer readable storage media include, but are not limited to, physical, recordable type media such as volatile and non-volatile memory devices, floppy disks, hard disk drives, CD-ROMs, and DVDs (among others).
- Each IP block 104 in the example of Fig. 2 is adapted to a router 110 through a memory communications controller 106.
- Each memory communication controller is an aggregation of synchronous and asynchronous logic circuitry adapted to provide data communications between an IP block and memory. Examples of such communications between IP blocks and memory include memory load instructions and memory store instructions.
- the memory communications controllers 106 are described in more detail below with reference to Fig. 3.
- Each IP block 104 is also adapted to a router 110 through a network interface controller 108, which controls communications through routers 110 between IP blocks 104. Examples of communications between IP blocks include messages carrying data and instructions for processing the data among IP blocks in parallel applications and in pipelined applications.
- the network interface controllers 108 are also described in more detail below with reference to Fig. 3.
- the links 118 may be packet structures implemented on physical, parallel wire buses connecting all the routers. That is, each link may be implemented on a wire bus wide enough to accommodate simultaneously an entire data switching packet, including all header information and payload data. If a packet structure includes 64 bytes, for example, including an eight byte header and 56 bytes of payload data, then the wire bus subtending each link is 64 bytes wide, 512 wires.
- each link may be bidirectional, so that if the link packet structure includes 64 bytes, the wire bus actually contains 1024 wires between each router and each of its neighbors in the network.
- a message could include more than one packet, but each packet would fit precisely onto the width of the wire bus.
- a link may be implemented on a wire bus that is only wide enough to accommodate a portion of a packet, such that a packet would be broken up into multiple beats, e.g., so that if a link is implemented as 16 bytes in width, or 128 wires, a 64 byte packet could be broken into four beats. It will be appreciated that different implementations may used different bus widths based on practical physical limits as well as desired performance characteristics.
- each router includes five ports, one for each of four directions of data transmission on the network and a fifth port for adapting the router to a particular IP block through a memory communications controller and a network interface controller.
- Each memory communications controller 106 controls communications between an IP block and memory.
- Memory can include off-chip main RAM 112, memory 114 connected directly to an IP block through a memory communications controller 106, on-chip memory enabled as an IP block 116, and on-chip caches.
- NOC 102 either of the on-chip memories 114, 116, for example, may be implemented as on-chip cache memory. All these forms of memory can be disposed in the same address space, physical addresses or virtual addresses, true even for the memory attached directly to an IP block. Memory addressed messages therefore can be entirely bidirectional with respect to IP blocks, because such memory can be addressed directly from any IP block anywhere on the network.
- Memory 116 on an IP block can be addressed from that IP block or from any other IP block in the NOC.
- Memory 114 attached directly to a memory communication controller can be addressed by the IP block that is adapted to the network by that memory communication controller - and can also be addressed from any other IP block anywhere in the NOC.
- NOC 102 includes two memory management units ('MMUs') 120, 122, illustrating two alternative memory architectures for NOCs consistent with embodiments of the present invention.
- MMU 120 is implemented within an IP block, allowing a processor within the IP block to operate in virtual memory while allowing the entire remaining architecture of the NOC to operate in a physical memory address space.
- MMU 122 is implemented off-chip, connected to the NOC through a data communications port 124.
- the port 124 includes the pins and other interconnections required to conduct signals between the NOC and the MMU, as well as sufficient intelligence to convert message packets from the NOC packet format to the bus format required by the external MMU 122.
- the external location of the MMU means that all processors in all IP blocks of the NOC can operate in virtual memory address space, with all conversions to physical addresses of the off-chip memory handled by the off- chip MMU 122.
- data communications port 126 illustrates a third memory architecture useful in NOCs capable of being utilized in embodiments of the present invention.
- Port 126 provides a direct connection between an IP block 104 of the NOC 102 and off-chip memory 112. With no MMU in the processing path, this architecture provides utilization of a physical address space by all the IP blocks of the NOC. In sharing the address space bi-directionally, all the IP blocks of the NOC can access memory in the address space by memory-addressed messages, including loads and stores, directed through the IP block connected directly to the port 126.
- the port 126 includes the pins and other interconnections required to conduct signals between the NOC and the off-chip memory 112, as well as sufficient intelligence to convert message packets from the NOC packet format to the bus format required by the off- chip memory 112.
- one of the IP blocks is designated a host interface processor 128.
- a host interface processor 128 provides an interface between the NOC and a host computer 10 in which the NOC may be installed and also provides data processing services to the other IP blocks on the NOC, including, for example, receiving and dispatching among the IP blocks of the NOC data processing requests from the host computer.
- a NOC may, for example, implement a video graphics adapter 26 or a coprocessor 28 on a larger computer 10 as described above with reference to Figure 1.
- the host interface processor 128 is connected to the larger host computer through a data communications port 130.
- the port 130 includes the pins and other interconnections required to conduct signals between the NOC and the host computer, as well as sufficient intelligence to convert message packets from the NOC to the bus format required by the host computer 10.
- NOC coprocessor in the computer of Fig. 1 such a port would provide data communications format translation between the link structure of the NOC coprocessor 28 and the protocol required for the front side bus 36 between the NOC coprocessor 28 and the bus adapter 18.
- Fig. 3 next illustrates a functional block diagram illustrating in greater detail the components implemented within an IP block 104, memory communications controller 106, network interface controller 108 and router 110 in NOC 102, collectively illustrated at 132.
- IP block 104 includes a computer processor 134 and I/O functionality 136.
- computer memory is represented by a segment of random access memory ('RAM') 138 in IP block 104.
- the memory as described above with reference to Fig. 2, can occupy segments of a physical address space whose contents on each IP block are addressable and accessible from any IP block in the NOC.
- the processors 134, I/O capabilities 136, and memory 138 in each IP block effectively implement the IP blocks as generally programmable
- each memory communications controller 106 includes a plurality of memory communications execution engines 140.
- Each memory communications execution engine 140 is enabled to execute memory communications instructions from an IP block 104, including bidirectional memory communications instruction flow 141, 142, 144 between the network and the IP block 104.
- the memory communications instructions executed by the memory communications controller may originate, not only from the IP block adapted to a router through a particular memory communications controller, but also from any IP block 104 anywhere in NOC 102. That is, any IP block in the NOC can generate a memory communications instruction and transmit that memory communications instruction through the routers of the NOC to another memory communications controller associated with another IP block for execution of that memory communications instruction.
- Such memory communications instructions can include, for example, translation lookaside buffer control instructions, cache control instructions, barrier instructions, and memory load and store instructions.
- Each memory communications execution engine 140 is enabled to execute a complete memory communications instruction separately and in parallel with other memory communications execution engines.
- the memory communications execution engines implement a scalable memory transaction processor optimized for concurrent throughput of memory communications instructions.
- Memory communications controller 106 supports multiple memory communications execution engines 140 all of which run concurrently for simultaneous execution of multiple memory communications instructions.
- a new memory communications instruction is allocated by the memory communications controller 106 to a memory communications engine 140 and memory communications execution engines 140 can accept multiple response events simultaneously. In this example, all of the memory communications execution engines 140 are identical. Scaling the number of memory communications instructions that can be handled simultaneously by a memory
- communications controller 106 therefore, is implemented by scaling the number of memory communications execution engines 140.
- each network interface controller 108 is enabled to convert communications instructions from command format to network packet format for transmission among the IP blocks 104 through routers 110.
- the communications instructions may be formulated in command format by the IP block 104 or by memory communications controller 106 and provided to the network interface controller 108 in command format.
- the command format may be a native format that conforms to architectural register files of IP block 104 and memory communications controller 106.
- the network packet format is typically the format required for transmission through routers 110 of the network. Each such message is composed of one or more network packets. Examples of such communications instructions that are converted from command format to packet format in the network interface controller include memory load instructions and memory store instructions between IP blocks and memory.
- Such communications instructions may also include communications instructions that send messages among IP blocks carrying data and instructions for processing the data among IP blocks in parallel applications and in pipelined applications.
- each IP block is enabled to send memory- address-based communications to and from memory through the IP block's memory communications controller and then also through its network interface controller to the network.
- a memory- address-based communications is a memory access instruction, such as a load instruction or a store instruction, that is executed by a memory communication execution engine of a memory communications controller of an IP block.
- Such memory-address-based communications typically originate in an IP block, formulated in command format, and handed off to a memory communications controller for execution.
- NOC 102 all memory-address-based communications that are executed with message traffic are passed from the memory communications controller to an associated network interface controller for conversion from command format to packet format and transmission through the network in a message.
- the network interface controller In converting to packet format, the network interface controller also identifies a network address for the packet in dependence upon the memory address or addresses to be accessed by a memory-address-based communication.
- Memory address based messages are addressed with memory addresses.
- Each memory address is mapped by the network interface controllers to a network address, typically the network location of a memory communications controller responsible for some range of physical memory addresses.
- the network location of a memory communication controller 106 is naturally also the network location of that memory communication controller's associated router 110, network interface controller 108, and IP block 104.
- the instruction conversion logic 150 within each network interface controller is capable of converting memory addresses to network addresses for purposes of transmitting memory-address-based communications through routers of a NOC.
- each network interface controller 108 Upon receiving message traffic from routers 110 of the network, each network interface controller 108 inspects each packet for memory instructions. Each packet containing a memory instruction is handed to the memory communications controller 106 associated with the receiving network interface controller, which executes the memory instruction before sending the remaining payload of the packet to the IP block for further processing. In this way, memory contents are always prepared to support data processing by an IP block before the IP block begins execution of instructions from a message that depend upon particular memory content.
- each IP block 104 is enabled to bypass its memory
- communications controller 106 and send inter-IP block, network-addressed communications 146 directly to the network through the IP block's network interface controller 108.
- Network-addressed communications are messages directed by a network address to another IP block. Such messages transmit working data in pipelined applications, multiple data for single program processing among IP blocks in a SIMD application, and so on, as will occur to those of skill in the art. Such messages are distinct from memory- address-based communications in that they are network addressed from the start, by the originating IP block which knows the network address to which the message is to be directed through routers of the NOC. Such network-addressed communications are passed by the IP block through I/O functions 136 directly to the IP block's network interface controller in command format, then converted to packet format by the network interface controller and transmitted through routers of the NOC to another IP block.
- Such network-addressed communications 146 are bi-directional, potentially proceeding to and from each IP block of the NOC, depending on their use in any particular application.
- Each network interface controller is enabled to both send and receive such communications to and from an associated router, and each network interface controller is enabled to both send and receive such communications directly to and from an associated IP block, bypassing an associated memory communications controller 106.
- Each network interface controller 108 in the example of Fig. 3 is also enabled to implement virtual channels on the network, characterizing network packets by type.
- Each network interface controller 108 includes virtual channel implementation logic 148 that classifies each communication instruction by type and records the type of instruction in a field of the network packet format before handing off the instruction in packet form to a router 110 for transmission on the NOC.
- Examples of communication instruction types include inter-IP block network-address-based messages, request messages, responses to request messages, invalidate messages directed to caches; memory load and store messages; and responses to memory load messages, etc.
- Each router 110 in the example of Fig. 3 includes routing logic 152, virtual channel control logic 154, and virtual channel buffers 156.
- the routing logic typically is
- Routing logic 152 includes the
- Routing logic implemented as a network of synchronous and asynchronous logic can be configured to make routing decisions as fast as a single clock cycle.
- the routing logic in this example routes packets by selecting a port for forwarding each packet received in a router.
- Each packet contains a network address to which the packet is to be routed.
- the network location of a memory communication controller 106 is naturally also the network location of that memory communication controller's associated router 110, network interface controller 108, and IP block 104.
- inter-IP block, or network-address-based communications therefore, it is also typical for application-level data processing to view network addresses as the location of an IP block within the network formed by the routers, links, and bus wires of the NOC.
- Fig. 2 illustrates that one organization of such a network is a mesh of rows and columns in which each network address can be implemented, for example, as either a unique identifier for each set of associated router, IP block, memory communications controller, and network interface controller of the mesh or x, y coordinates of each such set in the mesh.
- each router 110 implements two or more virtual
- each router 110 in the example of Fig. 3 also includes virtual channel control logic 154 and virtual channel buffers 156.
- the virtual channel control logic 154 examines each received packet for its assigned communications type and places each packet in an outgoing virtual channel buffer for that communications type for transmission through a port to a neighboring router on the NOC.
- Each virtual channel buffer 156 has finite storage space. When many packets are received in a short period of time, a virtual channel buffer can fill up - so that no more packets can be put in the buffer. In other protocols, packets arriving on a virtual channel whose buffer is full would be dropped.
- Each virtual channel buffer 156 in this example is enabled with control signals of the bus wires to advise surrounding routers through the virtual channel control logic to suspend transmission in a virtual channel, that is, suspend transmission of packets of a particular communications type. When one virtual channel is so suspended, all other virtual channels are unaffected - and can continue to operate at full capacity.
- the control signals are wired all the way back through each router to each router's associated network interface controller 108. Each network interface controller is configured to, upon receipt of such a signal, refuse to accept, from its associated memory communications controller 106 or from its associated IP block 104,
- suspension of a virtual channel affects all the hardware that implements the virtual channel, all the way back up to the originating IP blocks.
- One effect of suspending packet transmissions in a virtual channel is that no packets are ever dropped.
- the routers in the example of Fig. 3 may suspend by their virtual channel buffers 156 and their virtual channel control logic 154 all transmissions of packets in a virtual channel until buffer space is again available, eliminating any need to drop packets.
- the NOC of Fig. 3 therefore, may implement highly reliable network communications protocols with an extremely thin layer of hardware.
- the example NOC of Fig. 3 may also be configured to maintain cache coherency between both on-chip and off-chip memory caches.
- Each NOC can support multiple caches each of which operates against the same underlying memory address space.
- caches may be controlled by IP blocks, by memory communications controllers, or by cache controllers external to the NOC.
- Either of the on-chip memories 114, 116 in the example of Fig. 2 may also be implemented as an on-chip cache, and, within the scope of the present invention, cache memory can be implemented off-chip also.
- Each router 110 illustrated in Fig. 3 includes five ports, four ports 158A-D connected through bus wires 118 to other routers and a fifth port 160 connecting each router to its associated IP block 104 through a network interface controller 108 and a memory
- the routers 110 and the links 118 of the NOC 102 form a mesh network with vertical and horizontal links connecting vertical and horizontal ports in each router.
- ports 158A, 158C and 160 are termed vertical ports
- ports 158B and 158D are termed horizontal ports.
- FIG. 4 next illustrates in another manner one exemplary implementation of an IP block 104 consistent with the invention, implemented as a processing element partitioned into an instruction unit (IU) 162, execution unit (XU) 164 and auxiliary execution unit (AXU) 166.
- IU 162 includes a plurality of instruction buffers 168 that receive instructions from an LI instruction cache (iCACHE) 170.
- Each instruction buffer 168 is dedicated to one of a plurality, e.g., four, symmetric multithreaded (SMT) hardware threads.
- SMT symmetric multithreaded
- An effective-to-real translation unit (iERAT) 172 is coupled to iCACHE 170, and is used to translate instruction fetch requests from a plurality of thread fetch sequencers 174 into real addresses for retrieval of instructions from lower order memory.
- Each thread fetch sequencer 174 is dedicated to a particular hardware thread, and is used to ensure that instructions to be executed by the associated thread is fetched into the iCACHE for dispatch to the appropriate execution unit.
- instructions fetched into instruction buffer 168 may also be monitored by branch prediction logic 176, which provides hints to each thread fetch sequencer 174 to minimize instruction cache misses resulting from branches in executing threads.
- IU 162 also includes a dependency/issue logic block 178 dedicated to each hardware thread, and configured to resolve dependencies and control the issue of instructions from instruction buffer 168 to XU 164.
- dependency/issue logic 180 is provided in AXU 166, thus enabling separate instructions to be concurrently issued by different threads to XU 164 and AXU 166.
- logic 180 may be disposed in IU 162, or may be omitted in its entirety, such that logic 178 issues instructions to AXU 166.
- XU 164 is implemented as a fixed point execution unit, including a set of general purpose registers (GPR's) 182 coupled to fixed point logic 184, branch logic 186 and load/store logic 188.
- Load/store logic 188 is coupled to an LI data cache (dCACHE) 190, with effective to real translation provided by dERAT logic 192.
- XU 164 may be configured to implement practically any instruction set, e.g., all or a portion of a 32b or 64b PowerPC instruction set.
- AXU 166 operates as an auxiliary execution unit including dedicated
- AXU 166 may include any number of execution blocks, and may implement practically any type of execution unit, e.g., a floating point unit, or one or more specialized execution units such as encryption/decryption units, coprocessors, vector processing units, graphics processing units, XML processing units, etc.
- AXU 166 includes a high speed auxiliary interface to XU 164, e.g., to support direct moves between AXU architected state and XU architected state.
- IP block 104 may be managed in the manner discussed above in connection with Fig. 2, via network interface controller 108 coupled to NOC 102.
- Address-based communication e.g., to access L2 cache memory
- each IP block 104 may include a dedicated in box and/or out box in order to handle inter-node communications between IP blocks.
- Embodiments of the present invention may be implemented within the hardware and software environment described above in connection with Figs. 1-4. However, it will be appreciated by one of ordinary skill in the art having the benefit of the instant disclosure that the invention may be implemented in a multitude of different environments, and that other modifications may be made to the aforementioned hardware and software embodiment without departing from the scope of the invention. As such, the invention is not limited to the particular hardware and software environment disclosed herein.
- branch prediction logic data such as branch history table data is capable of providing accurate branch prediction results
- embodiments consistent with the invention provide guest-mode and/or user-mode
- Many microprocessor micro-architectures include hardware branch prediction algorithms that are implemented fully or in part by one or more branch history tables.
- Embodiments consistent with the invention extend any mechanisms for hypervisor code to control branch prediction logic operation, e.g., hypervisor accessible control registers that, for example, globally enable and disable branch prediction logic such as branch history tables.
- hypervisor accessible control registers that, for example, globally enable and disable branch prediction logic such as branch history tables.
- guest-mode mechanisms for guest operating system hosted by a hypervisor, and optionally user-mode applications and processes, are allowed to control the branch prediction logic as it pertains to the guest operating system's and/or user's own code streams while still allowing a hypervisor to setup global branch prediction operation.
- user-mode and/or guest-mode instructions to enable/disable branch prediction logic updates, e.g., branch history table updates
- hypervisor-mode and/or guest- mode instructions to enable/disable branch prediction logic updates, e.g., branch history table updates, based on process identifier
- hypervisor enable/disable of the guest-mode and/or user-mode instructions to restrict guest operating system and/or user applications from controlling branch protection logic in circumstances under which such control should be deferred
- hypervisor-mode reset of user-mode controls among other features.
- branch prediction logic data such as branch prediction history table data is capable of providing accurate branch prediction results
- branch prediction logic data such as branch prediction history table data is capable of providing accurate branch prediction results
- branch prediction logic e.g., a branch history table
- branch prediction logic is a shared resource between all hardware threads and all software processes that execute on those hardware threads within a given processing core. This can lead to a problem where the branch history table state thrashes as software processes execute different sets of code.
- Conventional hardware implementations use hashing algorithms, various branch history table sizes, and other techniques to reduce the impacts of sharing between processes; however, many of these techniques undesirably increase the size and complexity of branch prediction logic
- embodiments consistent with the invention may provide for a fine grained control over saving and restoring the state of branch prediction logic, which can reduce the warm up time for the logic to collect historical information that improves branch prediction accuracy for the various types of software executing in the system.
- a context switch may enable software to execute with a "warmed up" branch history table that is specific to that process.
- by saving state data rather than allowing it to be cast out as state data is collected for multiple processes may enable the size and complexity of branch prediction logic to be reduced.
- embodiments consistent with the invention provide instructions that, for example, save and restore the branch history table state information, including hypervisor-mode instructions to save/restore branch prediction logic state to/from memory or other storage medium; guest-mode and/or user-mode instructions to save/restore branch prediction logic state to/from memory; hypervisor-mode enable/disable of guest-mode and/or user-mode save/restore instructions; and hypervisor- mode reset of branch prediction logic state.
- FIG. 5 this figure illustrates an exemplary hardware and software environment for a data processing system 200 within which may be implemented
- data processing system 200 includes a plurality of processors or processing units 204, each including one or more hardware threads 206 supported by branch prediction logic 208 and one or more special purpose registers (SPRs) 210, a memory 214 and an I/O layer 214 coupling the data processing system to various hardware resources, e.g., external networks, storage devices and networks, etc.
- processors or processing units 204 each including one or more hardware threads 206 supported by branch prediction logic 208 and one or more special purpose registers (SPRs) 210, a memory 214 and an I/O layer 214 coupling the data processing system to various hardware resources, e.g., external networks, storage devices and networks, etc.
- SPRs special purpose registers
- one or more control registers may be used to control both the enable state of branch prediction logic and save/restore operations associated with branch prediction logic state.
- saved state data 216 may be stored in memory 212 and retrieved in associated with restore operations. It will be appreciated, however, that some data processing systems consistent with the invention may only support selective enablement of branch prediction logic, while others may only support branch prediction logic state saves/restores, so the implementation disclosed herein is not the exclusive manner of implementing the invention.
- processors 204 may be implemented as processing cores in one or more multi-core processor chips, and each processor 204 may include any number of hardware threads.
- branch prediction logic may be shared by multiple threads or may be replicated for different threads.
- branch prediction logic may be associated with a specific execution unit in a processor or may be processor- wide.
- processors 204 may be implemented as IP blocks that are interconnected with one another in a NOC arrangement such as disclosed above in connection with Figs. 1-4. Therefore, it will be appreciated the invention may be utilized in practically any hardware environment where branch prediction logic is utilized in a processor or processing core, and the invention is therefore not limited to the particular hardware environment disclosed herein.
- Hypervisor 218, guest operating systems 220 and user applications 222 are respectively referred to as hypervisor-mode, guest-mode and user-mode instructions, and each processor 204 desirably supports these different instruction modes to selectively restrict the activities of each level of software and control their relative priorities.
- Hypervisor 218, in particular, is granted the highest priority mode, with decreasing priorities assigned to guest operating systems 220 and user applications 222.
- data processing system 200 supports both hypervisor-mode and guest-mode control over the branch prediction logic, such that the guest-mode controls may be used to override any hypervisor- mode controls.
- guest-mode controls may be used to override any hypervisor- mode controls.
- user-mode controls may be used to override any guest-mode and/or hypervisor-mode controls.
- such controls may be applied to all guest operating systems and/or user applications such that, whenever a processor or processing core is executing any guest-mode/user-mode instructions, the guest-mode/user-mode controls are used to control the branch prediction logic, but the hypervisor-mode controls are used for hypervisor-mode instructions.
- guest-mode and/or user-mode controls may be tied to specific guest operating systems and/or user applications, such that, for example, each guest operating system and/or user application is permitted to control the branch prediction logic separate from other guest operating systems and/or user applications.
- a hypervisor and/or guest operating system may be desirable to permit a hypervisor and/or guest operating system to effectively "lock" the controls of any higher level software so that the ability for a guest operating system or user application to control the branch prediction logic may be disabled, either system wide or limited to particular guest operating systems and/or user applications.
- control over the selective enablement of branch prediction logic is implemented through control over an enable state of the branch prediction logic.
- the enable state indicates that the branch prediction logic is enabled
- the branch prediction logic is active and operating in a normal manner
- the enable state indicates that the branch prediction logic is disabled
- the branch prediction logic is essentially "turned off ' so that the branch prediction logic does not attempt to predict the outcome of branch instructions, and typically, does not collect historical information based upon the monitored execution of one or more instruction streams being executed by a processor or processing core.
- branch prediction logic that includes a branch history table may be configured to discontinue caching new entries in the branch history table or updating existing entries in the table.
- the enable state of the branch prediction logic may be controlled, for example, using one or more hardware-based control registers that are accessed by the branch prediction logic to determine whether the branch prediction logic is currently active.
- lock fields 238 and 240 are used to disable the ability of a guest operating system (for field 238) or user application (for field 240) to write to the corresponding enable field 234, 236, and thus control the branch prediction logic.
- lock fields 238 and 240 are writeable by a hypervisor, and lock field 240 is writeable by a guest operating system, although both lock fields are readable by all levels so that, for example, a guest operating system or user application can check whether rights have been granted to control the branch prediction logic before an attempt is made to change the enable state of the logic.
- control register 230 It may be desirable in some applications to save and restore all or a portion of the state of control register 230 in connection with context switches, so that, for example, the enable states set by guest operating systems and/or user applications will be used only when instructions for those guest operating systems and/or user applications are being executed, thereby supporting the ability to have each guest operating system and/or user application.
- a data structure such as a process-specific enable mode table 250 that includes a plurality of entries 252 that tie a process identifier 254 to user enable and lock fields 256, 258 that enable process-specific customization of branch prediction logic.
- Table 250 may be managed by a hypervisor or guest operating system to configure what processes, and what applications in those processes, are able to control the branch prediction logic, and to permit or restrict those processes from selectively enabling and disabling the branch prediction logic while executing the respective processes.
- a similar data structure may also be used in some embodiments to provide guest-specific control over multiple guest operating systems.
- branch prediction logic may be shared by multiple hardware threads executing in a given processor core, and in the embodiments illustrated in Figs. 6-7, control over branch prediction logic will typically affect all hardware threads utilizing the branch prediction logic in a given processing core.
- a thread-specific enable mode data structure such as a table 260 may include separate entries 262 associated with different threads and including separate hypervisor, guest and user enable fields 264, 266, 268 and guest and user lock fields 270, 272 for each hardware thread such that different enable states may be set for different hardware threads.
- the branch prediction logic may then be configured to access table 260 to determine whether the logic should be active when executing instructions associated with a particular hardware thread that is currently mapped to a given virtual thread.
- the enable control data structures may be virtualized and associated with particular virtual threads such that, whenever a particular virtual thread is being executed by a given hardware thread, the enable controls associated with that virtual thread will be used for that virtual thread.
- a virtual thread-specific control register may be loaded into a hardware-based control register for a processing core that is assigned to execute such virtual thread during a context switch to that virtual thread so that the branch prediction logic in the processing core is configured to operate in a manner specified by the virtual thread.
- the branch prediction logic may be selectively enabled during operation of a data processing system in the general manner illustrated by sequence of operations 280 of Fig. 9, which illustrates the general execution of a single hardware thread in a data processing system. It will be appreciated that other hardware threads resident in a data processing system may be executed in a similar manner.
- block 282 enables or disables the branch prediction logic based upon the enable state for the guest operating system about to be executed by the thread. It will be appreciated that this enable state may be designated by the guest operating system, or may be designated by the hypervisor, either due to the guest operating system being locked from setting the enable state, or due to the guest operating system having not overridden a default state set by the hypervisor.
- the guest operating system is run or executed (block 284) for some period of time such that the branch prediction logic will be enabled or disabled based upon the enable state for the guest operating system currently being executed. Execution continues until either a preemptive interrupt, or as shown in block 286, until the guest operating system has completed its assigned time slice, whereby control passes to block 288 to enable or disable the branch prediction logic based upon the enable state for the hypervisor.
- the hypervisor is then run or executed for some period of time (block 290), and a determination is made in block 292 as to whether to return to executing the last guest operating system or to swap in another guest operating system.
- block 296 enables or disables the branch prediction logic based upon the enable state for the user application about to be executed by the thread. It will be appreciated that this enable state may be designated by the user application, or may be designated by the hypervisor or guest operating system, either due to the user application being locked from setting the enable state, or due to the user application having not overridden a default state set by the hypervisor or the guest operating system.
- the user application is run or executed (block 298) for some period of time such that the branch prediction logic will be enabled or disabled based upon the enable state for the user application currently being executed. Execution continues until either a preemptive interrupt, or as shown in block 300, until the user application has completed its assigned time slice, whereby control passes to block 302 to enable or disable the branch prediction logic based upon the enable state for the guest operating system.
- the guest operating system is then run or executed for some period of time (block 304), and a determination is made in block 306 as to whether to return to executing the last user application or to swap in another user application.
- the guest operating system and/or hypervisor may selectively disable branch prediction logic when executing those incompatible programs.
- control over saving and restoring the state of branch prediction logic is implemented through the use of hypervisor-mode as well as guest- mode and/or use-mode instructions, e.g., via move instructions between addressable registers in the branch prediction logic, or one or more ports provided by the branch prediction and a memory or other buffer capable of storing cached state information.
- software may provide a memory address in an SPR and then write a kick-off bit (e.g., one bit for save, one bit for restore) to inform a microcode unit or hardware assist sequencer to save/restore the data to/from the provided memory address.
- the same SPR's that hold the address and kick-off bits may be protected by the aforementioned hypervisor/guest/user mechanism for setting the enable state.
- software instructions may perform save and restore operations by looping between instructions that set a memory address, write a kick- off bit, and increment the address until all data has been transferred.
- a save mode control register 310 including lock fields 312, 314 for guest-mode and user-mode instructions, may be used to selectively enable guest operating systems and/or user applications or processes to save and/or restore branch prediction logic state data.
- enabling save/restore functionality may apply to all guest operating systems and/or user applications, or may be specific to particular guest operating systems, user applications and/or user processes in some embodiments consistent with the invention.
- FIG. 11 illustrates an exemplary branch history table 320 including a plurality of entries 322 and coupled to a branch history table load/store unit 324.
- Load/store unit 324 may be used, for example, to copy one or more entries 322 from branch history table 320 as state data 326 in a memory 328, as well as restore branch history table 320 by copying entries in state data 326 back into branch history table 320.
- Memory 328 may be part of the main memory architecture of a data processing system, or may be a dedicated buffer, e.g., a dedicated buffer in a processing core, in some implementations.
- Load/store unit 324 may be implemented, for example, as a sequencer or microcode unit that is responsive to input data provided by a thread to initiate a transfer of selected data between branch history table 320 memory 328.
- the entire branch history table, and optionally including other state data for branch prediction logic may be saved/restored as state data. In some embodiments, however, it may be desirable to only save/restore a subset of the data representing the state of the branch prediction logic, e.g., to skip entries 322 that are marked as invalid, or to save only the N most used or most recently used entries.
- compression/decompression engine 330 in load/store unit 324 it may be desirable in some embodiments to compress the state data in memory 328 to reduce the amount of storage required to maintain the state data, and then decompress the compressed data as it is being restored back into the branch prediction logic.
- Other hardware-based manners of accelerating or otherwise reducing the performance impact of saving and restoring the state data of the branch prediction logic may be used in the alternative.
- FIG. 12 illustrates a sequence of operations 340 suitable for the general execution of a single hardware thread in a data processing system in connection with saving and restoring branch prediction logic state data. It will be appreciated that other hardware threads resident in a data processing system may be executed in a similar manner.
- block 342 restores, e.g., in response to a guest-mode instruction in the guest operating system, stored branch prediction logic state data for the guest operating system. Once the branch prediction logic state has been restored, the guest operating system is run or executed (block 346) for some period of time such that the branch prediction logic will use the restored state while the guest operating system is being executed.
- Block 348 Execution continues until either a preemptive interrupt, or as shown in block 348, until the guest operating system has completed its assigned time slice, whereby control passes to block 350 to save the state of the branch prediction logic, e.g., in response to a guest-mode instruction in the guest operating system.
- block 352 restores, e.g., in response to a hypervisor-mode instruction in the hypervisor, stored branch prediction logic state for the hypervisor.
- the hypervisor is then run or executed for some period of time (block 354), and thereafter block 356 saves the state of the branch prediction logic, e.g., in response to a hypervisor-mode instruction in the hypervisor.
- block 358 a determination is made in block 358 as to whether to return to executing the last guest operating system or to swap in another guest operating system. If a decision is made to swap in another guest operating system, control passes to block 360 to perform the swap, and then back to block 342 to restore the branch prediction logic state for the guest operating system. Otherwise, block 358 returns control to block 342 to restore the branch prediction logic state for the guest operating system.
- block 362 restores, e.g., in response to a user-mode instruction in the user application, stored branch prediction logic state data for the user application.
- the branch prediction logic state Once the branch prediction logic state has been restored, the user application is run or executed (block 364) for some period of time such that the branch prediction logic will use the restored state while the user application is being executed. Execution continues until either a preemptive interrupt, or as shown in block 368, until the user application has completed its assigned time slice, whereby control passes to block 370 to save the state of the branch prediction logic, e.g., in response to a user-mode instruction in the user application.
- block 372 restores, e.g., in response to a guest-mode instruction in the guest operating system, stored branch prediction logic state for the guest operating system.
- the guest operating system is then run or executed for some period of time (block 374), and thereafter block 376 saves the state of the branch prediction logic, e.g., in response to a guest-mode instruction in the guest operating system.
- a determination is made in block 378 as to whether to return to executing the last user application or to swap in another user application. If a decision is made to swap in another user application, control passes to block 380 to perform the swap, and then back to block 362 to restore the branch prediction logic state for the user application. Otherwise, block 378 returns control to block 362 to restore the branch prediction logic state for the user application.
- the instructions to save and/or restore branch prediction logic state data may be implemented within context switch routines executed to save or restore other state data associated with a given context being executed by a hardware thread.
- the hypervisor, selected guest operating systems and/or selected user applications may have no need to save or restore branch prediction logic state data, so these selected entities may omit the execution of any instructions during context switches to either save or restore branch prediction logic data for such entities.
- Figs. 13-14 illustrate in greater detail the operations that occur in connection with saving and restoring branch prediction logic state table, e.g., branch history table entries.
- Fig. 13 illustrates a save branch history table routine 390 that is executed by a program, e.g., a hypervisor, a guest operating system and/or user application, to save branch prediction logic state data.
- Block 392 for example, first determines whether the program is allowed to save the branch prediction logic state, e.g., by checking an associated lock field for the program. In some instances, e.g., for a hypervisor, the program may always be entitled to save branch prediction logic state, so block 392 may be omitted. If not permitted by block 392, routine 390 is terminated.
- FIG. 14 illustrates a restore branch history table routine 400 that is executed by a program, e.g., a hypervisor, a guest operating system and/or user application, to restore branch prediction logic state data.
- Block 402 for example, first determines whether the program is allowed to restore the branch prediction logic state, e.g., by checking an associated lock field for the program. In some instances, e.g., for a hypervisor, the program may always be entitled to restore branch prediction logic state, so block 402 may be omitted. If not permitted by block 402, routine 390 is terminated. Otherwise, block 402 passes control to block 404 to reset the branch prediction logic state, e.g., by clearing out all old branch history table entries, and then to block 406 to restore the branch prediction logic state. Routine 400 is then complete.
- embodiments consistent with the invention allow for finer grained control of branch prediction logic, through selective enablement/disablement and/or selective saving and restoring of branch prediction logic state data. It is believed that in many embodiments, the provision of finer grained control enables branch prediction logic to be better optimized for different types of programs and workloads, and in some instances, may allow smaller and/or less complex branch prediction logic to be used, thereby saving cost and reducing the amount of space consumed by the branch prediction logic on a processor chip.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Logic Circuits (AREA)
- Advance Control (AREA)
- Multi Processors (AREA)
- Measuring Volume Flow (AREA)
- Stored Programmes (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
Claims
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201380006419.1A CN104067227B (en) | 2012-01-23 | 2013-01-02 | Branch prediction logic |
DE201311000654 DE112013000654T5 (en) | 2012-01-23 | 2013-01-02 | Branch prediction logic |
GB1412914.2A GB2512011B (en) | 2012-01-23 | 2013-01-02 | Branch prediction logic |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US13/355,863 | 2012-01-23 | ||
US13/355,863 US9032191B2 (en) | 2012-01-23 | 2012-01-23 | Virtualization support for branch prediction logic enable / disable at hypervisor and guest operating system levels |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013111022A1 true WO2013111022A1 (en) | 2013-08-01 |
Family
ID=48798320
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/IB2013/050029 WO2013111022A1 (en) | 2012-01-23 | 2013-01-02 | Branch prediction logic |
Country Status (5)
Country | Link |
---|---|
US (1) | US9032191B2 (en) |
CN (1) | CN104067227B (en) |
DE (1) | DE112013000654T5 (en) |
GB (1) | GB2512011B (en) |
WO (1) | WO2013111022A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IT201900000412A1 (en) | 2019-01-10 | 2020-07-10 | Cifa Spa | AUTOBETONIERA |
Families Citing this family (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9520180B1 (en) | 2014-03-11 | 2016-12-13 | Hypres, Inc. | System and method for cryogenic hybrid technology computing and memory |
US9213569B2 (en) | 2014-03-27 | 2015-12-15 | International Business Machines Corporation | Exiting multiple threads in a computer |
US9772867B2 (en) | 2014-03-27 | 2017-09-26 | International Business Machines Corporation | Control area for managing multiple threads in a computer |
US9195493B2 (en) | 2014-03-27 | 2015-11-24 | International Business Machines Corporation | Dispatching multiple threads in a computer |
US9223574B2 (en) | 2014-03-27 | 2015-12-29 | International Business Machines Corporation | Start virtual execution instruction for dispatching multiple threads in a computer |
US9742630B2 (en) * | 2014-09-22 | 2017-08-22 | Netspeed Systems | Configurable router for a network on chip (NoC) |
US10348563B2 (en) | 2015-02-18 | 2019-07-09 | Netspeed Systems, Inc. | System-on-chip (SoC) optimization through transformation and generation of a network-on-chip (NoC) topology |
US10218580B2 (en) | 2015-06-18 | 2019-02-26 | Netspeed Systems | Generating physically aware network-on-chip design from a physical system-on-chip specification |
US10447728B1 (en) * | 2015-12-10 | 2019-10-15 | Fireeye, Inc. | Technique for protecting guest processes using a layered virtualization architecture |
US10846117B1 (en) | 2015-12-10 | 2020-11-24 | Fireeye, Inc. | Technique for establishing secure communication between host and guest processes of a virtualization architecture |
US10108446B1 (en) | 2015-12-11 | 2018-10-23 | Fireeye, Inc. | Late load technique for deploying a virtualization layer underneath a running operating system |
US9996351B2 (en) | 2016-05-26 | 2018-06-12 | International Business Machines Corporation | Power management of branch predictors in a computer processor |
US10452124B2 (en) | 2016-09-12 | 2019-10-22 | Netspeed Systems, Inc. | Systems and methods for facilitating low power on a network-on-chip |
US20180159786A1 (en) | 2016-12-02 | 2018-06-07 | Netspeed Systems, Inc. | Interface virtualization and fast path for network on chip |
CN108228239B (en) * | 2016-12-13 | 2021-04-20 | 龙芯中科技术股份有限公司 | Branch instruction grabbing method and device based on quick simulator QEMU |
US10063496B2 (en) | 2017-01-10 | 2018-08-28 | Netspeed Systems Inc. | Buffer sizing of a NoC through machine learning |
US10469337B2 (en) | 2017-02-01 | 2019-11-05 | Netspeed Systems, Inc. | Cost management against requirements for the generation of a NoC |
US10671417B2 (en) * | 2017-04-26 | 2020-06-02 | International Business Machines Corporation | Server optimization control |
US10983910B2 (en) | 2018-02-22 | 2021-04-20 | Netspeed Systems, Inc. | Bandwidth weighting mechanism based network-on-chip (NoC) configuration |
US11144457B2 (en) | 2018-02-22 | 2021-10-12 | Netspeed Systems, Inc. | Enhanced page locality in network-on-chip (NoC) architectures |
US10547514B2 (en) | 2018-02-22 | 2020-01-28 | Netspeed Systems, Inc. | Automatic crossbar generation and router connections for network-on-chip (NOC) topology generation |
US11023377B2 (en) | 2018-02-23 | 2021-06-01 | Netspeed Systems, Inc. | Application mapping on hardened network-on-chip (NoC) of field-programmable gate array (FPGA) |
US11176302B2 (en) | 2018-02-23 | 2021-11-16 | Netspeed Systems, Inc. | System on chip (SoC) builder |
US11797665B1 (en) * | 2018-06-28 | 2023-10-24 | Advanced Micro Devices, Inc. | Protection against branch target buffer poisoning by a management layer |
US11783050B2 (en) * | 2020-11-13 | 2023-10-10 | Centaur Technology, Inc. | Spectre fixes with predictor mode tag |
US11861368B2 (en) * | 2022-05-24 | 2024-01-02 | Arm Limited | Re-enabling use of prediction table after execution state switch |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006041758A1 (en) * | 2004-10-06 | 2006-04-20 | Intel Corporation | Overriding processor configuration settings |
Family Cites Families (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4530052A (en) * | 1982-10-14 | 1985-07-16 | Honeywell Information Systems Inc. | Apparatus and method for a data processing unit sharing a plurality of operating systems |
US4679141A (en) | 1985-04-29 | 1987-07-07 | International Business Machines Corporation | Pageable branch history table |
EP0218335A3 (en) | 1985-08-30 | 1989-03-08 | Advanced Micro Devices, Inc. | Control store for electronic processor |
US5228131A (en) | 1988-02-24 | 1993-07-13 | Mitsubishi Denki Kabushiki Kaisha | Data processor with selectively enabled and disabled branch prediction operation |
US5606715A (en) | 1995-06-26 | 1997-02-25 | Motorola Inc. | Flexible reset configuration of a data processing system and method therefor |
US5752014A (en) * | 1996-04-29 | 1998-05-12 | International Business Machines Corporation | Automatic selection of branch prediction methodology for subsequent branch instruction based on outcome of previous branch prediction |
US5949995A (en) | 1996-08-02 | 1999-09-07 | Freeman; Jackie Andrew | Programmable branch prediction system and method for inserting prediction operation which is independent of execution of program code |
DE69727773T2 (en) | 1996-12-10 | 2004-12-30 | Texas Instruments Inc., Dallas | Improved branch prediction in a pipeline microprocessor |
US6108775A (en) | 1996-12-30 | 2000-08-22 | Texas Instruments Incorporated | Dynamically loadable pattern history tables in a multi-task microprocessor |
US6108776A (en) | 1998-04-30 | 2000-08-22 | International Business Machines Corporation | Globally or selectively disabling branch history table operations during sensitive portion of millicode routine in millimode supporting computer |
US6223280B1 (en) | 1998-07-16 | 2001-04-24 | Advanced Micro Devices, Inc. | Method and circuit for preloading prediction circuits in microprocessors |
US6574712B1 (en) | 1999-11-08 | 2003-06-03 | International Business Machines Corporation | Software prefetch system and method for predetermining amount of streamed data |
US6877089B2 (en) | 2000-12-27 | 2005-04-05 | International Business Machines Corporation | Branch prediction apparatus and process for restoring replaced branch history for use in future branch predictions for an executing program |
US6938151B2 (en) * | 2002-06-04 | 2005-08-30 | International Business Machines Corporation | Hybrid branch prediction using a global selection counter and a prediction method comparison table |
US7493478B2 (en) | 2002-12-05 | 2009-02-17 | International Business Machines Corporation | Enhanced processor virtualization mechanism via saving and restoring soft processor/system states |
WO2004068337A1 (en) | 2003-01-30 | 2004-08-12 | Fujitsu Limited | Information processor |
US7370183B2 (en) * | 2003-04-11 | 2008-05-06 | Board Of Regents, The University Of Texas System | Branch predictor comprising a split branch history shift register |
US7523298B2 (en) * | 2006-05-04 | 2009-04-21 | International Business Machines Corporation | Polymorphic branch predictor and method with selectable mode of prediction |
US7707394B2 (en) * | 2006-05-30 | 2010-04-27 | Arm Limited | Reducing the size of a data stream produced during instruction tracing |
US20080114971A1 (en) | 2006-11-14 | 2008-05-15 | Fontenot Nathan D | Branch history table for debug |
US7783869B2 (en) * | 2006-12-19 | 2010-08-24 | Arm Limited | Accessing branch predictions ahead of instruction fetching |
US8171328B2 (en) | 2008-12-31 | 2012-05-01 | Intel Corporation | State history storage for synchronizing redundant processors |
US8745362B2 (en) * | 2010-06-25 | 2014-06-03 | International Business Machines Corporation | Operating system aware branch predictor using a dynamically reconfigurable branch history table |
-
2012
- 2012-01-23 US US13/355,863 patent/US9032191B2/en active Active
-
2013
- 2013-01-02 CN CN201380006419.1A patent/CN104067227B/en active Active
- 2013-01-02 GB GB1412914.2A patent/GB2512011B/en active Active
- 2013-01-02 DE DE201311000654 patent/DE112013000654T5/en active Pending
- 2013-01-02 WO PCT/IB2013/050029 patent/WO2013111022A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006041758A1 (en) * | 2004-10-06 | 2006-04-20 | Intel Corporation | Overriding processor configuration settings |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IT201900000412A1 (en) | 2019-01-10 | 2020-07-10 | Cifa Spa | AUTOBETONIERA |
EP3680080A1 (en) | 2019-01-10 | 2020-07-15 | CIFA SpA | Cement truck |
Also Published As
Publication number | Publication date |
---|---|
GB2512011B (en) | 2015-06-03 |
US20130191824A1 (en) | 2013-07-25 |
CN104067227B (en) | 2017-05-10 |
US9032191B2 (en) | 2015-05-12 |
CN104067227A (en) | 2014-09-24 |
GB2512011A (en) | 2014-09-17 |
DE112013000654T5 (en) | 2014-11-13 |
GB201412914D0 (en) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8935694B2 (en) | System and method for selectively saving and restoring state of branch prediction logic through separate hypervisor-mode and guest-mode and/or user-mode instructions | |
US9032191B2 (en) | Virtualization support for branch prediction logic enable / disable at hypervisor and guest operating system levels | |
US10831504B2 (en) | Processor with hybrid pipeline capable of operating in out-of-order and in-order modes | |
US10042417B2 (en) | Branch prediction with power usage prediction and control | |
US7873816B2 (en) | Pre-loading context states by inactive hardware thread in advance of context switch | |
US9501279B2 (en) | Local instruction loop buffer utilizing execution unit register file | |
US9274591B2 (en) | General purpose processing unit with low power digital signal processing (DSP) mode | |
US10521234B2 (en) | Concurrent multiple instruction issued of non-pipelined instructions using non-pipelined operation resources in another processing core | |
US9122465B2 (en) | Programmable microcode unit for mapping plural instances of an instruction in plural concurrently executed instruction streams to plural microcode sequences in plural memory partitions | |
US9239791B2 (en) | Cache swizzle with inline transposition | |
US8140830B2 (en) | Structural power reduction in multithreaded processor | |
US7890699B2 (en) | Processing unit incorporating L1 cache bypass | |
US8892851B2 (en) | Changing opcode of subsequent instruction when same destination address is not used as source address by intervening instructions | |
US20140164732A1 (en) | Translation management instructions for updating address translation data structures in remote processing nodes | |
US20140230077A1 (en) | Instruction set architecture with secure clear instructions for protecting processing unit architected state information | |
US20150032988A1 (en) | Regular expression memory region with integrated regular expression engine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13740957 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 1412914 Country of ref document: GB Kind code of ref document: A Free format text: PCT FILING DATE = 20130102 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 1412914.2 Country of ref document: GB |
|
WWE | Wipo information: entry into national phase |
Ref document number: 1120130006545 Country of ref document: DE Ref document number: 112013000654 Country of ref document: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 13740957 Country of ref document: EP Kind code of ref document: A1 |