From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbcLCSk2 (ORCPT ); Sat, 3 Dec 2016 13:40:28 -0500 Received: from p3plsmtps2ded03.prod.phx3.secureserver.net ([208.109.80.60]:34874 "EHLO p3plsmtps2ded03.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbcLCSjq (ORCPT ); Sat, 3 Dec 2016 13:39:46 -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 V2 07/15] hv: init percpu_list in hv_synic_alloc() Date: Sat, 3 Dec 2016 12:34:34 -0800 Message-Id: <1480797282-10126-7-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1480797282-10126-1-git-send-email-kys@exchange.microsoft.com> References: <1480797239-10085-1-git-send-email-kys@exchange.microsoft.com> <1480797282-10126-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfFjUKTXKFyszlb4JSGAg3PcKN1RhRvbUQGSUwp9lKiu1dYC0XJS1mUTD3q2Y+3/yBddrn1JLlw2eh8yhfXGTRGfjXSDd0nQJW0xi6UY1Ev1wKG8bPdcY G7ahRjaMJmsfUfrGtjrBXgEPkoe10LKLzb+vLw7db8BxjWh6QrdNAXZBtz/cpk3fYTy6/XLkeip4fe0VIw43CwuM3zuORERqUIpJczrgpibaeG6T5gTz1dcg Bc+s0qCImVy3/Z4yv2vZgsgugdRvQ/6GQr9Vztl+IXaNWiasyc0sjWcfFztWW+si+deiDlIjnZA1n1fi6OqAn6P1qghaVJAeG/Q/RECUuUepkGHohWj1ed2h ow2aevtnhxFCkbKhB7e3V0VvwVtcGi5wQwNbowjfN1YBcf77ssaAgk2NDtyIPiSkSY7uu8TWnhiomJT3BA4K0xBFvPEMkhkFPYtW7VOK15Yi+Vwf1f8= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 e4bb498..a2567a4 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