Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2444058pxb; Tue, 23 Feb 2021 07:14:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0tDk6e0oTO5d/GTXqrpYmlrtVev9EEUzC3UdOFtkU5Swvq3akGOmuEuDKyl43SmmKHfZy X-Received: by 2002:a50:d7c7:: with SMTP id m7mr27982770edj.260.1614093266591; Tue, 23 Feb 2021 07:14:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614093266; cv=none; d=google.com; s=arc-20160816; b=j4AcJmzZxSGONCNVd8yM40YmLcYiS0CRQu2muDHycX8f1dXLD0SDmJ4cPUvAs4NjFG 5Ras4GqoIPGuooe3jEkmrILBqaKuuYEQQ79mTlieqYBsbb1At3QCvUSuezhETYpSufeY 4wc4Pq1kt0GZM9Ji/v6/isbb3FH64/ls+BfGJCMgfJTICJuVNcnOlaHr50GU2h5vEBja ruCfQh2vvymzIICqgx1xie69vgbdSSSBzrNR+geA0JQMUO562rFzBQuno7f/Jhr5ukOI dz8KXAkVevEYDWQu6cHKuagcNupuWx2mtK6a+4l4/R/GIgp8U5MC2g+0FipKGjLptuYc k+WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VvAmlpRWLy1IB3ajhqxZp4GNx4HVtYypR66tWM6aVnQ=; b=QYX97O9L8fNDYmMwP1os3FFeK2SVblzbGxsUE5TlmVPin2Qbyb6ccUxmpBETCDNT94 iI4Euu1Qf8Zc3IIwf9lau+KLY7+VS1FTK/ejRaYgyiSu0K2BqReEtQ9Q1joHhcIrayRq bLNwrXLGjmQFmOCjPNF6nOjOilCPX8oeTDzfaP+3D/cl5vhMT6Qw4ztBHFwgLeggh+NC R6quXoOtyPybORHmNx8gCHocRpB8ajRlZXRBOa92Rw2pXvPwd02ByA956pE2Hm9mWZtk ihu9P81VH3r4mJ7nIFqeLwhhIDx0kWXqrG9gjG1M00tPZXGs32YpxDji8ChAK6wCX94d 08Dw== 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si3968261edu.55.2021.02.23.07.13.54; Tue, 23 Feb 2021 07:14:26 -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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233083AbhBWPMt (ORCPT + 99 others); Tue, 23 Feb 2021 10:12:49 -0500 Received: from foss.arm.com ([217.140.110.172]:55032 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232651AbhBWPLr (ORCPT ); Tue, 23 Feb 2021 10:11:47 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 98F171FB; Tue, 23 Feb 2021 07:11:00 -0800 (PST) Received: from e107158-lin (unknown [10.1.195.80]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93C7D3F73B; Tue, 23 Feb 2021 07:10:59 -0800 (PST) Date: Tue, 23 Feb 2021 15:10:56 +0000 From: Qais Yousef To: shuo.a.liu@intel.com Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, Randy Dunlap , Stephen Rothwell , Thomas Gleixner Subject: Re: [PATCH RESEND v2 1/2] cpu/hotplug: Fix build error of using {add,remove}_cpu() with !CONFIG_SMP Message-ID: <20210223151056.7j64e3ioyp2lkhkg@e107158-lin> References: <20210221134339.57851-1-shuo.a.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210221134339.57851-1-shuo.a.liu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/21 21:43, shuo.a.liu@intel.com wrote: > From: Shuo Liu > > 279dcf693ac7 ("virt: acrn: Introduce an interface for Service VM to > control vCPU") introduced {add,remove}_cpu() usage and it hit below > error with !CONFIG_SMP: > > ../drivers/virt/acrn/hsm.c: In function ‘remove_cpu_store’: > ../drivers/virt/acrn/hsm.c:389:3: error: implicit declaration of function ‘remove_cpu’; [-Werror=implicit-function-declaration] > remove_cpu(cpu); > > ../drivers/virt/acrn/hsm.c:402:2: error: implicit declaration of function ‘add_cpu’; [-Werror=implicit-function-declaration] > add_cpu(cpu); > > Add add_cpu() function prototypes with !CONFIG_SMP and remove_cpu() with > !CONFIG_HOTPLUG_CPU for such usage. > > Fixes: 279dcf693ac7 ("virt: acrn: Introduce an interface for Service VM to control vCPU") > Reported-by: Randy Dunlap > Signed-off-by: Shuo Liu > Acked-by: Randy Dunlap # build-tested > Cc: Stephen Rothwell > Cc: Thomas Gleixner > Cc: Greg Kroah-Hartman > Cc: Qais Yousef > --- Reviewed-by: Qais Yousef Thanks! -- Qais Yousef > include/linux/cpu.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/linux/cpu.h b/include/linux/cpu.h > index 3aaa0687e8df..94a578a96202 100644 > --- a/include/linux/cpu.h > +++ b/include/linux/cpu.h > @@ -108,6 +108,8 @@ static inline void cpu_maps_update_done(void) > { > } > > +static inline int add_cpu(unsigned int cpu) { return 0;} > + > #endif /* CONFIG_SMP */ > extern struct bus_type cpu_subsys; > > @@ -137,6 +139,7 @@ static inline int cpus_read_trylock(void) { return true; } > static inline void lockdep_assert_cpus_held(void) { } > static inline void cpu_hotplug_disable(void) { } > static inline void cpu_hotplug_enable(void) { } > +static inline int remove_cpu(unsigned int cpu) { return -EPERM; } > static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { } > #endif /* !CONFIG_HOTPLUG_CPU */ > > > base-commit: abaf6f60176f1ae9d946d63e4db63164600b7b1a > -- > 2.28.0 >