IP Library Granted Patent US 9,946,538
Granted Patent B2
US 9,946,538 · App. 14/710,372 · Granted Apr 17, 2018

Method and apparatus for providing hardware support for self-modifying code

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,946,538
App. No.
14/710,372
Granted
Apr 17, 2018
Kind
B2
Abstract

A method and apparatus for providing support for self modifying guest code. The apparatus includes a memory, a hardware buffer, and a processor. The processor is configured to convert guest code to native code and store converted native code equivalent of the guest code into a code cache portion of the processor. The processor is further configured to maintain the hardware buffer configured for tracking respective locations of converted code in a code cache. The hardware buffer is updated based a respective access to a respective location in the memory associated with a respective location of converted code in the code cache. The processor is further configured to perform a request to modify a memory location after accessing the hardware buffer.

Claims (36)

1. An apparatus comprising:

a memory;

a hardware buffer; and

a processor, including a set of cores, wherein the processor is configured to:

convert guest code to native code;

store converted guest code into a code cache portion of the processor;

maintain the hardware buffer configured for tracking respective locations of converted code in a code cache, wherein the hardware buffer is updated based on a respective access to a respective location in the memory associated with a respective location of converted guest code in the code cache; and

perform a request to modify the respective location in the memory associated with the respective access after accessing the hardware buffer, wherein the processor is configured to raise an exception if the request is to modify a location in memory associated with a location in the code cache that comprises converted guest code and wherein the memory comprises a table associated with the hardware buffer for tracking converted code present in the code cache, including tracking modifications to guest code, a type of exception to take in response to modifications to guest code, and whether the guest code has been converted to native code.

2. The apparatus of claim 1 , wherein the hardware buffer is configured to act as a cache of the table associated with the hardware buffer and the hardware buffer comprises a subset of data of the table associated with the hardware buffer.

3. The apparatus of claim 1 , wherein the processor is configured to raise an exception in response to a guest code branch.

4. The apparatus of claim 1 , wherein the request is a store by self modifying code.

5. The apparatus of claim 1 , wherein the request is a direct memory access (DMA) write.

6. The apparatus of claim 1 , wherein the processor comprises the hardware buffer.

7. A system comprising:

a memory, and;

a processor comprising a hardware buffer, a code cache, and a set of cores, wherein the processor is configured to:

convert guest code to native code;

store converted guest code into a code cache in the processor; and

maintain the hardware buffer configured for tracking respective locations of converted code in a code cache, wherein the hardware buffer is updated based on a respective access to a respective location in the memory associated with a respective location of converted guest code in the code cache; maintain a table associated with the hardware buffer for tracking converted code present in the code cache, wherein the memory comprises the table associated with the hardware buffer; and

perform a request to modify the respective location in the memory associated with the respective access after accessing the hardware buffer, wherein the processor is configured to raise an exception if the request is to modify a location in memory associated with a location in the code cache that comprises converted guest code and wherein the memory comprises a table associated with the hardware buffer for tracking converted code present in the code cache, including tracking modifications to guest code, a type of exception to take in response to modifications to guest code, and whether the guest code has been converted to native code.

8. The system of claim 7 , wherein the hardware buffer is configured to act as a cache of the table associated with the hardware buffer and the hardware buffer comprises a subset of data of the table associated with the hardware buffer.

9. The apparatus of claim 7 , wherein the processor is configured to raise an exception in response to a guest code branch.

10. The apparatus of claim 7 , wherein the request is a store by self modifying code.

11. The apparatus of claim 7 , wherein the request is a direct memory access (DMA) write.

12. A system for converting guest code, the system comprising:

a memory, and;

a processor comprising a hardware buffer, a code cache, and a set of cores, wherein the processor is configured to:

convert guest code to native code;

store converted guest code into a code cache in the processor; and

maintain the hardware buffer configured for tracking respective locations of converted code in a code cache, wherein the hardware buffer is updated based on a respective access to a respective location in the memory associated with a respective location of converted guest code in the code cache, and wherein the hardware buffer is updated in response to self modifying code;

maintain a table associated with the hardware buffer for tracking converted code present in the code cache, wherein the memory comprises the table associated with the hardware buffer; and

perform a request to modify the respective location in the memory associated with the respective access after accessing the hardware buffer wherein the processor is configured to raise an exception if the request is to modify a location in memory associated with a location in the code cache that comprises converted guest code and wherein the memory comprises a table associated with the hardware buffer for tracking converted code present in the code cache, including tracking modifications to guest code, a type of exception to take in response to modifications to guest code, and whether the guest code has been converted to native code.

13. The system of claim 12 , wherein the hardware buffer is configured to act as a cache of the table associated with the hardware buffer and the hardware buffer comprises a subset of data of the table associated with the hardware buffer.

14. The system of claim 12 , wherein the processor is configured to raise an exception in response to a guest code branch.

15. The system of claim 12 , wherein the request is a store.

16. The system of claim 12 , wherein the request is a direct memory access (DMA) write.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 14, 2016
From: SOFT MACHINES, INC.
To: INTEL CORPORATION
Reel/Frame 040631/0915 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 20, 2016
From: ABDALLAH, MOHAMMAD; AVUDAIYAPPAN, KARTHIKEYAN
To: SOFT MACHINES, INC.
Reel/Frame 040080/0909 →