Device and method for memory write-back

By introducing range-based memory write-back instructions, the performance and energy consumption issues of cache refresh and write-back in DMA operations are solved, efficient host-device communication and data synchronization are achieved, and the overall performance and user experience of the computer system are improved. .

CN108694057BActive Publication Date: 2024-09-10INTEL CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN201810168804.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-03-31
Filing Date
2018-02-28
Publication Date
2024-09-10
Estimated Expiration
2038-02-28

AI Technical Summary

Technical Problem

In the existing technology, in the DMA operation between the host and the device, there is significant overhead in cache refresh and write-back operations, resulting in reduced performance and increased energy consumption. In addition, existing instructions require a large number of host processing cycles and kernel code switching, affecting overall performance. and user experience.

Method used

Introducing range-based memory writeback instructions (ARFLUSH and ARWB) to flush or write back cache lines in system memory through one or several instructions, avoiding context switches, improving processor performance and reducing power consumption.

Benefits of technology

It realizes cache consistency management between the host and the device, reduces the consumption of host processing cycles, improves overall performance and user experience, and reduces energy consumption, especially in large data block operations, which significantly improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN108694057B_ABST
    Figure CN108694057B_ABST
Patent Text Reader

Abstract

The present application discloses efficient range-based memory write-back for improving host-to-device communication for optimal power and performance. Methods and apparatus for efficient range-based memory write-back are described herein. One embodiment of the apparatus includes: a system memory; a plurality of hardware processor cores, each of which includes a first cache; a decoder circuit for decoding an instruction having a field for a first memory address and a range indicator; and an execution circuit for executing the decoded instruction. The first memory address and the range indicator together define a continuous region in the system memory that includes one or more cache lines. Executing the decoded instruction invalidates any instance of the one or more cache lines in the first cache. In addition, any dirty invalid instances of the one or more cache lines are stored in the system memory.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art Technical Field

[0001] The present invention generally relates to the field of computer processors. More specifically, the present invention relates to a method and apparatus for range-based memory writeback.

[0002] Description of related technologies

[0003] An instruction set or instruction set architecture (ISA) is a portion of a computer architecture related to programming, including native data types, instructions, register architecture, addressing modes, memory architecture, interrupt and exception handling, and external input and output (I / O). It should be noted that the term "instruction" in this article generally refers to macroinstructions, i.e., instructions provided to a processor for execution, which are completely different from microinstructions or microoperations that are the result of a processor decoder decoding a macroinstruction. Microinstructions or microoperations can be configured to instruct an execution unit on a processor to perform operations to implement logic associated with a macroinstruction.

[0004] ISA is different from microarchitecture, which is a set of processor design technologies used to implement an instruction set. Processors with different microarchitectures can share a common instruction set. For example, Pentium 4 processor, Core TM Processors, and processors from Advanced Micro Devices, Inc. of Sunnyvale, California, implement almost the same version of the x86 instruction set (some extensions have been added in newer versions), but have different internal designs. For example, the same register architecture of the ISA can be implemented in different ways in different microarchitectures using known techniques, including dedicated physical registers, one or more dynamically allocated physical registers using a register renaming mechanism (e.g., using a register alias table (RAT), a reorder buffer (ROB), and a retirement register file). Unless otherwise specified, the phrases register architecture, register file, and register are used herein to refer to registers visible to the software / programmer and the manner in which instructions specify registers. When a distinction is needed, the adjectives "logical", "architectural", or "software visible" will be used to indicate registers / heaps in the register architecture, while different adjectives will be used for specified registers (e.g., physical registers, reorder buffers, retirement registers, register pools) in a given microarchitecture.

[0005] An instruction set includes one or more instruction formats. A given instruction format defines various fields (number of bits, position of bits) to specify (among other things) the operation to be performed and the (multiple) operands on which the operation is to be performed. Some instruction formats are further decomposed by defining instruction templates (or sub-formats). For example, an instruction template for a given instruction format may be defined as having different subsets of the fields of the instruction format (the fields included are usually in the same order, but at least some have different bit positions because fewer fields are included) and / or defined as having a given field with different interpretations. A given instruction is expressed using a given instruction format (and if defined, a given one of the instruction templates for the instruction format) and specifies the operation and operands. An instruction stream is a specific sequence of instructions, wherein each instruction in the sequence is an occurrence of an instruction using an instruction format (and if defined, a given one of the instruction templates for the instruction format). BRIEF DESCRIPTION OF THE DRAWINGS

[0006] The foregoing aspects and many of the attendant advantages of the present invention will be more readily appreciated as the same will be better understood by reference to the following detailed description when taken in conjunction with the accompanying drawings in which like reference numerals refer to like parts throughout the several views unless otherwise specified:

[0007] Figure 1A-1B Demonstrates potential coherency issues between host and device when using DMA mechanisms;

[0008] Figure 2 is a flow chart illustrating the use of a shared buffer with a synchronization mechanism between a host and a device;

[0009] Figure 3 An exemplary platform on which embodiments of the present invention may be implemented is presented;

[0010] Figure 4A shows a contiguous region in system memory defined by a memory address and a range operand when both the memory address and the range operand are memory addresses according to an embodiment;

[0011] Figure 4B shows a contiguous region in system memory defined by a memory address and a range operand when the range is an integer value according to an embodiment;

[0012] Figure 5 An exemplary large data array test (LDAT) engine that can be used to implement device debugging and testing of embodiments of the present invention is presented;

[0013] Figure 6 is a flow chart illustrating operations and logic for executing range-based memory writeback instructions according to an embodiment;

[0014] Figure 7 is a flow chart illustrating operations and logic for refreshing a cache line according to an embodiment;

[0015] Fig. 8A is a block diagram illustrating both an exemplary in-order pipeline and an exemplary register renaming out-of-order issue / execution pipeline according to an embodiment of the present invention;

[0016] Figure 8B is a block diagram illustrating both an exemplary embodiment of an in-order architecture core and an exemplary register renaming out-of-order issue / execution architecture core to be included in a processor in accordance with an embodiment of the present invention;

[0017] Fig. 9 is a block diagram of a single-core processor and a multi-core processor with integrated memory controller and graphics according to an embodiment of the present invention;

[0018] Fig.10 A block diagram of a system according to an embodiment of the present invention is shown;

[0019] Fig.11 A block diagram of a second system according to an embodiment of the present invention is shown;

[0020] Fig.12 A block diagram of a third system according to an embodiment of the present invention is shown;

[0021] Fig.13 A block diagram of a system on chip (SoC) according to an embodiment of the present invention is shown; and

[0022] Fig.14 A block diagram is shown comparing the use of a software instruction converter for converting binary instructions in a source instruction set to binary instructions in a target instruction set in accordance with an embodiment of the present invention. DETAILED DESCRIPTION

[0023] Embodiments of methods and apparatus for efficient range-based memory writeback are described herein. In the following description, many specific details are set forth to provide a thorough understanding of embodiments of the present invention. However, those skilled in the relevant art will appreciate that the present invention may be practiced without one or more of these specific details, or may be practiced using other methods, components, materials, etc. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of the present invention.

[0024] References throughout this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, throughout this specification, the appearances of the phrases "in one embodiment" or "in an embodiment" are not necessarily all referring to the same embodiment. Furthermore, in one or more embodiments, particular features, structures, or characteristics may be combined in any suitable manner. For clarity, individual components in the drawings herein may be referred to by their labels rather than by specific reference numbers.

