Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195657/?format=api
{ "id": 2195657, "url": "http://patchwork.ozlabs.org/api/patches/2195657/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260211153032.19327-3-sebott@redhat.com/", "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": "<20260211153032.19327-3-sebott@redhat.com>", "list_archive_url": null, "date": "2026-02-11T15:30:32", "name": "[v5,2/2] target/arm/kvm: add kvm-psci-version vcpu property", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b67d25fbdd82cd6703dfd6dce75f3475f2bdf75e", "submitter": { "id": 86446, "url": "http://patchwork.ozlabs.org/api/people/86446/?format=api", "name": "Sebastian Ott", "email": "sebott@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260211153032.19327-3-sebott@redhat.com/mbox/", "series": [ { "id": 491863, "url": "http://patchwork.ozlabs.org/api/series/491863/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491863", "date": "2026-02-11T15:30:31", "name": "arm: add kvm-psci-version vcpu property", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/491863/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195657/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195657/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=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=DhANDHcR;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=qxNSZeMy;\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 4fB2VG5q88z1xx7\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 02:32:06 +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 1vqCBK-0007LL-PM; Wed, 11 Feb 2026 10:31:10 -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 <sebott@redhat.com>) id 1vqCBH-0007KE-41\n for qemu-devel@nongnu.org; Wed, 11 Feb 2026 10:31:07 -0500", "from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <sebott@redhat.com>) id 1vqCBF-0008BB-DV\n for qemu-devel@nongnu.org; Wed, 11 Feb 2026 10:31:06 -0500", "from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-608-zcy5oeLQND-MeMkzb8lSxg-1; Wed, 11 Feb 2026 10:31:03 -0500", "by mail-wm1-f72.google.com with SMTP id\n 5b1f17b1804b1-4801c1056c7so13181185e9.2\n for <qemu-devel@nongnu.org>; Wed, 11 Feb 2026 07:31:03 -0800 (PST)", "from rh.fritz.box\n (p200300f6af2d8700b4c2d356c3fafe63.dip0.t-ipconnect.de.\n [2003:f6:af2d:8700:b4c2:d356:c3fa:fe63])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43783d34657sm6448511f8f.6.2026.02.11.07.31.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 11 Feb 2026 07:31:00 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770823864;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=KgZLxYej2+Jm/2mAtMCoJI/wRP+Se5cFtNVR14mJ03o=;\n b=DhANDHcRXKNAhk1zfPyKPsBAVJN+dj5Y1b2l+JLcy7wTmTr9tBFywwKzmLE+RwsReP3Vo+\n +yJUrW51LAbujNfZgRQxIh1BFDgRsN2/jPK2R0zpKthPcx/pFJzfaBRct4bBJY9WD7ks0U\n l+ngbRNG3nYvi99F10kbsq8B9WZr1uY=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1770823862; x=1771428662; 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=KgZLxYej2+Jm/2mAtMCoJI/wRP+Se5cFtNVR14mJ03o=;\n b=qxNSZeMy2Xa+snOgS1c+/Ne31i7lbW/YnPv93gZ7IWPWClQtSoIrg1juy0reSNS0o4\n +WIff21KjqQ9mgX+h5PNVFTtiirsoFufnphEmzNtfc5VMDIQj1tPQZGF8hcPy4aKtJCm\n 8/xl7gdsQviKDM8fjsUrGk+lUTXZYhObZMqjYIl46ITVO/FfK9qG5QFPHrsmevIpc+zl\n yPHi2Gv8Xu8a3G3jtSao7686sLvzxV5pGYHxAsnMIsDi8UXnlh3NVDEYF/f5Cqz7Jbm7\n b0DcLSpJiKMmiPhfPnmqI01PeWiwaU3xH1xXf3xeY9CDsLpb6CKo31GtbXGqFC1tt8d9\n zFMQ==" ], "X-MC-Unique": "zcy5oeLQND-MeMkzb8lSxg-1", "X-Mimecast-MFC-AGG-ID": "zcy5oeLQND-MeMkzb8lSxg_1770823862", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770823862; x=1771428662;\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=KgZLxYej2+Jm/2mAtMCoJI/wRP+Se5cFtNVR14mJ03o=;\n b=K3CcSda8FVV963jxywHCPz5CqUFXzUBJhIFtcEThFtHp3o9cyWoEQNBP2wF4roZ3Ai\n R8LBfXP7r1aCCID4mOwySIvms1jGhbMFfPCBPu7eLqau+7Dzo5KEVc8wRyNI/0sIUUhQ\n WpBzdHo9NOTx3r0t9b4GF7yHAUqHps3hqae2YJMAIzNcIq6G47eU+FYKqisZEfO1+VCp\n lRa/zK7q70J/cGZEIjWlJ0sSsJXZKOJIjnwudMCEHaP9qJU5FWHlpXXZDDz/XAZbOLNt\n UZ0Jgwlpol/QRFRJTD1AcDXrzcbxORdAxZy+MF6ZBo600nZF7TpbBaAczcR/dkNgu+2J\n 6/pg==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCXGR4pn8SZuUzmuf5RE8k+HucIczMGeZW18DPhrMvQyOA+VFrGpkduxytW7n4D4cJH+rDV78cv3LKOH@nongnu.org", "X-Gm-Message-State": "AOJu0YylzJ7Ko2a/pNFQ+qGvY9zzdjxcR4/ceDS57YqqBy5jLC6bIJ95\n rFwUCOgJIQiTCtfDZfb05QSA6cSzXxy+Cyt3fdazekHQzskGLm66d6oE3ledpj/+3ivzA+TEHct\n pGflwoHVVQV6xQv2Ms/afyODybqZq3X8SKU2DE1zevk7XuIoEP96YHBbB", "X-Gm-Gg": "AZuq6aJ+6L9m1ImUOu17AFdFwBDkgZYpMA0387UkRN1RJrYMLXewe15NembctsTgzXQ\n rw9WmV0bQM94oHtfdC00vt1sCUhNL7Ygtq52/cR4uEr/PkdzzOnhUboS/6XbUpW2eCZ7ceuQaxS\n 8Xxihp6m7FqkqlJKs3jWDUOgB6cfYeBRGa7Jj5xJHed1x7IBcLPJW/HXL3PNT5fsRIwVNltjWue\n dLvcFKnoHYcwL9Z+Wy0a3HkAlr9N9K6zW+2EG1Gmhke8ZAB+qoGq8vHOpHLbuP8StMp7Gi2PKIV\n x2s1tRFECN6GvdRRNlmNZDSz1wmHpEwxl8Luz8OrjNLx0y5lkPBryFoRBruIsNycdVrrkTzzDSl\n ltHO08GWPSviEfpTUxWhFl87lCosQ0eG1JQjPN3cMepu3MMJZuqTx8456BvTtUqIk9J28QRgA91\n xJ4NoOQt1N", "X-Received": [ "by 2002:a05:600c:c16d:b0:480:4a90:1b00 with SMTP id\n 5b1f17b1804b1-4832021605bmr226049955e9.20.1770823861888;\n Wed, 11 Feb 2026 07:31:01 -0800 (PST)", "by 2002:a05:600c:c16d:b0:480:4a90:1b00 with SMTP id\n 5b1f17b1804b1-4832021605bmr226049465e9.20.1770823861415;\n Wed, 11 Feb 2026 07:31:01 -0800 (PST)" ], "From": "Sebastian Ott <sebott@redhat.com>", "To": "Peter Maydell <peter.maydell@linaro.org>,\n Paolo Bonzini <pbonzini@redhat.com>, Eric Auger <eric.auger@redhat.com>", "Cc": "qemu-arm@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org,\n kvmarm@lists.linux.dev, Sebastian Ott <sebott@redhat.com>", "Subject": "[PATCH v5 2/2] target/arm/kvm: add kvm-psci-version vcpu property", "Date": "Wed, 11 Feb 2026 16:30:32 +0100", "Message-ID": "<20260211153032.19327-3-sebott@redhat.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260211153032.19327-1-sebott@redhat.com>", "References": "<20260211153032.19327-1-sebott@redhat.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=170.10.133.124; envelope-from=sebott@redhat.com;\n helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, 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": "Provide a kvm specific vcpu property to override the default\n(as of kernel v6.13 that would be PSCI v1.3) PSCI version emulated\nby kvm. Current valid values are: 0.1, 0.2, 1.0, 1.1, 1.2, and 1.3\n\nNote: in order to support PSCI v0.1 we need to drop vcpu\ninitialization with KVM_CAP_ARM_PSCI_0_2 in that case.\n\nReviewed-by: Eric Auger <eric.auger@redhat.com>\nTested-by: Eric Auger <eric.auger@redhat.com>\nSigned-off-by: Sebastian Ott <sebott@redhat.com>\n---\n docs/system/arm/cpu-features.rst | 11 ++++++\n target/arm/cpu.h | 6 +++\n target/arm/kvm.c | 65 +++++++++++++++++++++++++++++++-\n 3 files changed, 81 insertions(+), 1 deletion(-)", "diff": "diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst\nindex 37d5dfd15b..50b106f2eb 100644\n--- a/docs/system/arm/cpu-features.rst\n+++ b/docs/system/arm/cpu-features.rst\n@@ -204,6 +204,17 @@ the list of KVM VCPU features and their descriptions.\n the guest scheduler behavior and/or be exposed to the guest\n userspace.\n \n+``kvm-psci-version``\n+ Set the Power State Coordination Interface (PSCI) firmware ABI version\n+ that KVM provides to the guest. By default KVM will use the newest\n+ version that it knows about (which is PSCI v1.3 in Linux v6.13).\n+\n+ You only need to set this if you want to be able to migrate this\n+ VM to a host machine running an older kernel that does not\n+ recognize the PSCI version that this host's kernel defaults to.\n+\n+ Current valid values are: 0.1, 0.2, 1.0, 1.1, 1.2, and 1.3.\n+\n TCG VCPU Features\n =================\n \ndiff --git a/target/arm/cpu.h b/target/arm/cpu.h\nindex e146f7e6c4..d3cfd444e8 100644\n--- a/target/arm/cpu.h\n+++ b/target/arm/cpu.h\n@@ -1036,6 +1036,12 @@ struct ArchCPU {\n bool kvm_vtime_dirty;\n uint64_t kvm_vtime;\n \n+ /*\n+ * Intermediate value used during property parsing.\n+ * Once finalized, the value should be read from psci_version.\n+ */\n+ uint32_t kvm_prop_psci_version;\n+\n /* KVM steal time */\n OnOffAuto kvm_steal_time;\n \ndiff --git a/target/arm/kvm.c b/target/arm/kvm.c\nindex ded582e0da..6d13cb4f3c 100644\n--- a/target/arm/kvm.c\n+++ b/target/arm/kvm.c\n@@ -485,6 +485,46 @@ static void kvm_steal_time_set(Object *obj, bool value, Error **errp)\n ARM_CPU(obj)->kvm_steal_time = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF;\n }\n \n+typedef struct PSCIVersion {\n+ uint32_t number;\n+ const char *str;\n+} PSCIVersion;\n+\n+static const PSCIVersion psci_versions[] = {\n+ { QEMU_PSCI_VERSION_0_1, \"0.1\" },\n+ { QEMU_PSCI_VERSION_0_2, \"0.2\" },\n+ { QEMU_PSCI_VERSION_1_0, \"1.0\" },\n+ { QEMU_PSCI_VERSION_1_1, \"1.1\" },\n+ { QEMU_PSCI_VERSION_1_2, \"1.2\" },\n+ { QEMU_PSCI_VERSION_1_3, \"1.3\" },\n+};\n+\n+static char *kvm_get_psci_version(Object *obj, Error **errp)\n+{\n+ ARMCPU *cpu = ARM_CPU(obj);\n+\n+ for (int i = 0; i < ARRAY_SIZE(psci_versions); i++) {\n+ if (psci_versions[i].number == cpu->psci_version)\n+ return g_strdup(psci_versions[i].str);\n+ }\n+\n+ return g_strdup_printf(\"Unknown PSCI-version: %x\", cpu->psci_version);\n+}\n+\n+static void kvm_set_psci_version(Object *obj, const char *value, Error **errp)\n+{\n+ ARMCPU *cpu = ARM_CPU(obj);\n+\n+ for (int i = 0; i < ARRAY_SIZE(psci_versions); i++) {\n+ if (!strcmp(value, psci_versions[i].str)) {\n+ cpu->kvm_prop_psci_version = psci_versions[i].number;\n+ return;\n+ }\n+ }\n+\n+ error_setg(errp, \"Invalid PSCI version.\");\n+}\n+\n /* KVM VCPU properties should be prefixed with \"kvm-\". */\n void kvm_arm_add_vcpu_properties(ARMCPU *cpu)\n {\n@@ -506,6 +546,12 @@ void kvm_arm_add_vcpu_properties(ARMCPU *cpu)\n kvm_steal_time_set);\n object_property_set_description(obj, \"kvm-steal-time\",\n \"Set off to disable KVM steal time.\");\n+\n+ object_property_add_str(obj, \"kvm-psci-version\", kvm_get_psci_version,\n+ kvm_set_psci_version);\n+ object_property_set_description(obj, \"kvm-psci-version\",\n+ \"Set PSCI version. \"\n+ \"Valid values are 0.1, 0.2, 1.0, 1.1, 1.2, 1.3\");\n }\n \n bool kvm_arm_pmu_supported(void)\n@@ -1976,7 +2022,12 @@ int kvm_arch_init_vcpu(CPUState *cs)\n if (cs->start_powered_off) {\n cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;\n }\n- if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {\n+ if (cpu->kvm_prop_psci_version != QEMU_PSCI_VERSION_0_1 &&\n+ kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {\n+ /*\n+ * Versions >= v0.2 are backward compatible with v0.2\n+ * omit the feature flag for v0.1 .\n+ */\n cpu->psci_version = QEMU_PSCI_VERSION_0_2;\n cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;\n }\n@@ -2015,6 +2066,18 @@ int kvm_arch_init_vcpu(CPUState *cs)\n }\n }\n \n+ if (cpu->kvm_prop_psci_version) {\n+ psciver = cpu->kvm_prop_psci_version;\n+ ret = kvm_set_one_reg(cs, KVM_REG_ARM_PSCI_VERSION, &psciver);\n+ if (ret) {\n+ error_report(\"KVM in this kernel does not support PSCI version %d.%d\",\n+ (int) PSCI_VERSION_MAJOR(psciver),\n+ (int) PSCI_VERSION_MINOR(psciver));\n+ error_printf(\"Consider setting the kvm-psci-version property on the \"\n+ \"migration source.\\n\");\n+ return ret;\n+ }\n+ }\n /*\n * KVM reports the exact PSCI version it is implementing via a\n * special sysreg. If it is present, use its contents to determine\n", "prefixes": [ "v5", "2/2" ] }