Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1204460imm; Thu, 13 Sep 2018 14:29:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaoI1ZcTjPoqYRckhRT2BUY0c3mPzSG+Y22Ipz53bXmszkTbFzfdfLLrSlr9IEQIaGs04pa X-Received: by 2002:a63:6385:: with SMTP id x127-v6mr8840085pgb.413.1536874148060; Thu, 13 Sep 2018 14:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536874148; cv=none; d=google.com; s=arc-20160816; b=ZaX12EDJ8SMUKtNxUmZQRSployfSwRgl2dxzzc4f+1juM9mjfbaOfEWf00uvw1I7Mb jlAZZ4UC6tFczxTDcJqquDaj7qkjTtO1VlgWp37Ib4dpcKFrZ3MQDYKr8zHccCAZQKRN KZ4ZUGQCe2r95mR5AtWCauHuKLZ2Qm5JbUkwnOiVC9msI3dFdrm7D/dEUpVEfgnBpJTc VQnar2JPFRbpnEpE5mP5dF7l1R40a/NPviYUpkYxb/GaFrmt6m/12A3NfwkXIzNCUpc1 5P4+LmjUCLYfdgLnPLPucwOk6wakqN36GKjtXgFCg7D153ENqN84Hur0k6JK2J0ECh7B M8tQ== 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=n/Q7pouo9UZUjCtXlRGxKqQGOvgKqLLKkPyB9BHK3/w=; b=NQQu2y64d8u6GxS4ttDvNJUGWipu/aeRfHUb8+VJVuMfTyTWgl5ptm8Fd7M40lGcBn jw8MV4PYBxS7oWnF2/lnYbBOfaVBhRBjB02a04N5AtqqShXIHYlb+5XtAum449dl6cLK Vqq87ZIQzutmrqy2lCdiHzU0ugnCW7mEg3dzUR7dk+IikWR/MS5jwMQOkH7f5k64MzCQ mLA1MZg9gpHvY14fPbVyhIum1r05aGS+bAA65vQ+CdPOb8V0Ffi+G8irApBs8ZcADa/g h0okZgcqCYFg3VAtVaKHgKKNietlMmKGNNmN1auCQb+YxkItspB0rhPjG1d2huBJyxGh mX5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=3W0NyYIb; 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 x3-v6si5030508pgb.329.2018.09.13.14.28.52; Thu, 13 Sep 2018 14:29:08 -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=3W0NyYIb; 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 S1728196AbeINCgv (ORCPT + 99 others); Thu, 13 Sep 2018 22:36:51 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:46770 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbeINCgv (ORCPT ); Thu, 13 Sep 2018 22:36:51 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8DLJ1Yf094749; Thu, 13 Sep 2018 21:25:17 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=n/Q7pouo9UZUjCtXlRGxKqQGOvgKqLLKkPyB9BHK3/w=; b=3W0NyYIbLXeSs9DWRapNCs44r0uBk28HPRQ6QKxk+f5HOaHXOnDURbm+lCCFtA+6fErK lyMmXxjFnACkUxx3M/wChdflAIJK3toCLjFWVoRaxxW2UHLxtr02WgXIfdRQSaYhli0x JcngIx+CPOSkaN7AxyauOyF2/UTnLdrAk6wc1UIA21TJ2lbMI+UU0upVcKos6lS23enx tFumdO1zlcWxJ3sb3lJIqKWhjxVeEZpjsGH8ADMmivqSipp+YOw9ivYJTGU4R5QgWsgJ ogPDo+B9BaIaT2G+NUn+dz91guQ6aZHYRlfrJXGkeGUvOTq/0as6MetW+wiMJN+ONRyr Hg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2mc6cq3tsn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 21:25:17 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8DLPH3d023247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 21:25:17 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8DLPGmb001472; Thu, 13 Sep 2018 21:25:16 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 ; Thu, 13 Sep 2018 14:25:15 -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 v2] tpm: Restore functionality to xen vtpm driver. Date: Thu, 13 Sep 2018 17:25:51 -0400 Message-Id: <20180913212551.2435-1-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9015 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-1809130211 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 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. Fixes: ccc9d90a9a8b ("xenbus_client: Extend interface to support multi-page ring") Signed-off-by: Dr. Greg Wettstein [boris: fixed commit message formatting, 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