From patchwork Thu Dec 7 16:14:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 121018 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8556349qgn; Thu, 7 Dec 2017 08:16:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMY0w18eiH7d6Y5aaGx9E2WZhmHXZW3NUlBdNmIq0bXGVW/2QEC2ei4tVKi/YTy9l6BD7HwN X-Received: by 10.107.7.224 with SMTP id g93mr3318859ioi.208.1512663402275; Thu, 07 Dec 2017 08:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512663402; cv=none; d=google.com; s=arc-20160816; b=CEiWfVKRQR3DvBSBbcEgWYldt+zS/J5nCkpG1Gu0dBzSTfVb2vRyv9RcYivzqvnNEV b30/0fzvCxYWTcwXDpaEFcLZJ9kBIMYp5o3xonn1kLe7NCDHYCo7Sh+DF4mVIflUFD6B +bHwB/r/Zak2OkqbrSlKxaMI1WAAAbcFSIRZF31/itYNiP+07HIAt/SwqSdLxmod5MoD 57+Nnlwl5odqJPcj84Gd9vbaK0JwRWTOrM5FV7Uvfc5g0hrJa2CunFL8c09feGcqr7HU Go0YsnRenx5SdBBq+PL+3Uw+iU83Xb7/FPlH/nJNp6cyYz3WP7d9HO7eM8QvQs+ooApJ UOAQ== 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=2G0xnFIbxr12DtnY7sMsrBGkvbvlXgZUsbaC+W+p5ZE=; b=MUGNNCT5AINyK7AsRYK0RzF96eShiWOavUCjb1NjyKm9g8dx4Fsn88idRR9THZg/Zu 0FKtNhbgzXl2G7iK8JhDYgb7av5FujChN00fKNlup8DstcDHVZcBc9O3XFOh4VVC0khP zNv9tEOvSNyLY4Gw7Xer35GY5IByvS1jej032k28aZyjIkKh6mVptanoimtxQgVU9lFi hxivyhEhAAqV8gATp2J1FB64r3VJ8r7k3B/Vn5JeQtMtKxVl7sBUTS3lDH1BSvDKxDe1 hmSd2NigqIHzBoXVY6oVJwo/+ioL+WDPbdFbRkFzxDeRVpS7/UB0umVPG+/m+sP4FgT6 Lm1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SwXxOt/p; 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 z189si4060878itb.8.2017.12.07.08.16.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 08:16:42 -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=SwXxOt/p; 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 1eMyoX-0002B6-K5; Thu, 07 Dec 2017 16:14:21 +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 1eMyoV-0002AT-MZ for xen-devel@lists.xenproject.org; Thu, 07 Dec 2017 16:14:19 +0000 X-Inumbo-ID: 9ecb5adf-db69-11e7-b4a6-bc764e045a96 Received: from mail-wr0-x244.google.com (unknown [2a00:1450:400c:c0c::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9ecb5adf-db69-11e7-b4a6-bc764e045a96; Thu, 07 Dec 2017 17:13:54 +0100 (CET) Received: by mail-wr0-x244.google.com with SMTP id a41so8058318wra.6 for ; Thu, 07 Dec 2017 08:14:18 -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=/uqGcuvPfQwezBZ+RpXSQxCGhqfwKmBCB3noU3Nmhr0=; b=SwXxOt/pOAvXBk4vL97cxUwGtoD4sKhM9J1hp1ZHltDR8KJvfEjMuIItrzVf9nHAFj itGKA+LicXQyI6IV5OE/u6X/Iog9yiz5jmncFY9PWGSQ5xFd+Jo5l1B9mYvJsi0zhQBz LM+flRLyUqfKnkM7v95RVTKRosqRtt9uTYB7s= 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=/uqGcuvPfQwezBZ+RpXSQxCGhqfwKmBCB3noU3Nmhr0=; b=pndpujIUmHM8ng9/5ejXa8PyAjabXRHK7MrNb9/7LkvU5lZQJgMz2oJ322fxGICHBq /Lie1TR8aKWmuRbmrQdS0BbUPOlseey+WEmsl4uypIqpAjRYFkZ9GdfpqmbyWCzmw0WG dkeZku/JSsKXcM6S3SBlg+C3SwBC9c9EKcjqT3tAf6bPFINpcUfK3eGjxbMomW4i+QM3 SF1/ictVb/FWYbUAW8bB0V/EMMI7dnp/MX5GaVHnuN/0jFn+qEHUCWAwkzRBYVgt6R+c AuYjz7DR8Lvy9ogFek9fwp2WtLuT4ge8S+mWqOKXo3y4/bIo4G02/AJzSQ32zQLMK01r reGQ== X-Gm-Message-State: AJaThX7Y3+4a1+44cMBn8R8f6tJnj3yCaLFvSraSQJNTuNQVVrGyNFXe 3k8A2OnNmK/BwBjAiPdHUu9vYg== X-Received: by 10.223.139.73 with SMTP id v9mr23837327wra.77.1512663257076; Thu, 07 Dec 2017 08:14:17 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id f18sm6090624wrg.66.2017.12.07.08.14.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 08:14:16 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 7 Dec 2017 16:14:08 +0000 Message-Id: <20171207161415.20380-4-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171207161415.20380-1-andre.przywara@linaro.org> References: <20171207161415.20380-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH v2 03/10] ARM: VGIC: move gic_remove_irq_from_queues() 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" gic_remove_irq_from_queues() was not only misnamed, it also has the wrong abstraction, as it should not live in gic.c. Move it into vgic.c and vgic.h, where it belongs to, and rename it on the way. Signed-off-by: Andre Przywara Reviewed-by: Stefano Stabellini --- xen/arch/arm/gic.c | 9 --------- xen/arch/arm/vgic-v3-its.c | 4 ++-- xen/arch/arm/vgic.c | 11 ++++++++++- xen/include/asm-arm/gic.h | 1 - xen/include/asm-arm/vgic.h | 1 + 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index ed363f6c37..bac8ada2bb 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -411,15 +411,6 @@ void gic_remove_from_lr_pending(struct vcpu *v, struct pending_irq *p) list_del_init(&p->lr_queue); } -void gic_remove_irq_from_queues(struct vcpu *v, struct pending_irq *p) -{ - ASSERT(spin_is_locked(&v->arch.vgic.lock)); - - clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status); - list_del_init(&p->inflight); - gic_remove_from_lr_pending(v, p); -} - void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq) { struct pending_irq *n = irq_to_pending(v, virtual_irq); diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c index 72a5c70656..d8fa44258d 100644 --- a/xen/arch/arm/vgic-v3-its.c +++ b/xen/arch/arm/vgic-v3-its.c @@ -381,7 +381,7 @@ static int its_handle_clear(struct virt_its *its, uint64_t *cmdptr) * have no active state, we don't need to care about this here. */ if ( !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) ) - gic_remove_irq_from_queues(vcpu, p); + vgic_remove_irq_from_queues(vcpu, p); spin_unlock_irqrestore(&vcpu->arch.vgic.lock, flags); ret = 0; @@ -619,7 +619,7 @@ static int its_discard_event(struct virt_its *its, } /* Cleanup the pending_irq and disconnect it from the LPI. */ - gic_remove_irq_from_queues(vcpu, p); + vgic_remove_irq_from_queues(vcpu, p); vgic_init_pending_irq(p, INVALID_LPI); spin_unlock_irqrestore(&vcpu->arch.vgic.lock, flags); diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index d8acbbeaaa..6e933a86d3 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -281,7 +281,7 @@ bool vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq) /* If the IRQ is still lr_pending, re-inject it to the new vcpu */ if ( !list_empty(&p->lr_queue) ) { - gic_remove_irq_from_queues(old, p); + vgic_remove_irq_from_queues(old, p); irq_set_affinity(p->desc, cpumask_of(new->processor)); spin_unlock_irqrestore(&old->arch.vgic.lock, flags); vgic_vcpu_inject_irq(new, irq); @@ -508,6 +508,15 @@ void vgic_clear_pending_irqs(struct vcpu *v) spin_unlock_irqrestore(&v->arch.vgic.lock, flags); } +void vgic_remove_irq_from_queues(struct vcpu *v, struct pending_irq *p) +{ + ASSERT(spin_is_locked(&v->arch.vgic.lock)); + + clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status); + list_del_init(&p->inflight); + gic_remove_from_lr_pending(v, p); +} + void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq) { uint8_t priority; diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index d3d7bda50d..587a14f8b9 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -244,7 +244,6 @@ extern void gic_raise_guest_irq(struct vcpu *v, unsigned int irq, unsigned int priority); extern void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq); extern void gic_remove_from_lr_pending(struct vcpu *v, struct pending_irq *p); -extern void gic_remove_irq_from_queues(struct vcpu *v, struct pending_irq *p); /* Accept an interrupt from the GIC and dispatch its handler */ extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq); diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h index e489d0bf21..2a93a7bef9 100644 --- a/xen/include/asm-arm/vgic.h +++ b/xen/include/asm-arm/vgic.h @@ -204,6 +204,7 @@ extern int vcpu_vgic_init(struct vcpu *v); extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq); extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq); extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int virq); +extern void vgic_remove_irq_from_queues(struct vcpu *v, struct pending_irq *p); extern void vgic_clear_pending_irqs(struct vcpu *v); extern void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq); extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);