Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp391701pxu; Thu, 3 Dec 2020 02:58:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjXgqq+3eDv111cfNy/WHD6ZDO5WosTxY0WMxJaADyooglXZJsmVXDHvoBFmjDK2qah/ZS X-Received: by 2002:a17:907:444f:: with SMTP id on23mr2031354ejb.300.1606993125262; Thu, 03 Dec 2020 02:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606993125; cv=none; d=google.com; s=arc-20160816; b=kx1sTX3N/Ew2G9HFkrsG3CFwfo7txfr9MHEsvGVnNHWK1J4AxwLEZludCDeHPWVrFr tB6Y2Ex7kUQi3/jciIPd8Br/kKEaR5AON+jPrFW/Aom0C1BDBbzmxOakx1AUMOeeaBa5 qX6nCO/JQXWYU/O/RfBVxlXbOC8cTN1h54hc/6rl5VXAmxK5IGQAleuOj0VxrswUWfkR QljYHXGP8/qGuzEsWuXS8hbqxKJunQO+l1j70qS83rYh1u1BvlBkdtSIJhfY5Rk8Gqrf rPJh1WK0G3Pgj7OOvgNfTu9/kRC9ePg4gBEM/raTMShPCchSZZEjzc1AJlQgaqqPoI+v aeYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=T/AwaofolEELUHWYVdgTELG7bvqegiUVW9GGHZo8N/8=; b=QjbV0ghpmW13a898OS6HpvXq+afJezzf9AtbfJ5TJt1a6zG7+5w9SsX8MqcSIgeV7P eQcMqXjTFFRzJMcNXkYpxNwNjsflPR7QI3GRFvpsvnU9waB+0ElR4442fY42lqTGA38F gGjAW2+8cGdK2J0d+6PTfpHQdfLYFbs5y41Ds0C0jxJGy6ZE4iy+S2kvoeQ1CSbhyRSa WRi9uVS7nXmGBmvC6WbFJCKIntJt5+6E1r/z7jYymH1WCpLr5IqWV1HlvpJKbQqsF9/y Lv5B3pLofSGV59j1ZeFRQ9pjJAoXBj9epbId77OT8Veg6WRSfH+79zwMw0ZAKrYVbxUk PtLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay25si661799edb.8.2020.12.03.02.58.22; Thu, 03 Dec 2020 02:58:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2389017AbgLCK4C (ORCPT + 99 others); Thu, 3 Dec 2020 05:56:02 -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-kernel@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.