From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] Added call parameter to track whether invocation originated with guest or elsewhere Date: Fri, 26 Oct 2012 18:48:29 -0200 Message-ID: <20121026204829.GB4991@amt.cnet> References: <1350439833.8785.27.camel@WillAuldHomeLinux> <507E89F5.4000301@redhat.com> <20121017140918.GA4940@amt.cnet> <507EC079.3050908@redhat.com> <1350943100.5232.1.camel@WillAuldHomeLinux> <96EC5A4F3149B74492D2D9B9B1602C2728B8BDD4@ORSMSX108.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , "kvm@vger.kernel.org" , "Zhang, Xiantao" , "Liu, Jinsong" To: "Auld, Will" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11232 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932185Ab2JZUzG (ORCPT ); Fri, 26 Oct 2012 16:55:06 -0400 Content-Disposition: inline In-Reply-To: <96EC5A4F3149B74492D2D9B9B1602C2728B8BDD4@ORSMSX108.amr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Oct 23, 2012 at 07:56:54PM +0000, Auld, Will wrote: > Having looked closer at the tacked of changing out the index and data fields in some > function calls for a struct parameter with these and a originator field (host or guest) > it is less attractive than I thought it would be. The only place where we need to know the initiator is in kvm_write_tsc() which has an implicit index. At the moment yes, but it might have other uses in the future. > I have been trying to determine whether there is a possibility for taking a context switch while a guest initiated set_msr() is in progress whereby the new thread might invoke the set_msr()/kvm_write_tsc() routines. It looks to me like this is not possible but I can't be sure. It is not possible. > If it is not possible we can set a variable for the vcpu when a guest call is in progress and this would be sufficient. > > What do you think? > Thanks, The struct parameter seems the preferred choice as there might be other uses to this information in the future.