All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Stefan Berger <stefanb@us.ibm.com>,
	mst@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: crobinso@redhat.com
Subject: Re: [Qemu-devel] [REPOST v2] [PATCH] tpm: adapt sysfs cancel path for new TPM driver
Date: Mon, 28 Mar 2016 16:05:34 -0400	[thread overview]
Message-ID: <56F98E8E.3010103@linux.vnet.ibm.com> (raw)
In-Reply-To: <1458571168-2583-1-git-send-email-stefanb@us.ibm.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 <stefanb@linux.vnet.ibm.com>
> ---
>   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);

      reply	other threads:[~2016-03-28 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 14:39 [Qemu-devel] [REPOST v2] [PATCH] tpm: adapt sysfs cancel path for new TPM driver Stefan Berger
2016-03-28 20:05 ` Stefan Berger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F98E8E.3010103@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=crobinso@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.