From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01651C433F5 for ; Sun, 17 Oct 2021 19:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA43E61050 for ; Sun, 17 Oct 2021 19:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344531AbhJQTav (ORCPT ); Sun, 17 Oct 2021 15:30:51 -0400 Received: from mga04.intel.com ([192.55.52.120]:18948 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233508AbhJQTau (ORCPT ); Sun, 17 Oct 2021 15:30:50 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="226903911" X-IronPort-AV: E=Sophos;i="5.85,380,1624345200"; d="scan'208";a="226903911" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2021 12:28:40 -0700 X-IronPort-AV: E=Sophos;i="5.85,380,1624345200"; d="scan'208";a="565199838" Received: from ericalo-mobl.gar.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.254.45.96]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2021 12:28:39 -0700 Subject: Re: [PATCH v7 3/6] x86/topology: Disable CPU online/offline control for TDX guest To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Josh Poimboeuf , "H . Peter Anvin" Cc: Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org References: <20211005230550.1819406-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005230550.1819406-4-sathyanarayanan.kuppuswamy@linux.intel.com> <877deb4frg.ffs@tglx> From: Sathyanarayanan Kuppuswamy Message-ID: <8eef611f-77e1-aec5-3e1f-24a14ad50c91@linux.intel.com> Date: Sun, 17 Oct 2021 12:28:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <877deb4frg.ffs@tglx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/21 12:23 PM, Thomas Gleixner wrote: > Seriously? This lets the unplug start, which starts to kick off tasks > from the CPU just to make it fail a few steps later? > > The obvious place to prevent this is the CPU hotplug code itself, right? > > Thanks, > > tglx > --- > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 192e43a87407..c544eb6c79d3 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -1178,6 +1178,8 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, > > static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target) > { > + if (cc_platform_has(CC_HOTPLUG_DISABLED)) > + return -ENOTSUPP; > if (cpu_hotplug_disabled) > return -EBUSY; > return _cpu_down(cpu, 0, target); Makes sense. I will use it in next version. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer