From patchwork Fri Mar 9 15:11:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 131142 Delivered-To: patch@linaro.org Received: by 10.80.194.209 with SMTP id u17csp1135376edf; Fri, 9 Mar 2018 07:13:58 -0800 (PST) X-Google-Smtp-Source: AG47ELvnNlVancKJ26hpMgCUtv3+FGNC0TVjtyNly8bRdT0OlLd84dz6XAFb/krBSiUcaH8liN1a X-Received: by 2002:a24:4391:: with SMTP id s139-v6mr3689538itb.5.1520608438802; Fri, 09 Mar 2018 07:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520608438; cv=none; d=google.com; s=arc-20160816; b=H8v4cn3z3wzxfo3o+Dch03sulOg4qtZhIYF/49dJWMa3CtH0YSdYl4aIIOTUP0tLGU wOIX18zaY+tTMOnSdsDrHmjgucJ426rYE0bYMgs49CICO6oLqc1peOM9sHiEILRV4w0z zgxo8rr7094kwrtrMdu1vT8xB8Ouw1/0o0WOK7gJ8KSqwFHFEFjagzpolmyVs6EfDb+x 9Hr6daxKL4Tj43m14MNMPrHpdiFCrxBQO1/3PVFuwldIkU33G8+fitHRMa3YrlFNR7nw 5GRJTfo3BVUsCLQI1KJ2vNIOQw2v6YZcfhjxs4ubJVPwR8XZ985Q5zpK0QD/ehk1g50Y /KLg== 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 :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=9Yd674jENbGjANv4zEr84swFMgH/3R0EqyIEF0ximUQ=; b=YQfVNux7Q38vREBiZGdXsheT6ZGwffbHtl0art3f2Cs2S8IkhdauA/D2RdmDKuwHVP Rece+3NuCkNTUr8YGA4UbcNz5hfPNUXaRwOZnGp1CvepSW4kMQqa5rdL02j0ZfoHO0n/ sngxK1iz/vHK9233OhsOlS7I26NuX1ebpDnCwiFDsFr476OxOEmRdKqU/SF/0YjGV910 HrctMJPDte5Xx/gfv3qKXlz4dX5Wr97mNVTnS/G8hid9kZvGyP/0NkaVq2+1TwVZybyW 1bnllzdjkxUbqM7KC60pE9dJvroukAUL0DRb0ejS9ABQYqstrQUERDkVCoe5FxXoMPZe 2YQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e1Q0hAiu; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id a125si992565iog.295.2018.03.09.07.13.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 07:13:58 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e1Q0hAiu; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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 1euJgW-0005qn-30; Fri, 09 Mar 2018 15:11:52 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euJgV-0005qW-5y for xen-devel@lists.xenproject.org; Fri, 09 Mar 2018 15:11:51 +0000 X-Inumbo-ID: 0590e573-23ac-11e8-ba59-bc764e045a96 Received: from mail-wm0-x244.google.com (unknown [2a00:1450:400c:c09::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0590e573-23ac-11e8-ba59-bc764e045a96; Fri, 09 Mar 2018 16:10:37 +0100 (CET) Received: by mail-wm0-x244.google.com with SMTP id x7so4503533wmc.0 for ; Fri, 09 Mar 2018 07:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HiGGHfI1VHwocUzl9BWbUI9kqny5/9EKCt1vvIgQ+14=; b=e1Q0hAiuTOsl06NV2lWNYcXUiPpFSxlcZxo1+K1xzg3K5OU4y1n1o7i13lUKaqzskz OEnVHj/G3AxuhyNLn3qnmv9hR5CDH98+xq5zLahErCbPikchsDPobPEPbr8AmbGCGYhN Pkj0d03NHG4+nPpoql8Ry4MikGdvN9+w7s+VQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HiGGHfI1VHwocUzl9BWbUI9kqny5/9EKCt1vvIgQ+14=; b=SkejE4nUH4FURbHTV3y3zXJOWkuyGDn38S4hWboKFlO35gCUI8UpN81EtTx53xnE31 SajFKJH8dRLjLEmD+174bjg4SUG5OlW6es97wTeR5aboqdcw8B9Ar+sMYl7YzYn54b6U oabzahUsUbLNGGQldNV0P9BGhn1IPLbdkgGpnARlmzpeF3/tXrvXtjxklxYIjUA3dnmA jd6PP3kUo23QneCaYCo/4L+hd9m86Y84eIU1KNlA+nzKPC7XAqKO70h7H9zagfQKufl6 D/t1UfKicluF3WqgQMkviILyLQ1BoAzDXs194zgyLVs4aP/5pkPq2a8HVsKIp7G5h/8a /scQ== X-Gm-Message-State: AElRT7H7jrcbklsOptyi0zth8XHcKXpuB6kaG04fv51+4TMv25C4bQiR 7shvlXTdXWh/hPvDwLCBTwJIgw== X-Received: by 10.28.23.143 with SMTP id 137mr2465717wmx.153.1520608308380; Fri, 09 Mar 2018 07:11:48 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id 1sm1721198wmj.35.2018.03.09.07.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 07:11:47 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Fri, 9 Mar 2018 15:11:21 +0000 Message-Id: <20180309151133.31371-6-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180309151133.31371-1-andre.przywara@linaro.org> References: <20180309151133.31371-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 05/17] ARM: VGIC: rename gic_inject() and gic_clear_lrs() X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" The two central functions to synchronise our emulated VGIC state with the GIC hardware (the LRs, really), are named somewhat confusingly. Rename them from gic_inject() to vgic_sync_to_lrs() and from gic_clear_lrs() to vgic_sync_from_lrs(), to make the code more readable. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- xen/arch/arm/gic-vgic.c | 4 ++-- xen/arch/arm/traps.c | 4 ++-- xen/include/asm-arm/gic.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c index d273863556..c0fe38fd37 100644 --- a/xen/arch/arm/gic-vgic.c +++ b/xen/arch/arm/gic-vgic.c @@ -247,7 +247,7 @@ static void gic_update_one_lr(struct vcpu *v, int i) } } -void gic_clear_lrs(struct vcpu *v) +void vgic_sync_from_lrs(struct vcpu *v) { int i = 0; unsigned long flags; @@ -377,7 +377,7 @@ out: return rc; } -void gic_inject(void) +void vgic_sync_to_lrs(void) { ASSERT(!local_irq_is_enabled()); diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 1cba7e584d..7411bff7a7 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2024,7 +2024,7 @@ static void enter_hypervisor_head(struct cpu_user_regs *regs) if ( current->arch.hcr_el2 & HCR_VA ) current->arch.hcr_el2 = READ_SYSREG(HCR_EL2); - gic_clear_lrs(current); + vgic_sync_from_lrs(current); } } @@ -2234,7 +2234,7 @@ void leave_hypervisor_tail(void) { local_irq_disable(); if (!softirq_pending(smp_processor_id())) { - gic_inject(); + vgic_sync_to_lrs(); /* * If the SErrors handle option is "DIVERSE", we have to prevent diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 497f195bc1..e2ae4254ed 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -237,7 +237,7 @@ extern int gic_route_irq_to_guest(struct domain *, unsigned int virq, int gic_remove_irq_from_guest(struct domain *d, unsigned int virq, struct irq_desc *desc); -extern void gic_inject(void); +extern void vgic_sync_to_lrs(void); extern void gic_clear_pending_irqs(struct vcpu *v); extern int gic_events_need_delivery(void); @@ -295,7 +295,7 @@ extern unsigned int gic_number_lines(void); /* IRQ translation function for the device tree */ int gic_irq_xlate(const u32 *intspec, unsigned int intsize, unsigned int *out_hwirq, unsigned int *out_type); -void gic_clear_lrs(struct vcpu *v); +void vgic_sync_from_lrs(struct vcpu *v); struct gic_info { /* GIC version */