#
e92b63ea |
| 20-Nov-2018 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid
Make sure that the new locality passed to tpm_tis_prep_abort() is valid.
Add a comment to aborting_locty that it may be any local
tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid
Make sure that the new locality passed to tpm_tis_prep_abort() is valid.
Add a comment to aborting_locty that it may be any locality, including TPM_TIS_NO_LOCALITY.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
0f5faee3 |
| 20-Nov-2018 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: Remove unused locty parameter from tpm_tis_abort()
Remove the unused locty parameter from tpm_tis_abort() function.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Philippe M
tpm: Remove unused locty parameter from tpm_tis_abort()
Remove the unused locty parameter from tpm_tis_abort() function.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
show more ...
|
#
6a50bb98 |
| 06-Nov-2018 |
Prasad J Pandit <pjp@fedoraproject.org> |
tpm: use loop iterator to set sts data field
When TIS request is done, set 'sts' data field across all localities.
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by: Stefan Berger
tpm: use loop iterator to set sts data field
When TIS request is done, set 'sts' data field across all localities.
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
show more ...
|
#
9ec08c48 |
| 11-Oct-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: extend TPM TIS with state migration support
Extend the TPM TIS interface with state migration support.
We need to synchronize with the backend thread to make sure that a command being processe
tpm: extend TPM TIS with state migration support
Extend the TPM TIS interface with state migration support.
We need to synchronize with the backend thread to make sure that a command being processed by the external TPM emulator has completed and its response been received.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
fcbed221 |
| 03-Mar-2018 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: convert tpm_tis.c to use trace-events
Leave the DEBUG_TIS for more debugging and convert to use if (DEBUG_TIS) rather than #if DEBUG_TIS where it is being used.
Signed-off-by: Stefan Berger <s
tpm: convert tpm_tis.c to use trace-events
Leave the DEBUG_TIS for more debugging and convert to use if (DEBUG_TIS) rather than #if DEBUG_TIS where it is being used.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
adb0e917 |
| 15-Feb-2018 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tests: add test for TPM TIS device
Move the TPM TIS related register and flag #defines into include/hw/acpi/tpm.h for access by the test case.
Write a test case that covers the TIS functionality.
tests: add test for TPM TIS device
Move the TPM TIS related register and flag #defines into include/hw/acpi/tpm.h for access by the test case.
Write a test case that covers the TIS functionality.
Add the tests cases to the MAINTAINERS file.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
3bd9e161 |
| 02-Feb-2018 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: tis: move one-line function into caller
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
#
6a8a2354 |
| 29-Jan-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm: report backend request error
Use an Error** for request to let the caller handle error reporting.
This will also allow to inform the frontend of a backend error.
Signed-off-by: Marc-André Lur
tpm: report backend request error
Use an Error** for request to let the caller handle error reporting.
This will also allow to inform the frontend of a backend error.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|
#
2562755e |
| 01-Dec-2017 |
Eric Blake <eblake@redhat.com> |
maint: Fix macros with broken 'do/while(0); ' usage
The point of writing a macro embedded in a 'do { ... } while (0)' loop (particularly if the macro has multiple statements or would otherwise end w
maint: Fix macros with broken 'do/while(0); ' usage
The point of writing a macro embedded in a 'do { ... } while (0)' loop (particularly if the macro has multiple statements or would otherwise end with an 'if' statement) is so that the macro can be used as a drop-in statement with the caller supplying the trailing ';'. Although our coding style frowns on brace-less 'if': if (cond) statement; else something else; that is the classic case where failure to use do/while(0) wrapping would cause the 'else' to pair with any embedded 'if' in the macro rather than the intended outer 'if'. But conversely, if the macro includes an embedded ';', then the same brace-less coding style would now have two statements, making the 'else' a syntax error rather than pairing with the outer 'if'. Thus, even though our coding style with required braces is not impacted, ending a macro with ';' makes our code harder to port to projects that use brace-less styles.
The change should have no semantic impact. I was not able to fully compile-test all of the changes (as some of them are examples of the ugly bit-rotting debug print statements that are completely elided by default, and I didn't want to recompile with the necessary -D witnesses - cleaning those up is left as a bite-sized task for another day); I did, however, audit that for all files touched, all callers of the changed macros DID supply a trailing ';' at the callsite, and did not appear to be used as part of a brace-less conditional.
Found mechanically via: $ git grep -B1 'while (0);' | grep -A1 \\\\
Signed-off-by: Eric Blake <eblake@redhat.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20171201232433.25193-7-eblake@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
b86da7dd |
| 11-Oct-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: Implement tpm_sized_buffer_reset
Move the definition of TPMSizedBuffer out of tpm_tis.c into tpm_util.h and implement tpm_sized_buffer_reset() for the following patches to use.
Signed-off-by:
tpm: Implement tpm_sized_buffer_reset
Move the definition of TPMSizedBuffer out of tpm_tis.c into tpm_util.h and implement tpm_sized_buffer_reset() for the following patches to use.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
f999d81b |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: merge r/w_offset into rw_offset
We can now merge the r_offset and w_offset into a single rw_offset. This is possible since when the offset is used for writing in RECEPTION state then reads
tpm_tis: merge r/w_offset into rw_offset
We can now merge the r_offset and w_offset into a single rw_offset. This is possible since when the offset is used for writing in RECEPTION state then reads are ignore. Conversely, when the offset is used for reading when in COMPLETION state, then writes are ignored.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
e6b30c71 |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: move r/w_offsets to TPMState
Now that we have a single buffer, we also only need a single set of read/write offsets into that buffer. This works since only one locality can be active.
Sign
tpm_tis: move r/w_offsets to TPMState
Now that we have a single buffer, we also only need a single set of read/write offsets into that buffer. This works since only one locality can be active.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
c5496b97 |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: merge read and write buffer into single buffer
Since we can only be in read or write mode, we can merge the buffers into a single buffer.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.i
tpm_tis: merge read and write buffer into single buffer
Since we can only be in read or write mode, we can merge the buffers into a single buffer.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
08040842 |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: move buffers from localities into common location
One read buffer and one write buffer is sufficient for all localities. The localities cannot all be active at the same time, and only the a
tpm_tis: move buffers from localities into common location
One read buffer and one write buffer is sufficient for all localities. The localities cannot all be active at the same time, and only the active locality can use the r/w buffers. Inactive localities will require the COMMAND_READY flag to be set on the STS register to move to the READY state, which then enables access to using the buffer for writing of a command, while all other localities are inactive.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
e6b703f6 |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: remove TPMSizeBuffer usage
Remove usage of TPMSizeBuffer. The size of the buffers is limited now by s->be_buffer_size, which is the size of the buffer the TIS has negotiated with the backen
tpm_tis: remove TPMSizeBuffer usage
Remove usage of TPMSizeBuffer. The size of the buffers is limited now by s->be_buffer_size, which is the size of the buffer the TIS has negotiated with the backend.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
1af3d63e |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: limit size of buffer from backend
This is a preparatory patch for the subsequent ones where we get rid of the flexibility of supporting any kind of buffer size that the backend may support.
tpm_tis: limit size of buffer from backend
This is a preparatory patch for the subsequent ones where we get rid of the flexibility of supporting any kind of buffer size that the backend may support. We keep the size at 4096, which is also the size the external emulator supports. So, limit the size of the buffer we can support and pass it back to the backend.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
8a2306c7 |
| 10-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm_tis: convert uint32_t to size_t
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
#
9375c44f |
| 04-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: tpm_emulator: get and set buffer size of device
Convert the tpm_emulator backend to get the current buffer size of the external device and set it to the buffer size that the frontend (TIS) requ
tpm: tpm_emulator: get and set buffer size of device
Convert the tpm_emulator backend to get the current buffer size of the external device and set it to the buffer size that the frontend (TIS) requests.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
b21e6aaf |
| 03-Nov-2017 |
Stefan Berger <stefanb@linux.vnet.ibm.com> |
tpm: Move getting TPM buffer size to backends
Rather than setting the size of the TPM buffer in the front-end, query the backend for the size of the buffer. In this patch we just move the hard-coded
tpm: Move getting TPM buffer size to backends
Rather than setting the size of the TPM buffer in the front-end, query the backend for the size of the buffer. In this patch we just move the hard-coded buffer size of 4096 to the backends.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
#
d3fd953f |
| 06-Nov-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm: remove tpm_register_model()
Query object classes that implements TPMIf instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ib
tpm: remove tpm_register_model()
Query object classes that implements TPMIf instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|
#
c0378544 |
| 06-Nov-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm-tis: use DEFINE_PROP_TPMBE
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet
tpm-tis: use DEFINE_PROP_TPMBE
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|
#
51a837e9 |
| 06-Nov-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm-tis: check that at most one TPM device exists
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger
tpm-tis: check that at most one TPM device exists
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|
#
c87b35fa |
| 06-Nov-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm-tis: remove redundant 'tpm_tis:' in error messages
The reported error message is already prefixed with the -device name & arguments.
Before: qemu-system-x86_64: -device tpm-tis,id=foo,tpmdev=fo
tpm-tis: remove redundant 'tpm_tis:' in error messages
The reported error message is already prefixed with the -device name & arguments.
Before: qemu-system-x86_64: -device tpm-tis,id=foo,tpmdev=foo,irq=21: tpm_tis: IRQ 21 is outside valid range of 0 to 15
After: qemu-system-x86_64: -device tpm-tis,id=foo,tpmdev=foo,irq=21: IRQ 21 is outside valid range of 0 to 15
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|
#
5cf954d0 |
| 06-Nov-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm: add tpm_cmd_get_size() to tpm_util
The function is generally useful and used in the following patches.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger
tpm: add tpm_cmd_get_size() to tpm_util
The function is generally useful and used in the following patches.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|
#
9af7a721 |
| 06-Nov-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
tpm: add TPM interface to lookup TPM version
Do not hardcode TPM device model to lookup version, use an interface instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by
tpm: add TPM interface to lookup TPM version
Do not hardcode TPM device model to lookup version, use an interface instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
show more ...
|