KR20120070326A - A apparatus and a method for virtualizing memory - Google Patents

A apparatus and a method for virtualizing memory Download PDF

Info

Publication number
KR20120070326A
KR20120070326A KR1020100131841A KR20100131841A KR20120070326A KR 20120070326 A KR20120070326 A KR 20120070326A KR 1020100131841 A KR1020100131841 A KR 1020100131841A KR 20100131841 A KR20100131841 A KR 20100131841A KR 20120070326 A KR20120070326 A KR 20120070326A
Authority
KR
South Korea
Prior art keywords
page table
memory
guest
virtualization
caching
Prior art date
Application number
KR1020100131841A
Other languages
Korean (ko)
Inventor
김재열
김강호
고광원
전승협
Original Assignee
한국전자통신연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자통신연구원 filed Critical 한국전자통신연구원
Priority to KR1020100131841A priority Critical patent/KR20120070326A/en
Priority to CN201110431232.9A priority patent/CN102662857B/en
Publication of KR20120070326A publication Critical patent/KR20120070326A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/22Microcontrol or microprogram arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication

Abstract

PURPOSE: An apparatus and a method for virtualizing a memory are provided to improve the performance of a virtualizing system by rapidly mapping memories in order to change page tables of a guest operating system in the virtualizing system. CONSTITUTION: Shadow page tables(62) are generated respectively for guest operating systems. A guest page table is provided from one of the guest operating systems as the reference of a physical memory page. A processor processes mapping information which maps one of the shadow page tables and the guest page table. The mapping information is machine address information in which the guest operating system is loaded and is the virtual address information of the guest page table.

Description

메모리 가상화 장치 및 방법 {A apparatus and a method for virtualizing memory}Memory apparatus and method {A apparatus and a method for virtualizing memory}

본 발명은 다수의 게스트 운영체제를 지원하는 가상화 시스템에서 그림자 페이지 테이블을 이용한 메모리 가상화 방법에 관한 것이다.The present invention relates to a memory virtualization method using a shadow page table in a virtualization system supporting a plurality of guest operating systems.

가상화 기술은 운영체제(Operating System, OS)가 사용하는 하드웨어 자원인 CPU, 메모리, 네트워크, 모니터와 같은 입출력 장치를 가상화 시켜주는 기술이다. 일반적으로 운영체제는 하드웨어를 직접 접근하여 제어하도록 되어 있으나, 가상화 기술이 적용된 시스템은 운영체제가 하드웨어에 직접 접근 하는 것을 막고 운영체제에게 가상의 하드웨어 인터페이스를 제공함으로써 다수의 운영체제가 하나의 하드웨어 상에서 실행될 수 있도록 한다. 가상화 기술은 최초 서버 분야를 시작으로, 데스크탑, 최근에는 휴대폰이나 소형 단말과 같은 임베디드 모발 기기에 적용되기 시작했다.Virtualization technology is a technology that virtualizes input / output devices such as CPU, memory, network, and monitor, which are hardware resources used by an operating system (OS). In general, operating systems are designed to directly access and control hardware, but virtualized systems prevent multiple operating systems from directly accessing hardware and provide a virtual hardware interface to the operating system, allowing multiple operating systems to run on a single piece of hardware. . Virtualization technology began in the first server segment, and has been applied to desktops and, more recently, embedded hair devices such as mobile phones and handheld terminals.

가상화 기술은 세부적으로 CPU 가상화, 메모리 가상화, 디스크 가상화와 입출력 장치의 가상화로 구분할 수 있다. CPU의 경우를 살펴보면, 일반적으로 CPU 아키텍처는 두 개 이상의 모드를 지원하고 있다. Virtualization technology can be classified into CPU virtualization, memory virtualization, disk virtualization, and virtualization of I / O devices. In the case of CPUs, CPU architectures generally support more than one mode.

도 1과 도 2는 비가상화 시스템의 특권 모드(Privileged mode), 비특권 모드(Unprivileged mode)와 가상화 시스템의 특권 모드, 비특권 모드를 각각 도시한 구성도로서, 이를 참조하면 비가상화 시스템과 가상화 시스템은 특권 수준(Privileged level)에서 차이가 있다.1 and 2 are schematic diagrams illustrating a privileged mode, an unprivileged mode, a privileged mode of a virtualization system, and a nonprivileged mode of a non-virtualized system, respectively. The system differs at the privileged level.

도 1에 도시된 비가상화 시스템에서는, 운영체제(14)가 특권 모드(12)에서 수행되며, 일반 응용프로그램(13)은 비특권 모드(11)에서 수행된다. 특권 모드(12)에서는 CPU(미도시)가 제공하는 모든 명령어를 모두 사용할 수 있으며, 비특권 모드(11)에서는 CPU에서 특권모드(12)에서만 수행 가능한 명령어를 제외한 나머지 명령어들만을 수행할 수 있다. 운영체제는 일반적으로 특권모드에서 동작하며, 이를 통하여 응용프로그램을 제어할 수 있는 권한을 획득 한다. In the non-virtualization system shown in FIG. 1, the operating system 14 is run in privileged mode 12, and the general application 13 is run in non-privileged mode 11. In the privileged mode 12, all instructions provided by the CPU (not shown) may be used, and in the non-privileged mode 11, only the remaining instructions except the instructions that can be executed in the privileged mode 12 may be executed in the CPU. . The operating system generally operates in privileged mode, which acquires the authority to control the application program.

이와 달리, 도 2에 도시된 가상화 시스템에서는, 운영체제(24)가 비특권 모드(21)에서 동작한다. 즉, 운영체제(24)가 직접 하드웨어를 접근할 수 없도록 해야만 다수의 가상머신(Virtual Machine)을 운영할 수 있기 때문에 특권모드(22)는 가상머신 모니터(Virtual Machine Monitor, VMN)(25)에게 할당되고, 운영체제(24)와 응용프로그램(23)은 비특권모드(21)에서 실행되도록 CPU를 가상화 시킨다. In contrast, in the virtualization system shown in FIG. 2, the operating system 24 operates in the non-privileged mode 21. That is, the privileged mode 22 is assigned to the virtual machine monitor (VMN) 25 because the operating system 24 can not operate the hardware directly to operate a plurality of virtual machines. In addition, the operating system 24 and the application program 23 virtualize the CPU to be executed in the non-privileged mode 21.

메모리의 경우, 비 가상화 시스템에서는 운영체제가 모든 물리적 메모리를 모두 관리하며, 이를 응용프로그램에게 할당해 준다. 이를 위해서는 운영체제가 물리 메모리를 응용프로그램이 사용하는 가상메모리 공간(virtual memory space)에 매핑시켜주고, 메모리 영역에 대해 서로 다른 접근권한을 부여해 메모리 간섭을 방지한다.In the case of memory, in a non-virtualized system, the operating system manages all the physical memory and allocates it to applications. To do this, the operating system maps the physical memory to the virtual memory space used by the application and prevents memory interference by granting different access rights to the memory area.

가상화 시스템에서는 운영체제가 관리하던 메모리 매핑과 메모리 접근권한 제어를 가상머신 모니터가 수행하게 된다. 가상머신 모니터는 운영체제가 제공하는 메모리 매핑 정보인 게스트 페이지 테이블(Guest Page Table, GPT)을 참고하여, 이를 적절히 변형시켜 실제 물리 메모리 매핑에 사용되는 그림자 페이지 테이블(Shadow Page Table, SPT)을 생성한다. 그림자 페이지 테이블은 메모리 매핑 정보와 메모리 영역별 접근권한 옵션들을 포함하고 있다. In the virtualization system, the virtual machine monitor performs the memory mapping and memory access control that the operating system manages. The virtual machine monitor refers to the guest page table (GPT), which is memory mapping information provided by the operating system, and transforms it appropriately to generate a shadow page table (SPT) used for actual physical memory mapping. . The shadow page table contains memory mapping information and access rights options by memory area.

전가상화(full-virtualization)의 경우, 가상머신 모니터는 운영체제가 유지하고 있는 데이터 구조체 등의 정보를 볼 수 없으며, 단지 운영체제가 하드웨어에 특정 명령 수행을 요청할 때의 정보만을 볼 수 있다. 즉, 운영체제는 운영체제가 수행하는 프로세스 각각의 페이지 테이블을 모두 관리하고 있다고 볼 수 있지만, 가상머신 모니터는 운영체제가 현재 선택한 페이지 테이블만을 볼 수 있어서, 운영체제가 페이지 테이블을 변경할 때 마다 해당 게스트 페이지 테이블의 정보를 바탕으로 그림자 페이지를 매번 재생성하는 방법이 사용될 수 있다. In full-virtualization, the virtual machine monitor cannot see information such as data structures maintained by the operating system, but only when the operating system asks the hardware to execute a particular instruction. In other words, the operating system manages all the page tables of each process that the operating system runs, but the virtual machine monitor can only see the page table currently selected by the operating system. Based on the information, a method of recreating the shadow page each time may be used.

게스트 페이지 테이블의 변경은 응용프로그램 프로세스의 스위칭시 마다 발생하게 되기 때문에 게스트 페이지 테이블의 변경 빈도는 높다고 할 수 있으며, 그 때마다 그림자 페이지를 빈번히 재생성하여야 되기 때문에 가상화 시스템 성능에 막대한 저하를 가져오게 되는 문제점이 있다. Since the change of the guest page table occurs every time the application process is switched, the guest page table can be changed frequently. Since the shadow pages must be regenerated frequently each time, the virtual system performance is greatly reduced. There is a problem.

본 발명에서는 이러한 문제점을 해결하기 위해서 가상화 시스템에서 메모리 가상화를 위해 사용되는 그림자 페이지 테이블의 효율적인 관리를 통해 가상화 시스템의 성능을 향상시키는 메모리 가상화 방법을 제공하는데 그 목적이 있다.In order to solve this problem, an object of the present invention is to provide a memory virtualization method for improving performance of a virtualization system through efficient management of a shadow page table used for memory virtualization in a virtualization system.

상기의 기술적 과제를 해결하기 위한 본 발명의 일 양태로서의 메모리 가상 방법은, 다수의 게스트 운영체제를 지원하는 가상화 시스템에서의 메모리 가상화 방법에 있어서, 상기 다수의 게스트 운영체제별로 각각의 그림자 페이지 테이블을 생성하여 캐싱하는 단계; 매핑 정보를 이용하여 상기 캐싱된 그림자 페이지 테이블 중 하나와 상기 다수의 게스트 운영체제 중 하나로부터 물리메모리 페이지의 참조를 위한 게스트 페이지 테이블을 매핑하는 단계; 포함할 수 있다.Memory virtual method as an aspect of the present invention for solving the above technical problem, in the memory virtualization method in a virtualization system supporting a plurality of guest operating systems, by generating a respective shadow page table for each of the plurality of guest operating systems Caching; Mapping a guest page table for reference of a physical memory page from one of the cached shadow page tables and one of the plurality of guest operating systems using mapping information; It may include.

상기 매핑하는 단계는, 상기 게스트 운영체제가 로딩된 머신주소 위치정보와, 상기 게스트 페이지 테이블의 가상주소 위치정보를 상기 매핑정보로 사용하는 것이 바람직하다.The mapping may include using the machine address location information loaded by the guest operating system and the virtual address location information of the guest page table as the mapping information.

상기 캐싱하는 단계는, 상기 그림자 페이지 테이블의 위치정보를 상기 게스트 운영체제별 리스트로 캐싱할 수 있으며, 상기 게스트 운영체제의 수행이 중단된 경우에도 캐싱을 유지할 수 있다.In the caching operation, location information of the shadow page table may be cached as a list for each guest operating system, and caching may be maintained even when execution of the guest operating system is stopped.

상기 메모리 가상화 방법은, 상기 가상화 시스템의 가상 머신 모니터가 상기 게스트 운영체제별로 상기 그림자 페이지 테이블의 캐싱 빈도를 파악하고, 상기 캐싱 빈도에 따라 상기 그림자 페이지 테이블의 캐싱 공간을 동적으로 변경하는 단계;를 더 포함할 수 도 있다.The memory virtualization method may further include: determining, by the virtual machine monitor of the virtualization system, a caching frequency of the shadow page table for each guest operating system, and dynamically changing a caching space of the shadow page table according to the caching frequency. It may also be included.

상기 메모리 가상화 방법은, 상기 게스트 페이지 테이블을 1차 페이지 테이블과 2차 페이지 테이블로 형성하고, 상기 2차 페이지 테이블이 공유되는 경우, 상기 공유관계를 고려하여 상기 그림자 페이지 테이블을 캐싱할 수도 있다.The memory virtualization method may form the guest page table as a primary page table and a secondary page table, and when the secondary page table is shared, the shadow page table may be cached in consideration of the sharing relationship.

여기서, 상기 가상화 시스템의 가상머신 모니터가 공유된 상기 2차 페이지 테이블의 리스트를 관리하여 상기 그림자 페이지 테이블 캐싱시 상기 리스트를 참조하여 상기 2차 페이지 테이블의 공유관계를 파악할 수도 있으며, 해싱 기법으로 상기 2차 페이지 테이블의 공유관계를 파악할 수도 있다.Here, the virtual machine monitor of the virtualization system may manage the list of the secondary page table shared to identify the sharing relationship between the secondary page table by referring to the list when caching the shadow page table. You can also identify the sharing relationship of secondary page tables.

한편, 본 발명의 다른 양태로서, 다수의 게스트 운영체제를 지원하는 가상화 시스템에서 그림자 페이지 테이블을 이용한 메모리 가상화 장치는, 상기 다수의 게스트 운영체제별로 각각 생성된 그림자 페이지 테이블; 상기 다수의 게스트 운영체제 중 하나로부터 물리 메모리 페이지의 참조를 위해 제공되는 게스트 페이지 테이블; 상기 캐싱된 그림자 페이지 테이블 중 하나와 상기 게스트 페이지 테이블을 매핑하는 매핑 정보;를 처리하는 프로세서를 포함할 수 있다.On the other hand, in another aspect of the present invention, a memory virtualization apparatus using a shadow page table in a virtualization system supporting a plurality of guest operating systems, the shadow page table generated for each of the plurality of guest operating systems; A guest page table provided for reference of a physical memory page from one of the plurality of guest operating systems; And mapping information for mapping one of the cached shadow page tables and the guest page table.

본 발명은 다음과 같은 효과가 있다. The present invention has the following effects.

첫째, 그림자 페이지 테이블을 캐싱하여 재사용함으로써 가상화 시스템의 프로세싱 부하를 최소화시킬 수 있다.First, the processing overhead of the virtualization system can be minimized by caching and reusing shadow page tables.

둘째, 다수의 운영체제를 동시에 운영하는 가상화 시스템에서 게스트 운영체제의 페이지 테이블 변경에 메모리 매핑을 신속히 수행하여 가상화 시스템의 성능을 향상시킬 수 있다.Second, in the virtualization system operating multiple operating systems at the same time, memory mapping can be performed quickly to change the page table of the guest operating system to improve the performance of the virtualization system.

세째, 빈번히 발생하는 응용프로그램의 스위칭에 따른 메모리 매핑 부담을 감소시켜 응용프로그램의 프로세싱 속도를 향상시킬 수 있다.Third, the processing speed of the application can be improved by reducing the memory mapping burden due to switching of frequently occurring applications.

도 1은 일반적인 비가상화 시스템의 특권모드, 비특권모드를 도시한 구성도이다.
도 2는 일반적인 가상화 시스템의 특권모드, 비특권모드를 도시한 구성도이다.
도 3은 본 발명의 일실시예에 따른 페이지 테이블을 이용한 메모리 매핑을 도시한 도면이다.
도 4는 본 발명의 일실시예에 따른 가상머신 모니터와 게스트 운영체제의 메모리 맵 인식을 도시한 도면이다.
도 5는 본 발명의 일실시예에 따른 가상화 시스템의 메모리 구조를 도시한 도면이다.
도 6은 본 발명의 일실시예에 따른 메모리 가상화 방법에서 그림자 페이지 테이블 캐싱을 도시한 도면이다.
도 7은 본 발명의 일실시예에 따른 메모리 가상화 방법에서 2차 페이지 테이블 공유하는 경우를 도시한 도면이다.
도 8은 본 발명의 일실시예에 따른 메모리 가상화 방법을 설명하기 위한 플로우 차트를 도시한 도면이다.
1 is a block diagram illustrating a privileged mode and a non-privileged mode of a general non-virtualization system.
2 is a diagram illustrating a privileged mode and a non-privileged mode of a general virtualization system.
3 is a diagram illustrating memory mapping using a page table according to an embodiment of the present invention.
4 is a diagram illustrating memory map recognition of a virtual machine monitor and a guest operating system according to an exemplary embodiment of the present invention.
5 is a diagram illustrating a memory structure of a virtualization system according to an embodiment of the present invention.
6 is a diagram illustrating shadow page table caching in the memory virtualization method according to an embodiment of the present invention.
FIG. 7 illustrates a case in which secondary page tables are shared in a memory virtualization method according to an embodiment of the present invention.
8 is a flowchart illustrating a memory virtualization method according to an embodiment of the present invention.

이하의 실시예들은 본 발명의 구성요소들과 특징들을 소정 형태로 결합한 것들이다. 각 구성요소 또는 특징은 별도의 명시적 언급이 없는 한 선택적인 것으로 고려될 수 있다. 각 구성요소 또는 특징은 다른 구성요소나 특징과 결합되지 않은 형태로 실시될 수 있다. 또한, 일부 구성요소들 및/또는 특징들을 결합하여 본 발명의 실시예를 구성할 수도 있다. 본 발명의 실시예들에서 설명되는 동작들의 순서는 변경될 수 있다. 어느 실시예의 일부 구성이나 특징은 다른 실시예에 포함될 수 있고, 또는 다른 실시예의 대응하는 구성 또는 특징과 교체될 수 있다.The following embodiments are a combination of elements and features of the present invention in a predetermined form. Each component or feature may be considered to be optional unless otherwise stated. Each component or feature may be implemented in a form that is not combined with other components or features. In addition, some of the elements and / or features may be combined to form an embodiment of the present invention. The order of the operations described in the embodiments of the present invention may be changed. Some configurations or features of certain embodiments may be included in other embodiments, or may be replaced with corresponding configurations or features of other embodiments.

본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다. Embodiments of the invention may be implemented through various means. For example, embodiments of the present invention may be implemented by hardware, firmware, software, or a combination thereof.

하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(application specific integrated circuits), DSPs(digital signal processors), DSPDs(digital signal processing devices), PLDs(programmable logic devices), FPGAs(field programmable gate arrays), 프로세서, 콘트롤러, 마이크로 콘트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.For a hardware implementation, the method according to embodiments of the present invention may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs) , Field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and the like.

펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리 유닛에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리 유닛은 상기 프로세서 내부 또는 외부에 위치하여, 이미 공지된 다양한 수단에 의해 상기 프로세서와 데이터를 주고 받을 수 있다.In the case of an implementation by firmware or software, the method according to embodiments of the present invention may be implemented in the form of a module, a procedure or a function for performing the functions or operations described above. The software code may be stored in a memory unit and driven by a processor. The memory unit may be located inside or outside the processor, and may exchange data with the processor by various known means.

명세서 전체에서, 어떤 부분이 다른 부분과 "연결" 되어 있다고 할 때, 이는 직접적으로 연결되어 있는 경우뿐만 아니라, 그 중간에 다른 소자를 사이에 두고 전기적으로 연결되어 있는 경우도 포함한다. 또한 어떤 부분이 어떤 구성요소를 포함한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있다는 것을 의미한다.Throughout the specification, when a part is "connected" with another part, this includes not only a case where the part is directly connected, but a case where the part is electrically connected with another element in between. In addition, when a part includes a certain component, this means that unless otherwise stated, it may include other components other than excluding other components.

또한, 본 명세서에서 기재한 모듈(module)이란 용어는 특정한 기능이나 동작을 처리하는 하나의 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현할 수 있다.In addition, the term module described herein refers to a unit for processing a specific function or operation, which may be implemented in hardware or software, or a combination of hardware and software.

이하의 설명에서 사용되는 특정(特定) 용어들은 본 발명의 이해를 돕기 위해서 제공된 것이며, 이러한 특정 용어의 사용은 본 발명의 기술적 사상을 벗어나지 않는 범위에서 다른 형태로 변경될 수 있다.It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are intended to provide further explanation of the invention, and are not intended to limit the scope of the invention.

본 발명은 가상화 시스템에서의 메모리 가상화를 위해 사용되는 그림자 페이지 테이블을 효과적으로 관리하기 위한 메모리 가상화 방법이다. The present invention is a memory virtualization method for effectively managing a shadow page table used for memory virtualization in a virtualization system.

이하, 첨부된 도면들을 참조하여, 본 발명에 따른 실시예들에 대하여 상세하게 설명하기로 한다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 3은 본 발명의 일실시예에 따른 페이지 테이블을 이용한 메모리 매핑을 도시한 도면이다.3 is a diagram illustrating memory mapping using a page table according to an embodiment of the present invention.

본 발명의 실시예에 따른 메모리 가상화 방법에 사용되는 그림자 페이지 테이블은 페이지 테이블에 따라 생성되는 것으로, 먼저 도 3을 참조하여 페이지 테이블에 따른 매핑을 설명한다. 도 3은 다수의 CPU 아키텍쳐 중 하나인 ARM 아키텍쳐에 대한 것이나, 본 발명은 여기에 한정되지 않는다. 그 밖의 다른 아키텍처들도 약간의 차이점을 가지고는 있으나 페이지 테이블의 핵심 역할은 동일하다. 즉, 비교적 적은 물리 메모리를 상대적으로 큰 프로세스의 가상 메모리 공간에서 사용할 수 있도록 동적인 메모리 매핑을 지원하는 기능과 각 메모리의 영역별로 접근권한을 다르게 주어, 프로세스간 메모리 간섭을 방지하는 기능이다. ARM 아키텍처에서도 다수의 페이지 매핑 방법을 제공하는데, 도 3은 가장 일반적으로 사용되는 페이지 테이블의 예시이다. The shadow page table used in the memory virtualization method according to the embodiment of the present invention is generated according to the page table. First, the mapping according to the page table will be described with reference to FIG. 3. 3 is for the ARM architecture, which is one of a number of CPU architectures, but the invention is not limited thereto. Other architectures have some differences, but the key role of the page table is the same. In other words, this function supports dynamic memory mapping so that relatively small physical memory can be used in a relatively large virtual memory space of a process, and gives a different access permission for each memory area to prevent memory interference between processes. The ARM architecture also provides a number of page mapping methods. FIG. 3 is an example of the most commonly used page table.

1차 페이지 테이블(31) 또는 1차 페이지 테이블(31) 및 2차 페이지 테이블(32)을 이용해 물리 메모리인 페이지 프레임(35,36)를 매핑한다. The first page table 31 or the first page table 31 and the second page table 32 are used to map page frames 35 and 36 which are physical memories.

먼저, 1차 페이지 테이블(31)을 이용한 경우, 16KB 크기의 1차 페이지 테이블(31)을 구성한다. 1차 페이지 테이블(31)의 각 엔트리(33)는 4Byte의 크기를 갖고 있으므로, 16KB 크기의 1차 페이지 테이블(31)은 4096개의 엔트리를 갖게 되고, 각 엔트리(33)는 매핑된 물리 메모리인 1MB의 페이지 프레임(35)을 가리킨다. First, when the primary page table 31 is used, the primary page table 31 having a size of 16 KB is configured. Since each entry 33 of the primary page table 31 has a size of 4 bytes, the primary page table 31 having a size of 16 KB has 4096 entries, and each entry 33 is a mapped physical memory. It points to the page frame 35 of 1MB.

상기 페이지 테이블(31)은 프로세스당 하나씩 할당되며, 각 프로세스는 4GB의 가상 메모리공간을 매핑할 수 있게 된다. 이는 32bit 머신을 예로 든 경우이다. One page table 31 is allocated per process, and each process can map 4 GB of virtual memory space. This is the case with 32bit machines as an example.

한편, 1차 페이지 테이블(31)과 2차 페이지 테이블(32)을 이용한 경우는, 1차 페이지 테이블(31)의 엔트리(33)는 1KB 크기를 가지는 2차 페이지 테이블(32)을 지시한다. 2차 페이지 테이블(32)은 256개의 엔트리(34)를 가지며 각 엔트리는 4KB 크기의 페이지 프레임(36)을 지시한다. 256개의 4KB 페이지 프레임(36)은 1MB이므로, 결국 2차 페이지 테이블(32)을 거친 1차 페이지 테이블 엔트리(33)도 1MB의 페이지 프레임을 가리키게 된다. On the other hand, when the primary page table 31 and the secondary page table 32 are used, the entry 33 of the primary page table 31 indicates the secondary page table 32 having a size of 1 KB. The secondary page table 32 has 256 entries 34, each entry pointing to a page frame 36 of size 4KB. Since 256 4KB page frames 36 are 1MB, the primary page table entry 33, which has gone through the secondary page table 32, also points to a 1MB page frame.

2차 페이지 테이블(32)을 사용할 경우, 1MB 크기의 연속된 메모리가 아니라도 분산된 4KB 크기의 물리 메모리인 페이지 프레임을 지시할 수 있게 되고, 페이지 접근 권한은 페이지 프레임마다 설정할 수 있으므로 4KB 단위로 접근 권한을 다르게 설정할 수 있게 된다.When the secondary page table 32 is used, it is possible to indicate a page frame, which is distributed 4 KB physical memory even if not 1 MB of contiguous memory, and the page access authority can be set for each page frame, so that it can be set in 4 KB units. Access rights can be set differently.

도 4는 본 발명의 일실시예에 따른 가상머신 모니터와 게스트 운영체제의 메모리 맵 인식을 도시한 도면이다.4 is a diagram illustrating memory map recognition of a virtual machine monitor and a guest operating system according to an exemplary embodiment of the present invention.

이를 참조하면, 게스트 운영체제 1, 게스트 운영체제 2, 가상머신 모니터는 메모리 맵을 각각 다르게 인식하고 있다.Referring to this, the guest operating system 1, the guest operating system 2, and the virtual machine monitor recognize the memory map differently.

상기 차이가 발생하는 이유는, 가상화 시스템에서는 게스트 운영체계가 컴파일시에 알고 있었던 물리 메모리의 위치와 게스트 운영체제가 사용할 물리 메모리 위치가 다르게 되기 때문이다. The difference occurs because in the virtualization system, the location of the physical memory known to the guest operating system at the time of compilation and the physical memory location to be used by the guest operating system are different.

가상머신 모니터는 게스트 운영체제에서 생성한 게스트 페이지 테이블을 운영체제가 실제로 로딩되어 있는 메모리 위치로 변경시킨 그림자 페이지 테이블을 생성해 사용함으로써 이러한 차이를 보정하게 된다.The virtual machine monitor compensates for this difference by creating and using a shadow page table that changes the guest page table created by the guest operating system to the memory location where the operating system is actually loaded.

도 4에 도시된 본 발명의 실시예로 설명하면 다음과 같다.Referring to the embodiment of the present invention shown in Figure 4 as follows.

가상머신 모니터는 가상머신 모니터, 게스트 운영체제 1, 게스트 운영체제 2가 로딩되는 실제 물리 메모리(41)의 위치를 인식한다.The virtual machine monitor recognizes the location of the real physical memory 41 into which the virtual machine monitor, guest operating system 1, and guest operating system 2 are loaded.

그러나, 게스트 운영체제 1은 0x50000000번지부터 0x51000000번지까지의 물리 메모리(42)를 사용하는 것으로 인식하고, 게스트 운영체제 2도 0x50000000번지부터 0x51000000번지까지의 물리 메모리(43)를 사용하는 것으로 인식한다.However, the guest operating system 1 recognizes the use of the physical memory 42 from 0x50000000 to 0x51000000, and the guest operating system 2 also recognizes the use of the physical memory 43 from 0x50000000 to 0x51000000.

이러한 차이를 보정하기 위해 가상머신 모니터는 그림자 페이지 테이블을 제공하여 운영체제가 자신에게 할당된 실제 물리 메모리(41)를 매핑할 수 있도록 한다.To compensate for this difference, the virtual machine monitor provides a shadow page table that allows the operating system to map the actual physical memory 41 allocated to it.

도 5는 본 발명의 일실시예에 따른 가상화 시스템의 메모리 구조를 도시한 도면으로, 이를 참조하여 가상 메모리와 물리 메모리의 매핑관계를 설명하도록 한다. FIG. 5 is a diagram illustrating a memory structure of a virtualization system according to an exemplary embodiment of the present invention. Referring to this, a mapping relationship between a virtual memory and a physical memory will be described.

가상화 시스템에서의 메모리 주소는, 가상 주소(Virtual Address, 51)와 의사가상 주소(Peudo-physical Address, 52), 머신 주소(Machine Address, 53)로 구분된다. 가상 주소(51)는 가상머신이 인식하는 가상 메모리 영역이며, 의사가상 주소(52)는 가상머신이 인식하는 물리 메모리 영역이며, 머신 주소(53)는 가상머신 모니터가 보는 실제 물리 메모리 영역을 의미한다.The memory address in the virtualization system is divided into a virtual address (51), a pseudo-physical address (52), and a machine address (Machine Address, 53). The virtual address 51 is a virtual memory area recognized by the virtual machine, the pseudo virtual address 52 is a physical memory area recognized by the virtual machine, and the machine address 53 is an actual physical memory area seen by the virtual machine monitor. do.

