Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7930262rwp; Wed, 19 Jul 2023 02:32:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlGWWYUqXhFjxrqfRA5cqSjtZxpDzyws/24UItL9dNUuGhXZGT6oVAOkpoRTCzeuQW6kYHNy X-Received: by 2002:a05:6a20:7d90:b0:126:8b2d:4462 with SMTP id v16-20020a056a207d9000b001268b2d4462mr2102178pzj.24.1689759159312; Wed, 19 Jul 2023 02:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689759159; cv=none; d=google.com; s=arc-20160816; b=EUuEhKPfMxXLP4rOA11p4ufiqqBKiBO7GSN2tNzEaQ94x1ZvbUsmH1byZqsKmFvHWS v1LF/mXPOPgKErECXUStMr/fNbZRJbaPYdbF09f4JFmxgqcqfTvO7AdnolqfrjFv/eMY gN6EVoQPqnDAxAMIlIUR3Uqzxln8l/mjVfOJGyHOK+Q9uFrcjAxTDwfR2cTm2L53LSlh zTMQ6MnPqzGZPW+kicJgyL41idQ0lfQD3bUxdWRgCa4Kd95B9UG1CYd/zDKHwRlswAp6 eBsRqT7dcmqYEVRFjx+ZSVWAgW3exwoeHYL9mWPa/c51fmlvxuDnFsxd30YlUSCsSwYC 3vRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=zNmYQbmEiGX7NKAAaCye5dNrRdonVMIJrFPnnLYPh7E=; fh=OcLr65P5lWsmp6WYrcIePBlex3WbbGQSmu/0CDxk+VY=; b=WJzTSPh+LrhwB4QGAAclgSMSo1KlcboKjnRsSVL5W6zi+OKULO6ZC6sltozMIIq3zn KmI6OnE3b6X+L3Zyx6hUa1buSL7CAehCP+M2bdtLmU+fyDny2/Mgh1HSghk0z32E1Xz4 3XVRHW2oa6ann3YwDSo4qPuK3InJv62NTStuwRPY/uyjW8p13Gt5gMnHAY1yrp3pOdxE jhYJ/Nm5B9qbMmVwWgOTcTjCB6Y7Zi7RDpnnLpH20cs1GT0Crb/7pIV839EWrkkdGryh Cicu05SkbAPJ0YP6ml6zWdIwXsGqWAgiPRTqjCRIhKtj7gypXyh+F0/Sk5UBAhWeIUFW t/yw== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c31-20020a634e1f000000b00553ced07d17si3109086pgb.123.2023.07.19.02.32.26; Wed, 19 Jul 2023 02:32: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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbjGSJ2i (ORCPT + 99 others); Wed, 19 Jul 2023 05:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjGSJ2h (ORCPT ); Wed, 19 Jul 2023 05:28:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8CFB3186; Wed, 19 Jul 2023 02:28:35 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47D4E2F4; Wed, 19 Jul 2023 02:29:18 -0700 (PDT) Received: from [10.57.33.122] (unknown [10.57.33.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 794C13F67D; Wed, 19 Jul 2023 02:28:31 -0700 (PDT) Message-ID: <7da93c6e-1cbf-8840-282e-f115197b80c4@arm.com> Date: Wed, 19 Jul 2023 10:28:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world might require ARM spec change? To: Salil Mehta , "steven.price@arm.com" , 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" , Gareth Stockwell References: <9cb24131a09a48e9a622e92bf8346c9d@huawei.com> From: Suzuki K Poulose In-Reply-To: <9cb24131a09a48e9a622e92bf8346c9d@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 Hi Salil Thanks for raising this. On 19/07/2023 03:35, Salil Mehta wrote: > [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 The Realm exit with EXIT_PSCI already provides the parameters passed onto the PSCI request. This happens for all PSCI calls except (PSCI_VERSION and PSCI_FEAUTRES). The hyp could forward these exits to the VMM and could invoke the RMI_PSCI_COMPLETE only when the VMM blesses the request (wherever applicable). However, the RMM spec currently doesn't allow denying the request. i.e., without RMI_PSCI_COMPLETE, the REC cannot be scheduled back in. We will address this in the RMM spec and get back to you. Kind regards Suzuki > 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 >