KR100916550B1 - method for proventing damage of instruction cache memory by malicious code - Google Patents
method for proventing damage of instruction cache memory by malicious code Download PDFInfo
- Publication number
- KR100916550B1 KR100916550B1 KR1020070100704A KR20070100704A KR100916550B1 KR 100916550 B1 KR100916550 B1 KR 100916550B1 KR 1020070100704 A KR1020070100704 A KR 1020070100704A KR 20070100704 A KR20070100704 A KR 20070100704A KR 100916550 B1 KR100916550 B1 KR 100916550B1
- Authority
- KR
- South Korea
- Prior art keywords
- cache memory
- instruction
- instruction cache
- malicious code
- hot spot
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/52—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
본 발명은 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 관한 것으로, 특히 명령어 캐쉬메모리에 핫스팟(hot spot)이 감지된 경우에는 명령어 반입 사이클 사이에 버블(bubble) 사이클을 삽입하거나, 복수 사이클 동안 명령어 반입을 중지함으로써, 명령어 캐쉬메모리의 온도 상승을 방지하는데 적당하도록 한 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 관한 것이다.The present invention relates to a method of preventing damage to the instruction cache memory due to malicious code. In particular, when a hot spot is detected in the instruction cache memory, a bubble cycle is inserted between the instruction fetch cycles or multiple cycles. The present invention relates to a method of preventing damage to the instruction cache memory by malicious code, which is suitable for preventing the temperature of the instruction cache memory by stopping the instruction import.
본 발명인 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법을 이루는 구성수단은, 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 있어서, 캐쉬 컨트롤러가 명령어 캐쉬 메모리를 구성하는 각각의 인스트럭션 비트셀 어레이에서 악의적인 코드에 의한 핫스팟이 발생하는지를 감지하는 단계, 상기 핫스팟이 감지된 경우에는 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬 메모리의 접근을 변경하거나 중지시키는 단계를 포함하여 이루어진 것을 특징으로 한다.The constituent means of the method of preventing damage to the instruction cache memory by the malicious code of the present invention is a method of preventing the damage of the instruction cache memory by the malicious code, wherein each instruction bit cell array in which the cache controller constitutes the instruction cache memory is used. Detecting whether a hot spot occurs due to a malicious code, and if the hot spot is detected, the cache controller changes or suspends access to the instruction cache memory.
명령어, 캐쉬메모리, 온도, 핫스팟 Instruction, Cache Memory, Temperature, Hot Spot
Description
본 발명은 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 관한 것으로, 특히 명령어 캐쉬메모리에 핫스팟(hot spot)이 감지된 경우에는 명령어 반입 사이클 사이에 버블(bubble) 사이클을 삽입하거나, 복수 사이클 동안 명령어 반입을 중지함으로써, 명령어 캐쉬메모리의 온도 상승을 방지하는데 적당하도록 한 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 관한 것이다.The present invention relates to a method of preventing damage to the instruction cache memory due to malicious code. In particular, when a hot spot is detected in the instruction cache memory, a bubble cycle is inserted between the instruction fetch cycles or multiple cycles. The present invention relates to a method of preventing damage to the instruction cache memory by malicious code, which is suitable for preventing the temperature of the instruction cache memory by stopping the instruction import.
캐쉬메모리(cache memory)는 컴퓨터 속에 장착해 속도를 빠르게 하는 임시메모리이다. 컴퓨터의 속도를 이야기할 때에는 일반적으로 CPU(중앙처리장치)의 속도를 이야기한다. 이는 CPU의 속도에 의해 컴퓨터의 속도가 결정될 정도로 CPU에 비해 상대적으로 주변기기의 속도가 매우 느리다는 것을 나타낸다. Cache memory is temporary memory that is installed in a computer to speed up. When we talk about the speed of a computer, we usually talk about the speed of a central processing unit (CPU). This indicates that the peripherals are very slow compared to the CPU so that the speed of the computer is determined by the speed of the CPU.
이러한 문제점을 해결하기 위하여 주변기기의 속도를 빠르게 하는 대표적인 방법이 캐시메모리이다. 램캐시(외부캐시), 내부캐시, 디스크캐시 등 여러 종류의 캐시가 있다. In order to solve this problem, a representative method of speeding up a peripheral device is a cache memory. There are several types of caches, including RAM cache (external cache), internal cache, and disk cache.
하드디스크의 속도는 램보다 매우 느리다. 매번 프로그램을 실행시킬 때마다 디스크를 읽어야 하므로 속도가 느릴 수밖에 없다. 따라서 램과 디스크 사이에 일정량의 임시메모리를 만들고 처음 프로그램을 실행할 때 램으로 들어오는 내용을 그 임시메모리에도 보관한다. 그런 다음 프로그램을 실행시키면 하드디스크가 아닌 임시메모리에서 읽어오게 되기 때문에 읽어오는 시간이 매우 빨라지게 된다. 이 임시메모리를 캐시메모리라고 한다. Hard disks are much slower than RAM. Every time you run the program, you have to read the disk, which is slow. Therefore, a certain amount of temporary memory is created between RAM and disk, and the contents of RAM are stored in temporary memory when the program is first executed. Then, when you run the program, it reads from the temporary memory instead of the hard disk, which makes the reading time very fast. This temporary memory is called cache memory.
요즘에는 PC(퍼스널컴퓨터)에서도 사용되며, 수 10메가바이트의 주기억장치에 대해 수 10킬로바이트의 캐시메모리를 갖추고 있다. 캐시메모리를 내부에 장착한 마이크로 프로세서도 나왔다. 펜티엄컴퓨터는 CPU 내부의 캐시를 두 개로 늘렸는데, 각각은 명령처리를 위한 캐시와 데이터처리를 위한 캐시이다. 이로 인해 CPU의 속도가 훨씬 빨라졌다.Nowadays, it is also used in PCs (personal computers) and has several ten kilobytes of cache memory for several ten megabytes of main memory. There is also a microprocessor with a cache memory inside. The Pentium computer increased the cache inside the CPU to two, each with a cache for instruction processing and a cache for data processing. This made the CPU much faster.
더욱 상세하게 캐쉬메모리는 처리속도가 엄청 빠른 CPU와 처리속도가 상대적으로 엄청 느린 HDD또는 주 메모리 등간의 속도완충장치의 역할을 하는 SRAM으로 구성된 메모리를 말한다.More specifically, the cache memory refers to a memory composed of an SRAM that acts as a speed buffer device between an extremely fast CPU and an extremely slow HDD or main memory.
주 메모리에서 일단 캐쉬메모리로 정보를 전송받고 캐쉬메모리가 CPU와 정보를 주고받는 일이 동시에 이루어지면서 데이터 대기 시간을 최소롤 줄여서 전체 시스템 속도를 향상시킨다. 따라서 CPU를 높이는 것보다 캐쉬메모리를 좀더 용량이 큰 것으로 업그레이드 하는게 속도 향상에 더 도움이 된다. Once information is transferred from main memory to cache memory, and the cache memory exchanges information with the CPU at the same time, it minimizes data latency and improves overall system speed. Therefore, upgrading the cache memory to a larger capacity rather than increasing the CPU helps to speed up.
캐쉬 메모리에는 1차(L1), 2차(L2)캐쉬로 나뉘는데, L1(1차)캐쉬는 CPU내부에 내장되어 있는 메모리로 CPU내부 클럭 주파수에 의해 빠르게 동작하고 L2(2차) 캐쉬는 메인보드에서 지원되는 메모리로 외부 클럭 주파수에 의해 느리게 동작했었다. 하지만 펜티엄 프로부터는 L2캐쉬도 CPU에 내장이되어 빠른 속도로 동작하게 되었다. 펜티엄은 16[KB], 펜티엄 MMX 32[KB]의 L1 캐쉬를 갖고 있고, 펜티엄 프로는 256 ~ 512[KB]와 펜티엄 2 는 512[KB]의 L2 캐쉬를 갖고 있다. 셀러론은 펜티엄 2에서 바로 이 L2 캐쉬만을 없앤 것이다. 그리고 셀러론 A 는 이 L2캐쉬 메모리의 용량을 대폭 줄여 출시한 CPU를 말한다. The cache memory is divided into primary (L1) and secondary (L2) caches. The L1 (primary) cache is a memory that is built in the CPU and operates quickly by the clock frequency of the CPU. The memory supported by the board was running slowly by the external clock frequency. But from the Pentium P, the L2 cache was also built into the CPU, which made it run fast. The Pentium has an L1 cache of 16 [KB], a Pentium MMX 32 [KB], the Pentium Pro has a 256-512 [KB], and the Pentium 2 has a L2 cache of 512 [KB]. Celeron removed just this L2 cache from the Pentium 2. And Celeron A is a CPU that has released a significantly reduced capacity of this L2 cache memory.
그런데, 상기와 같은 캐쉬메모리는 너무 많은 접근이 발생하거나 컴퓨터 상에서 악의적인 코드가 실행되는 경우 온도가 높아져 타버리는 일이 발생할 수 있다. 따라서, 누군가가 일부러 악의적인 코드를 실행시킨다면 충분히 캐시메모리의 온도를 높일 수 있고, 결과적으로 캐쉬메모리가 타버릴 수 있게 된다.However, such a cache memory may be burned up due to a high temperature when too many accesses or malicious code is executed on a computer. Thus, if someone deliberately executes malicious code, it can raise the temperature of the cache memory sufficiently, resulting in the cache memory being burned out.
마이크로프로세서 안에 일반적으로 널리 알려져 있는 뜨거운 유닛이 악의적인 코드에 의하여 공격당할 경우에는, 마이크로프로세서 안에 설치되어 있는 온도 센서가 상기 뜨거운 유닛이 뜨거워지는 것을 감지하여 DTM(dynamic thermal management)을 실행시킨다. 그러면, 마이크로프로세서의 전체적인 온도가 내려가면서 악의적인 코드는 효과를 발휘하지 못하게 된다.When a hot unit, generally known in a microprocessor, is attacked by malicious code, a temperature sensor installed in the microprocessor senses that the hot unit is hot and performs dynamic thermal management (DTM). Then, as the overall temperature of the microprocessor decreases, the malicious code becomes ineffective.
그러나, 명령어 캐쉬 메모리와 같은 일반적으로 차가운 유닛에 대하여 악의적인 코드가 공격하는 경우에는, 상기 뜨거운 유닛에 설치되어 있는 온도 센서에 의하여 탐지되지 않기 때문에 물리적인 타격을 받을 수 있고, 심지어는 상기 명령어 캐쉬 메모리와 같은 일반적으로 차가운 유닛이 타버릴 수 있다.However, if malicious code attacks a generally cold unit such as an instruction cache memory, it can be physically damaged because it is not detected by the temperature sensor installed in the hot unit, even the instruction cache. Commonly cold units such as memory can burn out.
따라서, 상기 명령어 캐쉬 메모리와 같은 일반적으로 차가운 유닛이 악의적 인 코드에 의하여 물리적인 손상을 받거나 타버리는 일이 발생하지 않도록 대처 방안을 제시할 필요가 있다. 그러나 현재까지 악의적인 코드에 의하여 캐쉬메모리와 같은 차가운 유닛이 공격당하는 것을 방지하는 대책을 마련하지 못하고 있는 실정이다.Therefore, it is necessary to provide a countermeasure to prevent a general cold unit such as the instruction cache memory from being physically damaged or burned out by malicious code. However, until now, it has not been prepared to prevent a cold unit such as cache memory from being attacked by malicious code.
본 발명은 상기와 같은 종래 기술의 문제점을 해결하기 위하여 창안된 것으로, 명령어 캐쉬메모리에 핫스팟(hot spot)이 감지된 경우에는 명령어 반입 사이클 사이에 버블(bubble) 사이클을 삽입하거나, 복수 사이클 동안 명령어 반입을 중지함으로써, 명령어 캐쉬메모리의 온도 상승을 방지하는데 적당하도록 한 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법을 제공하는 것을 그 목적으로 한다.The present invention was devised to solve the above-mentioned problems of the prior art, and when a hot spot is detected in the instruction cache memory, a bubble cycle is inserted between the instruction fetch cycles, or the instruction for a plurality of cycles. It is an object of the present invention to provide a method for preventing damage to the instruction cache memory by malicious code, which is suitable for preventing the temperature of the instruction cache memory by stopping the import.
상기와 같은 과제를 해결하기 위하여 제안된 본 발명인 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법을 이루는 구성수단은, 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 있어서, 캐쉬 컨트롤러가 명령어 캐쉬 메모리를 구성하는 각각의 인스트럭션 비트셀 어레이에서 악의적인 코드에 의한 핫스팟이 발생하는지를 감지하는 단계, 상기 핫스팟이 감지된 경우에는 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬 메모리의 접근을 변경하거나 중지시키는 단계를 포함하여 이루어진 것을 특징으로 한다.In order to solve the above problems, the constituent means of the method of preventing damage to the instruction cache memory by the malicious code, which is proposed in the present invention, in the method of preventing the damage of the instruction cache memory by the malicious code, the cache controller is the instruction cache Detecting whether a hot spot occurs due to malicious code in each instruction bit cell array constituting the memory; and if the hot spot is detected, the cache controller changes or stops access to the instruction cache memory. Characterized in that made.
또한, 상기 핫스팟이 발생하는지를 감지하는 단계는, 기준 사이클 동안 상기 각각의 인스트럭션 비트셀 어레이의 접근 횟수를 카운팅하는 과정, 상기 기준 사이클 동안 상기 접근 횟수가 임계값 이상인 인스트럭션 비트셀 어레이가 하나라도 존 재하는가 판단하는 과정, 상기 접근 횟수가 임계값 이상인 인스트럭션 비트셀 어레이가 하나라도 존재하는 경우에 핫스팟이 발생하는 것으로 간주하는 과정을 포함하여 이루어진 것을 특징으로 한다.The detecting of whether the hot spot occurs may include: counting the number of accesses of each instruction bit cell array during a reference cycle, and even if there is one instruction bit cell array in which the access count is greater than or equal to a threshold value during the reference cycle. And determining whether a hot spot occurs when at least one instruction bit cell array in which the number of accesses is greater than or equal to a threshold exists.
또한, 상기 핫스팟이 발생하는지를 감지하는 단계는, 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬메모리에 접근하는 코드의 패턴이 사전에 저장되어 있는 악의적인 코드의 패턴과 동일한지 판단하는 과정, 상기 판단결과, 동일한 경우로 판단한 경우에는 악의적인 코드가 접근하여 핫스팟이 발생하는 것으로 간주하는 과정을 포함하여 이루어진 것을 특징으로 한다.The detecting of the hot spot may include: determining, by the cache controller, whether a pattern of code accessing the instruction cache memory is the same as a pattern of malicious code stored in advance; If it is determined that the malicious code is approaching characterized in that it comprises a process that is considered to occur as a hot spot occurs.
또한, 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬 메모리의 접근을 변경하는 단계는, 상기 기준 사이클 동안 상기 명령어 캐쉬메모리를 접근할 때마다 상기 캐쉬 컨트롤러가 버블(bubble) 사이클을 삽입하여 상기 명령어 캐쉬메모리의 접근을 제어하는 것을 특징으로 한다.In addition, when the cache controller changes the access of the instruction cache memory, the cache controller inserts a bubble cycle to access the instruction cache memory whenever the cache accesses the instruction cache memory during the reference cycle. It is characterized by controlling.
또한, 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬 메모리의 접근을 중지하는 단계는, 상기 기준 사이클 동안 상기 명령어 캐쉬메모리의 접근을 중지하도록 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬메모리의 접근을 제어하는 것을 특징으로 한다.The step of stopping the access of the instruction cache memory by the cache controller may be characterized in that the cache controller controls the access of the instruction cache memory to stop the access of the instruction cache memory during the reference cycle.
상기와 같은 과제 및 해결 수단을 가지는 본 발명인 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 의하면, 명령어 캐쉬메모리에 핫스팟(hot spot)이 감지된 경우에는 명령어 반입 사이클 사이에 버블(bubble) 사이클을 삽입 하거나, 복수 사이클 동안 명령어 반입을 중지할 수 있기 때문에, 명령어 캐쉬메모리의 온도 상승을 방지할 수 있고, 결과적으로 상기 명령어 캐쉬메모리가 손상되는 것을 방지할 수 있는 효과가 있다.According to the method of preventing damage to the instruction cache memory by the malicious code of the present invention having the above problems and solving means, when a hot spot is detected in the instruction cache memory (bubble cycle) between instruction import cycles Since it is possible to insert or to stop the instruction fetch for a plurality of cycles, the temperature rise of the instruction cache memory can be prevented, and as a result, the instruction cache memory can be prevented from being damaged.
이하, 도면을 참조하여 상기와 같은 구성수단 및 효과를 가지는 본 발명인 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 관한 바람직한 실시예를 상세하게 설명한다.Hereinafter, with reference to the drawings will be described in detail a preferred embodiment of the method for preventing damage to the instruction cache memory by the malicious code having the above configuration means and effects.
도 1은 본 발명에 따른 명령어 캐쉬메모리 구조의 예시도이다. 1 is an exemplary diagram of an instruction cache memory structure according to the present invention.
도 1에 도시된 바와 같이, 명령어 캐쉬메모리 구조는 복수개의 인스트럭션 비트셀 어레이(instruction bit-cell array)로 구성된다. 상기 각각의 인스트럭션 비트셀 어레이(instruction bit-cell array)들은 다른 유닛들에 의하여 접근되어진다. 도 1에서는 8개의 인스트럭션 비트셀 어레이(instruction bit-cell array)가 상기 명령어 캐쉬메모리를 구성하는 것으로 예시하였지만, 이는 당연히 변경될 수 있다.As shown in FIG. 1, the instruction cache memory structure includes a plurality of instruction bit-cell arrays. Each of the instruction bit-cell arrays is accessed by other units. In FIG. 1, eight instruction bit-cell arrays are illustrated as constituting the instruction cache memory. However, this may be changed.
상기 인스트럭션 비트셀 어레이(instruction bit-cell array)들이 정상적인 코드에 의하여 접근되어지는 경우에는 문제가 없지만, 악의적인 코드에 의하여 접근되어지는 경우에는 상기 인스트럭션 비트셀 어레이(instruction bit-cell array)를 구성하는 명령어 캐쉬메모리의 온도가 높아지고, 결국 타버리는 상태까지 진전될 수 있다.When the instruction bit-cell arrays are accessed by normal code, there is no problem, but when the instruction bit-cell arrays are accessed by malicious code, the instruction bit-cell array is configured. Instruction cache memory temperature increases, and eventually burns out.
따라서, 상기 명령어 캐쉬메모리는 악의적인 코드에 의하여 공격을 받고 있는지를 확인할 필요가 있고, 또한 공격을 받는 경우에 공격에 의한 손상을 방지할 수 있도록 하여야 한다.Therefore, the instruction cache memory needs to confirm whether it is under attack by malicious code, and in order to prevent damage caused by an attack when under attack.
도 2는 본 발명에 따라, 악의적인 코드에 의한 명령어 캐쉬메모리의 손상을 방지하기 위한 방법의 절차도이다.2 is a flowchart of a method for preventing damage to an instruction cache memory caused by malicious code according to the present invention.
도 2에 도시된 바와 같이, 악의적인 코드에 의하여 명령어 캐쉬메모리가 손상되는 것을 방지하기 위하여, 먼저 캐쉬 컨트롤러가 명령어 캐쉬메모리에 핫스팟(hot spot)이 발생하는 지를 감지한다(s10). As shown in FIG. 2, in order to prevent the instruction cache memory from being damaged by malicious code, the cache controller first detects whether a hot spot occurs in the instruction cache memory (S10).
상기 명령어 캐쉬메모리는 도 1에 도시된 바와 같이, 복수개의 인스트럭션 비트셀 어레이들로 구성된다. 따라서, 상기 캐쉬 컨트롤러는 상기 명령어 캐쉬 메모리를 구성하는 각각의 인스트럭션 비트셀 어레이들에서 악의적인 코드에 의해 핫스팟이 발생하는지를 감지한다.As illustrated in FIG. 1, the instruction cache memory includes a plurality of instruction bit cell arrays. Thus, the cache controller detects whether a hot spot is caused by malicious code in each of the instruction bit cell arrays constituting the instruction cache memory.
상기 캐쉬 컨트롤러는 다양한 방법에 의하여 상기 각각의 인스트럭션 비트셀 어레이들에서 핫스팟이 발생하는지를 감지하고, 다양한 방법에 의하여 상기 명령어 캐쉬메모리가 상기 핫스팟에 의하여 손상되는 것을 방지한다. 이에 대해서는 후술하겠다.The cache controller detects whether a hot spot occurs in each of the instruction bit cell arrays by various methods, and prevents the instruction cache memory from being damaged by the hot spot by various methods. This will be described later.
상기 캐쉬 컨트롤러에 의하여 핫스팟이 감지된 경우에는, 상기 캐쉬 컨트롤러는 다른 유닛들에 의하여 상기 명령어 캐쉬메모리의 접근을 변경하거나 또는 명령어 캐쉬메모리의 접근을 중지할 수 있도록 제어한다(s20). 이와 같이, 핫스팟이 감지된 경우에 명령어 캐쉬메모리의 접근을 변경하거나 중지하는 것은 상기 명령어 캐쉬메모리의 온도가 높아지는 것을 방지하여 타버리는 것을 막기 위해서이다.When the hot spot is detected by the cache controller, the cache controller controls to change the access of the instruction cache memory or to stop the access of the instruction cache memory by other units (S20). As described above, when the hot spot is detected, changing or stopping the access of the instruction cache memory is to prevent the temperature of the instruction cache memory from increasing and to prevent it from being burned out.
도 3은 본 발명의 제1 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법의 절차도이다.3 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a first embodiment of the present invention.
본 발명의 제1 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법에 대하여 도 3을 참조하여 설명하면 다음과 같다.A method of preventing damage to the instruction cache memory due to malicious code according to the first embodiment of the present invention will be described with reference to FIG. 3.
먼저, 상기 캐쉬 컨트롤러가 명령어 캐쉬메모리를 구성하는 각각의 인스트럭션 비트셀 어레이들에서 악의적인 코드에 의하여 핫스팟이 발생하는지를 감지한다. 이에 대하여 구체적으로 설명하면, 먼저 상기 캐쉬 컨트롤러가 정해진 기준 사이클 동안 다른 유닛에 의하여 상기 각각의 인스트럭션 비트셀 어레이들의 접근 횟수를 카운팅을 수행한다(s11).First, the cache controller detects whether a hot spot occurs due to malicious code in each of the instruction bit cell arrays constituting the instruction cache memory. In detail, first, the cache controller counts the number of times of access to each of the instruction bit cell arrays by another unit during a predetermined reference cycle (s11).
상기 각각의 인스트럭션 비트셀 어레이들의 접근 횟수를 카운팅하는 방법은 상기 캐쉬 컨트롤러에 구비되는 카운터에 의하여 이루어진다. 상기 카운터는 상기 각각의 인스트럭션 비트셀 어레이들에 일대일 대응되어, 다른 유닛에 의하여 상기 대응되는 각각의 인스트럭션 비트셀 어레들의 접근 횟수를 카운팅한다. The method of counting the number of accesses of each instruction bit cell array is performed by a counter provided in the cache controller. The counter corresponds one-to-one to each of the instruction bit cell arrays, and counts the number of times each corresponding instruction bit cell array is accessed by another unit.
그런 다음, 상기 캐쉬 컨트롤러는 상기 기준 사이클 동안 상기 접근 횟수가 사전에 세팅된 임계값 이상인 인스트럭션 비트셀 어레이가 하나라도 존재하는지를 판단한다(s13). 예를 들면, 상기 기준 사이클을 100000 사이클이라고 하고, 상기 임계값을 45000 이라고 할 때, 상기 캐쉬 컨트롤러는 상기 기준 사이클인 100000 사이클 동안 상기 임계값인 45000 이상으로 접근되는 인스트럭션 비트셀 어레이가 하나라도 존재하는지를 판단한다. Then, the cache controller determines whether there is at least one instruction bit cell array in which the number of accesses is greater than or equal to a preset threshold value during the reference cycle (s13). For example, when the reference cycle is 100000 cycles and the threshold is 45000, the cache controller has at least one instruction bit cell array approaching the threshold 45000 or more during the 100000 cycles of the reference cycle. Determine.
상기 기준 사이클과 임계값은 사전에 세팅될 수 있는 값으로서, 칩 제조 전에 시뮬레이션을 통해서 결정될 수 있는 값이다. 즉, 시뮬레이션을 통하여 100000 사이클 동안 상기 인스트럭션 비트셀 어레이 중 적어도 하나에 45000 번 접근이 있는 경우에는 악의적인 코드에 의하여 접근이 되고 있다는 것으로 간주할 수 있는 것이다.The reference cycle and the threshold are values that can be set in advance, values that can be determined through simulation prior to chip fabrication. In other words, if there are 45000 accesses to at least one of the instruction bit cell arrays for 100,000 cycles through simulation, it may be regarded as being accessed by malicious code.
따라서, 상기 기준 사이클(예를 들어 100000) 동안 상기 접근 횟수가 임계값(예를 들어 45000) 이상인 인스트럭션 비트셀 어레이가 하나라도 존재하는 경우에는 악의적인 코드에 의하여 접근이 되고 있다는 것으로 간주하여 상기 명령어 캐쉬메모리에 핫스팟이 발생하는 것으로 간주한다(s15). 즉, 상기 임계값은 시뮬레이션을 통하여 결정될 수 있는 값으로서, 상기 인스트럭션 비트셀 어레이에 악의적인 코드가 접근되고, 결과적으로 핫스팟이 발생하는 것으로 간주할 수 있는 분계값이라 할 수 있다.Therefore, if any instruction bit cell array in which the number of accesses is greater than or equal to a threshold value (for example, 45000) is present during the reference cycle (for example, 100000), the instruction is regarded as being accessed by a malicious code. It is assumed that a hot spot occurs in the cache memory (s15). That is, the threshold value is a value that can be determined through simulation, and may be regarded as a threshold value in which a malicious code approaches the instruction bit cell array and consequently a hot spot occurs.
상기와 같이, 상기 기준 사이클 동안 상기 접근 횟수가 임계값 이상인 인스트럭션 비트셀 어레이가 하나라도 존재하는 것으로 판단되어 핫스팟이 발생하는 것으로 간주된 경우에는, 상기 캐쉬 컨트롤러는 다른 유닛에 의하여 상기 명령어 캐쉬메모리의 접근을 변경한다. 이와 같은 상기 명령어 캐쉬메모리의 접근 변경은 온도가 상승하는 것을 방지하고 결과적으로 타버리는 것을 막기 위함이다.As described above, when it is determined that at least one instruction bit cell array having the number of accesses is greater than or equal to a threshold value during the reference cycle, and thus a hot spot is considered to occur, the cache controller is configured by another unit to clear the instruction cache memory. Change the access. This change in access of the instruction cache memory is to prevent the temperature from rising and consequently burn out.
상기 캐쉬 컨트롤러가 다른 유닛에 의하여 상기 명령어 캐쉬메모리의 접근을 변경하는 방법은 다양한다. 본 발명의 제1 실시예에서는 도 3에 도시된 바와 같이, 상기 기준 사이클 동안 다른 유닛이 상기 명령어 캐쉬메모리를 접근할 때마다, 상 기 캐쉬 컨트롤러가 버블(bubble) 사이클을 삽입함으로써, 상기 명령어 캐쉬메모리의 접근이 변경될 수 있도록 제어한다(s21). There are various ways that the cache controller can change the access of the instruction cache memory by another unit. In the first embodiment of the present invention, as shown in FIG. 3, whenever the other unit approaches the instruction cache memory during the reference cycle, the cache controller inserts a bubble cycle, thereby causing the instruction cache. Control to change the access of the memory (s21).
상기와 같이, 명령어 캐쉬메모리의 접근이 있을 때마다, 버블 사이클을 삽입함으로써, 명령어 반입을 느리게 한다. 그러면, 결과적으로 상기 악의적인 코드의 접근은 감소되고, 상기 명령어 캐쉬메모리의 온도도 감소된다.As described above, whenever there is an access to the instruction cache memory, the instruction fetch is slowed by inserting a bubble cycle. As a result, the access of the malicious code is reduced, and the temperature of the instruction cache memory is also reduced.
도 4는 본 발명의 제2 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법의 절차도이다.4 is a flowchart illustrating a method of preventing damage to an instruction cache memory due to malicious code according to a second embodiment of the present invention.
도 4에 도시된 바와 같이, 상기 캐쉬 컨트롤러가 명령어 캐쉬 메모리를 구성하는 각각의 인스트럭션 비트셀 어레이들에서 악의적인 코드에 의한 핫스팟이 발생하는지를 감지하는 단계(s11, s13, s15)는 도 3에 도시된 본 발명의 제1 실시예와 동일한다. 따라서, 이에 대해서는 설명을 생략한다.As shown in FIG. 4, the steps of detecting whether a hot spot is caused by a malicious code in each of the instruction bitcell arrays constituting the instruction cache memory are illustrated in FIG. 3. Same as the first embodiment of the present invention. Therefore, description thereof is omitted.
다만, 상기 인스트럭션 비트셀 어레이들 중에 적어도 하나에 핫스팟이 발생한 것으로 간주된 경우에는 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬메모리의 접근을 중지한다(s21). 즉, 핫스팟이 발생된 것으로 간주된 경우에는 기준 사이클 동안 상기 명령어 캐쉬메모리의 온도 상승을 방지하기 위하여 다른 유닛에 의하여 상기 명령어 캐쉬메모리의 접근을 상기 캐쉬 컨트롤러가 중지시킨다.However, when it is determined that at least one of the instruction bit cell arrays has a hot spot, the cache controller stops access to the instruction cache memory (S21). That is, when it is considered that a hot spot has occurred, the cache controller suspends access of the instruction cache memory by another unit to prevent the temperature of the instruction cache memory from rising during the reference cycle.
따라서, 상기 캐쉬 컨트롤러는 상기 핫스팟이 발생된 것으로 간주된 경우에는, 상기 기준 사이클 동안 상기 명령어 캐쉬메모리의 접근을 중지하도록, 다른 유닛에 의한 상기 명령어 캐쉬메모리의 접근을 제어한다.Thus, the cache controller controls the access of the instruction cache memory by another unit to suspend access to the instruction cache memory during the reference cycle when the hot spot is considered to have occurred.
도 5는 본 발명의 제3 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법의 절차도이다.5 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a third embodiment of the present invention.
상기 제3 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법은 캐쉬 컨트롤러가 명령어 캐쉬 메모리를 구성하는 각각의 인스트럭션 비트셀 어레이에서 악의적인 코드에 의한 핫스팟이 발생하는지 감지하는 방법이 상술한 제1 및 제2 실시예와 다르다. In the method for preventing damage to the instruction cache memory due to malicious code according to the third embodiment, the method for the cache controller to detect whether a hot spot caused by malicious code occurs in each instruction bit cell array constituting the instruction cache memory is described above. One is different from the first and second embodiments.
도 5에 도시된 바와 같이, 제3 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법은, 일단 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬메모리에 접근하는 코드의 패턴이 사전에 저장되어 있는 악의적인 코드의 패턴과 동일한지 비교판단한다(s11, s13). As shown in FIG. 5, in the method of preventing damage to the instruction cache memory due to malicious code according to the third embodiment, a malicious code in which a pattern of code in which the cache controller accesses the instruction cache memory is stored in advance The comparison is judged whether it is the same as the pattern of the encoding (s11, s13).
상기 명령어 캐쉬메모리를 집중적으로 접근하는 악의적인 코드는 일정한 특이 패턴을 가지고 있으므로, 사전에 상기 악의적인 코드의 이미지를 저장해 놓고, 상기 명령어 캐쉬메모리에 접근하는 코드와 동일 여부를 판단할 수 있다. 상기 악의적인 코드는 다양하게 변경될 수 있으므로, 사전에 저장되는 악의적인 코드는 수시로 업데이트된다.Since the malicious code intensively accessing the instruction cache memory has a certain specific pattern, it is possible to determine whether the malicious code is the same as the code accessing the instruction cache memory in advance by storing an image of the malicious code in advance. Since the malicious code can be changed in various ways, the malicious code stored in advance is updated frequently.
상기 명령어 캐쉬메모리에 접근하는 코드와 사전에 저장된 악의적인 코드의 패턴이 동일한지를 판단한 결과, 동일한 경우로 판단한 경우에는 상기 명령어 캐쉬메모리에 접근하는 코드는 악의적인 코드로 간주할 수 있기 때문에, 상기 명령어 캐쉬메모리에 핫스팟이 발생할 것으로 간주한다(s15). 이 경우는 상술한 제1 및 제2 실시예와 달리, 사전에 핫스팟이 발생할 것을 감지할 수 있는 장점이 있다.As a result of determining whether the code for accessing the instruction cache memory and the pattern of malicious code stored in advance are the same, if it is determined to be the same, the code accessing the instruction cache memory may be regarded as malicious code. It is assumed that a hot spot occurs in the cache memory (s15). In this case, unlike the first and second embodiments described above, there is an advantage that it is possible to detect that a hot spot occurs in advance.
상기와 같이 명령어 캐쉬메모리에 핫스팟이 발생할 것으로 간주된 경우에는 상기 명령어 캐쉬메모리가 고온화되어 타버릴 수 있기 때문에, 사전에 상기 명령어 캐쉬메모리의 온도가 상승하는 것을 방지해야 한다. 이를 위하여, 상기 캐쉬 컨트롤러가 다른 유닛에 의한 상기 명령어 캐쉬메모리의 접근을 변경하도록 제어한다.When it is considered that a hot spot occurs in the instruction cache memory as described above, since the instruction cache memory may become hot and burned, it is necessary to prevent the temperature of the instruction cache memory from rising in advance. To this end, the cache controller controls to change the access of the instruction cache memory by another unit.
상기 캐쉬 컨트롤러가 다른 유닛에 의하여 상기 명령어 캐쉬메모리의 접근을 변경하는 방법은 다양한다. 본 발명의 제3 실시예에서는 도 5에 도시된 바와 같이, 상기 기준 사이클 동안 다른 유닛이 상기 명령어 캐쉬메모리를 접근할 때마다, 상기 캐쉬 컨트롤러가 버블(bubble) 사이클을 삽입함으로써, 상기 명령어 캐쉬메모리의 접근이 변경될 수 있도록 제어한다(s21). There are various ways that the cache controller can change the access of the instruction cache memory by another unit. In the third embodiment of the present invention, as shown in FIG. 5, whenever the other unit approaches the instruction cache memory during the reference cycle, the cache controller inserts a bubble cycle, thereby allowing the instruction cache memory to be inserted. Control to change the access of (S21).
상기와 같이, 명령어 캐쉬메모리의 접근이 있을 때마다, 버블 사이클을 삽입함으로써, 명령어 반입을 느리게 한다. 그러면, 결과적으로 상기 악의적인 코드의 접근은 감소되고, 상기 명령어 캐쉬메모리의 온도도 감소된다.As described above, whenever there is an access to the instruction cache memory, the instruction fetch is slowed by inserting a bubble cycle. As a result, the access of the malicious code is reduced, and the temperature of the instruction cache memory is also reduced.
도 6은 본 발명의 제4 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬메모리의 손상 방지 방법의 절차도이다.6 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a fourth embodiment of the present invention.
도 6에 도시된 바와 같이, 상기 캐쉬 컨트롤러가 명령어 캐쉬 메모리를 구성하는 각각의 인스트럭션 비트셀 어레이들에서 악의적인 코드에 의한 핫스팟이 발생하는지를 감지하는 단계(s11, s13, s15)는 도 5에 도시된 본 발명의 제3 실시예와 동일한다. 따라서, 이에 대해서는 설명을 생략한다.As illustrated in FIG. 6, the steps (s11, s13, and s15) of detecting, by the cache controller, whether a hot spot is caused by a malicious code in each of the instruction bitcell arrays constituting the instruction cache memory is illustrated in FIG. Same as the third embodiment of the present invention. Therefore, description thereof is omitted.
다만, 상기 인스트럭션 비트셀 어레이들 중에 적어도 하나에 핫스팟이 발생 한 것으로 간주된 경우에는 상기 캐쉬 컨트롤러가 상기 명령어 캐쉬메모리의 접근을 중지한다(s21). 즉, 핫스팟이 발생된 것으로 간주된 경우에는 기준 사이클 동안 상기 명령어 캐쉬메모리의 온도 상승을 방지하기 위하여 다른 유닛에 의하여 상기 명령어 캐쉬메모리의 접근을 상기 캐쉬 컨트롤러가 중지시킨다.However, when it is determined that at least one of the instruction bit cell arrays has a hot spot, the cache controller stops access to the instruction cache memory (S21). That is, when it is considered that a hot spot has occurred, the cache controller suspends access of the instruction cache memory by another unit to prevent the temperature of the instruction cache memory from rising during the reference cycle.
따라서, 상기 캐쉬 컨트롤러는 상기 핫스팟이 발생된 것으로 간주된 경우에는, 상기 기준 사이클 동안 상기 명령어 캐쉬메모리의 접근을 중지하도록, 다른 유닛에 의한 상기 명령어 캐쉬메모리의 접근을 제어한다.Thus, the cache controller controls the access of the instruction cache memory by another unit to suspend access to the instruction cache memory during the reference cycle when the hot spot is considered to have occurred.
도 1은 본 발명에 따른 명령어 캐쉬메모리 구조의 예시도이다.1 is an exemplary diagram of an instruction cache memory structure according to the present invention.
도 2는 본 발명에 따른 악의적인 코드에 의한 명령어 캐쉬 메모리의 손상 방지 방법의 절차도이다.2 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to the present invention.
도 3은 본 발명의 제1 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬 메모리의 손상 방지 방법의 절차도이다.3 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a first embodiment of the present invention.
도 4는 본 발명의 제2 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬 메모리의 손상 방지 방법의 절차도이다.4 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a second embodiment of the present invention.
도 5는 본 발명의 제3 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬 메모리의 손상 방지 방법의 절차도이다.5 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a third embodiment of the present invention.
도 6은 본 발명의 제4 실시예에 따른 악의적인 코드에 의한 명령어 캐쉬 메모리의 손상 방지 방법의 절차도이다.6 is a flowchart illustrating a method of preventing corruption of an instruction cache memory due to malicious code according to a fourth embodiment of the present invention.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020070100704A KR100916550B1 (en) | 2007-10-08 | 2007-10-08 | method for proventing damage of instruction cache memory by malicious code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020070100704A KR100916550B1 (en) | 2007-10-08 | 2007-10-08 | method for proventing damage of instruction cache memory by malicious code |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20090035762A KR20090035762A (en) | 2009-04-13 |
KR100916550B1 true KR100916550B1 (en) | 2009-09-14 |
Family
ID=40760913
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020070100704A KR100916550B1 (en) | 2007-10-08 | 2007-10-08 | method for proventing damage of instruction cache memory by malicious code |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100916550B1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06309232A (en) * | 1993-04-20 | 1994-11-04 | Hitachi Ltd | Control system for disk cache |
JPH06314491A (en) * | 1993-04-30 | 1994-11-08 | Hitachi Ltd | Semiconductor memory |
JPH07130080A (en) * | 1993-11-02 | 1995-05-19 | Olympus Optical Co Ltd | Information recorder |
JP2007505406A (en) | 2003-09-11 | 2007-03-08 | インテル・コーポレーション | Cache algorithm adaptable to temperature sensitive memory |
-
2007
- 2007-10-08 KR KR1020070100704A patent/KR100916550B1/en not_active IP Right Cessation
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06309232A (en) * | 1993-04-20 | 1994-11-04 | Hitachi Ltd | Control system for disk cache |
JPH06314491A (en) * | 1993-04-30 | 1994-11-08 | Hitachi Ltd | Semiconductor memory |
JPH07130080A (en) * | 1993-11-02 | 1995-05-19 | Olympus Optical Co Ltd | Information recorder |
JP2007505406A (en) | 2003-09-11 | 2007-03-08 | インテル・コーポレーション | Cache algorithm adaptable to temperature sensitive memory |
Also Published As
Publication number | Publication date |
---|---|
KR20090035762A (en) | 2009-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lee et al. | TWiCe: Preventing row-hammering by exploiting time window counters | |
US8725936B2 (en) | Storage system with flash memory, and storage control method | |
TWI437439B (en) | Method for performing block management using dynamic threshold, and associated memory device and controller thereof | |
US10282292B2 (en) | Cluster-based migration in a multi-level memory hierarchy | |
JP4764360B2 (en) | Techniques for using memory attributes | |
US10714186B2 (en) | Method and apparatus for dynamically determining start program voltages for a memory device | |
CN105940386B (en) | Method, system, and medium for moving data between memories | |
US20150032936A1 (en) | Techniques for Identifying Read/Write Access Collisions for a Storage Medium | |
CN116324994A (en) | Mitigating row hammer attacks | |
JP2009163647A (en) | Disk array device | |
US9852065B1 (en) | Method and apparatus for reducing data program completion overhead in NAND flash | |
JP2006260525A (en) | Cache circuit | |
US9823880B1 (en) | Method and apparatus for initiating pre-read operation before completion of data load operation | |
CN110597457A (en) | Solid state disk, control method of solid state disk and controller | |
US20160092115A1 (en) | Implementing storage policies regarding use of memory regions | |
WO2019240849A1 (en) | Logical block addressing range collision crawler | |
KR100916550B1 (en) | method for proventing damage of instruction cache memory by malicious code | |
US20140032855A1 (en) | Information processing apparatus and method | |
US8639879B2 (en) | Sorting movable memory hierarchies in a computer system | |
CN1280721C (en) | Method of identifying big or small memory of imbedded system | |
CN114724601A (en) | Storage system and operation method of storage system | |
KR20140027885A (en) | Method and computer-readable medium emboding program for protecting data integrity of disk in alternate operating system environment | |
EP4390708A1 (en) | Selective memory duplication control | |
Choi et al. | An ssd-based accelerator using partitioned bloom filter for directory parsing | |
JP2014238771A (en) | Storage controller, access control method, and control program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20120615 Year of fee payment: 4 |
|
FPAY | Annual fee payment |
Payment date: 20130621 Year of fee payment: 5 |
|
LAPS | Lapse due to unpaid annual fee |