From patchwork Thu Oct 18 13:20:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 149141 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1972864lji; Thu, 18 Oct 2018 06:23:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV61er61dtqJ8OgqaElgiSBx8pwd0ij00KQ9KhBWNv+x/2FGyuuVMf5HZnjXZ/kv+gFR/3z1M X-Received: by 2002:a5b:f43:: with SMTP id y3-v6mr18065128ybr.296.1539869015535; Thu, 18 Oct 2018 06:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539869015; cv=none; d=google.com; s=arc-20160816; b=QaGe8JSwSstEpmUw69HqWW7uyzxFtabZf9py39KoDBkf1tM+WuWCst3qtzdajzB9We Iz16ZsirmUBfMltegS2jwK0Y+HHpVUNSNXWYyQMaL1XTPBg70d9CF3c6vpXQ8/Z4zf0Y haV8GGD2XWcFHKc660h6sjH/C8nzWIwarK5XXzkZLfH8hfJIUnv81AZvag1PD4MT0qfZ DMjl8m65+H07RWR7FKb9JJVl/tQWspYuohrMN0FCY0MdxV/jFgbNghiDC78gKix/ioIy aiH0bqf68sQYmjy4S9VVqnhx2G8iCIIhtpbDyT7XX0UsU5mJg9SAv/XHwfOVYklFdxsE 6U/w== 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=4UsijaZbarhr18Naq7ZGusmT+8Ou4/RphY/NeO6bZKo=; b=vuqBHGcz/1pSYz3s7xRdTVdbCMpmFm1H5r/cI+unLME8KAvSnqcQcYI5AqK4EHxo+A BDarnbEWFHqxSLy9yzdKlquqjYRQqZgmdt5Q1p0p4TadBUEXu0bjaCISMYz907THsE1K yzZGwSbcm0/ivGIaUAge8QYPoFa9kxit7v+aquxQ2QPBaV/Q8pNfF5cbT1GMkzYxMfVz O5v6v/WQP+bYVZ+kg+vemN7eawx8ElLkvLAfufy3dFD0CkFHN5SeE1pnJUJM8KzSq6e0 E0X1ZqEiYfTO3ik8y7XHVWBgaH1KVTdw29EZJzsniEBfd66HlguMUXSsO7m284jXB4G8 jOeQ== 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 s63-v6si1797673ybb.355.2018.10.18.06.23.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 06:23:35 -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 1gD8Ev-00030h-Rk; Thu, 18 Oct 2018 13:21:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gD8Ev-000308-1W for xen-devel@lists.xen.org; Thu, 18 Oct 2018 13:21:25 +0000 X-Inumbo-ID: e85dd7a8-d2d8-11e8-a6a9-d7ebe60f679a Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id e85dd7a8-d2d8-11e8-a6a9-d7ebe60f679a; Thu, 18 Oct 2018 13:22:48 +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 4D73515BE; Thu, 18 Oct 2018 06:21:23 -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 8587D3F59C; Thu, 18 Oct 2018 06:21:22 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 18 Oct 2018 14:20:53 +0100 Message-Id: <20181018132109.31192-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181018132109.31192-1-julien.grall@arm.com> References: <20181018132109.31192-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 06/22] 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 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 --- 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 f7a2e9a3ad..5b6bd0c38c 100644 --- a/xen/include/asm-arm/processor.h +++ b/xen/include/asm-arm/processor.h @@ -683,16 +683,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 059aa370c3..c12e9e4082 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(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: