get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.0/patches/2175287/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2175287,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2175287/?format=api",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/1.0/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"
    },
    "msgid": "<20251217172505.112398-3-ssrish@linux.ibm.com>",
    "date": "2025-12-17T17:25:01",
    "name": "[v2,2/6] powerpc/pseries: move the PLPKS config inside its own sysfs directory",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d570258d465add5b749b17b6c58be3af37efc285",
    "submitter": {
        "id": 90762,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/90762/?format=api",
        "name": "Srish Srinivasan",
        "email": "ssrish@linux.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20251217172505.112398-3-ssrish@linux.ibm.com/mbox/",
    "series": [
        {
            "id": 485734,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/485734/?format=api",
            "date": "2025-12-17T17:24:59",
            "name": "Extend \"trusted\" keys to support a new trust source named the PowerVM Key Wrapping Module (PKWM)",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/485734/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2175287/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-14846-incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=Un3VgEF0;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-14846-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=none smtp.remote-ip=148.163.158.5",
            "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com",
            "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=Un3VgEF0;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com\n (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com;\n envelope-from=ssrish@linux.ibm.com; receiver=lists.ozlabs.org)"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dWggD4mY4z1y0P\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 18 Dec 2025 04:25:44 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4dWgg33FJyz30Vn;\n\tThu, 18 Dec 2025 04:25:35 +1100 (AEDT)",
            "from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n [148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4dWgg23pBbz30VM\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 18 Dec 2025 04:25:34 +1100 (AEDT)",
            "from pps.filterd (m0353725.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id\n 5BHE6lN2012659;\n\tWed, 17 Dec 2025 17:25:22 GMT",
            "from pps.reinject (localhost [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4b0xjm5ghq-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 17 Dec 2025 17:25:22 +0000 (GMT)",
            "from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1])\n\tby pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 5BHHEYrM012447;\n\tWed, 17 Dec 2025 17:25:21 GMT",
            "from ppma23.wdc07v.mail.ibm.com\n (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4b0xjm5ghm-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 17 Dec 2025 17:25:21 +0000 (GMT)",
            "from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1])\n\tby ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 5BHH9ZqH002960;\n\tWed, 17 Dec 2025 17:25:20 GMT",
            "from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228])\n\tby ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4b1kykuf7j-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 17 Dec 2025 17:25:20 +0000",
            "from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com\n [10.20.54.100])\n\tby smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 5BHHPGsa25363044\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tWed, 17 Dec 2025 17:25:16 GMT",
            "from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 996BB20043;\n\tWed, 17 Dec 2025 17:25:16 +0000 (GMT)",
            "from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 7D2B720040;\n\tWed, 17 Dec 2025 17:25:13 +0000 (GMT)",
            "from li-fc74f8cc-3279-11b2-a85c-ef5828687581.ibm.com.com (unknown\n [9.124.211.226])\n\tby smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP;\n\tWed, 17 Dec 2025 17:25:13 +0000 (GMT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1765992335;\n\tcv=none;\n b=mQiKErCefSQKvyqYeMVrbm1adSDcr9pV3FVcrHC7Rxqx427j30rDF72pX+04o6Nw2quoMOBTgxJUM9sluDoqIHJhaMyuzb0GDaJRouj8ZfB+/Osuxrcw9EbcAvCsku31bGSTeTyFlwzIH+V57y3F6wuykdyLQRrrcjA29uqvgWO/sfa4o9URAypgDmemLFlKY0Rfdp19LNUa0sGqTJGtJ9I2kCrlTWc3GK9t8vuFFYWEhiPVCPDxAhjVvxZb3hvbgAvRTr7O47WJNaQe+bEV9M3i7ATQZ0qSCDiWleeKEXQeNuhcbAYp8/oMSuwf8wfwoPx7+9lu+U4ysCF1AwOSkQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1765992335; c=relaxed/relaxed;\n\tbh=5SKiyMHvrorLkIZBE65fPl51HErpcrh4BjYe7S+LMUQ=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=DpJa3uIc8omRPKtfRw6aUOmvIwfhuVVqPley8RvhoPCvtnqOZ5BbAIQiSrpViPlxk8ZnpyP0Mv2/lGs3GiRzwQ19fn+mHwwTsPI5+Ls2NimLXoFrrZugFxM+bsxdAXn4zFhdXnlkImyPo/a42TmggwLBCkOie7mtu7OcZ2S9gr0ll90Zm89zM76Te4Npg8Pb03qzdPtF2FDYwi1s7+Ofu+UpiCWocQWSnFJPFEVd7q6JPiF7b8eHyyN6o2ACtJ+dnzvLnwsimmbcOYhO97NS/wDRVSVOmig+Cd2akH4Av2cuQ3FikmdK9QvK9/6P8hb7v7gQRDoZGAwF3BOucDMSmw==",
        "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=Un3VgEF0; dkim-atps=neutral;\n spf=pass (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com;\n envelope-from=ssrish@linux.ibm.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n\t:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=pp1; bh=5SKiyMHvrorLkIZBE\n\t65fPl51HErpcrh4BjYe7S+LMUQ=; b=Un3VgEF0Ij1Cl3U6kxyfKKUX6J1iyszQB\n\tBRtRduyTiAdRMY50tWrU9vMOcFw6ZqltcNW4zpl+Ba3+GvZli8OtYop3z1lu4pug\n\tfpbtNiDqHqU2u8VEJ2tmsOfm9HLjrXZ7WR//wjRkdKOWceoIalrDazGxM7sweFHz\n\tlGNPT4tXUP22FiZa+9h7EGtXv4wjchh9VutsAGCkWTxrkpkHrq3/E5eOKcOknD5P\n\ttOsCX4dHOwezP667Pzn/q6ByrYvd4gFzH3+F4OuuvEzEohSAcBZVhlmS7saa2bfV\n\tCl7rhBUvs+Vmg6Vw2EwllhJQf0xO64f4Jb/vmRECZGCc3unayCwsA==",
        "From": "Srish Srinivasan <ssrish@linux.ibm.com>",
        "To": "linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,\n        linuxppc-dev@lists.ozlabs.org",
        "Cc": "maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,\n        christophe.leroy@csgroup.eu, James.Bottomley@HansenPartnership.com,\n        jarkko@kernel.org, zohar@linux.ibm.com, nayna@linux.ibm.com,\n        rnsastry@linux.ibm.com, linux-kernel@vger.kernel.org,\n        linux-security-module@vger.kernel.org, ssrish@linux.ibm.com",
        "Subject": "[PATCH v2 2/6] powerpc/pseries: move the PLPKS config inside its own\n sysfs directory",
        "Date": "Wed, 17 Dec 2025 22:55:01 +0530",
        "Message-ID": "<20251217172505.112398-3-ssrish@linux.ibm.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20251217172505.112398-1-ssrish@linux.ibm.com>",
        "References": "<20251217172505.112398-1-ssrish@linux.ibm.com>",
        "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org",
        "List-Id": "<linuxppc-dev.lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>",
        "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>",
        "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>",
        "Precedence": "list",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-TM-AS-GCONF": "00",
        "X-Proofpoint-ORIG-GUID": "xwXyKfd39xjnreLXNgme1xaiKlqbJXq-",
        "X-Authority-Analysis": "v=2.4 cv=CLgnnBrD c=1 sm=1 tr=0 ts=6942e782 cx=c_pps\n a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17\n a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8\n a=mWGr4ncSMiNchjaCnzgA:9",
        "X-Proofpoint-GUID": "85B0ugw7PXuQSVlsTJ76iF9pAc9tdisQ",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjUxMjEzMDAwOSBTYWx0ZWRfX5ak+azcgl/Ld\n sLPlMp9b6U7xaW258vRUsiXcuCplCutr8b+RMKG7ENkiIqMOJAYn0tYSZJwFTL5KLJ7gTtFjHaH\n 9Q6Duc/aL88yDleb4zeuukHPRGQx5WCqWLYiOUOMQL5XT/kaIUkTIx+I1AN2yWDIaEvBdnARPJu\n 7C+sGc9KkMkTIrvEiEYGRfqw0mPsIJcIfI1S8khXxn4YxX5Ln/Ce11e+dPRfM6JxlACqgBEEYO5\n R5FxTrk8bUauwGofClgJU2c/ELtwc/tmhGFilS+uikjWLIARXKwHI7BB+CmDQXt8LZzsDWw7ZVu\n 91DIGMpjOaZrqPEV2JKCjdNrwEpbB4hK+GkRCMsuS8pbH93InGpisZsggqFyZxpuxg/CLIr9SIh\n 1+Squ/j+ZEiDA6pZ1XK4/zGj02+/uw==",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49\n definitions=2025-12-17_03,2025-12-16_05,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n spamscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 suspectscore=0\n phishscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 adultscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2512130009",
        "X-Spam-Status": "No, score=-0.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tRCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,\n\tSPF_PASS autolearn=disabled version=4.0.1 OzLabs 8",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"
    },
    "content": "The /sys/firmware/secvar/config directory represents Power LPAR Platform\nKeyStore (PLPKS) configuration properties such as max_object_size, signed_\nupdate_algorithms, supported_policies, total_size, used_space, and version.\nThese attributes describe the PLPKS, and not the secure boot variables\n(secvars).\n\nCreate /sys/firmware/plpks directory and move the PLPKS config inside this\ndirectory. For backwards compatibility, create a soft link from the secvar\nsysfs directory to this config and emit a warning stating that the older\nsysfs path has been deprecated. Separate out the plpks specific\ndocumentation from secvar.\n\nSigned-off-by: Srish Srinivasan <ssrish@linux.ibm.com>\n---\n .../ABI/testing/sysfs-firmware-plpks          | 50 ++++++++++\n Documentation/ABI/testing/sysfs-secvar        | 65 -------------\n arch/powerpc/include/asm/plpks.h              |  5 +\n arch/powerpc/include/asm/secvar.h             |  1 -\n arch/powerpc/kernel/secvar-sysfs.c            | 21 ++---\n arch/powerpc/platforms/pseries/Makefile       |  2 +-\n arch/powerpc/platforms/pseries/plpks-secvar.c | 29 ------\n arch/powerpc/platforms/pseries/plpks-sysfs.c  | 94 +++++++++++++++++++\n 8 files changed, 156 insertions(+), 111 deletions(-)\n create mode 100644 Documentation/ABI/testing/sysfs-firmware-plpks\n create mode 100644 arch/powerpc/platforms/pseries/plpks-sysfs.c",
    "diff": "diff --git a/Documentation/ABI/testing/sysfs-firmware-plpks b/Documentation/ABI/testing/sysfs-firmware-plpks\nnew file mode 100644\nindex 000000000000..af0353f34115\n--- /dev/null\n+++ b/Documentation/ABI/testing/sysfs-firmware-plpks\n@@ -0,0 +1,50 @@\n+What:\t\t/sys/firmware/plpks/config\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tThis optional directory contains read-only config attributes as\n+\t\tdefined by the PLPKS implementation. All data is in ASCII\n+\t\tformat.\n+\n+What:\t\t/sys/firmware/plpks/config/version\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tConfig version as reported by the hypervisor in ASCII decimal\n+\t\tformat.\n+\n+What:\t\t/sys/firmware/plpks/config/max_object_size\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tMaximum allowed size of\tobjects in the keystore in bytes,\n+\t\trepresented in ASCII decimal format.\n+\n+\t\tThis is not necessarily the same as the max size that can be\n+\t\twritten to an update file as writes can contain more than\n+\t\tobject data, you should use the size of the update file for\n+\t\tthat purpose.\n+\n+What:\t\t/sys/firmware/plpks/config/total_size\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tTotal size of the PLPKS in bytes, represented in ASCII decimal\n+\t\tformat.\n+\n+What:\t\t/sys/firmware/plpks/config/used_space\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tCurrent space consumed by the key store, in bytes, represented\n+\t\tin ASCII decimal format.\n+\n+What:\t\t/sys/firmware/plpks/config/supported_policies\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tBitmask of supported policy flags by the hypervisor, represented\n+\t\tas an 8 byte hexadecimal ASCII string. Consult the hypervisor\n+\t\tdocumentation for what these flags are.\n+\n+What:\t\t/sys/firmware/plpks/config/signed_update_algorithms\n+Date:\t\tFebruary 2023\n+Contact:\tNayna Jain <nayna@linux.ibm.com>\n+Description:\tBitmask of flags indicating which algorithms the hypervisor\n+\t\tsupports for signed update of objects, represented as a 16 byte\n+\t\thexadecimal ASCII string. Consult the hypervisor documentation\n+\t\tfor what these flags mean.\ndiff --git a/Documentation/ABI/testing/sysfs-secvar b/Documentation/ABI/testing/sysfs-secvar\nindex 1016967a730f..c52a5fd15709 100644\n--- a/Documentation/ABI/testing/sysfs-secvar\n+++ b/Documentation/ABI/testing/sysfs-secvar\n@@ -63,68 +63,3 @@ Contact:\tNayna Jain <nayna@linux.ibm.com>\n Description:\tA write-only file that is used to submit the new value for the\n \t\tvariable. The size of the file represents the maximum size of\n \t\tthe variable data that can be written.\n-\n-What:\t\t/sys/firmware/secvar/config\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tThis optional directory contains read-only config attributes as\n-\t\tdefined by the secure variable implementation.  All data is in\n-\t\tASCII format. The directory is only created if the backing\n-\t\timplementation provides variables to populate it, which at\n-\t\tpresent is only PLPKS on the pseries platform.\n-\n-What:\t\t/sys/firmware/secvar/config/version\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tConfig version as reported by the hypervisor in ASCII decimal\n-\t\tformat.\n-\n-\t\tCurrently only provided by PLPKS on the pseries platform.\n-\n-What:\t\t/sys/firmware/secvar/config/max_object_size\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tMaximum allowed size of\tobjects in the keystore in bytes,\n-\t\trepresented in ASCII decimal format.\n-\n-\t\tThis is not necessarily the same as the max size that can be\n-\t\twritten to an update file as writes can contain more than\n-\t\tobject data, you should use the size of the update file for\n-\t\tthat purpose.\n-\n-\t\tCurrently only provided by PLPKS on the pseries platform.\n-\n-What:\t\t/sys/firmware/secvar/config/total_size\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tTotal size of the PLPKS in bytes, represented in ASCII decimal\n-\t\tformat.\n-\n-\t\tCurrently only provided by PLPKS on the pseries platform.\n-\n-What:\t\t/sys/firmware/secvar/config/used_space\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tCurrent space consumed by the key store, in bytes, represented\n-\t\tin ASCII decimal format.\n-\n-\t\tCurrently only provided by PLPKS on the pseries platform.\n-\n-What:\t\t/sys/firmware/secvar/config/supported_policies\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tBitmask of supported policy flags by the hypervisor,\n-\t\trepresented as an 8 byte hexadecimal ASCII string. Consult the\n-\t\thypervisor documentation for what these flags are.\n-\n-\t\tCurrently only provided by PLPKS on the pseries platform.\n-\n-What:\t\t/sys/firmware/secvar/config/signed_update_algorithms\n-Date:\t\tFebruary 2023\n-Contact:\tNayna Jain <nayna@linux.ibm.com>\n-Description:\tBitmask of flags indicating which algorithms the hypervisor\n-\t\tsupports for signed update of objects, represented as a 16 byte\n-\t\thexadecimal ASCII string. Consult the hypervisor documentation\n-\t\tfor what these flags mean.\n-\n-\t\tCurrently only provided by PLPKS on the pseries platform.\ndiff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h\nindex f303922bf622..8829a13bfda0 100644\n--- a/arch/powerpc/include/asm/plpks.h\n+++ b/arch/powerpc/include/asm/plpks.h\n@@ -13,6 +13,7 @@\n \n #include <linux/types.h>\n #include <linux/list.h>\n+#include <linux/kobject.h>\n \n // Object policy flags from supported_policies\n #define PLPKS_OSSECBOOTAUDIT\tPPC_BIT32(1) // OS secure boot must be audit/enforce\n@@ -107,11 +108,15 @@ u16 plpks_get_passwordlen(void);\n void plpks_early_init_devtree(void);\n \n int plpks_populate_fdt(void *fdt);\n+\n+int plpks_config_create_softlink(struct kobject *from);\n #else // CONFIG_PSERIES_PLPKS\n static inline bool plpks_is_available(void) { return false; }\n static inline u16 plpks_get_passwordlen(void) { BUILD_BUG(); }\n static inline void plpks_early_init_devtree(void) { }\n static inline int plpks_populate_fdt(void *fdt) { BUILD_BUG(); }\n+static inline int plpks_config_create_softlink(struct kobject *from)\n+\t\t\t\t\t\t{ return 0; }\n #endif // CONFIG_PSERIES_PLPKS\n \n #endif // _ASM_POWERPC_PLPKS_H\ndiff --git a/arch/powerpc/include/asm/secvar.h b/arch/powerpc/include/asm/secvar.h\nindex 4828e0ab7e3c..fd5006307f2a 100644\n--- a/arch/powerpc/include/asm/secvar.h\n+++ b/arch/powerpc/include/asm/secvar.h\n@@ -20,7 +20,6 @@ struct secvar_operations {\n \tint (*set)(const char *key, u64 key_len, u8 *data, u64 data_size);\n \tssize_t (*format)(char *buf, size_t bufsize);\n \tint (*max_size)(u64 *max_size);\n-\tconst struct attribute **config_attrs;\n \n \t// NULL-terminated array of fixed variable names\n \t// Only used if get_next() isn't provided\ndiff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c\nindex ec900bce0257..4111b21962eb 100644\n--- a/arch/powerpc/kernel/secvar-sysfs.c\n+++ b/arch/powerpc/kernel/secvar-sysfs.c\n@@ -12,6 +12,7 @@\n #include <linux/string.h>\n #include <linux/of.h>\n #include <asm/secvar.h>\n+#include <asm/plpks.h>\n \n #define NAME_MAX_SIZE\t   1024\n \n@@ -145,19 +146,6 @@ static __init int update_kobj_size(void)\n \treturn 0;\n }\n \n-static __init int secvar_sysfs_config(struct kobject *kobj)\n-{\n-\tstruct attribute_group config_group = {\n-\t\t.name = \"config\",\n-\t\t.attrs = (struct attribute **)secvar_ops->config_attrs,\n-\t};\n-\n-\tif (secvar_ops->config_attrs)\n-\t\treturn sysfs_create_group(kobj, &config_group);\n-\n-\treturn 0;\n-}\n-\n static __init int add_var(const char *name)\n {\n \tstruct kobject *kobj;\n@@ -260,12 +248,15 @@ static __init int secvar_sysfs_init(void)\n \t\tgoto err;\n \t}\n \n-\trc = secvar_sysfs_config(secvar_kobj);\n+\trc = plpks_config_create_softlink(secvar_kobj);\n \tif (rc) {\n-\t\tpr_err(\"Failed to create config directory\\n\");\n+\t\tpr_err(\"Failed to create softlink to PLPKS config directory\");\n \t\tgoto err;\n \t}\n \n+\tpr_info(\"/sys/firmware/secvar/config is now deprecated.\\n\");\n+\tpr_info(\"Will be removed in future versions.\\n\");\n+\n \tif (secvar_ops->get_next)\n \t\trc = secvar_sysfs_load();\n \telse\ndiff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile\nindex 931ebaa474c8..3ced289a675b 100644\n--- a/arch/powerpc/platforms/pseries/Makefile\n+++ b/arch/powerpc/platforms/pseries/Makefile\n@@ -30,7 +30,7 @@ obj-$(CONFIG_PAPR_SCM)\t\t+= papr_scm.o\n obj-$(CONFIG_PPC_SPLPAR)\t+= vphn.o\n obj-$(CONFIG_PPC_SVM)\t\t+= svm.o\n obj-$(CONFIG_FA_DUMP)\t\t+= rtas-fadump.o\n-obj-$(CONFIG_PSERIES_PLPKS)\t+= plpks.o\n+obj-$(CONFIG_PSERIES_PLPKS)\t+= plpks.o plpks-sysfs.o\n obj-$(CONFIG_PPC_SECURE_BOOT)\t+= plpks-secvar.o\n obj-$(CONFIG_PSERIES_PLPKS_SED)\t+= plpks_sed_ops.o\n obj-$(CONFIG_SUSPEND)\t\t+= suspend.o\ndiff --git a/arch/powerpc/platforms/pseries/plpks-secvar.c b/arch/powerpc/platforms/pseries/plpks-secvar.c\nindex f9e9cc40c9d0..a50ff6943d80 100644\n--- a/arch/powerpc/platforms/pseries/plpks-secvar.c\n+++ b/arch/powerpc/platforms/pseries/plpks-secvar.c\n@@ -20,33 +20,6 @@\n #include <asm/secvar.h>\n #include <asm/plpks.h>\n \n-// Config attributes for sysfs\n-#define PLPKS_CONFIG_ATTR(name, fmt, func)\t\t\t\\\n-\tstatic ssize_t name##_show(struct kobject *kobj,\t\\\n-\t\t\t\t   struct kobj_attribute *attr,\t\\\n-\t\t\t\t   char *buf)\t\t\t\\\n-\t{\t\t\t\t\t\t\t\\\n-\t\treturn sysfs_emit(buf, fmt, func());\t\t\\\n-\t}\t\t\t\t\t\t\t\\\n-\tstatic struct kobj_attribute attr_##name = __ATTR_RO(name)\n-\n-PLPKS_CONFIG_ATTR(version, \"%u\\n\", plpks_get_version);\n-PLPKS_CONFIG_ATTR(max_object_size, \"%u\\n\", plpks_get_maxobjectsize);\n-PLPKS_CONFIG_ATTR(total_size, \"%u\\n\", plpks_get_totalsize);\n-PLPKS_CONFIG_ATTR(used_space, \"%u\\n\", plpks_get_usedspace);\n-PLPKS_CONFIG_ATTR(supported_policies, \"%08x\\n\", plpks_get_supportedpolicies);\n-PLPKS_CONFIG_ATTR(signed_update_algorithms, \"%016llx\\n\", plpks_get_signedupdatealgorithms);\n-\n-static const struct attribute *config_attrs[] = {\n-\t&attr_version.attr,\n-\t&attr_max_object_size.attr,\n-\t&attr_total_size.attr,\n-\t&attr_used_space.attr,\n-\t&attr_supported_policies.attr,\n-\t&attr_signed_update_algorithms.attr,\n-\tNULL,\n-};\n-\n static u32 get_policy(const char *name)\n {\n \tif ((strcmp(name, \"db\") == 0) ||\n@@ -225,7 +198,6 @@ static const struct secvar_operations plpks_secvar_ops_static = {\n \t.set = plpks_set_variable,\n \t.format = plpks_secvar_format,\n \t.max_size = plpks_max_size,\n-\t.config_attrs = config_attrs,\n \t.var_names = plpks_var_names_static,\n };\n \n@@ -234,7 +206,6 @@ static const struct secvar_operations plpks_secvar_ops_dynamic = {\n \t.set = plpks_set_variable,\n \t.format = plpks_secvar_format,\n \t.max_size = plpks_max_size,\n-\t.config_attrs = config_attrs,\n \t.var_names = plpks_var_names_dynamic,\n };\n \ndiff --git a/arch/powerpc/platforms/pseries/plpks-sysfs.c b/arch/powerpc/platforms/pseries/plpks-sysfs.c\nnew file mode 100644\nindex 000000000000..01d526185783\n--- /dev/null\n+++ b/arch/powerpc/platforms/pseries/plpks-sysfs.c\n@@ -0,0 +1,94 @@\n+// SPDX-License-Identifier: GPL-2.0-only\n+/*\n+ * Copyright (C) 2025 IBM Corporation, Srish Srinivasan <ssrish@linux.ibm.com>\n+ *\n+ * This code exposes PLPKS config to user via sysfs\n+ */\n+\n+#define pr_fmt(fmt) \"plpks-sysfs: \"fmt\n+\n+#include <linux/init.h>\n+#include <linux/printk.h>\n+#include <linux/types.h>\n+#include <asm/machdep.h>\n+#include <asm/plpks.h>\n+\n+/* config attributes for sysfs */\n+#define PLPKS_CONFIG_ATTR(name, fmt, func)\t\t\t\\\n+\tstatic ssize_t name##_show(struct kobject *kobj,\t\\\n+\t\t\t\t   struct kobj_attribute *attr,\t\\\n+\t\t\t\t   char *buf)\t\t\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\treturn sysfs_emit(buf, fmt, func());\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+\tstatic struct kobj_attribute attr_##name = __ATTR_RO(name)\n+\n+PLPKS_CONFIG_ATTR(version, \"%u\\n\", plpks_get_version);\n+PLPKS_CONFIG_ATTR(max_object_size, \"%u\\n\", plpks_get_maxobjectsize);\n+PLPKS_CONFIG_ATTR(total_size, \"%u\\n\", plpks_get_totalsize);\n+PLPKS_CONFIG_ATTR(used_space, \"%u\\n\", plpks_get_usedspace);\n+PLPKS_CONFIG_ATTR(supported_policies, \"%08x\\n\", plpks_get_supportedpolicies);\n+PLPKS_CONFIG_ATTR(signed_update_algorithms, \"%016llx\\n\",\n+\t\t  plpks_get_signedupdatealgorithms);\n+\n+static const struct attribute *config_attrs[] = {\n+\t&attr_version.attr,\n+\t&attr_max_object_size.attr,\n+\t&attr_total_size.attr,\n+\t&attr_used_space.attr,\n+\t&attr_supported_policies.attr,\n+\t&attr_signed_update_algorithms.attr,\n+\tNULL,\n+};\n+\n+static struct kobject *plpks_kobj, *plpks_config_kobj;\n+\n+int plpks_config_create_softlink(struct kobject *from)\n+{\n+\tif (!plpks_config_kobj)\n+\t\treturn -EINVAL;\n+\treturn sysfs_create_link(from, plpks_config_kobj, \"config\");\n+}\n+\n+static __init int plpks_sysfs_config(struct kobject *kobj)\n+{\n+\tstruct attribute_group config_group = {\n+\t\t.name = NULL,\n+\t\t.attrs = (struct attribute **)config_attrs,\n+\t};\n+\n+\treturn sysfs_create_group(kobj, &config_group);\n+}\n+\n+static __init int plpks_sysfs_init(void)\n+{\n+\tint rc;\n+\n+\tif (!plpks_is_available())\n+\t\treturn -ENODEV;\n+\n+\tplpks_kobj = kobject_create_and_add(\"plpks\", firmware_kobj);\n+\tif (!plpks_kobj) {\n+\t\tpr_err(\"Failed to create plpks kobj\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tplpks_config_kobj = kobject_create_and_add(\"config\", plpks_kobj);\n+\tif (!plpks_config_kobj) {\n+\t\tpr_err(\"Failed to create plpks config kobj\\n\");\n+\t\tkobject_put(plpks_kobj);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\trc = plpks_sysfs_config(plpks_config_kobj);\n+\tif (rc) {\n+\t\tpr_err(\"Failed to create attribute group for plpks config\\n\");\n+\t\tkobject_put(plpks_config_kobj);\n+\t\tkobject_put(plpks_kobj);\n+\t\treturn rc;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+machine_subsys_initcall(pseries, plpks_sysfs_init);\n",
    "prefixes": [
        "v2",
        "2/6"
    ]
}