Skip to contentSkip to conversation

tests: request access to locality 0 before sending command

PATCH In review Stefan Berger 2 participants 3 messages Apr 16, 2018 – Apr 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: request access to locality 0 before sending command

Recent changes to the CRB code now require that access to locality 0 be requested before the locality can be used for sending a command. This patch adds the request to access the locality.

---
 tests/tpm-util.c | 2 ++
 1 file changed, 2 insertions(+)
tests/tpm-util.c +2 -0
index 4967a4e..6910503 100644
@@ -25,6 +25,8 @@ void tpm_util_crb_transfer(QTestState *s,
     uint64_t caddr = qtest_readq(s, TPM_CRB_ADDR_BASE + A_CRB_CTRL_CMD_LADDR);
     uint64_t raddr = qtest_readq(s, TPM_CRB_ADDR_BASE + A_CRB_CTRL_RSP_ADDR);
 
+    qtest_writeb(s, TPM_CRB_ADDR_BASE + A_CRB_LOC_CTRL, 1);
+
     qtest_memwrite(s, caddr, req, req_size);
 
     uint32_t sts, start = 1;
Signature · 1 line
2.5.5
#1 lore raw

Hi

Quoted 7 lines · Stefan Berger

Recent changes to the CRB code now require that access to locality 0 be requested before the locality can be used for sending a command. This patch adds the request to access the locality.

---
 tests/tpm-util.c | 2 ++

The patch fails to apply, tpm-util is added with your upcoming "tpm:
Add test cases that use the external swtpm with CRB interface" patch, I guess it could be squashed there (I confirm it fixes the test)

tpm-crb-test.c isn't affected, because you changed it in "tests: Tests more flags of the CRB interface" already

Quoted 18 lines
 1 file changed, 2 insertions(+)
tests/tpm-util.c +2 -1
index 4967a4e..6910503 100644
@@ -25,6 +25,8 @@ void tpm_util_crb_transfer(QTestState *s,
     uint64_t caddr = qtest_readq(s, TPM_CRB_ADDR_BASE + A_CRB_CTRL_CMD_LADDR);
     uint64_t raddr = qtest_readq(s, TPM_CRB_ADDR_BASE + A_CRB_CTRL_RSP_ADDR);
 
+    qtest_writeb(s, TPM_CRB_ADDR_BASE + A_CRB_LOC_CTRL, 1);
+
     qtest_memwrite(s, caddr, req, req_size);
 
     uint32_t sts, start = 1;
--

2.5.5

Signature · 1 line
Marc-André Lureau
#2 lore raw
Quoted 11 lines · Marc-André Lureau

Hi

Quoted 7 lines · Stefan Berger

Recent changes to the CRB code now require that access to locality 0 be requested before the locality can be used for sending a command. This patch adds the request to access the locality.

---
  tests/tpm-util.c | 2 ++
Quoted 7 lines

The patch fails to apply, tpm-util is added with your upcoming "tpm:
Add test cases that use the external swtpm with CRB interface" patch, I guess it could be squashed there (I confirm it fixes the test)

tpm-crb-test.c isn't affected, because you changed it in "tests: Tests more flags of the CRB interface" already

Right, wrong branch. Everything is good on 'git tip'.