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: 9717325 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 AAA2760365 for ; Tue, 9 May 2017 08:56:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A01CE28389 for ; Tue, 9 May 2017 08:56:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94EE2283CA; Tue, 9 May 2017 08:56:41 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 04E9728389 for ; Tue, 9 May 2017 08:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbdEII4i (ORCPT ); Tue, 9 May 2017 04:56:38 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35928 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbdEII4d (ORCPT ); Tue, 9 May 2017 04:56:33 -0400 Received: by mail-wm0-f48.google.com with SMTP id u65so3304766wmu.1 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=mBlgTm3k0vgBgZmsTXpdIYOW7GAqLDAV7Lo6gUkWDDlXkM5hH/2xUKXMBq6oL9R0YJ 5wo8d6PCAglwbhkBk6yLwiMYmwn7UK9VZoh2Q0xUHnP+oXwM0wYqfT8Z8zihiX52bXsh U+u5zhsXz5JQ23zAI5rDNaMqyhV0GA7luUPjDZ7IOgKO8xIiT2/X1E0+PHS17waUu/2x ZTXKQ1suM0C+TvcDxi7Okrs8fbZwd9DMroeB7TWZqFmFLLI8qic7pEGdbU0HC3YknW4n /NgNyjZNsKywPvCwaVIz2oSJQkxaRXsj6xlX7Z7mMhYShSYQT9WagmZzDcdudlm4dlcU nMJg== X-Gm-Message-State: AN3rC/4hVpllvo14AwATEvQ9Jtn+xy8sXWr4f3TWQRS/lwnsudxCl7jq j7dvyVQe7yRn94BP 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 Cc: kvm@vger.kernel.org, Marc Zyngier , Eric Auger , Christoffer Dall 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> 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 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);