From nobody Sun Apr 12 00:55:04 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=1772571148; cv=none; d=zohomail.com; s=zohoarc; b=IdiM+UxMN5Wz5pxr8qwA7J1xQayddhFAWX3JHb0XkITkXAXKUpOxQZPZDwc25s0QIOnW5//ONjpHfqt2P2+PoDZ3/Ep5daQ0iQ1CPeCjhgVxm6Ycvm5sNp5hvP7Am7budA6PfFxN6IRldPfFOX73pnMt6I/Cd0iE/Km3KWQSjEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772571148; 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=xfi6rjeDQo4vpSHmbqs0x+tY5PCeD7vMjLpTj63mmJI=; b=dJ9gfF+52ofedLZdQcCdXXkA30abaY0md0GH93zFGHp3kJrbAcfAxDatVUDcCED35czCs10begKkZfjVbInlUlnl+oAHyN9H5ED2/7bWNdnRZE9wC7pCu9LirQUbYN+lBBk1lK7riWh1sTX/+BbN6bIXDVM15EKmddYcysvuetE= 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 1772571148731674.1371354671102; Tue, 3 Mar 2026 12:52:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vxWhK-0006BW-Mf; Tue, 03 Mar 2026 15:50:30 -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 1vxWhH-00068q-6Y for qemu-devel@nongnu.org; Tue, 03 Mar 2026 15:50:27 -0500 Received: from p-east2-cluster6-host10-snip4-4.eps.apple.com ([57.103.76.205] 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 1vxWhF-0000nt-99 for qemu-devel@nongnu.org; Tue, 03 Mar 2026 15:50:26 -0500 Received: from outbound.st.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-1a-20-percent-2 (Postfix) with ESMTPS id F1F3F180012C; Tue, 3 Mar 2026 20:50:20 +0000 (UTC) Received: from localhost.localdomain (unknown [17.42.251.67]) by p00-icloudmta-asmtp-us-east-1a-20-percent-2 (Postfix) with ESMTPSA id 734571800580; Tue, 3 Mar 2026 20:50:18 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1772571024; x=1775163024; bh=xfi6rjeDQo4vpSHmbqs0x+tY5PCeD7vMjLpTj63mmJI=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=gylOBL219wo9mpENOvJe3UyCADKcXdPd2ypLZG+fBRLQiMYazjUDX+GuZBGkKHm2rjlcbE4KMkarVXswfQT5cJn2XALB4MAonC4pHzXAuN2SNPQE0z0VZJyxkDcd29hKCjAEROqqKUDMgDSqqn3R0IaWK5IpxWYftvjDmNBaesoJCSD99/r0F8ExbEri1C/CP/BJWMHM81NFoA8DrGm37OG4Dx/EYP+n0pM44nCoz1tzKm4bVdLoxhUiDlY9fNS4Ei0nxFMdvlwy5TeXzhO8Q4vOFKPjQKBeLlvQkbTAB2f59lJdb7HVQefi8LGweONhcfeFREufOgbm55iMeSfQ7Q== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Zhao Liu , Pedro Barbuda , "Michael S. Tsirkin" , Cameron Esfahani , Mohamed Mediouni , Peter Maydell , Roman Bolshakov , Phil Dennis-Jordan , qemu-arm@nongnu.org, Wei Liu Subject: [PATCH v3 9/9] whpx: i386: remove SIPI trapping Date: Tue, 3 Mar 2026 21:49:59 +0100 Message-ID: <20260303204959.31156-10-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260303204959.31156-1-mohamed@unpredictable.fr> References: <20260303204959.31156-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: mzhYWAyi_613Jwd4bpiBuTmORIiMM3rO X-Proofpoint-ORIG-GUID: mzhYWAyi_613Jwd4bpiBuTmORIiMM3rO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAzMDE3MSBTYWx0ZWRfX0z/KigJAZAp2 TWtvnB+44FINTwfORfTx1/WXjqqwdcSe8wMiigD5X9M2Ti2z34GxLE8za/pho0+2mUBRMxPSDgp kLEIe4zngVjBjjf3JPxZQdopqaCFWJZETFZu9VPLSSmN5YM2K7PMSbT9bmsg6ZFpBzrFuUEBApe KZ+ZQTzIaB1uiujdbvRr9X7hMgUMLz0zGbyhFWqT9Wd1V6lxxVmNG/XRiMnLsH2nYcvtUHTdLy6 GrS3NUf1AW5chn+YlxUvgYkpXmbhNCdeAhv7LJRMMwBvkm3z409mL1LnOZ//Sd/iQsKFawmH/0h LsxRvK9C8b9tro0Z7Qu6C88g2YuNTJDSVdZl+bpz1Cfc/bNWk3fLLR6uHeXdVU= X-Authority-Info-Out: v=2.4 cv=H4jWAuYi c=1 sm=1 tr=0 ts=69a7498e cx=c_apl:c_pps:t_out a=YrL12D//S6tul8v/L+6tKg==:117 a=YrL12D//S6tul8v/L+6tKg==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Xl7PRCIL3n5FuX7mVuoA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-03_03,2026-03-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=997 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1030 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 spamscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2603030171 X-JNJ: AAAAAAABCLcq71L/nAeaqvrS3vPU4gHNlLZ9/ZhxGO9u5sTOjbwjlIZDliblJRi1ssLIfnPqDOBEtHMqi0kuth//nX9asOABqFZqwXo6cVH09eOqscDMDHPhc5CuxFZPhJtb18oxrjH0h57TGXbJ09Ow5j94jOipXEQEU7tutCw0Z+i3xqHFaf12RW74Y3FBdArDQRFUDOLYhOwf64sft4JOXfla/zVJtTN81xHdk7jM5Zm51S5XDwXgf+LaVnmi+Ypk6Fs4cNnt6Xf7uzS/PunGT8KKVO/lG/3GCnteJ0ns6Sc5UiOx0uECiCRvIK1nAXnxputr2xxR1wNMTM2K4K13tj5TSTWgXDNDQr1ql53O6oebN03eVtbouhYUlfZTYbM7TkE/crfz8lEKgtt8XRUlCu8Bo0WM+xIzCJwtSgfIuObbEaolmjJufBEr39AjblItCycq2d6vQjo85mEyIma7dmtmBqIkuWjdzKdkXJmYj4J5dNOTs2ChaDodnhcRTd2jYyP9UjJdV/j0ayTALz1/ww5O7jq37SRA555qhGMjDdwh4iSu4qulZdeHx86JfQ0Hzn36tK9NxIjtPHJWvlqyUMKZkzbRbGon9TJZdUrUPyYBFkDplxzPAUi7YY8vX2/oW/6AIHrxSBzU/k1rg5SUIq3i1zMQBTcaYyO5tcfhM0umLOxm/It+n6WB5TM6TuUUvffpnOdwEUIprjzzPvNwM0jWXP0WE08Laibx7KzTM2ypRl53qvJEfz2oDWuDH2rlPmOc 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.76.205; envelope-from=mohamed@unpredictable.fr; helo=outbound.st.icloud.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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.322, RCVD_IN_VALIDITY_SAFE_BLOCKED=1.141, 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: 1772571152141158500 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 4968a5a3e4..fa78218f80 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -1679,100 +1679,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) { /* @@ -2236,9 +2142,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)