가상머신 모니터는 그림자 페이지 테이블을 생성할 때, 앞서 설명한 바와 같이 각 메모리의 영역별로 접근권한을 다르게 주어, 프로세스간 메모리 간섭을 방지한다.When creating a shadow page table, the virtual machine monitor gives different access rights to each memory area as described above to prevent memory interference between processes.

즉, 그림자 페이지 테이블의 엔트리를 만들 때, 게스트 운영체제가 특정 위치에 메모리 쓰기가 발생하면 가상머신 모니터가 제어권을 가져와서 읽기전용으로 변경할 수 있게 된다. 특권 모드인 가상머신 모니터가 비특권모드인 게스트 운영체제의 제어권을 획득한 것이다.In other words, when creating an entry in the shadow page table, if a guest operating system writes a memory to a specific location, the virtual machine monitor can take control and change it to read-only. Privileged mode virtual machine monitor has gained control of the non-privileged guest operating system.

본 발명의 메모리 가상화 방법은, 그림자 페이지 테이블을 생성할 때, 도 5에 도시된 바와 같이 게스트 페이지 테이블에 매핑이 되어 있는 엔트리를 의사가상 주소(52)와 머신 주소(53) 간의 주소 위치의 차이를 고려한다.In the memory virtualization method of the present invention, when generating the shadow page table, as shown in FIG. Consider.

또한, 프로세스간 메모리 간섭이 발생하는 경우와 같이, 접근제어 설정의 변경이 필요한 경우에는 이를 변경하여 그림자 페이지 테이블의 해당 엔트리를 작성하게 된다.In addition, if a change in the access control setting is required, such as when memory interprocess occurs, a corresponding entry in the shadow page table is created by changing the access control setting.

그림자 페이지 테이블 생성 과정은 페이지 테이블의 엔트리 개수에 따라 생성작업의 양이 결정된다. 다수개의 게스트 운영체제를 지원하는 가상화 시스템의 경우, 각각의 운영체제의 프로세스가 실행될 때마다 그림자 페이지 테이블이 생성되어야 되기 때문에 생성 과정이 매우 빈번히 발생하게 되어 시스템에 큰 부하가 걸리게 된다. In the shadow page table generation process, the amount of creation is determined by the number of entries in the page table. In the case of a virtualization system supporting a plurality of guest operating systems, since the shadow page table must be generated each time a process of each operating system is executed, the generation process occurs very frequently, which places a heavy load on the system.

운영체제마다 물리 메모리를 프로세스에 매핑하는 방식이 다른데, 본 발명의 일실시예에 따른 메모리 가상화 방법은, 게스트 운영체제의 이러한 특성을 고려하여 그림자 페이지 테이블 생성 부하를 줄이는 방법을 제안한다. Different operating systems map physical memory to processes, and a memory virtualization method according to an embodiment of the present invention proposes a method of reducing a shadow page table generation load in consideration of such characteristics of a guest operating system.

32bit 리눅스의 경우, 물리 메모리의 크기가 896MB 이하이면 리눅스는 프로세스의 4GB 가상주소 공간 중 커널이 사용하는 0xC0000000 번지부터 모든 물리메모리를 직접매핑 한다. 이러한 리눅스의 특성상 모든 프로세스는 동일한 커널 주소 매핑을 가지게 되며, 리눅스 운영체제에서 사용되는 프로세스의 페이지 테이블은 모두 0XC0000000 상위로 동일한 엔트리를 가지게 된다.For 32-bit Linux, if the physical memory size is less than 896MB, Linux maps all physical memory directly from the 0xC0000000 address used by the kernel in the process's 4GB virtual address space. Due to the nature of Linux, all processes have the same kernel address mapping, and the page tables of processes used in the Linux operating system all have the same entry above 0XC0000000.

따라서, 게스트 운영체제가 리눅스 운영체제인 경우, 0xC0000000 상위 부분의 번지일때는 게스트 페이지 테이블을 해석해서 그림자 페이지 테이블을 생성할 필요 없이 직전에 사용된 그림자 페이지 테이블 엔트리 내용을 재사용할 수 있다. 상기 실시예에서 설명된 리눅스외의 다른 운영체제에 대해서도 그 운영체제의 메모리 매핑 특성을 고려하면 그림자 페이지 테이블 생성 부하를 줄일 수 있게 된다.Therefore, if the guest operating system is a Linux operating system, the address of the upper part of 0xC0000000 can reuse the previous shadow page table entry contents without having to interpret the guest page table and create a shadow page table. For other operating systems other than Linux described in the above embodiments, considering the memory mapping characteristic of the operating system, the shadow page table generation load can be reduced.

복수의 게스트 운영체제를 운영하는 가상화 시스템에서, 그림자 페이지 테이블을 재사용하기 위해서는 게스트 운영체제에서 사용하는 게스트 페이지 테이블과 캐싱된 그림자 페이지 테이블을 매핑시킬 수 있는 정보가 있어야 한다. 상기 매핑 정보는 게스트 운영체제가 로딩된 머신주소 위치정보 즉, 실제 물리 메모리 위치정보가 사용될 수 있다. In a virtualization system operating multiple guest operating systems, in order to reuse a shadow page table, there must be information capable of mapping the guest page table and the cached shadow page table used in the guest operating system. The mapping information may be machine address location information loaded with a guest OS, that is, actual physical memory location information.

또한, 매핑 정보로 게스트 페이지 테이블의 가상주소 위치정보를 이용할 수도 있다. In addition, the virtual address location information of the guest page table may be used as the mapping information.

상기 머신주소와 가상주소를 매핑정보로 사용할 경우, 게스트 운영체제가 동일한 가상주소 위치에 다른 프로세스의 페이지 테이블을 사용하게 되면 이 2가지 정보로 페이지 테이블을 식별할 수 없는 문제가 발생한다. 반가상화(Para-Virtualization)의 경우에는 가상머신 모니터가 게스트 운영체제로부터 운영체제의 정보를 받을 수 있으므로 이 문제를 해결 할 수 있는 반면, 전가상화(Full-Virutialization)의 경우에는 식별을 위한 추가적인 정보가 필요하다. 가령, 각 운영체제별 식별자를 게스트 페이지 테이블에 추가하여 게스트 운영체제를 식별할 수 있게 된다. When the machine address and the virtual address are used as mapping information, when the guest operating system uses the page table of another process at the same virtual address location, the page table cannot be identified by the two pieces of information. In the case of para-virtualization, the virtual machine monitor can receive the operating system's information from the guest operating system. This problem can be solved. In the case of full-virtualization, additional information for identification is required. Do. For example, a guest operating system may be identified by adding an identifier for each operating system to the guest page table.

도 6은 본 발명의 일실시예에 따른 메모리 가상화 방법에서 그림자 페이지 테이블 캐싱을 도시한 도면이다. 6 is a diagram illustrating shadow page table caching in the memory virtualization method according to an embodiment of the present invention.

도 6을 참조하면, 본 발명의 일실시예에 따른 메모리 가상화 방법은, 다수의 게스트 운영체제별로 각각의 그림자 페이지 테이블(62)을 생성하고 캐싱하여 그림자 페이지 테이블(62)을 재사용할 수 있도록 하는데, 특히 그림자 페이지 테이블(62)의 위치정보를 포함한 게스트 운영체제별 리스트(61)로 캐싱하는 것을 특징으로 한다.Referring to FIG. 6, in the memory virtualization method according to an embodiment of the present invention, the shadow page table 62 may be reused by generating and caching each shadow page table 62 for each of a plurality of guest operating systems. In particular, it is characterized in that the cache by the guest operating system list 61 including the location information of the shadow page table (62).

상기 운영체제별 리스트(61)는, 게스트 페이지 테이블(미도시)과 그림자 페이지 테이블(62)을 매핑하는 정보이다. 이를 통해 게스트 페이지 테이블(미도시)이 변경될 때마다 그림자 페이지 테이블(62)을 재생성하지 않고 저장된 그림자 페이지 테이블(62)을 재사용할 수 있다. The operating system-specific list 61 is information for mapping the guest page table (not shown) and the shadow page table 62. As a result, whenever the guest page table (not shown) is changed, the stored shadow page table 62 may be reused without regenerating the shadow page table 62.

그림자 페이지 테이블(62)의 캐싱은 다양한 방법으로 수행될 수 있는데, 그 중 하나로 다수개의 게스트 운영체제 중 적어도 하나의 수행이 중단된 경우에도 캐싱을 유지하는 방법을 사용할 수 있다.Caching of the shadow page table 62 may be performed in various ways. One of the methods may be to maintain caching even when at least one of the plurality of guest operating systems is stopped.

가상화 시스템의 특성상 다수의 게스트 운영체제가 동시에 수행될 경우가 많으며 다수의 게스트 운영체제의 그림자 페이지 테이블이 하나의 캐시 공간을 공유하면, 캐시 공간이 유한하기 때문에 새로운 그림자 페이지 테이블을 저장하기 위해서는 기존의 그림자 페이지 테이블 중 수행이 중단된 게스트 운영체제의 그림자 페이지 테이블이 캐시에서 나가야 되는데, 수행이 중단되었다가 다시 수행 상태가 되는 게스트 운영체제의 그림자 페이지 테이블은 재사용할 수 없고 재생성해야 되는 문제가 발생한다. 본 발명의 일실시예에 따른 메모리 가상화 방법은, 이러한 문제가 발생하지 않도록 스케줄링 아웃되는 게스트 운영체제가 사용하던 그림자 페이지 테이블이라도 캐시에서 밀려 나지 않고 유지되도록 한다. Due to the nature of the virtualization system, many guest operating systems are often executed at the same time. If the shadow page tables of multiple guest operating systems share a single cache space, the cache space is finite, so the existing shadow page table is not needed to store a new shadow page table. The shadow page table of the guest operating system in which the execution of the table is stopped must exit the cache. However, the shadow page table of the guest operating system in which the execution is interrupted and then executed again becomes unusable and needs to be regenerated. Memory virtualization method according to an embodiment of the present invention, so that the shadow page table used by the guest operating system scheduled out so that such a problem does not occur is maintained without being pushed out of the cache.

또한, 그림자 페이지 테이블(62)의 캐싱은, 가상화 시스템의 가상 머신 모니터가 게스트 운영체제별로 그림자 페이지 테이블의 캐싱 빈도를 파악하고, 상기 캐싱 빈도에 따라 그림자 페이지 테이블의 캐싱 공간을 동적으로 변경하는 방법을 사용할 수도 있다. 이는 다수의 게스트 운영체제가 캐시영역을 공유할 경우, 이를 효율적으로 관리하기 위해서이다.In addition, the caching of the shadow page table 62 is a method in which the virtual machine monitor of the virtualization system determines the caching frequency of the shadow page table for each guest operating system, and dynamically changes the caching space of the shadow page table according to the caching frequency. Can also be used. This is to efficiently manage when a plurality of guest operating systems share a cache area.

도 7은 본 발명의 일실시예에 따른 메모리 가상화 방법에서 2차 페이지 테이블을 공유하는 경우를 도시한 도면이다.FIG. 7 illustrates a case in which secondary page tables are shared in a memory virtualization method according to an embodiment of the present invention.

도 7을 참조하면, 본 발명의 일실시예에 따른 메모리 가상화 방법은, 게스트 페이지 테이블을 1차 페이지 테이블과 2차 페이지 테이블(71)로 구분하고, 상기 2차 페이지 테이블(71)을 타 1차 페이지 테이블과 공유하여 사용한다. 이 경우, 공유관계를 고려하여 그림자 페이지 테이블을 캐싱하는 것이 바람직하다.Referring to FIG. 7, in the memory virtualization method according to an embodiment of the present invention, a guest page table is divided into a primary page table and a secondary page table 71, and the second page table 71 is divided into 1. Shared with the tea page table. In this case, it is desirable to cache the shadow page table in consideration of the sharing relationship.

게스트 페이지 테이블이 도 7과 같이 2차 페이지 테이블(71)을 공유하게 되면 페이지 테이블간에 서로 영향을 주게 되며, 그림자 페이지 테이블을 캐싱할 때 이러한 2차 페이지 테이블(71)의 공유 관계를 반영하지 않으면, 공유된 게스트 페이지 테이블의 변화를 그림자 페이지 테이블에 반영하지 못해 페이지 테이블의 일관성이 깨어져 가상화 시스템이 정상적으로 동작하지 못한다. 따라서, 본 발명의 실시예에서는 이러한 게스트 페이지 테이블의 공유 관계를 그림자 페이지 테이블에도 동일하게 반영하는 기법을 사용해 문제를 해결한다. 공유 관계를 인식하는 방법에는 여러 가지가 있을 수 있다.When the guest page table shares the secondary page table 71 as shown in FIG. 7, the page tables affect each other, and when the shadow page table is cached, the secondary page table 71 does not reflect the sharing relationship of the secondary page table 71. As a result, the shared guest page table cannot be reflected in the shadow page table, which causes the page table to be inconsistent and the virtualization system cannot operate normally. Therefore, the embodiment of the present invention solves the problem by using a technique that reflects the sharing relationship of the guest page table in the shadow page table. There are many ways to recognize a sharing relationship.

본 발명의 일실시예로, 가상화 시스템의 가상머신 모니터가 공유된 2차 페이지 테이블(71)의 리스트를 관리하여 그림자 페이지 테이블 생성시 상기 리스트를 참조함으로써 게스트 페이지 테이블의 공유여부를 확인할 수 있다.In an embodiment of the present invention, the virtual machine monitor of the virtualization system manages the list of shared secondary page tables 71 to check whether the guest page table is shared by referring to the list when creating the shadow page table.

또한, 본 발명의 다른 실시예로, 해싱 기법으로 2차 페이지 테이블의 공유관계를 파악하도록 구성할 수도 있다. 연결 리스트는 자료구조를 묶는 손쉬운 방법이지만, 연결 리스트를 탐색하는 것은 비효율적 일 수 있다. 원하는 걸 발견할 때까지 리스트 전체를 쭉 훑어보아야 하기 때문이다. 해시 테이블은 포인터의 배열, 즉 포인터의 벡터(vector)로서, 배열에서의 위치를 나타내는 인덱스(index)를 가지고 액세스함으로써 보다 효율적으로 공유여부를 확인할 수 있게 된다.In addition, as another embodiment of the present invention, the hashing scheme may be configured to determine the sharing relationship of the secondary page table. Linked lists are an easy way to group data structures, but searching through linked lists can be inefficient. Because you have to go through the list until you find what you want. A hash table is an array of pointers, or vectors of pointers, that can be accessed more efficiently by accessing them with an index that indicates their position in the array.

한편, 본 발명의 다른 관점에 따른 실시예인 그림자 페이지 테이블을 이용한 메모리 가상화 장치는, 캐싱된 그림자 페이지 테이블과, 게스트 페이지 테이블과, 캐싱된 그림자 페이지 테이블과 게스트 페이지 테이블을 매핑하는 매핑 정보를 처리하는 프로세서를 포함할 수 있다. Meanwhile, a memory virtualization apparatus using a shadow page table according to another aspect of the present invention is configured to process mapping information for mapping a cached shadow page table, a guest page table, and a cached shadow page table and a guest page table. It may include a processor.

도 8은 본 발명의 일실시예에 따른 메모리 가상화 방법을 설명하기 위한 플로우 차트를 도시한 도면이다.8 is a flowchart illustrating a memory virtualization method according to an embodiment of the present invention.

먼저, 다수의 운영체제를 지원하는 가상화시스템에서 운영체제별로 그림자 페이지 테이블을 생성한다(S110).First, in a virtualization system supporting a plurality of operating systems, a shadow page table is generated for each operating system (S110).

다음으로, 생성된 그림자 페이지 테이블을 캐시영역에 저장한다(S130). 이때, 캐싱 방법은 전술한 바와 같이 다양한 방식이 사용될 수 있다. 특정 운영체제의 수행이 중단된 경우에도 캐싱을 유지한다든지, 사용빈도를 고려하여 캐싱영역을 동적으로 할당하는 방식 등이 사용될 수 있다.Next, the generated shadow page table is stored in the cache area (S130). In this case, as described above, a caching method may use various methods. Even when execution of a particular operating system is stopped, a caching area may be maintained, or a method of dynamically allocating a caching area in consideration of the frequency of use may be used.

다음으로, 다수의 운영체제 중 하나의 운영체제의 프로세스가 수행되고, 이에 따른 게스트 페이지 테이블이 제공된다(S150).Next, a process of one operating system among a plurality of operating systems is performed, and a guest page table is provided accordingly (S150).

이후, 캐싱된 그림자 페이지 테이블과 게스트 페이지 테이블을 매핑정보를 바탕으로 매핑하게 된다(S170). 매핑정보는 운영체제별 리스트로 제공될 수 있으며, 상기 리스트는 물리 메모리의 주소정보를 포함하여 가상화 시스템에서의 물리 메모리 접근이 가능하게 된다. Thereafter, the cached shadow page table and the guest page table are mapped based on the mapping information (S170). The mapping information may be provided as a list for each operating system, and the list includes address information of the physical memory to allow access to the physical memory in the virtualization system.

결국, 기존 방식의 그림자 페이지 테이블 생성절차를 거치지 않고, 캐싱된 그림자 페이지 테이블을 매핑 정보를 이용해 재사용할 수 있게 되어 가상화 시스템의 성능이 향상되게 된다.As a result, the cached shadow page table can be reused using mapping information without going through the conventional shadow page table generation procedure, thereby improving the performance of the virtualization system.

본 발명은 본 발명의 정신 및 필수적 특징을 벗어나지 않는 범위에서 다른 특정한 형태로 구체화될 수 있다. 따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다. 또한, 특허청구범위에서 명시적인 인용 관계가 있지 않은 청구항들을 결합하여 실시예를 구성하거나 출원 후의 보정에 의해 새로운 청구항으로 포함시킬 수 있다.The present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. Accordingly, the above detailed description should not be construed as limiting in all aspects and should be considered as illustrative. The scope of the invention should be determined by reasonable interpretation of the appended claims, and all changes within the equivalent scope of the invention are included in the scope of the invention. In addition, claims that do not have an explicit citation in the claims may be combined to form an embodiment or included in a new claim by amendment after the application.

본 발명에 따른 메모리 가상화 장치 및 방법은, 다수의 운영체제를 운영하는 가상화 기술 분야에는 어디든 적용가능하다. The memory virtualization apparatus and method according to the present invention is applicable anywhere in the field of virtualization technology operating a plurality of operating systems.

31 : 1차 페이지 테이블 32 : 2차 페이지 테이블
51 :가상 주소 52 : 의사가상 주소
53 : 머신 주소 62 : 그림자 페이지 테이블
31: Primary page table 32: Secondary page table
51: virtual address 52: doctor virtual address
53: Machine Address 62: Shadow Page Table

Claims (14)

다수의 게스트 운영체제를 지원하는 가상화 시스템에서의 메모리 가상화 방법에 있어서,
상기 다수의 게스트 운영체제별로 각각의 그림자 페이지 테이블을 생성하여 캐싱하는 단계; 및
매핑 정보를 이용하여 상기 캐싱된 그림자 페이지 테이블 중 하나와 상기 다수의 게스트 운영체제 중 하나로부터 물리메모리 페이지의 참조를 위한 게스트 페이지 테이블을 매핑하는 단계; 포함하는 것을 특징으로 하는 메모리 가상화 방법.
In the memory virtualization method in a virtualization system supporting a plurality of guest operating systems,
Generating and caching a shadow page table for each of the plurality of guest operating systems; And
Mapping a guest page table for reference of a physical memory page from one of the cached shadow page tables and one of the plurality of guest operating systems using mapping information; Memory virtualization method comprising a.
제1항에 있어서,
상기 매핑하는 단계는,
상기 게스트 운영체제가 로딩된 머신주소 위치정보와, 상기 게스트 페이지 테이블의 가상주소 위치정보를 상기 매핑정보로 사용하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 1,
The mapping step,
And the machine address location information loaded by the guest operating system and the virtual address location information of the guest page table as the mapping information.
제1항에 있어서,
상기 캐싱하는 단계는,
상기 그림자 페이지 테이블의 위치정보를 상기 게스트 운영체제별 리스트로 캐싱하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 1,
The caching step,
And caching location information of the shadow page table as a list for each guest operating system.
제1항에 있어서,
상기 캐싱하는 단계는,
상기 게스트 운영체제의 수행이 중단된 경우에도 캐싱을 유지하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 1,
The caching step,
Memory caching method, characterized in that the caching is maintained even when the guest operating system is stopped.
제1항에 있어서,
상기 캐싱하는 단계는,
상기 가상화 시스템의 가상 머신 모니터가 상기 게스트 운영체제별로 상기 그림자 페이지 테이블의 캐싱 빈도를 파악하고, 상기 캐싱 빈도에 따라 상기 그림자 페이지 테이블의 캐싱 공간을 동적으로 변경하는 단계;를 더 포함하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 1,
The caching step,
Determining, by the virtual machine monitor of the virtualization system, a caching frequency of the shadow page table for each guest operating system, and dynamically changing a caching space of the shadow page table according to the caching frequency. Memory virtualization method.
제1항에 있어서,
상기 메모리 가상화 방법은,
상기 게스트 페이지 테이블을 1차 페이지 테이블과 2차 페이지 테이블로 형성하고, 상기 2차 페이지 테이블이 공유되는 경우, 상기 공유관계를 고려하여 상기 그림자 페이지 테이블을 캐싱하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 1,
The memory virtualization method,
And forming the guest page table as a primary page table and a secondary page table, and when the secondary page table is shared, caching the shadow page table in consideration of the sharing relationship.
제6항에 있어서,
상기 메모리 가상화 방법은,
상기 가상화 시스템의 가상머신 모니터가 공유된 상기 2차 페이지 테이블의 리스트를 관리하여 상기 그림자 페이지 테이블 캐싱시 상기 리스트를 참조하여 상기 2차 페이지 테이블의 공유관계를 파악하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 6,
The memory virtualization method,
And a virtual machine monitor of the virtualization system manages the list of shared secondary page tables to identify a sharing relationship between the secondary page tables with reference to the list when caching the shadow page table.
제6항에 있어서,
상기 메모리 가상화 방법은,
해싱 기법으로 상기 2차 페이지 테이블의 공유관계를 파악하는 것을 특징으로 하는 메모리 가상화 방법.
The method of claim 6,
The memory virtualization method,
Memory virtualization method characterized by grasping the sharing relationship of the secondary page table by a hashing technique.
다수의 게스트 운영체제를 지원하는 가상화 시스템에서 그림자 페이지 테이블을 이용한 메모리 가상화 장치에 있어서,
상기 다수의 게스트 운영체제별로 각각 생성된 그림자 페이지 테이블;
상기 다수의 게스트 운영체제 중 하나로부터 물리 메모리 페이지의 참조를 위해 제공되는 게스트 페이지 테이블;
상기 캐싱된 그림자 페이지 테이블 중 하나와 상기 게스트 페이지 테이블을 매핑하는 매핑 정보;를 처리하는 프로세서를 포함하는 것을 특징으로 하는 메모리 가상화 장치.
In the memory virtualization apparatus using a shadow page table in a virtualization system supporting a plurality of guest operating systems,
A shadow page table generated for each of the plurality of guest operating systems;
A guest page table provided for reference of a physical memory page from one of the plurality of guest operating systems;
And a processor for processing mapping information for mapping one of the cached shadow page tables and the guest page table.
제9항에 있어서,
상기 매핑정보는,
상기 게스트 운영체제가 로딩된 머신주소 위치정보와, 상기 게스트 페이지 테이블의 가상주소 위치정보인 것을 특징으로 하는 메모리 가상화 장치.
10. The method of claim 9,
The mapping information,
And virtual machine location information of the guest address table and machine address location information loaded by the guest operating system.
제9항에 있어서,
상기 그림자 페이지 테이블은,
상기 게스트 운영체제별 리스트로 캐싱되는 것을 특징으로 하는 메모리 가상화 장치.
10. The method of claim 9,
The shadow page table,
Memory virtualization device characterized in that the cached to the guest operating system-specific list.
제9항에 있어서,
상기 그림자 페이지 테이블은,
상기 게스트 운영체제의 수행이 중단된 경우에도 캐싱이 유지되는 것을 특징으로 하는 메모리 가상화 장치.
10. The method of claim 9,
The shadow page table is
Memory caching is maintained even when the execution of the guest operating system is stopped.
제9항에 있어서,
상기 그림자 페이지 테이블은,
상기 가상화 시스템의 가상 머신 모니터가 상기 게스트 운영체제별로 상기 그림자 페이지 테이블의 캐싱 빈도를 파악하고, 상기 캐싱 빈도에 따라 상기 그림자 페이지 테이블의 캐싱 공간을 동적으로 변경되는 것을 특징으로 하는 메모리 가상화 장치.
10. The method of claim 9,
The shadow page table is
And a virtual machine monitor of the virtualization system determines the caching frequency of the shadow page table for each guest operating system, and dynamically changes the caching space of the shadow page table according to the caching frequency.
제9항에 있어서,
상기 게스트 페이지 테이블은,
1차 페이지 테이블과 2차 페이지 테이블로 형성되며, 상기 2차 페이지 테이블이 공유된 경우, 상기 가상화 시스템의 가상머신 모니터가 공유된 상기 2차 페이지 테이블의 리스트를 관리하는 것을 특징으로 하는 메모리 가상화 장치.

