All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Marcel Apfelbaum" <marcel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3] tpm: add CRB device
Date: Tue, 30 Jan 2018 09:35:56 +0100	[thread overview]
Message-ID: <20180130093556.7397894b@redhat.com> (raw)
In-Reply-To: <09b823ea-f0d3-1428-fceb-a54d881e9333@linux.vnet.ibm.com>

On Mon, 29 Jan 2018 11:50:04 -0500
Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:

> On 01/29/2018 11:24 AM, Igor Mammedov wrote:
> > On Fri, 26 Jan 2018 13:03:06 +0100
> > Marc-André Lureau <marcandre.lureau@redhat.com> wrote:
> >  
> >> tpm_crb is a device for TPM 2.0 Command Response Buffer (CRB)
> >> Interface as defined in TCG PC Client Platform TPM Profile (PTP)
> >> Specification Family “2.0” Level 00 Revision 01.03 v22.
> >>
> >> The PTP allows device implementation to switch between TIS and CRB
> >> model at run time, but given that CRB is a simpler device to
> >> implement, I chose to implement it as a different device.
> >>
> >> The device doesn't implement other locality than 0 for now (my laptop
> >> TPM doesn't either, so I assume this isn't so bad)
> >>
> >> Tested with some success with Linux upstream and Windows 10, seabios &
> >> modified ovmf. The device is recognized and correctly transmit
> >> command/response with passthrough & emu. However, we are missing PPI
> >> ACPI part atm.
> >>
> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >> ---
> >>
> >> The patch is based on stefanb/tpm-next git branch.
> >>  
> > [...]
> >  
> >> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> >> index dc4b2b9ffe..ed78c4ed9f 100644
> >> --- a/hw/i386/acpi-build.c
> >> +++ b/hw/i386/acpi-build.c
> >> @@ -2224,6 +2224,22 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> >>               aml_append(sb_scope, scope);
> >>           }
> >>       }
> >> +
> >> +    if (TPM_IS_CRB(tpm_find())) {
> >> +        dev = aml_device("TPM");
> >> +        aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
> >> +        crs = aml_resource_template();
> >> +        aml_append(crs, aml_memory32_fixed(TPM_CRB_ADDR_BASE,
> >> +                                           TPM_CRB_ADDR_SIZE, AML_READ_WRITE));
> >> +        aml_append(dev, aml_name_decl("_CRS", crs));
> >> +  
> > [...]  
> >> +        method = aml_method("_STA", 0, AML_NOTSERIALIZED);
> >> +        aml_append(method, aml_return(aml_int(0x0f)));
> >> +        aml_append(dev, method);  
> > this is not needed as 0x0f is assumed default value if _STA is missing  
> 
> Well, it seems to be in good neighborhood with other devices created 
> that do the same thing: build_kbd_device_aml(), 
> build_mouse_device_aml(), part of \_SB.PCI0.ISA...
I'm in process of getting rid of that, so please don't add
new ones. 

PS:
(in case there won't be respin, a fixup patch that
maintainer could squash in would do)

[...]

      reply	other threads:[~2018-01-30  8:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 12:03 [Qemu-devel] [PATCH v3] tpm: add CRB device Marc-André Lureau
2018-01-26 12:09 ` Marc-Andre Lureau
2018-01-26 13:19 ` no-reply
2018-01-28 13:38   ` Stefan Berger
2018-01-29 14:24     ` Eric Blake
2018-01-26 13:23 ` no-reply
2018-01-26 13:27 ` no-reply
2018-01-26 13:27 ` no-reply
2018-01-26 13:30 ` no-reply
2018-01-26 18:50 ` Stefan Berger
2018-01-29 16:24 ` Igor Mammedov
2018-01-29 16:50   ` Stefan Berger
2018-01-30  8:35     ` Igor Mammedov [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=20180130093556.7397894b@redhat.com \
    --to=imammedo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.vnet.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.