From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/5]KVM: x86, apicv: add APICv register virtualization support Date: Wed, 19 Sep 2012 12:12:33 +0300 Message-ID: <50598C81.6050101@redhat.com> References: <5048C8E5.40107@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: "Li, Jiongxi" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44332 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560Ab2ISJMg (ORCPT ); Wed, 19 Sep 2012 05:12:36 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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