Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196571/?format=api
{ "id": 2196571, "url": "http://patchwork.ozlabs.org/api/patches/2196571/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260215052225.22513-9-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": "<20260215052225.22513-9-mohamed@unpredictable.fr>", "list_archive_url": null, "date": "2026-02-15T05:22:19", "name": "[v3,08/14] whpx: move whpx_get_reg/whpx_set_reg to generic code", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7ba7748f97b104d3fc4d564b2cd1300fe9eee106", "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/20260215052225.22513-9-mohamed@unpredictable.fr/mbox/", "series": [ { "id": 492201, "url": "http://patchwork.ozlabs.org/api/series/492201/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492201", "date": "2026-02-15T05:22:12", "name": "whpx: x86 updates (2026-02)", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/492201/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196571/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196571/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=OdWebKcu;\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 4fDDqr06dZz1xwj\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 15 Feb 2026 16:24:56 +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 1vrUb3-0000ON-L0; Sun, 15 Feb 2026 00:23:05 -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 1vrUb2-0000O5-A8\n for qemu-devel@nongnu.org; Sun, 15 Feb 2026 00:23:04 -0500", "from p-west2-cluster2-host8-snip4-10.eps.apple.com ([57.103.68.141]\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 1vrUb0-0004tE-Jp\n for qemu-devel@nongnu.org; Sun, 15 Feb 2026 00:23:03 -0500", "from outbound.mr.icloud.com (unknown [127.0.0.2])\n by p00-icloudmta-asmtp-us-west-2a-60-percent-1 (Postfix) with ESMTPS id\n 6C6AB18006A4; Sun, 15 Feb 2026 05:23:00 +0000 (UTC)", "from localhost.localdomain (unknown [17.57.152.38])\n by p00-icloudmta-asmtp-us-west-2a-60-percent-1 (Postfix) with ESMTPSA id\n 007101800190; Sun, 15 Feb 2026 05:22:56 +0000 (UTC)" ], "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr;\n s=sig1; t=1771132981; x=1773724981;\n bh=be0nJ130zvvK9XI/bsScdXF1W7wGDBAIgGEUgggxqUo=;\n h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;\n b=OdWebKcuaf1ljdxxl2eCgftGwsBkkj/pFVS2cS2aWfk7asUlvCX5X5YjLxmSDuhJdwMEhpMmkhyEhozLOqtZwNDLcHlu0KStMosA4DKIM02PgFMXyexMf3wHIPgJvCrOYOBSHrcl2xIbOp0aCmHBUnn7OwLR1+t/B36IwRa+h65HHLVWL2CVZGoSNaAoMy/8MIasZELCp5m9ZwkH0RcCYiftUo47UUWAcZngHKcI68V5gzeAXwgZWtYnN7v1UyWFacD+lAZl4T7d2efSLIxU8asbZJqmFQLXUuCqAVTO6EsgGkqsRmFCg/P+jtYPuLECUmav+wh8lw3RcAKbuWqwLA==", "mail-alias-created-date": "1752046281608", "From": "Mohamed Mediouni <mohamed@unpredictable.fr>", "To": "qemu-devel@nongnu.org", "Cc": "Phil Dennis-Jordan <phil@philjordan.eu>,\n Bernhard Beschow <shentey@gmail.com>, Cameron Esfahani <dirty@apple.com>,\n Magnus Kulke <magnuskulke@linux.microsoft.com>, qemu-arm@nongnu.org,\n Peter Maydell <peter.maydell@linaro.org>,\n Roman Bolshakov <rbolshakov@ddn.com>, Paolo Bonzini <pbonzini@redhat.com>,\n Mohamed Mediouni <mohamed@unpredictable.fr>,\n Pedro Barbuda <pbarbuda@microsoft.com>,\n =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, =?utf-8?q?Marc?=\n\t=?utf-8?q?-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n Magnus Kulke <magnus.kulke@linux.microsoft.com>, =?utf-8?q?Philippe_Mathieu?=\n\t=?utf-8?q?-Daud=C3=A9?= <philmd@linaro.org>, Wei Liu <wei.liu@kernel.org>,\n Zhao Liu <zhao1.liu@intel.com>", "Subject": "[PATCH v3 08/14] whpx: move whpx_get_reg/whpx_set_reg to generic code", "Date": "Sun, 15 Feb 2026 06:22:19 +0100", "Message-ID": "<20260215052225.22513-9-mohamed@unpredictable.fr>", "X-Mailer": "git-send-email 2.50.1", "In-Reply-To": "<20260215052225.22513-1-mohamed@unpredictable.fr>", "References": "<20260215052225.22513-1-mohamed@unpredictable.fr>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-ORIG-GUID": "-jpI853OAFlHDD6HhZZefQK7-bv1XYLv", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjE1MDAzNiBTYWx0ZWRfXyoKETvwC6HqV\n 5TbEo29CY+/nTA21Ex5MkPFOktM5T1IlkQF7KNYxzMLdiQ2lxCVHxypF6b0v5AesrYPosGhVWRK\n 0q8T0d531u+dgGvV9rUEUBnAo8HgdnU6o4vTzi02mRPw31mIp5MEQGRaGRhcW+eHnz6uunzswvv\n S8+FoaGUaZEap1rzS2+SYIII7DoFJLY3nXuGyMv2BuQU2qnZRpcHaCPrNe9BYC1d5FeB7kK8Sv0\n fSQf+nF2gByXfhp/7B3zTwvNb4xp+omRdzi1V7uzzUG/EDeIaHC8ab7ivtz6A+UKF8MyNF17Krx\n 4YMe8tyyHcOAHOsD48RgeE8YVT9ZxLyb3QwiiIRsKZht1gAiQ5yAgu3fBBTO3Y=", "X-Authority-Info-Out": "v=2.4 cv=ZsPg6t7G c=1 sm=1 tr=0 ts=69915835\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=zEEq2qrNK1eH_SHa7C4A:9", "X-Proofpoint-GUID": "-jpI853OAFlHDD6HhZZefQK7-bv1XYLv", "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_02,2026-02-13_01,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 adultscore=0\n mlxscore=0 phishscore=0 malwarescore=0 mlxlogscore=988 bulkscore=0\n clxscore=1030 suspectscore=0 spamscore=0 lowpriorityscore=0 classifier=spam\n authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000\n definitions=main-2602150036", "X-JNJ": "\n AAAAAAAB+neHZPbk77uzoEqAuHRKfpaF3BTsiLGKj5bi0DTrafYPVpWfUt5QW33PTbD1j2KziQy4IUMAzD9wKbinh/y9Rf/8ytUdRA7G/drxOiQbzoIC0CQzxVh71gqIQ0zU0DYHS530weTAuKEK816DCyoUH5yJsB8dJB34Y5neZDglaF04/vECa+3CizdrnAafUX2jX0hQIfJ+jynWxraHYOcd169RIHfhZmEpFCu/J0EereMKmgHyZ3jQBpkIcnGIzF9pbA8Jvlzl70TuxaWjPzaFLcJWDyJt78ZUiS/mmJ8tQYvo84XrjhmFd2ub8Ptbryb5KGcQg9COHXOFue3BpO5ZybaazZ4SGUJHrY6750UzTJt0Ld2fmI26sWUS9gA2ksNK1h1Lj4V5Kcz6Ox9YiMmgd3564veR0wK6C/bPmqZbUs2wfK72UXsNZAM7vpJkPqtroQRDRd6Gh5Nzrgji5yS0yxSwQnHn/VdY8uYay5wSFR9PG9e3+xNQP4Wamg26ILWma+AqKmpRtyYrTxHYNiCaS77sG53CmgToX2utUIYXgXWIiCGp9IgCczr+q25KInOqqEaTcTOAEoazYtfzgJQnigpwpammg3S2KLDVmg0oXQEbUWz5R9tLKOCiLgptEl1kEP+bwWBcK2/b+Nr9F+HlThpRxAMkIkDLXL43BzB5SRsok85Bt141M8R3oi52xJvHrEYCB4w3+H7lJSAiA6yiRBnfU+DK89Q6OrXTx4JTIv4OxpVZ/ViUPCmP2y8cp+UmiJ4oeZK9LKiHiJHZB1gaA5JeqgmDag==", "Received-SPF": "pass client-ip=57.103.68.141;\n envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com", "X-Spam_score_int": "-27", "X-Spam_score": "-2.8", "X-Spam_bar": "--", "X-Spam_report": "(-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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": "These will be used in the next commit on the x86_64 backend too.\nAlso move flush_cpu_state as it's used by get_reg/set_reg and the arm64 code.\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\n---\n accel/whpx/whpx-common.c | 35 +++++++++++++++++++++++++++++++++++\n include/system/whpx-common.h | 3 +++\n target/arm/whpx/whpx-all.c | 35 -----------------------------------\n 3 files changed, 38 insertions(+), 35 deletions(-)", "diff": "diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c\nindex c57a0d3f0f..c2263c2496 100644\n--- a/accel/whpx/whpx-common.c\n+++ b/accel/whpx/whpx-common.c\n@@ -46,6 +46,41 @@ static HMODULE hWinHvEmulation;\n struct whpx_state whpx_global;\n struct WHPDispatch whp_dispatch;\n \n+void flush_cpu_state(CPUState *cpu)\n+{\n+ if (cpu->vcpu_dirty) {\n+ whpx_set_registers(cpu, WHPX_SET_RUNTIME_STATE);\n+ cpu->vcpu_dirty = false;\n+ }\n+}\n+\n+void whpx_get_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE* val)\n+{\n+ struct whpx_state *whpx = &whpx_global;\n+ HRESULT hr;\n+\n+ flush_cpu_state(cpu);\n+\n+ hr = whp_dispatch.WHvGetVirtualProcessorRegisters(whpx->partition, cpu->cpu_index,\n+ ®, 1, val);\n+\n+ if (FAILED(hr)) {\n+ error_report(\"WHPX: Failed to get register %08x, hr=%08lx\", reg, hr);\n+ }\n+}\n+\n+void whpx_set_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE val)\n+{\n+ struct whpx_state *whpx = &whpx_global;\n+ HRESULT hr;\n+ hr = whp_dispatch.WHvSetVirtualProcessorRegisters(whpx->partition, cpu->cpu_index,\n+ ®, 1, &val);\n+\n+ if (FAILED(hr)) {\n+ error_report(\"WHPX: Failed to set register %08x, hr=%08lx\", reg, hr);\n+ }\n+}\n+\n /* Tries to find a breakpoint at the specified address. */\n struct whpx_breakpoint *whpx_lookup_breakpoint_by_addr(uint64_t address)\n {\ndiff --git a/include/system/whpx-common.h b/include/system/whpx-common.h\nindex b86fe9db6e..5bce33e336 100644\n--- a/include/system/whpx-common.h\n+++ b/include/system/whpx-common.h\n@@ -20,6 +20,9 @@ int whpx_first_vcpu_starting(CPUState *cpu);\n int whpx_last_vcpu_stopping(CPUState *cpu);\n void whpx_memory_init(void);\n struct whpx_breakpoint *whpx_lookup_breakpoint_by_addr(uint64_t address);\n+void flush_cpu_state(CPUState *cpu);\n+void whpx_get_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE* val);\n+void whpx_set_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE val);\n \n /* On x64: same as WHvX64ExceptionTypeDebugTrapOrFault */\n #define WHPX_INTERCEPT_DEBUG_TRAPS 1\ndiff --git a/target/arm/whpx/whpx-all.c b/target/arm/whpx/whpx-all.c\nindex d52580a082..c8d71a252e 100644\n--- a/target/arm/whpx/whpx-all.c\n+++ b/target/arm/whpx/whpx-all.c\n@@ -274,14 +274,6 @@ static struct whpx_sreg_match whpx_sreg_match[] = {\n { WHvArm64RegisterSpEl1, ENCODE_AA64_CP_REG(4, 1, 3, 4, 0) },\n };\n \n-static void flush_cpu_state(CPUState *cpu)\n-{\n- if (cpu->vcpu_dirty) {\n- whpx_set_registers(cpu, WHPX_SET_RUNTIME_STATE);\n- cpu->vcpu_dirty = false;\n- }\n-}\n-\n HRESULT whpx_set_exception_exit_bitmap(UINT64 exceptions)\n {\n if (exceptions != 0) {\n@@ -314,33 +306,6 @@ void whpx_arch_destroy_vcpu(CPUState *cpu)\n /* currently empty on Arm */\n }\n \n-static void whpx_get_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE* val)\n-{\n- struct whpx_state *whpx = &whpx_global;\n- HRESULT hr;\n-\n- flush_cpu_state(cpu);\n-\n- hr = whp_dispatch.WHvGetVirtualProcessorRegisters(whpx->partition, cpu->cpu_index,\n- ®, 1, val);\n-\n- if (FAILED(hr)) {\n- error_report(\"WHPX: Failed to get register %08x, hr=%08lx\", reg, hr);\n- }\n-}\n-\n-static void whpx_set_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE val)\n-{\n- struct whpx_state *whpx = &whpx_global;\n- HRESULT hr;\n- hr = whp_dispatch.WHvSetVirtualProcessorRegisters(whpx->partition, cpu->cpu_index,\n- ®, 1, &val);\n-\n- if (FAILED(hr)) {\n- error_report(\"WHPX: Failed to set register %08x, hr=%08lx\", reg, hr);\n- }\n-}\n-\n static void whpx_get_global_reg(WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE *val)\n {\n struct whpx_state *whpx = &whpx_global;\n", "prefixes": [ "v3", "08/14" ] }