From: Claudio Fontana <
claudio...@huawei.com>
this works around the lack of VT-d or ACPI DMAR table.
For debugging and early enablement of guests, it might be
useful to ignore devices.
Signed-off-by: Claudio Fontana <
claudio...@huawei.com>
---
tools/jailhouse-config-create | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Does this make sense?
We are playing around with the idea to enable other non-linux guests
in Jailhouse, and for that it will be a long way before we need to
care about devices. We will first try to just print a hello world
from the guest and die.
For this we shouldn't need VT-d, or any remapping of PCI devices
I would think..
Thank you for your comments,
Claudio
diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
index c3eebbe..6ed490c 100755
--- a/tools/jailhouse-config-create
+++ b/tools/jailhouse-config-create
@@ -50,6 +50,9 @@ parser.add_argument('-t', '--template-dir',
default=template_default_dir,
action='store',
type=str)
+parser.add_argument('-P', '--no-pci',
+ help="skip parsing of pci devices",
+ action="store_true")
memargs = [['--mem-inmates', '2M', 'inmate'],
['--mem-hv', '64M', 'hypervisor']]
@@ -613,6 +616,8 @@ def parse_dmar_devscope(f):
# parsing of DMAR ACPI Table
# see Intel VT-d Spec chapter 8
def parse_dmar(pcidevices, ioapics):
+ if not os.path.exists("/sys/firmware/acpi/tables/DMAR"):
+ raise RuntimeError('DMAR: no DMAR table found in sysfs. Try --no-pci ?')
f = input_open('/sys/firmware/acpi/tables/DMAR', 'rb')
signature = f.read(4)
if signature != b'DMAR':
@@ -778,7 +783,10 @@ if jh_enabled == '1':
file=sys.stderr)
sys.exit(1)
-(pcidevices, pcicaps) = parse_pcidevices()
+if (options.no_pci):
+ (pcidevices, pcicaps) = ([], [])
+else:
+ (pcidevices, pcicaps) = parse_pcidevices()
product = [input_readline('/sys/class/dmi/id/sys_vendor',
True).rstrip(),
@@ -797,7 +805,7 @@ mmconfig = MMConfig.parse()
ioapics = parse_madt()
-if get_cpu_vendor() == 'GenuineIntel':
+if get_cpu_vendor() == 'GenuineIntel' and not options.no_pci:
(dmar_units, rmrr_regs) = parse_dmar(pcidevices, ioapics)
else:
(dmar_units, rmrr_regs) = [], []
--
1.8.5.3