Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp847557pxu; Mon, 23 Nov 2020 05:48:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwaL1+hLY2HSmoZ2KxBbytVmvClBquB09kZR75ttPR3NWeDNu7Z7RJ7RPps7HBoyPRsyRr X-Received: by 2002:a05:6402:1804:: with SMTP id g4mr29433518edy.7.1606139297733; Mon, 23 Nov 2020 05:48:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606139297; cv=none; d=google.com; s=arc-20160816; b=WL8itB9+Gp6TmxtYKTq1WG1fD+rWI8FBYw1xkQRx8WAY2JPjZAxCmg2olNnYH645qC 54nogd6MwRSHoEvQvcQ79yDdKyX7q2l1FjFfOiOU9ay6YD1/i/I2Lqvxj+eOVwvllfw2 VA162vqCu+qG9377EikUolYZHts5PpAlisp18HOX2xPuOlswB0j/BlQHFAGRUHripOue kaYw6Gf16ajOuxhySuUDkWL+5O3MzaE5NHIezYX6KQBtVRCkd/mYJNBu+kGN1M+JgQeP Col0v7f3ruyaD9E0UA94vOA8fmgQc7oL6wDGSuqyf5C2/ai7r3HDbmwzigKCBW2M42GO dE5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=XjVYUIaThI0eHnWCLfoPC0AKqFV7nGCQB7h0YJJyZu0=; b=L4wOI0JobGPHZKoDJStqyKAwmT7u1QKP53sDuFvuOzrOIOMn9J494MkGBItd3cNrT7 g78z26FO+49Njdq2ZrHvMM2JPfjpHfgYLgrgP0KXFxOQ71LOH897ajmywcyfCkROvHgf qJGPHfShU+mFYglLAkSCkaAZE0oAp7i2CPp/dEdmiYP10euHk4AnbRddDSfpaeNHgge9 O+N75xTX/xutqNGf5GVi+YIvw2TBSLft+d+y0sFP5vp3ypm7ubZfbEC8FQqohB/YpZfn /M0ONIjvTwS9hnG6RXYLabcQ2v/cP24GmzRYwZbD8wjhQU9aZ6uzKq/eqxWfYjHsUVg6 c2pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=al1bRH4D; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si8924799edj.402.2020.11.23.05.47.55; Mon, 23 Nov 2020 05:48:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=al1bRH4D; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733137AbgKWNos (ORCPT + 99 others); Mon, 23 Nov 2020 08:44:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:35908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733009AbgKWNor (ORCPT ); Mon, 23 Nov 2020 08:44:47 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF43320729; Mon, 23 Nov 2020 13:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606139086; bh=/PwbI2azxdOOPyORsfavbiNovbcboiR/bBOFvrmG+KA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=al1bRH4DG5NZGMxwVysWnXLnEekLczyJ4QYzkOD2tCTquLnO7xrA/Vd3n7xMepZMu qr/oD5VaOydPneTWxRqrL0GNRnIEBwplZrrRFmrN8mOTKrNHEYXEpObyTiuOfKBLhB K9Yc3FNN+C2MMlx2K1Wr1wcQAJpW1NPxSbt0Npko= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1khC96-00Cxm6-HH; Mon, 23 Nov 2020 13:44:44 +0000 Date: Mon, 23 Nov 2020 13:44:38 +0000 Message-ID: <87pn445gs9.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil , Lorenzo Pieralisi , Sudeep Holla Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Quentin Perret , Andrew Scull , Andrew Walbran , kernel-team@android.com Subject: Re: [PATCH v2 00/24] Opt-in always-on nVHE hypervisor In-Reply-To: <20201116204318.63987-1-dbrazdil@google.com> References: <20201116204318.63987-1-dbrazdil@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dbrazdil@google.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, dennis@kernel.org, tj@kernel.org, cl@linux.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, qperret@google.com, ascull@google.com, qwandor@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Nov 2020 20:42:54 +0000, David Brazdil wrote: > > As we progress towards being able to keep guest state private to the > host running nVHE hypervisor, this series allows the hypervisor to > install itself on newly booted CPUs before the host is allowed to run > on them. > > All functionality described below is opt-in, guarded by an early param > 'kvm-arm.protected'. Future patches specific to the new "protected" mode > should be hidden behind the same param. > > The hypervisor starts trapping host SMCs and intercepting host's PSCI > CPU_ON/SUSPEND calls. It replaces the host's entry point with its own, > initializes the EL2 state of the new CPU and installs the nVHE hyp vector > before ERETing to the host's entry point. > > The kernel checks new cores' features against the finalized system > capabilities. To avoid the need to move this code/data to EL2, the > implementation only allows to boot cores that were online at the time of > KVM initialization and therefore had been checked already. > > Other PSCI SMCs are forwarded to EL3, though only the known set of SMCs > implemented in the kernel is allowed. Non-PSCI SMCs are also forwarded > to EL3. Future changes will need to ensure the safety of all SMCs wrt. > private guests. > > The host is still allowed to reset EL2 back to the stub vector, eg. for > hibernation or kexec, but will not disable nVHE when there are no VMs. > > Tested on Rock Pi 4b, based on 5.10-rc4. Adding Lorenzo and Sudeep for the PSCI side of things. Thanks, M. -- Without deviation from the norm, progress is not possible.