Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp938901pxb; Sun, 21 Feb 2021 05:47:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBp45vPpcHT+Xij3PjsFsQdaR1UxfMVrNMjM3OTUBrynEpUjT1YPiHNoBWnPCAPEecu/XU X-Received: by 2002:a05:6402:686:: with SMTP id f6mr9673459edy.125.1613915274410; Sun, 21 Feb 2021 05:47:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613915274; cv=none; d=google.com; s=arc-20160816; b=Fd0h6xiRm+3ou7Wbgjrz1EIWwcE1YPlPkwRJdT0M+DhNrIBU7osImly5cgRVXwAP0X aoLsNnyvwFz9Edp9N8nrKhLa9mQxln21VYUZrxV6b3y9sQlkdGpCpyAd2QOvHA5Fv7B0 zrvLeolFBmQ3UsN5/KRYebs9Yu1cAoGFMFuWaH+NFabaqeh5vegGszx82vLZdYO5edqH FVQdzgRDJZA1ax0rdB6iQBRu91dlXszWnD3gBmurKRJ0p828sSfjSCPuQNLYejBvQhI8 g0BXRqaskryWGaMRKSoCbmWL2zVSVFe8sH0tLAp4uL60Jmi/cOuU+uFskYYMY4DP8I7h cwEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=X7K2IeKLNXm8QCLmvEXbf6DgXGCDcfHAE0KGNciI7g8=; b=pdBoJYCntAj9+4V5/H59THYhDYG1WZ/8KiIdF6IshPnjzEIgG8tdosYWXx4Xzxa58R 6YdUyamN+U/GqZ2gEfGBhwKoSPiK7lPipI32OblvRcBjIyEOkOIbmbMspjec0cHCBuFT iSZaeC3AiiVKraBwBzqXZEtDIyv6Ch2/4zWHg+YZ8Tm8cxY0UGOhKFUeVXUw4HxrECY8 jkAM6eH5qnaSeKT875zeLM2flugsGstWFmiiyti3xkd7yPdPrd2Ljn8swhYez+2A/rKj pSXUQyts6vcyYbgnhkAoDblys4quzP9e5Heje9zqCcHSpz3PUSVmFbH9E+bNsly80q1i iiZg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o17si9947309edz.582.2021.02.21.05.47.32; Sun, 21 Feb 2021 05:47:54 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbhBUNom (ORCPT + 99 others); Sun, 21 Feb 2021 08:44:42 -0500 Received: from mga12.intel.com ([192.55.52.136]:6134 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229871AbhBUNom (ORCPT ); Sun, 21 Feb 2021 08:44:42 -0500 IronPort-SDR: aFrmcwf0rBDW2zYUGjYNbTNlpCdElKLB2x+IAnSIGkMyQeaGcdFYISF+b1IgF/3IGcdvAlXJKK Jc+JiZ3mZ3aw== X-IronPort-AV: E=McAfee;i="6000,8403,9901"; a="163424727" X-IronPort-AV: E=Sophos;i="5.81,194,1610438400"; d="scan'208";a="163424727" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2021 05:44:01 -0800 IronPort-SDR: PrMCnlPheAYGnrOWVQ4mJikuV4V5DUBeP3/PLvJQpOx5R66Z8+PN71LHr8rcw6S5k0N8sN0tWf XvP8GwYE6OOQ== X-IronPort-AV: E=Sophos;i="5.81,194,1610438400"; d="scan'208";a="402012813" Received: from shsi6026.sh.intel.com (HELO localhost) ([10.239.147.88]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2021 05:43:58 -0800 From: shuo.a.liu@intel.com To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, Shuo Liu , Randy Dunlap , Stephen Rothwell , Thomas Gleixner , Qais Yousef Subject: [PATCH RESEND v2 1/2] cpu/hotplug: Fix build error of using {add,remove}_cpu() with !CONFIG_SMP Date: Sun, 21 Feb 2021 21:43:38 +0800 Message-Id: <20210221134339.57851-1-shuo.a.liu@intel.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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