Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1041469pxu; Mon, 23 Nov 2020 10:06:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOgkDii6KenOcA2zR/+/sDn+fSSZ5Ft3LlUpaVbE3KJEwJKQMb0wziBnVIWF9T/+Chmvsg X-Received: by 2002:a17:906:490:: with SMTP id f16mr815281eja.12.1606154803086; Mon, 23 Nov 2020 10:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606154803; cv=none; d=google.com; s=arc-20160816; b=VfoQgcttqJXlmptu970O2XYYRK2N+pIPIH7QFtwtNsMNZBrZm36G0ehjKaPUeKuH2M 38y/GuYWNtLczgs/0ARI2E+1DkB5trDXWhsG+lML/KcRarRIS8fBnbzUWaxmZPY8Zji6 PMgbzI9hPjYOwu/grfStTfQTvGAtUzBiupnEsQWaw9F2Xz+sqesXRR/hv1pxHwUOML7I uu//NjXVD5vuFz7V+722CI7efWAHtCXS+JyXVDcopVXABKW0n1gjLHqVINmnLT8fFosg V30kaIxPw2jGL49X7JvSndByn5tHx7LckhuAm1GxJusB/epyzTm1pCwK+mhsAWufELE/ Apdg== 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=6hsFzQ6D4xvsantgxAOxkg0K5nFsACyKept5xiVCxjM=; b=nsN8ZCFvWff3D0vRNhWXZbYtMQjwMr5hf7zOZMaOgk+PCH9PZSavb8yPwrN/f/hldk o0eki1n5mND8EK46jSWaED6tz4ojqQmmsHnue9xb+LEUcesB7dp7PRGlyzLOUT+CO4As tzq+MgMdPbuzXDb7gPjmABq5okXs71/7801kxiJDpjdkqBGMnMF9PaaD2LJCsxHJrQWk ARjt8OoVmrhtzjM7/Zaj4hDHRpR4W2ei8Tde2GHKE7e9RsDhRDIHYg+qAPrJjw5pMhwk H34ILS5nxbJ5qaw4vdB2ol0f4c4aEZ1R86lR0NLG04wqC3WkZkQ9xmCUFxJ4XrEM8AJM 7TQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZTYQI9+c; 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 k5si6966192ejk.655.2020.11.23.10.06.19; Mon, 23 Nov 2020 10:06:43 -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=ZTYQI9+c; 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 S2390606AbgKWSBS (ORCPT + 99 others); Mon, 23 Nov 2020 13:01:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:54640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390418AbgKWSBR (ORCPT ); Mon, 23 Nov 2020 13:01:17 -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 D71602076E; Mon, 23 Nov 2020 18:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606154477; bh=3wL8o/sAyclefSUZKYXwlw4dgxvLRbLTCkeW8PWsIVE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZTYQI9+cXGC/y3cGvqIakhRkkVPuznNguzbQF/2SB6u3mZDII2fU70ovFRzPF+JQm MzXGVjXA+YLp1fVvhPTYOM3ShNkG3iVCoGueR0N6Sm3hoOQn09BhIMS4Arwy/oGAKi pFjgRR4F+uhJ6oqMWBlbztyLF9F5bB4Gj3i6T2Cg= 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 1khG9K-00D1dH-Fa; Mon, 23 Nov 2020 18:01:14 +0000 Date: Mon, 23 Nov 2020 18:01:13 +0000 Message-ID: <878sas54wm.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil 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, Lorenzo Pieralisi , Sudeep Holla 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, 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, lorenzo.pieralisi@arm.com, sudeep.holla@arm.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 Hi David, 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. I have now been through the whole series, and I don't think there is anything really major (although I haven't tried it yet). I think it would benefit from being rebased on top of kvmarm/queue, as it'd give you the opportunity to replace a number of per-CPU state fields with global function pointers. Another thing is that we seem to have diverging interpretations of the PSCI spec when it comes to CPU_SUSPEND. Finally, please include the PSCI maintainers in your next posting, as I'll need their Ack to pick the first few patches. Thanks, M. -- Without deviation from the norm, progress is not possible.