get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196590,
    "url": "http://patchwork.ozlabs.org/api/patches/2196590/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260215112543.4817-7-mohamed@unpredictable.fr/",
    "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": "<20260215112543.4817-7-mohamed@unpredictable.fr>",
    "list_archive_url": null,
    "date": "2026-02-15T11:25:35",
    "name": "[v10,06/14] hw/arm, target/arm: nested virtualisation on HVF",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "256f6b27acadeab9242800aab7a485415544e22f",
    "submitter": {
        "id": 91318,
        "url": "http://patchwork.ozlabs.org/api/people/91318/?format=api",
        "name": "Mohamed Mediouni",
        "email": "mohamed@unpredictable.fr"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260215112543.4817-7-mohamed@unpredictable.fr/mbox/",
    "series": [
        {
            "id": 492211,
            "url": "http://patchwork.ozlabs.org/api/series/492211/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492211",
            "date": "2026-02-15T11:25:32",
            "name": "HVF: Add support for platform vGIC and nested virtualisation",
            "version": 10,
            "mbox": "http://patchwork.ozlabs.org/series/492211/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196590/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196590/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=unpredictable.fr header.i=@unpredictable.fr\n header.a=rsa-sha256 header.s=sig1 header.b=ONCs/0gZ;\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=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.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 4fDNsq50fZz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 15 Feb 2026 22:27:11 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vraGZ-0005Kv-Fc; Sun, 15 Feb 2026 06:26:19 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mohamed@unpredictable.fr>)\n id 1vraGP-0005G3-J1\n for qemu-devel@nongnu.org; Sun, 15 Feb 2026 06:26:09 -0500",
            "from p-west2-cluster1-host1-snip4-7.eps.apple.com ([57.103.68.10]\n helo=outbound.mr.icloud.com)\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mohamed@unpredictable.fr>)\n id 1vraGL-0007y8-AH\n for qemu-devel@nongnu.org; Sun, 15 Feb 2026 06:26:07 -0500",
            "from outbound.mr.icloud.com (unknown [127.0.0.2])\n by p00-icloudmta-asmtp-us-west-2a-100-percent-0 (Postfix) with ESMTPS id\n 473BE180015F; Sun, 15 Feb 2026 11:26:02 +0000 (UTC)",
            "from localhost.localdomain (unknown [17.57.152.38])\n by p00-icloudmta-asmtp-us-west-2a-100-percent-0 (Postfix) with ESMTPSA id\n C677018001B2; Sun, 15 Feb 2026 11:25:59 +0000 (UTC)"
        ],
        "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr;\n s=sig1; t=1771154763; x=1773746763;\n bh=3nUlevAU9aZys/Rjn70E+I9X5fkWyVyDKfSHQSfGsNI=;\n h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;\n b=ONCs/0gZjQLltz8mFVZWRga9o+ari5WS6oPDBbjIFtvVFBtKjyqMjqNPZCy5+aHjY6IGQevA+r/zlu0LzVs1IJRYEGPZZ6Ooi7ioDXVsLqYQTpTEezEp5Ok88fAhLFTSouMOiW61YnIZYQyrdDGqEJvKMJX642YhDRvODz+FGD01jjQ2XNgz/NWQtK09/ekClNyB6dWF+8Tyf4ICvbyB0Tu4fqjnbsXAfqSajZkqaTcDy3X7Vj32vYcetIjNgWDgxlmLsFmZIYeK9a1BJFqcHfJhPB6fMDVDlc4/Y1fFl6iMtgAEFYe0yYnhphf8Ci8WtjVJuO9hfzuXbXrTNXinmA==",
        "mail-alias-created-date": "1752046281608",
        "From": "Mohamed Mediouni <mohamed@unpredictable.fr>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "qemu-arm@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,\n Mads Ynddal <mads@ynddal.dk>, Roman Bolshakov <rbolshakov@ddn.com>,\n Phil Dennis-Jordan <phil@philjordan.eu>, Alexander Graf <agraf@csgraf.de>,\n Paolo Bonzini <pbonzini@redhat.com>, Cameron Esfahani <dirty@apple.com>,\n Mohamed Mediouni <mohamed@unpredictable.fr>",
        "Subject": "[PATCH v10 06/14] hw/arm, target/arm: nested virtualisation on HVF",
        "Date": "Sun, 15 Feb 2026 12:25:35 +0100",
        "Message-ID": "<20260215112543.4817-7-mohamed@unpredictable.fr>",
        "X-Mailer": "git-send-email 2.50.1",
        "In-Reply-To": "<20260215112543.4817-1-mohamed@unpredictable.fr>",
        "References": "<20260215112543.4817-1-mohamed@unpredictable.fr>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Authority-Info-Out": "v=2.4 cv=aJn9aL9m c=1 sm=1 tr=0 ts=6991ad4b\n cx=c_apl:c_apl_out:c_pps a=9OgfyREA4BUYbbCgc0Y0oA==:117\n a=9OgfyREA4BUYbbCgc0Y0oA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22\n a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=YLAFOksV-_wk3IE7wuMA:9",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjE1MDA5MiBTYWx0ZWRfX3EltvrqgJIFH\n 1EYvQxI+kNA5FObBgs4mdh1rJRYFMdIBjf9TmyluYVyjHXyttyZ4FiZuuBzPq+6cGb9Cher4BOx\n hKGgohrDjDI/Kj0fH9b0oB0ASDOdZDULvcfUDkuSwW/E3bgBseJwAFvuvTrbnn2ucSKBtQr67Fh\n JhVTtQRgjo9lAzVS/sCqCsPJW/8YitRACRlnwdx+AbBiokpc5jzov5VWL6vrbOqy1H5a8Tcz0LW\n CFyBDuimz5lou1zyOvQf2diYv4ADu1xp3Hpv+sZ34Q7o7WhJZh1nUrtJDJ9wxoKPehaYMZl/A79\n ExORExENmjcaxu0SmVnaloJ59rVttVo4J9hKp7sX7wC7k70Gh6sjWgLGpMDiJs=",
        "X-Proofpoint-ORIG-GUID": "7LFd_F6Xj-Jxc_CK5SA1KwYP8CTXUv8a",
        "X-Proofpoint-GUID": "7LFd_F6Xj-Jxc_CK5SA1KwYP8CTXUv8a",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-02-15_04,2026-02-13_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 adultscore=0\n suspectscore=0 mlxlogscore=807 bulkscore=0 mlxscore=0 phishscore=0\n lowpriorityscore=0 clxscore=1030 malwarescore=0 spamscore=0 classifier=spam\n authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000\n definitions=main-2602150092",
        "X-JNJ": "\n AAAAAAABmSRyAYUMXlvjeppp2ENdGariwReMXE/2I4BuxRKjFklPDS9EyaIrJ7dEwGmuKGVJLxLESwh0C6IPbuc4Ar5rhYKFG56Abr5sO36mJelFY0kDL39NqUG6Y901fQhqRDEdwBBC86kO/VgJHticjt6SA+V1FkNQXli8t1s22f9r9ajjBFx4KQOJlnyykRI/OChNXdUx3HgwKiDPbogqCprlxEVxUp+zMSQXvmCycw5GXABBhHu+s8KPCjyl83OCQMQU80tsdyfECHW/uhuXqi5A2yD6XGgEXZRustq/WGNLR3ACVM6FM5U5wiwpTTdf4ExuvWSfVB20wDHnVLO6wCdZYaTVbaa43cfPuIQ3AFbCBC6hRQDPms9ovVF0ZrErLoX1tvPDd/E2xBXgmMvT2gbpaW6M07UpLArS/RPr3Vl5rIb0pYry2btpVMmGmOrlTgU4YmKCXAiXCa/yyuGocL8BCxSLGM2vrmkVoNEEaljHFJjp5C0m9eOnzTmYBtiMV3PXr/ywIMOUSfxZJTtEZwM9LrAkZJTvT823Q559Bw/sKEEI2kChmvAT8DCNqZJDlVtPPSdzXZJYJWwT1qxftDoE56L9Sry+/mzdyn/NOlkOWJdAbpWm54U+rs0lYrJvBY09oEQQ+PGvDPRJMF2q4hwZv1JohglfgtSY2sRffB6WVnFFevrYHuY6lFxAUW/ICZLIlg==",
        "Received-SPF": "pass client-ip=57.103.68.10;\n envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-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": "Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\n---\n accel/hvf/hvf-all.c    |  1 +\n accel/stubs/hvf-stub.c |  1 +\n hw/arm/virt.c          |  5 +++++\n include/system/hvf.h   |  5 +++++\n target/arm/hvf/hvf.c   | 36 ++++++++++++++++++++++++++++++++++--\n 5 files changed, 46 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c\nindex 929f53fd37..88f6d5accb 100644\n--- a/accel/hvf/hvf-all.c\n+++ b/accel/hvf/hvf-all.c\n@@ -25,6 +25,7 @@\n \n bool hvf_allowed;\n bool hvf_kernel_irqchip;\n+bool hvf_nested_virt;\n \n const char *hvf_return_string(hv_return_t ret)\n {\ndiff --git a/accel/stubs/hvf-stub.c b/accel/stubs/hvf-stub.c\nindex 6bd08759ba..cec1cbb056 100644\n--- a/accel/stubs/hvf-stub.c\n+++ b/accel/stubs/hvf-stub.c\n@@ -11,3 +11,4 @@\n \n bool hvf_allowed;\n bool hvf_kernel_irqchip;\n+bool hvf_nested_virt;\ndiff --git a/hw/arm/virt.c b/hw/arm/virt.c\nindex 391d5e6f76..071b082786 100644\n--- a/hw/arm/virt.c\n+++ b/hw/arm/virt.c\n@@ -2662,6 +2662,11 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)\n     VirtMachineState *vms = VIRT_MACHINE(obj);\n \n     vms->virt = value;\n+    /*\n+     * At this point, HVF is not initialised yet.\n+     * However, it needs to know if nested virt is enabled at init time.\n+     */\n+    hvf_nested_virt_enable(value);\n }\n \n static bool virt_get_highmem(Object *obj, Error **errp)\ndiff --git a/include/system/hvf.h b/include/system/hvf.h\nindex dc8da85979..0f0632f7ae 100644\n--- a/include/system/hvf.h\n+++ b/include/system/hvf.h\n@@ -28,9 +28,14 @@ extern bool hvf_allowed;\n #define hvf_enabled() (hvf_allowed)\n extern bool hvf_kernel_irqchip;\n #define hvf_irqchip_in_kernel()  (hvf_kernel_irqchip)\n+extern bool hvf_nested_virt;\n+#define hvf_nested_virt_enabled()  (hvf_nested_virt)\n+#define hvf_nested_virt_enable(enable) hvf_nested_virt = enable\n #else /* !CONFIG_HVF_IS_POSSIBLE */\n #define hvf_enabled() 0\n #define hvf_irqchip_in_kernel() 0\n+#define hvf_nested_virt_enabled() 0\n+#define hvf_nested_virt_enable(enable) 0\n #endif /* !CONFIG_HVF_IS_POSSIBLE */\n \n #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME(\"hvf\")\ndiff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c\nindex a22b544afe..a80c5f8384 100644\n--- a/target/arm/hvf/hvf.c\n+++ b/target/arm/hvf/hvf.c\n@@ -27,6 +27,7 @@\n #include \"system/memory.h\"\n #include \"hw/core/boards.h\"\n #include \"hw/core/irq.h\"\n+#include \"hw/arm/virt.h\"\n #include \"qemu/main-loop.h\"\n #include \"system/cpus.h\"\n #include \"arm-powerctl.h\"\n@@ -842,6 +843,10 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)\n                      (1ULL << ARM_FEATURE_PMU) |\n                      (1ULL << ARM_FEATURE_GENERIC_TIMER);\n \n+    if (hvf_nested_virt_enabled()) {\n+        ahcf->features |= 1ULL << ARM_FEATURE_EL2;\n+    }\n+\n     for (i = 0; i < ARRAY_SIZE(regs); i++) {\n         r |= hv_vcpu_config_get_feature_reg(config, regs[i].reg,\n                                             &host_isar.idregs[regs[i].index]);\n@@ -949,6 +954,15 @@ void hvf_arch_vcpu_destroy(CPUState *cpu)\n     assert_hvf_ok(ret);\n }\n \n+static bool hvf_arm_el2_supported(void)\n+{\n+    bool is_nested_virt_supported;\n+    hv_return_t ret = hv_vm_config_get_el2_supported(&is_nested_virt_supported);\n+    assert_hvf_ok(ret);\n+    return is_nested_virt_supported;\n+}\n+\n+\n hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range)\n {\n     hv_return_t ret;\n@@ -960,6 +974,18 @@ hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range)\n     }\n     chosen_ipa_bit_size = pa_range;\n \n+    if (hvf_nested_virt_enabled()) {\n+        if (!hvf_arm_el2_supported()) {\n+            error_report(\"Nested virtualization not supported on this system.\");\n+            goto cleanup;\n+        }\n+        ret = hv_vm_config_set_el2_enabled(config, true);\n+        if (ret != HV_SUCCESS) {\n+            error_report(\"Failed to enable nested virtualization.\");\n+            goto cleanup;\n+        }\n+    }\n+\n     ret = hv_vm_create(config);\n     if (hvf_irqchip_in_kernel()) {\n         /*\n@@ -1110,6 +1136,13 @@ static void hvf_psci_cpu_off(ARMCPU *arm_cpu)\n     assert(ret == QEMU_ARM_POWERCTL_RET_SUCCESS);\n }\n \n+static int hvf_psci_get_target_el(void)\n+{\n+    if (hvf_nested_virt_enabled()) {\n+        return 2;\n+    }\n+    return 1;\n+}\n /*\n  * Handle a PSCI call.\n  *\n@@ -1131,7 +1164,6 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)\n     CPUState *target_cpu_state;\n     ARMCPU *target_cpu;\n     target_ulong entry;\n-    int target_el = 1;\n     int32_t ret = 0;\n \n     trace_arm_psci_call(param[0], param[1], param[2], param[3],\n@@ -1185,7 +1217,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)\n         entry = param[2];\n         context_id = param[3];\n         ret = arm_set_cpu_on(mpidr, entry, context_id,\n-                             target_el, target_aarch64);\n+                             hvf_psci_get_target_el(), target_aarch64);\n         break;\n     case QEMU_PSCI_0_1_FN_CPU_OFF:\n     case QEMU_PSCI_0_2_FN_CPU_OFF:\n",
    "prefixes": [
        "v10",
        "06/14"
    ]
}