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=-10.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 37C3AC64E8A for ; Thu, 3 Dec 2020 10:56:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8F92208A9 for ; Thu, 3 Dec 2020 10:56:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8F92208A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OCctvMCOP2xE7G8pZvezMq8xLmsH1FHxny6LQ6Blbv4=; b=ryoRNhiHVhnSOiX70dSMjk+mw 25KIusm+yQzcwsAcV17Z8kZQ43xsGQvSUDw5FeetC8scK2oY5l79+kGGaXt0HuNLCM+oGaIBME6mb NHUk8TevXakXg2DvabmHQ9wjhGDJ6uKMOwieF2WKdZ0fSWKlgCeM1MiqHZ6IuNnNeVw/rKcEHmxH5 3A9LtBG/igKnzktqiM/KeltEPGVUNjl++M0vYUWD6JS/3se9ZhZRm3XpOzp9fI5XbtI1LFr/P2f0g 0D3vQt6DHMPxtcvg9rqPyp9kUGutsQ1QF/ad8luCkpT73TIkNYjfzRHx40tfv5QuKJs6gvWr+/Hvo hOSC6CRIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkmGe-0008O4-1z; Thu, 03 Dec 2020 10:55:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkmGa-0008Mq-Lf for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 10:55:17 +0000 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 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-Disposition: inline In-Reply-To: <20201202184122.26046-17-dbrazdil@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_055516_779083_2225846D X-CRM114-Status: GOOD ( 16.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , kernel-team@android.com, Jonathan Corbet , Catalin Marinas , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel