From patchwork Tue May 9 08:56:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9717351 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 B1A3160365 for ; Tue, 9 May 2017 08:58:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4BDD283BA for ; Tue, 9 May 2017 08:58:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99A8E283E8; Tue, 9 May 2017 08:58:20 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2627D283BA for ; Tue, 9 May 2017 08:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=izuSu0mGyQCndbmHsjr8t4m4fnfttE8kEA7smjCTixA=; b=IORFVMCdlO0XWSD7tfj1UYJ+Ie 3L/LDHYh1N2YT7vEliFpK6bjSOoiwtg41Em+l8XCXyhSsCDeJx4aacrI+YnM5rf9oi7dR+NaBNR13 045HxWYInB4KeuLDKFEM/f8twPSfoIoQ+Bf+C2nAdQT6aIC3VhB1FDn2s84PUM9w/3alEztR8pOCE +S8aaeW0kg8XGh+sTe43FPQN2mQekAyr16/MBKvOYwhY9hWsZ7PuKmaH/yDwgqqk02ZB8QcYUQ8yJ 1PDCq/aVbOiy1x8yxXGKCXuXD+4gGn72tX16ApzqcR9P8VEQacyVfGXELQ7hwJz32G2p28KrHKoCB T5nb9z9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d80yJ-0004AB-Go; Tue, 09 May 2017 08:58:19 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d80ws-0002Ie-VN for linux-arm-kernel@lists.infradead.org; Tue, 09 May 2017 08:56:54 +0000 Received: by mail-wm0-x22a.google.com with SMTP id m123so92392268wma.0 for ; Tue, 09 May 2017 01:56:32 -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=X5S09J8OG1pBF+v9ya2pj8zXoToQrxGMXYiHnvUjJvI=; b=Yw5inIxC6CFVTYipdSv2adePOMTKzLfcJ/VB5Us+1bpmem7jvmR3OYe+uvSh2BltqH oWRQ9Dm9dO3X+6NleGEvkF2hmDCvPHdtUxUrgyHKfV3evXiuxEBuzaJm9yryo/HMQtyK 3LdeuGbeuSRMmBDStL5iiev8ig0zbdrLlHeoU= 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=X5S09J8OG1pBF+v9ya2pj8zXoToQrxGMXYiHnvUjJvI=; b=VOOYVVBWOP0Eae6ZB7JHH/Uh9slLBMQ6tdEtvL9/46eROg7haZwaLS34WSzgxBQlQF /MTlypiD+17RtH1JcZNhFpGndvGxUCHZESqjN+w+voUSEeb/U3mXoOO6K1KnnwgAjyRo F2TFKhQCtbhraGpqGc3kP8Wd1a+LfgygCd3ZcDHeC01U48dDwUMmI/p3xqaVmW9SxlFe EEQrR0PaGxcoLSL+Sw8t/ZubQVz4kmUA9qZ5U5fpVx5qt0FW5Z/QTIIbYlUy5rTvn3Wl 9yN4QcyRZP1EU7e8KglzJyDXubv0ExPxXdvPLmbbOYY9AUk2+mMQol8s2iiVSMgQVfFE cOLQ== X-Gm-Message-State: AN3rC/5CbZ/OfAa0l7moxq8T/i5rZrt2fdhcn3UAtxnQsMX3tld0vuIx RHGZaGn9kKcfKcy6 X-Received: by 10.80.177.148 with SMTP id m20mr45150395edd.173.1494320191668; Tue, 09 May 2017 01:56:31 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id f40sm8376265edb.7.2017.05.09.01.56.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 01:56:31 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 08/11] KVM: arm/arm64: Get rid of its->initialized field Date: Tue, 9 May 2017 10:56:15 +0200 Message-Id: <20170509085618.28311-9-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170509085618.28311-1-cdall@linaro.org> References: <20170509085618.28311-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170509_015651_406151_243CFC12 X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Eric Auger , kvm@vger.kernel.org, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier The its->initialized doesn't bring much to the table, and creates unnecessary ordering between setting the address and initializing it (which amounts to exactly nothing). Let's kill it altogether, making KVM_DEV_ARM_VGIC_CTRL_INIT the no-op it deserves to be. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall Reviewed-by: Eric Auger --- include/kvm/arm_vgic.h | 1 - virt/kvm/arm/vgic/vgic-its.c | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 4ff65ef..bfde6fb 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -148,7 +148,6 @@ struct vgic_its { gpa_t vgic_its_base; bool enabled; - bool initialized; struct vgic_io_device iodev; struct kvm_device *dev; diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 9f7105c..18318c6 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -1545,9 +1545,6 @@ static int vgic_register_its_iodev(struct kvm *kvm, struct vgic_its *its) struct vgic_io_device *iodev = &its->iodev; int ret; - if (!its->initialized) - return -EBUSY; - if (IS_VGIC_ADDR_UNDEF(its->vgic_its_base)) return -ENXIO; @@ -1597,7 +1594,6 @@ static int vgic_its_create(struct kvm_device *dev, u32 type) INIT_LIST_HEAD(&its->collection_list); dev->kvm->arch.vgic.has_its = true; - its->initialized = false; its->enabled = false; its->dev = dev; @@ -2397,8 +2393,7 @@ static int vgic_its_set_attr(struct kvm_device *dev, switch (attr->attr) { case KVM_DEV_ARM_VGIC_CTRL_INIT: - its->initialized = true; - + /* Nothing to do */ return 0; case KVM_DEV_ARM_ITS_SAVE_TABLES: return abi->save_tables(its);