IP Library › Granted Patent US 12,306,757
Granted Patent B2
US 12,306,757 · App. 17/921,063 · Granted May 20, 2025

Recording a cache coherency protocol trace for use with a separate memory value trace

Inventor: Jordi Mola (Bellevue, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F12/0815G06F11/3471G06F2201/885G06F2212/1016G06F2212/1052
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 12,306,757
App. No.
17/921,063
Filed
Oct 24, 2022
Granted
May 20, 2025
Kind
B2
Art Unit
2114
USPC
714/42
Abstract

A processor that performs cache-based tracing based on recording one or more cache coherency protocol (CCP) messages into a first trace. Based on detecting a memory access to a target memory address, the processor logs into the first trace information usable to obtain a memory value corresponding to the particular memory address from the memory snapshot(s) stored within the second trace. This includes logging the particular memory address, as well as CCP message(s) indicating at least of: (i) that none of a plurality of processing units possessed a first cache line within the cache that overlaps with the target memory address; (ii) that a first processing unit initiated a cache miss for the target memory address; or (iii) that the first processing unit obtained, from a second processing, a second cache line within the cache that overlaps with the target memory address.

Claims (51)

1. A processor configured to participate in recording a replayable execution trace based on recording one or more cache coherency protocol (CCP) messages into a first trace, the CCP messages being usable to obtain memory values from one or more memory snapshots stored within a second trace, the processor comprising:

a plurality of processing units;

a cache; and

control logic that causes the processor to at least:

detect a memory access by a first processing unit of the plurality of processing units, the memory access being targeted at a particular memory address during execution of an execution context; and

based on detecting the memory access,

determine that logging is enabled for a memory region corresponding to the particular memory address;

based on logging being enabled for the memory region, determine to log information usable to obtain a memory value corresponding to the particular memory address from the one or more memory snapshots stored within the second trace; and

log, into the first trace, the information usable to obtain the memory value corresponding to the particular memory address from the one or more memory snapshots stored within the second trace, including logging the particular memory address and at least one of:

a first CCP message indicating that none of the plurality of processing units possessed a first cache line within the cache that overlaps with the particular memory address;

a second CCP message indicating that the first processing unit initiated a cache miss for the particular memory address; or

a third CCP message indicating that the first processing unit obtained, from a second processing unit of the plurality of processing units, a second cache line within the cache that overlaps with the particular memory address.

2. The processor of claim 1 , wherein the control logic causes the processor to log the first CCP message indicating that none of the plurality of processing units possessed the first cache line within the cache that overlaps with the particular memory address.

3. The processor of claim 1 , wherein the control logic causes the processor to log the second CCP message indicating that the first processing unit initiated the cache miss for the particular memory address.

4. The processor of claim 1 , wherein the control logic causes the processor to log the third CCP message indicating that the first processing unit obtained, from the second processing unit, the second cache line within the cache that overlaps with the particular memory address.

5. The processor of claim 1 , wherein the control logic also causes the processor to log, into the first trace, one or more CCP messages indicating that one or more of the plurality of processing units caused one or more evictions from the cache.

6. The processor of claim 1 , wherein the memory access comprises a first memory access, and wherein the control logic also causes the processor to:

detect a second memory access during execution of the execution context;

determine that the second memory access is a read that is targeted to an uncached memory location; and

based on the second memory access being the read that is targeted to the uncached memory location, log at least a value read by the second memory access.

7. The processor of claim 6 , wherein the first trace comprises a first trace data stream, and wherein logging the value read by the second memory access comprises at least one of (i) logging the value into an encrypted second trace data stream, or encrypting the value within the first trace data stream.

8. The processor of claim 1 , wherein the control logic also causes the processor to log, into the first trace, a side-effect of execution of at least one non-deterministic processor instruction of the execution context.

9. The processor of claim 1 , wherein the control logic also causes the processor to determine that logging is enabled for the execution context, and wherein the processor logs the information usable to obtain the memory value corresponding to the particular memory address from the one or more memory snapshots stored within the second trace based at least on logging being enabled for the execution context.

10. The processor of claim 1 , wherein the execution context comprises a first execution context, and wherein, based at least on a second execution context initiating a write into a memory space of the first execution context, the control logic also causes the processor to perform at least one of:

log at least one of a memory address or a value of the write;

evict a cache line overlapping with the memory address of the write;

mark a memory page corresponding to the memory address of the write as needing to be logged; or

initiate a trap handler that logs the memory page corresponding to the memory address.

11. The processor of claim 10 , wherein the control logic causes the processor to log the value of the write, wherein the first trace comprises a first trace data stream, and wherein logging the value of the write comprises at least one of (i) logging the value of the write into an encrypted second trace data stream, or encrypting the value of the write within the first trace data stream.

12. The processor of claim 1 , wherein the control logic also causes the processor to enable trace recording for the execution context.

13. The processor of claim 12 , wherein the control logic also causes the processor to flush, from the cache, at least one cache line that overlaps with a memory space of the execution context in connection with enabling trace recording for the execution context.

14. The processor of claim 1 , wherein the memory access comprises a first memory access, and wherein the control logic also causes the processor to:

detect a third memory access during execution of the execution context;

determine that the third memory access is targeted to a read-only memory location; and

based on the third memory access being targeted to a read-only memory location, refrain from logging a CCP message or an uncached read for the third memory access.

15. The processor of claim 1 , wherein,

determining that logging is enabled for the memory region comprises determining that the memory region associated is tagged to be logged; and

determining that the memory region associated is tagged to be logged comprises identifying one or more of a flag in a page table entry or a page directory entry, a mapping stored in a data structure in a system memory, or a mapping stored in a register of the processor.

16. A method, implemented at a processor that includes a plurality of processing units and a cache, for participating in recording a replayable execution trace based on recording one or more cache coherency protocol (CCP) messages into a first trace, the CCP messages being usable to obtain memory values from one or more memory snapshots stored within a second trace, the method comprising:

detecting a memory access by a first processing unit of the plurality of processing units, the memory access being targeted at a particular memory address during execution of an execution context; and

based on detecting the memory access,

determining that logging is enabled for a memory region corresponding to the particular memory address;

based on logging being enabled for the memory region, determining to log information usable to obtain a memory value corresponding to the particular memory address from the one or more memory snapshots stored within the second trace; and

logging, into the first trace, the information usable to obtain the memory value corresponding to the particular memory address from the one or more memory snapshots stored within the second trace, including logging the particular memory address and at least one of:

a first CCP message indicating that none of the plurality of processing units possessed a first cache line within the cache that overlaps with the particular memory address;

a second CCP message indicating that the first processing unit initiated a cache miss for the particular memory address; or

a third CCP message indicating that the first processing unit obtained, from a second processing unit of the plurality of processing units, a second cache line within the cache that overlaps with the particular memory address.

17. The method of claim 16 , wherein the method comprises logging the first CCP message indicating that none of the plurality of processing units possessed the first cache line within the cache that overlaps with the particular memory address.

18. The method of claim 16 , wherein the method comprises logging the second CCP message indicating that the first processing unit initiated the cache miss for the particular memory address.

19. The method of claim 16 , wherein the method comprises logging the third CCP message indicating that the first processing unit obtained, from the second processing unit, the second cache line within the cache that overlaps with the particular memory address.

20. The method of claim 16 , further comprising logging, into the first trace, one or more CCP messages indicating that one or more of the plurality of processing units caused one or more evictions from the cache.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 24, 2022
From: MOLA, JORDI
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 061519/0663 →
Priority Claims (1)
LU LU101768 · May 5, 2020 · national
Continuity (1)
Related Publication 20230176971A1 · Jun 8, 2023
References Cited (64)
US 8051247B1 · Favor · 2011 [cited by applicant]
US 8370576B1 · Favor · 2013 [cited by applicant]
US 8370609B1 · Favor · 2013 [cited by applicant]
US 8487895B1 · Brown · 2013 [cited by applicant]
US 9195593B1 · Radovic · 2015 [cited by applicant]
US 9432298B1 · Smith · 2016 [cited by applicant]
US 9471313B1 · Busaba · 2016 [cited by applicant]
US 9934127B1 · Mola et al. · 2018 [cited by applicant]
US 9973465B1 · Linkous · 2018 [cited by applicant]
US 9996287B2 · Dornemann · 2018 [cited by applicant]
US 10089230B1 · Koker · 2018 [cited by applicant]
US 10635555B2 · Grosser · 2020 [cited by applicant]
US 11405189B1 · Bennison · 2022 [cited by applicant]
US 11474871B1 · Mittal · 2022 [cited by applicant]
US 12079155B2 · Ray · 2024 [cited by applicant]
US 20020073063A1 · Faraj · 2002 [cited by applicant]
US 20140112339A1 · Safranek et al. · 2014 [cited by applicant]
US 20160239431A1 · Li · 2016 [cited by applicant]
US 20180060215A1 · Mola · 2018 [cited by examiner]
US 20180101483A1 · Catthoor · 2018 [cited by applicant]
US 20180113806A1 · Mola · 2018 [cited by applicant]
US 20180113809A1 · Mola · 2018 [cited by applicant]
US 20180165199A1 · Brandt · 2018 [cited by examiner]
US 20190065339A1 · Mola · 2019 [cited by examiner]
US 20190087305A1 · Mola · 2019 [cited by examiner]
US 20190180407A1 · Goossen et al. · 2019 [cited by applicant]
US 20190220403A1 · Mola · 2019 [cited by examiner]
US 20190258556A1 · Mola · 2019 [cited by examiner]
US 20190266090A1 · Mola · 2019 [cited by examiner]
US 20190286549A1 · Mola · 2019 [cited by examiner]
US 20200026639A1 · Mola · 2020 [cited by examiner]
US 20200349051A1 · Mola · 2020 [cited by examiner]
US 20230169010A1 · Mola · 2023 [cited by applicant]
US 20230176971A1 · Mola · 2023 [cited by examiner]
US 20230342282A1 · Mola · 2023 [cited by examiner]
US 20230350804A1 · Mola · 2023 [cited by examiner]
US 20240095187A1 · Mola · 2024 [cited by examiner]
Notice of Allowance mailed on Dec. 20, 2023, in U.S. Appl. No. 17/921,053, 13 pages. [cited by applicant]
Feldman, et al., “Igor: A System for Program Debugging via Reversible Execution”, In Proceedings of ACM SIGPLAN and SIGOPS Workshop on Parallel and Distributed Debugging, Nov. 1, 1988., pp. 112-123. [cited by applicant]
“Search Report and Written Opinion Issued in Luxembourg Patent Application No. LU101767”, Mailed Date: Feb. 26, 2021, 13 Pages. [cited by applicant]
“Search Report and Written Opinion Issued in Luxembourg Patent Application No. LU101768”, Mailed Date : Feb. 10, 2021, 11 Pages. [cited by applicant]
“Search Report and Written Opinion Issued in Luxembourg Patent Application No. LU101769”, Mailed Date: Feb. 5, 2021, 12 Pages. [cited by applicant]
“Search Report and Written Opinion Issued in Luxembourg Application No. LU101770”, Mailed Date: Feb. 5, 2021, 12 Pages. [cited by applicant]
“International Search Report & Written Opinion issued in PCT Application No. PCT/US21/030199”, Mailed Date: Aug. 27, 2021, 15 Pages. [cited by applicant]
“International Search Report & Written Opinion issued in PCT Application No. PCT/US21/030220”, Mailed Date: Aug. 25, 2021, 16 Pages. [cited by applicant]
“International Search Report and Written Openion Issued in PCT Application No. PCT/US21/030222”, Mailed Date : Oct. 8, 2021, 18 Pages. [cited by applicant]
“Invitation to Pay Additional Fees Issued in PCT Application No. PCT/US21/030222”, Mailed Date: Aug. 12, 2021, 14 Pages. [cited by applicant]
“International Search Report and Written Opinion Issued in PCT Application No. PCT/US21/030552”, Mailed Date: Feb. 24, 2022, 20 Pages. [cited by applicant]
Basu, et al., “Software Assisted Hardware Cache Coherence for Heterogeneous Processors”, Proceedings of the Second International Symposium on Memory Systems, Oct. 3, 2016, pp. 279-288. [cited by applicant]
Kaushik, et al., “Designing Predictable Cache Coherence Protocols for Multi-Core Real-Time Systems”, IEEE Transactions on Computers, vol. 70, Issue 12, Nov. 12, 2020, pp. 2098-2111. [cited by applicant]
Non-Final Office Action mailed on Apr. 15, 2024, in U.S. Appl. No. 17/921,067, 21 pages. [cited by applicant]
U.S. Appl. No. 17/921,053, filed May 4, 2021. [cited by applicant]
U.S. Appl. No. 17/921,048, filed Apr. 30, 2021. [cited by applicant]
U.S. Appl. No. 17/921,067, filed Apr. 30, 2021. [cited by applicant]
U.S. Appl. No. 18/895,877, filed Sep. 25, 2024. [cited by applicant]
Ciriani et al, “Combining Fragmentation and Encryption to Protect Privacy in Data Storage”, ACM Transactions on Information and System Security, vol. 13, Issue No. 1, 2010, pp. 1-33. [cited by applicant]
Luo, et al, “Public Trace-and-Revoke Proxy Re-Encryption for Secure Data Shring in Clouds”, IEEE Transactions on Information Forensics and Security, vol. 19, 2024, pp. 2919-2934. [cited by applicant]
Lyu, et al, “Directed Test Generation for Validation of Cache Coherence Protocols”, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 38, Issue No. 1, 2019, pp. 163-176. [cited by applicant]
Notice of Allowance mailed on Sep. 17, 2024, in U.S. Appl. No. 17/921,067, 13 pages. [cited by applicant]
Zakharov et al, “Time-dependent differential privacy for enhanced data protection in synthetic transaction generation”, Proceedings of the 2024 13th International Conference on Software and Computer Applications, 2024, … [cited by applicant]
Dunlap, et al., “ReVirt: Enabling intrusion analysis through virtual-machine logging and replay,” ACM SIGOPS Operating Systems Review 36.SI, 2002, pp. 211-224. [cited by applicant]
Lee, at al., “Design of flash-based DBMS: an in-page logging approach,” Proceedings of the 2007 ACM SIGMOD international conference on Management of data, 2007, pp. 55-66. [cited by applicant]
Notice of Allowance mailed on Jun. 26, 2024, in U.S. Appl. No. 17/921,048, 12 pages. [cited by applicant]
Polyn, et al., “Category-specific cortical activity precedes retrieval during memory search” Science, vol. 310, Issue No. 5756, Dec. 23, 2005, pp. 1963-1966. [cited by applicant]