Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808094/?format=api
{ "id": 808094, "url": "http://patchwork.ozlabs.org/api/patches/808094/?format=api", "web_url": "http://patchwork.ozlabs.org/project/skiboot/patch/1504164285-15095-6-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": "<1504164285-15095-6-git-send-email-cclaudio@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2017-08-31T07:24:36", "name": "[v2,05/14] libstb: rename rom_driver_ops struct to container_verification_code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4b38c17216b310541a49d10108d46af6ffea595d", "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/1504164285-15095-6-git-send-email-cclaudio@linux.vnet.ibm.com/mbox/", "series": [ { "id": 760, "url": "http://patchwork.ozlabs.org/api/series/760/?format=api", "web_url": "http://patchwork.ozlabs.org/project/skiboot/list/?series=760", "date": "2017-08-31T07:24:31", "name": "libstb: simplify the initialization of cvc drivers", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/760/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808094/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808094/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 3xjYpb4SFPz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 17:26:47 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjYpb3WQgzDqZf\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 17:26:47 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\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 3xjYmq3S1szDqXt\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 17:25:15 +1000 (AEST)", "from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7V7OfI1076988\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 03:25:14 -0400", "from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cp98rt191-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 03:25:13 -0400", "from localhost\n\tby e11.ny.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 03:25:12 -0400", "from b01cxnp23032.gho.pok.ibm.com (9.57.198.27)\n\tby e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 31 Aug 2017 03:25:10 -0400", "from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com\n\t[9.57.199.109])\n\tby b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v7V7PAwh25231364\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 07:25:10 GMT", "from localhost (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with SMTP id 06FDF11205E\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 03:24:56 -0400 (EDT)", "from legolas.ibm.com (unknown [9.85.193.48])\n\tby b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id EF0F2112047;\n\tThu, 31 Aug 2017 03:24:46 -0400 (EDT)" ], "X-IMSS-HAND-OFF-DIRECTIVE": "127.0.0.1:10026", "From": "Claudio Carvalho <cclaudio@linux.vnet.ibm.com>", "To": "skiboot@lists.ozlabs.org", "Date": "Thu, 31 Aug 2017 04:24:36 -0300", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1504164285-15095-1-git-send-email-cclaudio@linux.vnet.ibm.com>", "References": "<1504164285-15095-1-git-send-email-cclaudio@linux.vnet.ibm.com>", "X-TM-AS-GCONF": "00", "x-cbid": "17083107-2213-0000-0000-000002123A04", "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.00910098; UDB=6.00456511;\n\tIPR=6.00690378; \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:25:11", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17083107-2214-0000-0000-000057644C6D", "Message-Id": "<1504164285-15095-6-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-1708310114", "Subject": "[Skiboot] [PATCH v2 05/14] libstb: rename rom_driver_ops struct to\n\tcontainer_verification_code", "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 just gives a better name to the rom_driver_ops structure.\n\nSigned-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>\n---\n libstb/drivers/romcode.c | 4 ++--\n libstb/drivers/sw_driver.c | 4 ++--\n libstb/rom.c | 22 +++++++++++-----------\n libstb/rom.h | 6 +++---\n libstb/stb.c | 22 ++++++++++------------\n 5 files changed, 28 insertions(+), 30 deletions(-)", "diff": "diff --git a/libstb/drivers/romcode.c b/libstb/drivers/romcode.c\nindex 94bd42c..68f1230 100644\n--- a/libstb/drivers/romcode.c\n+++ b/libstb/drivers/romcode.c\n@@ -81,7 +81,7 @@ static void romcode_cleanup(void) {\n \thw_key_hash = NULL;\n }\n \n-static struct rom_driver_ops romcode_driver = {\n+static struct container_verification_code c1vc = {\n \t.name = DRIVER_NAME,\n \t.verify = romcode_verify,\n \t.sha512 = romcode_sha512,\n@@ -134,5 +134,5 @@ void romcode_probe(const struct dt_node *node)\n \t * the ROM code or set the memory region as executable.\n * skiboot accesses the physical memory directly. Real mode.\n \t */\n-\trom_set_driver(&romcode_driver);\n+\trom_set_driver(&c1vc);\n }\ndiff --git a/libstb/drivers/sw_driver.c b/libstb/drivers/sw_driver.c\nindex e7f3740..55224a2 100644\n--- a/libstb/drivers/sw_driver.c\n+++ b/libstb/drivers/sw_driver.c\n@@ -44,7 +44,7 @@ static void stb_software_cleanup(void)\n \treturn;\n }\n \n-static struct rom_driver_ops sw_driver = {\n+static struct container_verification_code c1vc = {\n \t.name = \"software\",\n \t.verify = stb_software_verify,\n \t.sha512 = stb_software_sha512,\n@@ -72,5 +72,5 @@ void stb_software_probe(const struct dt_node *node)\n \t}\n \thw_key_hash = (sha2_hash_t*) dt_prop_get(node, \"hw-key-hash\");\n \n-\trom_set_driver(&sw_driver);\n+\trom_set_driver(&c1vc);\n }\ndiff --git a/libstb/rom.c b/libstb/rom.c\nindex 5f9abd2..27b65c9 100644\n--- a/libstb/rom.c\n+++ b/libstb/rom.c\n@@ -19,37 +19,37 @@\n #include \"drivers/romcode.h\"\n #include \"drivers/sw_driver.h\"\n \n-static struct rom_driver_ops *rom_driver = NULL;\n+static struct container_verification_code *c1vc = NULL;\n \n-struct rom_driver_ops* rom_init(const struct dt_node *node __unused)\n+struct container_verification_code* rom_init(const struct dt_node *node __unused)\n {\n-\tif (rom_driver)\n+\tif (c1vc)\n \t\tgoto end;\n \n \t/* ROM drivers supported */\n \tromcode_probe(node);\n \n-\tif (!rom_driver)\n+\tif (!c1vc)\n \t\tstb_software_probe(node);\n \n-\tif (!rom_driver)\n+\tif (!c1vc)\n \t\tprlog(PR_NOTICE, \"ROM: no rom driver found\\n\");\n end:\n-\treturn rom_driver;\n+\treturn c1vc;\n }\n \n-void rom_set_driver(struct rom_driver_ops *driver)\n+void rom_set_driver(struct container_verification_code *driver)\n {\n-\tif (rom_driver) {\n+\tif (c1vc) {\n \t\t/**\n \t\t * @fwts-label ROMAlreadyRegistered\n \t\t * @fwts-advice ibm,secureboot already registered. Check if\n \t\t * rom_init called twice or the same driver is probed twice\n \t\t */\n \t\tprlog(PR_WARNING, \"ROM: %s driver already registered\\n\",\n-\t\t driver->name);\n+\t\t c1vc->name);\n \t\treturn;\n \t}\n-\trom_driver = driver;\n-\tprlog(PR_NOTICE, \"ROM: %s driver registered\\n\", driver->name);\n+\tc1vc = driver;\n+\tprlog(PR_NOTICE, \"ROM: %s driver registered\\n\", c1vc->name);\n }\ndiff --git a/libstb/rom.h b/libstb/rom.h\nindex e1a7497..972a19b 100644\n--- a/libstb/rom.h\n+++ b/libstb/rom.h\n@@ -22,7 +22,7 @@\n #include <stdlib.h>\n #include \"container.h\"\n \n-struct rom_driver_ops {\n+struct container_verification_code {\n \tconst char* name;\n \tint (*verify)(void *container);\n \tvoid (*sha512)(const uint8_t *data, size_t len, uint8_t *digest);\n@@ -33,11 +33,11 @@ struct rom_driver_ops {\n * Load a compatible driver to access the functions of the\n * verification code flashed in the secure ROM\n */\n-extern struct rom_driver_ops* rom_init(const struct dt_node *node);\n+extern struct container_verification_code* rom_init(const struct dt_node *node);\n \n /*\n * Set the rom driver that will be used\n */\n-extern void rom_set_driver(struct rom_driver_ops *driver);\n+extern void rom_set_driver(struct container_verification_code *driver);\n \n #endif /* __ROM_H */\ndiff --git a/libstb/stb.c b/libstb/stb.c\nindex ed34c6a..eb77038 100644\n--- a/libstb/stb.c\n+++ b/libstb/stb.c\n@@ -32,7 +32,7 @@\n static bool secure_mode = false;\n static bool trusted_mode = false;\n \n-static struct rom_driver_ops *rom_driver = NULL;\n+static struct container_verification_code *c1vc = NULL;\n \n /*\n * This maps a PCR for each resource we can measure. The PCR number is\n@@ -124,8 +124,8 @@ void stb_init(void)\n \n \tif (!secure_mode && !trusted_mode)\n \t\treturn;\n-\trom_driver = rom_init(ibm_secureboot);\n-\tif (secure_mode && !rom_driver) {\n+\tc1vc = rom_init(ibm_secureboot);\n+\tif (secure_mode && !c1vc) {\n \t\tprlog(PR_EMERG, \"STB: compatible romcode driver not found\\n\");\n \t\tsb_enforce();\n \t}\n@@ -167,9 +167,8 @@ int stb_final(void)\n \t\t}\n \t\ttpm_add_status_property();\n \t}\n-\tif (rom_driver) {\n-\t\trom_driver->cleanup();\n-\t\trom_driver = NULL;\n+\tif (c1vc) {\n+\t\tc1vc = NULL;\n \t}\n \ttpm_cleanup();\n \tsecure_mode = false;\n@@ -235,9 +234,8 @@ int tb_measure(enum resource_id id, void *buf, size_t len)\n \t\t\tabort();\n \t\t}\n \n-\t\trom_driver->sha512(\n-\t\t\t (void*)((uint8_t*)buf + SECURE_BOOT_HEADERS_SIZE),\n-\t\t\t len - SECURE_BOOT_HEADERS_SIZE, digest);\n+\t\tc1vc->sha512((void*) buf + SECURE_BOOT_HEADERS_SIZE,\n+\t\t\t\t len - SECURE_BOOT_HEADERS_SIZE, digest);\n \n \t\tprlog(PR_INFO, \"STB: %s sha512 hash re-calculated\\n\", name);\n \t\tif (memcmp(digestp, digest, TPM_ALG_SHA256_SIZE) != 0) {\n@@ -251,7 +249,7 @@ int tb_measure(enum resource_id id, void *buf, size_t len)\n \t\t\t\tabort();\n \t\t}\n \t} else {\n-\t\trom_driver->sha512(buf, len, digest);\n+\t\tc1vc->sha512(buf, len, digest);\n \t\tprlog(PR_INFO, \"STB: %s sha512 hash calculated\\n\", name);\n \t}\n \n@@ -287,7 +285,7 @@ int sb_verify(enum resource_id id, void *buf, size_t len)\n \t\t \"resource_id=%d unknown\\n\", id);\n \t\tsb_enforce();\n \t}\n-\tif (!rom_driver || !rom_driver->verify) {\n+\tif (!c1vc || !c1vc->verify) {\n \t\tprlog(PR_EMERG, \"STB: secure boot not initialized\\n\");\n \t\tsb_enforce();\n \t}\n@@ -296,7 +294,7 @@ int sb_verify(enum resource_id id, void *buf, size_t len)\n \t\t __func__, id, buf, len);\n \t\tsb_enforce();\n \t}\n-\tif (rom_driver->verify(buf)) {\n+\tif (c1vc->verify(buf)) {\n \t\tprlog(PR_EMERG, \"STB: %s failed: resource %s, \"\n \t\t \"eyecatcher 0x%016llx\\n\", __func__, name,\n \t\t *((uint64_t*)buf));\n", "prefixes": [ "v2", "05/14" ] }