From nobody Tue Feb 10 02:42:44 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=1572534656; cv=none; d=zoho.com; s=zohoarc; b=nz4Qvkg40cuUzpNHJOjGi4YtDWZ767Egx2v4ZXPR9MyQRjzLCAFb52DJSL3qLOXUg1NrdUP6r89i6T189k4gKnMKYJTNQcogS7ft56jno41oRbuzsukUmoGHCw9tO8QcBaJOAmg98pLlEtqM2CPlZ70PSmXDfh2ayFIZIiWiFqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572534656; 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=aYurCRELM+EBTGHAkv+IxbO/nCrhaA3SS7VpgeWhiP8=; b=EYCFxUXDb7rS9RxK6dZnVATha8zLNrTelwi3zRdwtJX4Nw5mexgKZcWxbRMBJ4d1YWhWA5co8lavEkVF9LUrUx4xZwin/lP9KhbdkvU3zCaZmusvCP4zhP+k5RrVPVz/2UZKKl37koUYOFBPfwYE+3/MSCM9sNNRKB6ppNSvr9k= 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 1572534656621355.3789098443169; Thu, 31 Oct 2019 08:10:56 -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 1iQC53-0006Uc-Uq; Thu, 31 Oct 2019 15:09:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC52-0006UA-BE for xen-devel@lists.xenproject.org; Thu, 31 Oct 2019 15:09:44 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 77562ff8-fbf0-11e9-8aca-bc764e2007e4; Thu, 31 Oct 2019 15:09:42 +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 31CC446A; Thu, 31 Oct 2019 08:09:42 -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 48F053F71E; Thu, 31 Oct 2019 08:09:41 -0700 (PDT) X-Inumbo-ID: 77562ff8-fbf0-11e9-8aca-bc764e2007e4 From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 31 Oct 2019 15:09:10 +0000 Message-Id: <20191031150922.22938-8-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 07/19] xen/arm64: entry: Introduce a macro to generate guest vector and use it 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" Most of the guest vectors are using the same pattern. This makes fairly tedious to alter the pattern and risk introducing mistakes when updating each path. A new macro is introduced to generate the guest vectors and now use it in the one that use the open-code version. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v3: - Add Stefano's reviewed-by Changes in v2: - Use the new short-hands --- xen/arch/arm/arm64/entry.S | 84 ++++++++++++++++--------------------------= ---- 1 file changed, 28 insertions(+), 56 deletions(-) diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S index fac4655bb9..2867c499da 100644 --- a/xen/arch/arm/arm64/entry.S +++ b/xen/arch/arm/arm64/entry.S @@ -175,6 +175,30 @@ =20 .endm =20 + /* + * Generate a guest vector. + * + * iflags: Correspond to the list of interrupts to unmask + * save_x0_x1: See the description on top of the macro 'entry' + */ + .macro guest_vector compat, iflags, trap, save_x0_x1=3D1 + entry hyp=3D0, compat=3D\compat, save_x0_x1=3D\save_x0_x1 + /* + * The vSError will be checked while SKIP_SYNCHRONIZE_SERROR_ENTRY= _EXIT + * is not set. If a vSError took place, the initial exception will= be + * skipped. Exit ASAP + */ + ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f", + "nop; nop", + SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT) + msr daifclr, \iflags + mov x0, sp + bl do_trap_\trap +1: + exit hyp=3D0, compat=3D\compat + .endm + + /* * Bad Abort numbers *----------------- @@ -347,36 +371,10 @@ guest_sync_slowpath: * x0/x1 may have been scratch by the fast path above, so avoid * to save them. */ - entry hyp=3D0, compat=3D0, save_x0_x1=3D0 - /* - * The vSError will be checked while SKIP_SYNCHRONIZE_SERROR_ENTRY= _EXIT - * is not set. If a vSError took place, the initial exception will= be - * skipped. Exit ASAP - */ - ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f", - "nop; nop", - SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT) - msr daifclr, #IFLAGS__AI_ - mov x0, sp - bl do_trap_guest_sync -1: - exit hyp=3D0, compat=3D0 + guest_vector compat=3D0, iflags=3DIFLAGS__AI_, trap=3Dguest_sync, = save_x0_x1=3D0 =20 guest_irq: - entry hyp=3D0, compat=3D0 - /* - * The vSError will be checked while SKIP_SYNCHRONIZE_SERROR_ENTRY= _EXIT - * is not set. If a vSError took place, the initial exception will= be - * skipped. Exit ASAP - */ - ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f", - "nop; nop", - SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT) - msr daifclr, #IFLAGS__A__ - mov x0, sp - bl do_trap_irq -1: - exit hyp=3D0, compat=3D0 + guest_vector compat=3D0, iflags=3DIFLAGS__A__, trap=3Dirq =20 guest_fiq_invalid: entry hyp=3D0, compat=3D0 @@ -390,36 +388,10 @@ guest_error: exit hyp=3D0, compat=3D0 =20 guest_sync_compat: - entry hyp=3D0, compat=3D1 - /* - * The vSError will be checked while SKIP_SYNCHRONIZE_SERROR_ENTRY= _EXIT - * is not set. If a vSError took place, the initial exception will= be - * skipped. Exit ASAP - */ - ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f", - "nop; nop", - SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT) - msr daifclr, #IFLAGS__AI_ - mov x0, sp - bl do_trap_guest_sync -1: - exit hyp=3D0, compat=3D1 + guest_vector compat=3D1, iflags=3DIFLAGS__AI_, trap=3Dguest_sync =20 guest_irq_compat: - entry hyp=3D0, compat=3D1 - /* - * The vSError will be checked while SKIP_SYNCHRONIZE_SERROR_ENTRY= _EXIT - * is not set. If a vSError took place, the initial exception will= be - * skipped. Exit ASAP - */ - ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f", - "nop; nop", - SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT) - msr daifclr, #IFLAGS__A__ - mov x0, sp - bl do_trap_irq -1: - exit hyp=3D0, compat=3D1 + guest_vector compat=3D1, iflags=3DIFLAGS__A__, trap=3Dirq =20 guest_fiq_invalid_compat: entry hyp=3D0, compat=3D1 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel