Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1491095imm; Wed, 17 Oct 2018 22:11:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV61etmsgkVNtqgtnlJ7C9MLVRDNjcPD6WqAEA8ophXbR85MvKX+CiNMpi0Re9hWh3JFjgjBk X-Received: by 2002:a17:902:c01:: with SMTP id 1-v6mr16025491pls.233.1539839483894; Wed, 17 Oct 2018 22:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539839483; cv=none; d=google.com; s=arc-20160816; b=rhQ5hzmOlwY3qnuvOx1C07UijhZfbWZadG/NdCCaKYSxKcEARFVg9UWeTNXmSdGtaV KL4sEc2f7qE8wzOCM1wh6jEJJsTr1mx0llSK+XYdh+gToCWrnCF+bLzBdbHxoE9RmjoV /Z9+eFt6NP+n343D0Ftbgz7Fseb1r7t2fMWYlOP3rcisYMIucHjtWDJ48XkNFXzIFjta OfM32U7SWG1sDbie2Z5HXBiKJ5xe9vy+fMapIZgO1ohVN/FrsFAU0TcVlgKiPxPIn4ja NQwvJvt+oxgnIJK3deeu7qhy+xrPKXiZGcMZZ4WLoTf/tRp32jaYxB6iMv68QBjeuP5M LjDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=T2E9oL2BWBEC64p9ZEVB07N7O00wsedS0FgHYLG9+bo=; b=r6RZ3AmKYd3FsO3vq/OyQKDCdTgGgiJjUSk6UU2n/Igkp/WaLPPAvNIz391AcJAA3A +2TxPgOIzUPUb06knd49VSi8qwHfbFfo34ai3i0smpaUXEpNDlBVfOwleGhk6hLYylks hhVLtWEJi10EqK0XJY94ngBQgJ3yA0uzZc7g/nvQTBfzph6PHjkOn0OKJ9gzAQxdtu1M CG4vQPBZ5+RFr/6njEa/A6+AVqAx4OqsDX0GXCBtq/cZre4pm3y3klYe1OKn+4Yxv55Y PxqzeFzHtyCwN7DjYQT4uKUOKGrqtHFTu41Il51ZSItwUQdZ/CudRlL4Lnhqmr+xUAGC oJUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si19267430pll.337.2018.10.17.22.11.08; Wed, 17 Oct 2018 22:11:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727641AbeJRNJp (ORCPT + 99 others); Thu, 18 Oct 2018 09:09:45 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:39456 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727352AbeJRNJo (ORCPT ); Thu, 18 Oct 2018 09:09:44 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with ESMTP id D0Yvg47xkbOGjD0Yvgan4E; Wed, 17 Oct 2018 22:09:34 -0700 x-originating-ip: 107.180.71.197 Received: from kys by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1gD0Yv-0007HI-Sy; Wed, 17 Oct 2018 22:09:33 -0700 From: kys@linuxonhyperv.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, vkuznets@redhat.com Cc: "K. Y. Srinivasan" Subject: [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context Date: Thu, 18 Oct 2018 05:09:28 +0000 Message-Id: <20181018050932.27932-1-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181018050835.27828-1-kys@linuxonhyperv.com> References: <20181018050835.27828-1-kys@linuxonhyperv.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfCVdhjszUBFJw4+JbZsb4HZB9P6m7Q8jcwGY4vImu7PBjBhrWxk0ogP7BBuNQoLAITXNrqbJ5WKsHeOLQXCC+j70/DHsiuHXzZZ2PsC8B3t1xAybRpcR bSLp7yBb3VCt8W0zL1Kn16tgk/6jlIB2bTy23e17cD8wETrni63hu5eWPc6aDvhtUJQWi97tDvVhpRZvGFYmMLSHwsxBYnks29qWkBw1K5AmaxhjZkrMMl1j MjlN9l6rWfJ9SEks5G1sdsaGwM8uhkx5pu6iklhpveHOLCbt/Z+7EG2kh/Fq4RTmJJl4tt1mHSoZ10Y2cQx5Vr9gnDjhJ6RRrsMSr+Uq2nj49rFBaTHOc7Lj xOcjjHAzY69U38moaiCWtnUIi+RJA5hxbuVRr7J63k5AUmYFMIEzxEhshdl89CaYT/FEaRyjkJp11O0OhzLe1xpEjGpcM5rh7DwzHmA1eQWs31IXqXEenoRp OcXiEC6m4qrA4FIHcNmekig+yZFf1IXuoeqJkqyWBD43Jqu6ilyaZplzIvi7CASINF3IswnmchwSUS44 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "K. Y. Srinivasan" Currently we are replicating state in struct hv_context that is unnecessary - this state can be retrieved from the hypervisor. Furthermore, this is a per-cpu state that is being maintained as a global state in struct hv_context. Get rid of this state in struct hv_context. Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c | 10 +++------- drivers/hv/hyperv_vmbus.h | 2 -- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 332d7c34be5c..166c2501de17 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -33,9 +33,7 @@ #include "hyperv_vmbus.h" /* The one and only */ -struct hv_context hv_context = { - .synic_initialized = false, -}; +struct hv_context hv_context; /* * If false, we're using the old mechanism for stimer0 interrupts @@ -326,8 +324,6 @@ int hv_synic_init(unsigned int cpu) hv_set_synic_state(sctrl.as_uint64); - hv_context.synic_initialized = true; - /* * Register the per-cpu clockevent source. */ @@ -373,7 +369,8 @@ int hv_synic_cleanup(unsigned int cpu) bool channel_found = false; unsigned long flags; - if (!hv_context.synic_initialized) + hv_get_synic_state(sctrl.as_uint64); + if (sctrl.enable != 1) return -EFAULT; /* @@ -435,7 +432,6 @@ int hv_synic_cleanup(unsigned int cpu) hv_set_siefp(siefp.as_uint64); /* Disable the global synic bit */ - hv_get_synic_state(sctrl.as_uint64); sctrl.enable = 0; hv_set_synic_state(sctrl.as_uint64); diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 72eaba3d50fc..f17c06a5e74b 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -230,8 +230,6 @@ struct hv_context { void *tsc_page; - bool synic_initialized; - struct hv_per_cpu_context __percpu *cpu_context; /* -- 2.18.0