{"id":2231427,"url":"http://patchwork.ozlabs.org/api/patches/2231427/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-33-pbonzini@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","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":"<20260430172204.1006673-33-pbonzini@redhat.com>","list_archive_url":null,"date":"2026-04-30T17:21:38","name":"[PULL,32/58] whpx: i386: disable kernel-irqchip on Windows 10 when PIC enabled","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5b9a2ceceb60f25cafb6173c09d66441a05d7c23","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/?format=json","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-33-pbonzini@redhat.com/mbox/","series":[{"id":502347,"url":"http://patchwork.ozlabs.org/api/series/502347/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502347","date":"2026-04-30T17:21:16","name":"[PULL,01/58] pythondeps: bump to meson 1.11.1","version":1,"mbox":"http://patchwork.ozlabs.org/series/502347/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231427/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231427/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=GLSqN9VJ;\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=sdL9Z313;\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 4g61KW27Pvz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 03:25:51 +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 1wIV7f-0006up-HS; Thu, 30 Apr 2026 13:24:23 -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 <pbonzini@redhat.com>)\n id 1wIV7C-0005kW-3h\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:24:00 -0400","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 <pbonzini@redhat.com>)\n id 1wIV79-0004iB-Hg\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:23:53 -0400","from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-154-ql0aXfpxOQKw00v_3JqoWA-1; Thu, 30 Apr 2026 13:23:49 -0400","by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-8ac9609d3d6so29718456d6.0\n for <qemu-devel@nongnu.org>; Thu, 30 Apr 2026 10:23:49 -0700 (PDT)","from [192.168.10.48] ([151.49.85.67])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b3ff43a465sm22165976d6.28.2026.04.30.10.23.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 10:23:46 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777569830;\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=p4g0uz/P7j9K70N0flDT+IgeE2GHWNDfoeHg+Js6mkw=;\n b=GLSqN9VJksa2+QFkFxt5Ix5k6739AASRz7MLU7iI2GXcixhBfhd0OES6g1vvqnh6uVUfvh\n 1t0sIdjQD6Bdbd6jNgDWoTfb+uY/LniOgAbfESFeYbxQyYFrw3ngDI2C2VtcZJh8Uo5DGD\n rYqfNxpMtzI5p7KRZJdmwHR7obDB9aw=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1777569828; x=1778174628; 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=p4g0uz/P7j9K70N0flDT+IgeE2GHWNDfoeHg+Js6mkw=;\n b=sdL9Z313OSJIKfV175x7/cUlA/VrU5Iz84qMqMoPfekF78C+m7Vcf9WI4Utz5y+xRH\n bQtKsnppeG+xEtVt/16qOEQrNcPotfH29gz5rUltQqaizvei317Si7lGuEtJqVm6q1gm\n a3lqQCTU1Fv8/Dv32ULtitS39vBiZmB4GP2JugPWERZ6pd+kUHxvIbapRZ25W2SgJROe\n ryzco6ORZ452137qAa+TO1eL81W/8BvQgq+eEBUIXvmiffcxAAMedtVluu8tW/i6a9bh\n QksjWC+qCLvDU9wHsavyVgIhoej76O9gODrgAy9+ZrHqkd8qoCI9U9in1W4577XxKGDU\n rP5Q=="],"X-MC-Unique":"ql0aXfpxOQKw00v_3JqoWA-1","X-Mimecast-MFC-AGG-ID":"ql0aXfpxOQKw00v_3JqoWA_1777569829","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777569828; x=1778174628;\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=p4g0uz/P7j9K70N0flDT+IgeE2GHWNDfoeHg+Js6mkw=;\n b=AzlfWBSfXrQlQG1qPx3IR+qLDJSyfGbNTDtmbPhUEXbI/OPkSWze1O0w3mZ2r+RNMI\n aPKGriLXN+0RgqCKgubuxPhA3oRej20xCGJEhsvM/KYmP66vOYSkBgDy6MoWF32z0LnR\n GMjbswPwBxxrhLdC5bw+E7cvljDQ8FARp15jybpfZUbB2kAL81SMCVOXHBQzTooTf3OO\n WRmAU7yc0ePz2+czowXmfFGx52ppJbHTgcJRFZN6PuZ6/WjfAazxEXkq8V1xAOtSU0TP\n P69lruNEXstIlMWSiI0BZcTrk0GLI4YYKkeF+lA2Sm/ZuPwBO0f1ZVVjAh44RFc2wtwn\n UEfQ==","X-Gm-Message-State":"AOJu0YwDF2KpgJYwF/GeQg7tzB72QZZqkB7dHNtdWj4MnheFAOsjiGIt\n sOkQqJ/cYCl+VJS0MVBGqnOIDiP/b8b2R/zKVZhzc10Pnr7jVBtdup+MHA+duMUYr2BwA9DldOJ\n GGqbVV5gyWPyJ1JUGHWeIl7lsI1qa/lBBhkQTcGH88UJGMJEOyrHqmxSoJQFIwesxcYg0GJ9zjH\n 0t/WDQZLXY3TA7t8ShglrhjfP1JNjN8ytv/HcMJ45N","X-Gm-Gg":"AeBDieulKy0gQUvnzdHzNMLizVMAOpLcJXUd1pCLHRcEUQkorYMoxf6uWyZJsXOLzJK\n AvlxCHYElRN2WKT3yvB6NmCQNe3qIXYGhNcv8K6M/4ETqXBoVH8cZismXPjnq4ITwXkdgROEc4n\n rEo5bzwGYSiU9rqbgfh1N9sfMFBJUl0jg/i21en+//XQwe6ugUHh+jC9aUzIWDoaCk0Z6Mhb2t0\n eM9UnHq/9yeE+Xl0DjRWpFxHWdCweDtNG2B1gpB/aDm52ux9KQ0ZPvqzmIo7vhZ6UG1zEpDwnur\n Z4niIS9i6DTFy0NyjVvqOnZ9VdVxDICFhflfKTumC/KDoJ4d7u3ddtYel7+7aJX0a5JeVNqptSO\n HmVpbO40XQ0n6bOxPC3hLBTU2cZQS6IGXlU3wCX1/8M/uCZisxsv2/aMbZeNV5l1BNlaB+WSQ0C\n Zr6JiGFN5MdEIgbvSmSFPhBiAFIjpaZtLOwbs=","X-Received":["by 2002:a05:6214:4608:b0:8b1:f2f6:33b with SMTP id\n 6a1803df08f44-8b3fe7af5dbmr57264646d6.22.1777569828231;\n Thu, 30 Apr 2026 10:23:48 -0700 (PDT)","by 2002:a05:6214:4608:b0:8b1:f2f6:33b with SMTP id\n 6a1803df08f44-8b3fe7af5dbmr57263826d6.22.1777569827351;\n Thu, 30 Apr 2026 10:23:47 -0700 (PDT)"],"From":"Paolo Bonzini <pbonzini@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"Mohamed Mediouni <mohamed@unpredictable.fr>","Subject":"[PULL 32/58] whpx: i386: disable kernel-irqchip on Windows 10 when\n PIC enabled","Date":"Thu, 30 Apr 2026 19:21:38 +0200","Message-ID":"<20260430172204.1006673-33-pbonzini@redhat.com>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260430172204.1006673-1-pbonzini@redhat.com>","References":"<20260430172204.1006673-1-pbonzini@redhat.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=pbonzini@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_H5=0.001, RCVD_IN_MSPIKE_WL=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":"From: Mohamed Mediouni <mohamed@unpredictable.fr>\n\nMove WHvCapabilityCodeProcessorPerfmonFeatures queries\nas that's how we distinguish if on a legacy OS.\n\nNow that Windows guests are booting, disable kernel-irqchip=on\nby default for Windows 10 when the PIC is enabled.\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\nLink: https://lore.kernel.org/r/20260422214225.2242-11-mohamed@unpredictable.fr\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n target/i386/whpx/whpx-all.c | 69 +++++++++++++++++++++----------------\n 1 file changed, 39 insertions(+), 30 deletions(-)","diff":"diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c\nindex 03c146dfb8c..ab8e97787fe 100644\n--- a/target/i386/whpx/whpx-all.c\n+++ b/target/i386/whpx/whpx-all.c\n@@ -2523,6 +2523,13 @@ int whpx_accel_init(AccelState *as, MachineState *ms)\n         0x80000002, 0x80000003, 0x80000004, 0x80000007, 0x80000008,\n         0x8000000A, 0x80000021, 0x80000022, 0xC0000000, 0xC0000001};\n \n+    X86MachineState *x86ms = X86_MACHINE(ms);\n+    bool pic_enabled = false;\n+\n+    if (x86ms->pic == ON_OFF_AUTO_ON || x86ms->pic == ON_OFF_AUTO_AUTO) {\n+        pic_enabled = true;\n+    }\n+\n     whpx = &whpx_global;\n \n     if (!init_whp_dispatch()) {\n@@ -2594,6 +2601,35 @@ int whpx_accel_init(AccelState *as, MachineState *ms)\n         goto error;\n     }\n \n+    /* Enable supported performance monitoring capabilities */\n+    hr = whp_dispatch.WHvGetCapability(\n+        WHvCapabilityCodeProcessorPerfmonFeatures, &perfmon_features,\n+        sizeof(WHV_PROCESSOR_PERFMON_FEATURES), &whpx_cap_size);\n+    /*\n+     * Relying on this is a crutch to maintain Windows 10 support.\n+     *\n+     * WHvCapabilityCodeProcessorPerfmonFeatures and\n+     * WHvPartitionPropertyCodeSyntheticProcessorFeaturesBanks\n+     * are implemented starting from Windows Server 2022 (build 20348).\n+     */\n+    if (FAILED(hr)) {\n+        warn_report(\"WHPX: Failed to get performance \"\n+                    \"monitoring features, hr=%08lx\", hr);\n+        is_modern_os = false;\n+    } else {\n+        hr = whp_dispatch.WHvSetPartitionProperty(\n+                whpx->partition,\n+                WHvPartitionPropertyCodeProcessorPerfmonFeatures,\n+                &perfmon_features,\n+                sizeof(WHV_PROCESSOR_PERFMON_FEATURES));\n+        if (FAILED(hr)) {\n+            error_report(\"WHPX: Failed to set performance \"\n+                         \"monitoring features, hr=%08lx\", hr);\n+            ret = -EINVAL;\n+            goto error;\n+        }\n+    }\n+\n     /*\n      * Error out if WHP doesn't support apic emulation and user is requiring\n      * it.\n@@ -2606,8 +2642,9 @@ int whpx_accel_init(AccelState *as, MachineState *ms)\n         goto error;\n     }\n \n-    if (whpx->kernel_irqchip_allowed && features.LocalApicEmulation &&\n-        whp_dispatch.WHvSetVirtualProcessorInterruptControllerState2) {\n+    if (whpx->kernel_irqchip_allowed && !(whpx_is_legacy_os() && pic_enabled\n+        && !whpx->kernel_irqchip_required) && features.LocalApicEmulation\n+        && whp_dispatch.WHvSetVirtualProcessorInterruptControllerState2) {\n         WHV_X64_LOCAL_APIC_EMULATION_MODE mode =\n             WHvX64LocalApicEmulationModeX2Apic;\n         hr = whp_dispatch.WHvSetPartitionProperty(\n@@ -2669,34 +2706,6 @@ int whpx_accel_init(AccelState *as, MachineState *ms)\n         goto error;\n     }\n \n-    /* Enable supported performance monitoring capabilities */\n-    hr = whp_dispatch.WHvGetCapability(\n-        WHvCapabilityCodeProcessorPerfmonFeatures, &perfmon_features,\n-        sizeof(WHV_PROCESSOR_PERFMON_FEATURES), &whpx_cap_size);\n-    /*\n-     * Relying on this is a crutch to maintain Windows 10 support.\n-     *\n-     * WHvCapabilityCodeProcessorPerfmonFeatures and\n-     * WHvPartitionPropertyCodeSyntheticProcessorFeaturesBanks\n-     * are implemented starting from Windows Server 2022 (build 20348).\n-     */\n-    if (FAILED(hr)) {\n-        warn_report(\"WHPX: Failed to get performance \"\n-                    \"monitoring features, hr=%08lx\", hr);\n-        is_modern_os = false;\n-    } else {\n-        hr = whp_dispatch.WHvSetPartitionProperty(\n-                whpx->partition,\n-                WHvPartitionPropertyCodeProcessorPerfmonFeatures,\n-                &perfmon_features,\n-                sizeof(WHV_PROCESSOR_PERFMON_FEATURES));\n-        if (FAILED(hr)) {\n-            error_report(\"WHPX: Failed to set performance \"\n-                         \"monitoring features, hr=%08lx\", hr);\n-            ret = -EINVAL;\n-            goto error;\n-        }\n-    }\n \n     /* Enable synthetic processor features */\n     WHV_SYNTHETIC_PROCESSOR_FEATURES_BANKS synthetic_features;\n","prefixes":["PULL","32/58"]}