From patchwork Wed Oct 31 18:12:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 149854 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7126834ljp; Wed, 31 Oct 2018 11:15:50 -0700 (PDT) X-Google-Smtp-Source: AJdET5fPLwLTdx50LSHs68g7yDVCbsx0hAexFbS3tF0cv9lI887dDt/JZVnohT7ROBJBdzktz5Bv X-Received: by 2002:a25:3588:: with SMTP id c130-v6mr4313335yba.410.1541009750285; Wed, 31 Oct 2018 11:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541009750; cv=none; d=google.com; s=arc-20160816; b=kIwttJ+H12suGpIVNLAYYa+Ycou9+iFCTuTbGvNzLawcWhZh84jNv6/v4GlWEhht6r HgfA7Vsex/M4cX13yl0D05xot6E39/knFQH/f08ttm+3rAa5+btj+wzz+ghm+GM+lZO9 UkFjRW8VmzTyW+ScSN3yS1g1eCdbYmVTW5rmDQtIg8vW9iePUn9JTOxidSaYAVO0lcch 25umPw4inGnRsEfiaVZUYJ8ct4uy2FH0RHqYaWeu3SF8VxVVHIJ0L32gV7b9kPgj+KK0 GfSRucWB9LWBLTxryn7X/G/3epVFcML0o0wXYZxJXl4kT1Ob39Vjd6U5jQ9LK+lYm5Rw EVOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=bwfsNkdCtMrT3xsMqBXy0OXbshatnwPRUa0vj3rX3+o=; b=O2kafBdT9LN2S7tlBu+Ur2eKlkArOthGP4h1OMnwyRFLGHBwEf2Xpg9YIrw7l0pZd0 k19Zj+rInwu4mAzb3B9U/AK0HrIvoUzXbg5rxhQxgS4/904BkMq/zjegq242Ekqtsxil ybrZO0LmmTDVDFEyqisiFb4XZvtmrzrRFkrGdJkYwZ19DQP806Vm2ZyM/U17J5zq7L4W Jzw13fUvUnfGbl8IEtn4STsY4KoVjygeJ0h5mTR63wITzUpLIaa30J2+ZafAYbfrcbrE Xi0nUnl/pn1k3M56VSVvo2BeMzwJ2aTaDpHRPPyned+5VEe4yuQxzmIh4yKAZOjLnriR TuHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id g4-v6si9811907ybq.491.2018.10.31.11.15.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Oct 2018 11:15:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gHuzh-0004Ob-Ij; Wed, 31 Oct 2018 18:13:29 +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 1gHuzf-0004O2-Ts for xen-devel@lists.xen.org; Wed, 31 Oct 2018 18:13:27 +0000 X-Inumbo-ID: a9ed21ba-dd38-11e8-ab33-12d6303a7972 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id a9ed21ba-dd38-11e8-ab33-12d6303a7972; Wed, 31 Oct 2018 18:13:27 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 264D180D; Wed, 31 Oct 2018 11:13:27 -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 3A8A03F6A8; Wed, 31 Oct 2018 11:13:26 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 31 Oct 2018 18:12:58 +0000 Message-Id: <20181031181313.8028-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181031181313.8028-1-julien.grall@arm.com> References: <20181031181313.8028-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 06/21] xen/arm: Move VABORT_GEN_BY_GUEST to traps.h and turned into inline 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 , sstabellini@kernel.org, andrii_anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The macro VABORT_GEN_BY_GUEST is only used by the trap code. So move it to trap.h. While moving the code, convert is to a static inline to allow typecheck. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov --- Changes in v2: - Add Andrii's reviewed-by --- xen/include/asm-arm/processor.h | 10 ---------- xen/include/asm-arm/traps.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h index bdce0df122..3f40468bfd 100644 --- a/xen/include/asm-arm/processor.h +++ b/xen/include/asm-arm/processor.h @@ -684,16 +684,6 @@ void do_trap_guest_serror(struct cpu_user_regs *regs); register_t get_default_hcr_flags(void); -/* Functions for pending virtual abort checking window. */ -void abort_guest_exit_start(void); -void abort_guest_exit_end(void); - -#define VABORT_GEN_BY_GUEST(r) \ -( \ - ( (unsigned long)abort_guest_exit_start == (r)->pc ) || \ - ( (unsigned long)abort_guest_exit_end == (r)->pc ) \ -) - /* * Synchronize SError unless the feature is selected. * This is relying on the SErrors are currently unmasked. diff --git a/xen/include/asm-arm/traps.h b/xen/include/asm-arm/traps.h index d30ee1e01e..a0406b5a3c 100644 --- a/xen/include/asm-arm/traps.h +++ b/xen/include/asm-arm/traps.h @@ -45,6 +45,16 @@ void do_trap_hvc_smccc(struct cpu_user_regs *regs); int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc); +/* Functions for pending virtual abort checking window. */ +void abort_guest_exit_start(void); +void abort_guest_exit_end(void); + +static inline bool VABORT_GEN_BY_GUEST(const struct cpu_user_regs *regs) +{ + return ((unsigned long)abort_guest_exit_start == regs->pc) || + (unsigned long)abort_guest_exit_end == regs->pc; +} + #endif /* __ASM_ARM_TRAPS__ */ /* * Local variables: