public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Li, Jiongxi" <jiongxi.li@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/5]KVM: x86, apicv: add APICv register virtualization support
Date: Wed, 19 Sep 2012 12:12:33 +0300	[thread overview]
Message-ID: <50598C81.6050101@redhat.com> (raw)
In-Reply-To: <D9137FCD9CFF644B965863BCFBEDABB8783C83@SHSMSX101.ccr.corp.intel.com>

On 09/18/2012 05:38 PM, Li, Jiongxi wrote:
>> 
>> >
>> > +static int handle_apic_write(struct kvm_vcpu *vcpu) {
>> > +	unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
>> > +	u32 offset = exit_qualification & 0xfff;
>> > +
>> > +	/* APIC-write VM exit is trap-like and thus no need to adjust IP */
>> > +	return kvm_apic_write_nodecode(vcpu, offset) == 0; }
>> 
>> Return 1 here means exit to userspace.  This will go crazy.
>> 
>> You need to return 0 always.  If this is an msr write to a read-only register, you
>> need to inject a #GP (IIRC).
> 
> Return 0 means exit to userspace, so it should return 1, right?
> __vcpu_run
> {
>   while (r>0)
>   {  
>      r = vcpu_enter_guest(vcpu)
>      if (r<=0)
>        break;
>   }
> }

Yes, sorry.  We should switch to a symbolic constant one day, it's
confusing.


-- 
error compiling committee.c: too many arguments to function

      reply	other threads:[~2012-09-19  9:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  5:41 [PATCH 1/5]KVM: x86, apicv: add APICv register virtualization support Li, Jiongxi
2012-09-06 16:01 ` Avi Kivity
2012-09-14 14:14   ` Li, Jiongxi
2012-09-16  9:41     ` Avi Kivity
2012-09-18 14:38   ` Li, Jiongxi
2012-09-19  9:12     ` Avi Kivity [this message]

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=50598C81.6050101@redhat.com \
    --to=avi@redhat.com \
    --cc=jiongxi.li@intel.com \
    --cc=kvm@vger.kernel.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