Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp400479pxb; Wed, 11 Nov 2020 06:35:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWaXtum28gLTyM3ZQ631BgmZFxixS6Q8/I9TVlcJiSNHhgGdcAn+pjYMGsyNLsckWyur2m X-Received: by 2002:aa7:c713:: with SMTP id i19mr26202714edq.296.1605105308935; Wed, 11 Nov 2020 06:35:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605105308; cv=none; d=google.com; s=arc-20160816; b=m73zm8egBncyqwSnSzdKGTPQiiQdFJtDQfW17162nNQxnF5MdvwD6XBDPWG/5jWi1W 8xGrM062Qx3PzWxdtRdH/5J7GXW+YbcBkjOnTdhWUt0Y4tjVMpDAR+DYEnGKFr2UGFnL Kz+s1/JCE4dsYMeUrKW5XmHjzMA8sS7VcD0GU6Gg1Tam0QRUJdORfIezvOtRznj38cOB 8XPhUlDjB15jkvYs0eKeedyv5MdGGt8olrACOKufaG+dBbzgswKnrbQxyVLNJWkAdmWP GUinc2loI86bZ+AfsW7ywdUBQSmbn+La/ekx7qKqe0szLukz92QQu+o+isEwTEe+oAhG 6Ylg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=YUEkki4aThZycDl6LmVRjNo85wrAh92ZnNeLg2481hY=; b=Xg9QP9E/LC2in6HKc10/zChPNcUv6oNiSW2ky01UhiL1B7f34798759GAgSHOTtgKw IbomxwTanPWbu6Ik09AUYbpHRO3NZpeXUvIScsW8Kk4VjhtMcVGoiVBAxem4xtt8qsU4 t5QNg+3nK+5yR0sjoCzNXjCzjxZiVcCSUcBG/S4CWKv2NNEf50Mmdwopjj+c+nv0g9Q1 ivoZBYlZaLoyePI6rmx4iqoP0Fd3AJH5jgMHDJQoVdoElttI9ezda8bVXMXMiG48wjzr 4/N8bPj7brln1D3Rlt/OMpXtDRiLuCCcZMPWUtz5BC8nq9z+F2UwTtw0/sQbDffMmlSX xTVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UpHIQIOZ; 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 lz21si1464712ejb.16.2020.11.11.06.34.44; Wed, 11 Nov 2020 06:35:08 -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=UpHIQIOZ; 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 S1726654AbgKKOcy (ORCPT + 99 others); Wed, 11 Nov 2020 09:32:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:44604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgKKOcx (ORCPT ); Wed, 11 Nov 2020 09:32:53 -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 98FC22072C; Wed, 11 Nov 2020 14:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605105172; bh=S5VKmn1vXVRwiTiDOW+I2kCvLAlgxe7X4/fLYqQufKo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UpHIQIOZ6FG8Vh8fhkww3nn5PePI9nSFyhNjvJowt94WNK2yeiwqOiLNSneW6A2uR 8fI6k25UBn3FAcm9sRxC9ASTk39qf40j66W84AYOQF12hAJOmvGX8Yxo66ymoBmyIA 2t6I7MRzrTS66uKqDr9JNpdH11q9kMQgWVFAo2G0= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kcrB4-009mxR-Hf; Wed, 11 Nov 2020 14:32:50 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 11 Nov 2020 14:32:50 +0000 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 Subject: Re: [PATCH v1 00/24] Opt-in always-on nVHE hypervisor In-Reply-To: <20201109113233.9012-1-dbrazdil@google.com> References: <20201109113233.9012-1-dbrazdil@google.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <60c7254e3e667486298c11ddccca4f13@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 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 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 2020-11-09 11:32, 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/OFF/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-rc3. I think I've gone through most of the patches. When you respin this series, you may want to do so on top of my host EL2 entry rework [1], which change a few things you currently rely on. If anything in there doesn't work for you, please let me know. Thanks, M. [1] https://lore.kernel.org/kvm/20201109175923.445945-1-maz@kernel.org/ -- Jazz is not dead. It just smells funny...