get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195667,
    "url": "http://patchwork.ozlabs.org/api/patches/2195667/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/b0235b8e04227ac36c54b64659a5f98b04f437e7.1770825377.git.michal.simek@amd.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<b0235b8e04227ac36c54b64659a5f98b04f437e7.1770825377.git.michal.simek@amd.com>",
    "list_archive_url": null,
    "date": "2026-02-11T15:56:20",
    "name": "[v8,1/4] efi_var_file: refactor to move buffer functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "2c3faac21206ff1b0ccaa244186a15108393b8e3",
    "submitter": {
        "id": 84271,
        "url": "http://patchwork.ozlabs.org/api/people/84271/?format=api",
        "name": "Michal Simek",
        "email": "michal.simek@amd.com"
    },
    "delegate": {
        "id": 96103,
        "url": "http://patchwork.ozlabs.org/api/users/96103/?format=api",
        "username": "apalos",
        "first_name": "Ilias",
        "last_name": "Apalodimas",
        "email": "apalos@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/b0235b8e04227ac36c54b64659a5f98b04f437e7.1770825377.git.michal.simek@amd.com/mbox/",
    "series": [
        {
            "id": 491869,
            "url": "http://patchwork.ozlabs.org/api/series/491869/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=491869",
            "date": "2026-02-11T15:56:20",
            "name": "efi_vars: Implement SPI Flash storage for EFI",
            "version": 8,
            "mbox": "http://patchwork.ozlabs.org/series/491869/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195667/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195667/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256\n header.s=selector1 header.b=VRPf5mfy;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=amd.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=amd.com header.i=@amd.com header.b=\"VRPf5mfy\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=amd.com",
            "phobos.denx.de;\n spf=fail smtp.mailfrom=michal.simek@amd.com"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fB32w6chmz1xtr\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 02:56:56 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 6B02083CBD;\n\tWed, 11 Feb 2026 16:56:52 +0100 (CET)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 7089A83B64; Wed, 11 Feb 2026 16:56:50 +0100 (CET)",
            "from BN1PR04CU002.outbound.protection.outlook.com\n (mail-eastus2azlp170100001.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c110::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id DFFF183966\n for <u-boot@lists.denx.de>; Wed, 11 Feb 2026 16:56:47 +0100 (CET)",
            "from PH7P220CA0048.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::19)\n by PH8PR12MB6793.namprd12.prod.outlook.com (2603:10b6:510:1c4::19)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9611.10; Wed, 11 Feb\n 2026 15:56:40 +0000",
            "from SN1PEPF000252A0.namprd05.prod.outlook.com\n (2603:10b6:510:32b:cafe::81) by PH7P220CA0048.outlook.office365.com\n (2603:10b6:510:32b::19) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9611.10 via Frontend Transport; Wed,\n 11 Feb 2026 15:56:38 +0000",
            "from satlexmb07.amd.com (165.204.84.17) by\n SN1PEPF000252A0.mail.protection.outlook.com (10.167.242.7) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9611.8 via Frontend Transport; Wed, 11 Feb 2026 15:56:39 +0000",
            "from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com\n (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 11 Feb\n 2026 09:56:39 -0600",
            "from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com\n (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 11 Feb\n 2026 09:56:38 -0600",
            "from localhost (10.180.168.240) by satlexmb07.amd.com\n (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17 via Frontend\n Transport; Wed, 11 Feb 2026 09:56:38 -0600"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=cf4PqIIeBfiC1+bQtZnr4LfLtXtk/Oz+j6WifHwYzled6F0fGc6wzZvRh4LUOn1+B+WdZzXHSSL2oZtdJt5EX9WZWdjIBPMm2trRcDZPGQbNNUWfboOSBOM31InvmexZi0l2PO7qLd1cpz4ZpU6/DfuF2jrD2wKdBnYvSHEtAcZQziKf96Vd0cLegSudTnVlRKQpfHdMXsNWIajktsGVxFDQ8hdfUg88QNaGw02TPZh8EGgls5oARQSXDroVJVCRVMwMcr/iTzp9IfroUR9Xu2LPvI/3OPxmnSZX1bTeL6pM6biLWctRF+1jbJMog1o+5CPzTjVvVM4JqPFiqOXkvg==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=6iZbx1EIqkhAfkkvfiBSuPoi1Fo/ti+KDIJDSPSgYlM=;\n b=wISpcRiiYjr3eMbWztMnKKahS8lnwNFYKP4B81hvLbQfCSuFBOP+TqLRBKRJE0MbgEmg4s8qDAfi4QqDT2UjE+4Z115WHqDfAUiSXHTHwJKSTvz7LaUIAWGd+2F5sZuOpp2OQ0INYGbPjDUIEu1p+FCTBVpzkxGhqb2ChYec+Dkntc68Pe2KvWdmn0HEXrg/QUcDUtL6Dkjl3FTnUje6RPBOzxOwewqtYBNN7NzTEXMwzmQeeLmxEq3p2SfdrcxJ0u+flgXXzv6gjJFqL2OJgmiLPZKtlFfOX3Uh+tzicsYe7/R4NKLjU9PBx6KVz/PKuXz7oTiAZQSlp6yrq/cKpQ==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com;\n dmarc=pass (p=quarantine sp=quarantine pct=100) action=none\n header.from=amd.com; dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=6iZbx1EIqkhAfkkvfiBSuPoi1Fo/ti+KDIJDSPSgYlM=;\n b=VRPf5mfylVYO7kKlP18fYvYOAc6EJo22B9zta8YxVSvtKzS678Xli6e04Y+NUUiQwzt1Kq9CWyhBIO5rGXL9HW/+hz1JUzbF9vpXn5WTKouBABKLLLMbRBBksE6k9GzUQLnjHkIgcJiTVy/WDxHcp8uhY7dByDitFdVKxJqpCNY=",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 165.204.84.17)\n smtp.mailfrom=amd.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=amd.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of amd.com designates\n 165.204.84.17 as permitted sender) receiver=protection.outlook.com;\n client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C",
        "From": "Michal Simek <michal.simek@amd.com>",
        "To": "<u-boot@lists.denx.de>, <git@amd.com>",
        "CC": "Shantur Rathore <i@shantur.com>, Neil Armstrong\n <neil.armstrong@linaro.org>, Heinrich Schuchardt <xypron.glpk@gmx.de>, \"Ilias\n Apalodimas\" <ilias.apalodimas@linaro.org>, Pranav Tilak\n <pranav.vinaytilak@amd.com>, Sughosh Ganu <sughosh.ganu@arm.com>, Tom Rini\n <trini@konsulko.com>, \"Ying-Chun Liu (PaulLiu)\" <paul.liu@linaro.org>",
        "Subject": "[PATCH v8 1/4] efi_var_file: refactor to move buffer functions",
        "Date": "Wed, 11 Feb 2026 16:56:20 +0100",
        "Message-ID": "\n <b0235b8e04227ac36c54b64659a5f98b04f437e7.1770825377.git.michal.simek@amd.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<cover.1770825377.git.michal.simek@amd.com>",
        "References": "<cover.1770825377.git.michal.simek@amd.com>",
        "MIME-Version": "1.0",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=7861; i=michal.simek@amd.com;\n h=from:subject:message-id; bh=TVihWY0589FrlblKseR/d+W7iOiiHjjiy01QnZEpZRI=;\n b=owGbwMvMwCG2mv3fB7+vgl8ZT6slMWT2LFt7cxV7+ZbMu058ef+MJL+uyfdIlP6z9srGDQvC2\n HlvB5gwdJSyMIhxMMiKKbJMZ9JxWPPt2lKx5ZH5MHNYmUCGMHBxCsBEvBwZGS43lrpsPxU2u9/9\n kaDCPZ97M1aWSaQGffmgeCRRQLQlTIKRYbOFnFhKcFmTvXqIoZ1t8PVH8x80TQ489nPT+57k/pX\n 6bAA=",
        "X-Developer-Key": "i=michal.simek@amd.com; a=openpgp;\n fpr=67350C9BF5CCEE9B5364356A377C7F21FE3D1F91",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "SN1PEPF000252A0:EE_|PH8PR12MB6793:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "8c56aa97-efe5-43b8-371d-08de69862500",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|1800799024|376014|82310400026|36860700013;",
        "X-Microsoft-Antispam-Message-Info": "\n Fsw8NdcRf0b4yFu4cmf/80VO/B2Td/+LwpPxA0yoKWu+yRcxrn2aoNCESTAWuShMo0YSFWSuO3kYF846F9hF4ehQz4Avs1k873tS31Oj6lSzLyd/vT3b02vL8XzY+bcSQDlPodEHaMBS8IJuAzJ2xITj/drU/88t9PDQTpzjm0NCA7Hm8laftEzi/kZfhlst4lWKZFKHbJUJsvGlCD1W8yiGmlhcDYrnOk75TAaaSrjQvn5XjBuypNqDArTJ3roJrLOMEVycg2GQs0szZeeGCWJ/5APkrtXBg8xUwT/a47ktG0v/AX+HdxHuLAZnPhAPjEsUZ5J+AR1BVTpwVXProXc3T3H6Q/BeiyGTUIzilQ8Y6NTqUKoAKImPpXL385xAwNcnm1od65pqwhSth/nG5zyGXT9P2wvPSDjquOpyUHlMZbWJNZqG662ENKhIYZz1x0SWyGOLfOI03FyxzG0oaSWoHwV/MRz4nT+8Tq2NNNJLgWObdIJKNlvp3/ksDd+cKbaA90gI6GRYEhtWxIlDLVMCvDuvlPGf9g3/NrFL0D4Qjgy145wVFkjQO8kTshS4wxW5OqdwdHKWa4fsOgTxe3jB+Xj4XWruA8jGjZCLpdpPUmqaSNLJnSVeRlizBvfXLFWXM12ZolRYN/BrFr5oKccyUH7hhPtJ6DxLb97r8gM03/VsN9ynQ3zGH6n6q8Axdvngc83R0tVDMSJBJxx8nc+Qpqjh++qmd0+h7X3cB3mdTIg9eskRdqFjGT2K74ekExFP3g4aHOiaTDGBRLeQ5aULVXyhHKAQ8AG1vBhT9KYtV8VG+HAArWOEvOSwYUnf/PkrUHkqQy1MjrIj2dNR1Y8aS39kltoWfy4tIgP46567ykdMnZAIsS5T8S+R3NfpEor/3GM6lHXWyvVEA/ZcEJcb0FJ7eu9UGqtxrx3MT3ma40EFnEtdUJ1bnmISId4JurB2Yc8stEGuLns60+hiqpGB3E2mtXP4gBI/QjWc7Bshpz0RFLXlDfyuxhZAJJnGUZraKXnS1I9MLrE6CkUqz2RD8Ivkpd8SI1eOMkXYAEd5yfqLhldwDWZXWnekKRx0eSwm03kVI0laPvW8a3HvzweAKMoj1tvLALodivPNV5rDRCsFczxKq/Lp6y//KyEdXKZV5PL6jdr0ubSucoS7qD6Fo07ixYV7JCUu+/uBvhpKXaY6ErrrWKe/4jWNqIygw/R0rIzTvFYNzrmE7zE0xhobIDBPDeEPRQjtItFJTHHFkl4Sa5qHrrGQR5083Db2+6nO6tl2yN8KdAiaFAqu4+MBOTHnsPESvHytbO+O5d2u4QNcMIhGbj6ZSnDsV1MB/t/Jy7dkHjppXX2ijBDE+ibFICcyNA0IZ+gZzSIZ88a6QfA8R1CetsmjF/o3c5Or+ukDKHXbAfC4t6rl+tuX1O/37vTK3tztIixvwfL8QKAYXgrnYvRJOGOHLzKZFHND/vdMq8hZXNzFJi/s3iXwKUQ6abOIvBgNGERVdRg89y/YcWWYZfWZPaWZ74OPl/4nanxmnXJYxAE8XysBDdUqsaWWtLjcX8fYlspxQj1QP3oO1sET+ou86kA4a/g8k9/jiO6I2pP1+OMV76DqGS5ibgpThQc7Sx51rw5JQAUZ54VyltgEcCH1vLs0/Yz0QE4qMVsCUaPpo08dGZCX7h9LYQ==",
        "X-Forefront-Antispam-Report": "CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT;\n SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n 791K3pIhepzq0B0TyRvCE4tV0DN7MYNQhkJ82e/gW/hLMMdiJVMQCf0cC3iFuxfOGhTrdM1f0B/oCIgYZd4z4e/kSLQbjC1svlp0SktLR5780mATaiXE5LS04jb2BaaIqi58V9cC02MFHnn9PdzPGZ7/TO80UAkvzQ3yQ2zkjvtogfHJGphtFljKEdQEM+bDA/i5l20ljrAQUt/AnAfNUXsLA5h/kA0MNJNRNDbuyKDlKNFVkjyXH4GNCE+Oa9aIs6KQ8l2R3Dydb4vqEUZEq45Eo1txAugG7HQ+vYdSRukQrygStXpGt8ALqITOuRYLYiJnDJNWuyRJj8J4Qhj4djgTONmJocZkhk902iPphijqQE7/FfibGVPu5o7KYFg0Uv12jOvNZVPBwYMgrSdKqvQS+quNsx4CRryW7G35DYed9p6EQGUJ/DVzRwPuMJ2Z",
        "X-OriginatorOrg": "amd.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "11 Feb 2026 15:56:39.9883 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 8c56aa97-efe5-43b8-371d-08de69862500",
        "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17];\n Helo=[satlexmb07.amd.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n SN1PEPF000252A0.namprd05.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PH8PR12MB6793",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "From: Shantur Rathore <i@shantur.com>\n\nCurrently efi_var_file.c has functions to store/read\nEFI variables to/from memory buffer. These functions\ncan be used with other EFI variable stores so move\nthem out to efi_var_common.c\n\nSigned-off-by: Shantur Rathore <i@shantur.com>\nSigned-off-by: Michal Simek <michal.simek@amd.com>\nTested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905D3-CC\n\n---\n\n(no changes since v6)\n\nChanges in v6:\n- Return EFI_SUCCESS in efi_set_variable_int() when\n  CONFIG_EFI_VARIABLE_NO_STORE is enabled\n\nChanges in v5:\n- Invert logic in efi_variable.c and avoid #if\n\n include/efi_variable.h          |  5 +++\n lib/efi_loader/Makefile         |  2 +-\n lib/efi_loader/efi_var_common.c | 42 ++++++++++++++++++++++++\n lib/efi_loader/efi_var_file.c   | 57 ---------------------------------\n lib/efi_loader/efi_variable.c   | 17 +++++++---\n 5 files changed, 60 insertions(+), 63 deletions(-)",
    "diff": "diff --git a/include/efi_variable.h b/include/efi_variable.h\nindex 4065cf45ecaf..ee68fa4a885f 100644\n--- a/include/efi_variable.h\n+++ b/include/efi_variable.h\n@@ -161,6 +161,11 @@ efi_status_t efi_var_to_file(void);\n efi_status_t __maybe_unused efi_var_collect(struct efi_var_file **bufp, loff_t *lenp,\n \t\t\t\t\t    u32 check_attr_mask);\n \n+/* GUID used by Shim to store the MOK database */\n+#define SHIM_LOCK_GUID \\\n+\tEFI_GUID(0x605dab50, 0xe046, 0x4300, \\\n+\t\t 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23)\n+\n /**\n  * efi_var_restore() - restore EFI variables from buffer\n  *\ndiff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile\nindex f490081f6542..ca1775eb03be 100644\n--- a/lib/efi_loader/Makefile\n+++ b/lib/efi_loader/Makefile\n@@ -53,7 +53,7 @@ ifeq ($(CONFIG_EFI_MM_COMM_TEE),y)\n obj-y += efi_variable_tee.o\n else\n obj-y += efi_variable.o\n-obj-y += efi_var_file.o\n+obj-$(CONFIG_EFI_VARIABLE_FILE_STORE) += efi_var_file.o\n obj-$(CONFIG_EFI_VARIABLES_PRESEED) += efi_var_seed.o\n endif\n obj-y += efi_watchdog.o\ndiff --git a/lib/efi_loader/efi_var_common.c b/lib/efi_loader/efi_var_common.c\nindex 4b34a58b4cf7..5ea1688dca3d 100644\n--- a/lib/efi_loader/efi_var_common.c\n+++ b/lib/efi_loader/efi_var_common.c\n@@ -41,6 +41,7 @@ static const struct efi_auth_var_name_type name_type[] = {\n \n static bool efi_secure_boot;\n static enum efi_secure_mode efi_secure_mode;\n+static const efi_guid_t shim_lock_guid = SHIM_LOCK_GUID;\n \n /**\n  * efi_efi_get_variable() - retrieve value of a UEFI variable\n@@ -488,3 +489,44 @@ efi_status_t __maybe_unused efi_var_collect(struct efi_var_file **bufp, loff_t *\n \n \treturn EFI_SUCCESS;\n }\n+\n+efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)\n+{\n+\tstruct efi_var_entry *var, *last_var;\n+\tu16 *data;\n+\tefi_status_t ret;\n+\n+\tif (buf->reserved || buf->magic != EFI_VAR_FILE_MAGIC ||\n+\t    buf->crc32 != crc32(0, (u8 *)buf->var,\n+\t\t\t\tbuf->length - sizeof(struct efi_var_file))) {\n+\t\tlog_err(\"Invalid EFI variables file\\n\");\n+\t\treturn EFI_INVALID_PARAMETER;\n+\t}\n+\n+\tlast_var = (struct efi_var_entry *)((u8 *)buf + buf->length);\n+\tfor (var = buf->var; var < last_var;\n+\t     var = (struct efi_var_entry *)ALIGN((uintptr_t)data + var->length, 8)) {\n+\t\tdata = var->name + u16_strlen(var->name) + 1;\n+\n+\t\t/*\n+\t\t * Secure boot related and volatile variables shall only be\n+\t\t * restored from U-Boot's preseed.\n+\t\t */\n+\t\tif (!safe &&\n+\t\t    (efi_auth_var_get_type(var->name, &var->guid) !=\n+\t\t     EFI_AUTH_VAR_NONE ||\n+\t\t     !guidcmp(&var->guid, &shim_lock_guid) ||\n+\t\t     !(var->attr & EFI_VARIABLE_NON_VOLATILE)))\n+\t\t\tcontinue;\n+\t\tif (!var->length)\n+\t\t\tcontinue;\n+\t\tif (efi_var_mem_find(&var->guid, var->name, NULL))\n+\t\t\tcontinue;\n+\t\tret = efi_var_mem_ins(var->name, &var->guid, var->attr,\n+\t\t\t\t      var->length, data, 0, NULL,\n+\t\t\t\t      var->time);\n+\t\tif (ret != EFI_SUCCESS)\n+\t\t\tlog_err(\"Failed to set EFI variable %ls\\n\", var->name);\n+\t}\n+\treturn EFI_SUCCESS;\n+}\ndiff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c\nindex f23a964a4180..4061a463b580 100644\n--- a/lib/efi_loader/efi_var_file.c\n+++ b/lib/efi_loader/efi_var_file.c\n@@ -14,17 +14,9 @@\n #include <mapmem.h>\n #include <efi_loader.h>\n #include <efi_variable.h>\n-#include <u-boot/crc.h>\n \n #define PART_STR_LEN 10\n \n-/* GUID used by Shim to store the MOK database */\n-#define SHIM_LOCK_GUID \\\n-\tEFI_GUID(0x605dab50, 0xe046, 0x4300, \\\n-\t\t 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23)\n-\n-static const efi_guid_t shim_lock_guid = SHIM_LOCK_GUID;\n-\n /**\n  * efi_set_blk_dev_to_system_partition() - select EFI system partition\n  *\n@@ -59,7 +51,6 @@ static efi_status_t __maybe_unused efi_set_blk_dev_to_system_partition(void)\n  */\n efi_status_t efi_var_to_file(void)\n {\n-#ifdef CONFIG_EFI_VARIABLE_FILE_STORE\n \tefi_status_t ret;\n \tstruct efi_var_file *buf;\n \tloff_t len;\n@@ -91,52 +82,6 @@ error:\n out:\n \tfree(buf);\n \treturn ret;\n-#else\n-\treturn EFI_SUCCESS;\n-#endif\n-}\n-\n-efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)\n-{\n-\tstruct efi_var_entry *var, *last_var;\n-\tu16 *data;\n-\tefi_status_t ret;\n-\n-\tif (buf->reserved || buf->magic != EFI_VAR_FILE_MAGIC ||\n-\t    buf->crc32 != crc32(0, (u8 *)buf->var,\n-\t\t\t\tbuf->length - sizeof(struct efi_var_file))) {\n-\t\tlog_err(\"Invalid EFI variables file\\n\");\n-\t\treturn EFI_INVALID_PARAMETER;\n-\t}\n-\n-\tlast_var = (struct efi_var_entry *)((u8 *)buf + buf->length);\n-\tfor (var = buf->var; var < last_var;\n-\t     var = (struct efi_var_entry *)\n-\t\t   ALIGN((uintptr_t)data + var->length, 8)) {\n-\n-\t\tdata = var->name + u16_strlen(var->name) + 1;\n-\n-\t\t/*\n-\t\t * Secure boot related and volatile variables shall only be\n-\t\t * restored from U-Boot's preseed.\n-\t\t */\n-\t\tif (!safe &&\n-\t\t    (efi_auth_var_get_type(var->name, &var->guid) !=\n-\t\t     EFI_AUTH_VAR_NONE ||\n-\t\t     !guidcmp(&var->guid, &shim_lock_guid) ||\n-\t\t     !(var->attr & EFI_VARIABLE_NON_VOLATILE)))\n-\t\t\tcontinue;\n-\t\tif (!var->length)\n-\t\t\tcontinue;\n-\t\tif (efi_var_mem_find(&var->guid, var->name, NULL))\n-\t\t\tcontinue;\n-\t\tret = efi_var_mem_ins(var->name, &var->guid, var->attr,\n-\t\t\t\t      var->length, data, 0, NULL,\n-\t\t\t\t      var->time);\n-\t\tif (ret != EFI_SUCCESS)\n-\t\t\tlog_err(\"Failed to set EFI variable %ls\\n\", var->name);\n-\t}\n-\treturn EFI_SUCCESS;\n }\n \n /**\n@@ -155,7 +100,6 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)\n  */\n efi_status_t efi_var_from_file(void)\n {\n-#ifdef CONFIG_EFI_VARIABLE_FILE_STORE\n \tstruct efi_var_file *buf;\n \tloff_t len;\n \tefi_status_t ret;\n@@ -180,6 +124,5 @@ efi_status_t efi_var_from_file(void)\n \t\tlog_err(\"Invalid EFI variables file\\n\");\n error:\n \tfree(buf);\n-#endif\n \treturn EFI_SUCCESS;\n }\ndiff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c\nindex f3533f4def3a..6e45134c61bf 100644\n--- a/lib/efi_loader/efi_variable.c\n+++ b/lib/efi_loader/efi_variable.c\n@@ -397,11 +397,15 @@ efi_status_t efi_set_variable_int(const u16 *variable_name,\n \t\tret = EFI_SUCCESS;\n \n \t/*\n-\t * Write non-volatile EFI variables to file\n+\t * Write non-volatile EFI variables\n \t * TODO: check if a value change has occured to avoid superfluous writes\n \t */\n-\tif (attributes & EFI_VARIABLE_NON_VOLATILE)\n+\tif (attributes & EFI_VARIABLE_NON_VOLATILE) {\n+\t\tif (IS_ENABLED(CONFIG_EFI_VARIABLE_NO_STORE))\n+\t\t\treturn EFI_SUCCESS;\n+\n \t\tefi_var_to_file();\n+\t}\n \n \treturn EFI_SUCCESS;\n }\n@@ -594,9 +598,12 @@ efi_status_t efi_init_variables(void)\n \tif (ret != EFI_SUCCESS)\n \t\treturn ret;\n \n-\tret = efi_var_from_file();\n-\tif (ret != EFI_SUCCESS)\n-\t\treturn ret;\n+\tif (!IS_ENABLED(CONFIG_EFI_VARIABLE_NO_STORE)) {\n+\t\tret = efi_var_from_file();\n+\t\tif (ret != EFI_SUCCESS)\n+\t\t\treturn ret;\n+\t}\n+\n \tif (IS_ENABLED(CONFIG_EFI_VARIABLES_PRESEED)) {\n \t\tret = efi_var_restore((struct efi_var_file *)\n \t\t\t\t      __efi_var_file_begin, true);\n",
    "prefixes": [
        "v8",
        "1/4"
    ]
}