From owner-svn-src-all@freebsd.org Sat Feb 1 20:38:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09BBA22C421; Sat, 1 Feb 2020 20:38:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4895Wy6YGnz43hv; Sat, 1 Feb 2020 20:38:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0C54A97; Sat, 1 Feb 2020 20:38:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011KcM8e052049; Sat, 1 Feb 2020 20:38:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KcMtT052048; Sat, 1 Feb 2020 20:38:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002012038.011KcMtT052048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 20:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357386 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 357386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:38:23 -0000 Author: cem Date: Sat Feb 1 20:38:22 2020 New Revision: 357386 URL: https://svnweb.freebsd.org/changeset/base/357386 Log: tpm(4): Fix 'go ready' in TPM 2.0 TIS driver tpmtis_go_ready() read the value of the TPM_STS register, ORed TPM_STS_CMD_READY with it, and wrote it back. However, the TPM Profile (PTP) specification states that only one bit in the write request value may be set to 1, or else the entire write request is ignored. Fix by just writing TPM_STS_CMD_READY. Similarly, remove the call which clears the TPM_STS_CMD_READY flag in the same function. It was being ignored for the same reason. Submitted by: Darrick Lew Reviewed by: vangyzen, myself MFC after: if you care about stable, you might want to do so Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23081 Modified: head/sys/dev/tpm/tpm_tis.c Modified: head/sys/dev/tpm/tpm_tis.c ============================================================================== --- head/sys/dev/tpm/tpm_tis.c Sat Feb 1 20:37:11 2020 (r357385) +++ head/sys/dev/tpm/tpm_tis.c Sat Feb 1 20:38:22 2020 (r357386) @@ -386,12 +386,11 @@ tpmtis_go_ready(struct tpm_sc *sc) mask = TPM_STS_CMD_RDY; sc->intr_type = TPM_INT_STS_CMD_RDY; - OR4(sc, TPM_STS, TPM_STS_CMD_RDY); + WR4(sc, TPM_STS, TPM_STS_CMD_RDY); bus_barrier(sc->mem_res, TPM_STS, 4, BUS_SPACE_BARRIER_WRITE); if (!tpm_wait_for_u32(sc, TPM_STS, mask, mask, TPM_TIMEOUT_B)) return (false); - AND4(sc, TPM_STS, ~TPM_STS_CMD_RDY); return (true); }