[0025] Many uses of modern computers require host-to-device communication via direct memory access (DMA), which is a mechanism that allows peripheral components in a computer system to transfer their I / O data directly to and from system memory without involving the system processor. For example, a network interface card (NIC) and a graphics processing unit (GPU) can retrieve data packets and blocks directly from host memory in order to perform their corresponding functions, thereby bypassing the system processor and accelerating memory operations. As a result, the DMA mechanism can greatly increase the throughput to and from the device. However, if the DMA controller that controls the DMA process does not participate in the cache coherence of the host processor (which is often the case), the operating system (OS) and / or software running on the OS will need to ensure that the cache lines currently stored in the processor cache are flushed (i.e., stored) into the system memory before the outgoing DMA transfer begins (i.e., read from the system memory). Similarly, the cache lines in the processor cache need to be invalidated before the memory range affected by the incoming DMA transfer is accessed (i.e., written to the system memory). In addition, the OS or software must also ensure that the affected memory range is not accessed by any running thread in order to prevent memory coherence violations.

[0026] Figure 1A-1B Demonstrates a potential coherency problem between the host and the device when using the DMA mechanism. The device initiates an asynchronous DMA read or write operation to access data directly to or from the system memory without going through the host cache. However, for a DMA write operation, data transferred to the system memory by the DMA operation may be overwritten with outdated data cached by the host in the host cache unless the host cache has been flushed just before the DMA write. For example, in Figure 1A1 , a device (i.e., a graphics processing unit (GPU)) 108 directly accesses data in a system memory 102 through a DMA controller 110 without going through a host (i.e., a central processing unit (CPU)) 104. For simplicity, the host, the device, the DMA controller, and the system memory are shown as being interconnected by a bus 112. During a DMA write 114, the device 108 writes data to a cache line 120a in the system memory 102 through the DMA controller 110. After the DMA write 114, the host 104 writes cache line 120b to the system memory 102 through an eviction or write-back operation, thereby overwriting cache line 120a. This creates a consistency problem because cache line 120b may not be the latest copy of cache line 120 and the data in cache line 120a is lost.

[0027] Similarly, unless the host cache has been flushed to system memory just before a DMA read operation, the data in the host cache may be more up to date than the copy in system memory. Figure 1B , host cache 106 of host 104 contains a modified copy of cache line 120c that has been stored in system memory. If the device initiates a DMA read of the cache line in system memory, the device will receive modified cache line 120a instead of modified version 120c.

[0028] To facilitate communication between the host and the device, a shared buffer with a synchronization mechanism is often used. Using this handshake feature, the host predefines shared data buffers and tags. After the host has prepared the data to be dispatched to the device, the host flushes its cache into the system memory and issues a "ready" tag to indicate that the data is ready for the device to access. The device that polls for the "ready" tag will access the data when it notices that the tag has been issued. Then, after the device has finished processing the data, the device will issue a "device ready" tag to indicate to the host that it can proceed to the next round of data. Figure 2 As shown in , after the host main thread has prepared the data, the host main thread notifies the device that the input data is ready (i.e., 202). This can be done by setting a ready flag by the host main thread. The device receives the notification by polling the ready flag. After the device accesses the data, it notifies the host read thread that the output data is ready for the host to access (i.e., 204). After the host read thread accesses the output data, the host read thread can then notify the host main thread that the shared buffer is ready to be used again (i.e., 206).

[0029] To compute a workload that is divided between a host (e.g., a central processing unit (CPU)) and a device (e.g., a graphics processing unit (GPU)), the workload is typically divided into multiple stages, where some stages are performed by the host and some stages are performed by the device. When transitioning between host and device processing stages, an explicit cache flush is required. However, cache flushes require a large number of host processing cycles, thus reducing performance and consuming energy. The cost is proportional to the size of the cache framework.

[0030] Existing solutions (such as cache line refresh (e.g., CLFLUSH), cache line writeback (e.g., CLWB), and writeback invalidation (e.g., WBINV) instructions) have their shortcomings and are not sufficient to address the overhead costs associated with refreshing the cache. For cache line refresh and cache line writeback instructions, writing data back to the system memory requires one instruction per cache line. For a data block of ~3MB, this may take up 1ms of processor time and require tens of thousands of instructions. This causes significant overhead, especially in the case of large data blocks. Regarding the writeback invalidation instruction that invalidates the entire cache and writes any dirty cache lines back to the system memory, it requires switching to kernel code because such instructions are often implemented as privileged instructions. The kernel uses space switching itself and is associated with significant overhead, which can destroy any time and / or resources saved by not using a single cache line instruction (e.g., CLFLUSH and CLWB). In addition, using the writeback invalidation instruction, the entire processor cache is invalidated. This means that useful code and data that is currently or will soon be used by the processor will also be invalid and need to be brought back to the cache. This in turn degrades performance. To address the shortcomings associated with existing solutions, a new set of range-based memory write-back instructions are described herein. The new set of instructions allows the processor to issue only one instruction (or a few instructions, depending on the number of memory regions) to refresh the shared system memory without performing any context switches. Using the new approach, a large number of host processing cycles can be saved and redirected to other tasks, thereby improving overall performance and user experience. Not to mention reduced power consumption and improved energy efficiency, which is important in modern computing, especially when it comes to mobile devices.

[0031] Figure 3 An exemplary processor 355 is shown that can implement embodiments of the present invention. The processor 355 includes a set of general purpose registers (GPR) 305, a set of vector registers 306, and a set of mask registers 307. For simplicity, Figure 3 Details of a single processor core ("core 0") are shown in FIG. However, it will be understood that Figure 3Each core shown in can have the same logical set as core 0. For example, each core can include a dedicated level 1 (L1) cache 312 and a level 2 (L2) cache 311 for caching instructions and data according to a specified cache management policy. The L1 cache 312 includes a separate instruction cache 320 (IL1) for storing instructions and a separate data cache 321 (DL1) for storing data. Instructions and data stored in various processor caches are managed at the granularity of cache lines, which can be a fixed size (e.g., 64, 128, 512 bytes in length). Each core of this exemplary embodiment has: an instruction fetch unit 310 for fetching instructions from main memory 300 and / or a shared level 3 (L3) cache 316; a decode unit 330 for decoding instructions (e.g., decoding program instructions into micro-operations or "uops"). An execution unit 340 for executing the instructions; and a write-back unit 350 for retiring the instructions and writing back the results.

[0032] The instruction fetch unit 310 includes various well-known components, including: a next instruction pointer 303 for storing the address of the next instruction to be fetched from the memory 300 (or one of the caches); an instruction translation lookaside buffer (ITLB) 304 for storing recently used virtual to physical instruction address mappings to increase address translation speed; a branch prediction unit 302 for speculatively predicting instruction branch addresses; and a branch target buffer (BTB) 301 for storing branch addresses and target addresses. Once fetched, the instruction is streamed to the remaining stages of the instruction pipeline including the decode unit 330, the execution unit 340, and the write-back unit 350. The structure and function of each of these units are well understood by those of ordinary skill in the art and will not be described in detail herein to avoid obscuring relevant aspects of different embodiments of the present invention.

[0033] In one embodiment, the decoding unit 330 includes a range-based instruction decoder 331 for decoding the range-based memory write-back instructions described herein (e.g., in one embodiment, decoding into a sequence of micro-operations), and the execution unit 340 includes a range-based instruction execution unit 341 for executing the decoded range-based memory write-back instructions.

[0034] For range-based flushing of processor caches, the ARFLUSH instruction is described below. According to an embodiment, the ARFLUSH instruction adopts the following format:

[0035] ARFLUSH{S}mem_addr,range

[0036] Wherein, the mem_addr operand is a memory address, the range operand is a range indicator, and S is an optional opcode. The mem_addr operand and the range operand together define a continuous area in the system memory. For example, in one embodiment, the mem_addr operand is a first memory address for indicating the starting point of the continuous area in the system memory, and the range operand is a second memory address for indicating the ending point of the continuous area. According to an embodiment, the memory address is a linear memory address of a location in a specified system memory. In other embodiments, the memory address can be an effective memory address, a virtual memory address, or a physical memory address (including a client physical memory address). Figure 4A A contiguous region defined by a memory address and a range operand in a system memory when both the memory address and the range operand are memory addresses according to an embodiment is shown. The ARFLUSH instruction invalidates all cache lines in a processor cache containing a memory address included in the contiguous region. The processor cache referred to herein may be IL1, DL1, L2, or a combination thereof. In some embodiments, the invalidation is broadcast throughout the cache coherency domain and may include caches on other cores. In one embodiment, any invalid cache lines that are dirty (e.g., modified) in the processor cache are written back to the system memory. In one embodiment, this is accomplished via a write-back operation or an eviction mechanism.

[0037] In another embodiment, the range operand is not a memory address but an integer value (i.e., "r") indicating the number of cache lines to be invalidated. According to an embodiment, a contiguous region in system memory begins at the memory address indicated by the mem_addr operand and is continuous with a plurality (i.e., "r") of cache lines indicated by the range operand. In other words, the memory addresses of the "r" cache lines included in the contiguous region are all equal to or incrementally greater than (or less than, depending on the implementation) the mem_addr operand. Alternatively, instead of cache lines, the range operand may indicate the number of bytes to be included in the contiguous region. The contiguous region begins at the memory address indicated by the mem_addr operand and is continuous with the number of bytes indicated by the range operand.

[0038] Figure 4BA contiguous region in system memory defined by a memory address and a range operand when the range is an integer value is shown in accordance with an embodiment. In one embodiment, ARFLUSH invalidates all cache lines in the processor cache containing a memory address that is equal to or incrementally greater than the mem_addr operand for the number of cache lines as indicated by the integer value in the range operand.

[0039] According to an embodiment, the optional opcode {S} indicates a shared cache. In one embodiment, the ARFLUSHS instruction behaves exactly like the ARFLUSH instruction, but flushes cache lines in a contiguous region out to a shared cache instead of always flushing to system memory. According to an embodiment, a shared cache is a cache shared by two or more processor cores in a host processor.

[0040] According to an embodiment, the ARFLUSH instruction is sorted by a fence operation (e.g., MFENCE, SFENCE, lock-prefixed instruction or architectural serialization instruction). In another embodiment, the ARFLUSH instruction can be a subset of those instructions (e.g., only the instruction is serialized). In another embodiment, the ARFLUSH instruction can be naturally sorted more strongly (e.g., as part of the TSO consistency model). The operating system and / or the software running on the operating system can use these sorting instructions to ensure the desired ordering of instructions. In one embodiment, the ARFLUSH instruction can be used at all privilege levels and is subject to all permission checks and the faults associated with byte loads.

[0041] For range-based writeback of cache lines in a processor cache, the ARWB instruction is described below. According to an embodiment, the ARWB instruction adopts the following format:

[0042] ARWB{S}mem_addr,range

[0043] Wherein, the mem_addr operand is a memory address, the range operand is a range indicator, and S is an optional opcode. Similar to the above-mentioned ARFLUSH instruction, the mem_addr operand and the range operand together define a continuous area in the system memory. For example, in one embodiment, the mem_addr operand is a memory address indicating the starting point of the continuous area in the system memory, and the range operand is another memory address indicating the end point of the continuous area. According to an embodiment, the memory address is a linear memory address that specifies a location in the system memory. In other embodiments, the memory address may be an effective memory address, a virtual memory address, or a physical memory address (including a customer physical memory address). According to an embodiment, the ARWB instruction writes back all dirty (i.e., modified) cache lines with memory addresses falling within the continuous area defined by the mem_addr and range operands from the processor cache to the system memory. The processor cache mentioned here may be IL1, DL1, L2, or a combination thereof. In some embodiments, the writeback is broadcast throughout the cache coherence domain and may include (multiple) caches on (multiple) other cores. For cache lines in the contiguous region that are not dirty (ie, not modified), they may remain in the cache hierarchy.

[0044] The ARWB instruction presents a performance improvement over instructions that invalidate both dirty and clean cache lines. By not invalidating unmodified cache lines, the ARWB instruction reduces cache misses in subsequent cache accesses. In one embodiment, the hardware can choose to keep unmodified cache lines in any level of the cache hierarchy or just invalidate them.

[0045] In another embodiment, the range operand is not a memory address but an integer value (i.e., "r") indicating the number of cache lines to be invalidated. According to an embodiment, a contiguous region in system memory begins at the memory address indicated by the mem_addr operand and is continuous with a plurality (i.e., "r") of cache lines indicated by the range operand. In other words, the memory addresses of the "r" cache lines included in the contiguous region are all equal to or incrementally greater than (or less than, depending on the implementation) the mem_addr operand. In one embodiment, ARWB writes back all dirty cache lines in the processor cache having a memory address that is equal to or incrementally greater than (or less than) the mem_addr operand for the number of cache lines indicated by the integer value of the range operand. Alternatively, instead of cache lines, the range operand may indicate the number of bytes to be included in the contiguous region. The contiguous region begins at the memory address indicated by the mem_addr operand and is continuous with the number of bytes indicated by the range operand.

[0046] According to an embodiment, the optional opcode {S} indicates a shared cache. In one embodiment, the ARWBS instruction behaves exactly like the ARWB instruction. The only difference is that the ARWBS instruction writes dirty cache lines in a contiguous region back to the shared cache instead of the system memory. According to an embodiment, a shared cache is a cache shared by two or more processor cores in a host processor.

[0047] According to an embodiment, ARWB is only based on storage sorting. In this way, the operating system and / or the software running on the operating system can use SFENCE, MFENCE or lock-prefix instructions to achieve the desired sorting. In one embodiment, the ARWB instruction described herein can be used at all privilege levels and is subject to all permission checks and the faults associated with byte loads. For the use that does not require complete data refresh and the subsequent access to data desired, the ARWB instruction can be preferred compared to other instructions.

[0048] According to an embodiment, the hardware implementation for executing the instructions described herein depends greatly on the processor architecture. Specifically, processors with different levels of cache hierarchies will indicate different implementation requirements. The same applies to cache inclusion strategies. For example, in a processor with an L1 / L2 inclusive cache, it may be sufficient to refresh the L2 cache alone, because any invalid cache lines in the L2 will be probed back in the L1. According to an embodiment, the hardware implementation can be simplified based on certain assumptions that can be made about the operating system and / or software running on the operating system. For example, as mentioned above, the operating system and / or software will ensure that any affected memory range is not accessed by another running thread.

[0049] In one embodiment, the range-based memory write-back instructions leverage existing hardware to reduce implementation costs. For example, a cache shrink or refresh engine for existing instructions (e.g., WBINV) can scan the processor cache and evict dirty lines in (multiple) specific ways. Moreover, existing array test registers used for device debugging and testing can provide data paths (e.g., array read / write MUXing with standard functional paths) and control logic (e.g., address scanning finite state machine (FSM)) that can be primarily shared by the range-based memory write-back instructions described herein.

[0050] Figure 5 An exemplary large data array test (LDAT) engine for device debugging and testing that can be used to implement embodiments of the present invention is shown. The data path 502 and control logic 504 can be reused to implement the ARFLUSH instruction and ARWB instruction described herein. In some embodiments, if overloading on existing internal control registers (e.g., machine specific registers (MSRs), such as PDAT / SDAT) is not preferred, a separate set of internal control registers can be defined.

[0051] According to an embodiment, a set of internal control registers are used to track cache lines whose addresses are in a contiguous region of system memory defined by the range-based memory writeback instructions described herein. Each of the cache lines is then flushed or written back to system memory. In one embodiment, this is performed by calling the corresponding CLFLUSH / CLWB instructions described above.

[0052] However, in some instances, it may not be desirable for the microcode to issue a request for each row. In such instances, according to an embodiment, a set of internal control registers are configured, and then the FSM is triggered to scan through a specified address range following the operations and logic described below. A status bit is set after the entire flow is completed, which will then be checked by a sequencing instruction (e.g., MFENCE) for serialization purposes.

[0053] Figure 6 6 is a flow chart showing the logic and operation of a memory write-back instruction based on a range according to an embodiment. At box 602, the current cache line (current CL) is determined based on the mem_addr operand (i.e., the starting memory address) of the instruction. At box 604, a cache line refresh or cache line write-back instruction is executed for the current cache line. At box 608, the next cache line is set to the current cache line. In one embodiment, the memory address of the next cache line is equal to or incrementally greater than the memory address of the current cache line. At box 610, a determination is made as to whether the current cache line is within the range, so that the address of the current cache line falls within the continuous area defined in the system memory by the starting memory address and the range indicator operand of the instruction. If the current cache line is within the range, a cache line refresh or write-back instruction is executed for the current cache line at box 604. However, if the current cache line is not within the range, representing the end of the continuous area in the system memory, the process ends.

[0054] Figure 7 is a flow chart illustrating the logic and operation for refreshing a cache line according to an embodiment. At block 702, a request is received to refresh or write back a cache line (CL) to system memory. In one embodiment, the cache line is Figure 6. At block 704, a cache line tag is read. In an embodiment, the microcode triggers a tag read to read the state of the cache line. Then, at block 706, a determination is made as to whether the cache line is cached in the processor cache. If the cache line is not found in the processor cache, no action is required and the operation ends. On the other hand, if the cache line is found in the processor cache, another determination is made at block 708 as to whether the cache line is dirty. In one embodiment, a dirty cache line is a cache line that has been modified but not written back to the system memory. If the cache line is found to be dirty, the dirty cache line is evicted at block 710. According to an embodiment, the cache line is evicted by a standard or existing eviction mechanism. Once the cache line has been evicted, thereby being stored in the system memory via a cache line writeback, the state of the cache line can be updated in the processor cache. For example, this can be performed by changing the state tag of the cache line to "I" (invalid) or "E" (exclusive). However, returning to box 708, if it is found that the cache line is not dirty (i.e., unmodified), a determination is made at box 712 as to whether the cache line is refreshed or invalidated. According to an embodiment, this is based on whether the request is for refreshing the cache line / invalidating the cache line or only writing back to the memory. As described above, the ARFLUSH instruction refreshes / invalidates the cache line in the processor cache, regardless of whether the cache line is dirty. On the other hand, the ARWB instruction does not refresh / invalidate non-dirty (i.e., unmodified) cache lines. If the cache line is refreshed, the state of the cache line is updated in the processor cache in box 714. As discussed above, this can be accomplished by changing the state tag of the cache line to "I" (invalid) or "E" (exclusive). Alternatively, the state tag of the cache line can be changed to other states according to the desired implementation. However, if the cache line is not refreshed, no changes are made to the cache line tag, and the process ends.

[0055] One embodiment of the present invention is an apparatus comprising: a system memory; a plurality of hardware processor cores, each of the plurality of hardware processor cores comprising a first cache; a decoder circuit for decoding an instruction having a field for a first memory address and a range indicator, the first memory address and the range indicator together defining a contiguous region of one or more cache lines in the system memory; and an execution circuit for executing the decoded instruction by invalidating any instance of the one or more cache lines in the first cache. In one embodiment, any dirty invalid instances of the one or more cache lines in the first cache are stored in the system memory. In some embodiments, the instruction may include an opcode for indicating whether the dirty invalid instances of the one or more cache lines in the first cache are to be stored in a second cache shared by the plurality of hardware processor cores instead of in the system memory. With respect to the range indicator, in some embodiments, it includes a second memory address, such that the contiguous region spans from the first memory address to the second memory address. In other embodiments, the range indicator includes an indication of the number of cache lines included in the contiguous region, such that the address of each of the included cache lines is equal to or incrementally greater than the first memory address. In one embodiment, the first memory address is a linear memory address.

[0056] Another embodiment of the present invention is an apparatus comprising an apparatus including: a system memory; a plurality of hardware processor cores, each of the plurality of hardware processor cores including a first cache; a decoder circuit for decoding an instruction having a field for a first memory address and a range indicator, the first memory address and the range indicator together defining a contiguous region of one or more cache lines in the system memory; and an execution circuit for executing the decoded instruction by causing any dirty instances of the one or more cache lines in the first cache to be stored in the system memory. In some embodiments, the instruction may include an opcode for indicating whether the dirty instances of the one or more cache lines in the first cache are to be stored in a second cache shared by the plurality of hardware processor cores instead of being stored in the system memory. With respect to the range indicator, in some embodiments, it includes a second memory address, such that the contiguous region spans from the first memory address to the second memory address. In other embodiments, the range indicator includes an indication of the number of cache lines included in the contiguous region, such that the address of each of the included cache lines is equal to or incrementally greater than the first memory address. In one embodiment, the first memory address is a linear memory address.

[0057] Another embodiment of the present invention is a method comprising: decoding an instruction having a field for a first memory address and a range indicator, the first memory address and the range indicator together defining a contiguous region of one or more cache lines in a system memory; and executing the decoded instruction by invalidating any instances of the one or more cache lines in a first processor cache. In some embodiments, executing the decoded instruction comprises storing any dirty invalid instances of the one or more cache lines in the first processor cache into the system memory. In other embodiments, executing the decoded instruction comprises storing any dirty invalid instances of the one or more cache lines from the first processor cache into a second cache shared by a plurality of hardware processor cores. With respect to the range indicator, in some embodiments, it comprises a second memory address, such that the contiguous region spans from the first memory address to the second memory address. In other embodiments, the range indicator comprises an indication of the number of cache lines included in the contiguous region, such that the address of each of the included cache lines is equal to or incrementally greater than the first memory address. In one embodiment, the first memory address is a linear memory address.

