From patchwork Tue Aug 8 11:47:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13345988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72544C04E69 for ; Tue, 8 Aug 2023 11:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dgMiM3phvY8NDP1HYbHc31YaLPGn5wFPjWI17pt0Zpc=; b=bCvweLdtF7JUEL T8OC6X0gBGFzCc43PWvpKOS8hYTc3LQpWEbfNS8tcsdzDLN9uVpa1kdo7leZbVLLl0RiQnaIcDgJk hdcdSz6qChDPt2w9oWWF+JrfQTYWpBQ/iw9QSTWHfUDwlqF0pOv502Umrp0cJ7fxnIxer+Wn5+Mdf HcZhWQtPM6X/Lrp3Z7ie4RZFZD2xX+b727iRehk3vwwgDfpLihZaRv9bDAOKYX7NPaHPoRG0Ms0nR 7CKydyzxAnn/nD/5B4KhJGVdUKOsxlPInokA5QpGf8e/+H0ViFdwCq2MFLhJleM8dC/yfLs6TKMsS Hj+AyK3HTRyg+aHZZSSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTLCQ-002V9v-1a; Tue, 08 Aug 2023 11:48:30 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTLC9-002Uwl-0i for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2023 11:48:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AC897624FD; Tue, 8 Aug 2023 11:48:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BBE4C433C9; Tue, 8 Aug 2023 11:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691495292; bh=QjU09/ztCkP8Hqos+fcG049ytIrT3fHu8hzu5/go5vY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i6ic2czQLDOnwPazNfEK/3Epm4IXa2Mlpaif4VAuc/uwhHFF47JXlUDS7nsWrs86l sTpvI8Axf2SYzet+9noTnzxUgThstg4Z6Ky85Gb0OCvhjzFyX+MUhTgQf5/rhRsoO8 ZPN85G9y5BY7qYeUqu9Tx/2dR9H5XHQAHhgcPCIFaV9Jpgf8KN2r2ojAD1QNni5IGH ZpAJGPPsez3Jy4cFcbdc0kzwlTj1QImg66wfL9tQVbQWLdJchjhG2qC4p8APAIi4As ImsFo+aKADp8rvmk8uRP5hi5E18uPZyUSj9z5G6IYQmMiwJACovnfl5q6UTYNt1zTw sCG3gHZJkA9YA== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qTLBL-0037Ph-Dq; Tue, 08 Aug 2023 12:47:23 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Eric Auger , Mark Brown , Mark Rutland , Will Deacon , Alexandru Elisei , Andre Przywara , Chase Conklin , Ganapatrao Kulkarni , Darren Hart , Miguel Luis , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH v3 25/27] KVM: arm64: nv: Expose FGT to nested guests Date: Tue, 8 Aug 2023 12:47:09 +0100 Message-Id: <20230808114711.2013842-26-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230808114711.2013842-1-maz@kernel.org> References: <20230808114711.2013842-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, eric.auger@redhat.com, broonie@kernel.org, mark.rutland@arm.com, will@kernel.org, alexandru.elisei@arm.com, andre.przywara@arm.com, chase.conklin@arm.com, gankulkarni@os.amperecomputing.com, darren@os.amperecomputing.com, miguel.luis@oracle.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230808_044813_334208_DA049CF8 X-CRM114-Status: GOOD ( 13.05 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we have FGT support, expose the feature to NV guests. Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger --- arch/arm64/kvm/nested.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index 7f80f385d9e8..3facd8918ae3 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -71,8 +71,9 @@ void access_nested_id_reg(struct kvm_vcpu *v, struct sys_reg_params *p, break; case SYS_ID_AA64MMFR0_EL1: - /* Hide ECV, FGT, ExS, Secure Memory */ - val &= ~(GENMASK_ULL(63, 43) | + /* Hide ECV, ExS, Secure Memory */ + val &= ~(NV_FTR(MMFR0, ECV) | + NV_FTR(MMFR0, EXS) | NV_FTR(MMFR0, TGRAN4_2) | NV_FTR(MMFR0, TGRAN16_2) | NV_FTR(MMFR0, TGRAN64_2) |