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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA69DC63777 for ; Thu, 3 Dec 2020 10:56:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E543208A9 for ; Thu, 3 Dec 2020 10:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388594AbgLCK4B (ORCPT ); Thu, 3 Dec 2020 05:56:01 -0500 Received: from foss.arm.com ([217.140.110.172]:37062 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387870AbgLCK4B (ORCPT ); Thu, 3 Dec 2020 05:56:01 -0500 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 EFD0F113E; Thu, 3 Dec 2020 02:55:15 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.0.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 129CC3F66B; Thu, 3 Dec 2020 02:55:11 -0800 (PST) Date: Thu, 3 Dec 2020 10:55:09 +0000 From: Mark Rutland To: David Brazdil Cc: kvmarm@lists.cs.columbia.edu, Jonathan Corbet , Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , Christoph Lameter , Lorenzo Pieralisi , Sudeep Holla , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Subject: Re: [PATCH v4 16/26] kvm: arm64: Bootstrap PSCI SMC handler in nVHE EL2 Message-ID: <20201203105509.GD96754@C02TD0UTHF1T.local> References: <20201202184122.26046-1-dbrazdil@google.com> <20201202184122.26046-17-dbrazdil@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201202184122.26046-17-dbrazdil@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, Dec 02, 2020 at 06:41:12PM +0000, David Brazdil wrote: > Add a handler of PSCI SMCs in nVHE hyp code. The handler is initialized > with the version used by the host's PSCI driver and the function IDs it > was configured with. If the SMC function ID matches one of the > configured PSCI calls (for v0.1) or falls into the PSCI function ID > range (for v0.2+), the SMC is handled by the PSCI handler. For now, all > SMCs return PSCI_RET_NOT_SUPPORTED. > > Signed-off-by: David Brazdil > +static bool is_psci_0_1_call(u64 func_id) > +{ > + return (func_id == kvm_host_psci_0_1_function_ids.cpu_suspend) || > + (func_id == kvm_host_psci_0_1_function_ids.cpu_on) || > + (func_id == kvm_host_psci_0_1_function_ids.cpu_off) || > + (func_id == kvm_host_psci_0_1_function_ids.migrate); > +} One minor thing, as I just spotted on an earlier patch: if FW doesn't implement one of these, the ID will be 0, so we might need to snapshot whether or not the function is enabled to stop spurious calls to FID 0. To be clear, that can be done in a follow-up if necessary. Thanks, Mark.