Device and method for triggering an action

By interpreting the data value in the memory location according to different interpretations in the data processing device, the action trigger circuit determines and executes the action, which solves the problem of limited number of data values ​​in the observation point configuration and high cost of the address observation point, and realizes the processing of a large number of addresses. monitoring and error detection.

CN112106029BActive Publication Date: 2024-08-23ARM LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980030434.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-05-31
Filing Date
2019-05-02
Publication Date
2024-08-23
Estimated Expiration
2039-05-02

AI Technical Summary

Technical Problem

When configuring observation points, existing data processing devices limit the number of data values ​​used to represent normal data, and require multiple comparators for each address observation point, resulting in high costs and a limited number of address observation points.

Method used

Action triggering circuitry is used to determine whether the data value is defined on the second interpretation by retrieving the data value at a memory location and determining whether to trigger an action based on different interpretations (first interpretation as data, second interpretation as metadata or action) The action to be performed, and triggers the execution of the action after it is determined, thereby realizing the observation point type function without reducing the available space for data interpretation.

Benefits of technology

Monitoring a large number of addresses for potential errors is implemented without reducing the available space for data interpretation and does not require multiple address comparators. It is particularly suitable for detecting memory usage errors such as out-of-bounds violations and use-after-free errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112106029B_ABST
    Figure CN112106029B_ABST
Patent Text Reader

Abstract

An apparatus and method for triggering the execution of an action are provided. An example apparatus includes a memory access circuit for retrieving a data value from a memory location of a memory. The apparatus also includes an action triggering circuit for determining whether the data value is to be interpreted according to a first interpretation or a second interpretation, and when it is determined that the data value is to be interpreted according to the second interpretation, determining whether the data value defines an action to be performed. When it is determined that the data value defines the action to be performed, the action triggering circuit triggers the execution of the action.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present technology relates to the field of data processing. Background Art

[0002] Some data processing apparatus allow watchpoints to be configured to trigger actions to be performed when specific memory accesses are made, for example for debugging or detecting memory usage errors. A watchpoint may be associated with a memory device of the data processing apparatus, where data values ​​are stored in addressable memory locations. An example of such a watchpoint is a data watchpoint, which causes an action to be triggered when a specific data value is loaded from the memory device. Another example is an address watchpoint, which causes an action to be triggered when a specific memory address is accessed.

[0003] Despite their practicality, the above-described watchpoints have disadvantages. In situations where a watchpoint action is not intended to be performed when normal data is accessed, the data value associated with the data watchpoint cannot be used to represent normal data. Therefore, the configuration of data watchpoints limits the number of data values ​​that can be used to represent normal data. In the case of address watchpoints, a comparator is typically required for each address watchpoint to be configured. Providing a large number of address comparators for address watchpoints is hardware expensive, so in practice, the number of addresses for which address watchpoints can be established simultaneously may be limited. Summary of the invention

[0004] In one example configuration, an apparatus is provided that includes: a memory access circuit for retrieving a data value from a memory location of a memory; and an action trigger circuit for: determining whether the data value is to be interpreted according to a first interpretation or a second interpretation; and when it is determined that the data value is to be interpreted according to the second interpretation: determining whether the data value defines an action to be performed; and when it is determined that the data value defines an action to be performed, triggering execution of the action.

[0005] In another example configuration, a method is provided, comprising: retrieving a data value from a memory location of a memory; determining whether the data value is to be interpreted according to a first interpretation or a second interpretation; and when it is determined that the data value is to be interpreted according to the second interpretation: determining whether the data value defines an action to be performed; and when it is determined that the data value defines an action to be performed, triggering execution of the action.

[0006] In yet another example, a computer program for controlling a host data processing device is provided to provide an instruction execution environment for executing instructions of a target program code, including: memory access program logic for requesting a data value from a memory location of a memory; and action triggering program logic for: determining whether the data value is to be interpreted according to a first interpretation or a second interpretation; and when it is determined that the data value is to be interpreted according to the second interpretation: determining whether the data value defines an action to be performed; and when it is determined that the data value defines an action to be performed, triggering the execution of the action. A storage medium may store the above-mentioned computer program. The storage medium may be a non-transitory storage medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] The present technology will be further described, by way of illustration only, with reference to examples of the present technology as shown in the accompanying drawings, in which:

[0008] Figure 1 is a block diagram of an apparatus arranged according to one example;

[0009] Figure 2 An example of an instruction type for which an error may be triggered if an attempt is made to set or access a pointer value within a bounded set of pointer storage elements, where the pointer value is used to specify an address outside of a range indicated by associated range information, is shown;

[0010] Figure 3 shows the use of tag bits associated with bounded pointers according to one example arrangement;

[0011] Figure 4 A method according to an example is schematically illustrated;

[0012] Figure 5A-5E An error suppression algorithm according to an example is shown;

[0013] Figure 6 schematically illustrates a method according to an example; and

[0014] Figure 7 An apparatus according to an example is schematically shown.

[0015] Figure 8 A simulator according to an example is schematically shown. DETAILED DESCRIPTION

[0016] A data processing apparatus according to examples of the present disclosure allows a data value stored in a given memory location to be interpreted according to different interpretations.

[0017] As an example of a system that allows such different interpretations, a device may support bounded pointers, in which a pointer indicating a specific address is associated with range information indicating an allowable address range in which the pointer can be dereferenced. For example, such a pointer may be referred to as a "fat pointer". In addition to the range information, such a bounded pointer may also have other associated attributes, thereby defining one or more restrictions / permissions on the use of the pointer. Such bounded pointers with permissions are generally referred to as "capabilities", and the use of such bounded pointers can therefore provide strong security by setting constraints on how the pointer values ​​specified by the boundary pointers are used. In such a data processing device, the contents of a given memory location may be interpreted as either capabilities or data.

[0018] In an example of the present disclosure, the data functionality is extended by providing a given data value to define an action to be performed when interpreting according to a specific interpretation such as a non-data interpretation. In the example, the action is encoded in a data value space that is redundant for the interpretation in question. For example, the interpretation may utilize some but not all of the available data values. Then, at least some of the remaining data values ​​that are not used for the second interpretation may be used to encode the action to be performed. In this way, a watchpoint type of functionality may be implemented without reducing the available data value space for data interpretation: the full range of data values ​​is still available. The above-mentioned disadvantages of data watchpoints are thus avoided. In addition, no dedicated address comparator is required for each address to be monitored, thereby avoiding the above-mentioned disadvantages of address watchpoints.

[0019] As described above, an example device includes a memory access circuit for retrieving a data value from a memory location of a memory. The device includes an action trigger circuit for determining whether to interpret the data value according to a first interpretation or a second interpretation. In an example, the first interpretation is that the data value is data, and the second interpretation is that the data value is non-data, such as metadata. When it is determined that the data value is to be interpreted according to the second interpretation, the action trigger circuit determines whether the data value defines an action to be performed. When it is determined that the data value defines an action to be performed, the action trigger circuit triggers the execution of the action. Therefore, the device provides a data value to be interpreted according to the second interpretation to define the action to be performed. Therefore, this enables monitoring of a potentially large number of addresses for accesses that potentially trigger actions without requiring many address comparators and without reducing the encoding space available for data in the first interpretation. This is particularly useful for detecting certain categories of memory use errors (e.g., out-of-bounds violations, use-after-free errors, etc., where the number of memory addresses that may potentially be incorrectly accessed may be relatively high, making it impractical to use address watchpoints to capture such errors).

[0020] In an example, the action is an error suppression action, which may, for example, include signaling an exception. This may be used as a "canary" to protect against unexpected or unauthorized loads from a particular memory region.

[0021] Alternatively or additionally, the action may include updating a diagnostic record, such as by incrementing a counter or storing a log file. This enables tracking of loads from a specific memory region without having to signal an exception and halt execution flow.

[0022] Actions may include returning different data values ​​from different memory locations. This allows actions to be performed while also returning expected data values. For example, as described in more detail below, a released memory location may be overwritten with the data value defining the action, while the data value originally stored in the memory location is stored in another memory location. When the memory location is accessed, the action may be performed and the data value from the other memory location may be returned. This allows, for example, keeping a record of loads from released memory locations while still returning expected data, thereby allowing the currently defined device to be transparently implemented without hindering the execution of code that is not specifically written for the current device.

[0023] In an example, in response to an attempted write to a memory location, data value retrieval and associated actions are performed, and the actions include determining whether the write was actually performed.

[0024] In a related example, the action includes determining that a processor operating state associated with an attempted write to a memory location is a prohibited operating state, and in response to determining that the operating state is a prohibited operating state, prohibiting the attempted write. The operating state can be at least one execution privilege level. Such prohibition of writes from a particular privilege level allows control over which processes can overwrite data values. For example, an accidental overwriting of a data value by a process other than the process that sets the data value can be prevented.

[0025] In an example, in response to an attempt to write to a memory location, the above-mentioned data value retrieval and associated action execution are performed. In such an example, the action may include determining whether the attempted write is actually performed. For example, this allows the action to be based on whether a prohibited write is attempted.

[0026] In an example, the action trigger circuit determines whether to interpret the data value according to the first interpretation or the second interpretation based on a control value associated with the memory location. For example, the control value can be a tag bit. The control value can be stored in a control value memory location in an area of ​​the memory allocated for control value storage. Alternatively, the control value can be stored in a control value memory location associated with the memory location, such as adjacent to the memory location. Therefore, the location of the control value storage can be determined based on the requirements and limitations of a particular system.

[0027] In an example, the action triggering circuit is used to trigger an action when the data value at least partially matches one of the one or more predefined values. For example, as described above, the action can be defined according to the second interpretation by redundancy in the data value, so that a specific predefined value is not used for the second interpretation. Then, such a predefined data value can be used to define the action to be performed.

[0028] Some processing devices may support the use of bounded pointers. For example, a pointer itself may point to or be used to determine the address of a data value to be accessed or an instruction to be executed. However, a pointer may also have associated range information that indicates the allowable range of addresses when the pointer is used. This may be useful, for example, to ensure that addresses determined from a pointer remain within certain boundaries to maintain the safety or functional correctness of behavior. For example, there is growing interest in capability-based architectures, in which certain capabilities are defined for a given process, and errors may be triggered if an attempt is made to perform operations outside of the defined capabilities. The range information for a bounded pointer may be part of the capability information defined for such an architecture, and within a capability-based architecture, such a bounded pointer (including its associated capability information) may be referred to as a capability.

[0029] Thus, the apparatus may have a storage element for storing a pointer with associated range information indicating an allowable range of addresses when using the pointer.Each bounded pointer storage element may be a register, or a memory location in a general purpose memory, such as a location on a stack memory.

[0030] Certain instructions may be used to reference such bounded pointer storage elements to obtain a pointer that is then used to derive addresses in memory required during operation of the instruction. Pointers may be used directly to identify memory addresses, or may be used to derive memory addresses, for example, by adding an offset to the pointer value.

[0031] As described above, in an example, the first interpretation is that the data value is data. In a related example, the second interpretation is that the data value is metadata. The metadata may, for example, be related to a data value stored in another memory location different from the memory location where the metadata is stored. The data value stored in the other memory location may be interpreted according to the first interpretation. In an example that supports the use of bounded pointers, the data value stored in the other memory location may include the pointer value of the bounded pointer, and the metadata may then include the boundaries of the bounded pointer. In some such examples, the action trigger circuit will determine that the pointer value is outside the boundaries, and in response to determining that the pointer value is outside the boundaries, signal an exception. In this way, the data processing functionality of the system that supports the use of capabilities can be extended to provide triggering of actions, as described elsewhere herein.

[0032] In other examples where the second interpretation is that the data value is metadata, the metadata is an error correction code associated with data stored in another memory location. In this way, the data processing functionality of a system supporting the use of error correction codes can be extended to provide triggering of actions, as described elsewhere herein.

[0033] Specific examples will now be described with reference to the drawings.

[0034] Figure 1 An example of a data processing apparatus 2 including a processing pipeline 4 for processing instructions is schematically shown. In this example, the processing pipeline 4 includes a plurality of pipeline stages including a fetch stage 6, a decode stage 8, an issue stage 10, an execute stage 12, and a write-back stage 14, but it will be appreciated that other types of stages or combinations of stages may be provided. For example, in some implementations, a renaming stage for performing register renaming may be included. Instructions to be processed move from stage to stage, and while an instruction is pending at one stage of the pipeline 4, another instruction may be pending at a different stage.

[0035] The fetch stage 6 fetches instructions from the level 1 (L1) instruction cache 20. The fetch stage 6 may typically fetch instructions sequentially from consecutive instruction addresses. However, the fetch stage may also have a branch predictor 22 for predicting the outcome of a branch instruction, and the fetch stage 6 may fetch instructions from a (non-sequential) branch target address if the predicted branch is taken, or from the next sequential address if the predicted branch is not taken. The branch predictor 22 may include one or more branch history tables for storing information for predicting whether certain branches are likely to be taken. For example, the branch history table may include counters for tracking the actual outcome of previously executed branches or representing the confidence of a prediction made for a branch. The branch predictor 22 may also include a branch target address cache (BTAC) 24 for caching previous target addresses of branch instructions so that the same branch instruction can be predicted when it is subsequently encountered.

[0036] The fetched instructions are passed to a decode stage 8, which decodes the instructions to generate decoded instructions. The decoded instructions may include control information for controlling the execution stage 12 to perform appropriate processing operations. For some more complex instructions fetched from the cache 20, the decode stage 8 may map these instructions to multiple decoded instructions, which may be referred to as micro-operations (μops or uops). Therefore, there may not be a one-to-one relationship between the instructions fetched from the L1 instruction cache 20 and the instructions seen by subsequent stages of the pipeline. Generally, references to "instructions" in this application should be interpreted as including micro-operations.

