From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akdPz-00083j-Ho for qemu-devel@nongnu.org; Mon, 28 Mar 2016 16:05:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akdPw-0003A3-7r for qemu-devel@nongnu.org; Mon, 28 Mar 2016 16:05:43 -0400 Received: from e18.ny.us.ibm.com ([129.33.205.208]:33828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akdPw-000399-2G for qemu-devel@nongnu.org; Mon, 28 Mar 2016 16:05:40 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Mar 2016 16:05:38 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 9B0BFC90041 for ; Mon, 28 Mar 2016 16:05:32 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2SK5asV32768166 for ; Mon, 28 Mar 2016 20:05:36 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2SK5aJg024206 for ; Mon, 28 Mar 2016 16:05:36 -0400 References: <1458571168-2583-1-git-send-email-stefanb@us.ibm.com> From: Stefan Berger Message-ID: <56F98E8E.3010103@linux.vnet.ibm.com> Date: Mon, 28 Mar 2016 16:05:34 -0400 MIME-Version: 1.0 In-Reply-To: <1458571168-2583-1-git-send-email-stefanb@us.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [REPOST v2] [PATCH] tpm: adapt sysfs cancel path for new TPM driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Berger , mst@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: crobinso@redhat.com Peter, Michael, I have 3 TPM related patches on the mailing list that are fixing buges. They are either being overlooked or ignored. How can we make progress with them? Regards, Stefan On 03/21/2016 10:39 AM, Stefan Berger wrote: > This patch addresses BZ 1281413. > > Adapt the sysfs TPM command cancel path for the TPM driver that > does not use a miscdevice anymore since Linux 4.0. Support old > and new paths. > > Signed-off-by: Stefan Berger > --- > hw/tpm/tpm_passthrough.c | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > > diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c > index e98efb7..e1edb38 100644 > --- a/hw/tpm/tpm_passthrough.c > +++ b/hw/tpm/tpm_passthrough.c > @@ -377,6 +377,8 @@ static int tpm_passthrough_open_sysfs_cancel(TPMBackend *tb) > int fd = -1; > char *dev; > char path[PATH_MAX]; > + const char *prefix[] = {"misc/", "tpm/"}; > + int i; > > if (tb->cancel_path) { > fd = qemu_open(tb->cancel_path, O_WRONLY); > @@ -390,16 +392,21 @@ static int tpm_passthrough_open_sysfs_cancel(TPMBackend *tb) > dev = strrchr(tpm_pt->tpm_dev, '/'); > if (dev) { > dev++; > - if (snprintf(path, sizeof(path), "/sys/class/misc/%s/device/cancel", > - dev) < sizeof(path)) { > - fd = qemu_open(path, O_WRONLY); > - if (fd >= 0) { > - tb->cancel_path = g_strdup(path); > - } else { > - error_report("tpm_passthrough: Could not open TPM cancel " > - "path %s : %s", path, strerror(errno)); > + for (i = 0; i < ARRAY_SIZE(prefix); i++) { > + if (snprintf(path, sizeof(path), > + "/sys/class/%s%s/device/cancel", > + prefix[i], dev) < sizeof(path)) { > + fd = qemu_open(path, O_WRONLY); > + if (fd >= 0) { > + tb->cancel_path = g_strdup(path); > + break; > + } > } > } > + if (fd < 0) { > + error_report("tpm_passthrough: Could not open TPM cancel " > + "path %s : %s", path, strerror(errno)); > + } > } else { > error_report("tpm_passthrough: Bad TPM device path %s", > tpm_pt->tpm_dev);