From patchwork Tue Sep 5 14:52:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9939155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 979AD60350 for ; Tue, 5 Sep 2017 14:52:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 897562897B for ; Tue, 5 Sep 2017 14:52:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E30B28995; Tue, 5 Sep 2017 14:52:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 232532897B for ; Tue, 5 Sep 2017 14:52:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751880AbdIEOw3 (ORCPT ); Tue, 5 Sep 2017 10:52:29 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35762 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbdIEOwZ (ORCPT ); Tue, 5 Sep 2017 10:52:25 -0400 Received: by mail-wm0-f54.google.com with SMTP id f199so365831wme.0 for ; Tue, 05 Sep 2017 07:52:25 -0700 (PDT) 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=axy93iugscsBzbX2yvmRm3H4WcT7IB3eiSq+wjvYMw4=; b=Zr4FkyRKS5y92B2fnUuXE5Rda2nkV6wz9G0Cm8tXFu/5RXuhI0T6NsDDP4h6kIdVKc tGBqQO6R505THo0gu9MBwus+l8Jd3ffEuoaWW7ImjNzOpi2azmqtyhKapyQ/2mzn4chb RUXRx5wtKAYdjYlCRUfFjzL4Au5cbjqBBTJLo= 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=axy93iugscsBzbX2yvmRm3H4WcT7IB3eiSq+wjvYMw4=; b=W7umeczXdn9LTAE0yTw2p/6VlaevoLX/DGLQCNKY2SwhXe4rk0zGb7OB6aPGW1PbQm 6QvfemOtV1eDGKNkaa0NVy3hZ1o978TFR8ZNb3ab2vLkvdoVn7+D5gjCky3IReVURLNv LdrjNyLomTbVm/FWUxwxz7N7cb6tpNGu2jY8D7xB52egg0WygTomMfqjgmmzzx6cXikE IR1oniFTuEKLgF16SfOnu03ziTJK8Mt9ZoflS4ltIDNwovWLFRbKStg7iXabemrSWojO f/cBX+z6+JXGttxmj+jGW8lvTfCvaUnq//hJrogtuN6GWl+uVh4zIrM2AS6bZ6dpdXYV kEsw== X-Gm-Message-State: AHPjjUgVCyYZZA/Sm52v6TUp6Cw3s4gg1rctQPKCoZUzN3Z11AueJw3V c8bHrchwNd4zD6Q9S+/Beg== X-Google-Smtp-Source: ADKCNb5pH2Udy5LSRF7a1jtqZ6+Xk9SFnnS7s9x5WvD5DprQeOHheli06d8o7pj3bQEQCQfCbld/FQ== X-Received: by 10.80.180.184 with SMTP id w53mr3464405edd.176.1504623144290; Tue, 05 Sep 2017 07:52:24 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id a28sm293809edc.14.2017.09.05.07.52.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 07:52:23 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Christoffer Dall Subject: [PULL 6/8] KVM: arm/arm64: vITS: Drop its_ite->lpi field Date: Tue, 5 Sep 2017 16:52:05 +0200 Message-Id: <20170905145207.18447-7-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170905145207.18447-1-cdall@linaro.org> References: <20170905145207.18447-1-cdall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier For unknown reasons, the its_ite data structure carries an "lpi" field which contains the intid of the LPI. This is an obvious duplication of the vgic_irq->intid field, so let's fix the only user and remove the now useless field. Signed-off-by: Marc Zyngier Reviewed-by: Andre Przywara Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-its.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index aa6b68d..f51c1e1 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -144,7 +144,6 @@ struct its_ite { struct vgic_irq *irq; struct its_collection *collection; - u32 lpi; u32 event_id; }; @@ -813,7 +812,7 @@ static void vgic_its_free_collection(struct vgic_its *its, u32 coll_id) /* Must be called with its_lock mutex held */ static struct its_ite *vgic_its_alloc_ite(struct its_device *device, struct its_collection *collection, - u32 lpi_id, u32 event_id) + u32 event_id) { struct its_ite *ite; @@ -823,7 +822,6 @@ static struct its_ite *vgic_its_alloc_ite(struct its_device *device, ite->event_id = event_id; ite->collection = collection; - ite->lpi = lpi_id; list_add_tail(&ite->ite_list, &device->itt_head); return ite; @@ -873,7 +871,7 @@ static int vgic_its_cmd_handle_mapi(struct kvm *kvm, struct vgic_its *its, new_coll = collection; } - ite = vgic_its_alloc_ite(device, collection, lpi_nr, event_id); + ite = vgic_its_alloc_ite(device, collection, event_id); if (IS_ERR(ite)) { if (new_coll) vgic_its_free_collection(its, coll_id); @@ -1848,7 +1846,7 @@ static int vgic_its_save_ite(struct vgic_its *its, struct its_device *dev, next_offset = compute_next_eventid_offset(&dev->itt_head, ite); val = ((u64)next_offset << KVM_ITS_ITE_NEXT_SHIFT) | - ((u64)ite->lpi << KVM_ITS_ITE_PINTID_SHIFT) | + ((u64)ite->irq->intid << KVM_ITS_ITE_PINTID_SHIFT) | ite->collection->collection_id; val = cpu_to_le64(val); return kvm_write_guest(kvm, gpa, &val, ite_esz); @@ -1895,7 +1893,7 @@ static int vgic_its_restore_ite(struct vgic_its *its, u32 event_id, if (!collection) return -EINVAL; - ite = vgic_its_alloc_ite(dev, collection, lpi_id, event_id); + ite = vgic_its_alloc_ite(dev, collection, event_id); if (IS_ERR(ite)) return PTR_ERR(ite);