From nobody Mon Feb 9 22:04:14 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1572534658; cv=none; d=zoho.com; s=zohoarc; b=WemhFWAH7slnhPu6CvQw6sIC3pYM5QA9mImRB6hpY/1L+ge0IHmecINnXDndKmA6EcFZ5EO1KfWPEd/N2fVdg4N/FDPkfJptYdS+37OqLNRjWLLCFOWjDTQCWF64/vtvA3tSzCVy6wx50can1ksTDyiu1862JmCuDerSf+Qh7/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572534658; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+Ou5PfEyktNMLxckO452XbKRYpIgVrkliWWQBxquBQE=; b=TuckgE6SNoXpUjMIrKOUjv2R86TduMiMYBx7KUumuPvv73CSIHUT/Mg6rNhd/3eHW57QXU+1k+oRGXM2nvYzsfcZxAiGrPUBX/F3+iEnf4sRu9gpSx7mXdlZKzZEAnmsN3rWi46RPDdazl6gFJZ7sIi0pG1Xd9QKx8PKWrfMvwo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1572534657945126.7563195140026; Thu, 31 Oct 2019 08:10:57 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC59-0006Yd-Uc; Thu, 31 Oct 2019 15:09:51 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC58-0006XN-Ad for xen-devel@lists.xenproject.org; Thu, 31 Oct 2019 15:09:50 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 75fbf34a-fbf0-11e9-954c-12813bfff9fa; Thu, 31 Oct 2019 15:09:40 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E7B76625; Thu, 31 Oct 2019 08:09:39 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (unknown [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 085003F71E; Thu, 31 Oct 2019 08:09:38 -0700 (PDT) X-Inumbo-ID: 75fbf34a-fbf0-11e9-954c-12813bfff9fa From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 31 Oct 2019 15:09:08 +0000 Message-Id: <20191031150922.22938-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191031150922.22938-1-julien.grall@arm.com> References: <20191031150922.22938-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.13 v4 05/19] xen/arm: traps: Update the correct PC when inject a virtual SError to the guest X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, Volodymyr Babchuk , Julien Grall , Stefano Stabellini , Julien Grall MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When injecting a virtual Abort to the guest, we want to update the guest PC so it can re-execute the HVC/SMC once it has handled the SError. This is unfortunately not the case when the SError is synchronized on entry from the guest. As the SError will be received while running in hypervisor context, we will update the PC of hypervisor context (i.e the trap). Rework inject_vabt_exception so it uses the guest context rather than the current one. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- Technically, updating the PC is only necessary when guest SError are received while running in hypervisor. The code should be reworked to get the path a bit simpler, but this is post Xen 4.13 work. Changes in v4: - Add Stefano's acked-by Changes in v3: - s/vcpu_info/vcpu/ Changes in v2: - Add patch --- xen/arch/arm/traps.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 3262052f47..12c52a3860 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -629,11 +629,18 @@ static void inject_dabt_exception(struct cpu_user_reg= s *regs, #endif } =20 -/* Inject a virtual Abort/SError into the guest. */ -static void inject_vabt_exception(struct cpu_user_regs *regs) +/* + * Inject a virtual Abort/SError into the guest. + * + * This should only be called with 'current'. + */ +static void inject_vabt_exception(struct vcpu *v) { + struct cpu_user_regs *regs =3D guest_cpu_user_regs(); const union hsr hsr =3D { .bits =3D regs->hsr }; =20 + ASSERT(v =3D=3D current); + /* * SVC/HVC/SMC already have an adjusted PC (See ARM ARM DDI 0487A.j * D1.10.1 for more details), which we need to correct in order to @@ -656,7 +663,7 @@ static void inject_vabt_exception(struct cpu_user_regs = *regs) break; } =20 - vcpu_hcr_set_flags(current, HCR_VA); + vcpu_hcr_set_flags(v, HCR_VA); } =20 /* @@ -683,7 +690,7 @@ static void __do_trap_serror(struct cpu_user_regs *regs= , bool guest) * forwarded to the currently running vCPU. */ if ( serrors_op =3D=3D SERRORS_DIVERSE && guest ) - return inject_vabt_exception(regs); + return inject_vabt_exception(current); =20 do_unexpected_trap("SError", regs); } --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel