From fb3f1c1855bd9aca625bc0d040be4cdcc216e958 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 29 Aug 2013 09:53:07 +0200 Subject: AMD IOMMU: allow command line overrides for broken IVRS tables With there being so many systems with broken ACPI tables, and with it generally being known what's wrong with those tables, give people a handle to overcome the resulting disabling of their IOMMUs. Inspired by Linux side patches providing similar functionality. Suggested-by: Sander Eikelenboom Signed-off-by: Jan Beulich Tested-By: Sander Eikelenboom Acked-by: Keir Fraser Acked-by: Suravee Suthikulpanit --- xen/common/kernel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'xen/common') diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 72fb9055b1..b8707d90a1 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -81,9 +81,15 @@ void __init cmdline_parse(const char *cmdline) /* Search for value part of a key=value option. */ optval = strchr(opt, '='); if ( optval != NULL ) + { *optval++ = '\0'; /* nul-terminate the option value */ + q = strpbrk(opt, "([{<"); + } else + { optval = q; /* default option value is empty string */ + q = NULL; + } /* Boolean parameters can be inverted with 'no-' prefix. */ bool_assert = !!strncmp("no-", optkey, 3); @@ -93,7 +99,17 @@ void __init cmdline_parse(const char *cmdline) for ( param = &__setup_start; param < &__setup_end; param++ ) { if ( strcmp(param->name, optkey) ) + { + if ( param->type == OPT_CUSTOM && q && + strlen(param->name) == q + 1 - opt && + !strncmp(param->name, opt, q + 1 - opt) ) + { + optval[-1] = '='; + ((void (*)(const char *))param->var)(q); + optval[-1] = '\0'; + } continue; + } switch ( param->type ) { -- cgit v1.2.3