Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp155144imm; Tue, 16 Oct 2018 20:15:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dxLb2KvFScOfY01QEMFAsqaxBUVmZ6wymFr6Kw0NfOYC1n0b4QfVQI9vrNvgJ7nXQJPeF X-Received: by 2002:a62:642:: with SMTP id 63-v6mr24452349pfg.190.1539746159040; Tue, 16 Oct 2018 20:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539746159; cv=none; d=google.com; s=arc-20160816; b=LqYkRuwBMCynUcIiGQ1LhxJ3jaVUapWY3Dn6CGoLAiFUCVaLUY3cGo45dSCnA9nkNV y0xlH1y7C4CFlSpRyaQJj6RTFJqLuSf5a7CSJmEB0vslBETj413BuXgy3GzwFfZF54vK P7/kjGi6Hh9Ac3sVo1kb6KA7XWlr1lhqYDxYC3BligmUQsEPTYOJSTMIh2hVdJXdjp+s yHud5xbowCU/MYo5sp48URi29W4+E7LeLBCJdEs9J46i9l+Z01ZUEqDGDGvC+6dY3WxD rLRP2CEIYzW7m30avXu+vaq9djgt9q91kaq3c2MsuizAIwei5rFQofQDwotHLILEUFEF Wv8w== 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=/dzjOrGbEO6+fywUyXfTWeXhFvugyC1zVIst6+Tib6M=; b=PN1obpPYH8TzfRLnZSkNvUPR9PLA1eURGFUM8lfXkIpHqZKj3cnfU5VpJyFh3PlSbU H4DXF+k7/cpeCwZF8CK3AU1fputnIHxsvFivqCOqHlREgY7pJJbcNnZhuh1CUoalDlgN GEv2tXAz2K05WcHgsNxEx/V/G+7nZStnlWiICoLW802XmpjF2XJ6J2ps6HVw8gn1BO9j x+YuJxEJJ3DDq7sctp5a2VWd4WVVV6imJt1Hl0J7g4nVrDml9c9dtBFJxilsXf4zIABZ q9ovn9/8vELmx7lZqG4FAcqjx7Gx1SOkeyXFc3uoETDI16U7uxETKjl1CAyO73pl8dSx uv1Q== 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 l2-v6si16933262pgc.196.2018.10.16.20.15.43; Tue, 16 Oct 2018 20:15:59 -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 S1727483AbeJQLIl (ORCPT + 99 others); Wed, 17 Oct 2018 07:08:41 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:59382 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727258AbeJQLIk (ORCPT ); Wed, 17 Oct 2018 07:08:40 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with ESMTP id CcHggUvXvsezkCcHggAZnh; Tue, 16 Oct 2018 20:14:08 -0700 x-originating-ip: 107.180.71.197 Received: from kys by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1gCcHg-0000DG-EH; Tue, 16 Oct 2018 20:14:08 -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 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context Date: Wed, 17 Oct 2018 03:14:02 +0000 Message-Id: <20181017031406.773-1-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181017031241.669-1-kys@linuxonhyperv.com> References: <20181017031241.669-1-kys@linuxonhyperv.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfLK9MjpBsderNzzVwxmz0YPdhAHYckRBt9fI/KvkFxvc/I5vfF+EDeOUUUAtJV5rRDDMY8S9GyaVeVEqNInma+3Tt7e9YTKw/qhNCrz0IAV6FY1beBZw mc9LWvCild4h65jX4OQiDLSIiz4/X6/1H+u23BwsbKQYYoRBdsCW3Ul5bd+Yhi5clxI8ql8l+lhYJV/JBXgjXEMirdgR8lsykOXU8XLLhUxegPj+N0v2uBJC sHf7wUg/7B/sRfBN32wPpa6WbW4Ua4PyLsfAW8z7Imk38LCKb8rbFj5PYIk+isLZTtvrdz6szpXAbTRU0+R8Ze72G1i/rAc8R/bpP3rMwy6COIid79po+H9m 8ZRrT7uN1WY2ZV1+yXs0rXIOt7gFwnumf+yh+Bc4pa+M4WShekzfTsliuI4Za79sliuc9k5rqkafGqH7K+SyR7Rxa6VCdHuE89A3Cr4dFW8XX0wlItwARLXk v7rm189dckdGpx4S9SyQi+QNGwmP/zRbLt6VCRIJZq/x0KiWaxKV1I+Y9gp9ySJXnox3bw2fOy/Egf0O 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. Reply-To: kys@microsoft.com 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