[0037] The decoded instructions are passed to the issue stage 10, which determines whether operands required for executing the instructions are available, and issues the instructions for execution when the operands are available. Some implementations may support in-order processing, whereby instructions are issued for execution in an order corresponding to the program order in which the instructions are fetched from the L1 instruction cache 20. Other implementations may support out-of-order execution, whereby instructions may be issued to the execution stage 12 in an order different from the program order. Out-of-order processing may be useful for improving performance because subsequent instructions for which operands are available may be executed first in program order while earlier instructions are stalled while waiting for operands.

[0038] The issue stage 10 issues instructions to the execution stage 12, where the instructions are executed to perform various data processing operations. For example, the execution stage may include a plurality of execution units 30, 32, 34, including an arithmetic / logic unit (ALU) 30 for performing arithmetic or logical operations on integer values, a floating point (FP) unit 32 for performing operations on values ​​represented in floating point form, and a load / store unit 34 for performing load operations, the load operation being used to load data values ​​from a level 1 (L1) data cache 36 to a register 40, or a store operation being used to store data values ​​from a register 40 to a L1 data cache 36. It should be understood that these are only some examples of the types of execution units that may be provided, and that many other types may also be provided. To perform processing operations, the execution stage 12 may read data values ​​from a register set 40. The results of the executed instructions may then be written back to the register 40 by the write-back stage 14.

[0039] The L1 instruction cache 20 and the L1 data cache 36 may be part of a cache hierarchy that includes multiple levels of cache. For example, a level 2 (L2) cache 44 may also be provided, and optionally, other levels of cache may be provided. In this example, the L2 cache 44 is shared between the L1 instruction cache 20 and the L1 data cache 36, but other examples may have separate L2 instruction and data caches. When an instruction to be fetched is not in the L1 instruction cache 20, then the instruction may be fetched from the L2 cache 44, and similarly, if the instruction is not in the L2 cache 44, then the instruction may be fetched from the main memory 50. Similarly, in response to a load instruction, if the data is not in the L1 data cache 36, then the data may be fetched from the L2 cache 44, and if necessary, then the data may be fetched from the memory 50. Any known scheme may be used to manage a cache hierarchy.

[0040] The addresses used by pipeline 4 to reference program instructions and data values ​​may be virtual addresses, but at least main memory 50 and optionally at least some levels of the cache hierarchy may be physically addressable. Therefore, a translation lookaside buffer 52 (TLB) may be provided for converting virtual addresses used by pipeline 4 into physical addresses for accessing cache or memory. For example, TLB 52 may include a plurality of entries, each entry specifying a virtual page address of a corresponding page of a virtual address space and a corresponding physical page address to which the virtual page address should be mapped, so as to convert the virtual address within the corresponding page into a physical address. For example, the virtual page address and the physical page address may correspond to the most significant portion of the corresponding virtual address and the physical address, wherein when the virtual address is mapped to the physical address, the remaining least significant portion remains unchanged. In addition to the address translation information, each TLB entry may also include some information specifying access rights, such as indicating whether certain address pages may be accessed in certain modes of pipeline 4. In some implementations, the TLB entry may also define other properties of the corresponding address page, such as cache policy information that defines which levels of the cache hierarchy are updated in response to a read or write operation (e.g., whether the cache should operate in write-back mode or write-through mode), or information that defines whether data accesses to addresses in the corresponding page can be reordered by the memory system compared to the order in which the data accesses were issued by pipeline 4.

[0041] although Figure 1 A single level TLB 52 is shown, but it should be understood that a hierarchy of TLBs may be provided such that a level 1 (L1) TLB 52 may include TLB entries for translating addresses in multiple recently accessed pages, and a level 2 (L2) TLB may be provided for storing entries for more pages. When the required entry is not present in the L1 TLB, the entry may be retrieved from the L2 TLB or from another TLB in the hierarchy. If the required entry for the page to be accessed is not in any TLB, a page table walk may be performed to access the page table in the memory 50. Any known TLB management scheme may be used in the present technology.

[0042] In addition, it should be understood that some systems may support multiple levels of address translation, such that, for example, a first TLB (or hierarchy of TLBs) may be used to translate a virtual address into an intermediate address, and a second level of address translation using one or more other TLBs may then translate the intermediate address into a physical address for accessing a cache or memory. This may be useful for supporting virtualization, where, for example, a first level of address translation may be managed by an operating system and a second level of address translation may be managed by a hypervisor.

[0043] like Figure 1 As shown, the device 2 may have a bounded pointer register set 60. Although Figure 1 The bounded pointer register set is shown as being physically separate from the general data register set 40, but in one implementation, the same physical storage may be used to provide both the general data registers and the bounded pointer registers.

[0044] Each bounded pointer register 60 includes a pointer value 62 that can be used to determine the address of the data value to be accessed, and range information 64 that specifies the allowable range of the address when using the corresponding pointer 62. The bounded pointer register 60 may also include restriction information 66 (also referred to herein as permission information), which may define one or more restrictions / permissions on the use of the pointer. For example, the restriction 66 may be used to limit the type of instructions that can use the pointer 62, or the mode of the pipeline 4 in which the pointer can be used. Therefore, the range information 64 and the restriction information 66 may be considered to define the capabilities in which the pointer 62 is allowed to be used. When attempting to use a pointer 62 outside the defined capabilities, an error may be triggered. The range information 64 may be used, for example, to ensure that the pointer remains within certain known boundaries and does not deviate from other areas in the memory address space that may contain sensitive information or security information. In an example in which both the general data register and the bounded pointer register use the same physical storage device, then in one implementation, the pointer value 62 may be stored, for example, in the same storage location as that used for the corresponding general register.

[0045] Figure 2 1 shows an example of an instruction type for which an allowable range may be used to prevent unauthorized access to data or instructions. Figure 2 As shown at the top of FIG. 1 , a particular bounded pointer register PR1 includes a given pointer value 62 and range information 64, which in this example is specified using a lower boundary address 68 and an upper boundary address 69, wherein the lower boundary address 68 defines the lower boundary of the allowable range and the upper boundary address 69 defines the upper boundary of the allowable range. For example, the boundaries 68 and 69 are set to define an address range of 80000 to 81000. When certain instructions reference the bounded pointer register PR1 and the address determined from the pointer 62 is outside the range, an error may be triggered.

[0046] For example, Figure 2 As shown in part A of FIG. 6 , in some systems, if an attempt is made to set the value of pointer 62 in pointer register 60 to a value outside the range specified by range information 64 (assuming here that the pointer directly specifies an address), an error may be triggered. This prevents pointer 62 from taking any value outside a specific range, thereby ensuring that any access using the pointer is safely within the permitted range. Optionally, as Figure 2As shown in part B of , when an instruction attempts to access the location identified by the address of pointer 62, an error may be triggered if the address is outside the specified range. Thus, it is still permitted to set pointer 62 to a value outside the specified range, but once a data access is attempted to the pointer address (or an address derived from the pointer), an error may be triggered if the address is outside the permitted range. Other systems may respond to Figure 2 The error is triggered by the two instruction types shown in Part A and Part B.

[0047] The scope information 64 may be set in different ways. For example, security code, or an operating system or hypervisor, may specify the allowed range for a given pointer. For example, an instruction set architecture may include multiple instructions for setting or modifying the scope information 64 for a given pointer 62, and the execution of these instructions may be restricted to certain software or certain modes or exception states of the processor 4. Any known technique for setting or modifying the scope information 64 may be used.

[0048] In addition to the bounded pointer storage element set 60 that may be used at the execution stage 12 when executing certain instructions that reference pointers, a program counter capability (PCC) register 80 may also be used to provide similar functionality at the fetch stage 6 when fetching instructions from the level 1 instruction cache 20. Specifically, the program counter pointer may be stored in field 82, with the PCC 80 also providing range information 84 and any appropriate limit information 86, similar to the range and limit information provided for each pointer in the bounded pointer storage element set 60.

[0049] Figure 3Schematically illustrates how tag bits are used in association with individual data blocks to identify whether the data blocks are to be interpreted according to a first interpretation or a second interpretation. In this example, the first interpretation is that the data blocks are to be interpreted as normal data, and the second interpretation is that the data blocks are to be interpreted as representing capabilities (i.e., bounded pointers and associated restriction information). In particular, the memory address space 110 will store a series of data blocks 115, which will typically have a specified size. For illustrative purposes only, it is assumed in this example that each data block includes 128 bits. Associated with each data block 115, a tag field 120 is provided, which in one example is a single bit field referred to as a tag bit, which is set to identify that the associated data block is to be interpreted as non-data, such as capabilities (i.e., interpreted according to the second interpretation), and is cleared to indicate that the associated data block represents normal data (i.e., interpreted according to the first interpretation). It should be understood that the actual value associated with the set or clear state may vary depending on the implementation, but for illustrative purposes only, in one example, if the value of the tag bit is 1, it indicates that the associated data block is to be interpreted as non-data, while if the value of the tag bit is 0, it indicates that the associated data block contains normal data.

[0050] In this example, the second non-data interpretation is that the data block contains capabilities. When a capability is loaded into one of the bounded pointer registers 60 (also referred to herein as capability registers), for example Figure 3 In the capability register 100 shown, the tag bit is moved together with the capability information. Therefore, when the capability is loaded into the capability register 100, the pointer 102, the range information 104 and the restriction information 106 (hereinafter referred to as the permission information) will be loaded into the capability register. In addition, associated with the capability register, or as a specific bit field therein, the tag bit 108 will be set to identify the content representing the capability. Similarly, when the capability is stored back to the memory, the relevant tag bit 120 is set in association with the data block in which the capability is stored. In this way, capabilities and normal data can be distinguished, and thus it is ensured that normal data cannot be used as capabilities.

