From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0EDD-0007Kh-Nq for qemu-devel@nongnu.org; Wed, 22 Feb 2012 10:34:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0ED8-0005SF-UA for qemu-devel@nongnu.org; Wed, 22 Feb 2012 10:34:35 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:33223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0ED8-0005S3-QW for qemu-devel@nongnu.org; Wed, 22 Feb 2012 10:34:30 -0500 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Feb 2012 10:34:29 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 1A6B838C80A7 for ; Wed, 22 Feb 2012 10:34:21 -0500 (EST) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1MFFa9E222378 for ; Wed, 22 Feb 2012 10:34:20 -0500 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1MF5Xgd021424 for ; Wed, 22 Feb 2012 08:05:49 -0700 Message-ID: <4F4503A7.9030800@linux.vnet.ibm.com> Date: Wed, 22 Feb 2012 10:03:03 -0500 From: Stefan Berger MIME-Version: 1.0 References: <20120220220201.GD19278@redhat.com> <4F42E899.3010907@linux.vnet.ibm.com> <20120221031854.GA2502@redhat.com> <4F437DBE.90901@linux.vnet.ibm.com> <20120221121810.GA6975@redhat.com> <4F43B2B6.1040109@linux.vnet.ibm.com> <20120221195812.GB9062@redhat.com> <4F441B08.6000306@linux.vnet.ibm.com> <20120221230845.GD9062@redhat.com> <4F443508.8070408@linux.vnet.ibm.com> <20120222043427.GA26903@redhat.com> In-Reply-To: <20120222043427.GA26903@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V14 2/7] Add TPM (frontend) hardware interface (TPM TIS) to Qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, Andreas Niederl On 02/21/2012 11:34 PM, Michael S. Tsirkin wrote: > On Tue, Feb 21, 2012 at 07:21:28PM -0500, Stefan Berger wrote: >> On 02/21/2012 06:08 PM, Michael S. Tsirkin wrote: >> > >> The locking times are short since no major computations >> are done while the lock is held. >> Considering that the TPM TIS interface is a non-DMA, byte-by-byte >> send/receive interface, the performance problems, if at all a >> problem, are to be found somewhere else : VMExits for example; if >> interface is used in polling mode, then the interval between polls. >> >> Stefan > In that case, you can take the qemu lock in your backend > and avoid locking in the frontend completely. > Maybe it's just me, but I prefer to have locks around the code that has the criticial section, rather than entering a function with locks held, especially since it would be in a different file (backend) where the lock then is grabbed. Also I do need a lock in the frontend for the condition that is used there. Stefan