Commit a6130165 authored by Charlie Jacobsen's avatar Charlie Jacobsen Committed by Vikram Narayanan

Simple unmapping code for ept in arch-dep code.

Just clears the ept entry.
parent 33d999d6
......@@ -172,6 +172,15 @@ void lcd_arch_ept_set(lcd_arch_epte_t *epte, u64 hpa);
* Read the host physical address stored in epte.
*/
u64 lcd_arch_ept_hpa(lcd_arch_epte_t *epte);
/**
* Clears guest physical => host physical mapping in the ept.
*
* (This is not going to free up potentially empty paging structures
* higher up in the ept hierarchy; but, for now, unset is used when
* we're tearing down the lcd -- due to an error -- so the paging
* structures will be freed up when the ept is torn down.)
*/
int lcd_arch_ept_unset(lcd_arch_epte_t *epte)
/**
* Simple routine combining ept walk and set.
*
......
......@@ -1010,6 +1010,11 @@ void lcd_arch_ept_set(lcd_arch_epte_t *epte, u64 hpa)
vmx_epte_set(epte, hpa, 3);
}
int lcd_arch_ept_unset(lcd_arch_epte_t *epte)
{
*epte = 0;
}
u64 lcd_arch_ept_hpa(lcd_arch_epte_t *epte)
{
return vmx_epte_hpa(*epte);
......@@ -2618,10 +2623,12 @@ EXPORT_SYMBOL(lcd_arch_destroy);
EXPORT_SYMBOL(lcd_arch_run);
EXPORT_SYMBOL(lcd_arch_ept_walk);
EXPORT_SYMBOL(lcd_arch_ept_set);
EXPORT_SYMBOL(lcd_arch_ept_unset);
EXPORT_SYMBOL(lcd_arch_ept_hpa);
EXPORT_SYMBOL(lcd_arch_ept_map_gpa_to_hpa);
EXPORT_SYMBOL(lcd_arch_ept_gpa_to_hpa);
EXPORT_SYMBOL(lcd_arch_set_pc);
EXPORT_SYMBOL(lcd_arch_set_gva_root);
/* DEBUGGING -------------------------------------------------- */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment