get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2224042,
    "url": "http://patchwork.ozlabs.org/api/patches/2224042/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260416165353.589569-3-peter.maydell@linaro.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/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": "<20260416165353.589569-3-peter.maydell@linaro.org>",
    "list_archive_url": null,
    "date": "2026-04-16T16:53:52",
    "name": "[v2,2/3] target/arm: Allow 'aarch64=off' to be set for TCG CPUs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a8ecbc59ec555ef67bd9fc425c8161ec4a7bbff6",
    "submitter": {
        "id": 5111,
        "url": "http://patchwork.ozlabs.org/api/people/5111/?format=api",
        "name": "Peter Maydell",
        "email": "peter.maydell@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260416165353.589569-3-peter.maydell@linaro.org/mbox/",
    "series": [
        {
            "id": 500186,
            "url": "http://patchwork.ozlabs.org/api/series/500186/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500186",
            "date": "2026-04-16T16:53:52",
            "name": null,
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/500186/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224042/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224042/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 (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=Oirh1zMy;\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 4fxPJP4M3Dz1yHP\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 02:55:00 +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 1wDPyi-0006Ay-Kh; Thu, 16 Apr 2026 12:54:08 -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 <peter.maydell@linaro.org>)\n id 1wDPyh-0006A7-30\n for qemu-devel@nongnu.org; Thu, 16 Apr 2026 12:54:07 -0400",
            "from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1wDPyf-0007ou-7Z\n for qemu-devel@nongnu.org; Thu, 16 Apr 2026 12:54:06 -0400",
            "by mail-wm1-x32a.google.com with SMTP id\n 5b1f17b1804b1-488ba840146so81567965e9.1\n for <qemu-devel@nongnu.org>; Thu, 16 Apr 2026 09:54:04 -0700 (PDT)",
            "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488fa79d476sm473035e9.1.2026.04.16.09.54.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 16 Apr 2026 09:54:01 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1776358443; x=1776963243; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=CxoE2sQDfNJcl7sNbi2G1nRN3fSKrRDunzLrpBK4/AE=;\n b=Oirh1zMyfH4drx6HVEBfPNQWOrUMGP1xxYNGXtRQT39JBCQqGM5oZg9KoTQHDGkApY\n vIrxu8fxwPruZ9y0v6faOh+oVAAqdhI4J8gVXaQfzaKxKWdqXac/qNd5EAGAh4i+6t7n\n RHHd44Gd52Ns77ofBfBPykXrnavZdDmwPVjmDml7Rv2qTd0n9r4JS5RODHdvl26pSBQp\n ZISe1LLcgPdpdWuchE4uYsWM68qBRn6L9dafFg59uGt0lFeUdIwgzN68tYCk6frQIU42\n zfUTyHyrTsOBakRZcyKcDG7OTjokNcI7UlDOptIm3/XDWAMWUzWTDza8x/jrtBdXFwu1\n Iq0g==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776358443; x=1776963243;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=CxoE2sQDfNJcl7sNbi2G1nRN3fSKrRDunzLrpBK4/AE=;\n b=SXJw5axpyfCdwMvdrwoFiU93WJAYekEQ/7Ia2E5Zr85CGeErT2PTCZuuF7NagjFd6u\n UO/THB+W7q9+/Bn9/hy+76EH96W8KliiZ6ipx9sCmh1vSNEz43DcveVMAhHLMhSArb04\n H9Vd5XYN5uPtLpylNcLaE4LU1fAffNH1ZLfnNHlR20pJ99/axOfMMeOoWVYujCh/7kvL\n dsApllBECtv6H9+yRSUpIWZ/R364Tqciag3Cg9DoxL6R0UulqYNk7w3H19uEQKNF4yiE\n MuF03POLaO0fVPGGkb6SqYmFWMkytM4iGTKeTADSxzG1HVUWxdlnkF6ZyG09emOqvxxb\n vLnw==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ+AwaKyZQ+dhAdWxT80nN9FMHlvEkAIp0nPjLN5njKTsMBFjrpXAEzF0h2zj7L2p1Ep/pwEv9qAEj74@nongnu.org",
        "X-Gm-Message-State": "AOJu0Yx3Yxp4W5YdpinIMY0CVn9+GpCFG/ZsNDfmB3DsSmDhGs0gkfWe\n l6CAWZpqqyGCxtXxGyFmsg39vioCQIlfW2wrNyCkz6NlXnFtoVuTo0hfQpG1IQfUXPc=",
        "X-Gm-Gg": "AeBDiesgpj4vfEy1cIW9hqUjXJwH+qO9T+KMgLpcbcn129XEM7K6rArqWL0TEDmh312\n biyX4t+Qi+adHHGqjfotqX8Y0FwORidd8pzXMcDWb5XJCeeN+7PgIzH/gQsAX84ECS/3PxfKG/U\n FxlNDlilRxm9rbT8hiP8Omxglyewh4sjlRoSbmf91p6oGL1ZIKdwfIJU0sa3QOpRCPiVm0fJX3S\n grFvnvvOO0V24BK/AyTCxEuLMrHWI5wVDaJZdGdDv8ORKKH7QrFDDjHxwRv6EH5WitDSeNGVoAz\n j9Xy5ZIaSxT76hTa9EtS8kpQQQNAMPmgZheNPByp2TbeyHNSmJ4/GssE2WQA2KehloijWlkr6nZ\n FqDF76+ZXJOVAv9AhxIf9EfE3GQNkdKHRXYklOZx7+FahHTYHObORupWqObt2rq9jEQ87/p6N9B\n 3tquv38yCidkLOp259wzVcsnGYPrrLUVDWRQeYE/ej0S556UkZlYqseHACIkiR1aThCtMOh2jW1\n i5jboh9T7QJrua3FIlBjm8TlhdSiaEu1YZbKbPaVQ==",
        "X-Received": "by 2002:a05:600c:4fcb:b0:488:c120:480a with SMTP id\n 5b1f17b1804b1-488d6891181mr380899715e9.31.1776358443389;\n Thu, 16 Apr 2026 09:54:03 -0700 (PDT)",
        "From": "Peter Maydell <peter.maydell@linaro.org>",
        "To": "qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org",
        "Cc": "Richard Henderson <richard.henderson@linaro.org>, =?utf-8?q?Cl=C3=A9ment?=\n\t=?utf-8?q?_Chigot?= <chigot@adacore.com>",
        "Subject": "[PATCH v2 2/3] target/arm: Allow 'aarch64=off' to be set for TCG CPUs",
        "Date": "Thu, 16 Apr 2026 17:53:52 +0100",
        "Message-ID": "<20260416165353.589569-3-peter.maydell@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260416165353.589569-1-peter.maydell@linaro.org>",
        "References": "<20260416165353.589569-1-peter.maydell@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::32a;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable 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": "Allow the 'aarch64=off' property, which is currently KVM-only, to\nbe set for TCG CPUs also.\n\nNote that we don't permit it on the qemu-aarch64 user-mode binary:\nthis makes no sense as that executable can only handle AArch64\nsyscalls (and it would also assert at startup since it doesn't\ncompile in the A32-specific GDB xml files like arm-neon.xml).\n\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nTested-by: Clément Chigot <chigot@adacore.com>\n---\nv1->v2: slight tweak to the docs wording\n---\n docs/system/arm/cpu-features.rst | 10 +++++----\n target/arm/cpu-features.h        |  5 +++++\n target/arm/cpu.c                 | 36 ++++++++++++++++++++++++++++----\n tests/qtest/arm-cpu-features.c   |  8 ++-----\n 4 files changed, 45 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst\nindex ce19ae6a04..10b0eff27e 100644\n--- a/docs/system/arm/cpu-features.rst\n+++ b/docs/system/arm/cpu-features.rst\n@@ -23,10 +23,12 @@ not implement ARMv8-A, will not have the ``aarch64`` CPU property.\n QEMU's support may be limited for some CPU features, only partially\n supporting the feature or only supporting the feature under certain\n configurations.  For example, the ``aarch64`` CPU feature, which, when\n-disabled, enables the optional AArch32 CPU feature, is only supported\n-when using the KVM accelerator and when running on a host CPU type that\n-supports the feature.  While ``aarch64`` currently only works with KVM,\n-it could work with TCG.  CPU features that are specific to KVM are\n+disabled, enables the optional AArch32 CPU feature, can only be set to\n+``off`` on the TCG and KVM accelerators, and it cannot be set to\n+``off`` under KVM unless running on a host CPU type that supports\n+running guests in AArch32.\n+\n+CPU features that are inherently specific to KVM are\n prefixed with \"kvm-\" and are described in \"KVM VCPU Features\".\n \n CPU Feature Probing\ndiff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h\nindex b683c9551a..6e5212ff6c 100644\n--- a/target/arm/cpu-features.h\n+++ b/target/arm/cpu-features.h\n@@ -1071,6 +1071,11 @@ static inline bool isar_feature_aa64_aa32_el2(const ARMISARegisters *id)\n     return FIELD_EX64_IDREG(id, ID_AA64PFR0, EL2) >= 2;\n }\n \n+static inline bool isar_feature_aa64_aa32_el3(const ARMISARegisters *id)\n+{\n+    return FIELD_EX64_IDREG(id, ID_AA64PFR0, EL3) >= 2;\n+}\n+\n static inline bool isar_feature_aa64_ras(const ARMISARegisters *id)\n {\n     return FIELD_EX64_IDREG(id, ID_AA64PFR0, RAS) != 0;\ndiff --git a/target/arm/cpu.c b/target/arm/cpu.c\nindex 11d3437843..347616fa5a 100644\n--- a/target/arm/cpu.c\n+++ b/target/arm/cpu.c\n@@ -1248,10 +1248,38 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool value, Error **errp)\n      * uniform execution state like do_interrupt.\n      */\n     if (value == false) {\n-        if (!kvm_enabled() || !kvm_arm_aarch32_supported()) {\n-            error_setg(errp, \"'aarch64' feature cannot be disabled \"\n-                             \"unless KVM is enabled and 32-bit EL1 \"\n-                             \"is supported\");\n+        if (kvm_enabled()) {\n+            if (!kvm_arm_aarch32_supported()) {\n+                error_setg(errp, \"'aarch64' feature cannot be disabled for KVM \"\n+                           \"because this host does not support 32-bit EL1\");\n+                return;\n+            }\n+        } else if (tcg_enabled()) {\n+#ifdef CONFIG_USER_ONLY\n+            error_setg(errp, \"'aarch64' feature cannot be disabled for \"\n+                       \"usermode emulator qemu-aarch64; use qemu-arm instead\");\n+            return;\n+#else\n+            bool aa32_at_highest_el;\n+            if (arm_feature(&cpu->env, ARM_FEATURE_EL3)) {\n+                aa32_at_highest_el = cpu_isar_feature(aa64_aa32_el3, cpu);\n+            } else if (arm_feature(&cpu->env, ARM_FEATURE_EL2)) {\n+                aa32_at_highest_el = cpu_isar_feature(aa64_aa32_el2, cpu);\n+            } else {\n+                aa32_at_highest_el = cpu_isar_feature(aa64_aa32_el1, cpu);\n+            }\n+\n+            if (!aa32_at_highest_el) {\n+                error_setg(errp, \"'aarch64' feature cannot be disabled for \"\n+                           \"this TCG CPU because it does not support 32-bit \"\n+                           \"execution at its highest implemented exception \"\n+                           \"level\");\n+                return;\n+            }\n+#endif\n+        } else {\n+            error_setg(errp, \"'aarch64' feature cannot be disabled for \"\n+                       \"this accelerator\");\n             return;\n         }\n         unset_feature(&cpu->env, ARM_FEATURE_AARCH64);\ndiff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c\nindex bbdd89a81d..cb4d01fd46 100644\n--- a/tests/qtest/arm-cpu-features.c\n+++ b/tests/qtest/arm-cpu-features.c\n@@ -493,12 +493,8 @@ static void test_query_cpu_model_expansion(const void *data)\n         sve_tests_default(qts, \"max\");\n         pauth_tests_default(qts, \"max\");\n \n-        /* Test that features that depend on KVM generate errors without. */\n-        assert_error(qts, \"max\",\n-                     \"'aarch64' feature cannot be disabled \"\n-                     \"unless KVM is enabled and 32-bit EL1 \"\n-                     \"is supported\",\n-                     \"{ 'aarch64': false }\");\n+        /* TCG allows us to turn off AArch64 on the 'max' CPU type */\n+        assert_set_feature(qts, \"max\", \"aarch64\", false);\n     }\n \n     qtest_quit(qts);\n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}