Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp647859pxf; Thu, 11 Mar 2021 11:20:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLY2UWWWC/OE+x/83wpkkntp2Yxwv7DRIyiW+kB1ZGuPWrOWbc5ZjDoN0mMsZhrMs/I2lw X-Received: by 2002:a05:6402:26ce:: with SMTP id x14mr9969867edd.359.1615490449615; Thu, 11 Mar 2021 11:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615490449; cv=none; d=google.com; s=arc-20160816; b=xzQlpfdwfGyKa3/fpTxqjLhHxOoOGsAxolB3r21vDndYqlQKqnwK0+gOh/cG9BkYu8 ddMzrYhEE1i00hcW419GvMn2uO18A7DF8LtzzPdgk6A8AqLLRjRlor6kQAGtoNeGwXs+ BOb+9FDnRr9FBLSbS12Z0Pc1U8KsYwytrWlUVKNxLYMPOLc/KpxwISCyRMSkMd9mxQqc WT8sW6f2uSW6xWVaC6b+YLt2CoYfzpyCPtjGLdGzvEuFQRFzb+1vIdeccSauc83sQ1bJ UXDRMasPgOSz9ZbqfjIrvNZL6NJUC0DO/lr43wgxWpq+iYn3K9IGdVSgi8H+mhxcs/Wj YWpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JhgkbUIm8Pw9D1jZSYQpuMWbP+3tq+nkWa0viqNNPjc=; b=TgO8YCrN+opqbuxA/BLiBjRdVxKz5IwdFFosIX8VQZl+Sv8PeOE5Ci2amTVexO3KvE IFmvN03t7+Ut0hdEMcDZCSLSq5VreUFJQVUIHko/EjoCaOSxfD4IacFCJ7/HO9dWW9sI JJSegdy6TuZaO6AARZFXSJfglMfal4w6K2C+fC8WPT8oQ9HDTnuIn4yd9YnDbo+MZKy2 INz1TTgA35+7jquhh+lmvmToFRZMKeVMBDqQSX9iuxgZ5HzBj6pBR+2Cvp91HRI42Gse JinnP1l0XNEBoifDdKoCxe71tu+2ovrq/9a8Nk1bfmwZVjzvZ8/atmN4liKhRtLh5fgw Yn2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4uo0tkI; 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 v18si2173779eju.671.2021.03.11.11.20.25; Thu, 11 Mar 2021 11:20:49 -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=k20201202 header.b=n4uo0tkI; 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 S229555AbhCKTRl (ORCPT + 99 others); Thu, 11 Mar 2021 14:17:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:41914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbhCKTRY (ORCPT ); Thu, 11 Mar 2021 14:17:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F13364E21; Thu, 11 Mar 2021 19:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615490243; bh=/fgB/prtT+9RLH2N2jUcU7RYPTvAJNdzfvwKlhf2uGs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=n4uo0tkIXihBJA/SKKfXmICFMT1onRMFDghteyFbkMpvQ+MLw3qWaNYlaUqfQxRu3 b+iAXIiFmn+UDfv5KgnxM6HaJOkRRDET5e5vKu+KqtC/O5yCsu2+Wd01CBuCMcaZuK Mrqdn0rF4GNHAYaY0slMJiWUwZuOq+7X8a0I6iDMTZo+wkZM/gQo09H0H+VQbZ78O/ LDrgGduWiCxlER2mWpLCf/FZLvOD/2lShq7oHXvQZSLmNP5woAWg1ZDd2Wlk0YqE3R MJ9fW0/oj1kDTrQyVuv0RLxaL+wh9wqpkiKpUubYkf9Rwyj4p/85aywSwtG+Mb443l xXG+bN91/D2Zg== Date: Thu, 11 Mar 2021 19:17:17 +0000 From: Will Deacon To: Quentin Perret Cc: catalin.marinas@arm.com, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, android-kvm@google.com, linux-kernel@vger.kernel.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, tabba@google.com, mark.rutland@arm.com, dbrazdil@google.com, mate.toth-pal@arm.com, seanjc@google.com, robh+dt@kernel.org, ardb@kernel.org Subject: Re: [PATCH v4 34/34] KVM: arm64: Protect the .hyp sections from the host Message-ID: <20210311191716.GD31586@willie-the-truck> References: <20210310175751.3320106-1-qperret@google.com> <20210310175751.3320106-35-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210310175751.3320106-35-qperret@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 05:57:51PM +0000, Quentin Perret wrote: > When KVM runs in nVHE protected mode, use the host stage 2 to unmap the > hypervisor sections by marking them as owned by the hypervisor itself. > The long-term goal is to ensure the EL2 code can remain robust > regardless of the host's state, so this starts by making sure the host > cannot e.g. write to the .hyp sections directly. > > Signed-off-by: Quentin Perret > --- > arch/arm64/include/asm/kvm_asm.h | 1 + > arch/arm64/kvm/arm.c | 46 +++++++++++++++++++ > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 2 + > arch/arm64/kvm/hyp/nvhe/hyp-main.c | 9 ++++ > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 33 +++++++++++++ > 5 files changed, 91 insertions(+) Acked-by: Will Deacon Will