From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHxqo-0002YW-Hr for qemu-devel@nongnu.org; Tue, 19 Mar 2013 10:49:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHxqm-0004k5-9I for qemu-devel@nongnu.org; Tue, 19 Mar 2013 10:49:18 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:47843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHxqm-0004jn-5a for qemu-devel@nongnu.org; Tue, 19 Mar 2013 10:49:16 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Mar 2013 10:49:13 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id C26F76E803F for ; Tue, 19 Mar 2013 10:49:07 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2JEn9lY31719622 for ; Tue, 19 Mar 2013 10:49:09 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2JEn8KF015441 for ; Tue, 19 Mar 2013 11:49:09 -0300 Message-ID: <51487AE3.7010009@linux.vnet.ibm.com> Date: Tue, 19 Mar 2013 10:49:07 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1361987275-26289-1-git-send-email-stefanb@linux.vnet.ibm.com> <1361987275-26289-2-git-send-email-stefanb@linux.vnet.ibm.com> <87obel867v.fsf@blackfin.pond.sub.org> <51432221.3050609@linux.vnet.ibm.com> <87li9k7t0g.fsf@blackfin.pond.sub.org> <51471A40.3060405@linux.vnet.ibm.com> <877gl3suhx.fsf@blackfin.pond.sub.org> <51483D8F.80704@linux.vnet.ibm.com> <871ubb4g5w.fsf@blackfin.pond.sub.org> In-Reply-To: <871ubb4g5w.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V27 1/7] Support for TPM command line options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: mst@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, Luiz Capitulino On 03/19/2013 10:28 AM, Markus Armbruster wrote: > Stefan Berger writes: > >> >> I can write an OS that sends a command to the TPM and then shuts down >> without waiting for the program to terminate or the even the response >> from the TPM to come back . In this case we would need to cancel the >> command on exit()l. > Aha, now we're getting somewhere. > > Are you talking about the following scenario? > > * Guest sends TPM command, QEMU passes it through, QEMU thread blocks in > write() to TPM. > > * Guest powers down, QEMU is configured to terminate on powerdown, calls > exit(). > > * Unless you explicitly cancel the TPM command, $BAD_THINGS can happen. > > If yes, please describe at least one instance of $BAD_THINGS for me > again. BAD_THINGS = If a TPM command is executing as in the scenario you are describing, the thread will still be caught in the write(), thus the QEMU process cannot terminate and will be stuck in the thread-join as it is implemented now. If there was no thread-join QEMU would probably linger around as a zombie for a while. Stefan