Error when creating Devices element when using mugenhwcfg.py

35 views
Skip to first unread message

connor....@codethink.co.uk

unread,
Nov 6, 2017, 12:39:20 PM11/6/17
to muen-dev
Hello,
After spending a little time with Muen using Bochs, I have now started work towards running it directly on hardware. I am using the mugenhwcfg tools to generate the xml file required to build Muen. I am encountering the following error:

=== Mugenhwcfg Start ===
> Initialising...
Checking for PyXB binding file...
Bindings found at: /root/mugenhwcfg/generated/hardware_config.py
> Extracting data from system...
Binding module to be used: '/root/mugenhwcfg/generated/hardware_config.pyc'.
Generating dmesg output to: /root/mugenhwcfg/tmp/dmesg_tmp
> Decompiling DMAR table
Input file /root/mugenhwcfg/tmp//094a5a74-4af6-4aea-810c-8c651753a5f2.dat, Length 0xB0 (176) bytes
ACPI: DMAR 0x0000000000000000 0000B0 (v01 INTEL  BDW      00000001 INTL 00000001)
Acpi Data Table [DMAR] decoded
Formatted output:  /root/mugenhwcfg/tmp//094a5a74-4af6-4aea-810c-8c651753a5f2.dsl - 5330 bytes
> Parsing IOMMU hardware unit definitions
> Parsing IOMMU RMRRs
> Decompiling FADT table
Input file /root/mugenhwcfg/tmp//b01a4c5b-33cc-4265-9fcd-ff440ae9fefa.dat, Length 0x10C (268) bytes
ACPI: FACP 0x0000000000000000 00010C (v05 INTEL  EDK2     00000005 INTL 0100000D)
Acpi Data Table [FACP] decoded
Formatted output:  /root/mugenhwcfg/tmp//b01a4c5b-33cc-4265-9fcd-ff440ae9fefa.dsl - 10027 bytes
> Creating element: processor
Element created: processor
> Creating element: memory
Filtering memory blocks...
Element created: memory
> Creating element: devices
Traceback (most recent call last):
  File "./mugenhwcfg.py", line 144, in <module>
    handleArgs()
  File "./mugenhwcfg.py", line 97, in handleArgs
    main(args.force)
  File "./mugenhwcfg.py", line 113, in main
    elemtree = creator.createElements()
  File "/root/mugenhwcfg/src/creator.py", line 924, in createElements
    hardware.append(DevicesCreator().createElem())
  File "/root/mugenhwcfg/src/creator.py", line 261, in createElem
    getPciConfigAddress(paths.IOMEM)))
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 2092, in __init__
    self._setAttributesFromKeywordsAndDOM(kw, dom_node)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 496, in _setAttributesFromKeywordsAndDOM
    self._setAttribute(attr_en, value_lex)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 2254, in _setAttribute
    au.set(self, value_lex, from_xml=True)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/content.py", line 278, in set
    new_value = self.__dataType.Factory(new_value, _from_xml=from_xml)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 305, in Factory
    rv = cls._DynamicCreate(*args, **kw)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 691, in _DynamicCreate
    return ctor(*args, **kw)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 943, in __init__
    self.xsdConstraintsOK(location)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 1069, in xsdConstraintsOK
    return self.XsdConstraintsOK(self, location)
  File "/root/mugenhwcfg/contrib/pyxb/pyxb/binding/basis.py", line 1064, in XsdConstraintsOK
    raise pyxb.SimpleFacetValueError(cls, value, f, location)

I have loaded the module as required with "modprobe msr" (I am logged in a root) however a corresponding module does not appear in lsmod, This could be a potential source of error. I have also tried both the devel and master branches.

I have also included the result of lscpu for relevant processor information. Thanks for any help in advance,
Connor.


cpu-info.txt

connor....@codethink.co.uk

unread,
Nov 6, 2017, 12:43:48 PM11/6/17
to muen-dev
Oops, I appear to have missed the last line from the error log:

pyxb.exceptions_.SimpleFacetValueError: Type word64Type pattern constraint violated by value

Thanks,
Connor.

Reto Buerki

unread,
Nov 7, 2017, 7:11:09 AM11/7/17
to connor....@codethink.co.uk, muen-dev
Hi Connor,

On 11/06/2017 06:39 PM, connor....@codethink.co.uk wrote:
> Hello,
> After spending a little time with Muen using Bochs, I have now started work
> towards running it directly on hardware. I am using the mugenhwcfg tools to
> generate the xml file required to build Muen. I am encountering the
> following error:
>
> === Mugenhwcfg Start ===
>>> Initialising...
>> Checking for PyXB binding file...
>> Bindings found at: /root/mugenhwcfg/generated/hardware_config.py
[..snip..]
>> in XsdConstraintsOK
>> raise pyxb.SimpleFacetValueError(cls, value, f, location)
>>
>
> I have loaded the module as required with "modprobe msr" (I am logged in a
> root) however a corresponding module does not appear in lsmod, This could
> be a potential source of error. I have also tried both the devel and master
> branches.

The tool complains if MSR access is not possible, so this should not be
a problem. The module might be compiled into the kernel, that is why it
does not show up with lsmod.

> I have also included the result of lscpu for relevant processor
> information. Thanks for any help in advance,

Can you please send us the /proc/iomem file of this host? What kind of
machine is it exactly?

Kind regards,
- reto

connor....@codethink.co.uk

unread,
Nov 7, 2017, 10:46:41 AM11/7/17
to muen-dev
Hello Reto,

I have attached the iomem log from the host machine. The host I am attempting to run this on is a board based around an Apollo Lake SoC.

Thanks,
Connor.
iomem.log

Reto Buerki

unread,
Nov 7, 2017, 4:39:38 PM11/7/17
to connor....@codethink.co.uk, muen-dev
Hi Connor

On 11/07/2017 04:46 PM, connor....@codethink.co.uk wrote:
> I have attached the iomem log from the host machine. The host I am
> attempting to run this on is a board based around an Apollo Lake SoC.

Thanks for the log. There is no memory region for memory-mapped PCI
configuration space access in your /proc/iomem file.

You should have something along the lines of:

$ sudo cat /proc/iomem | grep MMCONF
f8000000-fbffffff : PCI MMCONFIG 0000 [bus 00-3f]

$ sudo dmesg | grep MMCONF
[ 2.448592] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem
0xf8000000-0xfbffffff] (base 0xf8000000)
[ 2.448594] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in E820

Is your kernel compiled with CONFIG_PCI_MMCONFIG enabled?

Kind regards,
- reto

connor....@codethink.co.uk

unread,
Nov 8, 2017, 4:37:27 AM11/8/17
to muen-dev
Hello Reto,

My Kernel has not been compiled with PCI_MMCONFIG enabled. I will recompile with that enabled and report back.

Thanks,
Connor.

connor....@codethink.co.uk

unread,
Nov 8, 2017, 6:23:56 AM11/8/17
to muen-dev
Update:

I have recompiled the kernel with PCI_MMCONFIG enabled and now have the relevant entry in /proc/iomem

e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]
  e0000000-efffffff : reserved
    e0000000-efffffff : PCI Bus 0000:00
      e0000000-efffffff : pnp 00:01

I now encounter a new error which I have attached as mugenhwcfg-error.log. The error on the last line of the log I will include here so it can be searched for is:
pyxb.exceptions_.SimpleFacetValueError: Type irqNumberType maxInclusive constraint violated by value 394

I have also included my new iomem as a log.

Thanks,
Connor.

mugenhwcfg-error.log
iomem.log

Reto Buerki

unread,
Nov 8, 2017, 6:39:15 AM11/8/17
to connor....@codethink.co.uk, muen-dev
Hi Connor,
Are you using the latest devel branch (rev c91048b)? It contains fixes
to address IRQs in unexpected ranges.

Kind regards,
- reto

connor....@codethink.co.uk

unread,
Nov 8, 2017, 7:00:28 AM11/8/17
to muen-dev
Hello Reto,

I have switched to the devel branch and it has cleared that error. I am now getting

Traceback (most recent call last):
  File "./mugenhwcfg.py", line 144, in <module>
    handleArgs()
  File "./mugenhwcfg.py", line 97, in handleArgs
    main(args.force)
  File "./mugenhwcfg.py", line 113, in main
    elemtree = creator.createElements()
  File "/root/mugenhwcfg/src/creator.py", line 924, in createElements
    hardware.append(DevicesCreator().createElem())
  File "/root/mugenhwcfg/src/creator.py", line 281, in createElem
    paths.IOMMUGRPS):
  File "/root/mugenhwcfg/src/creator.py", line 323, in createElems
    iommugrpdir))
  File "/root/mugenhwcfg/src/creator.py", line 683, in createDeviceFromPath
    device.append(schemadata.schema.namedRefType(ref=rmrr))
AttributeError: 'module' object has no attribute 'namedRefType'

Thanks,
Connor

Reto Buerki

unread,
Nov 8, 2017, 8:17:48 AM11/8/17
to connor....@codethink.co.uk, muen-dev
Hi Connor
Please clean the generated pyxb schema bindings and retry:

$ git clean -dxf
$ sudo ./mugenhwcfg.py

Kind regards,
- reto

connor....@codethink.co.uk

unread,
Nov 8, 2017, 9:33:41 AM11/8/17
to muen-dev
Hello Reto,

Thanks for your help, that fixed it and the xml has been generated now, albeit with a few warnings along the way. I have attached the warning log just in case you can spot any potential issues that will cause erros down the line. I am going to look into fixing:

* WARNING *: IOMMU groups not available in directory
'/sys/kernel/iommu_groups/', reboot with 'intel_iommu=on' kernel parameter.

Since intel_iommu=on is already set in my cmdline.txt, I had assumed that feature was enabled. I will do some troubleshooting to rectify this.

Thanks,
Connor.
mugenhwcfg-warning.log

Reto Buerki

unread,
Nov 9, 2017, 4:47:18 AM11/9/17
to connor....@codethink.co.uk, muen-dev
Hi Connor,
Great that it worked! Make sure to enable CONFIG_INTEL_IOMMU and friends
in your Linux kernel configuration.

Kind regards,
- reto
Reply all
Reply to author
Forward
0 new messages