Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2231469/?format=api
{ "id": 2231469, "url": "http://patchwork.ozlabs.org/api/patches/2231469/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-46-pbonzini@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": "<20260430172204.1006673-46-pbonzini@redhat.com>", "list_archive_url": null, "date": "2026-04-30T17:21:51", "name": "[PULL,45/58] target: i386: HLT type that ignores EFLAGS.IF", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f7a2f8466aa64a8563011acfa9885cf3d551db6b", "submitter": { "id": 2701, "url": "http://patchwork.ozlabs.org/api/people/2701/?format=api", "name": "Paolo Bonzini", "email": "pbonzini@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-46-pbonzini@redhat.com/mbox/", "series": [ { "id": 502347, "url": "http://patchwork.ozlabs.org/api/series/502347/?format=api", "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/2231469/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231469/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=C2TkZQK/;\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=K83DfbDG;\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 4g61Tz2jBNz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 03:33:11 +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 1wIV7s-0000Hh-Um; Thu, 30 Apr 2026 13:24:37 -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 1wIV7p-0008Oo-LU\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:24:33 -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 1wIV7n-0004tk-JS\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:24:33 -0400", "from mail-qk1-f197.google.com (mail-qk1-f197.google.com\n [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-691-lqc0s5CsN76z2e8VvrKgJg-1; Thu, 30 Apr 2026 13:24:29 -0400", "by mail-qk1-f197.google.com with SMTP id\n af79cd13be357-8eacc2008b2so224529285a.3\n for <qemu-devel@nongnu.org>; Thu, 30 Apr 2026 10:24:29 -0700 (PDT)", "from [192.168.10.48] ([151.49.85.67])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8fbb430fed8sm22495485a.41.2026.04.30.10.24.25\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 10:24:26 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777569870;\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=XzkvcbiWP5MOo9vAJOAasVb4pDl+/ni1HFtBLV+7Xec=;\n b=C2TkZQK/mfkRvVsmr0rtNcePxPfy7//smITvkgVkHn2d2Zsz7QJZnX9qJh2SVqjzo7fhM/\n 7T83YmDf+yY2oqSzOYKfANomxJ3rzZ5IhWMWCX1BaI1Ub03gkxd5LSWjKnJu8dWCFxJby7\n o9ezqCLVv49h2KEL1N8Zsdryiiw+fPI=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1777569868; x=1778174668; 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=XzkvcbiWP5MOo9vAJOAasVb4pDl+/ni1HFtBLV+7Xec=;\n b=K83DfbDGqamy5DTRlrcN4nTz0sG0poo9A7/lDaOGr6CXzE+bBMQsuGuGcHDpIlg8qT\n 5KiiFojU1E//qa/8nCo9jB1kDsZrzPU9a+ErQv4uKo7Ld3/lQZqtWbMJ4iyp2cf+Vic2\n kr+YcB8XqCK1ran0bCMZncIvQlGdO3LjPqjKx5ZS2w0nuYL9cnc5IRVyAlfa7p/jtwa/\n /ZF+uSSdohO8AA/RlHYwzMO3T2ZLb599eQmyKJdRkhgXLikHuam26jvEGyp+POd0AHPs\n kAZNxrHvymgn2n3pxI8fiYP1ysKf4NV+rT0b9ND4rgTFSjSy3awXUtQET0HsaEMNMz/V\n T5MQ==" ], "X-MC-Unique": "lqc0s5CsN76z2e8VvrKgJg-1", "X-Mimecast-MFC-AGG-ID": "lqc0s5CsN76z2e8VvrKgJg_1777569869", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777569868; x=1778174668;\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=XzkvcbiWP5MOo9vAJOAasVb4pDl+/ni1HFtBLV+7Xec=;\n b=CSq+kahp4tYpHz8zzCfCk2maz+T+oUCMOA5HqTyNxihA69trYKbAMutuUv5vwd3zkC\n EgebeiuDEoLrnY3vjFicEd3nrk/XsSHxTk1y1VXKQpOw9BDeVgoc4cS6cbGhFoglPo5D\n JxiVozXRIpC4uciOawd8HMwphAgjJcil3AqzLNy2tqFLCEnjcM6+IFRMBORWJbscRfDa\n yHvkis9VN9bxhd9gPW/VpG3o+zhSBnga8vCey2CcAUYHF1XD9GGpNxjXX2a8piZgm1/Q\n a3JbKjpfGHN6EYW5JcyMmQITh4OXQ8omsS18AhdOCvK74BIA6coNUNs42Wv8uHN1HzSH\n tYow==", "X-Gm-Message-State": "AOJu0Yza/gp37T+kb/N/ikuizBkHtTYuKeGno0d5Ns8dTDuSKRvGClyr\n SWqqz4G70+9B+i3ZPsQC2lJxy+G+CYeBQjg53z2rVaRboOdxmv7ffZBH2/7Jwnf1RRTFvEngZdQ\n 9hxZF2ElsYH/tUvRLYSD7b3sSodXmIhcvGrtz1IDVqGRoFt24XhC9+GDasQ9BxCytETWDA6+tQt\n Hb9J0ijk2yv3AWznuJMNu5MW/uD1QhbBJuseH1emlK", "X-Gm-Gg": "AeBDievHYP48hIhWGMDIUAEoa2nttakZ07b5t4hHg6Sez4QsKNpniuBZKz514/TgGbi\n v1Bb5jTaOD+YdmjqTSYi0UNvFRrD8Hx6AlSRu02fX4SD8wzTH3QYPjBoFA5sunR/ivCPehn5A8k\n ega6nbi3yBWR5BsXezvbm7W7zEYOI5WVD13HoCP3ruT7bam8VJfLidcDnXwqvCL8Fi65kEi9uCQ\n 2/v5Li4WDlNNnH7Cat+Gx+LNWe9kTmWVug6kQNKn9FQxX/gYvQgzODo3HeITR5qxtpaIIMXDMGO\n DKa2kf6sAcWL+iYdYWyXaSRcAXjV33hJx2mZqqaYoFCb1vb5f2x8qvow4C7KIAqgN+pGEpOEhXs\n 9+ACtkUW7rel3RYsYwAkSRXe68MqEUPGpe1jRcs73Wu+MIcQbfk0UpTLyGUf/oHovUFf9JWzpmo\n 7ev/CJZOJcXrxtJnsjzedeyPtYKvfN3k7Zyws=", "X-Received": [ "by 2002:a05:620a:4107:b0:8cd:b317:a0b3 with SMTP id\n af79cd13be357-8fa86fa786fmr600894485a.24.1777569868299;\n Thu, 30 Apr 2026 10:24:28 -0700 (PDT)", "by 2002:a05:620a:4107:b0:8cd:b317:a0b3 with SMTP id\n af79cd13be357-8fa86fa786fmr600886785a.24.1777569867674;\n Thu, 30 Apr 2026 10:24:27 -0700 (PDT)" ], "From": "Paolo Bonzini <pbonzini@redhat.com>", "To": "qemu-devel@nongnu.org", "Cc": "Mohamed Mediouni <mohamed@unpredictable.fr>", "Subject": "[PULL 45/58] target: i386: HLT type that ignores EFLAGS.IF", "Date": "Thu, 30 Apr 2026 19:21:51 +0200", "Message-ID": "<20260430172204.1006673-46-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\nThe TLFS says:\n\n> A partition which possesses the AccessGuestIdleMsr privilege may trigger\n> entry into the virtual processor idle sleep state through a read to the\n> hypervisor-defined MSR HV_X64_MSR_GUEST_IDLE. The virtual processor will\n> be woken when an interrupt arrives, regardless of whether the interrupt\n> is enabled on the virtual processor or not.\n\nMeanwhile, Windows 24H2+ calls this MSR anyway without the privilege being set.\n\nAdd the infrastructure to support it on the generic QEMU side.\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\nLink: https://lore.kernel.org/r/20260422214225.2242-22-mohamed@unpredictable.fr\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n target/i386/cpu.h | 9 +++++++++\n target/i386/cpu.c | 10 ++++------\n target/i386/hvf/x86hvf.c | 4 ++--\n target/i386/whpx/whpx-all.c | 5 ++++-\n 4 files changed, 19 insertions(+), 9 deletions(-)", "diff": "diff --git a/target/i386/cpu.h b/target/i386/cpu.h\nindex 6401028e70d..c14237967b5 100644\n--- a/target/i386/cpu.h\n+++ b/target/i386/cpu.h\n@@ -225,6 +225,7 @@ typedef enum X86Seg {\n #define HF2_NPT_SHIFT 6 /* Nested Paging enabled */\n #define HF2_IGNNE_SHIFT 7 /* Ignore CR0.NE=0 */\n #define HF2_VGIF_SHIFT 8 /* Can take VIRQ*/\n+#define HF2_HYPERV_HLT_SHIFT 9 /* Hyper-V HV_X64_MSR_GUEST_IDLE */\n \n #define HF2_GIF_MASK (1 << HF2_GIF_SHIFT)\n #define HF2_HIF_MASK (1 << HF2_HIF_SHIFT)\n@@ -235,6 +236,7 @@ typedef enum X86Seg {\n #define HF2_NPT_MASK (1 << HF2_NPT_SHIFT)\n #define HF2_IGNNE_MASK (1 << HF2_IGNNE_SHIFT)\n #define HF2_VGIF_MASK (1 << HF2_VGIF_SHIFT)\n+#define HF2_HYPERV_HLT_MASK (1 << HF2_HYPERV_HLT_SHIFT)\n \n #define CR0_PE_SHIFT 0\n #define CR0_MP_SHIFT 1\n@@ -3085,6 +3087,13 @@ static inline bool ctl_has_irq(CPUX86State *env)\n return (env->int_ctl & V_IRQ_MASK) && (int_prio >= tpr);\n }\n \n+static inline bool x86_cpu_interrupts_enabled(CPUX86State *env)\n+{\n+ return ((env->eflags & IF_MASK) &&\n+ !(env->hflags & HF_INHIBIT_IRQ_MASK)) ||\n+ (env->hflags2 & HF2_HYPERV_HLT_MASK);\n+}\n+\n #if defined(TARGET_X86_64) && \\\n defined(CONFIG_USER_ONLY) && \\\n defined(CONFIG_LINUX)\ndiff --git a/target/i386/cpu.c b/target/i386/cpu.c\nindex 7ea80f07c7c..efe7ba014d3 100644\n--- a/target/i386/cpu.c\n+++ b/target/i386/cpu.c\n@@ -10617,14 +10617,12 @@ int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request)\n (((env->hflags2 & HF2_VINTR_MASK) &&\n (env->hflags2 & HF2_HIF_MASK)) ||\n (!(env->hflags2 & HF2_VINTR_MASK) &&\n- (env->eflags & IF_MASK &&\n- !(env->hflags & HF_INHIBIT_IRQ_MASK))))) {\n+ x86_cpu_interrupts_enabled(env)))) {\n return CPU_INTERRUPT_HARD;\n } else if (env->hflags2 & HF2_VGIF_MASK) {\n- if((interrupt_request & CPU_INTERRUPT_VIRQ) &&\n- (env->eflags & IF_MASK) &&\n- !(env->hflags & HF_INHIBIT_IRQ_MASK)) {\n- return CPU_INTERRUPT_VIRQ;\n+ if ((interrupt_request & CPU_INTERRUPT_VIRQ) &&\n+ x86_cpu_interrupts_enabled(env)) {\n+ return CPU_INTERRUPT_VIRQ;\n }\n }\n }\ndiff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c\nindex bb480311b0f..16b810f3c2e 100644\n--- a/target/i386/hvf/x86hvf.c\n+++ b/target/i386/hvf/x86hvf.c\n@@ -405,9 +405,9 @@ bool hvf_inject_interrupts(CPUState *cs)\n }\n }\n \n- if (!(env->hflags & HF_INHIBIT_IRQ_MASK) &&\n+ if (x86_cpu_interrupts_enabled(env) &&\n cpu_test_interrupt(cs, CPU_INTERRUPT_HARD) &&\n- (env->eflags & IF_MASK) && !(info & VMCS_INTR_VALID)) {\n+ !(info & VMCS_INTR_VALID)) {\n int line = cpu_get_pic_interrupt(env);\n cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);\n if (line >= 0) {\ndiff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c\nindex 11c9d8729fa..bc8d673c31a 100644\n--- a/target/i386/whpx/whpx-all.c\n+++ b/target/i386/whpx/whpx-all.c\n@@ -1630,11 +1630,14 @@ static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exit_context_valid)\n \n static int whpx_handle_halt(CPUState *cpu)\n {\n+ X86CPU *x86_cpu = X86_CPU(cpu);\n+ CPUX86State *env = &x86_cpu->env;\n+\n int ret = 0;\n \n bql_lock();\n if (!(cpu_test_interrupt(cpu, CPU_INTERRUPT_HARD) &&\n- (cpu_env(cpu)->eflags & IF_MASK)) &&\n+ x86_cpu_interrupts_enabled(env)) &&\n !cpu_test_interrupt(cpu, CPU_INTERRUPT_NMI)) {\n cpu->exception_index = EXCP_HLT;\n cpu->halted = true;\n", "prefixes": [ "PULL", "45/58" ] }