public inbox for kvmarm@lists.cs.columbia.edu
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Andrew Jones <drjones@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: Advice on HYP interface for AsyncPF
Date: Thu, 9 Apr 2015 15:35:06 +0200	[thread overview]
Message-ID: <20150409133506.GN4715@cbox> (raw)
In-Reply-To: <20150409120646.GA3212@hawk.usersys.redhat.com>

On Thu, Apr 09, 2015 at 02:06:47PM +0200, Andrew Jones wrote:
> On Thu, Apr 09, 2015 at 08:57:23AM +0100, Marc Zyngier wrote:
> > On Thu, 9 Apr 2015 02:46:54 +0100
> > Mario Smarduch <m.smarduch@samsung.com> wrote:
> > 
> > Hi Mario,
> > 
> > > I'm working with AsyncPF, and currently using
> > > hyp call to communicate guest GFN for host to inject
> > > virtual abort - page not available/page available.
> > > 
> > > Currently only PSCI makes use of that interface,
> > > (handle_hvc()) can we overload interface with additional
> > > hyp calls in this case pass guest gfn? Set arg0
> > > to some range outside of PSCI use.
> > 
> > I can't see a reason why we wouldn't open handle_hvc() to other
> > paravirtualized services. But this has to be done with extreme caution:
> > 
> > - This becomes an ABI between host and guest
> 
> To expand on that, if the benefits don't out weight the maintenance
> required for that ABI, for life, then it turns into a life-time burden.
> Any guest-host speedups that can be conceived, which require hypercalls,
> should probably be bounced of the hardware people first. Waiting for
> improvements in the virt extensions may be a better choice than
> committing to a PV solution.
> 
> > - We need a discovery protocol
> 
> Hopefully all users of the PSCI hypcall have been using function #0,
> because handle_hvc unfortunately hasn't been checking it.

huh?  I don't understand this, sorry.

> In any case,
> I'm not sure we have much choice but to start enforcing it now. Once we
> do, with something like
> 
> switch(hypcall_nr) {
> case 0: /* handle psci call */
> default: return -KVM_ENOSYS;
> }
> 
> then, I think the guest's discovery protocol can simply be
> 
> if (do_hypercall() == -ENOSYS) {
>    /* PV path not supported, fall back to whatever... */
> }
> 
> > - We need to make sure other hypervisors don't reuse the same function
> >   number for other purposes
> 
> I'm not sure what this means. Xen already has several hypercalls defined
> for ARM, the same that they have for x86, which don't match any of the
> KVM hypercalls. Now, KVM for other arches (which is maybe what you meant)
> does define a handful, which we should integrate with, as KVM mixes
> architectures within it's hypercall number allocation, see
> include/uapi/linux/kvm_para.h. Just using the common code should make it
> easy to avoid problems. We don't have a problem with the PSCI hypcall, as
> zero isn't allocated. Ideally we would define PSCI properly though,
> e.g. KVM_HC_ARM_PSCI, and still reserve zero in the common header. To do
> that maybe we'll need to keep #0 as an ARM-only alias for the new number
> for compatibility now?
> 
> > 
> > Maybe we should adopt Xen's idea of a hypervisor node in DT where we
> > would describe the various services? How will that work with ACPI?
> 
> I don't think we'll ever have a "virt guest" ACPI table that we can
> use for this stuff, so this won't work for ACPI. But I think the ENOSYS
> probing should be sufficient for this anyway.
> 
We've reserved a Xen table on ACPI, not sure why we can't do the same
for KVM or a generic ARM PV table for that matter... ?

-Christoffer

  parent reply	other threads:[~2015-04-09 13:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  1:46 Advice on HYP interface for AsyncPF Mario Smarduch
2015-04-09  7:57 ` Marc Zyngier
2015-04-09 12:06   ` Andrew Jones
2015-04-09 12:48     ` Mark Rutland
2015-04-09 13:43       ` Andrew Jones
2015-04-09 14:00         ` Mark Rutland
2015-04-09 14:22           ` Andrew Jones
2015-04-09 14:37             ` Mark Rutland
2015-04-09 14:54               ` Andrew Jones
2015-04-09 15:20                 ` Mark Rutland
2015-04-09 19:01                   ` Andrew Jones
2015-04-13 10:46                     ` Mark Rutland
2015-04-13 12:52                       ` Andrew Jones
2015-04-09 14:48             ` Mark Rutland
2015-04-09 13:35     ` Christoffer Dall [this message]
2015-04-09 13:59       ` Andrew Jones
2015-04-09 14:22         ` Christoffer Dall
2015-04-09 14:42           ` Andrew Jones
2015-04-10  2:36   ` Mario Smarduch
2015-04-10  8:53     ` Marc Zyngier
2015-04-10 23:45       ` Mario Smarduch

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=20150409133506.GN4715@cbox \
    --to=christoffer.dall@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.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