@@ -21,7 +21,7 @@
#include <xen/keyhandler.h>
#include <xsm/xsm.h>
-static void parse_iommu_param(char *s);
+static int parse_iommu_param(char *s);
static void iommu_dump_p2m_table(unsigned char key);
unsigned int __read_mostly iommu_dev_iotlb_timeout = 1000;
@@ -78,10 +78,10 @@ DEFINE_SPINLOCK(iommu_pt_cleanup_lock);
PAGE_LIST_HEAD(iommu_pt_cleanup_list);
static struct tasklet iommu_pt_cleanup_tasklet;
-static void __init parse_iommu_param(char *s)
+static int __init parse_iommu_param(char *s)
{
char *ss;
- int val;
+ int val, b, rc = 0;
do {
val = !!strncmp(s, "no-", 3);
@@ -92,8 +92,9 @@ static void __init parse_iommu_param(char *s)
if ( ss )
*ss = '\0';
- if ( !parse_bool(s) )
- iommu_enable = 0;
+ b = parse_bool(s);
+ if ( b >= 0 )
+ iommu_enable = b;
else if ( !strcmp(s, "force") || !strcmp(s, "required") )
force_iommu = val;
else if ( !strcmp(s, "workaround_bios_bug") )
@@ -124,9 +125,13 @@ static void __init parse_iommu_param(char *s)
iommu_dom0_strict = val;
else if ( !strcmp(s, "sharept") )
iommu_hap_pt_share = val;
+ else
+ rc = -EINVAL;
s = ss + 1;
} while ( ss );
+
+ return rc;
}
int iommu_domain_init(struct domain *d)