From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v10 11/20] x86/VPMU: Interface for setting PMU mode and flags Date: Fri, 19 Sep 2014 08:42:40 -0400 Message-ID: <541C24C0.9070002@oracle.com> References: <1409802080-6160-1-git-send-email-boris.ostrovsky@oracle.com> <1409802080-6160-12-git-send-email-boris.ostrovsky@oracle.com> <541B53BE.4000909@oracle.com> <541BEE9202000078000366AE@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <541BEE9202000078000366AE@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , "Aravind.Gopalakrishnan@amd.com" Cc: "tim@xen.org" , Kevin Tian , "keir@xen.org" , "suravee.suthikulpanit@amd.com" , "andrew.cooper3@citrix.com" , Eddie Dong , "xen-devel@lists.xen.org" , Jun Nakajima List-Id: xen-devel@lists.xenproject.org On 09/19/2014 02:51 AM, Jan Beulich wrote: >>>> On 18.09.14 at 23:50, wrote: >> On 09/18/2014 12:11 AM, Tian, Kevin wrote: >>>> From: Boris Ostrovsky [mailto:boris.ostrovsky@oracle.com] >>>> +{ >>>> + unsigned i, j, allbutself_num, tasknum, mycpu; >>>> + static s_time_t start; >>>> + static struct tasklet **sync_task; >>>> + struct vcpu *curr_vcpu = current; >>>> + static struct vcpu *sync_vcpu; >>>> + int ret = 0; >>>> + >>>> + tasknum = allbutself_num = num_online_cpus() - 1; >>>> + >>>> + if ( sync_task ) /* if set, we are in hypercall continuation */ >>>> + { >>>> + if ( (sync_vcpu != NULL) && (sync_vcpu != curr_vcpu) ) >>>> + /* We are not the original caller */ >>>> + return -EAGAIN; >>> I assume hypercall continuation will happen on original vcpu context. Under >>> which situation the hypercall will be continued on a different vcpu? If yes, >>> would it be an unbounded situation where you may wait unexpected time >>> to have sync_vcpu==curr_vcpu? >> The continuation call is gone in v11. If we are stuck waiting for more >> than 5 seconds we'll simply return -EAGAIN and have the caller retry. > That reads wrong, but I'd of course have to see whether the just > wording above is incorrectly reflecting the code changes you did. The only thing that I can think of that I didn't mention is hypercall_preempt_check() to bail out earlier than 5 seconds. Is that what you are missing in my reply? Otherwise I don't know what else is wrong. -boris