Patent ID: 7133975

Claim:
A system comprising: an instruction cache memory configured to store a first plurality of cache lines of data; a lower level cache memory coupled to said instruction cache memory, and configured to store a second plurality of cache lines of data; and a data cache memory coupled to the lower level cache memory, and configured to store a third plurality of cache lines of data; wherein the lower level cache memory further includes: a tag storage configured to store a plurality of tags each corresponding to a respective cache line of said second plurality of cache lines, wherein each of said plurality of tags includes an associated bit and a second associated bit, wherein the associated bit is indicative of whether a copy of said corresponding respective cache line of said second plurality of cache lines is stored within said, instruction cache memory, and the second associated bit is indicative of whether a copy of said corresponding respective cache line of said second plurality of cache lines is stored within said data cache memory; and tag logic coupled to said tag storage and configured to detect a cache request and an eviction notification from said instruction cache memory, and wherein said tag logic is further configured to clear said associated bit in response to detecting said eviction notification; wherein the tag logic is configured to detect sharing of a modified cache line between said instruction cache memory and said data cache memory based upon a state of said associated bit and said second associated bit; wherein the tag logic is configured to detect sharing if, in response to a cache line request for said modified cache line by the data cache memory, said associated bit indicates said modified cache line is stored in said instruction cache memory, and wherein the tag logic is further configured to cause a self-modifying code check to be initiated in response to detecting sharing of the modified cache line between the instruction cache memory and the data cache memory.