Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp510415ybi; Tue, 16 Jul 2019 00:53:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTTBVPGeT1D5HMkXD2fuciXgzDvERrkF8KTwRXgEDsJFDlV3yCqb++q8Wb2MkCW0UKXmxq X-Received: by 2002:a17:902:900a:: with SMTP id a10mr33996180plp.281.1563263631916; Tue, 16 Jul 2019 00:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563263631; cv=none; d=google.com; s=arc-20160816; b=Zr2kQutUB0RkAH6mBvgoHHfzFKYcDV/yAimC0zpXV6m3E7km1DnNiVHN1lc7teGRnv es9KwFkWzTYdh+bpYpV3UpbqZ7chOQ5zoz04NkMfoIlDP0qX57TAdHOVLyUD+wCUIIxN c4KzGeCVGvm9IrYMUlurZ5BT/n1P5H+x+VxTUIaZZjj+U6fA+rvxU38L0d96xwTaQON5 +jqzN3FMZu81tDxS+fkcvzt+TNL5Fdo2bTj39NveE53h/iAhtZuIR3dN9RpmIoEokrD/ lqb8c+1+n/zgsxohG4Ke9Su72wQb/RTt0Ez/CMEUNHm49yXmDk4RwkwQx+dXCfhgTGQN 676w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dXPUTOAI0cDVqTqnPrprMbsjBX2mDvsuxWBfDKqb2Y0=; b=J3rRb8w5zg9/qBIKyT7Af6NX3ABNrj0tMVthjQkNJvlOMWpPatMoyYKmruD/iKCGjt Ccz/UFZNS17n7QHVftHfmfGlvmRte/0xjsPNPF0Tfwy5usCV/JlG6DNdLOPj920hLhlK eBCnN8E8Ehj/Y6916OlOpGEOucbxuvLT79LIfvjhrZsH8TbQ1Dg5mN1uE/kPoQ4AAcJC mg7UYr+72BnPKsR7ZIT0qRs+tL+pG/0FvanmiZH2WTGU5SSWL0PMfnsDF/QaWt3+MJfr bT+XS19Hgm5KT8KluDIYAoHt19p7F6IBx8j4IvNyHCuYA24MJij3XAYVH5MeO7/zhjYr T66w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si17896748pll.439.2019.07.16.00.53.35; Tue, 16 Jul 2019 00:53:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729778AbfGPHwm (ORCPT + 99 others); Tue, 16 Jul 2019 03:52:42 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:36568 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726420AbfGPHwl (ORCPT ); Tue, 16 Jul 2019 03:52:41 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8D4F24C29AFC5FF4B6B7; Tue, 16 Jul 2019 15:52:38 +0800 (CST) Received: from [127.0.0.1] (10.184.52.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Tue, 16 Jul 2019 15:52:28 +0800 Subject: Re: [RFC PATCH v2 0/3] Support CPU hotplug for ARM64 To: James Morse CC: , , , , , , , , , References: <1561776155-38975-1-git-send-email-wangxiongfeng2@huawei.com> <82879258-46a7-a6e9-ee54-fc3692c1cdc3@arm.com> From: Xiongfeng Wang Message-ID: <8a8cd9d2-684e-2246-c1f9-5cf21aa2defc@huawei.com> Date: Tue, 16 Jul 2019 15:52:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <82879258-46a7-a6e9-ee54-fc3692c1cdc3@arm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.184.52.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/5 18:12, James Morse wrote: > Hi guys, > > (CC: +kvmarm list) > > On 29/06/2019 03:42, Xiongfeng Wang wrote: >> This patchset mark all the GICC node in MADT as possible CPUs even though it >> is disabled. But only those enabled GICC node are marked as present CPUs. >> So that kernel will initialize some CPU related data structure in advance before >> the CPU is actually hot added into the system. This patchset also implement >> 'acpi_(un)map_cpu()' and 'arch_(un)register_cpu()' for ARM64. These functions are >> needed to enable CPU hotplug. >> >> To support CPU hotplug, we need to add all the possible GICC node in MADT >> including those CPUs that are not present but may be hot added later. Those >> CPUs are marked as disabled in GICC nodes. > > ... what do you need this for? > > (The term cpu-hotplug in the arm world almost never means hot-adding a new package/die to > the platform, we usually mean taking CPUs online/offline for power management. e.g. > cpuhp_offline_cpu_device()) > > It looks like you're adding support for hot-adding a new package/die to the platform ... > but only for virtualisation. I read the GIC driver these days. It is a lot of work to configure the GIC at runtime, and this patchset doesn't support this. Actually, my original idea is hot-adding cores to the platform, and it is only for virtualisation. These cores need to be on the same physical package. The GIC is initialized when the kernel boots and GICR is initialized when the core is hot-added and brought up. > > I don't see why this is needed for virtualisation. The in-kernel irqchip needs to know > these vcpu exist before you can enter the guest for the first time. You can't create them > late. At best you're saving the host scheduling a vcpu that is offline. Is this really a > problem? > > If we moved PSCI support to user-space, you could avoid creating host vcpu threads until > the guest brings the vcpu online, which would solve that problem, and save the host > resources for the thread too. (and its acpi/dt agnostic) > > I don't see the difference here between booting the guest with 'maxcpus=1', and bringing > the vcpu online later. The only real difference seems to be moving the can-be-online > policy into the hypervisor/VMM... > > > I think physical package/die hotadd is a much bigger, uglier problem than doing the same > under virtualisation. Its best to do this on real hardware first so we don't miss > something. (cpu-topology, numa, memory, errata, timers?) > I'm worried that doing virtualisation first means the firmware-requirements for physical > hotadd stuff is "whatever Qemu does". > > > Thanks, > > James > > . >