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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFBD6C433EF for ; Wed, 24 Nov 2021 22:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352520AbhKXW6I (ORCPT ); Wed, 24 Nov 2021 17:58:08 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:47684 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352309AbhKXW55 (ORCPT ); Wed, 24 Nov 2021 17:57:57 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1637794485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=33e828wB9dEjeifz4XOcX4tXiHJV404Ri36l36adBdc=; b=QL25vkWz5mQq9ypR1mfmeECHaoZFXVS51EIdeocF5QL5UpPcPy/vofDZ9im05kSuQzGiBJ hmVnAE32Zwr1VkRpV1E2d3zSHp/NaafeFx27NyPu3NeXBUKveOHM8EaU3XHWHEOM9acx4v TWEwjphxl+Xa8N5TxXy+pF+QZh0oBWvQ9a133TJwQqhgl5uKgyToljpih/0s43EbY/3lIm cqA8t+/NdjU5XMTORklBghjPF/S6+ETzyUnMQxqFwpOfWrExhkE8lszWssWX+C4T/s5tlu pI/lWC3ZBTxtDAQGnymKdUUdgrmG7v8S4EW/yoFY7yrdWzSp9BUsjrBqKIRw+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1637794485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=33e828wB9dEjeifz4XOcX4tXiHJV404Ri36l36adBdc=; b=mA9Ro9+xZCYf8cq+L5iHAjp5rtiwfJn3ClnLyxZNu70rRhIHMx8CyC3LbEXLTKodK5/j7L 0IJbIbc/zuN/RbDA== To: Sebastian Andrzej Siewior , "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" Cc: linux-kernel@vger.kernel.org, "Gonglei (Arei)" , x86@kernel.org, xen-devel@lists.xenproject.org, Peter Zijlstra , Ingo Molnar , Valentin Schneider , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: Re: [PATCH] cpu/hotplug: Allow the CPU in CPU_UP_PREPARE state to be brought up again. In-Reply-To: <20211122154714.xaoxok3fpk5bgznz@linutronix.de> References: <20211122154714.xaoxok3fpk5bgznz@linutronix.de> Date: Wed, 24 Nov 2021 23:54:44 +0100 Message-ID: <87y25djhaj.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 22 2021 at 16:47, Sebastian Andrzej Siewior wrote: > From: "Longpeng(Mike)" > > A CPU will not show up in virtualized environment which includes an > Enclave. The VM splits its resources into a primary VM and a Enclave > VM. While the Enclave is active, the hypervisor will ignore all requests > to bring up a CPU and this CPU will remain in CPU_UP_PREPARE state. > The kernel will wait up to ten seconds for CPU to show up > (do_boot_cpu()) and then rollback the hotplug state back to > CPUHP_OFFLINE leaving the CPU state in CPU_UP_PREPARE. The CPU state is > set back to CPUHP_TEARDOWN_CPU during the CPU_POST_DEAD stage. > > After the Enclave VM terminates, the primary VM can bring up the CPU > again. > > Allow to bring up the CPU if it is in the CPU_UP_PREPARE state. > > [bigeasy: Rewrite commit description.] > > Signed-off-by: Longpeng(Mike) > Signed-off-by: Sebastian Andrzej Siewior > Link: https://lore.kernel.org/r/20210901051143.2752-1-longpeng2@huawei.com > --- > > For XEN: this changes the behaviour as it allows to invoke > cpu_initialize_context() again should it have have earlier. I *think* > this is okay and would to bring up the CPU again should the memory > allocation in cpu_initialize_context() fail. Any comment from XEN folks? Thanks, tglx