From nobody Mon Apr 13 12:17:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1772898182; cv=none; d=zohomail.com; s=zohoarc; b=ELdcryy2HrkjNUau1HdZYRLJeuWiIAFRYnxGBE72wDyWJS5opCobKm/HpPI76/4U6GT4ReXXmPf3dBD9mX+Vt0BPOvsC5pO1GLJFOcIDGHEbd4TXTpQTA2UVGyQK4Zfxx+LpG+DJPxovPubOHONw2hy8drx9avF74NEMKlVhDm8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772898182; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4TmqJMoXVEKb3HMgHzQp4gRnTyoFFXJDWRIsbiC4fMg=; b=ZTnk7YmN9iFnaC/6DvNFVaK9isFXOtrvZ0sONdG+QfewVdKV4Zkj2H/GflUG4e4VITlltauXuk9c+HiZwNxVqfNKi+BHfMjHtrs7yphgacz9HpPN4OKZpE3reRb5n0mI2kOk2Ksiu+NoNajdfeWdyKv+9HOwgrG4zzc2CTDPQ3o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1772898182055719.231595159407; Sat, 7 Mar 2026 07:43:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vytn6-0001BK-KZ; Sat, 07 Mar 2026 10:42:08 -0500 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 1vytmc-0000qz-96 for qemu-devel@nongnu.org; Sat, 07 Mar 2026 10:41:47 -0500 Received: from qs-2004b-snip4-2.eps.apple.com ([57.103.84.15] helo=outbound.qs.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vytmU-000220-Oq for qemu-devel@nongnu.org; Sat, 07 Mar 2026 10:41:33 -0500 Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-60-percent-0 (Postfix) with ESMTPS id A4EB41800887; Sat, 7 Mar 2026 15:41:25 +0000 (UTC) Received: from localhost.localdomain (unknown [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-60-percent-0 (Postfix) with ESMTPSA id 13FE718008B3; Sat, 7 Mar 2026 15:41:22 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1772898089; x=1775490089; bh=4TmqJMoXVEKb3HMgHzQp4gRnTyoFFXJDWRIsbiC4fMg=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=F6ZtOheDof1eRFvbg6u7W254/XWfqkXOA6R7TnUh2ZX5ljKJQ4lt1BLJ0Z2jghSkWNrnuSUioiDZoivBG1CjAGHcbbBzzdQv4Emh/2bPe5YhdjWeMpXCtQvznY3bciEnHZ4AzJoKyvdvcl0G7SMAKFptORC/1h8Edi3nq68s4uMwHF5w6wdq5n0pLG66x4WY+SX+zbXZMzMUWLfDiCmLpDmH2Qku0KSwVdYwfl9ktbSqgqVoSm94KujPjHhf3ZIrKW1JkoisoYmTxmagNTSQyPcjZQYRo8+Q8FLlaU64UM2wFry1m8sxLZjbaRRFIvURGxblkJ7i6+pMO93HQxOrxA== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Zhao Liu , Mohamed Mediouni , Phil Dennis-Jordan , Peter Maydell , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Roman Bolshakov , Wei Liu , Pedro Barbuda , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Subject: [PATCH v5 9/9] whpx: i386: remove SIPI trapping Date: Sat, 7 Mar 2026 16:41:04 +0100 Message-ID: <20260307154104.84567-10-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260307154104.84567-1-mohamed@unpredictable.fr> References: <20260307154104.84567-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: TwXcvAcxO-jxkDyDV4XaXZkxzziGiNwN X-Proofpoint-GUID: TwXcvAcxO-jxkDyDV4XaXZkxzziGiNwN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA3MDE0OSBTYWx0ZWRfX0SIHvIdOxHg9 ySwSsgJui+sLQLAFRKP38Jo5NecgMpfLeLVga9o63lDqG7KDEAhFI3tH2mKZk+87lBbyFoaPOnv CMkYn8aXcTIh25sFm1sdhSk+Y8XYfTdM+2/fXpHv9AQtZww6zSeY2ZaP39VETdekbg/KAFPF0Ux /SjnTa4tFBzUlA+V1Cf0dqe1VJj6y7IRbNnGyruUtkEcEKg7s5b9U/HjHGR+JOxodZtetyFs3ve SItc5TyxDIFoBTDrMJ/zLmOTAFXQ1KnoSmaWuZsPDwKfyxxnCVEUuoGfE/nP0UqD++4YW1dPQ/M aVx4AyvufZsW++AwMIh8eLVI3q3D9bgIkfFoOZiVMqFPYBqWv263g6YwYF7woI= X-Authority-Info-Out: v=2.4 cv=V/9wEOni c=1 sm=1 tr=0 ts=69ac4727 cx=c_apl:c_pps:t_out a=bsP7O+dXZ5uKcj+dsLqiMw==:117 a=bsP7O+dXZ5uKcj+dsLqiMw==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Xl7PRCIL3n5FuX7mVuoA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-07_05,2026-03-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 clxscore=1030 mlxlogscore=994 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2603070149 X-JNJ: AAAAAAABPa8AEV7HaH+GjlN4CgWo5tATV80sRRUm7KZSbvydmIqyL1QZyn0AcjAspLBA0kmZFZLy7z2eHwUCy1Zm0xe9plv4eMsTuH4G1/eUP6cO87yq0N+M/3LOIdAuRZu6psArCCLwR0KtUj/JQpsDbYFptWSvvP2pqoJihCRCVboD2bVdh9lGsDPqgRsr8qw8H9Ss3R05YF6YUBiYvk0H0z8QgNMsARUUltZeT1qv95QlyOG5OClaS5E0/e3LvgYKunmAGhgIh/N9Mlti9MQ9M0AjyEA/R7pkrp1e8Krw2lR3aClf3k101Bxeq7kPKzilcFEDew5lbzVVA0THeqme+9BSfycsEuXY+jhdrcpTAS7gUhcLNAC1UPyRTr+hS6xBhDy11Tb2yDMcOrbib+jfDotKYvhqg8nfot1Q1MtQ5B5TQGqfAamQD8iyP3LLpKZ9FJzCCrBeiOo44yxRBex599wMiPu5RnRh7j2BRanywVcKEHIJUDCwWvgpbUbuRjegVnXZcOLNmofBgZACv856R3Eyv5QnjL21KbdmfI2YcoLQ1yzyx+Se5m+wdQf79iEvlqcwy/BpMcNyqAdaeJnA6emno+4obHNXJyzrp7LsKjGHPkV6U/X+wi93vyZAHDmms56QOhxT6zydL2xfkAq4mB5ewpFJu48V8yfhSvdYbuTDMx5h8Atk5DDzGwfbE2PX9kKVG74jv+6pbqL8WsvfskfjkAYca+dtpT0Wr4ahB+b/QBGi1ULKDRfP18KI2NTUx6/Bfd9WhT2AAmec1RtlzGFAZUSouo9T Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=57.103.84.15; envelope-from=mohamed@unpredictable.fr; helo=outbound.qs.icloud.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1772898182581158500 Content-Type: text/plain; charset="utf-8" The implementation in Hyper-V works fine and the code currently present doesn't handle x2APIC correctly anyway, so remove it and use the implementation in Hyper-V. Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 97 ------------------------------------- 1 file changed, 97 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index b095c96962..4d5d3dbd24 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -1692,100 +1692,6 @@ int whpx_vcpu_run(CPUState *cpu) ret =3D whpx_handle_halt(cpu); break; =20 - case WHvRunVpExitReasonX64ApicInitSipiTrap: { - WHV_INTERRUPT_CONTROL ipi =3D {0}; - uint64_t icr =3D vcpu->exit_ctx.ApicInitSipi.ApicIcr; - uint32_t delivery_mode =3D - (icr & APIC_ICR_DELIV_MOD) >> APIC_ICR_DELIV_MOD_SHIFT; - int dest_shorthand =3D - (icr & APIC_ICR_DEST_SHORT) >> APIC_ICR_DEST_SHORT_SHIFT; - bool broadcast =3D false; - bool include_self =3D false; - uint32_t i; - - /* We only registered for INIT and SIPI exits. */ - if ((delivery_mode !=3D APIC_DM_INIT) && - (delivery_mode !=3D APIC_DM_SIPI)) { - error_report( - "WHPX: Unexpected APIC exit that is not a INIT or SIPI= "); - break; - } - - if (delivery_mode =3D=3D APIC_DM_INIT) { - ipi.Type =3D WHvX64InterruptTypeInit; - } else { - ipi.Type =3D WHvX64InterruptTypeSipi; - } - - ipi.DestinationMode =3D - ((icr & APIC_ICR_DEST_MOD) >> APIC_ICR_DEST_MOD_SHIFT) ? - WHvX64InterruptDestinationModeLogical : - WHvX64InterruptDestinationModePhysical; - - ipi.TriggerMode =3D - ((icr & APIC_ICR_TRIGGER_MOD) >> APIC_ICR_TRIGGER_MOD_SHIF= T) ? - WHvX64InterruptTriggerModeLevel : - WHvX64InterruptTriggerModeEdge; - - ipi.Vector =3D icr & APIC_VECTOR_MASK; - switch (dest_shorthand) { - /* no shorthand. Bits 56-63 contain the destination. */ - case 0: - ipi.Destination =3D (icr >> 56) & APIC_VECTOR_MASK; - hr =3D whp_dispatch.WHvRequestInterrupt(whpx->partition, - &ipi, sizeof(ipi)); - if (FAILED(hr)) { - error_report("WHPX: Failed to request interrupt hr=3D= %08lx", - hr); - } - - break; - - /* self */ - case 1: - include_self =3D true; - break; - - /* broadcast, including self */ - case 2: - broadcast =3D true; - include_self =3D true; - break; - - /* broadcast, excluding self */ - case 3: - broadcast =3D true; - break; - } - - if (!broadcast && !include_self) { - break; - } - - for (i =3D 0; i <=3D max_vcpu_index; i++) { - if (i =3D=3D cpu->cpu_index && !include_self) { - continue; - } - - /* - * Assuming that APIC Ids are identity mapped since - * WHvX64RegisterApicId & WHvX64RegisterInitialApicId regi= sters - * are not handled yet and the hypervisor doesn't allow the - * guest to modify the APIC ID. - */ - ipi.Destination =3D i; - hr =3D whp_dispatch.WHvRequestInterrupt(whpx->partition, - &ipi, sizeof(ipi)); - if (FAILED(hr)) { - error_report( - "WHPX: Failed to request SIPI for %d, hr=3D%08lx", - i, hr); - } - } - - break; - } - case WHvRunVpExitReasonCanceled: if (exclusive_step_mode !=3D WHPX_STEP_NONE) { /* @@ -2249,9 +2155,6 @@ int whpx_accel_init(AccelState *as, MachineState *ms) memset(&prop, 0, sizeof(WHV_PARTITION_PROPERTY)); prop.ExtendedVmExits.X64MsrExit =3D 1; prop.ExtendedVmExits.ExceptionExit =3D 1; - if (whpx_irqchip_in_kernel()) { - prop.ExtendedVmExits.X64ApicInitSipiExitTrap =3D 1; - } =20 hr =3D whp_dispatch.WHvSetPartitionProperty( whpx->partition, --=20 2.50.1 (Apple Git-155)