From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3329FC433E6 for ; Thu, 11 Mar 2021 19:22:01 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20A3064F13 for ; Thu, 11 Mar 2021 19:22:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20A3064F13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+Cp9ZNdJ98iwIypjkxcHYqIvD/lI/D0Y1NTdFwrQkfk=; b=WWIsXdo4efT1SyZOQckVAEoj7 wy9NcyvuMLclTwt0UKCNNXsDoblHgoEF5aNw+58Hen4BP9nyE2OxZ5cVHqTYMJvf99vnxj/p+diwk O7mDNt7DYX54KDFcbENCqEbnuYCYtHkUkYokLQYKBwwUQ29+qgZrsF1fM8RSlBuc5l/bGBVW94c0e oKtKsLHvrPRtKhsxhGDTW/WyBopKLVWhkOGNg+jSVm8Wzo0ho+HI7RHZ0mkHCeP/fK7Q0AMKA9woU bxhBZSIyioUm6ohhcKrgyFf6Ev9jwxvA+XgjhMifWmQNILdYayn316RUiDVXPxFLJrFTr8Dh/t2lo Tg0UsHCHg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKQqk-009yJD-8L; Thu, 11 Mar 2021 19:20:00 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKQoH-009xrV-JU for linux-arm-kernel@lists.infradead.org; Thu, 11 Mar 2021 19:17:30 +0000 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-Disposition: inline In-Reply-To: <20210310175751.3320106-35-qperret@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_191726_093788_860F3405 X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel