WO2022119110A1 - 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치 - Google Patents

하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치 Download PDF

Info

Publication number
WO2022119110A1
WO2022119110A1 PCT/KR2021/014198 KR2021014198W WO2022119110A1 WO 2022119110 A1 WO2022119110 A1 WO 2022119110A1 KR 2021014198 W KR2021014198 W KR 2021014198W WO 2022119110 A1 WO2022119110 A1 WO 2022119110A1
Authority
WO
WIPO (PCT)
Prior art keywords
hypervisor
instruction
virtual machine
guest virtual
function
Prior art date
Application number
PCT/KR2021/014198
Other languages
English (en)
French (fr)
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 삼성전자 주식회사
Publication of WO2022119110A1 publication Critical patent/WO2022119110A1/ko

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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45545Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox
    • 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Definitions

  • Embodiments disclosed in this document relate to a method for monitoring a virtual machine using a hypervisor and an electronic device supporting the same.
  • a hypervisor refers to a virtual platform technology that allows a plurality of guest operating systems to be simultaneously executed on one host computer.
  • the hypervisor may virtualize and distribute hardware resources such as memory, registers, storage, device drivers, processors, or networks among multiple guest operating systems.
  • the hypervisor Since the hypervisor has higher privileges than the guest operating system, even if the guest operating system steals the root privilege, the hypervisor cannot be hacked and can be used for security purposes.
  • the hypervisor Since the hypervisor is a platform separate from the guest virtual machine, it is common that internal information of the guest virtual machine is not known. Therefore, in order for the hypervisor to participate in the operation of the guest virtual machine, it is necessary to port the code for the hypervisor to the virtual machine in a compile step. However, in terms of a hypervisor that drives a plurality of guest virtual machines, it is inefficient to port codes one by one to a plurality of guest virtual machines, and there is a risk of hacking because the code of the hypervisor is exposed.
  • the hypervisor directly modifies the code flow of the guest virtual machine during run-time, so that every point in time when the guest virtual machine executes code or accesses memory
  • An object of the present invention is to provide an electronic device and method for monitoring.
  • an electronic device includes: a memory for storing at least one guest virtual machine and a hypervisor; and a processor operatively coupled to the memory, wherein, as a first operation, the processor obtains, as a first operation, an address of a target symbol from symbol information of a guest virtual machine loaded into the hypervisor.
  • the hypervisor extracts symbol information from the guest virtual machine. loading (loading) into the operation; retrieving an address of a target symbol from the symbol information; storing a first instruction corresponding to the address of the guest virtual machine in the hypervisor and replacing the first instruction with a second instruction that calls the hypervisor; generating a trap to the hypervisor according to the execution of the second instruction in the guest virtual machine; acquiring register information of the guest virtual machine at the trap time in the hypervisor; executing a designated code based on the register information in the hypervisor; executing the first instruction stored in the hypervisor; and controlling to return from the hypervisor to the guest virtual machine.
  • Every time the guest virtual machine executes code or accesses memory by directly modifying the code flow of the guest virtual machine during run-time by the hypervisor An electronic device and method capable of monitoring may be provided.
  • FIG. 1 is a block diagram of an electronic device in a network environment, according to various embodiments of the present disclosure
  • FIG. 2 is a diagram illustrating a hierarchical structure of software and hardware of an electronic device according to an embodiment to which a hypervisor is applied.
  • FIG. 3 is a diagram illustrating structures of a hypervisor and a guest virtual machine according to an embodiment.
  • FIG. 4 is a diagram illustrating an operation of a hypervisor according to an embodiment.
  • FIG. 5 is a diagram illustrating an operation of a hypervisor according to an embodiment.
  • FIG. 6 is a diagram illustrating an operation of a hypervisor according to an embodiment.
  • FIG. 7 is a flowchart illustrating an operation of an electronic device according to an exemplary embodiment.
  • FIGS. 8A to 8C are diagrams illustrating a method of monitoring a virtual machine at various viewpoints using a hypervisor of an electronic device according to an exemplary embodiment.
  • FIG. 1 is a block diagram of an electronic device 101 in a network environment 100 according to various embodiments.
  • an electronic device 101 communicates with an electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or a second network 199 . It may communicate with the electronic device 104 or the server 108 through (eg, a long-distance wireless communication network). According to an embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 .
  • a first network 198 eg, a short-range wireless communication network
  • a second network 199 e.g., a second network 199
  • the electronic device 101 may communicate with the electronic device 104 through the server 108 .
  • the electronic device 101 includes a processor 120 , a memory 130 , an input module 150 , a sound output module 155 , a display module 160 , an audio module 170 , and a sensor module ( 176), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or an antenna module 197 may be included.
  • at least one of these components eg, the connection terminal 178
  • may be omitted or one or more other components may be added to the electronic device 101 .
  • some of these components are integrated into one component (eg, display module 160 ). can be
  • the processor 120 for example, executes software (eg, a program 140) to execute at least one other component (eg, a hardware or software component) of the electronic device 101 connected to the processor 120 . It can control and perform various data processing or operations. According to one embodiment, as at least part of data processing or operation, the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 . may be stored in the volatile memory 132 , and may process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 .
  • software eg, a program 140
  • the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 .
  • the volatile memory 132 may be stored in the volatile memory 132 , and may process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 .
  • the processor 120 is the main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor).
  • the main processor 121 e.g, a central processing unit or an application processor
  • a secondary processor 123 eg, a graphic processing unit, a neural network processing unit
  • NPU neural processing unit
  • an image signal processor e.g., a sensor hub processor, or a communication processor.
  • the main processor 121 e.g, a central processing unit or an application processor
  • a secondary processor 123 eg, a graphic processing unit, a neural network processing unit
  • NPU neural processing unit
  • an image signal processor e.g., a sensor hub processor, or a communication processor.
  • the main processor 121 e.g, a central processing unit or an application processor
  • a secondary processor 123
  • the auxiliary processor 123 is, for example, on behalf of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or the main processor 121 is active (eg, executing an application). ), together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states.
  • the co-processor 123 eg, an image signal processor or a communication processor
  • may be implemented as part of another functionally related component eg, the camera module 180 or the communication module 190. have.
  • the auxiliary processor 123 may include a hardware structure specialized for processing an artificial intelligence model.
  • Artificial intelligence models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself on which artificial intelligence is performed, or may be performed through a separate server (eg, the server 108).
  • the learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but in the above example not limited
  • the artificial intelligence model may include a plurality of artificial neural network layers.
  • Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the above, but is not limited to the above example.
  • the artificial intelligence model may include, in addition to, or alternatively, a software structure in addition to the hardware structure.
  • the memory 130 may store various data used by at least one component of the electronic device 101 (eg, the processor 120 or the sensor module 176 ).
  • the data may include, for example, input data or output data for software (eg, the program 140 ) and instructions related thereto.
  • the memory 130 may include a volatile memory 132 or a non-volatile memory 134 .
  • the program 140 may be stored as software in the memory 130 , and may include, for example, an operating system 142 , middleware 144 , or an application 146 .
  • the input module 150 may receive a command or data to be used in a component (eg, the processor 120 ) of the electronic device 101 from the outside (eg, a user) of the electronic device 101 .
  • the input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).
  • the sound output module 155 may output a sound signal to the outside of the electronic device 101 .
  • the sound output module 155 may include, for example, a speaker or a receiver.
  • the speaker can be used for general purposes such as multimedia playback or recording playback.
  • the receiver may be used to receive an incoming call. According to one embodiment, the receiver may be implemented separately from or as part of the speaker.
  • the display module 160 may visually provide information to the outside (eg, a user) of the electronic device 101 .
  • the display module 160 may include, for example, a control circuit for controlling a display, a hologram device, or a projector and a corresponding device.
  • the display module 160 may include a touch sensor configured to sense a touch or a pressure sensor configured to measure the intensity of a force generated by the touch.
  • the audio module 170 may convert a sound into an electric signal or, conversely, convert an electric signal into a sound. According to an embodiment, the audio module 170 acquires a sound through the input module 150 , or an external electronic device (eg, a sound output module 155 ) connected directly or wirelessly with the electronic device 101 . A sound may be output through the electronic device 102 (eg, a speaker or headphones).
  • an external electronic device eg, a sound output module 155
  • a sound may be output through the electronic device 102 (eg, a speaker or headphones).
  • the sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, user state), and generates an electrical signal or data value corresponding to the sensed state. can do.
  • the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, It may include a temperature sensor, a humidity sensor, or an illuminance sensor.
  • the interface 177 may support one or more designated protocols that may be used by the electronic device 101 to directly or wirelessly connect with an external electronic device (eg, the electronic device 102 ).
  • the interface 177 may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
  • HDMI high definition multimedia interface
  • USB universal serial bus
  • SD card interface Secure Digital Card
  • the connection terminal 178 may include a connector through which the electronic device 101 can be physically connected to an external electronic device (eg, the electronic device 102 ).
  • the connection terminal 178 may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (eg, a headphone connector).
  • the haptic module 179 may convert an electrical signal into a mechanical stimulus (eg, vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic sense.
  • the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
  • the camera module 180 may capture still images and moving images. According to an embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.
  • the power management module 188 may manage power supplied to the electronic device 101 .
  • the power management module 188 may be implemented as, for example, at least a part of a power management integrated circuit (PMIC).
  • PMIC power management integrated circuit
  • the battery 189 may supply power to at least one component of the electronic device 101 .
  • battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.
  • the communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). It can support establishment and communication performance through the established communication channel.
  • the communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication.
  • the communication module 190 is a wireless communication module 192 (eg, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (eg, : It may include a LAN (local area network) communication module, or a power line communication module).
  • GNSS global navigation satellite system
  • a corresponding communication module among these communication modules is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN).
  • a first network 198 eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)
  • a second network 199 eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN).
  • a telecommunication network
  • the wireless communication module 192 uses the subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199 .
  • the electronic device 101 may be identified or authenticated.
  • the wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, a new radio access technology (NR).
  • NR access technology includes high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and access to multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency) -latency communications)).
  • eMBB enhanced mobile broadband
  • mMTC massive machine type communications
  • URLLC ultra-reliable and low-latency
  • the wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example.
  • a high frequency band eg, mmWave band
  • the wireless communication module 192 includes various technologies for securing performance in a high-frequency band, for example, beamforming, massive multiple-input and multiple-output (MIMO), all-dimensional multiplexing. It may support technologies such as full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming, or a large scale antenna.
  • the wireless communication module 192 may support various requirements specified in the electronic device 101 , an external electronic device (eg, the electronic device 104 ), or a network system (eg, the second network 199 ).
  • the wireless communication module 192 may include a peak data rate (eg, 20 Gbps or more) for realizing eMBB, loss coverage (eg, 164 dB or less) for realizing mMTC, or U-plane latency for realizing URLLC ( Example: downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less).
  • a peak data rate eg, 20 Gbps or more
  • loss coverage eg, 164 dB or less
  • U-plane latency for realizing URLLC
  • the antenna module 197 may transmit or receive a signal or power to the outside (eg, an external electronic device).
  • the antenna module 197 may include an antenna including a conductor formed on a substrate (eg, a PCB) or a radiator formed of a conductive pattern.
  • the antenna module 197 may include a plurality of antennas (eg, an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network such as the first network 198 or the second network 199 is connected from the plurality of antennas by, for example, the communication module 190 . can be selected. A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna.
  • other components eg, a radio frequency integrated circuit (RFIC)
  • RFIC radio frequency integrated circuit
  • the antenna module 197 may form a mmWave antenna module.
  • the mmWave antenna module comprises a printed circuit board, an RFIC disposed on or adjacent to a first side (eg, bottom side) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, an array antenna) disposed on or adjacent to a second side (eg, top or side) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.
  • peripheral devices eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)
  • GPIO general purpose input and output
  • SPI serial peripheral interface
  • MIPI mobile industry processor interface
  • the command or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 .
  • Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 .
  • all or a part of operations executed in the electronic device 101 may be executed in one or more external electronic devices 102 , 104 , or 108 .
  • the electronic device 101 may perform the function or service itself instead of executing the function or service itself.
  • one or more external electronic devices may be requested to perform at least a part of the function or the service.
  • One or more external electronic devices that have received the request may execute at least a part of the requested function or service, or an additional function or service related to the request, and transmit a result of the execution to the electronic device 101 .
  • the electronic device 101 may process the result as it is or additionally and provide it as at least a part of a response to the request.
  • cloud computing distributed computing, mobile edge computing (MEC), or client-server computing technology may be used.
  • the electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing.
  • the external electronic device 104 may include an Internet of things (IoT) device.
  • Server 108 may be an intelligent server using machine learning and/or neural networks.
  • the external electronic device 104 or the server 108 may be included in the second network 199 .
  • the electronic device 101 may be applied to an intelligent service (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.
  • FIG. 2 is a diagram 200 illustrating a hierarchical structure of software and hardware of an electronic device according to an embodiment to which a hypervisor is applied.
  • the electronic device may include a software layer 250 and a hardware layer 210 .
  • the software layer 250 may include an operating system (eg, the operating system 142 of FIG. 1 ) and a hypervisor 230 .
  • the software layer 250 may include a hypervisor 230 between the operating system and the hardware layer 210 .
  • the electronic device is software based on an Android operating system including a Linux kernel 251 , a library 253 , an Android runtime 255 , an application framework 257 , and an application 259 .
  • the layer 250 may be included, but is not limited thereto. For example, at least a part of the configuration and structure of the Android operating system shown in FIG. 2 may be changed.
  • the electronic device may include a software layer based on various operating systems such as iOS, Windows, Symbian, tizen, or bada.
  • the Linux kernel 251 is the lowest layer of Android, and may perform low-level management functions such as a background thread, memory management, security, or a device driver.
  • the library 253 may include a library commonly used by application programs (applications 259 ), and the library 253 may be a factor determining the overall speed of the electronic device.
  • the Android runtime 255 provides an environment optimized to execute an application, and may include a Dalvik virtual machine and Java core libraries.
  • the application framework 257 is an application programming interface (API) of Android.
  • the application 259 may not directly call the Linux kernel 251 or the library 253 , but may request a function of the Linux kernel 251 or the library 253 through the application framework 257 .
  • the application 259 is software directly used by a user, and may include, for example, an application program such as a home screen, a phone call, a web browser, a gallery, or a game.
  • the hardware layer 210 includes a processor (eg, the processor 120 of FIG. 1 ) (eg, a central processing unit (CPU)), a memory (eg, the memory 130 of FIG. 1 ) ) (eg, random access memory (RAM), read only memory (ROM), or hard disk), a network, or a physical resource such as an input/output device.
  • a processor eg, the processor 120 of FIG. 1
  • a memory eg, the memory 130 of FIG. 1
  • RAM random access memory
  • ROM read only memory
  • hard disk e.g, a network
  • a physical resource such as an input/output device.
  • the electronic device may include an operating system directly on the hardware layer 210 , and in this case, the Linux kernel 251 directly drives the hardware.
  • the electronic device may include the hypervisor 230 between the hardware layer 210 and the operating system.
  • the hardware is to be provided to the Linux kernel 251 through the hypervisor 230 .
  • the hypervisor 230 disclosed in this document is a logical platform for simultaneously executing a plurality of operating systems in a host computer (eg, the electronic device 101 of FIG. 1 ), and a virtual machine monitor It may be referred to as a (virtual machine monitor) or a virtual machine manager, and may be referred to as VMM for short.
  • the hypervisor 230 may refer to a program capable of generating and driving a plurality of virtual machines based on one piece of hardware.
  • the hypervisor 230 may virtualize a hardware resource including a processor (eg, the processor 120 of FIG. 1 ) or a memory (eg, the memory 130 of FIG. 1 ) and distribute it to a plurality of virtual machines.
  • a computer eg, the electronic device 101 of FIG. 1
  • executing one or more virtual machines may be referred to as a “host”, and each virtual machine may be referred to as a “guest”.
  • the virtual machine driven by the hypervisor 230 may be referred to as a guest operating system.
  • the memory (eg, the memory 130 of FIG. 1 ) of the electronic device may store the hypervisor 230 and at least one virtual machine.
  • the processor (eg, the processor 120 of FIG. 1 ) of the electronic device transfers the hypervisor 230 from the non-volatile memory (eg, the non-volatile memory 134 of FIG. 1 ) (eg, a hard disk). and at least one virtual machine may be loaded and stored in a volatile memory (eg, the volatile memory 132 of FIG. 1 ) (eg, RAM).
  • the processor accesses the hypervisor 230 and at least one virtual machine loaded memory (eg, the volatile memory 132 of FIG. 1 ) to access the hypervisor 230 or at least one It is possible to execute instructions of a virtual machine or code, which is a set of instructions.
  • the electronic device may perform a function of the hypervisor 230 or at least one virtual machine by executing an instruction or code.
  • FIG. 3 is a diagram 300 illustrating structures of a hypervisor and a guest virtual machine according to an embodiment.
  • operations of the hypervisor 301 and the guest virtual machine 302 described with reference to FIG. 3 are performed by the processor (eg, the processor 120 of FIG. 1 ) of the electronic device (eg, the electronic device 101 of FIG. 1 ). ) can be done by According to an embodiment, that the hypervisor 301 or the guest virtual machine 302 performs an arbitrary operation means that the processor of the electronic device is a memory (eg, the volatile memory 132 of FIG. 1 ) (eg, RAM). It may mean to access and execute instructions or codes of the hypervisor 301 or the guest virtual machine 302 .
  • the processor of the electronic device is a memory (eg, the volatile memory 132 of FIG. 1 ) (eg, RAM). It may mean to access and execute instructions or codes of the hypervisor 301 or the guest virtual machine 302 .
  • the hypervisor 301 may drive the guest virtual machine 302 .
  • the guest virtual machine 302 may include a plurality of guest virtual machines.
  • the hypervisor 301 loads the data or information included in the binary 320 of the guest virtual machine 302 into a memory (eg, RAM) to the guest virtual machine 302 . ) can be driven.
  • a memory eg, RAM
  • the binary 320 may refer to a data set including data required to be loaded into a memory in order for the hypervisor 301 to drive the guest virtual machine 302 .
  • the binary 320 may be stored in a hard disk.
  • the binary 320 may include symbol information 321 , a code 322 , and data 323 .
  • the code 322 may include a plurality of instructions, and may include a series of instructions for the guest virtual machine 302 to perform a specific function.
  • the code 322 may include at least a portion of the code of the guest virtual machine 302 .
  • the data 323 may include data necessary for the guest virtual machine 302 to execute the code 322 .
  • the symbol information 321 may include a symbol name for identifying an instruction of the guest virtual machine 302 and an address corresponding to the symbol name.
  • a symbol may mean a minimum unit capable of having an absolute address.
  • the symbol name may include a symbol name corresponding to instructions constituting the code 322 and a symbol name corresponding to a non-optimized function or variable in the code 322 .
  • an address corresponding to a symbol name may indicate a location at which an instruction, a function, or a variable indicated by the symbol is loaded into the memory.
  • the symbol information 321 may include a table-type symbol table in which symbol names and symbol addresses are one-to-one mapped, but is not limited thereto.
  • the hypervisor 301 may include a symbol loading module 310 , an instruction modification module 320 , and a trap module 330 .
  • the symbol loading module 310 may load the symbol information 321 (eg, a symbol table) of the guest virtual machine 302 into the hypervisor 301 .
  • the symbol loading module 310 extracts the symbol information 321 from the binary 320 and stores it in a database of the hypervisor 301, and transmits the symbol information 321 to the hypervisor 301 at a specified time. It may be loaded into a memory (eg, RAM) of the visor 301 .
  • the designated time point may include a booting time point of the electronic device.
  • the symbol loading module 310 extracts the symbol information 321 from the binary 320 before the booting time of the electronic device, stores it in the database of the hypervisor 301, and stores it in the hypervisor 301 at the booting time. It can be loaded into the memory of the visor 301 .
  • the hypervisor 301 may extract the code 322 and data 323 from the binary 320 at boot time and load it into the memory (eg, RAM) of the guest virtual machine 302 . .
  • the instruction modification module 320 may modify the code 322 of the guest virtual machine 302 .
  • the instruction modification module 320 may search for an address of a given target symbol from the symbol information 321 loaded by the symbol loading module 310 .
  • the instruction modification module 320 may determine an address mapped to a symbol name corresponding to the target symbol in the symbol table as the address of the target symbol.
  • the instruction modification module 320 may store an instruction corresponding to the searched address of the target symbol in the memory of the hypervisor 301 .
  • the instruction modification module 320 may access the memory of the guest virtual machine 302 based on the address of the target symbol and store the first instruction having the corresponding address in the memory of the hypervisor 301 .
  • the first instruction stored in the memory of the guest virtual machine 302 is It may include copying to the memory of the hypervisor 301 , or moving the storage location of the first instruction from the memory of the guest virtual machine 302 to the memory of the hypervisor 301 .
  • the instruction modification module 320 may replace the first instruction with the second instruction.
  • the second instruction may include an instruction for invoking the hypervisor 301 .
  • the instruction for calling the hypervisor 301 may include an instruction for generating a trap from the guest virtual machine 302 to the hypervisor 301 .
  • a trap may include a software phenomenon in which an execution subject of a specified instruction is changed from the guest virtual machine 302 to the hypervisor 301 .
  • the instruction modification module 320 is configured to perform a first corresponding to the target symbol at a specified time before the guest virtual machine 302 executes the code 322 of the guest virtual machine 302 corresponding to the target symbol.
  • the instruction may be replaced with the second instruction.
  • the instruction modification module 320 converts the first instruction to a second instruction before the guest virtual machine 302 executes the code including the first instruction at boot time or during run-time after booting. It can be replaced with an instruction.
  • the trap module 330 may generate a trap to the hypervisor as the guest virtual machine 302 executes the second instruction. Since the trap has been described above, a redundant description will be omitted.
  • the trap module 330 may acquire register information of the guest virtual machine 302 at the trap time.
  • a register is located in the processor and may temporarily store data that the processor can use immediately.
  • a register is a general register used for storing general data, a stack pointer, a special register used for a special purpose, and/or an address register ( address register).
  • the register information may include at least one of a result value of an operation processed by the processor, an intermediate result value, information indicating an execution state of a program, and a memory address.
  • the trap module 330 may execute a designated code based on the acquired register information.
  • the trap module 330 may analyze the first instruction stored in the memory of the hypervisor 301 based on the register information.
  • the designated code may be differently designated according to the first instruction, and, for example, may include code for at least one of security and debugging.
  • the trap module 330 may execute a code designated to perform a security check function when the first instruction is an instruction requiring security check, and the first instruction If this is an instruction that requires debugging, you can execute the code specified to perform the debugging function.
  • the trap module 330 may execute the first instruction stored in the memory of the hypervisor 301 after executing the specified code. According to an embodiment, the trap module 330 may determine whether to execute the first instruction stored in the memory of the hypervisor 301 based on the execution result of the specified code. For example, the trap module 330 may perform a debugging function as the specified code is executed, and may check whether an error exists in the first instruction. When it is determined that there is no error in the first instruction as a result of the execution of the specified code, the trap module 330 may execute the first instruction stored in the memory of the hypervisor 301 .
  • the trap module 330 may shut down the entire electronic device or shut down only the application related to the first instruction. it is not As another example, the trap module 330 may perform a security check function (or a security check function) as a specified code is executed and check whether a security flaw exists. When it is determined that there is no security flaw as a result of executing the specified code, the trap module 330 may execute the first instruction stored in the memory of the hypervisor 301 . When it is determined that a security flaw exists as a result of the execution of the specified code, the trap module 330 may shut down the entire electronic device or shut down only the application related to the first instruction.
  • a security check function or a security check function
  • the trap module 330 may control to return to the guest virtual machine 302 from the hypervisor 301 after executing the first instruction.
  • return may include moving from the current code execution position to a position immediately following the instruction that called the current code.
  • the trap module 330 executes the first instruction and moves the code execution position to the next position of the second instruction that generated the trap from the guest virtual machine 302 to the hypervisor 301. have. After returning from the hypervisor 301 to the guest virtual machine 302 , the guest virtual machine 302 may execute the code from the instruction following the second instruction.
  • FIG. 4 is a diagram 400 illustrating an operation of a hypervisor according to an embodiment.
  • operations of the hypervisor eg, the hypervisor 301 of FIG. 2
  • a processor eg, the processor ( ) of FIG. 1
  • the electronic device eg, the electronic device 101 of FIG. 1 ). 120
  • the binary 410 of the guest virtual machine may include code 411 and symbol information 412 .
  • the code 411 may include code loaded into the memory of the guest virtual machine to drive the guest virtual machine.
  • the code 411 may include an instruction set including a plurality of instructions.
  • the code 411 may include an instruction D 411_1 , an instruction E 411_2 , and an instruction F 411_3 .
  • the symbol information 412 is information for identifying the code 411 or an instruction included in the code 411, and corresponds to the symbol name (eg, AA, AB, or AC) and the symbol name. It may include an address (eg, 0xa000, 0xa008, or 0xa010). According to an embodiment, one symbol name and one address may be mapped to each of the instructions.
  • the symbol name “AA” and the address “0xa000” may be mapped to the instruction D (411_1), and the symbol name “AB” and the address “0xa008” may be mapped to the instruction E (411_2), The symbol name “AC” and the address “0xa010” may be mapped to the instruction F (411_3).
  • the hypervisor may identify the instruction based on a symbol name or an address.
  • the hypervisor may extract the symbol information 412 of the guest virtual machine from the binary 410 and load it into the memory 420 of the hypervisor (operation 401).
  • the extraction of the symbol information 412 may include copying the symbol information 412 .
  • the hypervisor may extract the symbol information 412 from the binary 410 in advance before booting.
  • the hypervisor may store the extracted symbol information 412 in a database of the hypervisor, and may load it into the memory 420 of the hypervisor at boot time.
  • the hypervisor may search for an address of a given target symbol based on the symbol information 412 of the guest virtual machine loaded into the memory 420 of the hypervisor, and identify an instruction corresponding to the retrieved address. have.
  • FIG. 5 is a diagram 500 illustrating an operation of a hypervisor according to an embodiment.
  • operations of a hypervisor eg, the hypervisor 301 of FIG. 2
  • a guest virtual machine eg, the guest virtual machine 302 of FIG. 2
  • FIG. 5 operations of a hypervisor (eg, the hypervisor 301 of FIG. 2 ) and a guest virtual machine (eg, the guest virtual machine 302 of FIG. 2 ) described with reference to FIG. 5 are performed by an electronic device (eg, FIG. 1 ) may be performed by a processor (eg, the processor 120 of FIG. 1 ) of the electronic device 101 of FIG.
  • FIG. 5 is a view after the hypervisor performs the operation (operation 401) described with reference to FIG. 4 .
  • a symbol table 511 may be loaded into the memory 520 of the hypervisor.
  • the symbol table 511 may mean symbol information in which a symbol name and an address corresponding to the symbol name are stored in the form of a table.
  • the guest virtual machine when the hypervisor loads the symbol table into the memory 520 of the hypervisor, the guest virtual machine writes code including instructions A, B, C, D, and E to the guest virtual machine. may be loaded into the machine's memory 530 .
  • the code including instruction A, instruction B, instruction C, instruction D, and instruction E includes at least a portion of the code copied from the binary (eg, binary 410 of FIG. 4 ) by the guest virtual machine.
  • a time at which the symbol table 511 and instructions A to E are loaded into each memory may be a booting time.
  • a guest virtual machine exists above hardware (eg, a processor or memory), and a hypervisor exists above the guest virtual machine.
  • the memory 530 of the guest virtual machine may be displayed on the memory 520 of the hypervisor.
  • the hypervisor may search for an address of a given target symbol (eg, symbol DD) from the symbol table 511 (operation 1).
  • the target symbol may include a symbol name corresponding to an instruction to be modified by the hypervisor.
  • the hypervisor may retrieve the address of a symbol whose symbol name is “DD” from the symbol table 511 .
  • the hypervisor identifies an instruction corresponding to an address (eg, an address of symbol DD) retrieved from the symbol table 511 from among codes of the guest virtual machine loaded into the memory 530 of the guest virtual machine. It can be done (operation 503).
  • the hypervisor may identify “instruction D” corresponding to the address of a symbol whose symbol name is “DD”.
  • the hypervisor may replace the first instruction (eg, instruction D) corresponding to the address of the target symbol with the second instruction (eg, hypervisor call (HVC) D) (operation 505).
  • the second instruction may include an instruction for invoking a hypervisor, but is not limited thereto, and may include various instructions for generating a trap to the hypervisor.
  • a trap from the guest virtual machine to the hypervisor may occur.
  • the hypervisor may store the first instruction in the memory 520 of the hypervisor (operation 507 ). According to an embodiment, the hypervisor stores the first instruction in the memory 520 of the hypervisor, so that the hypervisor may execute the first instruction after being trapped from the guest virtual machine to the hypervisor.
  • FIG. 6 is a diagram 600 illustrating an operation of a hypervisor according to an embodiment.
  • operations of the hypervisor eg, the hypervisor 301 of FIG. 2
  • the guest virtual machine eg, the guest virtual machine 302 of FIG. 2
  • FIG. 6 operations of the hypervisor (eg, the hypervisor 301 of FIG. 2 ) and the guest virtual machine (eg, the guest virtual machine 302 of FIG. 2 ) described with reference to FIG. 6 are performed by an electronic device (eg, FIG. 1 ) may be performed by a processor (eg, the processor 120 of FIG. 1 ) of the electronic device 101 of FIG.
  • FIG. 6 is a diagram after the hypervisor performs the operation (eg, operation 401) described with reference to FIG. 4 and the operation (eg, operation 501 to operation 507) described with reference to FIG. 5 .
  • a first instruction eg, instruction D
  • a second instruction eg, HVC D
  • the guest virtual machine may execute the code loaded in the memory 630 of the guest virtual machine according to the code flow (operation 601 ).
  • the guest virtual machine may execute code in the following order: Instruction A, Instruction B, Instruction C, HVC D, and Instruction E.
  • the guest virtual machine may generate a trap to the hypervisor by executing a second instruction (eg, HVC D) while performing operation 601 (operation 603 ).
  • the guest virtual machine may generate a trap to the hypervisor by sequentially executing instruction A, instruction B, and instruction C and then executing HVC D.
  • the hypervisor may execute the specified code (operation 605 ).
  • the hypervisor may acquire register information of the guest virtual machine at the trap time.
  • the register information of the guest virtual machine may include data or an address stored in the register of the guest virtual machine at the trap time.
  • the register information may include information indicating a code execution state of the guest virtual machine, a result value and/or an intermediate value of an operation executed by the guest virtual machine, and/or register information affecting system operation.
  • the hypervisor may execute a designated code based on the acquired register information. For example, when it is determined that the hypervisor needs to perform the security check function based on the register information, it may execute a code designated to perform the security check function, but is not limited thereto. As another example, when the hypervisor determines that it is necessary to perform a debugging function based on register information, it may execute a code designated to perform a debugging function.
  • the hypervisor may execute the first instruction (eg, instruction D) stored in the memory 620 of the hypervisor (operation 607 ).
  • the hypervisor may determine whether to execute the first instruction (eg, instruction D) based on the execution result of the specified code.
  • the hypervisor may execute the first instruction (eg, instruction D) as it determines to execute the first instruction (eg, instruction D) based on the execution result of the specified code.
  • the hypervisor may not be executed. .
  • the hypervisor determines not to execute the first instruction (eg, instruction D)
  • it may shut down the entire electronic device or shut down an application that operates abnormally, but is not limited thereto. it is not
  • the hypervisor executes a first instruction (eg, instruction D) stored in the memory 620 of the hypervisor, and then returns an instruction (eg, RET) from the hypervisor to the guest virtual machine. to guest) (operation 609).
  • the hypervisor may change the code execution location by performing operation 609 .
  • the code execution location may be changed to a location next to the second instruction (eg, HVC D) that called the hypervisor in the guest virtual machine.
  • the guest virtual machine may resume code execution (operation 611 ).
  • the guest virtual machine may resume code execution from the next instruction (eg, instruction E) of the second instruction (eg, HVC D) that generated the trap to the hypervisor.
  • FIG. 7 is a flowchart 700 illustrating an operation of an electronic device according to an exemplary embodiment. Operations of the electronic device described below with reference to FIG. 7 may be performed by a processor (eg, the processor 120 of FIG. 1 ) of the electronic device (eg, the electronic device 101 of FIG. 1 ).
  • a processor eg, the processor 120 of FIG. 1
  • the electronic device eg, the electronic device 101 of FIG. 1 .
  • the electronic device may include a processor and a memory (eg, the memory 130 of FIG. 1 ).
  • the memory may store a hypervisor (eg, the hypervisor 301 of FIG. 3 ) and at least one guest virtual machine (eg, the guest virtual machine 302 of FIG. 3 ).
  • the processor may perform a function of the hypervisor or the guest virtual machine by accessing the memory and executing code or instructions of the hypervisor or the guest virtual machine.
  • the electronic device may extract symbol information from the guest virtual machine and load the extracted symbol information into a hypervisor.
  • the electronic device may extract symbol information of the guest virtual machine from a binary of the guest virtual machine.
  • the binary of the guest virtual machine may include data and information that the electronic device loads into a memory to drive the guest virtual machine.
  • the binary of the guest virtual machine may include symbol information of the guest virtual machine, code of the guest virtual machine, and data of the guest virtual machine.
  • the binary may be stored in the hard disk, and the electronic device may extract symbol information of the guest virtual machine stored in the hard disk.
  • the electronic device may load the extracted symbol information into the memory of the hypervisor.
  • the electronic device may load symbol information of a guest virtual machine stored in a hard disk into a random access memory (RAM).
  • RAM random access memory
  • the electronic device may extract symbol information of the guest virtual machine in advance before booting, store it in a database of the hypervisor, and load the symbol information into the memory of the hypervisor at boot time.
  • the symbol information may include information for identifying an instruction of a guest virtual machine.
  • the symbol information may include a symbol name and an address corresponding to the symbol name.
  • a symbol means a minimum unit capable of having an absolute address, and an instruction of a guest virtual machine may have a symbol name and address corresponding thereto.
  • the electronic device may load the code of the guest virtual machine extracted from the binary into the memory of the guest virtual machine at boot time. According to an embodiment, the electronic device may identify the memory location of the instruction included in the code of the guest virtual machine loaded into the memory of the guest virtual machine based on the symbol information. According to an embodiment, the electronic device may access the memory based on the address of the instruction to be modified identified based on the symbol information.
  • the electronic device may retrieve the address of the target symbol from the symbol information.
  • the electronic device may search for an address of a given target symbol from symbol information loaded into the hypervisor.
  • the target symbol may mean a symbol indicating an instruction to be modified by the hypervisor from among codes of the guest virtual machine.
  • the target symbol may include a symbol name corresponding to the instruction to be modified.
  • the symbol information may include a symbol table in which a symbol name and a symbol address corresponding to the symbol name are one-to-one mapped.
  • the electronic device may search for an address corresponding to the given symbol name in the symbol table, and may determine the address corresponding to the given symbol name as the address of the target symbol.
  • the electronic device may store the first instruction corresponding to the address in the hypervisor, and may replace the first instruction with the second instruction.
  • the electronic device may access a specific memory location based on the address of the target symbol, and the instruction stored in the specific memory location may be a first instruction that is one of instructions included in the code of the guest virtual machine. have.
  • the electronic device may store the first instruction in the memory of the hypervisor and change the first instruction into the second instruction.
  • the second instruction may include an instruction for invoking a hypervisor, for example, an instruction for generating a trap from the guest virtual machine to the hypervisor.
  • the electronic device may generate a trap from the guest virtual machine to the hypervisor as the second instruction is executed during code execution of the guest virtual machine by replacing the first instruction with the second instruction.
  • the electronic device may control the hypervisor to execute the first instruction after trapping from the guest virtual machine to the hypervisor.
  • the electronic device may generate a trap to the hypervisor as the second instruction is executed in the guest virtual machine.
  • the electronic device may sequentially execute the code loaded in the memory of the guest virtual machine according to the code flow, and as the second instruction is executed, the code execution in the guest virtual machine is stopped and the code is transferred to the hypervisor. It can generate traps.
  • the electronic device may acquire register information of the guest virtual machine at the trap time in the hypervisor.
  • the electronic device may control the hypervisor to acquire information stored in a register of the guest virtual machine at a trap time.
  • the register is a temporary storage device located in the processor, and may store information indicating an operation result executed by the processor and an execution state of a program being executed by the processor.
  • register information of the guest virtual machine acquired at the time of the trap may include internal information of the guest virtual machine.
  • the electronic device may execute a designated code based on register information in the hypervisor.
  • the specified code may include a code for security check or debugging.
  • the electronic device may control the hypervisor to execute a code designated to perform the security check function.
  • the electronic device may execute a code designated to perform the debugging function.
  • the electronic device may execute the first instruction in the hypervisor.
  • the electronic device may determine whether to execute the first instruction stored in the memory of the hypervisor based on the execution result of the specified code.
  • the electronic device may perform operation 713 upon determining that the first instruction is to be executed, and may shut down the entire system or an application that has performed an abnormal operation upon determining not to execute the first instruction. can For example, when it is determined that there is an error in the first application as a result of executing the code for debugging, the electronic device may shut down the first application, but is not limited thereto.
  • the electronic device may control to return from the hypervisor to the guest virtual machine.
  • the electronic device may control the hypervisor to execute an instruction to return to the guest virtual machine from the hypervisor after executing the first instruction.
  • the electronic device may control the guest virtual machine to resume code execution.
  • the electronic device may execute the code of the guest virtual machine from the next instruction (second instruction) that generates a trap from the guest virtual machine to the hypervisor.
  • the hypervisor modifies the code of the guest virtual machine during run-time after booting, and the guest virtual machine executes the code or accesses the memory at any point in time. It can support monitoring virtual machines. Accordingly, the electronic device according to an embodiment may allow the hypervisor to participate in all functions of the guest virtual machine, collect information, and block actions. On the other hand, since the guest virtual machine cannot check the code flow and the code execution location of the hypervisor, the electronic device according to an embodiment may provide enhanced security.
  • the electronic device allows the hypervisor to directly modify the code of the guest virtual machine at runtime, so that no minimum requirements are included in the compile step of the guest virtual machine, and thus various types of guest virtual machines It is applicable to , and there is no need to port the code for the hypervisor in the compilation stage of the guest virtual machine, so it is possible to block the code exposure of the hypervisor and to facilitate the maintenance of the software.
  • the electronic device provides a more powerful debugging function to the guest virtual machine or adds a new function by allowing a hypervisor with higher privilege than the guest virtual machine to modify the code of the guest virtual machine and execute the specified code. can do.
  • FIGS. 8A to 8C a method for an electronic device to monitor a virtual machine at various points in time using a hypervisor according to an embodiment will be described with reference to FIGS. 8A to 8C .
  • FIGS. 8A to 8C are diagrams 800 , 820 , and 840 illustrating a virtual machine monitoring method using a hypervisor of an electronic device according to an exemplary embodiment.
  • the electronic device eg, the electronic device 101 of FIG. 1
  • accesses a memory eg, the memory 130 of FIG. 1
  • a processor eg, the processor 120 of FIG. 1
  • a hypervisor (or host operating system) 801 and a guest operating system 802 may be executed.
  • an operation performed by the hypervisor 801 and an operation performed by the guest operating system 802 may be performed by a processor of the electronic device.
  • FIG. 8A is a diagram for monitoring a timing at which the hypervisor 801 jumps from a first function (eg, Function A) to a second function (eg, Function B) in the guest operating system 802 according to an embodiment.
  • the hypervisor 801 transmits a first instruction for calling a second function (eg, Function B) to the hypervisor while a first function (eg, Function A) among codes of the guest operating system 802 is being executed. can be replaced with the second instruction that calls
  • the hypervisor 801 may replace the first instruction with the second instruction after booting and before the code including the first instruction is executed.
  • the guest operating system 802 may execute a first function (eg, Function A) according to a code flow before the first instruction (operation 811 ).
  • the guest operating system 802 may jump from a first function (eg, Function A) to a second function (eg, Function B) as the first instruction is executed (operation 812 ).
  • the guest operating system 802 may perform operation 811 in the same manner and may be trapped by the hypervisor 801 as the second instruction is executed (operation 813 ).
  • the hypervisor 801 may acquire internal information of the guest operating system 802 at the trap time.
  • the internal information of the guest operating system 802 may include register information stored in a special register, a general register, and a stack pointer of the guest virtual machine.
  • the hypervisor 801 may restore an argument of the second function (eg, Function B) based on register information of the guest virtual machine at the trap time. According to an embodiment, the hypervisor 801 may perform at least one of security check or debugging for the second function (eg, Function B) based on the restored function argument. According to an embodiment, the hypervisor 801 may perform security check or debugging by executing a specified code (operation 815 ).
  • the hypervisor 801 may determine whether to execute the second function (eg, Function B) based on the execution result of the specified code. According to an embodiment, the hypervisor 801 may perform operation 817 upon determining that the second function (eg, Function B) is to be executed, and indicates that the second function (eg, Function B) is not executed. Depending on the decision, all or part of the electronic device (eg, a specific app) may be shut down.
  • the second function eg, Function B
  • the hypervisor 801 may perform operation 817 upon determining that the second function (eg, Function B) is to be executed, and indicates that the second function (eg, Function B) is not executed. Depending on the decision, all or part of the electronic device (eg, a specific app) may be shut down.
  • the hypervisor 801 may perform an instruction (eg, RET to guest) returning from the hypervisor 801 to the guest operating system 802 (operation 817 ). ).
  • an instruction eg, RET to guest
  • the guest virtual machine 802 may execute a second function (eg, Function B) (operation 819 ).
  • the guest operating system 802 starts from the code position of the second function (eg, Function B) called by the first instruction (eg, the starting point of the second function (eg, Function B) code).
  • the code of the second function can be executed.
  • the guest operating system 802 executes the code of the second function (eg, Function B) and then executes the instruction that returns to the first function (eg, Function A), so that the first function (eg, Function A) is executed.
  • the guest operating system 802 may resume execution of the first function (eg, Function A) using the return value (operation 823 ).
  • the hypervisor 801 may monitor the jump timing from the first function (eg, Function A) to the second function (eg, Function B) in the guest operating system 802 .
  • FIG. 8B is a diagram illustrating a method for monitoring a time point at which the hypervisor 801 returns from a first function (eg, Function B) to a second function (eg, Function A) in the guest operating system 802 according to an embodiment.
  • the hypervisor 801 transmits a first instruction returning as a second function (eg, Function A) to a second function (eg, Function A) after execution of a first function (eg, Function B) among codes of the guest operating system 802 to the hypervisor can be replaced with the second instruction that calls
  • the hypervisor 801 may replace the first instruction with the second instruction after booting and before the code including the first instruction is executed.
  • the guest operating system 802 may execute a second function (eg, Function A) according to a code flow (operation 831 ).
  • a second function eg, Function A
  • the guest operating system 802 executes an instruction that calls the first function (eg, Function B) during execution of the second function (eg, Function A), the first function (eg, Function B) to the second function (eg, Function B) : You can jump to Function A) (operation 833).
  • the guest operating system 802 may execute the first function (eg, Function B) according to the code flow (operation 835 ).
  • the guest operating system 802 executes a first function (eg, Function B) and then returns a first function (eg, Function B) to a second function (eg, Function A). instruction can be executed. As the guest operating system 802 executes the first instruction, it may return from the first function (eg, Function B) to the second function (eg, Function A) (operation 836 ). According to an embodiment, the guest operating system 802 may execute a second instruction for calling the hypervisor 801 after executing the first function (eg, Function B). The guest operating system 802 may be trapped by the hypervisor 801 as it executes the second instruction (operation 837 ).
  • a first function eg, Function B
  • a second function eg, Function A
  • instruction can be executed.
  • the guest operating system 802 may return from the first function (eg, Function B) to the second function (eg, Function A) (operation 836 ).
  • the guest operating system 802 may execute a second instruction for calling the hypervisor 801 after executing the first
  • the hypervisor 801 may obtain register information from a register of the guest virtual machine at the trap time. According to an embodiment, the hypervisor 801 may restore a return value of a first function (eg, Function B) to a second function (eg, Function A) based on register information. According to an embodiment, the hypervisor 801 may perform at least one of security check or debugging for the second function (eg, Function A) based on the restored function return value. According to an embodiment, the hypervisor 801 may perform security check or debugging by executing a specified code (operation 839).
  • a specified code operation 839
  • the hypervisor 801 may determine whether to resume execution of the second function (eg, Function A) based on the execution result of the specified code. According to an embodiment, the hypervisor 801 may perform operation 841 upon determining that execution of the second function (eg, Function A) is resumed and execute the second function (eg, Function A). By deciding not to resume, you may shut down all or part of an electronic device (eg, a specific app).
  • the hypervisor 801 may perform an instruction (eg, RET to guest) returning from the hypervisor 801 to the guest operating system 802 (operation 841 ). ).
  • an instruction eg, RET to guest
  • the hypervisor 801 may return to the second function (eg, Function A) as operation 841 is performed and may return a return value.
  • the guest operating system 802 may resume execution of the second function (eg, Function A) using the return value (operation 843 ).
  • the guest operating system 802 determines that the code position (eg, the second function (eg, Function A) of the second function (eg, Function A) returned by the first instruction) is the first function (eg, Function A).
  • the code of the second function (eg Function A) can be executed from the starting point of the next instruction of the instruction that calls Function B).
  • the hypervisor 801 may monitor a return time point from the first function (eg, Function B) to the second function (eg, Function A) in the guest operating system 802 .
  • FIG. 8C is a diagram illustrating a method of monitoring when the hypervisor 801 accesses a memory in the guest operating system 802 according to an embodiment.
  • the hypervisor 801 converts a first instruction (eg, Instruction D) that accesses a memory among codes of the guest operating system 802 into a second instruction (eg, HVC D) that calls the hypervisor. can be replaced
  • the hypervisor 801 may replace the first instruction (eg, Instruction D) with the second instruction (eg, HVC D) after booting and before the code including the first instruction is executed.
  • the guest operating system 802 may execute the code according to the code flow until the first instruction (eg, HVC D) (operation 851 ).
  • the guest operating system 802 may execute instruction A, instruction B, and instruction C.
  • the guest operating system 802 may be trapped by the hypervisor 801 as it executes the second instruction (eg, HVC D) after executing instruction A, instruction B, and instruction C. (Act 853).
  • the second instruction eg, HVC D
  • the hypervisor 801 may acquire internal information of the guest operating system 802 at a trap time by executing a specified code (operation 855).
  • the internal information of the guest operating system 802 may include register information stored in an address register of the guest virtual machine.
  • the register information may include, for example, a memory address indicating a memory location from which the guest operating system 802 accesses a memory and a memory value corresponding to the memory address.
  • a memory address obtained by the hypervisor 801 at a trap time is referred to as a first address.
  • the hypervisor 801 may convert the first address into the second address.
  • the first address may be an address used by the guest operating system 802
  • the second address may be an address used by the hypervisor 801 .
  • the first address may be a virtual address
  • the second address may be a physical address.
  • the hypervisor 801 may convert the first address into a second address based on page mapping information (eg, a page table) (operation 857).
  • page mapping information eg, a page table
  • a page may mean a unit constituting a memory.
  • the page mapping may mean creating or setting a correspondence relationship between a page of a virtual memory used by the guest operating system 802 and a page of a real memory.
  • the hypervisor 801 may perform page mapping and convert the first address into the second address (operation 857).
  • the hypervisor 801 may execute a first instruction (eg, Instruction D′) based on the second address (operation 859 ). According to an embodiment, the hypervisor 801 may access the memory through a memory location corresponding to the second address.
  • a first instruction eg, Instruction D′
  • the hypervisor 801 may access the memory through a memory location corresponding to the second address.
  • the hypervisor 801 may perform an instruction (eg, RET to guest) returning from the hypervisor 801 to the guest operating system 802 (operation 861 ). ).
  • an instruction eg, RET to guest
  • the guest operating system 802 may resume execution of code (operation 863 ). According to an embodiment, the guest operating system 802 may execute the code from the starting point of the next instruction (eg, Instruction E) of the first instruction (eg, Instruction D) to be trapped by the hypervisor.
  • the guest operating system 802 may execute the code from the starting point of the next instruction (eg, Instruction E) of the first instruction (eg, Instruction D) to be trapped by the hypervisor.
  • the hypervisor 801 may monitor every point in time when the guest operating system 802 accesses the memory.
  • the electronic device (eg, the electronic device 101 of FIG. 1 ) includes at least one guest virtual machine (eg, the guest virtual machine 302 of FIG. 3 ). ) and a memory (eg, memory 130 of FIG. 1 ) storing a hypervisor (eg, hypervisor 230 of FIG. 2 , or hypervisor 301 of FIG. 3 ); and a processor (eg, processor 120 of FIG. 1 ) operatively coupled to the memory.
  • a hypervisor eg, hypervisor 230 of FIG. 2 , or hypervisor 301 of FIG. 3
  • processor eg, processor 120 of FIG. 1
  • the processor searches for an address of a target symbol from symbol information of a guest virtual machine loaded into the hypervisor, and the guest virtual machine
  • a first instruction corresponding to the address of may be stored in the hypervisor, and the first instruction may be replaced with a second instruction that calls the hypervisor.
  • the processor as a second operation, the processor generates a trap to the hypervisor by executing the second instruction in the guest virtual machine, and at the time of the trap in the hypervisor Acquire register information of the guest virtual machine, execute a designated code based on the register information in the hypervisor, execute the first instruction stored in the hypervisor, and from the hypervisor It can be controlled to return to the guest virtual machine.
  • the processor extracts the symbol information from a binary of the guest virtual machine and stores it in a database of the hypervisor, and a designated time point may control to load the symbol information into the memory of the hypervisor.
  • the designated time point may include a booting time point of the electronic device.
  • the symbol information may include a symbol name for identifying an instruction of the guest virtual machine and an address corresponding to the symbol name.
  • the processor may perform the first operation at a booting time of the electronic device or at a specified time after the booting time before executing the code including the first instruction in the guest virtual machine. have.
  • the designated code may include a code for at least one of security check or debugging of the first instruction stored in the hypervisor.
  • the processor may determine whether to execute the first instruction stored in the hypervisor based on an execution result of the specified code.
  • the processor when the first instruction is an instruction that calls a second function during execution of a first function, the processor, as the second operation, performs a function based on the register information in the hypervisor. restore an argument, perform at least one of security check or debugging for the second function based on the function argument in the hypervisor, and control to return from the hypervisor to the guest virtual machine;
  • the second function may be controlled to be executed in the guest virtual machine.
  • the processor when the first instruction is an instruction that returns to a second function after execution of the first function, the processor, as the second operation, performs a function return value ( return value), the hypervisor performs at least one of security check or debugging for the second function based on the function return value, and controls to return from the hypervisor to the guest virtual machine;
  • the second function may be controlled to be executed in the guest virtual machine.
  • the processor when the first instruction is an instruction for the guest virtual machine to access the memory, the processor, as the second operation, is trapped from the guest virtual machine to the hypervisor. , obtain in the hypervisor a first address at which the guest virtual machine accesses the memory, and in the hypervisor convert the first address into a second address at which the hypervisor accesses the memory, and the hypervisor may control to execute the first instruction based on the second address and return from the hypervisor to the guest virtual machine.
  • a hypervisor eg, the hypervisor 230 of FIG. 2
  • the hypervisor of FIG. 3 of an electronic device eg, the electronic device 101 of FIG. 1
  • a guest virtual machine eg, the guest virtual machine 302 of FIG.
  • symbol information is extracted from the guest virtual machine and loaded into the hypervisor ( loading); retrieving an address of a target symbol from the symbol information; storing a first instruction corresponding to the address of the guest virtual machine in the hypervisor and replacing the first instruction with a second instruction that calls the hypervisor; generating a trap to the hypervisor according to the execution of the second instruction in the guest virtual machine; acquiring register information of the guest virtual machine at the trap time in the hypervisor; executing a designated code based on the register information in the hypervisor; executing the first instruction stored in the hypervisor; and controlling to return from the hypervisor to the guest virtual machine.
  • the loading of the symbol information may include: extracting the symbol information from a binary of the guest virtual machine and storing it in a database of the hypervisor; and controlling to load the symbol information into the memory of the hypervisor at a specified time.
  • the designated time point may include a booting time point of the electronic device.
  • the symbol information may include a symbol name for identifying an instruction of the guest virtual machine and an address corresponding to the symbol name.
  • the operation of retrieving the address of the target symbol and the operation of storing the first instruction in the hypervisor and replacing the first instruction with the second instruction may include: a booting time of the electronic device; Alternatively, it may be performed at a specified time after the booting point before executing the code including the first instruction in the guest virtual machine.
  • the designated code may include a code for at least one of security check or debugging of the first instruction stored in the hypervisor.
  • the method may further include determining whether to execute the first instruction stored in the hypervisor based on an execution result of the specified code.
  • the hypervisor when the first instruction is an instruction that calls a second function during execution of a first function, after the operation of obtaining the register information, the hypervisor performs a function based on the register information an operation to restore an argument; performing at least one of security check or debugging for the second function based on the function argument in the hypervisor; controlling return from the hypervisor to the guest virtual machine; and controlling the guest virtual machine to execute the second function.
  • the hypervisor when the first instruction is an instruction that returns to a second function after the execution of the first function, after the operation of obtaining the register information, the hypervisor returns a function return value ( return value); performing at least one of security check or debugging for the second function based on the function return value in the hypervisor; controlling return from the hypervisor to the guest virtual machine; and controlling the guest virtual machine to execute the second function.
  • return value return value
  • the hypervisor when the first instruction is an instruction for the guest virtual machine to access the memory, after generating a trap to the hypervisor, the hypervisor obtaining, by the virtual machine, a first address to access the memory; converting the first address at the hypervisor into a second address at which the hypervisor accesses the memory; executing the first instruction based on the second address in the hypervisor; and controlling to return from the hypervisor to the guest virtual machine.
  • the electronic device may have various types of devices.
  • the electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device.
  • a portable communication device eg, a smart phone
  • a computer device e.g., a smart phone
  • a portable multimedia device e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a wearable device e.g., a smart bracelet
  • a home appliance device e.g., a home appliance
  • first, second, or first or second may be used simply to distinguish the element from other elements in question, and may refer to elements in other aspects (e.g., importance or order) is not limited. It is said that one (eg, first) component is “coupled” or “connected” to another (eg, second) component, with or without the terms “functionally” or “communicatively”. When referenced, it means that one component can be connected to the other component directly (eg by wire), wirelessly, or through a third component.
  • module used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logic block, component, or circuit.
  • a module may be an integrally formed part or a minimum unit or a part of the part that performs one or more functions.
  • the module may be implemented in the form of an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • one or more instructions stored in a storage medium may be implemented as software (eg, the program 140) including
  • a processor eg, processor 120
  • a device eg, electronic device 101
  • the one or more instructions may include code generated by a compiler or code executable by an interpreter.
  • the device-readable storage medium may be provided in the form of a non-transitory storage medium.
  • 'non-transitory' only means that the storage medium is a tangible device and does not include a signal (eg, electromagnetic wave), and this term is used in cases where data is semi-permanently stored in the storage medium and It does not distinguish between temporary storage cases.
  • a signal eg, electromagnetic wave
  • the method according to various embodiments disclosed in this document may be provided as included in a computer program product.
  • Computer program products may be traded between sellers and buyers as commodities.
  • the computer program product is distributed in the form of a machine-readable storage medium (eg compact disc read only memory (CD-ROM)), or via an application store (eg Play StoreTM) or on two user devices ( It can be distributed (eg downloaded or uploaded) directly between smartphones (eg: smartphones) and online.
  • a part of the computer program product may be temporarily stored or temporarily created in a machine-readable storage medium such as a memory of a server of a manufacturer, a server of an application store, or a relay server.
  • each component (eg, module or program) of the above-described components may include a singular or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. have.
  • one or more components or operations among the above-described corresponding components may be omitted, or one or more other components or operations may be added.
  • a plurality of components eg, a module or a program
  • the integrated component may perform one or more functions of each component of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. .
  • operations performed by a module, program, or other component are executed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations are executed in a different order, or omitted. or one or more other operations may be added.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

적어도 하나의 게스트 가상 머신(guest virtual machine) 및 하이퍼바이저(hypervisor)를 저장하는 메모리; 및 상기 메모리에 작동적으로 연결되는 프로세서를 포함하는 전자 장치가 개시된다. 상기 프로세서는, 제1 동작으로서, 상기 하이퍼바이저에 로딩된 게스트 가상 머신의 심볼(symbol) 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하고, 상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체하고, 제2 동작으로서, 상기 게스트 가상 머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키고, 상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하고, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하고, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하고, 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어할 수 있다. 이 외에도 명세서를 통해 파악되는 다양한 실시 예가 가능하다.

Description

하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치
본 문서에서 개시되는 실시 예들은, 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치에 관한 것이다.
하이퍼바이저(hypervisor)란, 하나의 호스트(host) 컴퓨터에서 복수의 게스트(guest) 운영 체제를 동시에 실행할 수 있도록 하는 가상 플랫폼 기술을 의미한다. 예를 들어, 하이퍼바이저는 메모리, 레지스터, 저장소, 디바이스 드라이버, 프로세서, 또는 네트워크와 같은 하드웨어 자원을 가상화하여 복수의 게스트 운영 체제에 분배할 수 있다.
하이퍼바이저는 게스트 운영 체제보다 높은 권한을 가지므로, 게스트 운영 체제가 루트(root) 권한을 탈취하더라도 하이퍼바이저를 해킹할 수 없어 보안 용도로 사용될 수 있다.
하이퍼바이저(hypervisor)는 게스트 가상 머신(guest virtual machine)과는 별개의 플랫폼이므로, 게스트 가상 머신의 내부 정보를 알 수 없는 것이 일반적이다. 따라서, 하이퍼바이저가 게스트 가상 머신의 동작에 관여할 수 있도록 하기 위해서는, 컴파일(compile) 단계에서 가상 머신에 하이퍼바이저를 위한 코드를 포팅(porting)해야 한다. 그러나, 다수의 게스트 가상 머신을 구동하는 하이퍼바이저의 측면에서 다수의 게스트 가상 머신에 일일이 코드를 포팅하는 것은 비효율적이며, 하이퍼바이저의 코드가 노출되어 해킹의 우려가 있다.
본 문서에 개시되는 다양한 실시 예들은, 하이퍼바이저가 런-타임(run-time) 중에 게스트 가상 머신의 코드 흐름(flow)을 직접 수정함으로써 게스트 가상 머신이 코드를 실행하거나 메모리에 접근하는 모든 시점을 모니터링할 수 있는 전자 장치 및 방법을 제공하고자 한다.
본 문서에 개시되는 일 실시 예에 따른 전자 장치는, 적어도 하나의 게스트 가상 머신(guest virtual machine) 및 하이퍼바이저(hypervisor)를 저장하는 메모리; 및 상기 메모리에 작동적으로 연결되는 프로세서를 포함하고, 상기 프로세서는, 제1 동작으로서, 상기 하이퍼바이저에 로딩된 게스트 가상 머신의 심볼(symbol) 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하고, 상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체하고, 제2 동작으로서, 상기 게스트 가상 머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키고, 상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하고, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하고, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하고, 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어할 수 있다.
또한, 본 문서에 개시되는 일 실시 예에 따른 전자 장치의 하이퍼바이저(hypervisor)를 이용한 게스트 가상 머신(guest virtual machine) 모니터링 방법은, 상기 게스트 가상 머신으로부터 심볼(symbol) 정보를 추출하여 상기 하이퍼바이저에 로딩(loading)하는 동작; 상기 심볼 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하는 동작; 상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체하는 동작; 상기 게스트 가상머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키는 동작; 상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하는 동작; 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하는 동작; 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하는 동작; 및 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작을 포함할 수 있다.
본 문서에 개시되는 다양한 실시 예들에 따르면, 하이퍼바이저가 런-타임(run-time) 중에 게스트 가상 머신의 코드 흐름(flow)을 직접 수정함으로써 게스트 가상 머신이 코드를 실행하거나 메모리에 접근하는 모든 시점을 모니터링할 수 있는 전자 장치 및 방법을 제공할 수 있다.
이 외에, 본 문서를 통해 직접적 또는 간접적으로 파악되는 다양한 효과들이 제공될 수 있다.
도 1은 다양한 실시 예들에 따른, 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는 하이퍼바이저가 적용된 일 실시 예에 따른 전자 장치의 소프트웨어 및 하드웨어의 계층 구조를 나타낸 도면이다.
도 3은 일 실시 예에 따른 하이퍼바이저와 게스트 가상 머신의 구조를 나타낸 도면이다.
도 4는 일 실시 예에 따른 하이퍼바이저의 동작을 나타낸 도면이다.
도 5는 일 실시 예에 따른 하이퍼바이저의 동작을 나타낸 도면이다.
도 6은 일 실시 예에 따른 하이퍼바이저의 동작을 나타낸 도면이다.
도 7은 일 실시 예에 따른 전자 장치의 동작을 나타낸 흐름도이다.
도 8a 내지 도 8c는 일 실시 예에 따른 전자 장치의 하이퍼바이저를 이용한 다양한 시점에서의 가상 머신 모니터링 방법을 나타낸 도면이다.
도면의 설명과 관련하여, 동일 또는 유사한 구성요소에 대해서는 동일 또는 유사한 참조 부호가 사용될 수 있다.
도 1은, 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다. 도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제 1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제 2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108)와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.
프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.
보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다.
메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다.
프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다.
입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다.
음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.
디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다.
오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.
센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다.
인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.
연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.
햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.
카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.
전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.
배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.
통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제 1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제 2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다.
무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제 2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.
안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다.
다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제 1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제 2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.
상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.
일실시예에 따르면, 명령 또는 데이터는 제 2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102, 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104, 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제 2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다.
이하, 도 2를 참조하여 일 실시 예에 따른 전자 장치의 계층 구조를 설명한다.
도 2는 하이퍼바이저가 적용된 일 실시 예에 따른 전자 장치의 소프트웨어 및 하드웨어의 계층 구조를 나타낸 도면(200)이다.
일 실시 예에 따르면, 전자 장치(예: 도 1의 전자 장치(101))는 소프트웨어 계층(250) 및 하드웨어 계층(210)을 포함할 수 있다. 일 실시 예에 따르면, 소프트웨어 계층(250)은 운영 체제(예: 도 1의 운영 체제(142)), 및 하이퍼바이저(230)를 포함할 수 있다. 일 실시예에 따르면, 소프트웨어 계층(250)은 운영 체제와 하드웨어 계층(210) 사이에 하이퍼바이저(230)를 포함할 수 있다.
일 실시 예에 따르면, 전자 장치는 리눅스 커널(251), 라이브러리(253), 안드로이드 런타임(255), 어플리케이션 프레임워크(257), 및 어플리케이션(259)을 포함하는 안드로이드(android) 운영 체제에 기반한 소프트웨어 계층(250)을 포함할 수 있으나, 이에 한정되는 것은 아니다. 예를 들어, 도 2에 도시된 안드로이드 운영 체제의 구성 및 구조의 적어도 일부가 변경될 수 있다. 다양한 실시예들에 따르면, 전자 장치는, iOS, 윈도우(windows), 심비안(Symbian), 타이젠(tizen), 또는 바다(bada)와 같은 다양한 운영 체제에 기반한 소프트웨어 계층을 포함할 수 있다.
일 실시 예에 따르면, 리눅스 커널(251)은 안드로이드의 최하위 계층으로, 백그라운드 스레드(background thread), 메모리 관리, 보안, 또는 디바이스 드라이버(device driver)와 같은 낮은 수준의 관리 기능을 수행할 수 있다. 일 실시 예에 따르면, 라이브러리(253)는 응용 프로그램(어플리케이션(259))들이 공통적으로 사용하는 라이브러리를 포함할 수 있으며, 라이브러리(253)는 전자 장치의 전반적인 속도를 결정하는 요소일 수 있다. 일 실시 예에 따르면, 안드로이드 런타임(255)은 어플리케이션을 실행하기 위해 최적화된 환경을 제공하며, 달빅 가상 머신(Dalvik virtual machine) 및 자바 코어 라이브러리(Java core libraries)를 포함할 수 있다. 일 실시 예에 따르면, 어플리케이션 프레임워크(257)는 안드로이드의 어플리케이션 프로그래밍 인터페이스(application programming interface, API)이다. 어플리케이션(259)은 리눅스 커널(251) 또는 라이브러리(253)를 직접 호출할 수 없고, 어플리케이션 프레임워크(257)를 통해 리눅스 커널(251) 또는 라이브러리(253)의 기능을 요청할 수 있다. 일 실시 예에 따르면, 어플리케이션(259)은 사용자가 직접 사용하는 소프트웨어로, 예를 들어, 홈 화면, 전화 걸기, 웹 브라우저, 갤러리, 또는 게임과 같은 응용 프로그램을 포함할 수 있다.
일 실시 예에 따르면, 하드웨어 계층(210)은 프로세서(예: 도 1의 프로세서(120))(예: 중앙처리장치(central processing unit, CPU)), 메모리(예: 도 1의 메모리(130))(예: RAM(random access memory), ROM(read only memory), 또는 하드디스크(hard disk)), 네트워크, 또는 입출력 장치와 같은 물리적 자원(resource)을 포함할 수 있다.
비교 실시 예에 따르면, 전자 장치는 하드웨어 계층(210) 위에 바로 운영 체제를 포함할 수 있으며, 이 경우, 리눅스 커널(251)이 직접 하드웨어를 구동시키게 된다.
일 실시 예에 따르면, 전자 장치는 하드웨어 계층(210)과 운영 체제 사이에 하이퍼바이저(230)를 포함할 수 있으며, 이 경우, 하드웨어는 하이퍼바이저(230)를 통해 리눅스 커널(251)에 제공될 수 있다.
본 문서에 개시되는 하이퍼바이저(230)는 호스트 컴퓨터(host computer)(예: 도 1의 전자 장치(101))에서 복수의 운영 체제(operating system)를 동시에 실행하기 위한 논리적 플랫폼으로, 가상화 머신 모니터(virtual machine monitor) 또는 가상화 머신 매니저(virtual machine manager)로 지칭될 수 있고, 약어로 VMM으로 지칭될 수 있다. 일 실시 예에 따르면, 하이퍼바이저(230)는 하나의 하드웨어를 기반으로 복수의 가상 머신(virtual machine)을 생성하고 구동시킬 수 있는 프로그램을 의미할 수 있다. 하이퍼바이저(230)는 프로세서(예: 도 1의 프로세서(120)) 또는 메모리(예: 도 1의 메모리(130))를 포함하는 하드웨어 자원을 가상화하여, 복수의 가상 머신에 분배할 수 있다. 일 실시 예에 따르면, 하나 이상의 가상 머신을 실행하는 컴퓨터(예: 도 1의 전자 장치(101))를 “호스트(host)”라 하고, 각 가상 머신을 “게스트(guest)”라 할 수 있다. 이하, 하이퍼바이저(230)에 의해 구동되는 가상 머신은 게스트 운영 체제로 지칭될 수 있다.
일 실시 예에 따르면, 전자 장치의 메모리(예: 도 1의 메모리(130))는 하이퍼바이저(230) 및 적어도 하나의 가상 머신을 저장할 수 있다. 일 실시 예에 따르면, 전자 장치의 프로세서(예: 도 1의 프로세서(120))는 비휘발성 메모리(예: 도 1의 비휘발성 메모리(134))(예: 하드 디스크)로부터 하이퍼바이저(230) 및 적어도 하나의 가상 머신을 휘발성 메모리(예: 도 1의 휘발성 메모리(132))(예: RAM)에 로딩하여 저장할 수 있다.
일 실시 예에 따르면, 프로세서는 하이퍼바이저(230) 및 적어도 하나의 가상 머신이 로딩된 메모리(예: 도 1의 휘발성 메모리(132))에 액세스(access)하여 하이퍼바이저(230) 또는 적어도 하나의 가상 머신의 인스트럭션(instruction) 또는 인스트럭션의 집합인 코드(code)를 실행할 수 있다. 전자 장치는 인스트럭션 또는 코드를 실행함으로써 하이퍼바이저(230) 또는 적어도 하나의 가상 머신의 기능을 수행할 수 있다.
이하, 도 3을 참조하여 하이퍼바이저 및 게스트 가상 머신의 구성 요소 및 동작에 대하여 설명한다.
도 3은 일 실시 예에 따른 하이퍼바이저와 게스트 가상 머신의 구조를 나타낸 도면(300)이다. 이하, 도 3을 참조하여 설명하는 하이퍼바이저(301) 및 게스트 가상 머신(302)의 동작들은 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))에 의해 수행될 수 있다. 일 실시 예에 따르면, 하이퍼바이저(301) 또는 게스트 가상 머신(302)이 임의의 동작을 수행한다는 것은, 전자 장치의 프로세서가 메모리(예: 도 1의 휘발성 메모리(132))(예: RAM)에 액세스(access)하여 하이퍼바이저(301) 또는 게스트 가상 머신(302)의 인스트럭션 또는 코드를 실행하는 것을 의미할 수 있다.
도 3을 참조하면, 하이퍼바이저(301)는 게스트 가상 머신(302)을 구동시킬 수 있다. 일 실시 예에 따르면, 게스트 가상 머신(302)은 복수의 게스트 가상 머신을 포함할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(301)는 게스트 가상 머신(302)의 바이너리(binary)(320)에 포함되는 데이터 또는 정보를 메모리(예: RAM)에 로딩(loading)함으로써 게스트 가상 머신(302)을 구동시킬 수 있다.
일 실시 예에 따르면, 바이너리(binary)(320)는 하이퍼바이저(301)가 게스트 가상 머신(302)을 구동하기 위해 메모리에 로딩이 필요한 데이터를 포함하는 데이터 집합을 의미할 수 있다. 예를 들어, 바이너리(320)는 하드 디스크에 저장될 수 있다.
일 실시 예에 따르면, 바이너리(320)는 심볼 정보(321), 코드(322), 및 데이터(323)를 포함할 수 있다. 일 실시 예에 따르면, 코드(322)는 복수의 인스트럭션을 포함하며, 게스트 가상 머신(302)이 특정 기능을 수행하기 위한 일련의 인스트럭션들을 포함할 수 있다. 일 실시 예에 따르면, 코드(322)는 게스트 가상 머신(302)의 코드의 적어도 일부를 포함할 수 있다. 일 실시 예에 따르면, 데이터(323)는 게스트 가상 머신(302)이 코드(322)를 실행하기 위해 필요한 데이터를 포함할 수 있다.
일 실시 예에 따르면, 심볼 정보(321)는 게스트 가상 머신(302)의 인스트럭션을 식별하기 위한 심볼 명칭(symbol name) 및 심볼 명칭에 대응되는 어드레스(address)를 포함할 수 있다. 일 실시 예에 따르면, 심볼(symbol)은, 절대 어드레스를 가질 수 있는 최소 단위를 의미할 수 있다. 예를 들면, 심볼 명칭은 코드(322)를 구성하는 인스트럭션에 대응되는 심볼 명칭 및 코드(322) 내 최적화되지 않은 함수 또는 변수에 대응되는 심볼 명칭을 포함할 수 있다. 일 실시 예에 따르면, 심볼 명칭에 대응되는 어드레스(address)는 심볼이 가리키는 인스트럭션, 함수, 또는 변수가 메모리에 로딩되는 위치를 나타낼 수 있다. 일 실시 예에 따르면, 심볼 정보(321)는 심볼 명칭과 심볼 어드레스가 일대일 맵핑되어 있는 테이블 타입의 심볼 테이블(symbol table)을 포함할 수 있으나, 이에 한정되는 것은 아니다.
일 실시 예에 따르면, 하이퍼바이저(301)는 심볼 로딩 모듈(310), 인스트럭션 수정 모듈(320), 및 트랩 모듈(330)을 포함할 수 있다. 일 실시 예에 따르면, 심볼 로딩 모듈(310)은 게스트 가상 머신(302)의 심볼 정보(321)(예: 심볼 테이블)를 하이퍼바이저(301)에 로딩할 수 있다. 일 실시 예에 따르면, 심볼 로딩 모듈(310)은 바이너리(320)로부터 심볼 정보(321)를 추출하여 하이퍼바이저(301)의 데이터베이스(database)에 저장하고, 지정된 시점에 심볼 정보(321)를 하이퍼바이저(301)의 메모리(예: RAM)에 로딩할 수 있다. 일 실시 예에 따르면, 지정된 시점은, 전자 장치의 부팅(booting) 시점을 포함할 수 있다. 예를 들면, 심볼 로딩 모듈(310)은 전자 장치의 부팅 시점 이전에 바이너리(320)로부터 심볼 정보(321)를 미리 추출하여 하이퍼바이저(301)의 데이터베이스(database)에 저장해두었다가, 부팅 시점에 하이퍼바이저(301)의 메모리에 로딩할 수 있다.
일 실시 예에 따르면, 하이퍼바이저(301)는 부팅 시점에 바이너리(320)로부터 코드(322) 및 데이터(323)를 추출하여 게스트 가상 머신(302)의 메모리(예: RAM)에 로딩할 수 있다.
일 실시 예에 따르면, 인스트럭션 수정 모듈(320)은 게스트 가상 머신(302)의 코드(322)를 수정할 수 있다. 일 실시 예에 따르면, 인스트럭션 수정 모듈(320)은 심볼 로딩 모듈(310)에 의해 로딩된 심볼 정보(321)로부터 주어진 대상 심볼(target symbol)의 어드레스를 검색할 수 있다. 예를 들면, 인스트럭션 수정 모듈(320)은 심볼 테이블에서 대상 심볼에 대응되는 심볼 명칭에 맵핑된 어드레스를 대상 심볼의 어드레스로 결정할 수 있다.
일 실시 예에 따르면, 인스트럭션 수정 모듈(320)은 검색된 대상 심볼의 어드레스에 대응되는 인스트럭션을 하이퍼바이저(301)의 메모리에 저장할 수 있다. 예를 들면, 인스트럭션 수정 모듈(320)은 대상 심볼의 어드레스에 기반하여 게스트 가상 머신(302)의 메모리에 액세스하여, 해당 어드레스를 갖는 제1 인스트럭션을 하이퍼바이저(301)의 메모리에 저장할 수 있다. 일 실시 예에 따르면, 인스트럭션 수정 모듈(320)이 대상 심볼의 어드레스에 대응되는 제1 인스트럭션을 하이퍼바이저(301)의 메모리에 저장하는 것은, 게스트 가상 머신(302)의 메모리에 저장된 제1 인스트럭션을 하이퍼바이저(301)의 메모리로 복사하거나, 제1 인스트럭션의 저장 위치를 게스트 가상 머신(302)의 메모리에서 하이퍼바이저(301)의 메모리로 이동시키는 것을 포함할 수 있다.
일 실시 예에 따르면, 인스트럭션 수정 모듈(320)은 제1 인스트럭션을 제2 인스트럭션으로 대체할 수 있다. 예를 들면, 제2 인스트럭션은 하이퍼바이저(301)를 호출하는 인스트럭션을 포함할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(301)를 호출하는 인스트럭션은 게스트 가상 머신(302)에서 하이퍼바이저(301)로의 트랩(trap)을 발생시키는 인스트럭션을 포함할 수 있다. 일 실시 예에 따르면, 트랩(trap)은 지정된 인스트럭션의 실행 주체를 게스트 가상 머신(302)에서 하이퍼바이저(301)로 변경하는 소프트웨어적 현상을 포함할 수 있다.
일 실시 예에 따르면, 인스트럭션 수정 모듈(320)은 게스트 가상 머신(302)이 대상 심볼에 대응되는 게스트 가상 머신(302)의 코드(322)를 실행하기 전의 지정된 시점에 대상 심볼에 대응되는 제1 인스트럭션을 제2 인스트럭션으로 대체할 수 있다. 예를 들어, 인스트럭션 수정 모듈(320)은 부팅 시점, 또는 부팅 이후 런-타임(run-time) 중 게스트 가상 머신(302)이 제1 인스트럭션을 포함하는 코드를 실행하기 전에 제1 인스트럭션을 제2 인스트럭션으로 대체할 수 있다.
일 실시 예에 따르면, 트랩 모듈(330)은 게스트 가상 머신(302)이 제2 인스트럭션을 실행함에 따라 하이퍼바이저로의 트랩을 발생시킬 수 있다. 트랩에 대하여는 상술하였으므로, 중복된 설명은 생략한다.
일 실시 예에 따르면, 트랩 모듈(330)은 트랩 시점에서의 게스트 가상 머신(302)의 레지스터(register) 정보를 획득할 수 있다. 일 실시 예에 따르면, 레지스터(register)는 프로세서 내에 위치하며, 프로세서가 바로 사용할 수 있는 데이터를 일시적으로 저장할 수 있다. 예를 들면, 레지스터(register)는 일반적인 데이터를 저장하는 용도로 사용되는 범용 레지스터(general register), 스택 포인터(stack pointer), 특수한 용도로 사용되는 특수 레지스터(special register), 및/또는 주소 레지스터(address register) 중 적어도 하나를 포함할 수 있다. 일 실시 예에 따르면, 레지스터 정보는 프로세서가 처리한 연산의 결과 값, 중간 결과 값, 프로그램의 실행 상태를 나타내는 정보, 또는 메모리 주소 중 적어도 하나를 포함할 수 있다.
일 실시 예에 따르면, 트랩 모듈(330)은 획득된 레지스터 정보에 기반하여 지정된 코드를 실행할 수 있다. 일 실시 예에 따르면, 트랩 모듈(330)은 레지스터 정보에 기반하여 하이퍼바이저(301)의 메모리에 저장된 제1 인스트럭션을 분석할 수 있다. 일 실시 예에 따르면, 지정된 코드는 제1 인스트럭션에 따라 다르게 지정될 수 있으며, 예를 들어, 보안 또는 디버깅 중 적어도 하나를 위한 코드를 포함할 수 있다. 일 실시 예에 따르면, 트랩 모듈(330)은 레지스터 정보에 기반한 제1 인스트럭션의 분석 결과, 제1 인스트럭션이 보안 확인이 필요한 인스트럭션인 경우 보안 확인 기능을 수행하도록 지정된 코드를 실행할 수 있고, 제1 인스트럭션이 디버깅이 필요한 인스트럭션인 경우 디버깅 기능을 수행하도록 지정된 코드를 실행할 수 있다.
일 실시 예에 따르면, 트랩 모듈(330)은 지정된 코드를 실행한 후, 하이퍼바이저(301)의 메모리에 저장된 제1 인스트럭션을 실행할 수 있다. 일 실시 예에 따르면, 트랩 모듈(330)은 지정된 코드의 실행 결과에 기반하여 하이퍼바이저(301)의 메모리에 저장된 제1 인스트럭션의 실행 여부를 결정할 수 있다. 예를 들어, 트랩 모듈(330)은 지정된 코드를 실행함에 따라 디버깅 기능을 수행하고, 제1 인스트럭션에 오류가 존재하는지 여부를 확인할 수 있다. 지정된 코드의 실행 결과, 제1 인스트럭션에 오류가 존재하지 않는 것으로 판단되는 경우, 트랩 모듈(330)은 하이퍼바이저(301)의 메모리에 저장된 제1 인스트럭션을 실행할 수 있다. 지정된 코드의 실행 결과, 제1 인스트럭션에 오류가 존재하는 것으로 판단되는 경우, 트랩 모듈(330)은 전자 장치 전체를 셧다운(shutdown)하거나, 제1 인스트럭션과 관련된 어플리케이션만 셧다운할 수 있으나, 이에 한정되는 것은 아니다. 다른 예로, 트랩 모듈(330)은 지정된 코드를 실행함에 따라 보안 확인 기능(또는, 보안 검사 기능)을 수행하고, 보안 결함이 존재하는지 여부를 확인할 수 있다. 지정된 코드의 실행 결과, 보안 결함이 존재하지 않는 것으로 판단되는 경우, 트랩 모듈(330)은 하이퍼바이저(301)의 메모리에 저장된 제1 인스트럭션을 실행할 수 있다. 지정된 코드의 실행 결과, 보안 결함이 존재하는 것으로 판단되는 경우, 트랩 모듈(330)은 전자 장치 전체를 셧다운(shutdown)하거나, 제1 인스트럭션과 관련된 어플리케이션만 셧다운할 수 있다.
일 실시 예에 따르면, 트랩 모듈(330)은 제1 인스트럭션을 실행한 후, 하이퍼바이저(301)로부터 게스트 가상 머신(302)으로 리턴(return)하도록 제어할 수 있다. 일 실시 예에 따르면, 리턴(return)은 현재의 코드 실행 위치에서 현재의 코드를 호출한 인스트럭션의 바로 다음 위치로 이동하는 것을 포함할 수 있다. 일 실시 예에 따르면, 트랩 모듈(330)은 제1 인스트럭션을 실행하고, 게스트 가상 머신(302)에서 하이퍼바이저(301)로의 트랩을 발생시킨 제2 인스트럭션의 다음 위치로 코드 실행 위치를 이동시킬 수 있다. 하이퍼바이저(301)로부터 게스트 가상 머신(302)으로 리턴(return) 후, 게스트 가상 머신(302)은 제2 인스트럭션 다음 인스트럭션부터 코드를 실행할 수 있다.
이하, 도 4를 참조하여 일 실시 예에 따른 하이퍼바이저가 심볼 정보를 로딩하는 동작에 대하여 설명한다.
도 4는 일 실시 예에 따른 하이퍼바이저의 동작을 나타낸 도면(400)이다. 이하, 도 4를 참조하여 설명하는 하이퍼바이저(예: 도 2의 하이퍼바이저(301))의 동작들은 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))에 의해 수행될 수 있다.
도 4를 참조하면, 게스트 가상 머신의 바이너리(410)는 코드(code)(411) 및 심볼 정보(symbol information)(412)를 포함할 수 있다. 일 실시 예에 따르면, 코드(411)는 게스트 가상 머신이 구동되기 위해 게스트 가상 머신의 메모리에 로딩되는 코드를 포함할 수 있다. 일 실시 예에 따르면, 코드(411)는 복수의 인스트럭션으로 이루어진 인스트럭션 셋(set)을 포함할 수 있다. 예를 들어, 코드(411)는 인스트럭션 D(411_1), 인스트럭션 E(411_2), 및 인스트럭션 F(411_3)를 포함할 수 있다.
일 실시 예에 따르면, 심볼 정보(412)는 코드(411) 또는 코드(411)에 포함된 인스트럭션을 식별하기 위한 정보로서, 심볼 명칭(예: AA, AB, 또는 AC) 및 심볼 명칭에 대응되는 어드레스(예: 0xa000, 0xa008, 또는 0xa010)를 포함할 수 있다. 일 실시 예에 따르면, 인스트럭션 각각에는 하나의 심볼 명칭 및 하나의 어드레스가 맵핑될 수 있다. 예를 들어, 인스트럭션 D(411_1)에는 심볼 명칭 “AA”와, 어드레스 “0xa000”이 맵핑될 수 있고, 인스트럭션 E(411_2)에는 심볼 명칭 “AB”와, 어드레스 “0xa008”이 맵핑될 수 있고, 인스트럭션 F(411_3)에는 심볼 명칭 “AC”와, 어드레스 “0xa010”이 맵핑될 수 있다. 일 실시 예에 따르면, 하이퍼바이저는 심볼 명칭 또는 어드레스에 기반하여 인스트럭션을 식별할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 바이너리(410)로부터 게스트 가상 머신의 심볼 정보(412)를 추출하여 하이퍼바이저의 메모리(420)에 로딩할 수 있다(동작 401). 일 실시 예에 따르면, 심볼 정보(412)의 추출은 심볼 정보(412)의 복사를 포함할 수 있다. 일 실시 예에 따르면, 하이퍼바이저는 부팅 시점 이전에 바이너리(410)로부터 심볼 정보(412)를 미리 추출할 수 있다. 하이퍼바이저는 추출된 심볼 정보(412)를 하이퍼바이저의 데이터베이스에 저장할 수 있으며, 부팅 시점에 하이퍼바이저의 메모리(420)에 로딩할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 하이퍼바이저의 메모리(420)에 로딩된 게스트 가상 머신의 심볼 정보(412)에 기반하여 주어진 대상 심볼의 어드레스를 검색하고, 검색된 어드레스에 대응되는 인스트럭션을 식별할 수 있다.
이하, 도 5를 참조하여 일 실시 예에 따른 하이퍼바이저가 인스트럭션을 수정하는 동작에 대하여 설명한다.
도 5는 일 실시 예에 따른 하이퍼바이저의 동작을 나타낸 도면(500)이다. 이하, 도 5를 참조하여 설명하는 하이퍼바이저(예: 도 2의 하이퍼바이저(301)) 및 게스트 가상 머신(예: 도 2의 게스트 가상 머신(302))의 동작들은 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))에 의해 수행될 수 있다.
도 5는 하이퍼바이저가 도 4를 참조하여 설명한 동작(동작 401)을 수행한 이후의 도면이다. 도 5를 참조하면, 하이퍼바이저가 동작 401을 수행함에 따라, 하이퍼바이저의 메모리(520)에는 심볼 테이블(511)이 로딩될 수 있다. 일 실시 예에 따르면, 심볼 테이블(511)은 심볼 명칭 및 심볼 명칭에 대응되는 어드레스가 테이블 형태로 저장된 심볼 정보를 의미할 수 있다.
일 실시 예에 따르면, 하이퍼바이저가 심볼 테이블을 하이퍼바이저의 메모리(520)에 로딩할 때, 게스트 가상 머신은 인스트럭션 A, 인스트럭션 B, 인스트럭션 C, 인스트럭션 D, 및 인스트럭션 E를 포함하는 코드를 게스트 가상 머신의 메모리(530)에 로딩할 수 있다. 일 실시 예에 따르면, 인스트럭션 A, 인스트럭션 B, 인스트럭션 C, 인스트럭션 D, 및 인스트럭션 E를 포함하는 코드는 게스트 가상 머신이 바이너리(예: 도 4의 바이너리(410))로부터 복사한 코드 중 적어도 일부를 포함할 수 있다. 일 실시 예에 따르면, 심볼 테이블(511) 및 인스트럭션 A 내지 인스트럭션 E가 각 메모리에 로딩되는 시점은 부팅 시점일 수 있다.
계층적 구조에 따르면, 하드웨어(예: 프로세서, 또는 메모리) 위에 게스트 가상 머신이 존재하고, 게스트 가상 머신 위에 하이퍼바이저가 존재한다. 일 실시 예에 따르면, 도 5와 같이, 하이퍼바이저의 메모리(520) 위에 게스트 가상 머신의 메모리(530)가 존재하는 것처럼 표시될 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 심볼 테이블(511)로부터 주어진 대상 심볼(target symbol)(예: symbol DD)의 어드레스를 검색할 수 있다(동작 1). 일 실시 예에 따르면, 대상 심볼은 하이퍼바이저가 수정할 인스트럭션에 대응되는 심볼 명칭을 포함할 수 있다. 예를 들면, 하이퍼바이저는 심볼 테이블(511)로부터 심볼 명칭이 “DD”인 심볼의 어드레스를 검색할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 게스트 가상 머신의 메모리(530)에 로딩된 게스트 가상 머신의 코드 중에서, 심볼 테이블(511)로부터 검색된 어드레스(예: symbol DD의 어드레스)에 대응되는 인스트럭션을 식별할 수 있다(동작 503). 예를 들면, 하이퍼바이저는 심볼 명칭이 “DD”인 심볼의 어드레스에 대응되는 “인스트럭션 D”를 식별할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 대상 심볼의 어드레스에 대응되는 제1 인스트럭션(예: 인스트럭션 D)을 제2 인스트럭션(예: HVC(hypervisor call) D)로 대체할 수 있다(동작 505). 일 실시 예에 따르면, 제2 인스트럭션은 하이퍼바이저를 호출하는 인스트럭션을 포함할 수 있으나, 이에 한정되는 것은 아니고, 하이퍼바이저로의 트랩(trap)을 발생시키는 다양한 인스트럭션을 포함할 수 있다. 일 실시 예에 따르면, 제2 인스트럭션이 실행됨에 따라, 게스트 가상 머신에서 하이퍼바이저로의 트랩(trap)이 발생할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 제1 인스트럭션을 하이퍼바이저의 메모리(520)에 저장할 수 있다(동작 507). 일 실시 예에 따르면, 하이퍼바이저는 제1 인스트럭션을 하이퍼바이저의 메모리(520)에 저장해둠으로써, 게스트 가상 머신으로부터 하이퍼바이저로 트랩된 이후 하이퍼바이저가 제1 인스트럭션을 실행할 수 있다.
이하, 도 6을 참조하여 일 실시 예에 따른, 게스트 가상 머신으로부터 하이퍼바이저로의 트랩 및 트랩 이후 하이퍼바이저의 동작에 대하여 설명한다.
도 6은 일 실시 예에 따른 하이퍼바이저의 동작을 나타낸 도면(600)이다. 이하, 도 6을 참조하여 설명하는 하이퍼바이저(예: 도 2의 하이퍼바이저(301)) 및 게스트 가상 머신(예: 도 2의 게스트 가상 머신(302))의 동작들은 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))에 의해 수행될 수 있다.
도 6은 하이퍼바이저가 도 4를 참조하여 설명한 동작(예: 동작 401) 및 도 5를 참조하여 설명한 동작(예: 동작 501 내지 동작 507)을 수행한 이후의 도면이다. 도 6을 참조하면, 게스트 가상 머신의 메모리(630)에 로딩된 코드 중 제1 인스트럭션(예: 인스트럭션 D)은 제2 인스트럭션(예: HVC D)으로 대체될 수 있다.
일 실시 예에 따르면, 게스트 가상 머신은 게스트 가상 머신의 메모리(630)에 로딩된 코드를 코드 흐름에 따라 실행할 수 있다(동작 601). 예를 들면, 게스트 가상 머신은 인스트럭션 A, 인스트럭션 B, 인스트럭션 C, HVC D, 및 인스트럭션 E 순서로 코드를 실행할 수 있다. 일 실시 예에 따르면, 게스트 가상 머신은 동작 601을 수행 중에 제2 인스트럭션(예: HVC D)을 실행함에 따라 하이퍼바이저로의 트랩을 발생시킬 수 있다(동작 603). 예를 들면, 게스트 가상 머신은 인스트럭션 A, 인스트럭션 B, 및 인스트럭션 C를 순차적으로 실행한 이후 HVC D를 실행함에 따라, 하이퍼바이저로의 트랩을 발생시킬 수 있다.
일 실시 예에 따르면, 게스트 가상 머신으로부터 하이퍼바이저로의 트랩이 발생한 이후, 하이퍼바이저는 지정된 코드를 실행할 수 있다(동작 605). 일 실시 예에 따르면, 하이퍼바이저는 트랩 시점에 게스트 가상 머신의 레지스터 정보를 획득할 수 있다. 일 실시 예에 따르면, 게스트 가상 머신의 레지스터 정보는 트랩 시점에 게스트 가상 머신의 레지스터에 저장된데이터 또는 주소를 포함할 수 있다. 레지스터 정보는 게스트 가상 머신의 코드 실행 상태를 나타내는 정보, 게스트 가상 머신이 실행한 연산의 결과 값 및/또는 중간 값, 및/또는 시스템 구동에 영향을 주는 레지스터 정보를 포함할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 획득된 레지스터 정보에 기반하여 지정된 코드를 실행할 수 있다. 예를 들어, 하이퍼바이저가 레지스터 정보에 기반하여 보안 확인 기능을 수행할 필요가 있다고 판단되는 경우, 보안 확인 기능을 수행하도록 지정된 코드를 실행할 수 있으나, 이에 한정되는 것은 아니다. 다른 예로, 하이퍼바이저가 레지스터 정보에 기반하여 디버깅 기능을 수행할 필요가 있다고 판단되는 경우, 디버깅 기능을 수행하도록 지정된 코드를 실행할 수 있다.
일 실시 예에 따르면, 하이퍼바이저는 지정된 코드를 실행한 후, 하이퍼바이저의 메모리(620)에 저장된 제1 인스트럭션(예: 인스트럭션 D)을 실행할 수 있다(동작 607). 일 실시 예에 따르면, 하이퍼바이저는 지정된 코드의 실행 결과에 기반하여 제1 인스트럭션(예: 인스트럭션 D)의 실행 여부를 결정할 수 있다. 일 실시 예에 따르면, 하이퍼바이저는 지정된 코드의 실행 결과에 기반하여 제1 인스트럭션(예: 인스트럭션 D)을 실행하는 것으로 결정함에 따라, 제1 인스트럭션(예: 인스트럭션 D)을 실행할 수 있다. 일 실시 예에 따르면, 하이퍼바이저는 지정된 코드의 실행 결과에 기반하여 제1 인스트럭션(예: 인스트럭션 D)을 실행하지 않는 것으로 결정함에 따라, 제1 인스트럭션(예: 인스트럭션 D)을 실행하지 않을 수 있다. 예를 들어, 하이퍼바이저는 제1 인스트럭션(예: 인스트럭션 D)을 실행하지 않는 것으로 결정함에 따라, 전자 장치 전체를 셧다운(shutdown)시키거나, 이상 동작을 하는 어플리케이션을 셧다운시킬 수 있으나, 이에 한정되는 것은 아니다.
일 실시 예에 따르면, 하이퍼바이저는 하이퍼바이저의 메모리(620)에 저장된 제1 인스트럭션(예: 인스트럭션 D)을 실행한 후, 하이퍼바이저로부터 게스트 가상 머신으로 리턴(return)하도록 하는 인스트럭션(예: RET to guest)을 실행할 수 있다(동작 609). 일 실시 예에 따르면, 하이퍼바이저는 동작 609를 수행함에 따라 코드 실행 위치를 변경할 수 있다. 일 실시 예에 따르면, 게스트 가상 머신에서 하이퍼바이저를 호출한 제2 인스트럭션(예: HVC D)의 다음 위치로 코드 실행 위치를 변경할 수 있다.
일 실시 예에 따르면, 하이퍼바이저로부터 게스트 가상 머신으로의 리턴 후, 게스트 가상 머신은 코드 실행을 재개할 수 있다(동작 611). 일 실시 예에 따르면, 게스트 가상 머신은 하이퍼바이저로의 트랩을 발생시킨 제2 인스트럭션(예: HVC D)의 다음 인스트럭션(예: 인스트럭션 E)부터 코드 실행을 재개할 수 있다.
이하, 도 7을 참조하여 일 실시 예에 따른 전자 장치의 하이퍼바이저를 이용한 가상 머신 모니터링 방법에 대하여 설명한다.
도 7은 일 실시 예에 따른 전자 장치의 동작을 나타낸 흐름도(700)이다. 이하에서 도 7을 참조하여 설명하는 전자 장치의 동작들은 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))에 의해 수행될 수 있다.
일 실시 예에 따르면, 전자 장치는 프로세서 및 메모리(예: 도 1의 메모리(130))를 포함할 수 있다. 일 실시 예에 따르면, 메모리는 하이퍼바이저(예: 도 3의 하이퍼바이저(301)) 및 적어도 하나의 게스트 가상 머신(예: 도 3의 게스트 가상 머신(302))을 저장할 수 있다. 일 실시 예에 따르면, 프로세서는 메모리에 액세스하여 하이퍼바이저 또는 게스트 가상 머신의 코드 또는 인스트럭션을 실행함으로써 하이퍼바이저 또는 게스트 가상 머신의 기능을 수행할 수 있다.
동작 701에서, 전자 장치는 게스트 가상 머신으로부터 심볼 정보를 추출하고, 추출된 심볼 정보를 하이퍼바이저에 로딩할 수 있다. 일 실시 예에 따르면, 전자 장치는 게스트 가상 머신의 바이너리(binary)로부터 게스트 가상 머신의 심볼 정보를 추출할 수 있다. 일 실시 예에 따르면, 게스트 가상 머신의 바이너리는 전자 장치가 게스트 가상 머신을 구동하기 위해 메모리에 로딩하는 데이터 및 정보를 포함할 수 있다. 예를 들어, 게스트 가상 머신의 바이너리는 게스트 가상 머신의 심볼 정보, 게스트 가상 머신의 코드, 및 게스트 가상 머신의 데이터를 포함할 수 있다. 예를 들면, 바이너리는 하드 디스크에 저장될 수 있으며, 전자 장치는 하드 디스크에 저장된 게스트 가상 머신의 심볼 정보를 추출할 수 있다.
일 실시 예에 따르면, 전자 장치는 추출된 심볼 정보를 하이퍼바이저의 메모리에 로딩할 수 있다. 예를 들면, 전자 장치는 하드 디스크에 저장된 게스트 가상 머신의 심볼 정보를 랜덤 액세스 메모리(RAM)에 로딩할 수 있다.
일 실시 예에 따르면, 전자 장치는 부팅 시점 이전에 미리 게스트 가상 머신의 심볼 정보를 추출하여 하이퍼바이저의 데이터베이스에 저장하고, 부팅 시점에 심볼 정보를 하이퍼바이저의 메모리에 로딩할 수 있다.
일 실시 예에 따르면, 심볼 정보는 게스트 가상 머신의 인스트럭션을 식별하기 위한 정보를 포함할 수 있다. 일 실시 예에 따르면, 심볼 정보는 심볼 명칭 및 심볼 명칭에 대응되는 어드레스를 포함할 수 있다. 일 실시 예에 따르면, 심볼은 절대 어드레스를 가질 수 있는 최소 단위를 의미하며, 게스트 가상 머신의 인스트럭션은 그와 대응되는 심볼 명칭 및 어드레스를 가질 수 있다.
일 실시 예에 따르면, 전자 장치는 부팅 시점에 바이너리로부터 추출된 게스트 가상 머신의 코드를 게스트 가상 머신의 메모리에 로딩할 수 있다. 일 실시 예에 따르면, 전자 장치는 심볼 정보에 기반하여 게스트 가상 머신의 메모리에 로딩된 게스트 가상 머신의 코드에 포함된 인스트럭션의 메모리 위치를 식별할 수 있다. 일 실시 예에 따르면, 전자 장치는 심볼 정보에 기반하여 식별된 수정할 인스트럭션의 어드레스에 기반하여 메모리에 액세스할 수 있다.
동작 703에서, 전자 장치는 심볼 정보로부터 대상 심볼의 어드레스를 검색할 수 있다. 일 실시 예에 따르면, 전자 장치는 하이퍼바이저에 로딩된 심볼 정보로부터 주어진 대상 심볼의 어드레스를 검색할 수 있다. 일 실시 예에 따르면, 대상 심볼은 하이퍼바이저가 게스트 가상 머신의 코드 중에서 수정하고자 하는 인스트럭션을 가리키는 심볼을 의미할 수 있다. 예를 들어, 대상 심볼은 수정할 인스트럭션에 대응되는 심볼 명칭을 포함할 수 있다. 예를 들면, 심볼 정보는 심볼 명칭 및 심볼 명칭에 대응되는 심볼 어드레스가 일대일 맵핑된 심볼 테이블을 포함할 수 있다. 일 실시 예에 따르면, 전자 장치는 심볼 테이블에서 주어진 심볼 명칭에 대응되는 어드레스를 검색할 수 있고, 주어진 심볼 명칭에 대응되는 어드레스를 대상 심볼의 어드레스로 결정할 수 있다.
동작 705에서, 전자 장치는 어드레스에 대응되는 제1 인스트럭션을 하이퍼바이저에 저장하고, 제1 인스트럭션을 제2 인스트럭션으로 대체할 수 있다. 일 실시 예에 따르면, 전자 장치는 대상 심볼의 어드레스에 기반하여 특정 메모리 위치에 액세스할 수 있으며, 특정 메모리 위치에 저장된 인스트럭션은 게스트 가상 머신의 코드에 포함되는 인스트럭션들 중 하나인 제1 인스트럭션일 수 있다. 일 실시 예에 따르면, 전자 장치는 제1 인스트럭션을 하이퍼바이저의 메모리에 저장하고, 제1 인스트럭션을 제2 인스트럭션으로 변경할 수 있다.
일 실시 예에 따르면, 제2 인스트럭션은 하이퍼바이저를 호출하는 인스트럭션을 포함할 수 있으며, 예를 들어, 게스트 가상 머신으로부터 하이퍼바이저로의 트랩을 발생시키는 인스트럭션을 포함할 수 있다. 일 실시 예에 따르면, 전자 장치는 제1 인스트럭션을 제2 인스트럭션으로 대체함으로써 게스트 가상 머신의 코드 실행 중 제2 인스트럭션을 실행함에 따라 게스트 가상 머신으로부터 하이퍼바이저로의 트랩을 발생시킬 수 있다.
일 실시 예에 따르면, 전자 장치는 제1 인스트럭션을 하이퍼바이저의 메모리에 저장해둠으로써, 게스트 가상 머신으로부터 하이퍼바이저로의 트랩 후, 하이퍼바이저가 제1 인스트럭션을 실행하도록 제어할 수 있다.
동작 707에서, 전자 장치는 게스트 가상 머신에서 제2 인스트럭션을 실행함에 따라 하이퍼바이저로의 트랩을 발생시킬 수 있다. 일 실시 예에 따르면, 전자 장치는 게스트 가상 머신의 메모리에 로딩된 코드를 코드 흐름에 따라 순차적으로 실행할 수 있으며, 제2 인스트럭션을 실행함에 따라 게스트 가상 머신에서의 코드 실행을 중지하고 하이퍼바이저로의 트랩을 발생시킬 수 있다.
동작 709에서, 전자 장치는 하이퍼바이저에서 트랩 시점에서의 게스트 가상 머신의 레지스터 정보를 획득할 수 있다. 일 실시 예에 따르면, 전자 장치는 하이퍼바이저가 트랩 시점에 게스트 가상 머신의 레지스터에 저장된 정보를 획득하도록 제어할 수 있다. 일 실시 예에 따르면, 레지스터는 프로세서 내에 위치하는 임시 기억 장치이며, 프로세서가 실행한 연산 결과 및 프로세서가 실행 중인 프로그램의 실행 상태를 나타내는 정보를 저장할 수 있다. 일 실시 예에 따르면, 전자 장치는 트랩 전에 게스트 가상 머신의 코드를 실행하고 있었으므로, 트랩 시점에 획득되는 게스트 가상 머신의 레지스터 정보는 게스트 가상 머신의 내부 정보를 포함할 수 있다.
동작 711에서, 전자 장치는 하이퍼바이저에서 레지스터 정보에 기반하여 지정된 코드를 실행할 수 있다. 일 실시 예에 따르면, 지정된 코드는 보안 확인 또는 디버깅을 위한 코드를 포함할 수 있다. 일 실시 예에 따르면, 전자 장치는 레지스터 정보를 분석한 결과, 보안 확인 기능을 수행할 필요가 있다고 판단되는 경우, 하이퍼바이저가 보안 확인 기능을 수행하도록 지정된 코드를 실행하도록 제어할 수 있다. 일 실시 예에 따르면, 전자 장치는 레지스터 정보를 분석한 결과, 디버깅 기능을 수행할 필요가 있다고 판단되는 경우, 디버깅 기능을 수행하도록 지정된 코드를 실행할 수 있다.
동작 713에서, 전자 장치는 하이퍼바이저에서 제1 인스트럭션을 실행할 수 있다. 일 실시 예에 따르면, 전자 장치는 지정된 코드의 실행 결과에 기반하여 하이퍼바이저의 메모리에 저장된 제1 인스트럭션의 실행 여부를 결정할 수 있다. 일 실시 예에 따르면, 전자 장치는 제1 인스트럭션을 실행하는 것으로 결정함에 따라 동작 713을 수행할 수 있고, 제1 인스트럭션을 실행하지 않는 것으로 결정함에 따라 시스템 전체 또는 이상 동작을 수행한 어플리케이션을 셧다운시킬 수 있다. 예를 들어, 전자 장치는 디버깅을 위한 코드를 실행한 결과, 제1 어플리케이션에 오류가 있다고 판단된 경우, 제1 어플리케이션을 셧다운시킬 수 있으나, 이에 한정되는 것은 아니다.
동작 715에서, 전자 장치는 하이퍼바이저로부터 게스트 가상 머신으로 리턴하도록 제어할 수 있다. 일 실시 예에 따르면, 전자 장치는 하이퍼바이저가 제1 인스트럭션을 실행한 후 하이퍼바이저로부터 게스트 가상 머신으로 리턴하도록 하는 인스트럭션을 실행하도록 제어할 수 있다. 일 실시 예에 따르면, 전자 장치는 하이퍼바이저로부터 게스트 가상 머신으로 리턴하도록 하는 인스트럭션이 실행됨에 따라, 게스트 가상 머신이 코드 실행을 재개하도록 제어할 수 있다. 일 실시 예에 따르면, 전자 장치는 게스트 가상 머신으로부터 하이퍼바이저로의 트랩을 발생시킨 인스트럭션(제2 인스트럭션)의 다음 인스트럭션부터 게스트 가상 머신의 코드를 실행할 수 있다.
상술한 바에 따르면, 일 실시 예에 따른 전자 장치는 하이퍼바이저가 부팅 이후 런타임(run-time) 중에 게스트 가상 머신의 코드를 수정하고, 게스트 가상 머신이 코드를 실행하거나 메모리에 접근하는 모든 시점에 게스트 가상 머신을 모니터링하도록 지원할 수 있다. 따라서, 일 실시 예에 따른 전자 장치는 하이퍼바이저가 게스트 가상 머신의 모든 기능에 관여하고, 정보를 수집하고, 행동을 차단하도록 할 수 있다. 반면에, 게스트 가상 머신은 하이퍼바이저의 코드의 흐름 및 코드의 실행 위치를 확인할 수 없으므로, 일 실시 예에 따른 전자 장치는 강화된 보안을 제공할 수 있다.
일 실시 예에 따르면, 전자 장치는 하이퍼바이저가 런타임에 게스트 가상 머신의 코드를 직접 수정하도록 함으로써, 게스트 가상 머신의 컴파일(compile) 단계에서 어떤 최소한의 요구사항도 포함되지 않으므로 다양한 형태의 게스트 가상 머신에 적용 가능하고, 게스트 가상 머신의 컴파일 단계에서 하이퍼바이저를 위한 코드를 포팅(porting)할 필요가 없어져 하이퍼바이저의 코드 노출을 차단할 수 있으며, 소프트웨어의 유지보수를 용이하게 할 수 있다.
일 실시 예에 따르면, 전자 장치는 게스트 가상 머신보다 권한이 높은 하이퍼바이저가 게스트 가상 머신의 코드를 수정하고 지정된 코드를 실행하도록 함으로써, 게스트 가상 머신에 보다 강력한 디버깅 기능을 제공하거나, 새로운 기능을 추가할 수 있다.
이하, 도 8a 내지 도 8c를 참조하여 일 실시 예에 따른 전자 장치가 하이퍼바이저를 이용하여 다양한 시점에 가상 머신을 모니터링하는 방법에 대하여 설명한다.
도 8a 내지 도 8c는 일 실시 예에 따른 전자 장치의 하이퍼바이저를 이용한 가상 머신 모니터링 방법을 나타낸 도면(800, 820, 및 840)이다. 일 실시 예에 따르면, 전자 장치(예: 도 1의 전자 장치(101))는 프로세서(예: 도 1의 프로세서(120))에 의해 메모리(예: 도 1의 메모리(130))에 액세스하여 하이퍼바이저(또는, 호스트 운영 체제)(801) 및 게스트 운영 체제(802)를 실행할 수 있다. 이하, 하이퍼바이저(801)가 수행하는 동작 및 게스트 운영 체제(802)가 수행하는 동작은 전자 장치의 프로세서에 의해 수행될 수 있다.
도 8a는 일 실시 예에 따른 하이퍼바이저(801)가 게스트 운영 체제(802)에서 제1 함수(예: Function A)로부터 제2 함수(예: Function B)로 점프(jump)하는 시점을 모니터링하는 방법을 나타낸 도면이다. 일 실시 예에 따르면, 하이퍼바이저(801)는 게스트 운영 체제(802)의 코드 중 제1 함수(예: Function A) 실행 중에 제2 함수(예: Function B)를 호출하는 제1 인스트럭션을 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 부팅 이후 제1 인스트럭션을 포함하는 코드의 실행 전에 제1 인스트럭션을 제2 인스트럭션으로 대체할 수 있다.
비교 실시 예에 따르면, 게스트 운영 체제(802)는 제1 함수(예: Function A)를 제1 인스트럭션 전까지 코드 흐름에 따라 실행할 수 있다(동작 811). 게스트 운영 체제(802)는 제1 인스트럭션을 실행함에 따라 제1 함수(예: Function A)에서 제2 함수(예: Function B)로 점프(jump)할 수 있다(동작 812). 일 실시 예에 따르면, 게스트 운영 체제(802)는 동작 811을 동일하게 수행하고, 제2 인스트럭션을 실행함에 따라 하이퍼바이저(801)로 트랩될 수 있다(동작 813).
일 실시 예에 따르면, 하이퍼바이저(801)는 트랩 시점에서의 게스트 운영 체제(802)의 내부 정보를 획득할 수 있다. 일 실시 예에 따르면, 게스트 운영 체제(802)의 내부 정보는, 게스트 가상 머신의 특수 레지스터, 범용 레지스터, 및 스택 포인터에 저장된 레지스터 정보를 포함할 수 있다.
일 실시 예에 따르면, 하이퍼바이저(801)는 트랩 시점에서의 게스트 가상 머신의 레지스터 정보에 기반하여 제2 함수(예: Function B)의 인자(argument)를 복원할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 복원된 함수 인자에 기반하여 제2 함수(예: Function B)에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 지정된 코드를 수행함으로써 보안 확인 또는 디버깅을 수행할 수 있다(동작 815).
일 실시 예에 따르면, 하이퍼바이저(801)는 지정된 코드의 실행 결과에 기반하여 제2 함수(예: Function B)의 실행 여부를 결정할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 제2 함수(예: Function B)를 실행하는 것으로 결정함에 따라 동작 817을 수행할 수 있고, 제2 함수(예: Function B)를 실행하지 않는 것으로 결정함에 따라 전자 장치의 전체 또는 일부(예: 특정 앱(app))를 셧다운시킬 수 있다.
일 실시 예에 따르면, 하이퍼바이저(801)는 동작 815를 수행한 후, 하이퍼바이저(801)로부터 게스트 운영 체제(802)로 리턴하는 인스트럭션(예: RET to guest)을 수행할 수 있다(동작 817).
일 실시 예에 따르면, 하이퍼바이저(801)가 동작 817을 수행함에 따라 게스트 가상 머신(802)은 제2 함수(예: Function B)를 실행할 수 있다(동작 819). 일 실시 예에 따르면, 게스트 운영 체제(802)는 제1 인스트럭션에 의해 호출되는 제2 함수(예: Function B)의 코드 위치(예: 제2 함수(예: Function B) 코드의 시작 지점)부터 제2 함수의 코드를 실행할 수 있다.
일 실시 예에 따르면, 게스트 운영 체제(802)는 제2 함수(예: Function B)의 코드를 실행한 후, 제1 함수(예: Function A)로 리턴하는 인스트럭션을 실행함에 따라 제1 함수(예: Function A)로 리턴하며 리턴 값(return value)을 반환할 수 있다(동작 821). 일 실시 예에 따르면, 게스트 운영 체제(802)는 리턴 값(return value)을 이용하여 제1 함수(예: Function A)의 실행을 재개할 수 있다(동작 823).
상술한 실시 예에 따르면, 하이퍼바이저(801)는 게스트 운영 체제(802)에서 제1 함수(예: Function A)로부터 제2 함수(예: Function B)로의 점프 시점을 모니터링할 수 있다.
도 8b는 일 실시 예에 따른 하이퍼바이저(801)가 게스트 운영 체제(802)에서 제1 함수(예: Function B)로부터 제2 함수(예: Function A)로 리턴(return)하는 시점을 모니터링하는 방법을 나타낸 도면이다. 일 실시 예에 따르면, 하이퍼바이저(801)는 게스트 운영 체제(802)의 코드 중 제1 함수(예: Function B) 실행 후에 제2 함수(예: Function A)로 리턴하는 제1 인스트럭션을 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 부팅 이후 제1 인스트럭션을 포함하는 코드의 실행 전에 제1 인스트럭션을 제2 인스트럭션으로 대체할 수 있다.
일 실시 예에 따르면, 게스트 운영 체제(802)는 제2 함수(예: Function A)를 코드 흐름에 따라 실행할 수 있다(동작 831). 게스트 운영 체제(802)는 제2 함수(예: Function A) 실행 중에 제1 함수(예: Function B)를 호출하는 인스트럭션을 실행함에 따라 제1 함수(예: Function B)에서 제2 함수(예: Function A)로 점프(jump)할 수 있다(동작 833). 이후, 게스트 운영 체제(802)는 제1 함수(예: Function B)를 코드 흐름에 따라 실행할 수 있다(동작 835).
비교 실시 예에 따르면, 게스트 운영 체제(802)는 제1 함수(예: Function B)를 실행한 후에 제1 함수(예: Function B)에서 제2 함수(예: Function A)로 리턴하는 제1 인스트럭션을 실행할 수 있다. 게스트 운영 체제(802)는 제1 인스트럭션을 실행함에 따라 제1 함수(예: Function B)에서 제2 함수(예: Function A)로 리턴할 수 있다(동작 836). 일 실시 예에 따르면, 게스트 운영 체제(802)는 제1 함수(예: Function B)를 실행한 후에 하이퍼바이저(801)를 호출하는 제2 인스트럭션을 실행할 수 있다. 게스트 운영 체제(802)는 제2 인스트럭션을 실행함에 따라 하이퍼바이저(801)로 트랩될 수 있다(동작 837).
일 실시 예에 따르면, 하이퍼바이저(801)는 트랩 시점에서의 게스트 가상 머신의 레지스터로부터 레지스터 정보를 획득할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 레지스터 정보에 기반하여 제1 함수(예: Function B)의 제2 함수(예: Function A)로의 리턴 값(return value)을 복원할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 복원된 함수 리턴 값에 기반하여 제2 함수(예: Function A)에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 지정된 코드를 수행함으로써 보안 확인 또는 디버깅을 수행할 수 있다(동작 839).
일 실시 예에 따르면, 하이퍼바이저(801)는 지정된 코드의 실행 결과에 기반하여 제2 함수(예: Function A)의 실행 재개 여부를 결정할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 제2 함수(예: Function A)의 실행을 재개하는 것으로 결정함에 따라 동작 841을 수행할 수 있고, 제2 함수(예: Function A)의 실행을 재개하지 않는 것으로 결정함에 따라 전자 장치의 전체 또는 일부(예: 특정 앱(app))를 셧다운시킬 수 있다.
일 실시 예에 따르면, 하이퍼바이저(801)는 동작 839를 수행한 후, 하이퍼바이저(801)로부터 게스트 운영 체제(802)로 리턴하는 인스트럭션(예: RET to guest)을 수행할 수 있다(동작 841).
일 실시 예에 따르면, 하이퍼바이저(801)는 동작 841을 수행함에 따라 제2 함수(예: Function A)로 리턴하며 리턴 값(return value)을 반환할 수 있다. 일 실시 예에 따르면, 게스트 운영 체제(802)는 리턴 값(return value)을 이용하여 제2 함수(예: Function A)의 실행을 재개할 수 있다(동작 843). 일 실시 예에 따르면, 게스트 운영 체제(802)는 제1 인스트럭션에 의해 리턴되는 제2 함수(예: Function A)의 코드 위치(예: 제2 함수(예: Function A)가 제1 함수(예: Function B)를 호출하는 인스트럭션의 다음 인스트럭션의 시작 지점)부터 제2 함수(예: Function A)의 코드를 실행할 수 있다.
상술한 실시 예에 따르면, 하이퍼바이저(801)는 게스트 운영 체제(802)에서 제1 함수(예: Function B)로부터 제2 함수(예: Function A)로의 리턴 시점을 모니터링할 수 있다.
도 8c는 일 실시 예에 따른 하이퍼바이저(801)가 게스트 운영 체제(802)에서 메모리에 접근(access)하는 시점을 모니터링하는 방법을 나타낸 도면이다. 일 실시 예에 따르면, 하이퍼바이저(801)는 게스트 운영 체제(802)의 코드 중 메모리에 접근하는 제1 인스트럭션(예: Instruction D)을 하이퍼바이저를 호출하는 제2 인스트럭션(예: HVC D)으로 대체할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 부팅 이후 제1 인스트럭션을 포함하는 코드의 실행 전에 제1 인스트럭션(예: Instruction D)을 제2 인스트럭션(예: HVC D)으로 대체할 수 있다.
일 실시 예에 따르면, 게스트 운영 체제(802)는 제1 인스트럭션(예: HVC D) 전까지 코드 흐름에 따라 코드를 실행할 수 있다(동작 851). 예를 들면, 게스트 운영 체제(802)는 인스트럭션 A, 인스트럭션 B, 및 인스트럭션 C를 실행할 수 있다.
일 실시 예에 따르면, 게스트 운영 체제(802)는 인스트럭션 A, 인스트럭션 B, 및 인스트럭션 C를 실행한 후, 제2 인스트럭션(예: HVC D)을 실행함에 따라 하이퍼바이저(801)로 트랩될 수 있다(동작 853).
일 실시 예에 따르면, 하이퍼바이저(801)는 지정된 코드를 수행함으로써 트랩 시점에서의 게스트 운영 체제(802)의 내부 정보를 획득할 수 있다(동작 855). 일 실시 예에 따르면, 게스트 운영 체제(802)의 내부 정보는, 게스트 가상 머신의 주소 레지스터에 저장된 레지스터 정보를 포함할 수 있다. 레지스터 정보는, 예를 들어, 게스트 운영 체제(802)가 메모리에 접근하는 메모리 위치를 나타내는 메모리 어드레스 및 메모리 어드레스에 대응되는 메모리 값(value)을 포함할 수 있다. 이하, 하이퍼바이저(801)가 트랩 시점에 획득하는 메모리 어드레스를 제1 어드레스라 한다.
일 실시 예에 따르면, 하이퍼바이저(801)는 제1 어드레스를 제2 어드레스로 변환할 수 있다. 일 실시 예에 따르면, 제1 어드레스는 게스트 운영 체제(802)가 사용하는 주소이고, 제2 어드레스는 하이퍼바이저(801)가 사용하는 주소일 수 있다. 일 실시 예에 따르면, 제1 어드레스는 가상 주소이고, 제2 어드레스는 물리 주소일 수 있다.
일 실시 예에 따르면, 하이퍼바이저(801)는 제1 어드레스가 페이지 맵핑되어 있는 경우에는 페이지 맵핑 정보(예: 페이지 테이블)에 기반하여 제1 어드레스를 제2 어드레스로 변환할 수 있다(동작 857). 일 실시 예에 따르면, 페이지는 메모리를 구성하는 단위를 의미할 수 있다. 일 실시 예에 따르면, 페이지 맵핑은, 게스트 운영 체제(802)가 사용하는 가상 메모리의 페이지와 실제 메모리의 페이지 간의 대응 관계를 생성하거나 설정하는 것을 의미할 수 있다. 일 실시 예에 따르면, 하이퍼바이저(801)는 제1 어드레스가 페이지 맵핑되어 있지 않은 경우에는 페이지 맵핑을 수행하고, 제1 어드레스를 제2 어드레스로 변환할 수 있다(동작 857).
일 실시 예에 따르면, 하이퍼바이저(801)는 제2 어드레스에 기반하여 제1 인스트럭션(예: Instruction D')을 실행할 수 있다(동작 859). 일 실시 예에 따르면, 하이퍼바이저(801)는 제2 어드레스에 대응되는 메모리 위치로 메모리에 접근할 수 있다.
일 실시 예에 따르면, 하이퍼바이저(801)는 동작 859를 수행한 후, 하이퍼바이저(801)로부터 게스트 운영 체제(802)로 리턴하는 인스트럭션(예: RET to guest)을 수행할 수 있다(동작 861).
일 실시 예에 따르면, 하이퍼바이저(801)가 동작 861을 수행함에 따라, 게스트 운영 체제(802)는 코드의 실행을 재개할 수 있다(동작 863). 일 실시 예에 따르면, 게스트 운영 체제(802)는 하이퍼바이저로 트랩시키는 제1 인스트럭션(예: Instruction D)의 다음 인스트럭션(예: Instruction E)의 시작 지점부터 코드를 실행할 수 있다.
상술한 실시 예에 따르면, 하이퍼바이저(801)는 게스트 운영 체제(802)가 메모리에 접근하는 모든 시점을 모니터링할 수 있다.
본 문서에 개시되는 다양한 실시예들에 따르면, 전자 장치(예: 도 1의 전자 장치(101))는 적어도 하나의 게스트 가상 머신(guest virtual machine)(예: 도 3의 게스트 가상 머신(302)) 및 하이퍼바이저(hypervisor) (예: 도 2의 하이퍼바이저(230), 또는 도 3의 하이퍼바이저(301))를 저장하는 메모리(예: 도 1의 메모리(130)); 및 상기 메모리에 작동적으로 연결되는 프로세서(예: 도 1의 프로세서(120))를 포함할 수 있다.
일 실시예에 따르면, 상기 프로세서는, 제1 동작으로서, 상기 하이퍼바이저에 로딩된 게스트 가상 머신의 심볼(symbol) 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하고, 상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체할 수 있다.
일 실시예에 따르면, 상기 프로세서는, 제2 동작으로서, 상기 게스트 가상 머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키고, 상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하고, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하고, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하고, 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어할 수 있다.
일 실시예에 따르면, 상기 프로세서는, 상기 제1 동작 이전에 수행하는 제3 동작으로서, 상기 게스트 가상 머신의 바이너리(binary)로부터 상기 심볼 정보를 추출하여 상기 하이퍼바이저의 데이터베이스에 저장하고, 지정된 시점에 상기 심볼 정보를 상기 하이퍼바이저의 메모리에 로딩하도록 제어할 수 있다.
일 실시예에 따르면, 상기 지정된 시점은, 상기 전자 장치의 부팅(booting) 시점을 포함할 수 있다.
일 실시예에 따르면, 상기 심볼 정보는, 상기 게스트 가상 머신의 인스트럭션을 식별하기 위한 심볼 명칭 및 상기 심볼 명칭에 대응되는 어드레스를 포함할 수 있다.
일 실시예에 따르면, 상기 프로세서는, 상기 전자 장치의 부팅 시점, 또는 상기 부팅 시점 이후 상기 게스트 가상 머신에서 상기 제1 인스트럭션을 포함하는 코드를 실행하기 전의 지정된 시점에 상기 제1 동작을 수행할 수 있다.
일 실시예에 따르면, 상기 지정된 코드는, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 보안 확인 또는 디버깅 중 적어도 하나를 위한 코드를 포함할 수 있다.
일 실시예에 따르면, 상기 프로세서는, 상기 지정된 코드의 실행 결과에 기반하여 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 실행 여부를 결정할 수 있다.
일 실시예에 따르면, 상기 제1 인스트럭션이 제1 함수(function) 실행 중에 제2 함수를 호출하는 인스트럭션인 경우, 상기 프로세서는, 상기 제2 동작으로서, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 인자(argument)을 복원하고, 상기 하이퍼바이저에서 상기 함수 인자에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하고, 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하고, 상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어할 수 있다.
일 실시예에 따르면, 상기 제1 인스트럭션이 제1 함수 실행 후에 제2 함수로 리턴하는 인스트럭션인 경우, 상기 프로세서는, 상기 제2 동작으로서, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 리턴 값(return value)을 복원하고, 상기 하이퍼바이저에서 상기 함수 리턴 값에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하고, 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하고, 상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어할 수 있다.
일 실시예에 따르면, 상기 제1 인스트럭션이 상기 게스트 가상 머신이 상기 메모리에 접근(access)하는 인스트럭션인 경우, 상기 프로세서는, 상기 제2 동작으로서, 상기 게스트 가상 머신에서 상기 하이퍼바이저로 트랩됨에 따라, 상기 하이퍼바이저에서 상기 게스트 가상 머신이 상기 메모리에 접근하는 제1 어드레스를 획득하고, 상기 하이퍼바이저에서 상기 제1 어드레스를 상기 하이퍼바이저가 상기 메모리에 접근하는 제2 어드레스로 변환하고, 상기 하이퍼바이저에서 상기 제2 어드레스에 기반하여 상기 제1 인스트럭션을 실행하고, 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어할 수 있다.
본 문서에 개시되는 다양한 실시예들에 따르면, 전자 장치(예: 도 1의 전자 장치(101))의 하이퍼바이저(hypervisor)(예: 도 2의 하이퍼바이저(230), 또는 도 3의 하이퍼바이저(301))를 이용한 게스트 가상 머신(guest virtual machine)(예: 도 3의 게스트 가상 머신(302)) 모니터링 방법은, 상기 게스트 가상 머신으로부터 심볼(symbol) 정보를 추출하여 상기 하이퍼바이저에 로딩(loading)하는 동작; 상기 심볼 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하는 동작; 상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체하는 동작; 상기 게스트 가상머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키는 동작; 상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하는 동작; 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하는 동작; 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하는 동작; 및 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 심볼 정보를 로딩하는 동작은, 상기 게스트 가상 머신의 바이너리(binary)로부터 상기 심볼 정보를 추출하여 상기 하이퍼바이저의 데이터베이스에 저장하는 동작; 및, 지정된 시점에 상기 심볼 정보를 상기 하이퍼바이저의 메모리에 로딩하도록 제어하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 지정된 시점은, 상기 전자 장치의 부팅(booting) 시점을 포함할 수 있다.
일 실시예에 따르면, 상기 심볼 정보는, 상기 게스트 가상 머신의 인스트럭션을 식별하기 위한 심볼 명칭 및 상기 심볼 명칭에 대응되는 어드레스를 포함할 수 있다.
일 실시예에 따르면, 상기 대상 심볼의 어드레스를 검색하는 동작, 및 상기 제1 인스트럭션을 상기 하이퍼바이저에 저장하고 상기 제1 인스트럭션을 상기 제2 인스트럭션으로 대체하는 동작은, 상기 전자 장치의 부팅 시점, 또는 상기 부팅 시점 이후 상기 게스트 가상 머신에서 상기 제1 인스트럭션을 포함하는 코드를 실행하기 전의 지정된 시점에 수행될 수 있다.
일 실시예에 따르면, 상기 지정된 코드는, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 보안 확인 또는 디버깅 중 적어도 하나를 위한 코드를 포함할 수 있다.
일 실시예에 따르면, 상기 방법은, 상기 지정된 코드의 실행 결과에 기반하여 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 실행 여부를 결정하는 동작을 더 포함할 수 있다.
일 실시예에 따르면, 상기 제1 인스트럭션이 제1 함수(function) 실행 중에 제2 함수를 호출하는 인스트럭션인 경우, 상기 레지스터 정보를 획득하는 동작 이후에, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 인자(argument)을 복원하는 동작; 상기 하이퍼바이저에서 상기 함수 인자에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하는 동작; 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작; 및 상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 제1 인스트럭션이 제1 함수 실행 후에 제2 함수로 리턴하는 인스트럭션인 경우, 상기 레지스터 정보를 획득하는 동작 이후에, 상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 리턴 값(return value)을 복원하는 동작; 상기 하이퍼바이저에서 상기 함수 리턴 값에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하는 동작; 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작; 및 상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 제1 인스트럭션이 상기 게스트 가상 머신이 상기 메모리에 접근(access)하는 인스트럭션인 경우, 상기 하이퍼바이저로의 트랩(trap)을 발생시키는 동작 이후에, 상기 하이퍼바이저에서 상기 게스트 가상 머신이 상기 메모리에 접근하는 제1 어드레스를 획득하는 동작; 상기 하이퍼바이저에서 상기 제1 어드레스를 상기 하이퍼바이저가 상기 메모리에 접근하는 제2 어드레스로 변환하는 동작; 상기 하이퍼바이저에서 상기 제2 어드레스에 기반하여 상기 제1 인스트럭션을 실행하는 동작; 및 상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작을 포함할 수 있다.
본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.
본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.
본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다.
본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, '비일시적'은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.
일실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어™)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.

Claims (15)

  1. 전자 장치에 있어서,
    적어도 하나의 게스트 가상 머신(guest virtual machine) 및 하이퍼바이저(hypervisor)를 저장하는 메모리; 및
    상기 메모리에 작동적으로 연결되는 프로세서를 포함하고,
    상기 프로세서는,
    제1 동작으로서,
    상기 하이퍼바이저에 로딩된 게스트 가상 머신의 심볼(symbol) 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하고,
    상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체하고,
    제2 동작으로서,
    상기 게스트 가상 머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키고,
    상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하고,
    상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하고,
    상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하고,
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는, 전자 장치.
  2. 청구항 1에 있어서,
    상기 프로세서는,
    상기 제1 동작 이전에 수행하는 제3 동작으로서,
    상기 게스트 가상 머신의 바이너리(binary)로부터 상기 심볼 정보를 추출하여 상기 하이퍼바이저의 데이터베이스에 저장하고,
    지정된 시점에 상기 심볼 정보를 상기 하이퍼바이저의 메모리에 로딩하도록 제어하고,
    상기 지정된 시점은, 상기 전자 장치의 부팅(booting) 시점을 포함하는, 전자 장치.
  3. 청구항 1에 있어서,
    상기 심볼 정보는, 상기 게스트 가상 머신의 인스트럭션을 식별하기 위한 심볼 명칭 및 상기 심볼 명칭에 대응되는 어드레스를 포함하는, 전자 장치.
  4. 청구항 1에 있어서,
    상기 프로세서는,
    상기 전자 장치의 부팅 시점, 또는 상기 부팅 시점 이후 상기 게스트 가상 머신에서 상기 제1 인스트럭션을 포함하는 코드를 실행하기 전의 지정된 시점에 상기 제1 동작을 수행하는, 전자 장치.
  5. 청구항 1에 있어서,
    상기 지정된 코드는, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 보안 확인 또는 디버깅 중 적어도 하나를 위한 코드를 포함하고,
    상기 프로세서는,
    상기 지정된 코드의 실행 결과에 기반하여 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 실행 여부를 결정하는, 전자 장치.
  6. 청구항 1에 있어서,
    상기 제1 인스트럭션이 제1 함수(function) 실행 중에 제2 함수를 호출하는 인스트럭션인 경우, 상기 프로세서는, 상기 제2 동작으로서,
    상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 인자(argument)을 복원하고,
    상기 하이퍼바이저에서 상기 함수 인자에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하고,
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하고,
    상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어하는, 전자 장치.
  7. 청구항 1에 있어서,
    상기 제1 인스트럭션이 제1 함수 실행 후에 제2 함수로 리턴하는 인스트럭션인 경우, 상기 프로세서는, 상기 제2 동작으로서,
    상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 리턴 값(return value)을 복원하고,
    상기 하이퍼바이저에서 상기 함수 리턴 값에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하고,
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하고,
    상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어하는, 전자 장치.
  8. 청구항 1에 있어서,
    상기 제1 인스트럭션이 상기 게스트 가상 머신이 상기 메모리에 접근(access)하는 인스트럭션인 경우, 상기 프로세서는, 상기 제2 동작으로서,
    상기 게스트 가상 머신에서 상기 하이퍼바이저로 트랩됨에 따라, 상기 하이퍼바이저에서 상기 게스트 가상 머신이 상기 메모리에 접근하는 제1 어드레스를 획득하고,
    상기 하이퍼바이저에서 상기 제1 어드레스를 상기 하이퍼바이저가 상기 메모리에 접근하는 제2 어드레스로 변환하고,
    상기 하이퍼바이저에서 상기 제2 어드레스에 기반하여 상기 제1 인스트럭션을 실행하고,
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는, 전자 장치.
  9. 전자 장치의 하이퍼바이저(hypervisor)를 이용한 게스트 가상 머신(guest virtual machine) 모니터링 방법에 있어서,
    상기 게스트 가상 머신으로부터 심볼(symbol) 정보를 추출하여 상기 하이퍼바이저에 로딩(loading)하는 동작;
    상기 심볼 정보로부터 대상 심볼(target symbol)의 어드레스(address)를 검색하는 동작;
    상기 게스트 가상 머신의 상기 어드레스에 대응되는 제1 인스트럭션(instruction)을 상기 하이퍼바이저에 저장하고, 상기 제1 인스트럭션을 상기 하이퍼바이저를 호출하는 제2 인스트럭션으로 대체하는 동작;
    상기 게스트 가상머신에서 상기 제2 인스트럭션을 실행함에 따라 상기 하이퍼바이저로의 트랩(trap)을 발생시키는 동작;
    상기 하이퍼바이저에서 상기 트랩 시점에서의 상기 게스트 가상 머신의 레지스터(register) 정보를 획득하는 동작;
    상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 지정된 코드(code)를 실행하는 동작;
    상기 하이퍼바이저에 저장된 상기 제1 인스트럭션을 실행하는 동작; 및
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작을 포함하는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
  10. 청구항 9에 있어서,
    상기 심볼 정보를 로딩하는 동작은,
    상기 게스트 가상 머신의 바이너리(binary)로부터 상기 심볼 정보를 추출하여 상기 하이퍼바이저의 데이터베이스에 저장하는 동작; 및
    지정된 시점에 상기 심볼 정보를 상기 하이퍼바이저의 메모리에 로딩하도록 제어하는 동작을 포함하고,
    상기 지정된 시점은, 상기 전자 장치의 부팅(booting) 시점을 포함하는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
  11. 청구항 9에 있어서,
    상기 대상 심볼의 어드레스를 검색하는 동작, 및 상기 제1 인스트럭션을 상기 하이퍼바이저에 저장하고 상기 제1 인스트럭션을 상기 제2 인스트럭션으로 대체하는 동작은, 상기 전자 장치의 부팅 시점, 또는 상기 부팅 시점 이후 상기 게스트 가상 머신에서 상기 제1 인스트럭션을 포함하는 코드를 실행하기 전의 지정된 시점에 수행되는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
  12. 청구항 9에 있어서,
    상기 지정된 코드는, 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 보안 확인 또는 디버깅 중 적어도 하나를 위한 코드를 포함하고,
    상기 방법은,
    상기 지정된 코드의 실행 결과에 기반하여 상기 하이퍼바이저에 저장된 상기 제1 인스트럭션의 실행 여부를 결정하는 동작을 더 포함하는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
  13. 청구항 9에 있어서,
    상기 제1 인스트럭션이 제1 함수(function) 실행 중에 제2 함수를 호출하는 인스트럭션인 경우,
    상기 레지스터 정보를 획득하는 동작 이후에,
    상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 인자(argument)을 복원하는 동작;
    상기 하이퍼바이저에서 상기 함수 인자에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하는 동작;
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작; 및
    상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어하는 동작을 포함하는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
  14. 청구항 9에 있어서,
    상기 제1 인스트럭션이 제1 함수 실행 후에 제2 함수로 리턴하는 인스트럭션인 경우,
    상기 레지스터 정보를 획득하는 동작 이후에,
    상기 하이퍼바이저에서 상기 레지스터 정보에 기반하여 함수 리턴 값(return value)을 복원하는 동작;
    상기 하이퍼바이저에서 상기 함수 리턴 값에 기반하여 상기 제2 함수에 대한 보안 확인 또는 디버깅 중 적어도 하나를 수행하는 동작;
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작; 및
    상기 게스트 가상 머신에서 상기 제2 함수를 실행하도록 제어하는 동작을 포함하는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
  15. 청구항 9에 있어서,
    상기 제1 인스트럭션이 상기 게스트 가상 머신이 상기 메모리에 접근(access)하는 인스트럭션인 경우,
    상기 하이퍼바이저로의 트랩(trap)을 발생시키는 동작 이후에,
    상기 하이퍼바이저에서 상기 게스트 가상 머신이 상기 메모리에 접근하는 제1 어드레스를 획득하는 동작;
    상기 하이퍼바이저에서 상기 제1 어드레스를 상기 하이퍼바이저가 상기 메모리에 접근하는 제2 어드레스로 변환하는 동작;
    상기 하이퍼바이저에서 상기 제2 어드레스에 기반하여 상기 제1 인스트럭션을 실행하는 동작; 및
    상기 하이퍼바이저로부터 상기 게스트 가상 머신으로 리턴하도록 제어하는 동작을 포함하는, 전자 장치의 하이퍼바이저를 이용한 게스트 가상 머신 모니터링 방법.
PCT/KR2021/014198 2020-12-02 2021-10-14 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치 WO2022119110A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2020-0166887 2020-12-02
KR1020200166887A KR20220077694A (ko) 2020-12-02 2020-12-02 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치

Publications (1)

Publication Number Publication Date
WO2022119110A1 true WO2022119110A1 (ko) 2022-06-09

Family

ID=81854029

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2021/014198 WO2022119110A1 (ko) 2020-12-02 2021-10-14 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치

Country Status (2)

Country Link
KR (1) KR20220077694A (ko)
WO (1) WO2022119110A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070086843A (ko) * 2004-12-10 2007-08-27 인텔 코오퍼레이션 가상 머신 모니터의 구성요소의 특권을 해제하는 시스템 및방법
KR101454837B1 (ko) * 2013-04-22 2014-10-28 한국인터넷진흥원 하이퍼바이저 보안 api 모듈 및 하이퍼바이저 기반 가상화 네트워크 침입 방지 시스템
US20160224789A1 (en) * 2015-01-30 2016-08-04 Vmware, Inc. System and method for hypervisor-based security
US20160224794A1 (en) * 2013-10-29 2016-08-04 Hewlett Packard Enterprise Development Lp Virtual machine introspection
US20190129741A1 (en) * 2017-10-31 2019-05-02 Nicira, Inc. Host-based virtual machine introspection with dynamic guest assistance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070086843A (ko) * 2004-12-10 2007-08-27 인텔 코오퍼레이션 가상 머신 모니터의 구성요소의 특권을 해제하는 시스템 및방법
KR101454837B1 (ko) * 2013-04-22 2014-10-28 한국인터넷진흥원 하이퍼바이저 보안 api 모듈 및 하이퍼바이저 기반 가상화 네트워크 침입 방지 시스템
US20160224794A1 (en) * 2013-10-29 2016-08-04 Hewlett Packard Enterprise Development Lp Virtual machine introspection
US20160224789A1 (en) * 2015-01-30 2016-08-04 Vmware, Inc. System and method for hypervisor-based security
US20190129741A1 (en) * 2017-10-31 2019-05-02 Nicira, Inc. Host-based virtual machine introspection with dynamic guest assistance

Also Published As

Publication number Publication date
KR20220077694A (ko) 2022-06-09

Similar Documents

Publication Publication Date Title
WO2020171427A1 (ko) 어플리케이션을 프리페치하는 전자 장치 및 방법
WO2020080780A1 (en) Electronic device for executing multiple operating systems and method of controlling same
WO2021045428A1 (en) Method and apparatus for improving runtime performance after application update in electronic device
WO2020218743A1 (en) Method for controlling execution of application, electronic device and storage medium for the same
WO2020106019A1 (en) Electronic device and method for providing in-vehicle infotainment service
WO2022030903A1 (ko) 어플리케이션 설치 방법 및 이를 지원하는 전자 장치
WO2021075905A1 (en) Application optimization method and electronic device supporting the same
WO2022177162A1 (ko) 어플리케이션의 모델 파일을 초기화하는 프로세서 및 이를 포함하는 전자 장치
WO2022255652A1 (ko) 어플리케이션 업데이트 방법 및 그 전자 장치
WO2023058860A1 (ko) 멀티 서명된 apk 파일을 처리하는 전자 장치 및 그 동작 방법
WO2022119110A1 (ko) 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치
WO2022154264A1 (ko) 전자 장치 및 전자 장치의 동작 방법
WO2021158068A1 (ko) 전자 장치 및 전자 장치의 클립 보드 운용 방법
WO2024034841A1 (ko) 지정된 이벤트에 기반하여 파일을 컴파일하기 위한 전자 장치 및 그 방법
WO2024014695A1 (ko) 상호작용에 의해 획득된 순서에 기반하여 패키지들을 컴파일하는 전자 장치 및 방법
WO2022260263A1 (ko) 보안을 위한 메모리 관리 방법 및 이를 위한 전자 장치
WO2022154220A1 (ko) 전자 장치 및 바이너리 변경 방법
WO2023158185A1 (ko) 전자 장치 및 이의 제어 방법
WO2024071927A1 (ko) 전자 장치 및 이를 이용한 데이터 보호 방법
WO2023038430A1 (ko) 메모리를 포함하는 인쇄 회로 기판 및 그의 데이터 처리 방법
WO2022154163A1 (ko) 전자 장치 및 전자 장치의 메모리 관리 방법
WO2021085996A1 (ko) 신경망의 커널들을 정렬하는 전자 장치 및 이의 동작 방법
WO2024071707A1 (ko) 어플리케이션을 컴파일하기 위해 이용되는 정보를 획득하기 위한 전자 장치 및 그 방법
WO2022030866A1 (ko) 데이터 처리 장치 및 방법
WO2023043052A1 (ko) 설치 파일에 대한 권한을 분석하기 위한 전자 장치 및 그 동작 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21900798

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21900798

Country of ref document: EP

Kind code of ref document: A1