From: "Michael S. Tsirkin" <mst@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC dontapply] kvm_para: add mmio word store hypercall
Date: Mon, 26 Mar 2012 13:30:38 +0200 [thread overview]
Message-ID: <20120326113037.GC15207@redhat.com> (raw)
In-Reply-To: <4F7041EE.10305@redhat.com>
On Mon, Mar 26, 2012 at 12:16:14PM +0200, Avi Kivity wrote:
> On 03/26/2012 12:08 PM, Michael S. Tsirkin wrote:
> >
> > > > + gpa = hc_gpa(vcpu, a1, a2);
> > > > + if (!write_mmio(vcpu, gpa, 2, &a0) && run) {
> > >
> > > What's this && run thing?
> >
> > I'm not sure - copied this from another other place in emulation:
> > arch/x86/kvm/x86.c:4953: if (!write_mmio(vcpu, gpa, 2, &a0) && run)
> >
> > I assumed there's some way to trigger emulation while VCPU does not run.
> > No?
>
> Not the way you initialize run above.
Thanks for pointing this out, I'll drop the test.
> >
> > >
> > > > + run->exit_reason = KVM_EXIT_MMIO;
> > > > + run->mmio.phys_addr = gpa;
> > > > + memcpy(run->mmio.data, &a0, 2);
> > > > + run->mmio.len = 2;
> > > > + run->mmio.is_write = 1;
> > > > + r = 0;
> > > > + }
> > > > + goto noret;
> > >
> > > What if the address is in RAM?
> > > Note the guest can't tell if a piece of memory is direct mapped or
> > > implemented as mmio.
> >
> > True but doing hypercalls for memory which can be
> > mapped directly is bad for performance - it's
> > the reverse of what we are trying to do here.
>
> It's bad, but the guest can't tell.
>
> Suppose someone implements virtio in hardware and we pass it through to
> a guest. It should continue working, no?
Why would we want hypercalls then?
As I see it, virtio device would have a capability
that tells the guest to use hypercalls for access.
An actual PCI device won't expose this capability,
as would a device on a host which lacks the hypercall.
> > The intent is to use this for virtio where we can explicitly let the
> > guest know whether using a hypercall is safe.
> >
> > Acceptable? What do you suggest?
>
> It's iffy.
Question is, do we want a bunch of dead code sitting there
just in case? And what are the chances it'll work correctly
when we need it to?
> What's the performance gain from this thing?
I'll test and post separately.
>
> --
> error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-03-26 11:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-25 22:05 [PATCH RFC dontapply] kvm_para: add mmio word store hypercall Michael S. Tsirkin
2012-03-25 23:25 ` H. Peter Anvin
2012-03-26 6:31 ` Michael S. Tsirkin
2012-03-26 9:21 ` Avi Kivity
2012-03-26 10:08 ` Michael S. Tsirkin
2012-03-26 10:16 ` Avi Kivity
2012-03-26 11:30 ` Michael S. Tsirkin [this message]
2012-03-26 12:11 ` Avi Kivity
2012-03-26 10:29 ` Gleb Natapov
2012-03-26 11:24 ` Michael S. Tsirkin
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=20120326113037.GC15207@redhat.com \
--to=mst@redhat.com \
--cc=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=joerg.roedel@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=tglx@linutronix.de \
/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