qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, michael@ellerman.id.au,
	qemu-ppc@nongnu.org, amit.shah@redhat.com,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] spapr: Add support for hwrng when available
Date: Tue, 8 Sep 2015 15:03:16 +1000	[thread overview]
Message-ID: <20150908050316.GA372@tungsten.ozlabs.ibm.com> (raw)
In-Reply-To: <55E583A6.4000600@redhat.com>

On Tue, Sep 01, 2015 at 12:53:26PM +0200, Thomas Huth wrote:
> On 01/09/15 02:38, David Gibson wrote:
> > On Mon, Aug 31, 2015 at 08:46:01PM +0200, Thomas Huth wrote:
> >> From: Michael Ellerman <michael@ellerman.id.au>
> >>
> >> Some powerpc systems have support for a hardware random number generator
> >> (hwrng). If such a hwrng is present the host kernel can provide access
> >> to it via the H_RANDOM hcall.
> >>
> >> The kernel advertises the presence of a hwrng with the KVM_CAP_PPC_HWRNG
> >> capability. If this is detected we add the appropriate device tree bits
> >> to advertise the presence of the hwrng to the guest kernel.
> >>
> >> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> >> [thuth: Refreshed patch so it applies to QEMU master branch]
> >> Signed-off-by: Thomas Huth <thuth@redhat.com>
> > 
> > So, I'm confused by one thing.
> > 
> > I thought new kernel handled hcalls were supposed to be disabled by
> > default, but I don't see any calls to kvmppc_enable_hcall() to turn on
> > H_RANDOM.
> 
> Michael's patch was from 2013, the kvmppc_enable_hcall() stuff seems to
> be from 2014 ... so the enablement is likely missing in this patch,
> indeed. I didn't test the in-kernel hypercall yet, just my QEMU
> implementation so far, that's why I did not notice this yet.
> 
> Michael, do you want to rework your patch? Or shall I add an additional
> enablement patch to my queue?

If I recall correctly, it's specifically not enabled: there was quite a lot of
discussion about it when Michael posted the patches and I think the consensus
was that it should only be enabled by QEMU, and only if the user could decide
if it was used or not.

What if we set up another backend that just enables the hcall in KVM?

This would answer the question about what to do if both are available as well:
just do only what the user has asked for. (But I'm not sure what the default
behaviour should be if the user doesn't specify anything.)

(Oh also: I have tested the in-kernel hcall using a QEMU modified to enable it
and it seems to work :-)

Cheers,
Sam.

  reply	other threads:[~2015-09-08  5:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 18:46 [Qemu-devel] [PATCH v2 0/2] ppc/spapr_hcall: Implement H_RANDOM hypercall Thomas Huth
2015-08-31 18:46 ` [Qemu-devel] [PATCH v2 1/2] spapr: Add support for hwrng when available Thomas Huth
2015-09-01  0:38   ` David Gibson
2015-09-01 10:53     ` Thomas Huth
2015-09-08  5:03       ` Sam Bobroff [this message]
2015-09-08  5:15         ` [Qemu-devel] [Qemu-ppc] " David Gibson
2015-09-09 21:10           ` Thomas Huth
2015-09-10  7:33             ` Thomas Huth
2015-09-10 10:40               ` David Gibson
2015-09-10 12:03                 ` Thomas Huth
2015-09-10 12:13                   ` Alexander Graf
2015-09-11  0:46                     ` David Gibson
2015-09-11  9:43                       ` Alexander Graf
2015-09-14  2:27                         ` David Gibson
2015-09-14  7:36                           ` Alexander Graf
2015-09-11  0:45                   ` David Gibson
2015-09-11  7:30                     ` Thomas Huth
2015-09-14  2:25                       ` David Gibson
2015-09-08  5:38         ` Thomas Huth
2015-09-09  0:54           ` Sam Bobroff
2015-09-10 12:06             ` Greg Kurz
2015-09-09 14:09   ` [Qemu-devel] " Greg Kurz
2015-08-31 18:46 ` [Qemu-devel] [PATCH v2 2/2] ppc/spapr_hcall: Implement H_RANDOM hypercall in QEMU Thomas Huth
2015-09-01  0:47   ` David Gibson
2015-09-01 11:03     ` Thomas Huth
2015-09-07 15:05     ` Thomas Huth
2015-09-08  1:14       ` David Gibson
2015-09-02  5:34   ` Amit Shah
2015-09-02  7:48     ` David Gibson
2015-09-02  8:58       ` Thomas Huth
2015-09-02 10:06         ` Amit Shah
2015-09-02 10:02       ` Amit Shah
2015-09-03  1:21       ` Michael Ellerman
2015-09-03  2:17         ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150908050316.GA372@tungsten.ozlabs.ibm.com \
    --to=sam.bobroff@au1.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=michael@ellerman.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).