From: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/3] Refactor hypercall infrastructure
Date: Mon, 27 Aug 2007 12:29:10 -0500 [thread overview]
Message-ID: <1188235750.6364.8.camel@squirrel> (raw)
In-Reply-To: <46D2F680.9060100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
On Mon, 2007-08-27 at 19:06 +0300, Avi Kivity wrote:
> Anthony Liguori wrote:
> > void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
> > {
> > int i;
> > @@ -1632,6 +1575,12 @@ void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
> > vcpu->regs[VCPU_REGS_RBX] = 0;
> > vcpu->regs[VCPU_REGS_RCX] = 0;
> > vcpu->regs[VCPU_REGS_RDX] = 0;
> > +
> > + if ((function & 0xFFFF0000) == 0x40000000) {
> > + emulate_paravirt_cpuid(vcpu, function);
> > + goto out;
> > + }
> > +
> >
>
> Hmm. Suppose we expose kvm capabilities to host userspace instead, and
> let the host userspace decide which features to expose to the guest via
> the regular cpuid emulation? That allows the qemu command line to
> control the feature set.
That's a little awkward with something like NPT. Some CPUID features
should be masked by the availability of NPT support in hardware and
whether kernelspace supports NPT. To set these feature bits in
userspace, you would have to query kernelspace anyway.
It would be nice to be consistent with the other cpuid flags though.
There is somewhat of a similar issue with migration here. If we have an
initial set of PV features and down the road, add more, it may be
desirable to enable those features depending on what your network looks
like. Yeah, I think I agree that userspace is the right place to set
these bits.
> >
> > +static int ud_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
> > +{
> > + int er;
> > +
> > + er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0);
> > +
> > + /* we should only succeed here in the case of hypercalls which
> > + cannot generate an MMIO event. MMIO means that the emulator
> > + is mistakenly allowing an instruction that should generate
> > + a UD fault so it's a bug. */
> > + BUG_ON(er == EMULATE_DO_MMIO);
> >
>
> It's a guest-triggerable bug; one vcpu can be issuing ud2-in-a-loop
> while the other replaces the instruction with something that does mmio.
Good catch! I'll update.
> > +
> > +#define KVM_ENOSYS ENOSYS
> >
>
> A real number (well, an integer, not a real) here please. I know that
> ENOSYS isn't going to change soon, but this file defines the kvm abi and
> I'd like it to be as independent as possible.
>
> Let's start it at 1000 so that spurious "return 1"s or "return -1"s
> don't get translated into valid error numbers.
Okay.
> I really like the simplification to the guest/host interface that this
> patch brings.
Thanks.
Regards,
Anthony Liguori
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-08-27 17:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-27 15:16 [PATCH 0/3] KVM paravirtualization framework Anthony Liguori
2007-08-27 15:16 ` [PATCH 1/3] Implement emulator_write_phys() Anthony Liguori
2007-08-27 15:16 ` [PATCH 2/3] Refactor hypercall infrastructure Anthony Liguori
2007-08-27 15:16 ` [PATCH 3/3] KVM paravirt-ops implementation Anthony Liguori
[not found] ` <11882278082826-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-08-27 16:06 ` [PATCH 2/3] Refactor hypercall infrastructure Avi Kivity
[not found] ` <46D2F680.9060100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-27 17:29 ` Anthony Liguori [this message]
2007-08-27 15:45 ` [PATCH 1/3] Implement emulator_write_phys() Avi Kivity
2007-08-27 17:23 ` Anthony Liguori
2007-08-27 17:26 ` Avi Kivity
[not found] ` <1188236391.6364.14.camel@squirrel>
2007-08-27 17:47 ` Avi Kivity
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=1188235750.6364.8.camel@squirrel \
--to=aliguori-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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