10. The method of claim 9,
The guest page table is
A virtual virtualization apparatus comprising a primary page table and a secondary page table, and when the secondary page table is shared, a virtual machine monitor of the virtualization system manages a list of shared secondary page tables. .

KR1020100131841A 2010-12-21 2010-12-21 A apparatus and a method for virtualizing memory KR20120070326A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020100131841A KR20120070326A (en) 2010-12-21 2010-12-21 A apparatus and a method for virtualizing memory
CN201110431232.9A CN102662857B (en) 2010-12-21 2011-12-21 For carrying out virtualized equipment and method for storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100131841A KR20120070326A (en) 2010-12-21 2010-12-21 A apparatus and a method for virtualizing memory

Publications (1)

Publication Number Publication Date
KR20120070326A true KR20120070326A (en) 2012-06-29

Family

ID=46688209

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100131841A KR20120070326A (en) 2010-12-21 2010-12-21 A apparatus and a method for virtualizing memory

Country Status (2)

Country Link
KR (1) KR20120070326A (en)
CN (1) CN102662857B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014104509A1 (en) * 2012-12-31 2014-07-03 고려대학교 산학협력단 Memory management method in virtualization system
KR102199509B1 (en) * 2019-10-16 2021-01-06 숭실대학교산학협력단 Memory sharing system, method, and program for performing for sharing memory in virtualization system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10209899B2 (en) * 2015-11-06 2019-02-19 Microsoft Technology Licensing, Llc Storage virtualization offload
CN106155933B (en) * 2016-07-06 2019-02-05 乾云众创(北京)信息科技研究院有限公司 A kind of virutal machine memory sharing method combined based on KSM and Pass-through

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI359377B (en) * 2005-04-05 2012-03-01 Ibm System and method for providing execute-in-place f
US8479195B2 (en) * 2007-05-16 2013-07-02 Vmware, Inc. Dynamic selection and application of multiple virtualization techniques
CN101398768B (en) * 2008-10-28 2011-06-15 北京航空航天大学 Construct method of distributed virtual machine monitor system
US8234432B2 (en) * 2009-01-26 2012-07-31 Advanced Micro Devices, Inc. Memory structure to store interrupt state for inactive guests

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014104509A1 (en) * 2012-12-31 2014-07-03 고려대학교 산학협력단 Memory management method in virtualization system
KR102199509B1 (en) * 2019-10-16 2021-01-06 숭실대학교산학협력단 Memory sharing system, method, and program for performing for sharing memory in virtualization system

Also Published As

Publication number Publication date
CN102662857B (en) 2016-07-06
CN102662857A (en) 2012-09-12

Similar Documents

Publication Publication Date Title
US20230161615A1 (en) Techniques for virtual machine transfer and resource management
US8661181B2 (en) Memory protection unit in a virtual processing environment
CA2577865C (en) System and method for virtualization of processor resources
US10671542B2 (en) Application execution enclave memory method and apparatus
US10255069B2 (en) Cleared memory indicator
US10241817B2 (en) Paravirtualized access for device assignment by bar extension
JP2014017012A (en) Guest to host address translation for devices to access memory in partitioned system
US10055136B2 (en) Maintaining guest input/output tables in swappable memory
US10365825B2 (en) Invalidation of shared memory in a virtual environment
US11003585B2 (en) Determining affinity domain information based on virtual memory address
US9471226B2 (en) Reverse copy on write for better cache utilization
WO2017131914A1 (en) Sharing a guest physical address space among virtualized contexts
KR20120070326A (en) A apparatus and a method for virtualizing memory
Chen et al. DMM: A dynamic memory mapping model for virtual machines
US20140208034A1 (en) System And Method for Efficient Paravirtualized OS Process Switching
US10684959B2 (en) Shared memory in a virtual environment
US20230185593A1 (en) Virtual device translation for nested virtual machines
US20220405111A1 (en) Improving memory access handling for nested virtual machines
US11748136B2 (en) Event notification support for nested virtual machines
US11748135B2 (en) Utilizing virtual input/output memory management units (IOMMU) for tracking encryption status of memory pages
US11243801B2 (en) Transparent huge pages support for encrypted virtual machines
US20160246633A1 (en) Read-only vm function chaining for secure hypervisor access
US11860792B2 (en) Memory access handling for peripheral component interconnect devices
Shang et al. Reestablishing Page Placement Mechanisms for Nested Virtualization
US20230027307A1 (en) Hypervisor-assisted transient cache for virtual machines

Legal Events

Date Code Title Description
WITN Withdrawal due to no request for examination