From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07E4FCCD183 for ; Thu, 16 Oct 2025 20:22:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v9UTS-0005ne-Is; Thu, 16 Oct 2025 16:21:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v9UTP-0005l7-Dl for qemu-devel@nongnu.org; Thu, 16 Oct 2025 16:21:19 -0400 Received: from p-east2-cluster5-host1-snip4-8.eps.apple.com ([57.103.79.11] helo=outbound.st.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v9UTJ-000106-Of for qemu-devel@nongnu.org; Thu, 16 Oct 2025 16:21:18 -0400 Received: from outbound.st.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-1a-60-percent-2 (Postfix) with ESMTPS id C37C118002FA; Thu, 16 Oct 2025 20:21:08 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=h7u/XWsux0pmMZnA7+paR99F4ZhLVNBkIu/tmCtAH0I=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=YEgPW3ffV8FRjRpnj3kpllUYohNCdA+16xl+hsFsqyPIDUDCEvr31xZdYE2laRZwytlcYsxHMnp0+0uniOAVz0tBrzcF1/kUgS/cpf48a9PKFaebr4EDqLq25VyWjIzKsQBpciU8/iF/VU1k8HBCYTDgR8JqXz3JsoBVKenuSgTk5J1ldzouqDecIrc4xW0Rh1aIPKllqKJGeo7iqRiBeFxQZgmqZhvexgtvIcPFoc1ONPF2j58/0rrfHrvN/ok5LmjP0drTGOlg5LOWikZPoR2pWEwOcZTz/SQvIAlg1v5MDz6B4yave+Y7qiqr/unVy3cnm7wYFhOFvl52tTOQdQ== mail-alias-created-date: 1752046281608 Received: from localhost.localdomain (unknown [17.42.251.67]) by p00-icloudmta-asmtp-us-east-1a-60-percent-2 (Postfix) with ESMTPSA id D593118005F6; Thu, 16 Oct 2025 20:21:04 +0000 (UTC) From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Pedro Barbuda , qemu-arm@nongnu.org, Peter Maydell , Mohamed Mediouni , Paolo Bonzini , Phil Dennis-Jordan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Pierrick Bouvier Subject: [PATCH v9 10/24] hw, target, accel: whpx: change apic_in_platform to kernel_irqchip Date: Thu, 16 Oct 2025 22:20:30 +0200 Message-ID: <20251016202044.75261-11-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251016202044.75261-1-mohamed@unpredictable.fr> References: <20251016202044.75261-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: C7oEKbrd8wSU04x7dnCeqCWtXcPEgkOj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE2MDE1MSBTYWx0ZWRfX60YmZwLNf1pR nic2ImIGWhQYp0nAB2GXOEzkYxoOhFzrcj9/z3scyPnEKSRJ5nGCUOYz0R2nrB/hTBBUq9fIWFO 1eLqDuiRzrIDUlMpqqt5JhQ3Nb707s/ioDLHTpnsn9jqmwsiMC1aeBJhCc1/3vweEEF1C7d+w/N m81oVhqdhvfdoZcmwD91EAW1vpZL6GupJDFGETKM/H5dIcU6OGstU8BWYjObCY4uhgCHZGS9l+O 2e42w6aaxX9YFtbLYWFaH6zZNXFQnnIjH1vPvdMtwYaEEH9arSuWxN+ZtwXUdVTBdstVfU8gQ= X-Proofpoint-GUID: C7oEKbrd8wSU04x7dnCeqCWtXcPEgkOj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-16_04,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 phishscore=0 mlxlogscore=862 bulkscore=0 malwarescore=0 mlxscore=0 spamscore=0 clxscore=1030 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2510160151 X-JNJ: AAAAAAABBsfqEe4nmChG1BmgzDj3ZUNyYAZsfbl/1VsYA8CiVTeJc6FteehA1Nz8aCNlvsUoxH5Y6+vF0ke9zt9B4u6N+DFcUhOXPAzQSPhGQ9xHGMXjPkThBD9KUIexl5hPJEliEJGgElMmd1tM3IrA4zv4NBOW5O2nwY/A3RLEt2qDbE8A+GmGKGP+cRrSyaboJyku8y7NwNfvWwu6DAKhMvVK6dwsEvKG+cmy5QEj6n8KBfJLQrOdxqW+oVpybDYbTKyGG8s1nTVVdwk7EYX3RkNiyRRkIIGNQjH5/9gpkIvub9VNZlojM2C/DgwHTvoM+g/5oA8MlbDBvXYV3/YRhfZnlSXIFuK3VMIQsxtGNJo1FG9fOfMCz+RQQ3kp1HYWNALnJXjfMyA5cC+k1dKKDq0KN4BtDFTw5jAQ4bhyeLKAvIXhEhve6nHq9fxfmZPHEwX6JavY2VI/Y98P7i4/ifCJvvBMf8E1aVzFQPtaoOVB/l7t7qvRc8Nc5k77uv2rACDzu2TkM/MHY5Ka+/v1rWqotgBZAclKUWMpvEUnqqof8umLbQXkbvv6etP6zpwHy5kSaPweXuGF4JxYfBG2C3yChFg3+EQTg0fDHTNqerU6p5ePt0UstBOMik7z2spnmxLLROpDeubRHCOkwJLhpleJ0xNLiLCHNyaj50uG2JH4McgM+WHgDkTt5UdhVcOsVA== Received-SPF: pass client-ip=57.103.79.11; envelope-from=mohamed@unpredictable.fr; helo=outbound.st.icloud.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_SPF_HELO=1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Change terminology to match the KVM one, as APIC is x86-specific. Signed-off-by: Mohamed Mediouni Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/whpx/whpx-accel-ops.c | 2 +- accel/whpx/whpx-common.c | 4 ++-- hw/i386/x86-cpu.c | 4 ++-- include/system/whpx-internal.h | 2 +- include/system/whpx.h | 4 ++-- target/i386/cpu-apic.c | 2 +- target/i386/whpx/whpx-all.c | 14 +++++++------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/accel/whpx/whpx-accel-ops.c b/accel/whpx/whpx-accel-ops.c index c84a25c273..50fadea0fd 100644 --- a/accel/whpx/whpx-accel-ops.c +++ b/accel/whpx/whpx-accel-ops.c @@ -78,7 +78,7 @@ static void whpx_kick_vcpu_thread(CPUState *cpu) static bool whpx_vcpu_thread_is_idle(CPUState *cpu) { - return !whpx_apic_in_platform(); + return !whpx_irqchip_in_kernel(); } static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index c0ff6cacb8..18d93225c1 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -496,9 +496,9 @@ static const TypeInfo whpx_cpu_accel_type = { * Partition support */ -bool whpx_apic_in_platform(void) +bool whpx_irqchip_in_kernel(void) { - return whpx_global.apic_in_platform; + return whpx_global.kernel_irqchip; } static void whpx_accel_class_init(ObjectClass *oc, const void *data) diff --git a/hw/i386/x86-cpu.c b/hw/i386/x86-cpu.c index c876e6709e..778607e7ca 100644 --- a/hw/i386/x86-cpu.c +++ b/hw/i386/x86-cpu.c @@ -45,7 +45,7 @@ static void pic_irq_request(void *opaque, int irq, int level) trace_x86_pic_interrupt(irq, level); if (cpu_is_apic_enabled(cpu->apic_state) && !kvm_irqchip_in_kernel() && - !whpx_apic_in_platform()) { + !whpx_irqchip_in_kernel()) { CPU_FOREACH(cs) { cpu = X86_CPU(cs); if (apic_accept_pic_intr(cpu->apic_state)) { @@ -71,7 +71,7 @@ int cpu_get_pic_interrupt(CPUX86State *env) X86CPU *cpu = env_archcpu(env); int intno; - if (!kvm_irqchip_in_kernel() && !whpx_apic_in_platform()) { + if (!kvm_irqchip_in_kernel() && !whpx_irqchip_in_kernel()) { intno = apic_get_interrupt(cpu->apic_state); if (intno >= 0) { return intno; diff --git a/include/system/whpx-internal.h b/include/system/whpx-internal.h index e57d2c8526..366bc525a3 100644 --- a/include/system/whpx-internal.h +++ b/include/system/whpx-internal.h @@ -42,7 +42,7 @@ struct whpx_state { bool kernel_irqchip_allowed; bool kernel_irqchip_required; - bool apic_in_platform; + bool kernel_irqchip; }; extern struct whpx_state whpx_global; diff --git a/include/system/whpx.h b/include/system/whpx.h index 00f6a3e523..98fe045ba1 100644 --- a/include/system/whpx.h +++ b/include/system/whpx.h @@ -26,10 +26,10 @@ #ifdef CONFIG_WHPX_IS_POSSIBLE extern bool whpx_allowed; #define whpx_enabled() (whpx_allowed) -bool whpx_apic_in_platform(void); +bool whpx_irqchip_in_kernel(void); #else /* !CONFIG_WHPX_IS_POSSIBLE */ #define whpx_enabled() 0 -#define whpx_apic_in_platform() (0) +#define whpx_irqchip_in_kernel() (0) #endif /* !CONFIG_WHPX_IS_POSSIBLE */ #endif /* QEMU_WHPX_H */ diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c index 242a05fdbe..d4d371a616 100644 --- a/target/i386/cpu-apic.c +++ b/target/i386/cpu-apic.c @@ -32,7 +32,7 @@ APICCommonClass *apic_get_class(Error **errp) apic_type = "kvm-apic"; } else if (xen_enabled()) { apic_type = "xen-apic"; - } else if (whpx_apic_in_platform()) { + } else if (whpx_irqchip_in_kernel()) { apic_type = "whpx-apic"; } diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index d1f8e49cb2..feabbec427 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -607,7 +607,7 @@ void whpx_get_registers(CPUState *cpu) hr); } - if (whpx_apic_in_platform()) { + if (whpx_irqchip_in_kernel()) { /* * Fetch the TPR value from the emulated APIC. It may get overwritten * below with the value from CR8 returned by @@ -749,7 +749,7 @@ void whpx_get_registers(CPUState *cpu) assert(idx == RTL_NUMBER_OF(whpx_register_names)); - if (whpx_apic_in_platform()) { + if (whpx_irqchip_in_kernel()) { whpx_apic_get(x86_cpu->apic_state); } @@ -1379,7 +1379,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) } /* Get pending hard interruption or replay one that was overwritten */ - if (!whpx_apic_in_platform()) { + if (!whpx_irqchip_in_kernel()) { if (!vcpu->interruption_pending && vcpu->interruptable && (env->eflags & IF_MASK)) { assert(!new_int.InterruptionPending); @@ -1552,7 +1552,7 @@ int whpx_vcpu_run(CPUState *cpu) if (exclusive_step_mode == WHPX_STEP_NONE) { whpx_vcpu_process_async_events(cpu); - if (cpu->halted && !whpx_apic_in_platform()) { + if (cpu->halted && !whpx_irqchip_in_kernel()) { cpu->exception_index = EXCP_HLT; qatomic_set(&cpu->exit_request, false); return 0; @@ -1641,7 +1641,7 @@ int whpx_vcpu_run(CPUState *cpu) break; case WHvRunVpExitReasonX64ApicEoi: - assert(whpx_apic_in_platform()); + assert(whpx_irqchip_in_kernel()); ioapic_eoi_broadcast(vcpu->exit_ctx.ApicEoi.InterruptVector); break; @@ -2186,7 +2186,7 @@ int whpx_accel_init(AccelState *as, MachineState *ms) goto error; } } else { - whpx->apic_in_platform = true; + whpx->kernel_irqchip = true; } } @@ -2195,7 +2195,7 @@ int whpx_accel_init(AccelState *as, MachineState *ms) prop.ExtendedVmExits.X64MsrExit = 1; prop.ExtendedVmExits.X64CpuidExit = 1; prop.ExtendedVmExits.ExceptionExit = 1; - if (whpx_apic_in_platform()) { + if (whpx_irqchip_in_kernel()) { prop.ExtendedVmExits.X64ApicInitSipiExitTrap = 1; } -- 2.50.1 (Apple Git-155)