Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbcLGHet (ORCPT ); Wed, 7 Dec 2016 02:34:49 -0500 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:58726 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbcLGHeo (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 2/5] hv: allocate synic pages for all present CPUs Date: Wed, 7 Dec 2016 01:16:25 -0800 Message-Id: <1481102188-4414-2-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: MS4wfBHVHLTFNmy0+rmvOpBwb3bEZleLSmp0Bw5WmMM9nDz/kVysZb+fFo6q6xFIM6mnh/abM4JQwcwRdDwOYRcr8S0HoOLz3DBFro9CR63Yxn6mY6DHqYls QjmOAJ1II7G5ouyY2e0PyCVvkNi6VUXlj7iQM/myblgYuLNJB9kQwUCEoox5IWXtdHk/QfVSWj3L99A3j1wsGRA0VIfkllHdTExPrpylYDwv2eOiu2BiE5jC W9clwaW9eTx9qDJiiwyCkK64JA1aTt1UxwusVQhO8iKUnBM/vuPNYKcB5LcTQxYdlkFIdQ8EGoyjer6jW/mGqHk//mBgt8NgtfTsGlvove9BAM1tN8mi/cdu sekaTu4aVh5WAtGfIElmxVbPIKstaKxIG7UhJFB2o18mn7mAzaLe/yIBtHKzi+b2j8ks+jDuuMO5ivHz69YVD5IAOkQyH0uFjdrtU0kEzgcHrjlrHHfoLz+A 3wgYo3SLXS7T6/Kas+c9CftI1QHRVBxogCo2SQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 37 From: Vitaly Kuznetsov It may happen that not all CPUs are online when we do hv_synic_alloc() and in case more CPUs come online later we may try accessing these allocated structures. 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 446802a..c326c67 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -411,7 +411,7 @@ int hv_synic_alloc(void) goto err; } - for_each_online_cpu(cpu) { + for_each_present_cpu(cpu) { hv_context.event_dpc[cpu] = kmalloc(size, GFP_ATOMIC); if (hv_context.event_dpc[cpu] == NULL) { pr_err("Unable to allocate event dpc\n"); @@ -482,7 +482,7 @@ void hv_synic_free(void) int cpu; kfree(hv_context.hv_numa_map); - for_each_online_cpu(cpu) + for_each_present_cpu(cpu) hv_synic_free_cpu(cpu); } -- 1.7.4.1