Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7638275rwp; Tue, 18 Jul 2023 20:03:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlHD6cUp1rgYLHTHqmnuXEPiInwR+EyPcE88amoQpkMfYirlG8G0pqW5ggHkyvvcUB5DzmyK X-Received: by 2002:a05:6512:1181:b0:4fb:89b3:3373 with SMTP id g1-20020a056512118100b004fb89b33373mr10281446lfr.43.1689735819715; Tue, 18 Jul 2023 20:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689735819; cv=none; d=google.com; s=arc-20160816; b=MItXzrq/N1XZU7/hWMTYH8wcH/kXaemXufUw56auvzCQdrGvdVmK96jnj60FqjRy4K MCrV2aJ3tWuh27FLlTn4WdlKkQGL2CZbNGAEv334xPQG6uVzFOInFw8i7gBX0vJXKcO0 3hVBqV00q4PDL/NTXA3CqvMSlPF0E0rCIKNj3YR/eCkrSl4XTCMlA6e9xD4g/W2vbsWQ wbkW/yBfumERoQBBxZpkJgy91Af0N8uC7saoY6O2/96AXSeEVdlVvkdhxzyqFrHy3HDs qsjFWo2CKnOMK5sikiK8KUyo3bQBdyhe35j/2gtLoxy5229qIHduF6ANtxdHlOweJnPA 4fcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=Z4ueBSJFzDzeFthNo6wAnnDG1V42AobeG5gVecIzRjA=; fh=n+OQxkmbeLHe2fUDWdRHez1afmPDDFv6WaaDOaTMFfg=; b=vvnNMISDjirfdFZ0vOImQjedQSqR3ohj3XIzpMycYUORP8jQuTrmeMnCaNfWEFxDrL 6jl0AGlw8GAQDXwwRje4fzUAyLjI9wsyCHix6RBXZvphmX+e5zaVeywUvkatR9HAvCNH zwBWe4hkE6UaxdOEsRnsLxyfdiUI1QSQSTmvvwfDR3e0TzieLKukECIIeRwzZsN9gB2u 7/nrfTJy/JF3jNWnIXqLdB2cQwMUTrg0dsDFIVParroqSeyAmLdCyfDiaT0cHbmzqUU0 cRhfYx0+nZ4BuYsAav6p3scyHp7mLhLwCpfX+7V3FtEeb0b1z3yONG4876lBAqGxN6Z6 rAQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be8-20020a0564021a2800b00521a380947fsi2089727edb.382.2023.07.18.20.03.14; Tue, 18 Jul 2023 20:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjGSCf2 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 18 Jul 2023 22:35:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjGSCfY (ORCPT ); Tue, 18 Jul 2023 22:35:24 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AEA91BC3; Tue, 18 Jul 2023 19:35:23 -0700 (PDT) Received: from lhrpeml500006.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4R5Kc000Dtz67QB0; Wed, 19 Jul 2023 10:32:47 +0800 (CST) Received: from lhrpeml500001.china.huawei.com (7.191.163.213) by lhrpeml500006.china.huawei.com (7.191.161.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 03:35:20 +0100 Received: from lhrpeml500001.china.huawei.com ([7.191.163.213]) by lhrpeml500001.china.huawei.com ([7.191.163.213]) with mapi id 15.01.2507.027; Wed, 19 Jul 2023 03:35:20 +0100 From: Salil Mehta To: "steven.price@arm.com" , Suzuki K Poulose , Jean-Philippe Brucker , "james.morse@arm.com" , "linux-coco@lists.linux.dev" , "kvmarm@lists.linux.dev" CC: Catalin Marinas , Jonathan Cameron , Marc Zyngier , Will Deacon , "christoffer.dall@arm.com" , "oliver.upton@linux.dev" , "mark.rutland@arm.com" , "pbonzini@redhat.com" , "Salil Mehta" , "andrew.jones@linux.dev" , yuzenghui , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Subject: [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world might require ARM spec change? Thread-Topic: [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world might require ARM spec change? Thread-Index: Adm55YYLPryt1tEKR0alBn01xBiFBw== Date: Wed, 19 Jul 2023 02:35:19 +0000 Message-ID: <9cb24131a09a48e9a622e92bf8346c9d@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.48.147.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Reposting it here from Linaro Open Discussion List for more eyes to look at] Hello, I have recently started to dabble with ARM CCA stuff and check if our recent changes to support vCPU Hotplug in ARM64 can work in the realm world. I have realized that in the RMM specification[1] PSCI_CPU_ON command(B5.3.3) does not handles the PSCI_DENIED return code(B5.4.2), from the host. This might be required to support vCPU Hotplug feature in the realm world in future. vCPU Hotplug is an important feature to support kata-containers in realm world as it reduces the VM boot time and facilitates dynamic adjustment of vCPUs (which I think should be true even with Realm world as current implementation only makes use of the PSCI_ON/OFF to realize the Hotplug look-like effect?) As per our recent changes [2], [3] related to support vCPU Hotplug on ARM64, we handle the guest exits due to SMC/HVC Hypercall in the user-space i.e. VMM/Qemu. In realm world, REC Exits to host due to PSCI_CPU_ON should undergo similar policy checks and I think, 1. Host should *deny* to online the target vCPUs which are NOT plugged 2. This means target REC should be denied by host. Can host call RMI_PSCI_COMPETE in such s case? 3. The *return* value (B5.3.3.1.3 Output values) should be PSCI_DENIED 4. Failure condition (B5.3.3.2) should be amended with runnable pre: target_rec.flags.runnable == NOT_RUNNABLE (?) post: result == PSCI_DENIED (?) 5. Change would also be required in the flow (D1.4 PSCI flows) depicting PSCI_CPU_ON flow (D1.4.1) I do understand that ARM CCA support is in its infancy stage and discussing about vCPU Hotplug in realm world seem to be a far-fetched idea right now. But specification changes require lot of time and if this change is really required then it should be further discussed within ARM. Many thanks! Bes regards Salil References: [1] https://developer.arm.com/documentation/den0137/latest/ [2] https://github.com/salil-mehta/qemu.git virt-cpuhp-armv8/rfc-v1-port11052023.dev-1 [3] https://git.gitlab.arm.com/linux-arm/linux-jm.git virtual_cpu_hotplug/rfc/v2