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 BEA8FC87FDA for ; Fri, 8 Aug 2025 07:03:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukH7q-0007Aq-Sj; Fri, 08 Aug 2025 03:02:50 -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 1ukH7D-0006D2-Rj for qemu-arm@nongnu.org; Fri, 08 Aug 2025 03:02:16 -0400 Received: from p-east3-cluster5-host8-snip4-1.eps.apple.com ([57.103.86.202] 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 1ukH7B-0005HV-Vy for qemu-arm@nongnu.org; Fri, 08 Aug 2025 03:02:11 -0400 Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-100-percent-5 (Postfix) with ESMTPS id CAEDC180011B; Fri, 8 Aug 2025 07:02:05 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=0S6v8Tybtmg8DehY+/ufHI0MTv15GAaksGdzRj7wi/E=; h=From:To:Subject:Date:Message-Id:MIME-Version:x-icloud-hme; b=S+EjT9gIkmqzjdnWB2GPrU8ln1tVVyLQ6hzn6/9nEPgHzP3j9vwa2u/XTdYzagqZ82ZU/ReCL6wjfMsjVswkVxhNK786GoabG8GCKFD9LyDZ842pt3ZKA+/hJvbZrKuLxHprnEnAmQGa/m45Gscbivqda49R+kjZZsYZE2VaiRe6V3CNuhPLGM+jVa1hB5svj0YUVEziN3hUTjqXOid/5sJcKvIldY9pTmRI1SKPg9iMus0LDpdSQltE/RBQEP3fdQJ3v0jC7blXFW4k0BYT0TIRSp9xiPQguNdMuS79FyUH1hSUT67q+odDKOLjNUs0nFFZRlafI6PD+MxoDti//g== X-Client-IP: 46.189.47.18 Received: from localhost.localdomain (qs-asmtp-me-k8s.p00.prod.me.com [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-100-percent-5 (Postfix) with ESMTPSA id 4A8B8180015E; Fri, 8 Aug 2025 07:02:03 +0000 (UTC) From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Peter Maydell , Shannon Zhao , "Michael S. Tsirkin" , Ani Sinha , qemu-arm@nongnu.org, Paolo Bonzini , Roman Bolshakov , Igor Mammedov , Phil Dennis-Jordan , Alexander Graf , Mads Ynddal , Cameron Esfahani , Mohamed Mediouni Subject: [PATCH v6 13/13] target/arm: hvf: add asserts for code paths not leveraged when using the vGIC Date: Fri, 8 Aug 2025 09:01:37 +0200 Message-Id: <20250808070137.48716-14-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250808070137.48716-1-mohamed@unpredictable.fr> References: <20250808070137.48716-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: m9-XphNJAHy0xJX7wan7b67Bzd0FzCkM X-Proofpoint-ORIG-GUID: m9-XphNJAHy0xJX7wan7b67Bzd0FzCkM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA4MDA1NyBTYWx0ZWRfX7jogIbiRjShB wAZJjyLfy61UvjaLBpq55Snw01RomcTK9u6+1l9IO332VfzpPSVLygwR7BBphShvI+ozXnZTRE5 pJzsbjSG2kOr2Laqb741YdNspuRpDFLdkgPdxFr2y3TOeibH9+RznbRx7Jx2A5zBUCXzddWbYQJ v2kIerB2koAJud1qwheiI8Nu9UFJ3uVSDB7AgiLAIb3FJUeWhUuYP6AX1PcA5IH7iX2vyUXI/xD aHQ7BiSMUyVsb7rxbPOtFgiZ2+ZAZTOAZKnAYJROhdAOQI3VunY6bpg9yoC6BDdeu2S9UfnZg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-08_01,2025-08-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 mlxlogscore=598 mlxscore=0 spamscore=0 bulkscore=0 clxscore=1030 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2508080057 Received-SPF: pass client-ip=57.103.86.202; envelope-from=mohamed@unpredictable.fr; helo=outbound.qs.icloud.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org When using the vGIC, timers are directly handled by the platform. No vmexits ought to happen in that case. Abort if reaching those code paths. Signed-off-by: Mohamed Mediouni --- target/arm/hvf/hvf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index bb7b84ff35..1d285c70d8 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1477,6 +1477,7 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, uint64_t *val) case SYSREG_ICC_SGI1R_EL1: case SYSREG_ICC_SRE_EL1: case SYSREG_ICC_CTLR_EL1: + assert(!hvf_irqchip_in_kernel()); /* Call the TCG sysreg handler. This is only safe for GICv3 regs. */ if (hvf_sysreg_read_cp(cpu, reg, val)) { return 0; @@ -1803,6 +1804,7 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t reg, uint64_t val) case SYSREG_ICC_SGI0R_EL1: case SYSREG_ICC_SGI1R_EL1: case SYSREG_ICC_SRE_EL1: + assert(!hvf_irqchip_in_kernel()); /* Call the TCG sysreg handler. This is only safe for GICv3 regs. */ if (hvf_sysreg_write_cp(cpu, reg, val)) { return 0; @@ -2066,6 +2068,7 @@ int hvf_vcpu_exec(CPUState *cpu) /* This is the main one, handle below. */ break; case HV_EXIT_REASON_VTIMER_ACTIVATED: + assert(!hvf_irqchip_in_kernel()); qemu_set_irq(arm_cpu->gt_timer_outputs[GTIMER_VIRT], 1); cpu->accel->vtimer_masked = true; return 0; -- 2.39.5 (Apple Git-154)