Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2226917/?format=api
{ "id": 2226917, "url": "http://patchwork.ozlabs.org/api/patches/2226917/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260422214225.2242-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": "<20260422214225.2242-9-mohamed@unpredictable.fr>", "list_archive_url": null, "date": "2026-04-22T21:41:56", "name": "[v3,08/37] whpx: i386: kernel-irqchip=off fixes", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "43c129a3bf01c246b07be19f74fa0e2a66f092e5", "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/20260422214225.2242-9-mohamed@unpredictable.fr/mbox/", "series": [ { "id": 501116, "url": "http://patchwork.ozlabs.org/api/series/501116/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501116", "date": "2026-04-22T21:41:48", "name": "[v3,01/37] target/i386: emulate: include name of unhandled instruction", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/501116/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2226917/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226917/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=LPhhMXOL;\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 4g1CRh2GgSz1yDD\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 07:44:32 +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 1wFfLR-0007zR-HB; Wed, 22 Apr 2026 17:42:53 -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 <mohamed@unpredictable.fr>)\n id 1wFfLO-0007wy-Hk\n for qemu-devel@nongnu.org; Wed, 22 Apr 2026 17:42:50 -0400", "from p-east2-cluster1-host6-snip4-10.eps.apple.com ([57.103.76.103]\n helo=outbound.st.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 1wFfLL-0006zW-N4\n for qemu-devel@nongnu.org; Wed, 22 Apr 2026 17:42:49 -0400", "from outbound.st.icloud.com (unknown [127.0.0.2])\n by p00-icloudmta-asmtp-us-east-1a-100-percent-1 (Postfix) with ESMTPS id\n 4E82818006F2; Wed, 22 Apr 2026 21:42:45 +0000 (UTC)", "from localhost.localdomain (unknown [17.42.251.67])\n by p00-icloudmta-asmtp-us-east-1a-100-percent-1 (Postfix) with ESMTPSA id\n 263BF1800962; Wed, 22 Apr 2026 21:42:43 +0000 (UTC)" ], "X-ICL-Out-Info": "\n HUtFAUMHWwJACUgBTUQeDx5WFlZNRAJCTQFIHV8DWRxBAUkdXw9LVxQEFVwFVgZXFHkNXR1FDlYZWgxSD1sOHBZLWFUJCgZdGFgVVgl3HlwASx1XBFQfUxJVHR0LRUtAEwRJAU1fDl4fBBdGGVUERx5dVkAZGQJRHFYNV0NUBF9QSQxBUGxaAEcXSB1dGVlvUF0cDhhZG0AVXRFQGVYJXhUXHkFNWgJWTQVKA18BWwZCC0oCWQVZB14LSgdfGlIfHVYQUgBSD3IFVwhBCFMCUQRYGl8IGQ1AThkMSh1SVlEFSgxcAGgPXR1YEV0=", "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr;\n s=sig1; t=1776894166; x=1779486166;\n bh=rF48Y2MLEXMC/gSG0+gU5MLW6aYnvIDO0HJVJDRDdVs=;\n h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;\n b=LPhhMXOLm1GllTYJN8x4iMxupC9tn/xJskNZ0tAnGr7842+wODS7+umjdH5iQdJ5RDIsctQMF27SaPce0WqU2TF+TsCoi7PKWfbhiGJWy2m0RqbnhxIOgrosf8ymAlK6eaoNjbMcZYCzlN7RX9nTb5j4CCiMJCJITZC6awhPBIw3wwU09BYwKoxPGBTCxFpGJRmpHR8fx9OmIH5bruXT7fWtM7hbn9SJsKCbajj83EEAsuzOiVE6qbqMJrfHWz+H0TRUlmKATx+aB0iGJxevsnsYltRSQgyb27+dhcXwHc1FcmI9QaQlhhsdXxvqvBzVzwafASrmimH4ei71/QJDUQ==", "mail-alias-created-date": "1752046281608", "From": "Mohamed Mediouni <mohamed@unpredictable.fr>", "To": "qemu-devel@nongnu.org", "Cc": "Pedro Barbuda <pbarbuda@microsoft.com>, qemu-arm@nongnu.org,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>,\n Mohamed Mediouni <mohamed@unpredictable.fr>,\n Roman Bolshakov <rbolshakov@ddn.com>,\n \"Michael S. Tsirkin\" <mst@redhat.com>, Wei Liu <wei.liu@kernel.org>,\n Phil Dennis-Jordan <phil@philjordan.eu>,\n Peter Maydell <peter.maydell@linaro.org>, Zhao Liu <zhao1.liu@intel.com>,\n Paolo Bonzini <pbonzini@redhat.com>", "Subject": "[PATCH v3 08/37] whpx: i386: kernel-irqchip=off fixes", "Date": "Wed, 22 Apr 2026 23:41:56 +0200", "Message-ID": "<20260422214225.2242-9-mohamed@unpredictable.fr>", "X-Mailer": "git-send-email 2.50.1", "In-Reply-To": "<20260422214225.2242-1-mohamed@unpredictable.fr>", "References": "<20260422214225.2242-1-mohamed@unpredictable.fr>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDIyMDIxMSBTYWx0ZWRfX/B7l03B7Yq6P\n lKD0UiXMCOwQkq3g0KkpLcsp+knvWr/93K7n+H4+dMyKIJDTzlmmKJFuTCdXSGNpmPkxO+WlhCY\n 5LqIk1Pktbvx2AquSk0UN6F9/AHpfZAUtPlrQjNCysHaJzqoTcoCwiBTy+ryttb2kp7T3KvXUed\n lbO5YUuX86NZXJoYMWF5I1da+TbMnDy694eneWUx2nWAadQMmMCcVcXO4LDoIZX6W1ntIiMC0rl\n k+sa9TUzIR3R/bZM9GQRPqp8Ajz5UpQXTjl9VKm5w1ndBT5Us6nYkliFY7AlnzaReSPxb7qJF4c\n LWF+wVrqovI491iZD+mCAWBfMnWGhpcEKgr6/CcvqxI+SpNQquWPXYeDMFJEiE=", "X-Proofpoint-ORIG-GUID": "RWZcdDPvkY1yzF8lBcUYEB9iEdmeP5PO", "X-Proofpoint-GUID": "RWZcdDPvkY1yzF8lBcUYEB9iEdmeP5PO", "X-Authority-Info-Out": "v=2.4 cv=G9cR0tk5 c=1 sm=1 tr=0 ts=69e940d6\n cx=c_apl:c_pps:t_out a=YrL12D//S6tul8v/L+6tKg==:117\n a=YrL12D//S6tul8v/L+6tKg==:17 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=gP1GEkNOX-MqffGxZ4oA:9", "Received-SPF": "pass client-ip=57.103.76.103;\n envelope-from=mohamed@unpredictable.fr; helo=outbound.st.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 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": "This was really... quite broken. After fixing this,\nWindows boots with kernel-irqchip=off.\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\n---\n include/system/whpx-common.h | 1 +\n target/i386/whpx/whpx-all.c | 43 +++++-------------------------------\n 2 files changed, 7 insertions(+), 37 deletions(-)", "diff": "diff --git a/include/system/whpx-common.h b/include/system/whpx-common.h\nindex 04289afd97..3406c20fec 100644\n--- a/include/system/whpx-common.h\n+++ b/include/system/whpx-common.h\n@@ -4,6 +4,7 @@\n \n struct AccelCPUState {\n bool window_registered;\n+ int window_priority;\n bool interruptable;\n bool ready_for_pic_interrupt;\n uint64_t tpr;\ndiff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c\nindex 73e351d895..d470c5b9d3 100644\n--- a/target/i386/whpx/whpx-all.c\n+++ b/target/i386/whpx/whpx-all.c\n@@ -22,6 +22,8 @@\n #include \"qemu/main-loop.h\"\n #include \"hw/core/boards.h\"\n #include \"hw/intc/ioapic.h\"\n+#include \"hw/intc/i8259.h\"\n+#include \"hw/i386/x86.h\"\n #include \"hw/i386/apic_internal.h\"\n #include \"qemu/error-report.h\"\n #include \"qapi/error.h\"\n@@ -390,28 +392,6 @@ static int whpx_set_tsc(CPUState *cpu)\n return 0;\n }\n \n-/*\n- * The CR8 register in the CPU is mapped to the TPR register of the APIC,\n- * however, they use a slightly different encoding. Specifically:\n- *\n- * APIC.TPR[bits 7:4] = CR8[bits 3:0]\n- *\n- * This mechanism is described in section 10.8.6.1 of Volume 3 of Intel 64\n- * and IA-32 Architectures Software Developer's Manual.\n- *\n- * The functions below translate the value of CR8 to TPR and vice versa.\n- */\n-\n-static uint64_t whpx_apic_tpr_to_cr8(uint64_t tpr)\n-{\n- return tpr >> 4;\n-}\n-\n-static uint64_t whpx_cr8_to_apic_tpr(uint64_t cr8)\n-{\n- return cr8 << 4;\n-}\n-\n void whpx_set_registers(CPUState *cpu, WHPXStateLevel level)\n {\n struct whpx_state *whpx = &whpx_global;\n@@ -440,7 +420,7 @@ void whpx_set_registers(CPUState *cpu, WHPXStateLevel level)\n v86 = (env->eflags & VM_MASK);\n r86 = !(env->cr[0] & CR0_PE_MASK);\n \n- vcpu->tpr = whpx_apic_tpr_to_cr8(cpu_get_apic_tpr(x86_cpu->apic_state));\n+ vcpu->tpr = cpu_get_apic_tpr(x86_cpu->apic_state);\n vcpu->apic_base = cpu_get_apic_base(x86_cpu->apic_state);\n \n idx = 0;\n@@ -711,17 +691,6 @@ void whpx_get_registers(CPUState *cpu, WHPXStateLevel level)\n hr);\n }\n \n- if (whpx_irqchip_in_kernel()) {\n- /*\n- * Fetch the TPR value from the emulated APIC. It may get overwritten\n- * below with the value from CR8 returned by\n- * WHvGetVirtualProcessorRegisters().\n- */\n- whpx_apic_get(x86_cpu->apic_state);\n- vcpu->tpr = whpx_apic_tpr_to_cr8(\n- cpu_get_apic_tpr(x86_cpu->apic_state));\n- }\n-\n idx = 0;\n \n /* Indexes for first 16 registers match between HV and QEMU definitions */\n@@ -770,7 +739,7 @@ void whpx_get_registers(CPUState *cpu, WHPXStateLevel level)\n tpr = vcxt.values[idx++].Reg64;\n if (tpr != vcpu->tpr) {\n vcpu->tpr = tpr;\n- cpu_set_apic_tpr(x86_cpu->apic_state, whpx_cr8_to_apic_tpr(tpr));\n+ cpu_set_apic_tpr(x86_cpu->apic_state, tpr);\n }\n \n /* 8 Debug Registers - Skipped */\n@@ -1775,7 +1744,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu)\n }\n \n /* Sync the TPR to the CR8 if was modified during the intercept */\n- tpr = whpx_apic_tpr_to_cr8(cpu_get_apic_tpr(x86_cpu->apic_state));\n+ tpr = cpu_get_apic_tpr(x86_cpu->apic_state);\n if (tpr != vcpu->tpr) {\n vcpu->tpr = tpr;\n reg_values[reg_count].Reg64 = tpr;\n@@ -1822,7 +1791,7 @@ static void whpx_vcpu_post_run(CPUState *cpu)\n if (vcpu->tpr != tpr) {\n vcpu->tpr = tpr;\n bql_lock();\n- cpu_set_apic_tpr(x86_cpu->apic_state, whpx_cr8_to_apic_tpr(vcpu->tpr));\n+ cpu_set_apic_tpr(x86_cpu->apic_state, vcpu->tpr);\n bql_unlock();\n }\n \n", "prefixes": [ "v3", "08/37" ] }