<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12209</bug_id>
          
          <creation_ts>2017-10-10 05:37:22 +0000</creation_ts>
          <short_desc>qemuppc: Cannot manage &apos;undefined&apos; PCI device type &apos;&lt;NULL&gt;&apos;</short_desc>
          <delta_ts>2017-11-07 14:00:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>virtual machines</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>ReportedUpstream</resolution>
          
          <see_also>https://bugzilla.yoctoproject.org/show_bug.cgi?id=12034</see_also>
    
    <see_also>https://bugzilla.yoctoproject.org/show_bug.cgi?id=12183</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.5 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jackie Huang">jackie.huang</reporter>
          <assigned_to name="Jackie Huang">jackie.huang</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77477</commentid>
    <comment_count>0</comment_count>
    <who name="Jackie Huang">jackie.huang</who>
    <bug_when>2017-10-10 05:37:22 +0000</bug_when>
    <thetext>There is an annoying error message when runqemu to boot qemuppc:

&gt;&gt; Cannot manage &apos;undefined&apos; PCI device type &apos;&lt;NULL&gt;&apos;:
&gt;&gt;  1af4 1005 (0 ff 0)

But it doesn&apos;t block the boot.

Detail logs:
==================
$ runqemu qemuppc core-image-minimal nographic slirp
runqemu - INFO - Running MACHINE=qemuppc bitbake -e...
runqemu - INFO - Continuing with the following parameters:

KERNEL: [tmp/deploy/images/qemuppc/vmlinux]
MACHINE: [qemuppc]
FSTYPE: [ext4]
ROOTFS: [tmp/deploy/images/qemuppc/core-image-minimal-qemuppc.ext4]
CONFFILE: [/myproject/tmp/deploy/images/qemuppc/core-image-minimal-qemuppc.qemuboot.conf]

runqemu - INFO - Port forward: hostfwd=tcp::2222-:22 hostfwd=tcp::2323-:23
runqemu - INFO - Running tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin//qemu-system-ppc -device virtio-net-pci,netdev=net0,mac=52:54:00:12:35:02 -netdev user,id=net0,hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23,tftp=tmp/deploy/images/qemuppc -drive file=tmp/deploy/images/qemuppc/core-image-minimal-qemuppc.ext4,if=virtio,format=raw -show-cursor -usb -device usb-tablet -device virtio-rng-pci  -nographic -machine mac99 -cpu G4 -m 256 -serial mon:stdio -serial null -kernel tmp/deploy/images/qemuppc/vmlinux -append &apos;root=/dev/vda rw highres=off  console=ttyS0 mem=256M ip=dhcp console=tty console=ttyS0 &apos;

C&gt;&gt; annot manage &apos;undefined&apos; PCI device type &apos;&lt;NULL&gt;&apos;:
&gt;&gt;  1af4 1005 (0 ff 0)

&gt;&gt; =============================================================
&gt;&gt; OpenBIOS 1.1 [Jul 13 2017 18:28]
&gt;&gt; Configuration device id QEMU version 1 machine id 1
&gt;&gt; CPUs: 1
&gt;&gt; Memory: 256M
&gt;&gt; UUID: 00000000-0000-0000-0000-000000000000
&gt;&gt; CPU type PowerPC,G4
milliseconds isn&apos;t unique.
Welcome to OpenBIOS v1.1 built on Jul 13 2017 18:28
&gt;&gt; [ppc] Kernel already loaded (0x01000000 + 0x00c1368c) (initrd 0x00000000 + 0x00000000)
&gt;&gt; [ppc] Kernel command line: root=/dev/vda rw highres=off  console=ttyS0 mem=256M ip=dhcp console=tty console=ttyS0
----snip----


Additional info:
It seems to be caused by &quot;-device virtio-rng-pci&quot;, the error will be gone if I remove this option when run qemu. And I checked that the option is supported by qemuppc:

$ tmp-glibc/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-ppc -device help 2&gt;&amp;1 |grep virtio-rng-pci
name &quot;virtio-rng-pci&quot;, bus PCI, alias &quot;virtio-rng&quot;

And I found the option was added by:

commit e890c05e66a21702e9e8ccce794b74cb7f5518ed
Author: Nathan Rossi &lt;nathan@nathanrossi.com&gt;
Date:   Thu Sep 22 23:53:00 2016 +1000

    runqemu: Move virtio RNG to machine configuration

    Not all QEMU machines (outside of those available in OE-Core) are
    capable of using the virtio-rng-pci device due to various machine models
    not having a pci/virtio bus. This makes it such that the use of the
    &apos;-device virtio-rng-pci&apos; flag to QEMU is machine specific.

    This patch removes the general addition of the flag to all runqemu
    targets and adds the flag into the QB_OPT_APPEND for all the qemu*
    machines in OE-Core that support its use (which is all of them).

    Signed-off-by: Nathan Rossi &lt;nathan@nathanrossi.com&gt;
    Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77648</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2017-10-17 22:35:29 +0000</bug_when>
    <thetext>After messing around with qemu source and enabling qemu tracing, I am convinced that the problem here is the openbios when it enumerates the PCI devices, it does find the VIRTIO_RNG device in it&apos;s tables.

Currently, the openbios code is not rebuilt, we purely use the upstream binary from the qemu tarball.  An entry would be needed in the pci_database.c code in the rom/openbios code for the Virtio_rng.

I did verify via the tracing, that while the openbios does not know how to handle the virtio-rng PCI entry, the kernel correctly identifies it and I see correct tracing output when the device is accessed.

I would suggest you report it upstream and then close this bug as reported upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78012</commentid>
    <comment_count>2</comment_count>
    <who name="Jackie Huang">jackie.huang</who>
    <bug_when>2017-11-07 02:40:06 +0000</bug_when>
    <thetext>The openbios issue tracker is not accessible:
https://tracker.coreboot.org/trac/openbios

So I report it in github:
https://github.com/openbios/openbios/issues/2

And send Email to the openbios mailing list:
openbios@openbios.org</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>