get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2224336,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2224336/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260417-sdcard-performance-b4-v4-5-119e66be10c2@avm.de/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260417-sdcard-performance-b4-v4-5-119e66be10c2@avm.de>",
    "list_archive_url": null,
    "date": "2026-04-17T09:51:38",
    "name": "[v4,5/7] hw/sd/sdcard: Add erase-blocks-as-zero option.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f17e977c1b594534ca20d90844f2c06c54de056a",
    "submitter": {
        "id": 91343,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/91343/?format=api",
        "name": "Christian Speich",
        "email": "c.speich@avm.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260417-sdcard-performance-b4-v4-5-119e66be10c2@avm.de/mbox/",
    "series": [
        {
            "id": 500297,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/500297/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500297",
            "date": "2026-04-17T09:51:34",
            "name": "hw/sd: Improve performance of read/write/erase",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/500297/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224336/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224336/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "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=avm.de header.i=@avm.de header.a=rsa-sha256\n header.s=mail header.b=Wm5S1lah;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxr1j1YQcz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 19:58:47 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wDfxF-0002yV-LV; Fri, 17 Apr 2026 05:57:41 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <c.speich@avm.de>)\n id 1wDfx9-0002jV-GU; Fri, 17 Apr 2026 05:57:35 -0400",
            "from mail.avm.de ([212.42.244.119])\n by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <c.speich@avm.de>)\n id 1wDfx5-00030z-Ib; Fri, 17 Apr 2026 05:57:35 -0400",
            "from [172.16.0.1] (helo=mail.avm.de)\n by mail.avm.de with ESMTP (eXpurgate 4.55.2)\n (envelope-from <c.speich@avm.de>)\n id 69e20405-1e6c-7f0000032729-7f000001c526-1\n for <multiple-recipients>; Fri, 17 Apr 2026 11:57:25 +0200",
            "from mail-notes.avm.de (mail-notes.avm.de [172.16.0.1])\n by mail.avm.de (Postfix) with ESMTP;\n Fri, 17 Apr 2026 11:57:25 +0200 (CEST)",
            "from [127.0.1.1] ([172.17.89.139])\n by mail-notes.avm.de (HCL Domino Release 14.0FP4)\n with ESMTP id 2026041711572445-2978 ;\n Fri, 17 Apr 2026 11:57:24 +0200"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=avm.de; s=mail;\n t=1776419845; bh=+0mmvb50jR9kZ68HQ7CQk2Labu3feNtqqLeBytUExT4=;\n h=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n b=Wm5S1lahyJKP7HKLqYguJ7D6Zz6CAGwNNWjCkBRcWjyxGud4t5IXB82DvtUsRS5Kj\n iUxeSLj1w8nS+vZZ0320iuke8swQhf40hnsNudCks79TaBpRvk8TZ8ACEF+AEHzQMq\n zcNT75yN50mxfEf12/qe2cZ3YvKtrIzRX63gs/0U=",
        "From": "Christian Speich <c.speich@avm.de>",
        "Date": "Fri, 17 Apr 2026 11:51:38 +0200",
        "Subject": "[PATCH v4 5/7] hw/sd/sdcard: Add erase-blocks-as-zero option.",
        "MIME-Version": "1.0",
        "Message-Id": "<20260417-sdcard-performance-b4-v4-5-119e66be10c2@avm.de>",
        "References": "<20260417-sdcard-performance-b4-v4-0-119e66be10c2@avm.de>",
        "In-Reply-To": "<20260417-sdcard-performance-b4-v4-0-119e66be10c2@avm.de>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>,\n Bin Meng <bmeng.cn@gmail.com>, qemu-block@nongnu.org,\n Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,\n Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>,\n Christian Speich <c.speich@avm.de>",
        "X-Mailer": "b4 0.14.2",
        "X-MIMETrack": "Itemize by SMTP Server on ANIS1/AVM(Release 14.0FP4|March 10,\n 2025) at 17.04.2026 11:57:24,\n Serialize by Router on ANIS1/AVM(Release 14.0FP4|March 10, 2025) at\n 17.04.2026 11:57:25, Serialize complete at 17.04.2026 11:57:25",
        "X-TNEFEvaluated": "1",
        "Content-Transfer-Encoding": "7bit",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "X-purgate-ID": "149429::1776419845-22F7A373-09464F27/0/0",
        "X-purgate-type": "clean",
        "X-purgate-size": "3423",
        "X-purgate-Ad": "Categorized by eleven eXpurgate (R) https://www.eleven.de",
        "X-purgate": [
            "This mail is considered clean (visit https://www.eleven.de for\n further information)",
            "clean"
        ],
        "Received-SPF": "pass client-ip=212.42.244.119; envelope-from=c.speich@avm.de;\n helo=mail.avm.de",
        "X-Spam_score_int": "-48",
        "X-Spam_score": "-4.9",
        "X-Spam_bar": "----",
        "X-Spam_report": "(-4.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "Currently, erased blocks are filled with 0xFF. However SCR Bit 55\n(DATA_STAT_AFTER_ERASE) indicates that an erase produces zeros. One of\nthem is wrong.\n\nThis patch does two things.\n\nFirst it fixes the reporting of DATA_STAT_AFTER_ERASE in SCR to\ncorrectly reflect the content of erased blocks. We also increase the\nProduct Revision (REV in CID) to indicate to the guest that\nDATA_STAT_AFTER_ERASE is now reliable.\n\nSecondly, we introduce a erase-blocks-as-zero option, which allows the\nuser to choose if erased blocks should contain 0xFF or 0x00. The default\nis still 0xFF to remain compatible with current users.\n\nSigned-off-by: Christian Speich <c.speich@avm.de>\n---\n hw/core/machine.c |  5 +++++\n hw/sd/sd.c        | 15 +++++++++++++--\n 2 files changed, 18 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/hw/core/machine.c b/hw/core/machine.c\nindex 0aa77a57e956693208d77fea6af5853ed4904234..54e4c05c96e3cf35ab2e702ee81fba36457cadd7 100644\n--- a/hw/core/machine.c\n+++ b/hw/core/machine.c\n@@ -38,6 +38,11 @@\n #include \"hw/acpi/generic_event_device.h\"\n #include \"qemu/audio.h\"\n \n+GlobalProperty hw_compat_11_0[] = {\n+    { \"sdmmc-common\", \"erase-blocks-as-zero\", \"false\" },\n+};\n+const size_t hw_compat_11_0_len = G_N_ELEMENTS(hw_compat_11_0);\n+\n GlobalProperty hw_compat_10_2[] = {\n     { \"scsi-block\", \"migrate-pr\", \"off\" },\n     { \"isa-cirrus-vga\", \"global-vmstate\", \"true\" },\ndiff --git a/hw/sd/sd.c b/hw/sd/sd.c\nindex b27fed2e563e5971dd32787498eb8abed9ffe9be..0f997ed8cc80e38645101cb8f47c86f1c30d5a25 100644\n--- a/hw/sd/sd.c\n+++ b/hw/sd/sd.c\n@@ -162,6 +162,7 @@ struct SDState {\n     /* Static properties */\n \n     uint8_t spec_version;\n+    bool erase_blocks_as_zero;\n     uint64_t boot_part_size;\n     uint64_t rpmb_part_size;\n     BlockBackend *blk;\n@@ -439,6 +440,9 @@ static void sd_set_scr(SDState *sd)\n     sd->scr[0] |= 2;            /* Spec Version 2.00 or Version 3.0X */\n     sd->scr[1] = (2 << 4)       /* SDSC Card (Security Version 1.01) */\n                  | 0b0101;      /* 1-bit or 4-bit width bus modes */\n+    if (!sd->erase_blocks_as_zero) {\n+        sd->scr[1] |= (1 << 7); /* DATA_STAT_AFTER_ERASE: Erase produces 0xFF */\n+    }\n     sd->scr[2] = 0x00;          /* Extended Security is not supported. */\n     if (sd->spec_version >= SD_PHY_SPECv3_01_VERS) {\n         sd->scr[2] |= 1 << 7;   /* Spec Version 3.0X */\n@@ -456,7 +460,7 @@ static void sd_set_scr(SDState *sd)\n #define MID     0xaa\n #define OID     \"XY\"\n #define PNM     \"QEMU!\"\n-#define PRV     0x01\n+#define PRV     0x02\n #define MDT_YR  2006\n #define MDT_MON 2\n \n@@ -1363,7 +1367,12 @@ static void sd_erase(SDState *sd)\n     sd->erase_end = INVALID_ADDRESS;\n     sd->csd[14] |= 0x40;\n \n-    memset(sd->data, 0xff, erase_len);\n+    if (sd->erase_blocks_as_zero) {\n+        memset(sd->data, 0x0, erase_len);\n+    } else {\n+        memset(sd->data, 0xFF, erase_len);\n+    }\n+\n     for (erase_addr = erase_start; erase_addr <= erase_end;\n          erase_addr += erase_len) {\n         if (sdsc) {\n@@ -3287,6 +3296,8 @@ static void emmc_realize(DeviceState *dev, Error **errp)\n \n static const Property sdmmc_common_properties[] = {\n     DEFINE_PROP_DRIVE(\"drive\", SDState, blk),\n+    DEFINE_PROP_BOOL(\"erase-blocks-as-zero\", SDState, erase_blocks_as_zero,\n+                     true),\n };\n \n static const Property sd_properties[] = {\n",
    "prefixes": [
        "v4",
        "5/7"
    ]
}