From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpIJz-0008Q0-HW for qemu-devel@nongnu.org; Mon, 04 May 2015 11:30:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpIJw-0002uq-IP for qemu-devel@nongnu.org; Mon, 04 May 2015 11:30:15 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:49046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpIJw-0002ul-By for qemu-devel@nongnu.org; Mon, 04 May 2015 11:30:12 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 May 2015 09:30:11 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id B69891FF001E for ; Mon, 4 May 2015 09:21:18 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t44FU8kn40501262 for ; Mon, 4 May 2015 08:30:08 -0700 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t44FU6iE008033 for ; Mon, 4 May 2015 09:30:07 -0600 Message-ID: <55479078.8050008@linux.vnet.ibm.com> Date: Mon, 04 May 2015 11:30:00 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1430724181-476-1-git-send-email-quan.xu@intel.com> <1430724181-476-6-git-send-email-quan.xu@intel.com> In-Reply-To: <1430724181-476-6-git-send-email-quan.xu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 5/6] Qemu-Xen-vTPM: Qemu vTPM xenstubdoms backen. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Quan Xu , stefano.stabellini@eu.citrix.com, eblake@redhat.com Cc: dgdegra@tycho.nsa.gov, wei.liu2@citrix.com, qemu-devel@nongnu.org, xen-devel@lists.xen.org On 05/04/2015 03:23 AM, Quan Xu wrote: > This Patch provides the glue for the TPM_TIS(Qemu frontend) to Xen > stubdom vTPM domain that provides the actual TPM functionality. It > sends data and TPM commends with xen_vtpm_frontend. It is similar as > another two vTPM backens: > *vTPM passthrough backen Since QEMU 1.5. > *vTPM libtpms-based backen. > > Some details: > This part of the patch provides support for the spawning of a thread > that will interact with stubdom vTPM domain by the xen_vtpm_frontend. > It expects a signal from the frontend to wake and pick up the TPM > command that is supposed to be processed and delivers the response > packet using a callback function provided by the frontend. > > The backend connects itself to the frontend by filling out an interface > structure with pointers to the function implementing support for various > operations. > > (QEMU) vTPM XenStubdoms backen is initialized by Qemu command line options, > "-tpmdev xenstubdoms,id=xenvtpm0 -device tpm-tis,tpmdev=xenvtpm0" > > Signed-off-by: Quan Xu Reviewed-by: Stefan Berger + +#ifdef DEBUG_TPM +#define DPRINTF(fmt, ...) \ + do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) +#else +#define DPRINTF(fmt, ...) \ + do { } while (0) +#endif In case some other parts needs revision, please use the following instead: #define DEBUG_TPM 0 #define DPRINTF(fmt, ...) do { \ if (DEBUG_TPM) { \ fprintf(stderr, fmt, ## __VA_ARGS__); \ } \ } while (0); Stefan