From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:49215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtD7V-0006q2-Ib for qemu-devel@nongnu.org; Mon, 11 Feb 2019 10:03:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtD7P-0002s1-Ni for qemu-devel@nongnu.org; Mon, 11 Feb 2019 10:03:41 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:35444) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtD7N-00027S-C7 for qemu-devel@nongnu.org; Mon, 11 Feb 2019 10:03:34 -0500 From: Liam Merwick Date: Mon, 11 Feb 2019 15:03:03 +0000 Message-Id: <1549897385-10091-1-git-send-email-liam.merwick@oracle.com> Subject: [Qemu-devel] [PATCH v2 1/3] tpm_tis: fix loop that cancels any seizure by a lower locality List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stefanb@linux.ibm.com, qemu-devel@nongnu.org In tpm_tis_mmio_write() if the requesting locality is seizing access, any seizure by a lower locality is cancelled. However the loop doing the seizure had an off-by-one error and the locality immediately preceding the requesting locality was not being cleared. This is fixed by adjusting the test in the for loop to check the localities up to the requesting locality. Signed-off-by: Liam Merwick --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index fd6bb9b59a96..61a130beef35 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -624,7 +624,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr, } /* cancel any seize by a lower locality */ - for (l = 0; l < locty - 1; l++) { + for (l = 0; l < locty; l++) { s->loc[l].access &= ~TPM_TIS_ACCESS_SEIZE; } -- 1.8.3.1