{"id":2231468,"url":"http://patchwork.ozlabs.org/api/patches/2231468/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-47-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-47-pbonzini@redhat.com>","list_archive_url":null,"date":"2026-04-30T17:21:52","name":"[PULL,46/58] whpx: i386: add HV_X64_MSR_GUEST_IDLE when !kernel-irqchip","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"577eac8244944668856df069527a0d8c1941f7ed","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-47-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/2231468/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231468/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=cQAgrdeu;\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=KWGCEjYP;\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 4g61TS4GXvz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 03:32:44 +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 1wIV7v-0000dQ-Uk; Thu, 30 Apr 2026 13:24:39 -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 1wIV7s-0000Ml-UF\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:24:37 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.129.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 1wIV7q-0004ui-Su\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:24:36 -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-263-KQiAV-vyMyqlUZNOQEICvg-1; Thu, 30 Apr 2026 13:24:32 -0400","by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-8b46c014a26so15280236d6.0\n for <qemu-devel@nongnu.org>; Thu, 30 Apr 2026 10:24:32 -0700 (PDT)","from [192.168.10.48] ([151.49.85.67])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b3ff4850e5sm22901446d6.49.2026.04.30.10.24.28\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 10:24:29 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777569874;\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=wyoUkF/bjkIeC5ZoeQHhKzjY0RW68pJmMim6gYvuPMQ=;\n b=cQAgrdeu6G1et/gin36zRolYapu3SMh84Mc3ns6xvVn1rvm1U28wqXiaLhQkNpAa7Zm7JJ\n W4jIJJhRa0AYG9N/Lrm7VSUTtF4LM0ozs4Zy/+kMrlPE3tkpOh7ZC4KjGjNtShv5+vC7Gv\n lpT4CFV/YKg+EJFpalL1qCiiuvDuER4=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1777569871; x=1778174671; 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=wyoUkF/bjkIeC5ZoeQHhKzjY0RW68pJmMim6gYvuPMQ=;\n b=KWGCEjYPcKsSCJCzfW/U21ZtNNrUGlMm1/3GErqTDyMxre3PustVfu+sOiAKPpHzGz\n Jg97WHksJBWCxLqWVYSS4/vZ+W2hFUQpAVTLL3k4TnMW3I5V6tvkh3zgtd8nCQ97eJb1\n 8CMGTulbt7fo7Sn+G64kfKb46KXnRaBdWj1Vg4JXoP89V30RS5mNmDP8jL64hice9YE1\n A1QO/vjuw+H7e4wEx7OHgrEdHGB9l57wyegJ7DV9WOsaoeoVmbC/z30FnlDoNvPCrcqy\n C+fPjYJ5iykfnTzJ4xEm78RvZseEz6UflZPaV0uBfiN2Q6nm9bMzq3wcQNL9FMJXFg2f\n DuYg=="],"X-MC-Unique":"KQiAV-vyMyqlUZNOQEICvg-1","X-Mimecast-MFC-AGG-ID":"KQiAV-vyMyqlUZNOQEICvg_1777569872","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777569871; x=1778174671;\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=wyoUkF/bjkIeC5ZoeQHhKzjY0RW68pJmMim6gYvuPMQ=;\n b=ZcL254DW0Y7f50nvVj5edRR389E6+raoAEfHLSWz+OnInviGCj5XbBmm1NWZNlw0+7\n ZELSuvfnRGqDsX9/On405YRxvJ5J5CQTwKI3FT2hhKuSIFG723uSTYrcBYwqmp4IMsID\n f4NlWaeLQ1Nwa7Asyo2X7SaVcvBc4efH4OacI8DiLWJulShmyDKZGwoLkxrGIy+ELhFV\n 1aGVdUl1vK5iAY3mpQLkzCAo8E9lXLOUD3LtIoe+BRCHKSYT+dK6k8vyVYt0v4ejuGUf\n yu1VCNBaylpUUw7SpNf8PipDej1k7370JpsXTnpqO6zFoaPjC57HxXZCXxTmubxqE+6X\n DdgA==","X-Gm-Message-State":"AOJu0YypU74a1z4pHSclKHOmUyPSCGECXZt0P6OqD8qBhrEH4IvFIK46\n iEAdAPL8BQA6cokH/lwevGAU8P3qkcgFNwCYNfmR0BrL5htsZWuvCqJeY77cfmuvE5i/sOxgzvZ\n GG8632+D1r1+Fbq33cGF/31i+v9zvuUQD4iVPBORZ2eJiZEASZ2KCs/cNGHxbiEKZ4EahKijvLp\n n/nombWTOlD+90X2bCIC3zp4ucxpLnp3OvNPhBwLYf","X-Gm-Gg":"AeBDieuRbwqkH8U+s+IhKvhteAEia2b6p9PFV6mkilsbhYG474LMDkzKOS0yt6Vtf/l\n 1oq0cLkJCOVWuvtTcnKkI/FWhNEkg2xK3srYfmlWkJpj0xBMQCSvMP5VQ5GBJocwlxVaoqadAYm\n 02cB5NniydL4Ti5YPYaV4OyufLYnHn2bHTWgSRBQEwdxA9qkzvdGNuNklg+McbWIJKXvS8UsWBZ\n 7+ykFqVcIkos784aY7QhRgz9O4JQgADRHpItTEqN0gSJ0Xyj2XZV0ROzLt3/oH6NPhR/l9ghC8S\n Rnz8SRjqCkzhPXB3Ol/vhRDikaoKeZQc9oXzG+KLf9UyDRvTwJ0IVcocDZSjXh/fGuDCY9Kp3EW\n LOpedOZqXwAFF05QRkfQdDNUpp4u5VSxkouNJE3CuU++uaKbyb6o5sM0YvOZ/O9lMLo6N4qcPcI\n gQqN7mwFFWYGVJcFJctlJRhunetbRgfI0/4uE=","X-Received":["by 2002:a05:6214:3986:b0:8ac:a62a:a451 with SMTP id\n 6a1803df08f44-8b3fe727594mr60926886d6.12.1777569870956;\n Thu, 30 Apr 2026 10:24:30 -0700 (PDT)","by 2002:a05:6214:3986:b0:8ac:a62a:a451 with SMTP id\n 6a1803df08f44-8b3fe727594mr60926246d6.12.1777569870315;\n Thu, 30 Apr 2026 10:24:30 -0700 (PDT)"],"From":"Paolo Bonzini <pbonzini@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"Mohamed Mediouni <mohamed@unpredictable.fr>","Subject":"[PULL 46/58] whpx: i386: add HV_X64_MSR_GUEST_IDLE when\n !kernel-irqchip","Date":"Thu, 30 Apr 2026 19:21:52 +0200","Message-ID":"<20260430172204.1006673-47-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.129.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_H4=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\nAdd support for an oddball HV_X64_MSR_GUEST_IDLE not-quite-an-HLT\nthat wakes the vCPU even if EFLAGS.IF is set.\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\nLink: https://lore.kernel.org/r/20260422214225.2242-23-mohamed@unpredictable.fr\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n target/i386/whpx/whpx-all.c | 27 ++++++++++++++++++++++++++-\n 1 file changed, 26 insertions(+), 1 deletion(-)","diff":"diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c\nindex bc8d673c31a..593a707e219 100644\n--- a/target/i386/whpx/whpx-all.c\n+++ b/target/i386/whpx/whpx-all.c\n@@ -52,6 +52,7 @@\n /* for kernel-irqchip=off */\n #define HV_X64_MSR_APIC_FREQUENCY       0x40000023\n #define HV_X64_MSR_VP_ASSIST_PAGE       0x40000073\n+#define HV_X64_MSR_GUEST_IDLE           0x400000f0\n \n static bool is_modern_os = true;\n \n@@ -1648,6 +1649,15 @@ static int whpx_handle_halt(CPUState *cpu)\n     return ret;\n }\n \n+static int whpx_handle_hyperv_guestidle(CPUState *cpu)\n+{\n+    X86CPU *x86_cpu = X86_CPU(cpu);\n+    CPUX86State *env = &x86_cpu->env;\n+\n+    env->hflags2 |= HF2_HYPERV_HLT_MASK;\n+    return whpx_handle_halt(cpu);\n+}\n+\n static void whpx_vcpu_kick_out_of_hlt(CPUState *cpu) \n {\n     WHV_REGISTER_VALUE reg;\n@@ -1851,9 +1861,10 @@ static void whpx_vcpu_process_async_events(CPUState *cpu)\n     }\n \n     if ((cpu_test_interrupt(cpu, CPU_INTERRUPT_HARD) &&\n-         (env->eflags & IF_MASK)) ||\n+         ((env->eflags & IF_MASK) || (env->hflags2 & HF2_HYPERV_HLT_MASK))) ||\n         cpu_test_interrupt(cpu, CPU_INTERRUPT_NMI)) {\n         cpu->halted = false;\n+        env->hflags2 &= ~HF2_HYPERV_HLT_MASK;\n     }\n \n     if (cpu_test_interrupt(cpu, CPU_INTERRUPT_SIPI)) {\n@@ -2128,6 +2139,20 @@ int whpx_vcpu_run(CPUState *cpu)\n                 }\n             }\n \n+            /*\n+             * Windows and Linux both use this MSR.\n+             * Windows 11 25H2 uses it even when not advertised.\n+             */\n+            if (vcpu->exit_ctx.MsrAccess.MsrNumber == HV_X64_MSR_GUEST_IDLE\n+                && !vcpu->exit_ctx.MsrAccess.AccessInfo.IsWrite\n+                && !whpx_irqchip_in_kernel()\n+                && whpx->hyperv_enlightenments_enabled) {\n+                is_known_msr = 1;\n+                whpx_bump_rip(cpu, &vcpu->exit_ctx);\n+                ret = whpx_handle_hyperv_guestidle(cpu);\n+                break;\n+            }\n+\n             /*\n              * Linux tries to use it anyway even when not exposed.\n              * Ignore the write as the VP assist page is not used.\n","prefixes":["PULL","46/58"]}