Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808107/?format=api
{ "id": 808107, "url": "http://patchwork.ozlabs.org/api/patches/808107/?format=api", "web_url": "http://patchwork.ozlabs.org/project/skiboot/patch/1504165372-15971-3-git-send-email-cclaudio@linux.vnet.ibm.com/", "project": { "id": 44, "url": "http://patchwork.ozlabs.org/api/projects/44/?format=api", "name": "skiboot firmware development", "link_name": "skiboot", "list_id": "skiboot.lists.ozlabs.org", "list_email": "skiboot@lists.ozlabs.org", "web_url": "http://github.com/open-power/skiboot", "scm_url": "http://github.com/open-power/skiboot", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1504165372-15971-3-git-send-email-cclaudio@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2017-08-31T07:42:49", "name": "[2/5] hdata/tpmrel.c: add eventlog info to tpm devices", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "7b0f0b330ca30cc1c58dc23f778066bc4e23a29c", "submitter": { "id": 69305, "url": "http://patchwork.ozlabs.org/api/people/69305/?format=api", "name": "Claudio Carvalho", "email": "cclaudio@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/skiboot/patch/1504165372-15971-3-git-send-email-cclaudio@linux.vnet.ibm.com/mbox/", "series": [ { "id": 762, "url": "http://patchwork.ozlabs.org/api/series/762/?format=api", "web_url": "http://patchwork.ozlabs.org/project/skiboot/list/?series=762", "date": "2017-08-31T07:42:47", "name": "hdata: add and parse the tpmrel structure", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/762/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808107/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808107/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "skiboot@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "skiboot@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjZB30Vcmz9sRq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 17:43:39 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjZB26jkTzDqYb\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 17:43:38 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjZ9T1HxDzDqGX\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 17:43:08 +1000 (AEST)", "from pps.filterd (m0098419.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7V7csh2096490\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 03:43:06 -0400", "from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cpa77ygqm-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 03:43:06 -0400", "from localhost\n\tby e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <cclaudio@linux.vnet.ibm.com>;\n\tThu, 31 Aug 2017 01:43:05 -0600", "from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15)\n\tby e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 31 Aug 2017 01:43:04 -0600", "from b03ledav005.gho.boulder.ibm.com\n\t(b03ledav005.gho.boulder.ibm.com [9.17.130.236])\n\tby b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7V7h3mb4194658\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 00:43:03 -0700", "from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id D4C7ABE039\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 01:43:03 -0600 (MDT)", "from legolas.ibm.com (unknown [9.85.193.48])\n\tby b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 3E847BE038\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 01:43:03 -0600 (MDT)" ], "From": "Claudio Carvalho <cclaudio@linux.vnet.ibm.com>", "To": "skiboot@lists.ozlabs.org", "Date": "Thu, 31 Aug 2017 04:42:49 -0300", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1504165372-15971-1-git-send-email-cclaudio@linux.vnet.ibm.com>", "References": "<1504165372-15971-1-git-send-email-cclaudio@linux.vnet.ibm.com>", "X-TM-AS-GCONF": "00", "x-cbid": "17083107-0004-0000-0000-000012DA09F0", "X-IBM-SpamModules-Scores": "", "X-IBM-SpamModules-Versions": "BY=3.00007640; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00910104; UDB=6.00456514;\n\tIPR=6.00690384; \n\tBA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938;\n\tXFM=3.00000015; UTC=2017-08-31 07:43:05", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17083107-0005-0000-0000-000080EDDCE6", "Message-Id": "<1504165372-15971-3-git-send-email-cclaudio@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-31_02:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708310118", "Subject": "[Skiboot] [PATCH 2/5] hdata/tpmrel.c: add eventlog info to tpm\n\tdevices", "X-BeenThere": "skiboot@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "Mailing list for skiboot development <skiboot.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/skiboot/>", "List-Post": "<mailto:skiboot@lists.ozlabs.org>", "List-Help": "<mailto:skiboot-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org", "Sender": "\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>" }, "content": "This parses the TPMREL secureboot_tpm_info structure in order to add the\nevent log info to i2c tpm devices.\n\nThere can be multiple secureboot_tpm_info entries with each entry\ncorresponding to a master processor that has a tpm device.\n\nSigned-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>\n---\n hdata/spira.h | 28 ++++++++++++++++++++++++++++\n hdata/tpmrel.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-\n 2 files changed, 81 insertions(+), 1 deletion(-)", "diff": "diff --git a/hdata/spira.h b/hdata/spira.h\nindex d2a70c1..78ff33d 100644\n--- a/hdata/spira.h\n+++ b/hdata/spira.h\n@@ -1098,6 +1098,34 @@ struct ipmi_sensors {\n */\n #define STB_HDIF_SIG\t\"TPMREL\"\n \n+/*\n+ * Idata index 0 : Secure Boot and TPM Instance Info\n+ *\n+ * There can be multiple entries with each entry corresponding to\n+ * a master processor that has a TPM device\n+ */\n+#define TPMREL_IDATA_SECUREBOOT_TPM_INFO\t0\n+\n+struct secureboot_tpm_info {\n+\t__be32 chip_id;\n+\t__be32 dbob_id;\n+\tuint8_t locality1;\n+\tuint8_t locality2;\n+\tuint8_t locality3;\n+\tuint8_t locality4;\n+#define TPM_PRESENT_AND_FUNCTIONAL\t0x01\n+#define TPM_PRESENT_AND_NOT_FUNCTIONAL\t0x02\n+#define TPM_NOT_PRESENT\t\t\t0x03\n+\tuint8_t tpm_status;\n+\tuint8_t reserved[3];\n+\t/* zero indicates no tpm log data */\n+\t__be32 srtm_log_offset;\n+\t__be32 srtm_log_size;\n+\t/* zero indicates no tpm log data */\n+\t__be32 drtm_log_offset;\n+\t__be32 drtm_log_size;\n+} __packed;\n+\n static inline const char *cpu_state(u32 flags)\n {\n \tswitch ((flags & CPU_ID_VERIFY_MASK) >> CPU_ID_VERIFY_SHIFT) {\ndiff --git a/hdata/tpmrel.c b/hdata/tpmrel.c\nindex 7ded404..f2e2ec8 100644\n--- a/hdata/tpmrel.c\n+++ b/hdata/tpmrel.c\n@@ -19,11 +19,62 @@\n #endif\n \n #include <skiboot.h>\n+#include <device.h>\n \n #include \"spira.h\"\n #include \"hdata.h\"\n #include \"hdif.h\"\n \n+#define TPM_SRTM_EVENTLOG_MAX_SIZE 0x10000\n+\n+static void add_tpmrel_tpm_eventlog(const struct HDIF_common_hdr *hdif_hdr)\n+{\n+\tconst struct secureboot_tpm_info *stinfo;\n+\tstruct dt_node *xscom, *node;\n+\tuint64_t addr;\n+\tbool tpmfound = false;\n+\tint count, i;\n+\n+\tcount = HDIF_get_iarray_size(hdif_hdr, TPMREL_IDATA_SECUREBOOT_TPM_INFO);\n+\tif (count > 1) {\n+\t\tprerror(\"multinode not supported, count=%d\\n\",\n+\t\t\tcount);\n+\t\treturn;\n+\t}\n+\n+\tfor (i = 0; i < count; i++) {\n+\n+\t\tstinfo = HDIF_get_iarray_item(hdif_hdr,\n+\t\t\t\t\t TPMREL_IDATA_SECUREBOOT_TPM_INFO,\n+\t\t\t\t\t i, NULL);\n+\n+\t\txscom = find_xscom_for_chip(be32_to_cpu(stinfo->chip_id));\n+\t\tif (xscom) {\n+\t\t\tdt_for_each_node(xscom, node) {\n+\t\t\t\tif (dt_has_node_property(node, \"label\", \"tpm\")) {\n+\t\t\t\t\ttpmfound=true;\n+\t\t\t\t\taddr = (uint64_t) stinfo +\n+\t\t\t\t\t\tbe32_to_cpu(stinfo->srtm_log_offset);\n+\t\t\t\t\tdt_add_property_u64s(node, \"linux,sml-base\", addr);\n+\t\t\t\t\tdt_add_property_cells(node, \"linux,sml-size\",\n+\t\t\t\t\t\t\t TPM_SRTM_EVENTLOG_MAX_SIZE);\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (!tpmfound &&\n+\t\t\t stinfo->tpm_status == TPM_PRESENT_AND_FUNCTIONAL) {\n+\t\t\t\tprerror(\"TPM functional but not found for chip_id=%d.\\n\",\n+\t\t\t\t\tstinfo->chip_id);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t} else {\n+\t\t\tprerror(\"could not add TPM device, chip_id=%d invalid\\n\",\n+\t\t\t\tstinfo->chip_id);\n+\t\t\tcontinue;\n+\t\t}\n+\t}\n+}\n+\n void node_stb_parse(void)\n {\n \tstruct HDIF_common_hdr *hdif_hdr;\n@@ -34,7 +85,8 @@ void node_stb_parse(void)\n \t\treturn;\n \t}\n \n-\t/* TODO: Idata 0: Secure Boot and TPM Instance Info */\n+\tadd_tpmrel_tpm_eventlog(hdif_hdr);\n+\n \t/* TODO: Idata 1: User Physical Interaction Mechanism Info */\n \t/* TODO: Idata 2: Hash and Verification Function Offset Array */\n }\n", "prefixes": [ "2/5" ] }