From nobody Tue Nov 11 08:47:04 2025 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=1569523173; cv=none; d=zoho.com; s=zohoarc; b=VODRftWIfDPAvgCU/71yUr7tTd98cI/zI+rIMlh/2iJzBpUIOiMelc4kq5s8Abnh3ufKYE4MAwrFFY/x0slAUN18L5XtPtc6p6ijNXHQX1l/2ND+ydkxWbxLho/WBSKGh+6GYvZz3F/JEkApZ7JBQvV6/dHct9bWRHBraxj5w+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569523173; 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:ARC-Authentication-Results; bh=BdskQHunxWm6sUNJmdg7n48ru+EAdQwUMzylK7eqyAQ=; b=E4Jl7a9pcOOeVM1iW4idevUalmCsf77qY7efE42Xe8Hv9xiuXi2Bc9XGvnUQPe+SNLKp5SQMqBzFKoPcO/JPKkj3zjehG3npTG6f7PoFOmWv8pDUWhyH2NAn29QHUHnTGDQu/mCLlmU1vLC9G3tl+2ypUN6a3xmKwy6+CwRgK3E= 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 15695231733616.327454872134581; Thu, 26 Sep 2019 11:39:33 -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 1iDYeg-0002O6-6E; Thu, 26 Sep 2019 18:38:18 +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 1iDYee-0002Ns-7s for xen-devel@lists.xenproject.org; Thu, 26 Sep 2019 18:38:16 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id cca6d78e-e08c-11e9-965e-12813bfff9fa; Thu, 26 Sep 2019 18:38:14 +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 4FB631570; Thu, 26 Sep 2019 11:38:14 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 834B93F67D; Thu, 26 Sep 2019 11:38:13 -0700 (PDT) X-Inumbo-ID: cca6d78e-e08c-11e9-965e-12813bfff9fa From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 26 Sep 2019 19:37:59 +0100 Message-Id: <20190926183808.11630-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190926183808.11630-1-julien.grall@arm.com> References: <20190926183808.11630-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH RFC for-4.13 01/10] 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: Julien Grall , Stefano Stabellini , Volodymyr Babchuk , andrii.anisov@gmail.com 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 --- 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 2d9a2713a1..8665d2844a 100644 --- a/xen/arch/arm/arm64/entry.S +++ b/xen/arch/arm/arm64/entry.S @@ -157,6 +157,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 *----------------- @@ -290,36 +314,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, #6 - mov x0, sp - bl do_trap_guest_sync -1: - exit hyp=3D0, compat=3D0 + guest_vector compat=3D0, iflags=3D6, 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, #4 - mov x0, sp - bl do_trap_irq -1: - exit hyp=3D0, compat=3D0 + guest_vector compat=3D0, iflags=3D4, trap=3Dirq =20 guest_fiq_invalid: entry hyp=3D0, compat=3D0 @@ -333,36 +331,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, #6 - mov x0, sp - bl do_trap_guest_sync -1: - exit hyp=3D0, compat=3D1 + guest_vector compat=3D1, iflags=3D6, 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, #4 - mov x0, sp - bl do_trap_irq -1: - exit hyp=3D0, compat=3D1 + guest_vector compat=3D1, iflags=3D4, 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