Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1250702pxb; Fri, 13 Nov 2020 07:58:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrucrhno2n/i+c6FnX0vRGqIt+5klyMQp8cupq6SJ2R2hZO8yKzEqTw+X5xLKe28Zwg/H2 X-Received: by 2002:a50:c28a:: with SMTP id o10mr3083946edf.222.1605283115703; Fri, 13 Nov 2020 07:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605283115; cv=none; d=google.com; s=arc-20160816; b=DvgrxmccvIeWWy5P2lZ6T6iM6K5PZZsAL6bZg1G1eAvQSnlo2P0Tg+6uSM+ZZShD2d VH/5xcdQip4g685N2FwqDpDl9WisAJCHf6Dl9juZ434IuyVWsv+ERTU3aXTShWQtHfP+ nOIxvzO9dqXAfVcSH1xg+FhVqjo1BnvVVWLruSHrXgzKYgcObKo6bO3qKG4IfKobJsy+ pxfDPlvjNVhjlyV8+qdy9nACuUtFUexW2cP1d7QFQfgPMMWo+SW2IZTFCQrtF6TjNxSt o+6IegbH3+rHW19q+H5QyvfR+H3+EM3iooCounkyKbFt9jo88yo/ETiHko/8+jMUX0n/ ELLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=s6hyMVEFfMlo0q95MNqmUfjlLkrSXFwE1LaCrXDrf1U=; b=lvkq6sCtDezaPzkHOkcRa/iGEIg9YLzPUSex3lI0W/1fJQey7ytWMBsrDYvZchmtev GskpRCkV513ZJ5RQ+0Bc4if9ojAZSZilGIeoTirCoAZRygNu1qFiRIYd1F/CmGOFuVa9 2ikxymZCFOBqsK2HyPx3wFbM+fz+A5JJCvBqNjdnomWyEExHJskn6d54xLdXkvcQV6tP jaFG1SCtMupwrMB6GdZpWMMQnhnKXZnp81peXygXKJAgc0lMbWFTpLrllWgQHixSYL5m Tlo86T94/Qq/DmpfeZGP+1vLC9eo0ZlgrqmnVpOi8vIXV6rHfiGVGCNKIgYdkcPQ8cuB QUBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si6350110ede.143.2020.11.13.07.58.13; Fri, 13 Nov 2020 07:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbgKMP4j (ORCPT + 99 others); Fri, 13 Nov 2020 10:56:39 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:56299 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbgKMP4i (ORCPT ); Fri, 13 Nov 2020 10:56:38 -0500 Received: by mail-wm1-f68.google.com with SMTP id c9so8527280wml.5; Fri, 13 Nov 2020 07:56:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=s6hyMVEFfMlo0q95MNqmUfjlLkrSXFwE1LaCrXDrf1U=; b=T7GlhVgQg1AiqMBL5AxD8kXFbzWQbAmSuPZCfSo0A8EkuVLrlJ0ifWX652KFtdMPAc 5uRrKQhTQ2rQ1Oy7zIQvyD6H6eIwNVhrW2HIu4tFMCE7HzwPEOuFa50oJmgy36GxHa4K B1Xgn0mhxHJmO4re6AGPMZl1CSoUFq50/yahdNG908uC2In/piy8H21Cxy7LUpe60BKM 49UzKynUQXiCFabc7wmgXXm6uHkxIMFmSjP+koGasjsMIN/RcL+7DXMvVbJJPmO3UXZB uTGB3/V3hAvapO1ym9TxyxU/2kZXOVOBFhdjH3oxYqf5Tfd907vuXzwJeIa9ZrbLdBeS 6EyQ== X-Gm-Message-State: AOAM531aY59mXvySawSFjRp+tZFqo4xe2QmOzHd84n8LTSbAD26hOdRC Ek1E8jJGz+yAlPEFrMtJeNA= X-Received: by 2002:a1c:2643:: with SMTP id m64mr3286089wmm.28.1605282992030; Fri, 13 Nov 2020 07:56:32 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id m18sm9567357wru.37.2020.11.13.07.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 07:56:31 -0800 (PST) Date: Fri, 13 Nov 2020 15:56:29 +0000 From: Wei Liu To: Vitaly Kuznetsov Cc: Wei Liu , Linux on Hyper-V List , virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Lillian Grassin-Drake , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" Subject: Re: [PATCH v2 10/17] x86/hyperv: implement and use hv_smp_prepare_cpus Message-ID: <20201113155629.bkw45kcuqhr6puck@liuwe-devbox-debian-v2> References: <20201105165814.29233-1-wei.liu@kernel.org> <20201105165814.29233-11-wei.liu@kernel.org> <87y2j6wmm7.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y2j6wmm7.fsf@vitty.brq.redhat.com> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 05:44:48PM +0100, Vitaly Kuznetsov wrote: > Wei Liu writes: > > > Microsoft Hypervisor requires the root partition to make a few > > hypercalls to setup application processors before they can be used. > > > > Signed-off-by: Lillian Grassin-Drake > > Signed-off-by: Sunil Muthuswamy > > Co-Developed-by: Lillian Grassin-Drake > > Co-Developed-by: Sunil Muthuswamy > > Signed-off-by: Wei Liu > > --- > > CPU hotplug and unplug is not yet supported in this setup, so those > > paths remain untouched. > > --- > > arch/x86/kernel/cpu/mshyperv.c | 27 +++++++++++++++++++++++++++ > > 1 file changed, 27 insertions(+) > > > > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c > > index f7633e1e4c82..4795e54550e6 100644 > > --- a/arch/x86/kernel/cpu/mshyperv.c > > +++ b/arch/x86/kernel/cpu/mshyperv.c > > @@ -31,6 +31,7 @@ > > #include > > #include > > #include > > +#include > > > > struct ms_hyperv_info ms_hyperv; > > EXPORT_SYMBOL_GPL(ms_hyperv); > > @@ -208,6 +209,30 @@ static void __init hv_smp_prepare_boot_cpu(void) > > hv_init_spinlocks(); > > #endif > > } > > + > > +static void __init hv_smp_prepare_cpus(unsigned int max_cpus) > > +{ > > +#if defined(CONFIG_X86_64) > > '#ifdef CONFIG_X86_64' is equally good as you can't compile x86_64 > support as a module :-) > > > + int i; > > + int ret; > > + > > + native_smp_prepare_cpus(max_cpus); > > + > > So hypotetically, if hv_root_partition is true but 'ifdef CONFIG_X86_64' > is false, we won't even be doing native_smp_prepare_cpus()? This doesn't > sound right. Either move it outside of #ifdef or put the #ifdef around > 'smp_ops.smp_prepare_cpus' assignment too. > Fixed. Thanks. Wei.