qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Mathieu-Daudé, Philippe" <f4bug@amsat.org>,
	"Stefan Berger" <stefanb@linux.ibm.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v16 5/6] acpi: add ACPI memory clear interface
Date: Mon, 14 Jan 2019 09:47:58 -0500	[thread overview]
Message-ID: <20190114094746-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAMxuvaxyPdZtgWPXHwzzeJqaojBzjq3tKfw-kyow5eX_jCLfNw@mail.gmail.com>

On Mon, Jan 14, 2019 at 02:23:16PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Mon, Jan 14, 2019 at 2:17 PM Igor Mammedov <imammedo@redhat.com> wrote:
> >
> > On Wed,  9 Jan 2019 23:31:14 +0400
> > Marc-André Lureau <marcandre.lureau@redhat.com> wrote:
> >
> > > The interface is described in the "TCG Platform Reset Attack
> > > Mitigation Specification", chapter 6 "ACPI _DSM Function". According
> > I'd add a spec version here as well adn maybe a link like it's
> > in 4/6 (but links are often go stale so it's not must have, just name
> > and version should be sufficient to find the spec)
> >
> > > to Laszlo, it's not so easy to implement in OVMF, he suggested to do
> > > it in qemu instead.
> > >
> > > See specification documentation for more details, and next commit for
> > > memory clear on reset handling.
> > >
> > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> > > Tested-by: Stefan Berger <stefanb@linux.ibm.com>
> > With commit amended
> >
> > Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> 
> Specification Version 1.00
> https://www.trustedcomputinggroup.org/wp-content/uploads/Platform-Reset-Attack-Mitigation-Specification.pdf
> 
> Michael, do you need me to resend the series or can you update the
> commit message?
> 
> thanks

Pls resend in a ready form.
Thanks!

> >
> > > ---
> > >  hw/acpi/tpm.c      | 55 ++++++++++++++++++++++++++++++++++++++++++++++
> > >  docs/specs/tpm.txt |  2 ++
> > >  2 files changed, 57 insertions(+)
> > >
> > > diff --git a/hw/acpi/tpm.c b/hw/acpi/tpm.c
> > > index 9f205378f2..b96459e45b 100644
> > > --- a/hw/acpi/tpm.c
> > > +++ b/hw/acpi/tpm.c
> > > @@ -53,6 +53,16 @@ void tpm_build_ppi_acpi(TPMIf *tpm, Aml *dev)
> > >      pprq = aml_name("PPRQ");
> > >      pprm = aml_name("PPRM");
> > >
> > > +    aml_append(dev,
> > > +               aml_operation_region(
> > > +                   "TPP3", AML_SYSTEM_MEMORY,
> > > +                   aml_int(TPM_PPI_ADDR_BASE +
> > > +                           0x15a /* movv, docs/specs/tpm.txt */),
> > > +                           0x1));
> > > +    field = aml_field("TPP3", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
> > > +    aml_append(field, aml_named_field("MOVV", 8));
> > > +    aml_append(dev, field);
> > > +
> > >      /*
> > >       * DerefOf in Windows is broken with SYSTEM_MEMORY.  Use a dynamic
> > >       * operation region inside of a method for getting FUNC[op].
> > > @@ -399,6 +409,51 @@ void tpm_build_ppi_acpi(TPMIf *tpm, Aml *dev)
> > >              aml_append(ifctx, aml_return(aml_buffer(1, zerobyte)));
> > >          }
> > >          aml_append(method, ifctx);
> > > +
> > > +        /*
> > > +         * "TCG Platform Reset Attack Mitigation Specification 1.00",
> > > +         * Chapter 6 "ACPI _DSM Function"
> > > +         */
> > > +        ifctx = aml_if(
> > > +            aml_equal(uuid,
> > > +                      aml_touuid("376054ED-CC13-4675-901C-4756D7F2D45D")));
> > > +        {
> > > +            /* standard DSM query function */
> > > +            ifctx2 = aml_if(aml_equal(function, zero));
> > > +            {
> > > +                uint8_t byte_list[1] = { 0x03 }; /* functions 1-2 supported */
> > > +
> > > +                aml_append(ifctx2,
> > > +                           aml_return(aml_buffer(sizeof(byte_list),
> > > +                                                 byte_list)));
> > > +            }
> > > +            aml_append(ifctx, ifctx2);
> > > +
> > > +            /*
> > > +             * TCG Platform Reset Attack Mitigation Specification 1.0 Ch.6
> > > +             *
> > > +             * Arg 2 (Integer): Function Index = 1
> > > +             * Arg 3 (Package): Arguments = Package: Type: Integer
> > > +             *                  Operation Value of the Request
> > > +             * Returns: Type: Integer
> > > +             *          0: Success
> > > +             *          1: General Failure
> > > +             */
> > > +            ifctx2 = aml_if(aml_equal(function, one));
> > > +            {
> > > +                aml_append(ifctx2,
> > > +                           aml_store(aml_derefof(aml_index(arguments, zero)),
> > > +                                     op));
> > > +                {
> > > +                    aml_append(ifctx2, aml_store(op, aml_name("MOVV")));
> > > +
> > > +                    /* 0: success */
> > > +                    aml_append(ifctx2, aml_return(zero));
> > > +                }
> > > +            }
> > > +            aml_append(ifctx, ifctx2);
> > > +        }
> > > +        aml_append(method, ifctx);
> > >      }
> > >      aml_append(dev, method);
> > >  }
> > > diff --git a/docs/specs/tpm.txt b/docs/specs/tpm.txt
> > > index 424d1511fc..5d8c26b1ad 100644
> > > --- a/docs/specs/tpm.txt
> > > +++ b/docs/specs/tpm.txt
> > > @@ -135,6 +135,8 @@ layout:
> > >   +----------+--------+--------+-------------------------------------------+
> > >   | next_step|   0x1  |  0x159 | Operation to execute after reboot by      |
> > >   |          |        |        | firmware. Used by firmware.               |
> > > + +----------+--------+--------+-------------------------------------------+
> > > + | movv     |   0x1  |  0x15a | Memory overwrite variable                 |
> > >   +----------+--------+--------+-------------------------------------------+
> > >
> > >     The following values are supported for the 'func' field. They correspond
> >

  reply	other threads:[~2019-01-14 14:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 19:31 [Qemu-devel] [PATCH v16 0/6] Add support for TPM Physical Presence interface Marc-André Lureau
2019-01-09 19:31 ` [Qemu-devel] [PATCH v16 1/6] tpm: add a "ppi" boolean property Marc-André Lureau
2019-01-09 19:31 ` [Qemu-devel] [PATCH v16 2/6] tpm: allocate/map buffer for TPM Physical Presence interface Marc-André Lureau
2019-01-09 19:31 ` [Qemu-devel] [PATCH v16 3/6] acpi: expose TPM/PPI configuration parameters to firmware via fw_cfg Marc-André Lureau
2019-01-09 19:31 ` [Qemu-devel] [PATCH v16 4/6] acpi: build TPM Physical Presence interface Marc-André Lureau
2019-01-09 19:31 ` [Qemu-devel] [PATCH v16 5/6] acpi: add ACPI memory clear interface Marc-André Lureau
2019-01-14 10:17   ` Igor Mammedov
2019-01-14 10:23     ` Marc-André Lureau
2019-01-14 14:47       ` Michael S. Tsirkin [this message]
2019-01-09 19:31 ` [Qemu-devel] [PATCH v16 6/6] tpm: clear RAM when "memory overwrite" requested Marc-André Lureau
2019-01-11 23:36 ` [Qemu-devel] [PATCH v16 0/6] Add support for TPM Physical Presence interface no-reply

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=20190114094746-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=imammedo@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).