From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za0Zz-0001Mr-09 for qemu-devel@nongnu.org; Thu, 10 Sep 2015 08:03:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Za0Zt-0000kA-7g for qemu-devel@nongnu.org; Thu, 10 Sep 2015 08:03:50 -0400 References: <1441046762-5788-1-git-send-email-thuth@redhat.com> <1441046762-5788-2-git-send-email-thuth@redhat.com> <20150901003808.GI11475@voom.redhat.com> <55E583A6.4000600@redhat.com> <20150908050316.GA372@tungsten.ozlabs.ibm.com> <20150908051528.GD24774@voom.redhat.com> <55F0A036.2090508@redhat.com> <55F13241.8040004@redhat.com> <20150910104051.GC11781@voom> From: Thomas Huth Message-ID: <55F1719B.5070208@redhat.com> Date: Thu, 10 Sep 2015 14:03:39 +0200 MIME-Version: 1.0 In-Reply-To: <20150910104051.GC11781@voom> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hLm88qx1NToChRwKBBOcAS2qbmwrl0jLg" Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] spapr: Add support for hwrng when available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: armbru@redhat.com, qemu-devel@nongnu.org, michael@ellerman.id.au, qemu-ppc@nongnu.org, amit.shah@redhat.com, Sam Bobroff This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hLm88qx1NToChRwKBBOcAS2qbmwrl0jLg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/09/15 12:40, David Gibson wrote: > On Thu, Sep 10, 2015 at 09:33:21AM +0200, Thomas Huth wrote: >> On 09/09/15 23:10, Thomas Huth wrote: >>> On 08/09/15 07:15, David Gibson wrote: >> ... >>>> At this point rather than just implementing them as discrete machine= >>>> options, I suspect it will be more maintainable to split out the >>>> h-random implementation as a pseudo-device with its own qdev and so >>>> forth. We already do similarly for the RTAS time of day functions >>>> (spapr-rtc). >>> >>> I gave that I try, but it does not work as expected. To be able to >>> specify the options, I'd need to instantiate this device with the >>> "-device" option, right? Something like: >>> >>> -device spapr-rng,backend=3Drng0,usekvm=3D0 >>> >>> Now this does not work when I use TYPE_SYS_BUS_DEVICE as parent class= >>> like it is done for spapr-rtc, since the user apparently can not plug= >>> device to this bus on machine spapr (you can also not plug an spapr-r= tc >>> device this way!). >>> >>> The spapr-vlan, spapr-vty, etc. devices are TYPE_VIO_SPAPR_DEVICE, so= I >>> also tried that instead, but then the rng device suddenly shows up un= der >>> /vdevice in the device tree - that's also not what we want, I guess. >> >> I did some more tests, and I think I can get this working with one sma= ll >> modification to spapr_vio.c =2E.. >> i.e. when the dt_name has not been set, the device won't be added to t= he >> /vdevice device tree node. If that's acceptable, I'll continue with th= is >> approach. >=20 > A bit hacky. >=20 > I think it would be preferable to build it under SysBus by default, > like spapr-rtc. Properties can be set on the device using -global (or > -set, but -global is easier). If anyhow possible, I'd prefere to use "-device" for this instead, becaus= e a) it's easier to use for the user, for example you can simply use "-device spapr-rng,?" to get the list of properties - this does not seem to work with spapr-rtc (it has a "date" property which does not show up in the help text?) b) unlike the rtc device which is always instantiated, the rng device is rather optional, so it is IMHO more intuitive if created via the -device option. So I'd like to give it a try with the TYPE_VIO_SPAPR_DEVICE first ... if you then still don't like the patches at all, I can still rework them to use TYPE_SYS_BUS_DEVICE instead. Thomas --hLm88qx1NToChRwKBBOcAS2qbmwrl0jLg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJV8XGbAAoJEC7Z13T+cC21p5gP/A5jdOJW33D/4yiNiRZApzHF rV9matVPCbTL5z8ABubTPp9fGny8SN0RA44UF8jOiGqTupHDJgyhfB4KoXHiaosS ZSo1sjTT7s9Eya8n79Mt8Hc19D/VrHRoP2RvrvtFcCXLEKH2g4+wjMGtyW0l97jo mF9GzRwQSz1ZOKGIgA95Hp11B7fws04RzjKJsDJdJmX5PVUJF/AWIqqMQu7rnkac R/bH365Ml/gpEL/29a7IR7TYSnD3tEs1Mf5t/OAtvtbjWc4Hp6vmjLSg+nVBCYtC KoF8in86L1yiGhvn1FcsVYCvLBYkb2xkxEccNh4SO8g2elov6YcnydNh1mS90xyP 9Ns7df17KNgl8+B69/GF4OrKHcmZOxE3ezoOPF/gSbClMoNBFB4InJpyhdWU+GcW b77Zg29HLUnUGXgPnGV3tWavEN1un3bCcMeSRRIsdD9W6DTdBUYCg7iC+UjI+z0m Zd82SUpPLGdWwrk7jLDbr6JAbB1QyXdwqkbQNY9jfq1iclsMKyQI/ZOGig76mHD1 dnuExlWBwj/WKY44C6yMw1a609jJN6t7Ep5FmDplOMbeLiJApJ6lHHf1kt+7+bKt YOYcq7T4MD6J+QUWloks6LfIsBpNpJaAbfLB0B3Dt00NP71JrIAkOrZeQ0Ot3t+W Rc8bMpkptUlj8pl+ql7a =oin3 -----END PGP SIGNATURE----- --hLm88qx1NToChRwKBBOcAS2qbmwrl0jLg--