From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v6 5/5] KVM : VMX: Use posted interrupt to deliver virtual interrupt Date: Tue, 19 Mar 2013 12:27:38 -0300 Message-ID: <20130319152738.GA10627@amt.cnet> References: <1363354271-25302-6-git-send-email-yang.z.zhang@intel.com> <20130319085438.GA4832@redhat.com> <20130319122359.GW11223@redhat.com> <20130319132924.GA14157@redhat.com> <20130319145104.GA19292@redhat.com> <20130319151254.GB19292@redhat.com> <20130319151955.GC10096@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Zhang, Yang Z" , "kvm@vger.kernel.org" , "Zhang, Xiantao" To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:3304 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756327Ab3CSP1m (ORCPT ); Tue, 19 Mar 2013 11:27:42 -0400 Content-Disposition: inline In-Reply-To: <20130319151955.GC10096@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 19, 2013 at 12:19:55PM -0300, Marcelo Tosatti wrote: > See the previous argument: should never enter guest mode with PIR ON bit > set. With logic above: > > context1 context2 context3 > set_bit(PIR-1) > r = pi_test_and_set_on() set_bit(PIR-40) > set_bit(KVM_REQ_EVENT) > if (kvm_check_request(KVM_REQ_EVENT) > if (test_and_clear_bit(on)) > > kvm_apic_update_irr() r = pi_test_and_set_on() > > guest entry with PIR ON=1 > > > Thats the reason for unconditional clearing on guest entry: it is easy > to verify its correct. I understand and agree the callback (and VMWRITE) > is not nice. Re: KVM_REQ_EVENT setting after set_bit(KVM_REQ_EVENT) assures no guest entry with PIR ON=1. Might be, would have to verify. Its trickier though. Maybe add a FIXME: to the callback and remove it later.