From patchwork Tue Sep 5 15:41:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9939233 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 02E9160350 for ; Tue, 5 Sep 2017 15:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAC992897C for ; Tue, 5 Sep 2017 15:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF945289AF; Tue, 5 Sep 2017 15:41:25 +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 890FF2897C for ; Tue, 5 Sep 2017 15:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752011AbdIEPlX (ORCPT ); Tue, 5 Sep 2017 11:41:23 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36648 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751824AbdIEPlU (ORCPT ); Tue, 5 Sep 2017 11:41:20 -0400 Received: by mail-wm0-f50.google.com with SMTP id i145so20982752wmf.1 for ; Tue, 05 Sep 2017 08:41:20 -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=IfzMl6YXRAICtsjzJ+uJZUzt5q/2X044XqigDrpeZfWxTdVUQBaNKc2iMue0zgImPc PlsPIES1iDLrbe+WXUJzZlcuT40OXPH/TK4qo+EGwx2N4qboglBlBAHnMM96vNXlk6Yh zlX0MmHELRKwSoD4L6OUt04ARZIu5+EL8JJ44= 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=SIN7KYKwJct5Wh7LZdwdw4tQEFSPoYb2sfrVZL7GyKBtN1wkHiGd0UeJ9fY7k4sfF4 UsV0G59tb2yUF6jLhZoB9B394sR1D22iqEaSBNqdIAAsaMDTeba0FkVFPwz/0f8qDg/n 7OkaRNMxVvMMMvT6wNeQFnUA+PgrsDCsL93eS+rAsjcr0mSaWwSjp/00ry+cWe6D+YJ2 maTMVk9oHrfspuZYGI11zZIaqc6o7JqMumheT0gIGYLIPcCthQIMwt/ApoBQmP2+SYje SwjAK1QUvH5F9WqiL7+RAvRk6sdCCt9c/gpR3vqA9KeJIwpcyRC/N12ShAFVAaXwn9C6 QAtQ== X-Gm-Message-State: AHPjjUjvomvu7YrME2j8JgWiqIcR2eNmSxnwYZXayWPnEx2UVZdGQKZ1 3ZWObbHYLdAdc1i9 X-Google-Smtp-Source: ADKCNb5n1GDohQuBYY6jlKfxby5+12KiP6KjrqbVahbT6KuiCgHpwdzrati0CBd0SNUGjo7aI0LhOQ== X-Received: by 10.80.149.92 with SMTP id v28mr1167045eda.284.1504626079614; Tue, 05 Sep 2017 08:41:19 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id k19sm336273eda.73.2017.09.05.08.41.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 08:41:18 -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 v2 3/5] KVM: arm/arm64: vITS: Drop its_ite->lpi field Date: Tue, 5 Sep 2017 17:41:04 +0200 Message-Id: <20170905154106.2945-4-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170905154106.2945-1-cdall@linaro.org> References: <20170905154106.2945-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);