[xenmgr] Hook up passthrough-mmio/io for xl#105
Conversation
|
#106 -> stable-7 Built ok, needs testing (not currently near my test box). Use xec-vm to set these fields, use the xl syntax, comma separated per iomem/ioport entry. Xenmgr will take care of wrapping them in quotes and brackets when it generates the xl domain config in /tmp on vm start. |
|
@dpsmith, please review |
jandryuk
left a comment
There was a problem hiding this comment.
xenmgr/xenvm passthrough-mmio was previously defined as "start-end" range (or ranges, I'm not sure). I was thinking this code would maintain backwards compatibility by converting from a start-end byte address to a start,count page format for XL.
However, the XL format supports an additional @ GFN syntax to specify a mapping location inside the guest which cannot be represented with the old syntax.
Personally, I don't care that this breaks backwards compatibility, but does the project as a whole care? I think VMs using the old syntax would fail to boot when XL can't parse the iomem field.
| _ -> case name of | ||
| "viridian" -> name ++ "=" ++ (wrapBrackets $ wrapQuotes v) | ||
| "serial" -> name ++ "=" ++ (wrapBrackets $ wrapQuotes v) | ||
| "iomem" -> name ++ "=" ++ (wrapBrackets $ wrapQuotes v) |
There was a problem hiding this comment.
This naively only supports a single value when iomem can handle multiple ranges:
iomem=[ "IOMEM_START,NUM_PAGES[@gfn]", "IOMEM_START,NUM_PAGES[@gfn]", ... ]
You can jam multiple values in by writing something like "0xfed40,4','0xfff60,1" so the inner single quotes are passed through and interpreted by xl.
|
I don't think anyone is currently using this feature in production, so we can drop backwards compatibility in order to simplify support for XL syntax. This feature is useful for demo purposes. |
|
Building 1164 |
|
I recommend re-working this to accept multiple range definitions without resorting to cramming in partially quoted strings. |
|
Works. Created an HVM CentOS 7 guest. Passthrough the TPM mmio ranges:
|
passthrough-mmio and passthrough-io map to iomem and ioports in xl. Hook up the logic in Config.hs to dump them into the config OXT-1220 Signed-off-by: Chris <rogersc@ainfosec.com>
|
PR updated with in-code comment block with ticket id and info regarding future implementation where ranges are added/removed at a finer granularity. |
dpsmith
left a comment
There was a problem hiding this comment.
RM Reviewed-by: dpsmith@apertussolutions.com
passthrough-mmio and passthrough-io map to iomem and ioports
in xl. Hook up the logic in Config.hs to dump them into the config
OXT-1220
Signed-off-by: Chris rogersc@ainfosec.com