Commit 2b0bc478 authored by Vikram Narayanan's avatar Vikram Narayanan

lcd/ept: Add verbose flag for ept walk

During ept walk, not always do we need to know about missing mappings. Add
verbose flag to print a warning for the missig mapping. This is just to prevent
printk flood during iommu map.
Signed-off-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
parent 343402e0
......@@ -78,7 +78,7 @@ int lcd_arch_ept_unmap_range(struct lcd_arch *lcd, gpa_t ga_start,
/**
* Simple routine combinding ept walk and get.
*/
int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out);
int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out, bool verbose);
/**
* Translate guest physical address to host virtual.
*/
......@@ -87,7 +87,7 @@ static inline int lcd_arch_ept_gpa_to_hva(struct lcd_arch *lcd, gpa_t gpa,
{
hpa_t hpa;
int ret;
ret = lcd_arch_ept_gpa_to_hpa(lcd, gpa, &hpa);
ret = lcd_arch_ept_gpa_to_hpa(lcd, gpa, &hpa, true);
if (ret)
return ret;
*hva_out = hpa2hva(hpa);
......
......@@ -349,7 +349,7 @@ int lcd_arch_ept_unmap_range(struct lcd_arch *lcd, gpa_t ga_start,
/**
* Simple routine combinding ept walk and get.
*/
int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out);
int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out, bool);
/**
* Translate guest physical address to host virtual.
*/
......@@ -358,7 +358,7 @@ static inline int lcd_arch_ept_gpa_to_hva(struct lcd_arch *lcd, gpa_t gpa,
{
hpa_t hpa;
int ret;
ret = lcd_arch_ept_gpa_to_hpa(lcd, gpa, &hpa);
ret = lcd_arch_ept_gpa_to_hpa(lcd, gpa, &hpa, true);
if (ret)
return ret;
*hva_out = hpa2hva(hpa);
......
......@@ -403,7 +403,7 @@ int lcd_arch_ept_unmap_range(struct lcd_arch *lcd, gpa_t ga_start,
return 0;
}
int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out)
int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out, bool verbose)
{
int ret;
lcd_arch_epte_t *ept_entry;
......@@ -419,11 +419,11 @@ int lcd_arch_ept_gpa_to_hpa(struct lcd_arch *lcd, gpa_t ga, hpa_t *ha_out)
/*
* Confirm the entry is present
*/
if (!vmx_epte_present(*ept_entry)) {
if (!vmx_epte_present(*ept_entry) && verbose) {
LCD_ERR("gpa %lx is not mapped\n",
gpa_val(ga));
return -EINVAL;
}
}
/*
* Get the base host physical address, and add the offset.
......
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