Re: [Qemu-devel] [PATCH v2 25/28] tpm-emulator: protect concurrent ctrl_chr access

2017-11-07 Thread Marc-André Lureau
Hi On Tue, Nov 7, 2017 at 2:11 AM, Stefan Berger wrote: > On 11/06/2017 05:11 PM, Marc-André Lureau wrote: >> >> Hi >> >> - Original Message - >>> >>> On 11/06/2017 01:39 PM, Marc-André Lureau wrote: The control chardev is being used from the data thread to set the locality

Re: [Qemu-devel] [PATCH v2 25/28] tpm-emulator: protect concurrent ctrl_chr access

2017-11-06 Thread Stefan Berger
On 11/06/2017 05:11 PM, Marc-André Lureau wrote: Hi - Original Message - On 11/06/2017 01:39 PM, Marc-André Lureau wrote: The control chardev is being used from the data thread to set the locality of the next request. Altough the chr has a write mutex, we may potentially read the reply

Re: [Qemu-devel] [PATCH v2 25/28] tpm-emulator: protect concurrent ctrl_chr access

2017-11-06 Thread Marc-André Lureau
Hi - Original Message - > On 11/06/2017 01:39 PM, Marc-André Lureau wrote: > > The control chardev is being used from the data thread to set the > > locality of the next request. Altough the chr has a write mutex, we > > may potentially read the reply from another thread request. > > Righ

Re: [Qemu-devel] [PATCH v2 25/28] tpm-emulator: protect concurrent ctrl_chr access

2017-11-06 Thread Stefan Berger
On 11/06/2017 01:39 PM, Marc-André Lureau wrote: The control chardev is being used from the data thread to set the locality of the next request. Altough the chr has a write mutex, we may potentially read the reply from another thread request. Right, so there may be concurrency with the CMD_RESE

[Qemu-devel] [PATCH v2 25/28] tpm-emulator: protect concurrent ctrl_chr access

2017-11-06 Thread Marc-André Lureau
The control chardev is being used from the data thread to set the locality of the next request. Altough the chr has a write mutex, we may potentially read the reply from another thread request. Add a mutex to protect from concurrent control commands. Signed-off-by: Marc-André Lureau --- hw/tpm/