[0058] Yet another embodiment of the present invention is a method comprising: decoding an instruction having a field for a first memory address and a range indicator, the first memory address and the range indicator together defining a contiguous region of one or more cache lines in a system memory; and executing the decoded instruction by causing any dirty instances of the one or more cache lines in a first processor cache to be stored in the system memory. In some embodiments, the instruction may include an opcode for indicating whether dirty instances of the one or more cache lines in the first processor cache are to be stored in a second cache shared by a plurality of hardware processor cores instead of being stored in the system memory. With respect to the range indicator, in some embodiments, it includes a second memory address, such that the contiguous region spans from the first memory address to the second memory address. In other embodiments, the range indicator includes an indication of the number of cache lines included in the contiguous region, such that the address of each of the included cache lines is equal to or incrementally greater than the first memory address. In one embodiment, the first memory address is a linear memory address.

[0059] Fig. 8A is a block diagram illustrating both an exemplary in-order pipeline and an exemplary register renaming out-of-order issue / execution pipeline according to embodiments of the present invention. Figure 8B is a block diagram illustrating both an exemplary embodiment of an in-order architecture core and an exemplary register renaming out-of-order issue / execution architecture core to be included in a processor according to embodiments of the present invention. Fig. 8A The solid boxes in -B show the in-order pipeline and in-order core, while the optional addition of dashed boxes shows the register renaming out-of-order issue / execution pipeline and core. The out-of-order aspects will be described assuming that the in-order aspects are a subset of the out-of-order aspects.

[0060] exist Fig. 8A , the processor pipeline 800 includes a fetch stage 802, a length decode stage 804, a decode stage 806, an allocation stage 808, a rename stage 810, a schedule (also called a dispatch or issue) stage 812, a register read / memory read stage 814, an execute stage 816, a write back / memory write stage 818, an exception handling stage 822, and a commit stage 824.

[0061] Figure 8B A processor core 890 is shown, which includes front-end hardware 830 coupled to execution engine hardware 850, and both the execution engine hardware and the front-end hardware are coupled to memory hardware 870. The core 890 can be a reduced instruction set computing (RISC) core, a complex instruction set computing (CISC) core, a very long instruction word (VLIW) core, or a hybrid or alternative core type. As yet another option, the core 890 can be a special-purpose core, such as, for example, a network or communication core, a compression engine, a coprocessor core, a general-purpose computing graphics processing unit (GPGPU) core, a graphics core, etc.

[0062] The front-end hardware 830 includes branch prediction hardware 832 coupled to instruction cache hardware 834, which is coupled to instruction translation lookaside buffer (TLB) 836, which is coupled to instruction fetch hardware 838, which is coupled to decoding hardware 840. The decoding hardware 840 (or decoder) can decode the instruction and generate one or more micro-operations, microcode entry points, microinstructions, other instructions or other control signals decoded from the original instruction, or otherwise reflecting the original instruction or derived from the original instruction as output. The decoding hardware 840 can be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to: lookup tables, hardware implementations, programmable logic arrays (PLA), microcode read-only memories (ROMs), etc. In one embodiment, the core 890 includes a microcode ROM or other medium that stores microcode for certain macroinstructions (e.g., in the decoding hardware 840 or within the front-end hardware 830). The decoding hardware 840 is coupled to the renamer / allocator hardware 852 in the execution engine hardware 850.

[0063] The execution engine hardware 850 includes a renamer / allocator hardware 852 coupled to the retirement hardware 854 and a set of one or more scheduler hardware 856. The scheduler hardware 856 represents any number of different schedulers, including reservation stations, central instruction windows, etc. The scheduler hardware 856 is coupled to (multiple) physical register file hardware 858. (Multiple) physical register file hardware 858 each represents one or more physical register files, wherein different physical register files store one or more different data types, such as scalar integers, scalar floating points, packed integers, packed floating points, vector integers, vector floating points, status (e.g., an instruction pointer as the address of the next instruction to be executed), etc. In one embodiment, (multiple) physical register file hardware 858 includes vector register hardware, write mask register hardware, and scalar register hardware. This register hardware can provide architectural vector registers, vector mask registers, and general registers. The physical register file(s) hardware 858 overlaps with the retirement hardware 854 to illustrate various ways in which register renaming and out-of-order execution may be implemented (e.g., using reorder buffer(s) and retirement register file(s); using future stack(s), history buffer(s) and retirement register file(s); using register maps and register pools; etc.). The retirement hardware 854 and the physical register file(s) hardware 858 are coupled to the execution cluster(s) 860. The execution cluster(s) 860 include a set of one or more execution hardware 862 and a set of one or more memory access hardware 864. The execution hardware 862 may perform various operations (e.g., shifts, additions, subtractions, multiplications) and on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). While some embodiments may include multiple execution hardware dedicated to a particular function or set of functions, other embodiments may include only one execution hardware or include multiple execution hardware that all perform all functions. Scheduler hardware 856, physical register file hardware(s) 858, and execution cluster(s) 860 are shown as possibly plural because certain embodiments create separate pipelines for certain types of data / operations (e.g., scalar integer pipelines, scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipelines, and / or memory access pipelines, each of which has its own scheduler hardware, physical register file hardware(s), and / or execution cluster, and in the case of separate memory access pipelines, certain embodiments are implemented in which only the execution cluster of that pipeline has memory access hardware 864). It should also be understood that where separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution pipelines, and the rest are in-order pipelines.

[0064] The set of memory access hardware 864 is coupled to memory hardware 870, which includes data TLB hardware 872 coupled to data cache hardware 874, which is coupled to level 2 (L2) cache hardware 876. In an exemplary embodiment, the memory access hardware 864 may include load hardware, store address hardware, and store data hardware, each coupled to the data TLB hardware 872 in the memory hardware 870. The instruction cache hardware 834 is further coupled to level 2 (L2) cache hardware 876 in the memory hardware 870. The L2 cache hardware 876 is coupled to one or more other levels of cache and ultimately to main memory.

[0065] By way of example, an exemplary register renaming out-of-order issue / execution core architecture may implement pipeline 800 as follows: 1) instruction fetch 838 performs fetch and length decode stages 802 and 804; 2) decode hardware 840 performs decode stage 806; 3) rename / allocator hardware 852 performs allocate stage 808 and rename stage 810; 4) scheduler hardware 856 performs schedule stage 812; 5) (multiple) physical register file hardware 858 and memory hardware 870 perform register read / memory read stage 814; execution cluster 860 implements execute stage 816; 6) memory hardware 870 and (multiple) physical register file hardware 858 perform write back / memory write stage 818; 7) various hardware may be involved in exception handling stage 822; and 8) retirement hardware 854 and (multiple) physical register file hardware 858 perform commit stage 824.

[0066] Core 890 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions that newer versions have added); the MIPS instruction set of MIPS Technologies, Inc. of Sunnyvale, California; the ARM instruction set of ARM Holdings, Inc. of Sunnyvale, California (with optional additional extensions, such as NEON)), including the instruction(s) described herein. In one embodiment, core 890 includes logic to support packed data instruction set extensions (e.g., AVX1, AVX2, and / or some form of universal vector friendly instruction format (U=0 and / or U=1), as described below), thereby allowing operations used by many multimedia applications to be performed using packed data.

[0067] It should be understood that a core may support multithreading (executing two or more operations or sets of threads in parallel) and may accomplish such multithreading in a variety of ways, including time-division multithreading, simultaneous multithreading (where a single physical core provides a logical core for each of the threads that the physical core is simultaneously multithreading), or a combination thereof (e.g., time-division fetching and decoding and thereafter, such as Hyper-Threading (Simultaneous Multithreading).

[0068] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming can be used in an in-order architecture. Although the illustrated embodiment of the processor also includes separate instruction and data cache hardware 834 / 874 and shared L2 cache hardware 876, alternative embodiments may have a single internal cache for both instructions and data, such as, for example, a level 1 (L1) internal cache, or multiple levels of internal caches. In some embodiments, the system may include a combination of internal caches and external caches external to the core and / or processor. Alternatively, all caches may be external to the core and / or processor.

[0069] Fig. 9 is a block diagram of a processor 900 that may have more than one core, may have an integrated memory controller, and may have integrated graphics in accordance with an embodiment of the present invention. Fig. 9 The solid lined box in the figure shows a processor 900 having a single core 902A, a system agent 910, a set of one or more bus controller hardware 916, while the optional addition of the dashed lined box shows an alternative processor 900 having multiple cores 902A-N, a set of one or more integrated memory controller hardware 914 in the system agent hardware 910, and dedicated logic 908.

[0070] Thus, different implementations of the processor 900 may include: 1) a CPU with dedicated logic 908 as integrated graphics and / or scientific (throughput) logic (which may include one or more cores) and cores 902A-N as one or more general purpose cores (e.g., general purpose in-order cores, general purpose out-of-order cores, a combination of both); 2) a coprocessor, where the cores 902A-N are a large number of dedicated cores intended primarily for graphics and / or scientific (throughput); and 3) a coprocessor, where the cores 902A-N are a large number of general purpose in-order cores. Thus, the processor 900 may be a general purpose processor, a coprocessor, or a dedicated processor, such as, for example, a network or communication processor, a compression engine, a graphics processor, a GPGPU (general purpose graphics processing unit), a high throughput integrated many-core (MIC) coprocessor (including 30 or more cores), an embedded processor, etc. The processor may be implemented on one or more chips. The processor 900 may be part of one or more substrates and / or may be implemented on one or more substrates using any of a variety of processing technologies such as, for example, BiCMOS, CMOS, or NMOS.

[0071] The memory hierarchy includes one or more levels of cache within the core, a set of one or more shared cache hardware 906, and external memory (not shown) coupled to the set of integrated memory controller hardware 914. The set of shared cache hardware 906 may include one or more mid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, a final cache (LLC), and / or combinations thereof. While in one embodiment, a ring-based interconnect hardware 912 interconnects the integrated graphics logic 908, the set of shared cache hardware 906, and the system agent hardware 910 / integrated memory controller hardware 914, alternative embodiments may use any number of known techniques for interconnecting such hardware. In one embodiment, coherency is maintained between the one or more cache hardware 906 and the cores 902A-N.

[0072] In some embodiments, one or more of the cores 902A-N may be capable of multithreading. System agent 910 includes those components that coordinate and operate cores 902A-N. System agent hardware 910 may include, for example, a power control unit (PCU) and display hardware. The PCU may be or include logic and components required to regulate the power state of cores 902A-N and integrated graphics logic 908. The display hardware is used to drive one or more externally connected displays.

[0073] The cores 902A-N may be homogeneous or heterogeneous in terms of the architectural instruction set; that is, two or more of the cores 902A-N may be capable of executing the same instruction set, while other cores may be capable of executing only a subset of the instruction set or a different instruction set. In one embodiment, the cores 902A-N are heterogeneous and include both "small" cores and "big" cores described below.

[0074] Figure 10-13 is a block diagram of an exemplary computer architecture. Other system designs and configurations known in the art for laptop computers, desktop computers, handheld PCs, personal digital assistants, engineering workstations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, cellular phones, portable media players, handheld devices, and various other electronic devices are also suitable. In general, a wide variety of systems or electronic devices that can incorporate the processors and / or other execution logic disclosed herein are generally suitable.

[0075] Now refer to Fig.10, a block diagram of a system 1000 according to one embodiment of the present invention is shown. The system 1000 may include one or more processors 1010, 1015 coupled to a controller hub 1020. In one embodiment, the controller hub 1020 includes a graphics memory controller hub (GMCH) 1090 and an input / output hub (IOH) 1050 (which may be on separate chips); the GMCH 1090 includes memory and a graphics controller, to which a memory 1040 and a coprocessor 1045 are coupled; and the IOH 1050 couples an input / output (I / O) device 1060 to the GMCH 1090. Alternatively, one or both of the memory and the graphics controller are integrated within a processor (as described herein), with the memory 1040 and the coprocessor 1045 being coupled directly to the processor 1010 and the controller hub 1020 with the IOH 1050 in a single chip.

[0076] Fig.10 The optional nature of the additional processor 1015 is indicated by dashed lines in FIG. 10. Each processor 1010, 1015 may include one or more of the processing cores described herein and may be some version of processor 900.

[0077] The memory 1040 may be, for example, a dynamic random access memory (DRAM), a phase change memory (PCM), or a combination of both. For at least one embodiment, the controller hub 1020 communicates with the processor(s) 1010, 1015 via a multi-drop bus (e.g., a front side bus (FSB), a point-to-point interface, or similar connection 1095).

[0078] In one embodiment, the coprocessor 1045 is a special purpose processor such as, for example, a high throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, etc. In one embodiment, the controller hub 1020 may include an integrated graphics accelerator.

[0079] There may be a variety of differences between physical resources (eg, processors 1010, 1015) with respect to a range of metrics, including architectural, microarchitectural, thermal, power consumption characteristics, etc.

[0080] In one embodiment, processor 1010 executes instructions that control general types of data processing operations. Coprocessor instructions may be embedded in the instructions. Processor 1010 recognizes these coprocessor instructions as being of a type that should be executed by an attached coprocessor 1045. Accordingly, processor 1010 issues these coprocessor instructions (or control signals representing coprocessor instructions) on a coprocessor bus or other interconnect to coprocessor 1045. Coprocessor(s) 1045 accept and execute the received coprocessor instructions.

[0081] Now refer to Fig.11 , a block diagram of a first more specific exemplary system 1100 according to an embodiment of the present invention is shown. Fig.11 As shown, multiprocessor system 1100 is a point-to-point interconnect system and includes a first processor 1170 and a second processor 1180 coupled via a point-to-point interconnect 1150. Processors 1170 and 1180 may each be a version of processor 900. In one embodiment of the present invention, processors 1170 and 1180 are processors 1010 and 1015, respectively, and coprocessor 1138 is coprocessor 1045. In another embodiment, processors 1170 and 1180 are processors 1010 and coprocessor 1045, respectively.

[0082] Processors 1170 and 1180 are shown as including integrated memory controller (IMC) hardware 1172 and 1182, respectively. Processor 1170 also includes point-to-point (PP) interfaces 1176 and 1178 as part of its bus controller hardware; similarly, second processor 1180 includes PP interfaces 1186 and 1188. Processors 1170, 1180 can exchange information via point-to-point (PP) interface 1150 using PP interface circuits 1178, 1188. Fig.11 As shown, IMCs 1172 and 1182 couple the processors to corresponding memories, namely, memory 1132 and memory 1134, which may be portions of main memory locally attached to the corresponding processors.

[0083] Processors 1170, 1180 may each exchange information with chipset 1190 via separate PP interfaces 1152, 1154 using point-to-point interface circuits 1176, 1194, 1186, 1198. Alternatively, chipset 1190 may exchange information with coprocessor 1138 via high performance interface 1139. In one embodiment, coprocessor 1138 is a special purpose processor such as, for example, a high throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, etc.

[0084] A shared cache (not shown) may be included in either processor or external to both processors but connected to the processors via the PP interconnect such that if the processors are placed in a low power mode, local cache information of either or both processors may be stored in the shared cache.

[0085] Chipset 1190 may be coupled to first bus 1116 via interface 1196. In one embodiment, first bus 1116 may be a peripheral component interconnect (PCI) bus, or a bus such as a PCI Express bus or another third generation I / O interconnect bus, although the scope of the invention is not limited in this regard.

[0086] like Fig.11 As shown, different I / O devices 1114 can be coupled to the first bus 1116 along with a bus bridge 1118, which can couple the first bus 1116 to a second bus 1120. In one embodiment, one or more additional processors 1115 (e.g., a coprocessor, a high throughput MIC processor, a GPGPU, an accelerator (e.g., a graphics accelerator or digital signal processing (DSP) hardware), a field programmable gate array, or any other processor) are coupled to the first bus 1116. In one embodiment, the second bus 1120 can be a low pin count (LPC) bus. In one embodiment, various devices can be coupled to the second bus 1120, including, for example, a keyboard and / or mouse 1122, communication devices 1127, and storage hardware 1128 (such as a disk drive or other mass storage device) which may include instruction / code data 1130. Further, an audio I / O 1124 can be coupled to the second bus 1120. Note that other architectures are possible. For example, instead of Fig.11 Instead of a point-to-point architecture, the system may implement a multi-point bus or other such architecture.

[0087] Reference now Fig.12 , shows a block diagram of a more specific second exemplary system 1200 according to an embodiment of the present invention. Fig.11 and Fig.12 Identical components in the same format have the same reference numbers and have been changed from Fig.12 Omitted Fig.11 to avoid using Fig.12 Other aspects are vague.

[0088] Fig.12 It is shown that processors 1170, 1180 may include integrated memory and I / O control logic ("CL") 1172 and 1182, respectively. Thus, CL 1172, 1182 includes integrated memory controller hardware and includes I / O control logic. Fig.12 It is shown that not only the memory 1132, 1134 is coupled to the CL 1172, 1182, but also the I / O devices 1214 are coupled to the control logic 1172, 1182. Legacy I / O devices 1215 are coupled to the chipset 1190.

[0089] Reference now Fig.13, shows a block diagram of a SoC 1300 according to an embodiment of the present invention. Fig. 9 Similar components in FIG. 1 have the same reference numbers. Also, dashed boxes are optional features for more advanced SoCs. Fig.13 , interconnect hardware 1302 is coupled to: an application processor 1310, which includes a set of one or more cores 902A-N and shared cache hardware 906; system agent hardware 910; bus controller hardware 916; integrated memory controller hardware 914; a set of one or more coprocessors 1320, which may include integrated graphics logic, image processors, audio processors, and video processors; static random access memory (SRAM) hardware 1330; direct memory access (DMA) hardware 1332; and display hardware 1340 for coupling to one or more external displays. In one embodiment, the coprocessor(s) 1320 are special purpose processors, such as, for example, network or communication processors, compression engines, GPGPUs, high throughput MIC processors, embedded processors, etc.

[0090] The embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementation approaches. Embodiments of the present invention may be implemented as a computer program or program code executed on a programmable system, the programmable system comprising at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0091] like Fig.11 The program code of the code 1130 shown can be applied to input instructions to perform functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purpose of this application, the processing system includes any system with a processor, such as, for example: a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0092] The program code can be implemented in a high-level program or object-oriented programming language to communicate with the processing system. If necessary, the program code can also be implemented in assembly or machine language. In fact, the scope of the mechanism described herein is not limited to any specific programming language. In any case, the language can be a compiled or interpreted language.

[0093] One or more aspects of at least one embodiment may be implemented by representative instructions stored on a machine-readable medium, the instructions representing various logic within a processor, which when read by a machine causes the machine to fabricate logic for performing the techniques described herein. Such representations (called "IP cores") may be stored on a tangible machine-readable medium and provided to various customers or manufacturing facilities to be loaded into a fabrication machine that actually fabricates the logic or processor.

[0094] Such machine-readable storage media may include, but are not limited to: a non-transitory tangible arrangement of items manufactured or formed by a machine or device, including storage media such as a hard disk; any other type of disk, including floppy disks, optical disks, compact disk-read only memory (CD-ROM), compact disk-rewritable (CD-RW), and magneto-optical disks; semiconductor devices, such as read-only memory (ROM); random access memory (RAM), such as dynamic random access memory (DRAM), static random access memory (SRAM); erasable programmable read-only memory (EPROM); flash memory; electrically erasable programmable read-only memory (EEPROM); phase change memory (PCM); magnetic card or optical card; or any other type of medium suitable for storing electronic instructions.

[0095] Therefore, embodiments of the present invention also include non-transitory tangible machine-readable media containing instructions or containing design data (such as hardware description language (HDL)), which defines the structures, circuits, devices, processors and / or system features described herein. Such embodiments may also be referred to as program products.

[0096] In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may convert (e.g., using static binary translation, dynamic binary translation including dynamic compilation), deform, simulate, or otherwise convert instructions to one or more other instructions to be processed by the core. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on the processor, off the processor, or partially on the processor and partially off the processor.

[0097] Fig.14 1 is a block diagram comparing the use of a software instruction converter for converting binary instructions in a source instruction set into binary instructions in a target instruction set according to an embodiment of the present invention. In the illustrated embodiment, the instruction converter is a software instruction converter, however, alternatively, the instruction converter may be implemented in software, firmware, hardware, or various combinations thereof. Fig.14A program in a high-level language 1402 is shown that can be compiled using an x86 compiler 1404 to generate x86 binary code 1406 that can be natively executed by a processor having at least one x86 instruction set core 1416. A processor having at least one x86 instruction set core 1416 represents any processor that can perform substantially the same functionality as an Intel processor having at least one x86 instruction set core by compatibly executing or otherwise processing: (1) a substantial portion of the instruction set of an Intel x86 instruction set core, or (2) an object code version of an application or other software that is targeted to run on an Intel processor having at least one x86 instruction set core to achieve substantially the same results as an Intel processor having at least one x86 instruction set core. The x86 compiler 1404 represents a compiler that is operable to generate x86 binary code 1406 (e.g., object code) that can be executed on a processor having at least one x86 instruction set core 1416 with or without additional link processing. Similarly, Fig.14 A program of a high-level language 1402 is shown that can be compiled using an alternative instruction set compiler 1408 to generate an alternative instruction set binary code 1410 that can be natively executed by a processor 1414 that does not have at least one x86 instruction set core (e.g., a processor that has a core that executes the MIPS instruction set of MIPS Technologies, Inc. of Sunnyvale, California and / or executes the ARM instruction set of ARM Holdings, Inc. of Sunnyvale, California). An instruction converter 1412 is used to convert the x86 binary code 1406 into code that can be natively executed by a processor that does not have an x86 instruction set core 1414. This converted code is unlikely to be the same as the alternative instruction set binary code 1410 because it is difficult to make an instruction converter that can achieve this; however, the converted code will complete the general operation and be composed of instructions from the alternative instruction set. Therefore, the instruction converter 1412 represents software, firmware, hardware, or a combination thereof that allows a processor or other electronic device that does not have an x86 instruction set processor or core to execute the x86 binary code 1406 through simulation, emulation, or any other process.

[0098] Although some embodiments have been described with reference to specific embodiments, other embodiments are possible according to some embodiments. In addition, the arrangement and / or order of elements or other features shown in the drawings and / or described herein need not be arranged in the particular manner shown and described. According to some embodiments, many other arrangements are possible.

[0099] In each system shown in the drawings, elements in some cases may each have the same reference numeral or different reference numerals to indicate that the represented elements may be different and / or similar. However, elements may be flexible enough to have different embodiments and work with some or all of the systems shown or described in this article. The various elements shown in the drawings may be the same or different. Which is called the first element and which is called the second element is arbitrary.

[0100] In the specification and claims, the terms "coupled" and "connected" and their derivatives may be used. It should be understood that these terms are not intended to be synonymous with each other. On the contrary, in a particular embodiment, "connected" may be used to indicate that two or more elements are in direct physical or electrical contact with each other. "Coupled" may mean that two or more elements are in direct physical or electrical contact. However, "coupled" may also mean that two or more elements are not in direct contact with each other, but still cooperate or interact with each other.

[0101] An embodiment is an implementation or example of the present invention. References in the specification to "an embodiment," "one embodiment," "some embodiments," or "other embodiments" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least some embodiments of the present invention, but not necessarily all embodiments. Multiple occurrences of "an embodiment," "one embodiment," or "some embodiments" do not necessarily all refer to the same embodiment.

[0102] Not all components, features, structures, characteristics, etc. described and shown herein need to be included in one or more specific embodiments. For example, if the specification states that a component, feature, structure, or characteristic "may", "might", "could", or "can" be included, the specific component, feature, structure, or characteristic is not required to be included. If the specification or claims refer to "a" or "an" element, that does not mean that there is only one element. If the specification or claims refer to "additional" elements, that does not exclude the presence of more than one additional element.

[0103] The above description of the illustrated embodiments of the present invention, including what is described in the Abstract, is not intended to be exclusive or to limit the present invention to the precise forms disclosed. Although specific embodiments and examples of the present invention are described herein for illustrative purposes, various equivalent modifications are possible within the scope of the present invention, as will be appreciated by those skilled in the art.

[0104] These modifications may be made to the invention in light of the above detailed description. The terms used in the following claims should not be interpreted to limit the invention to the specific embodiments disclosed in the specification and drawings. Instead, the scope of the invention is determined entirely by the following claims, which should be interpreted according to the established provisions of claim interpretation.

Claims

1. A device for computing, comprising: System memory; A plurality of hardware processor cores, each of the hardware processor cores being configured to include: a first cache; a decoder circuit for decoding an instruction having fields for a first memory address and a range indicator, the first memory address and the range indicator defining a contiguous region in the system memory, the contiguous region comprising one or more cache lines; and execution circuitry for executing a decoded instruction by invalidating any instances of the one or more cache lines in the first cache, The instruction further includes an operation code for indicating whether dirty instances of the one or more cache lines in the first cache are to be stored in a second cache shared by the plurality of hardware processor cores instead of being stored in the system memory.

2. The device according to claim 1, characterized in that If an invalid instance of the one or more cache lines in the first cache is dirty, the invalid instance will be stored in the system memory.

3. The device according to claim 1 or 2, characterized in that The range indicator includes a second memory address, and the contiguous region is used to span from the first memory address to the second memory address.

4. The device according to claim 1 or 2, characterized in that The range indicator includes an indication of a number of bytes or cache lines to be included in the contiguous region, the included cache lines having addresses equal to or incrementally greater than the first memory address.

5. The device according to claim 1 or 2, characterized in that The first memory address is a linear memory address.

6. An apparatus for computing, comprising: System memory; A plurality of hardware processor cores, each of the hardware processor cores being configured to include: a first cache; a decoder circuit for decoding an instruction having fields for a first memory address and a range indicator, the first memory address and the range indicator defining a contiguous region in the system memory, the contiguous region comprising one or more cache lines; and execution circuitry for executing a decoded instruction by causing any dirty instances of the one or more cache lines in the first cache to be stored in the system memory, The instruction further includes an operation code for indicating whether dirty instances of the one or more cache lines in the first cache are to be stored in a second cache shared by the plurality of hardware processor cores instead of being stored in the system memory.

7. The device according to claim 6, characterized in that The range indicator includes a second memory address, and the contiguous region is used to span from the first memory address to the second memory address.

8. The device according to claim 6, characterized in that The range indicator includes an indication of a number of bytes or cache lines to be included in the contiguous region, the included cache lines having addresses equal to or incrementally greater than the first memory address.

9. The device according to any one of claims 6 to 8, characterized in that The first memory address is a linear memory address.

10. A method for computing, comprising: decoding an instruction having fields for a first memory address and a range indicator, the first memory address and the range indicator defining a contiguous region in system memory, the contiguous region comprising one or more cache lines; as well as executing the decoded instruction by invalidating any instances of the one or more cache lines in the first processor cache, Wherein, the step of executing the decoded instruction further comprises: if the invalid instance of the one or more cache lines from the first processor cache is dirty, storing the invalid instance in a second cache shared by multiple hardware processor cores.

11. The method according to claim 10, characterized in that Executing the decoded instruction further includes storing invalid instances of the one or more cache lines in the first processor cache in the system memory if the invalid instances are dirty.

12. The method according to claim 10 or 11, characterized in that The range indicator includes a second memory address, and the contiguous region is used to span from the first memory address to the second memory address.

13. The method according to claim 10 or 11, characterized in that: The range indicator includes an indication of a number of bytes or cache lines to be included in the contiguous region, the included cache lines having addresses equal to or incrementally greater than the first memory address.

14. The method according to claim 10 or 11, characterized in that: The first memory address is a linear memory address.

15. A method for computing, comprising: decoding an instruction having fields for a first memory address and a range indicator, the first memory address and the range indicator defining a contiguous region in system memory, the contiguous region comprising one or more cache lines; as well as executing the decoded instruction by causing any dirty instances of the one or more cache lines in the first processor cache to be stored into the system memory, The instruction further includes an opcode for indicating whether dirty instances of the one or more cache lines in the first processor cache are to be stored in a second cache shared by multiple hardware processor cores instead of in the system memory.

16. The method according to claim 15, characterized in that The range indicator includes a second memory address, and the contiguous region is used to span from the first memory address to the second memory address.

17. The method according to claim 15, characterized in that The range indicator includes an indication of a number of bytes or cache lines to be included in the contiguous region, the included cache lines having addresses equal to or incrementally greater than the first memory address.

18. The method according to any one of claims 15 to 17, characterized in that The first memory address is a linear memory address.

Citation Information

Patent Citations

  • Method, system, apparatus for performing cacheline polling operation

    CN101038567A

  • Instructions and logic to provide advanced paging capabilities for secure enclave page caches

    CN104484284A

  • Instruction and logic to provide pushing buffer copy and store functionality

    CN104937539A

  • Secure memory repartitioning

    CN105474227A

  • Instruction and logic for memory access in a clustered wide-execution machine

    CN105745630A