mirror of
https://github.com/momo5502/hypervisor.git
synced 2025-07-03 17:51:52 +00:00
Cleanup on process termination
This commit is contained in:
@ -26,6 +26,8 @@ namespace vmx
|
||||
{
|
||||
uint64_t physical_base_address{};
|
||||
pml1* target_page{};
|
||||
process_id source_pid{0};
|
||||
process_id target_pid{0};
|
||||
};
|
||||
|
||||
struct ept_hook
|
||||
@ -43,6 +45,9 @@ namespace vmx
|
||||
pml1 original_entry{};
|
||||
pml1 execute_entry{};
|
||||
pml1 readwrite_entry{};
|
||||
|
||||
process_id source_pid{0};
|
||||
process_id target_pid{0};
|
||||
};
|
||||
|
||||
struct ept_translation_hint
|
||||
@ -68,11 +73,12 @@ namespace vmx
|
||||
|
||||
void initialize();
|
||||
|
||||
void install_code_watch_point(uint64_t physical_page);
|
||||
void install_code_watch_point(uint64_t physical_page, process_id source_pid, process_id target_pid);
|
||||
|
||||
void install_hook(const void* destination, const void* source, size_t length,
|
||||
void install_hook(const void* destination, const void* source, size_t length, process_id source_pid,
|
||||
process_id target_pid,
|
||||
const utils::list<ept_translation_hint>& hints = {});
|
||||
void disable_all_hooks() const;
|
||||
void disable_all_hooks();
|
||||
|
||||
void handle_violation(guest_context& guest_context);
|
||||
void handle_misconfiguration(guest_context& guest_context) const;
|
||||
@ -84,6 +90,8 @@ namespace vmx
|
||||
|
||||
uint64_t* get_access_records(size_t* count);
|
||||
|
||||
bool handle_process_termination(process_id process);
|
||||
|
||||
private:
|
||||
DECLSPEC_PAGE_ALIGN pml4 epml4[EPT_PML4E_ENTRY_COUNT];
|
||||
DECLSPEC_PAGE_ALIGN pml3 epdpt[EPT_PDPTE_ENTRY_COUNT];
|
||||
@ -110,8 +118,8 @@ namespace vmx
|
||||
|
||||
void split_large_page(uint64_t physical_address);
|
||||
|
||||
void install_page_hook(void* destination, const void* source, size_t length,
|
||||
const ept_translation_hint* translation_hint = nullptr);
|
||||
void install_page_hook(void* destination, const void* source, size_t length, process_id source_pid,
|
||||
process_id target_pid, const ept_translation_hint* translation_hint = nullptr);
|
||||
|
||||
void record_access(uint64_t rip);
|
||||
};
|
||||
|
Reference in New Issue
Block a user