From patchwork Thu Dec 22 20:41:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. Greg Wettstein" X-Patchwork-Id: 9485637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE41960405 for ; Thu, 22 Dec 2016 20:44:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFEA327F93 for ; Thu, 22 Dec 2016 20:44:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D228827D85; Thu, 22 Dec 2016 20:44:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,HK_NAME_DR, RCVD_IN_DNSWL_MED,TRACKER_ID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 37BAA27D85 for ; Thu, 22 Dec 2016 20:44:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKABZ-0005sZ-Fr; Thu, 22 Dec 2016 20:41:57 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKABY-0005sO-7z; Thu, 22 Dec 2016 20:41:56 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 32/BB-23854-39A3C585; Thu, 22 Dec 2016 20:41:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRWlGSWpSXmKPExsXiw+UQrTvJKib CYGWzhsWSj4tZLFZdPcDqwORxdPdvpgDGKNbMvKT8igTWjAuHnzMXPOGpOD3nJlMD40uuLkYu DiGBuYwSJy62MkI4DYwSvf8uMXcxcnKwCKhK9L17wghiswkYS+xs/84GYvMKWEvsXXkSzBYSk JZ4ueUHK4gtIWAqsfvbL7C4iICCxObeZ2BxYQF7iXPv9rGD2MwC2RIXtnxiAlkmIdDLKDGt5w L7BEbuBYwMqxg1ilOLylKLdA3N9JKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpOK9ZLzczcxAr3 NAAQ7GFdt9zzEKMnBpCTKu8QiJkKILyk/pTIjsTgjvqg0J7X4EKMGB4fA05PTZzFKseTl56Uq SfDuA6kTLEpNT61Iy8wBhiNMqQQHj5IIbxtImre4IDG3ODMdInWKUVFKnNfdEighAJLIKM2Da 4PFwCVGWSlhXkago4R4ClKLcjNLUOVfMYpzMCoJ8/4HGc+TmVcCN/0V0GImoMW2zdEgi0sSEV JSDYxNrZtsJx6QcnYNFj8buaPeTP/Nxwqft6+yz77ktU2cpVR0s4Pn/aXfZx0fdqtosn7kaOa P5dzvwy+qen7vo/mf2tZMN+zmr1tmdTDmzifHgNZ5B76xNl66Oe9AfPr7CtOfk8WzvW5t9/Ni v6edf86j8aDW38v73l8Q/176ZfqsG27Ly39rFHxRYinOSDTUYi4qTgQAmQ/0BXwCAAA= X-Env-Sender: greg@wind.enjellic.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1482439313!74298727!1 X-Originating-IP: [76.10.64.91] X-SpamReason: No, hits=1.5 required=7.0 tests=BODY_RANDOM_LONG, TRACKER_ID X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 59789 invoked from network); 22 Dec 2016 20:41:54 -0000 Received: from wind.enjellic.com (HELO wind.enjellic.com) (76.10.64.91) by server-5.tower-31.messagelabs.com with SMTP; 22 Dec 2016 20:41:54 -0000 Received: from wind.enjellic.com (localhost [127.0.0.1]) by wind.enjellic.com (8.14.3/8.14.3) with ESMTP id uBMKfqEX018663; Thu, 22 Dec 2016 14:41:53 -0600 Received: (from greg@localhost) by wind.enjellic.com (8.14.3/8.14.3/Submit) id uBMKfqKC018662; Thu, 22 Dec 2016 14:41:52 -0600 Date: Thu, 22 Dec 2016 14:41:52 -0600 From: "Dr. Greg Wettstein" Message-Id: <201612222041.uBMKfqKC018662@wind.enjellic.com> X-Mailer: Mail User's Shell (7.2.6-ESD1.0 03/31/2012) To: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.3 (wind.enjellic.com [0.0.0.0]); Thu, 22 Dec 2016 14:41:53 -0600 (CST) Cc: xen-users@lists.xen.org, dgdegra@tycho.nsa.gov, stable@vger.kernel.org, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH] tpm: Restore functionality to xen vtpm driver. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: greg@enjellic.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Functionality of the xen-tpmfront driver was lost secondary to the introduction of xenbus multi-page support in the following commit: ccc9d90a9a8b5c4ad7e9708ec41f75ff9e98d61d xenbus_client: Extend interface to support multi-page ring In this commit a pointer to the shared page address was being passed to the xenbus_grant_ring() function rather then the address of the shared page itself. This resulted in a situation where the driver would attach to the vtpm-stubdom but any attempt to send a command to the stub domain would timeout. A diagnostic finding for this regression is the following error message being generated when the xen-tpmfront driver probes for a device: <3>vtpm vtpm-0: tpm_transmit: tpm_send: error -62 <3>vtpm vtpm-0: A TPM error (-62) occurred attempting to determine the timeouts This fix is relevant to all kernels from 4.1 forward which is the release in which multi-page xenbus support was introduced. Daniel De Graaf formulated the fix by code inspection after the regression point was located. Signed-off-by: Dr. Greg Wettstein --- drivers/char/tpm/xen-tpmfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c index 5aaa268..dd83a07 100644 --- a/drivers/char/tpm/xen-tpmfront.c +++ b/drivers/char/tpm/xen-tpmfront.c @@ -203,7 +203,7 @@ static int setup_ring(struct xenbus_device *dev, struct tpm_private *priv) return -ENOMEM; } - rv = xenbus_grant_ring(dev, &priv->shr, 1, &gref); + rv = xenbus_grant_ring(dev, priv->shr, 1, &gref); if (rv < 0) return rv;