From patchwork Wed Dec 7 12:33:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 87085 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp291006qgi; Wed, 7 Dec 2016 04:36:01 -0800 (PST) X-Received: by 10.107.138.93 with SMTP id m90mr59687658iod.127.1481114161240; Wed, 07 Dec 2016 04:36:01 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id u130si5800583ith.97.2016.12.07.04.36.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 04:36:01 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEbQH-00068H-3X; Wed, 07 Dec 2016 12:34:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEbQF-00065Z-Ab for xen-devel@lists.xen.org; Wed, 07 Dec 2016 12:34:07 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id B1/C2-12366-FB108485; Wed, 07 Dec 2016 12:34:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTXcfo0e EwY3JWhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b0g/9YCk6JVdz/doalgfGUUBcjF4eQwCZG idfvXrNDOKcZJY7c6mfqYuTkYBPQlLjz+ROYLSIgLXHt82VGEJtZwEHizcd7LCC2sECwxNKfR 8BsFgFViV0P1rKB2LwCLhJ3XneA1UsIyEmcPDaZFcTmFHCVuPX1L1i9EFDN16ZlLBMYuRcwMq xi1ChOLSpLLdI1NNZLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAj0MAMQ7GD8siz gEKMkB5OSKO+uCe4RQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4FzF4RAgJFqWmp1akZeYAQw0m LcHBoyTCu+8/UCtvcUFibnFmOkTqFKOilDjvXJA+AZBERmkeXBssvC8xykoJ8zICHSLEU5Bal JtZgir/ilGcg1FJmJcLZApPZl4J3PRXQIuZgBbPuwG2uCQRISXVwHiwwsAnYsWvRYv5P7yrPV HF8fbX5dt682P+mJrNPSEp1p/70a+FNWlC0bZZU5j8FyblcehufXbqwjxlp5ccCyT41BkmS/y 7Eslks/TQundKPoFv7rFvrOTdYV/as3RfOVNRHXv7iynPcnoOFJ2+7/LYsV/IrVA2aBWDZjnn gpTZEm5iMxvM25VYijMSDbWYi4oTAQRj/nhqAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1481114046!71556451!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50232 invoked from network); 7 Dec 2016 12:34:06 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-7.tower-27.messagelabs.com with SMTP; 7 Dec 2016 12:34:06 -0000 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 00E94707; Wed, 7 Dec 2016 04:34:06 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6140B3F477; Wed, 7 Dec 2016 04:34:05 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 7 Dec 2016 12:33:46 +0000 Message-Id: <1481114033-11024-7-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481114033-11024-1-git-send-email-julien.grall@arm.com> References: <1481114033-11024-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 06/13] xen/arm: vgic: Switch emulate_sysreg return from int to bool X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" emulate_sysreg callback can only return 2 values: 0 or 1. Use bool instead to make clear only two possible values exist. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/vgic-v3.c | 6 +++--- xen/arch/arm/vgic.c | 2 +- xen/include/asm-arm/vgic.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index 17c3000..e54df0b 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -1300,7 +1300,7 @@ static bool vgic_v3_to_sgi(struct vcpu *v, register_t sgir) return vgic_to_sgi(v, sgir, sgi_mode, virq, &target); } -static int vgic_v3_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr) +static bool vgic_v3_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr) { struct vcpu *v = current; struct hsr_sysreg sysreg = hsr.sysreg; @@ -1321,10 +1321,10 @@ static int vgic_v3_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr) else { gprintk(XENLOG_WARNING, "Reading SGI1R_EL1 - WO register\n"); - return 0; + return false; } default: - return 0; + return false; } } diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 3e1774d..196e86b 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -546,7 +546,7 @@ void arch_evtchn_inject(struct vcpu *v) vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq); } -int vgic_emulate(struct cpu_user_regs *regs, union hsr hsr) +bool vgic_emulate(struct cpu_user_regs *regs, union hsr hsr) { struct vcpu *v = current; diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h index 83843fa..fadb1e1 100644 --- a/xen/include/asm-arm/vgic.h +++ b/xen/include/asm-arm/vgic.h @@ -131,7 +131,7 @@ struct vgic_ops { /* Release resources that were allocated by domain_init */ void (*domain_free)(struct domain *d); /* vGIC sysreg emulation */ - int (*emulate_sysreg)(struct cpu_user_regs *regs, union hsr hsr); + bool (*emulate_sysreg)(struct cpu_user_regs *regs, union hsr hsr); /* Maximum number of vCPU supported */ const unsigned int max_vcpus; }; @@ -300,7 +300,7 @@ extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq); extern struct pending_irq *spi_to_pending(struct domain *d, unsigned int irq); extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int s); extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq); -extern int vgic_emulate(struct cpu_user_regs *regs, union hsr hsr); +extern bool vgic_emulate(struct cpu_user_regs *regs, union hsr hsr); extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n); extern void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n); extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);