[0051] When the tag bits indicate that a given data block represents a capability, the data block can define an action to be performed. In an example, this is encoded within redundant space in the data block. For example, specific data values ​​may not be required to define a capability. These values ​​can then be used to define one or more actions to be performed.

[0052] Figure 4 A method 400 according to an example of the present disclosure is schematically illustrated. The method 400 may be implemented, for example, in a general-purpose processing circuit or in a dedicated circuit specifically configured to implement the method 400.

[0053] At block 405, a data value is retrieved from a memory location of a memory, for example, as described above with respect to Figure 1 as described.

[0054] At block 410, a determination is made as to whether the data value is to be interpreted according to a first interpretation or a second interpretation. As described above, in the example, the first interpretation is that the data value corresponds to data and the second interpretation is that the data value corresponds to a capability. For example, the determination of block 410 may be based on a tag bit associated with the data value, as described above with respect to Figure 3 as described.

[0055] If it is determined at block 410 that the data is to be interpreted according to the second interpretation, flow proceeds to block 415 .

[0056] At block 415, it is determined whether the data value defines an action to be performed. Specific examples of such actions and how they are encoded within the data value are described elsewhere in this disclosure. For example, the action may be an error suppression action.

[0057] If it is determined at block 415 that the data value defines an action to be performed, flow proceeds to block 420 .

[0058] At block 420, an action is performed.

[0059] The method 400 thus provides for interpreting a given data value according to different interpretations, and also provides for triggering the execution of an action according to the data value indicated as corresponding to the second interpretation. For example, as described elsewhere herein, the action to be performed can be defined taking advantage of redundancy, i.e., by utilizing data values ​​that are not required for the second interpretation. In this way, the data processing functionality of the system is increased without requiring additional storage to indicate whether an action is to be performed.

[0060] As described above, the action to be performed may be an error suppression action. For example, the action may include updating a diagnostic record, such as by storing or updating a log file or incrementing a counter. Alternatively or additionally, the action may include returning a data value from a memory location different from the memory location originally accessed. Reference will now be made to Figure 5A-5E Describe an example of this action.

[0061] Figure 5A A memory 500 of a comparison system is schematically shown, wherein the method of the present disclosure is not implemented such that a data value may be interpreted according to a first data interpretation or a second non-data interpretation, but the data value according to the second interpretation does not define an action to be performed.

[0062] Memory 500 includes data values ​​AE in memory locations 505a-505e. Retrieval request 510 is directed to memory location 505c, and data value C is retrieved in retrieval 515.

[0063] Figure 5B The memory 500 is schematically shown after the memory locations 505a-505e have been released.Although the memory locations 505a-505e have been released (indicated by their dashed depiction), the data values ​​AE have not been overwritten, and therefore the memory locations 505a-505e still contain the data values ​​AE.

[0064] Retrieval request 520 points to memory location 505c. If the retrieval request is not blocked (e.g., by a system process that blocks access to freed memory locations), data value C will be retrieved in retrieval 525. In some systems, this behavior is desirable, e.g., to allow execution flow to continue rather than causing a crash.

[0065] Figure 5C Schematically illustrates a memory 530 according to an example of the present disclosure. The memory includes memory locations 535a-535e, which respectively contain data values ​​AE, such that the memory 530 has Figure 5A The same configuration as the memory 500.

[0066] Figure 5D The memory 530 is schematically shown after a first step of a process of freeing memory locations 535a-535e. The contents of the memory locations 535a-535e (ie data values ​​AE) are copied to a different set of memory locations 540a-540e.

[0067] Figure 5E Memory 530 is schematically shown after the process of releasing memory locations 535a-535e is complete.Other data values ​​A2-E2 have been written to memory locations 535a-535e, after which memory locations 535a-535e have been released (indicated by their dashed depictions).

[0068] An indication is stored that the other data values ​​A2-E2 are data values ​​to be interpreted according to the non-data interpretation, for example by means of a tag bit associated with each of the memory locations 535a-535e as described elsewhere herein. In this example, each data value 535a-535e identifies a corresponding memory location 540a-540e to which its original content is copied, and also defines an error suppression action as described elsewhere herein. For example, the corresponding memory location 540a-540e can be identified by means of an offset from the memory location 535a-535e.

[0069] Retrieval request 545 points to released memory location 535c. It is determined that data value C2 does not represent data, but rather identifies corresponding memory location 540c, and an error suppression action is also defined. Based on this, the content of corresponding memory location 540c, i.e., data value C, is identified in identification 550. Data value C is retrieved in retrieval 555, and an error suppression action is performed. In this way, error suppression is defined and performed without preventing the retrieval of data value C. Therefore, the above description of the error suppression action can be used in the same manner as above. Figure 5A-Figure 5B The same approach as described above is performed based on the data value C, while providing the error suppression action to be performed. Thus, the error suppression function can be implemented transparently so that the execution flow is similar to that of a comparison system (such as Figure 5A-Figure 5B Therefore, error suppression can be achieved without negatively affecting the user experience.

[0070] Figure 6 Schematically illustrates a method 600 according to an example of the present disclosure. In this example, a first interpretation of a given data value is its representation data, and a second interpretation is its representation metadata associated with another data value interpreted according to the first interpretation. The method 600 may be implemented, for example, in a general purpose processing circuit or in a dedicated circuit specifically configured to implement the method 600.

[0071] At block 605, a data value is retrieved from a memory location of a memory, for example, as described above with respect to Figure 1 as described.

[0072] At block 610, a determination is made as to whether the data value is to be interpreted according to the first interpretation or according to the second interpretation. For example, the determination of block 610 may be based on a tag bit associated with the data value, as described above with respect to Figure 3 as described.

[0073] If it is determined that the data value is to be interpreted according to the first interpretation, flow proceeds to block 615 where the data value is interpreted as data.

[0074] If it is determined that the data value is to be interpreted according to the second interpretation, the flow proceeds to block 620. At block 620, it is determined whether the data value defines an action to be performed. Specific examples of such actions and encoding them within data values ​​are described elsewhere in this disclosure. For example, the action may be an error suppression action.

[0075] If it is determined that the data value defines an action to be performed, flow proceeds to block 625 where performance of the action is triggered.

[0076] After the action is performed, flow proceeds to block 630. Alternatively, if it is determined at block 620 that the data value does not define an action to be performed, flow proceeds directly to block 630, skipping block 625. At block 630, the data value is interpreted as metadata.

[0077] Figure 7 An apparatus 700 according to an example of the present disclosure is schematically shown. The components of the apparatus may be implemented, for example, as routines within one or more general-purpose processing components, and / or as dedicated circuits.

[0078] The apparatus 700 includes memory access circuitry for retrieving data values ​​from memory locations of the memory 710. The memory 710 may be external to the apparatus 700.

[0079] The device 700 includes an action trigger circuit 715. The action trigger circuit 715 receives a data value from the memory access circuit 705.

[0080] Action trigger circuit 715 includes processing blocks 715a-715c.

[0081] Block 715a directs the action trigger circuit 715 to determine whether the data value is to be interpreted according to the first interpretation or the second interpretation.

[0082] Block 715b causes the action trigger circuit 715 to determine whether the data value defines an action to be performed if the data value is to be interpreted according to the second interpretation.

[0083] Block 715c causes the action trigger circuit 715 to trigger the performance of an action if the data value defines an action to be performed.

[0084] In this way, the apparatus 700 is configured to perform the method of the present disclosure.

[0085] Figure 8The simulator implementation that can be used is shown. Although the previously described embodiments implement the present invention in terms of the apparatus and method for operating the specific processing hardware supporting the relevant technology, it is also possible to provide an instruction execution environment according to the embodiments described herein, which is implemented by using a computer program. Such computer programs are generally referred to as simulators because they provide software-based implementations of hardware architectures. Various simulator computer programs include emulators, virtual machines, models, and binary converters, including dynamic binary converters. Typically, the simulator implementation can be run on a host processor 805, optionally running a host operating system 810 that supports the simulator program 815. In some arrangements, there may be multiple layers of simulation between the hardware and the provided instruction execution environment, and / or multiple different instruction execution environments provided on the same host processor. Historically, powerful processors have been required to provide simulator implementations that are executed at reasonable speeds, but this approach may be reasonable in some cases, such as when it is desired to run another processor local code for compatibility or reuse reasons. For example, a simulator implementation can provide an instruction execution environment with additional functions that are not supported by the host processor hardware, or provide an instruction execution environment that is generally associated with different hardware architectures. An overview of simulation is given in "Some Efficient Architecture Simulation Techniques" (Robert Bedichek, USENIX Conference, Winter 1990, pp. 53-63).

[0086] To the extent that embodiments have been previously described with reference to specific hardware constructs or features, in simulated embodiments, equivalent functionality may be provided by appropriate software constructs or features. For example, specific circuits may be implemented as computer program logic in simulated embodiments. Similarly, memory hardware such as registers or caches may be implemented as software data structures in simulated embodiments. In arrangements where one or more hardware elements referenced in previously described embodiments are present on host hardware (e.g., host processor 805), some simulated embodiments may utilize host hardware where appropriate.

[0087] The simulator program 815 may be stored on a computer-readable storage medium 820 (which may be a non-transitory medium) and provides a program interface (instruction execution environment) to the target code 825 (which may include applications, operating systems, and hypervisors) that is identical to the application program interface of the hardware architecture modeled by the simulator program 815. Therefore, the simulator program 815 may be used to execute program instructions of the target code 825 including the above-mentioned action triggers from within the instruction execution environment, so that the host computer 805 that does not actually have the hardware features of the above-mentioned device 2 can simulate these features. For example, the simulator program 815 may include a memory access program logic 830 for controlling the access of the instructions of the target code 825 to the memory. For example, the memory access program logic 830 may include instructions for requesting data values ​​from a memory location of the memory. In addition, the simulator program 815 may include an action trigger program logic 835, which includes instructions for triggering the execution of an action, as described in more detail with respect to the above method.

[0088] By using the above techniques, it will be appreciated that action triggering functionality can be implemented in a data processing system while avoiding the disadvantages of comparison systems in which data watchpoints and / or address watchpoints are implemented. In addition, the impact on execution flow can be reduced or eliminated.

[0089] The methods described herein may be implemented in hardware and / or software. Such hardware may be a general purpose processor, or a more specific unit such as an application specific integrated circuit or a field programmable gate array.

[0090] Although illustrative examples of the present invention have been described in detail herein with reference to the accompanying drawings, it should be understood that the present invention is not limited to these precise examples and that various changes, additions and modifications may be implemented therein by those skilled in the art without departing from the scope and spirit of the present invention as defined by the appended claims. For example, various combinations of the features of the dependent claims may be made with the features of the independent claims without departing from the scope of the present invention.

Claims

1. A device for triggering an action, include: memory access circuitry for retrieving a data value from a memory location of the memory; as well as Action trigger circuit for: determining whether to interpret the data value according to a first interpretation or a second interpretation different from the first interpretation, wherein the first interpretation is that the data value is data; and When it is determined that the data value is to be interpreted according to the second interpretation: determining whether the data value defines an action to be performed; and When it is determined that the data value defines an action to be performed, execution of the action is triggered.

2. The device according to claim 1, in, The action is an error suppression action.

3. The device according to claim 1 or 2, in, The action includes signaling an exception.

4. The device according to claim 1 or 2, in, The action includes returning a different data value from a different memory location.

5. The device according to claim 1 or 2, in, The action includes updating a diagnostic record.

6. The device according to claim 1 or 2, in, The actions include: determining that a processor operating state associated with the attempted write to the memory location is a prohibited operating state; and In response to determining that the operating state is the prohibited operating state, the attempted write is prohibited.

7. The device according to claim 6, in, The operating state is at least one execution privilege level.

8. The device according to claim 1 or 2, in, The action trigger circuit determines whether to interpret the data value according to the first interpretation or the second interpretation based on a control value associated with the memory location.

9. The device according to claim 8, in, The control value is stored in a control value memory location which is within an area in the memory allocated for control value storage.

10. The device according to claim 8, in, The control value is stored in a control value memory location associated with the memory location.

11. The device according to claim 10, in, The control value memory location is adjacent to the memory location.

12. The device according to claim 1 or 2, in, The action triggering circuit triggers the action when the data value at least partially matches a predefined value of one or more predefined values.

13. The device according to claim 1 or 2, in, The second interpretation is that the data value is metadata related to a data value stored in another memory location different from the memory location, the data value stored in the other memory location being interpreted according to the first interpretation.

14. The device according to claim 13, in: said data value stored in said another memory location comprises a pointer value of a bounded pointer; as well as The metadata includes the bounds of the bounded pointer.

15. The device according to claim 14, in, The action trigger circuit is used for: determining that the pointer value is outside the bounds; and In response to determining that the pointer value is outside of the bounds, an exception is signaled.

16. The device according to claim 13, in, The metadata includes an error correction code associated with the data stored in the another memory location.

17. A method for triggering an action, include: retrieving a data value from a memory location of a memory; determining whether to interpret the data value according to a first interpretation or a second interpretation different from the first interpretation, wherein the first interpretation is that the data value is data; and When it is determined that the data value is to be interpreted according to the second interpretation: determining whether the data value defines an action to be performed; and When it is determined that the data value defines an action to be performed, execution of the action is triggered.

18. A storage medium storing a computer program for controlling a host data processing device, for providing an instruction execution environment for executing instructions of a target program code, include: memory access program logic for requesting a data value from a memory location of the memory; as well as Action triggers program logic for: determining whether to interpret the data value according to a first interpretation or a second interpretation different from the first interpretation, wherein the first interpretation is that the data value is data; and When it is determined that the data value is to be interpreted according to the second interpretation: determining whether the data value defines an action to be performed; and When it is determined that the data value defines an action to be performed, execution of the action is triggered.