Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753395AbcLGHgg (ORCPT ); Wed, 7 Dec 2016 02:36:36 -0500 Received: from p3plsmtps2ded03.prod.phx3.secureserver.net ([208.109.80.60]:39882 "EHLO p3plsmtps2ded03.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbcLGHeo (ORCPT ); Wed, 7 Dec 2016 02:34:44 -0500 x-originating-ip: 72.167.245.219 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com Cc: "K. Y. Srinivasan" , Subject: [PATCH 3/5] hv: init percpu_list in hv_synic_alloc() Date: Wed, 7 Dec 2016 01:16:26 -0800 Message-Id: <1481102188-4414-3-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1481102188-4414-1-git-send-email-kys@exchange.microsoft.com> References: <1481102113-4365-1-git-send-email-kys@exchange.microsoft.com> <1481102188-4414-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfMW8SY/8RnuztFlIH8Gk4qECLlq5TVOxjm1wGfiRQLwjUBGhlwqr7JGb9YY7EYvLBeySMFf1zaCQ1vZXxI0KrDiYu5C9KwWoTwyMTo4n1zKRqZtJjJE/ +Ey5py3lK9SRHlDXdVTIFHvYwROU/lliGdU7auPav09R3kRoGMncpA8obrdH+csSqldbpDhrKRRt30lLWeHDs6/9ipy063QK5wyb8exGIFBmqXJXxxQ5aVm9 vIqd/0f+9WzrOX0t58XvGYVVnZUbfCCrElq+3yiWldFPNhLezPLke14dZMExlBlo54A3zr1cwgKqv+7ugmd7D54F0M9CCPypDlYGZJGqlAn7EbsSadmv5CBT arMO27fAZsZkXmi59Poorm4S8pcp7aIwloeV0a6N3b7JCQBAQl9T7yc/PIY3ObMYOhG0i5WcsiFXz5r3u6gWzTLevUXYnzzv8IaCwWq5mnYOt6lZ17oGxPZy QzkuZxdcKNjxvbvRgD9kR0i2vYBd4vNVXbtOEA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 Lines: 37 From: Vitaly Kuznetsov Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a crash in percpu_channel_enq() when not all CPUs were online during initialization and it naturally belongs there. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/hv.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index c326c67..c11393c 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -457,6 +457,8 @@ int hv_synic_alloc(void) pr_err("Unable to allocate post msg page\n"); goto err; } + + INIT_LIST_HEAD(&hv_context.percpu_list[cpu]); } return 0; @@ -552,8 +554,6 @@ void hv_synic_init(void *arg) rdmsrl(HV_X64_MSR_VP_INDEX, vp_index); hv_context.vp_index[cpu] = (u32)vp_index; - INIT_LIST_HEAD(&hv_context.percpu_list[cpu]); - /* * Register the per-cpu clockevent source. */ -- 1.7.4.1