Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4527907imm; Mon, 17 Sep 2018 15:54:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaze+KQl9OaNQG14AhuZ3CFZiF24vsZO5R9USjtgy7+m3ceb3LKQVt4grfIUi0/8+UADPyW X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr25118494pgf.12.1537224870459; Mon, 17 Sep 2018 15:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537224870; cv=none; d=google.com; s=arc-20160816; b=bp3wvATrdV3seES6//fj5ClFpx68Ep/x2wmrjPVkxdEPP5NGNxO5zUVaSRI3qMcoOa uqYj7bA3Mh/ojYTLVPBy/2zfd5YaIdG1AcrtfGCmsDCxpVkYbGaPUbJuIf3peYK8fLR0 T0kvnny6vPmy1Q7G+Bor/HIhxk8cZBbmjqyLIzHpzs4BnGfn992TXTnuhbRL6QpLgG+U 5t1rPWTQ7Rm6SEmJty9V8yonLZMk2n2+MbspzWX6Ja+Gdoi0ZHuQ3zryK1EHYK8Qxq/H 5eZq/Vo5z1XJ40nw8WyE6Xgxo0Gr5yARlWQbwl3y4LM8Nr9WXxJUEYfZqw4ChAnbPBEd 7w/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6cwOTq3UQ6q7QNDO3eCSq9fJk8XMVfycexIgWuLK3N8=; b=T035hqYWpUcBWnA00dOfehu4Uf6goET90XD2f0dfe7M7p5y/sBJEoNsYQhfdTBwJri z/+zpwSIosxAteZABBqOg+2WR2siX2bHVZESVd2WHVWnmrI9pWWzrac9r/T/is5yDyoj 9WTSPSfrGFFQ1ULX0Z5PcFY7Sk1o3XDJRmmPvQnEgMgRsxkx90O54dGe0ZGoYvIsfmUi lRSe1y/lJzfnYDSf3ayQdUpZoVW9NsK1wCQGZGfgnQexEBXO88sO2bXwnHnZ9KqVhuXL dhaCPNEFQW0rm8nIwq7I+FE9wOuJXoRrt/e7bDusVFCBJZ2w42Epb+WJfeHfQTyXe5nI W/iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="ziUKo8o/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13-v6si16334707pgh.627.2018.09.17.15.54.15; Mon, 17 Sep 2018 15:54:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="ziUKo8o/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729518AbeIREWf (ORCPT + 99 others); Tue, 18 Sep 2018 00:22:35 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:43802 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728874AbeIREWf (ORCPT ); Tue, 18 Sep 2018 00:22:35 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8HMnELc146812; Mon, 17 Sep 2018 22:52:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=6cwOTq3UQ6q7QNDO3eCSq9fJk8XMVfycexIgWuLK3N8=; b=ziUKo8o/EYjUgRdbunfDQ2LYazEn8hfkd8gBBeASIq1GxfD9RCIuhlVBlDRGtPaibchl gQ1+C3XiSQBof2u88rsiNA6NC6s6DNNElD12WyJYljCFr1yikw5EJ0xyYkRNHHCabtQO tA+gmPk4LHLaKmxx6uyQQZxipdP/dfqpT8w058MhJ2JRFzy9k3tbZ7xBZSK/t4cKFtCU OPjZTJr5mdc05dOCFACmRqWwo2wwxvBbdjbUaFzyP3urrjzOKylRllXNtm821Xb9jhGN 0DajC6ntep/yLyWf52iGYQnViIRaYdQ+YdNGBAEY4cx+sAVS1Qav9YkD8em2KREXt1AK pA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2mgsgth5s6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Sep 2018 22:52:51 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8HMqpw2022174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Sep 2018 22:52:51 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8HMqncw019014; Mon, 17 Sep 2018 22:52:49 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Sep 2018 15:52:48 -0700 From: Boris Ostrovsky To: peterhuewe@gmx.de, jarkko.sakkinen@linux.intel.com, jgg@ziepe.ca Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, jgross@suse.com, dunlapg@umich.edu, "Dr. Greg Wettstein" , "Dr . Greg Wettstein" , Boris Ostrovsky , stable@vger.kernel.org Subject: [PATCH v3] tpm: Restore functionality to xen vtpm driver. Date: Mon, 17 Sep 2018 18:53:33 -0400 Message-Id: <20180917225333.10426-1-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9019 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809170226 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Dr. Greg Wettstein" Functionality of the xen-tpmfront driver was lost secondary to the introduction of xenbus multi-page support in commit ccc9d90a9a8b ("xenbus_client: Extend interface to support multi-page ring"). In this commit pointer to location of where the shared page address is stored 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. Fixes: ccc9d90a9a8b ("xenbus_client: Extend interface to support multi-page ring") Signed-off-by: Dr. Greg Wettstein [boris: Updated commit message, added Fixes tag] Signed-off-by: Boris Ostrovsky Cc: stable@vger.kernel.org # v4.1+ --- 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 911475d36800..b150f87f38f5 100644 --- a/drivers/char/tpm/xen-tpmfront.c +++ b/drivers/char/tpm/xen-tpmfront.c @@ -264,7 +264,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; -- 2.17.1