Message ID | 20230127113932.166089-26-suzuki.poulose@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp788286wrn; Fri, 27 Jan 2023 03:46:27 -0800 (PST) X-Google-Smtp-Source: AK7set9K+D4c51DMk98sUVNVUnMUszq55QKgVWIhFoNtNOzvHyRwug9ahU5O7BRnXCx1KAbsoC5y X-Received: by 2002:a17:907:2d07:b0:87b:daca:aa1a with SMTP id gs7-20020a1709072d0700b0087bdacaaa1amr1503429ejc.45.1674819987684; Fri, 27 Jan 2023 03:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674819987; cv=none; d=google.com; s=arc-20160816; b=L1Kj/Qmn4+2K3lPYV1JnxvhCw3ghx/d420QP48B2VgDEdYiokQ/Av7BDA8awdtN+kO tmHnpBVdK07gPrYaSMRdV8M05+hJawRQhKkKiSyXuAcvmGHAyIp2b3wmXyFk6U2F6jmL U2sd5zJGKAgWveaxp0EupjTFJVkTPcHNujLjxRA0YmdrCb56nlKyY8NnR4is9jdcOWKV rOymYC1C+bzWOpUVFqzasU6xi5lsWZ1P+3zReD2u8mLS1xXiKhjMtP4442M9WB6Qc8pN eE/DWuM8xjvNCIoMYzL6/fI59s8IV3DH/XLZb+UISYIwEnxZa+hqvR+F1VIncKIfi9cm XZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sNQiej5jsQyq0PeHIq0jITBcc9ALWIhX6feJOk+R5GY=; b=DKPM0JVzVM+kCdQpx5ZHCVEQkRwnZqoaXzseZoun4JZR+hWyXbSOYBL//fuWR/XiHV zxpy50VexrcHvPwNNCrG6L32gSh7Ely7+sxZnGKyjrDPwg1dCB14jl7d0WNmNEkiyNMy qHNKtfGvxMXqKSihN/VrtyLs40WNmpr25ipPHwZyH3c0vZ8KKkHjCoOfniqA2JRsX/Wz aBX8C3Yauz0IB75qmChOS3cK4zqs3Zswzc62/EFAX0s5JSPpqZZasKgzR/J6TGI+piy2 ETLUuVOImLljL0wA73+jZPalk3MvAf01eaZee2HyUa7y6sjvo+rpMDbVmUbjbks+H9vI goXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay24-20020a170907901800b0087bce26e657si1649301ejc.924.2023.01.27.03.46.03; Fri, 27 Jan 2023 03:46:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233017AbjA0Lnv (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 06:43:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234032AbjA0Lnd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 06:43:33 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 33B737C313; Fri, 27 Jan 2023 03:42:13 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D1C71764; Fri, 27 Jan 2023 03:41:42 -0800 (PST) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9B35E3F64C; Fri, 27 Jan 2023 03:40:57 -0800 (PST) From: Suzuki K Poulose <suzuki.poulose@arm.com> To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: suzuki.poulose@arm.com, Alexandru Elisei <alexandru.elisei@arm.com>, Andrew Jones <andrew.jones@linux.dev>, Christoffer Dall <christoffer.dall@arm.com>, Fuad Tabba <tabba@google.com>, Jean-Philippe Brucker <jean-philippe@linaro.org>, Joey Gouly <Joey.Gouly@arm.com>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Paolo Bonzini <pbonzini@redhat.com>, Quentin Perret <qperret@google.com>, Steven Price <steven.price@arm.com>, Thomas Huth <thuth@redhat.com>, Will Deacon <will@kernel.org>, Zenghui Yu <yuzenghui@huawei.com>, linux-coco@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC kvmtool 25/31] arm64: realm: Double the IPA space Date: Fri, 27 Jan 2023 11:39:26 +0000 Message-Id: <20230127113932.166089-26-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230127113932.166089-1-suzuki.poulose@arm.com> References: <20230127112248.136810-1-suzuki.poulose@arm.com> <20230127113932.166089-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756176043219554701?= X-GMAIL-MSGID: =?utf-8?q?1756176043219554701?= |
Series |
arm64: Support for Arm Confidential Compute Architecture
|
|
Commit Message
Suzuki K Poulose
Jan. 27, 2023, 11:39 a.m. UTC
The Realm's IPA space is divided into 2 halves. Protected
(lower half) and Unprotected (upper half). KVM implements
aliasing of the IPA, where the unprotected IPA is alias of
the corresponding protected ipa. Thus we must double the
IPA space required for a given VM.
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arm/aarch64/kvm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c index fca1410b..344c568b 100644 --- a/arm/aarch64/kvm.c +++ b/arm/aarch64/kvm.c @@ -189,6 +189,9 @@ int kvm__get_vm_type(struct kvm *kvm) /* Otherwise, compute the minimal required IPA size */ max_ipa = kvm->cfg.ram_addr + kvm->cfg.ram_size - 1; ipa_bits = max(32, fls_long(max_ipa)); + /* Realm needs double the IPA space */ + if (kvm->cfg.arch.is_realm) + ipa_bits++; pr_debug("max_ipa %lx ipa_bits %d max_ipa_bits %d", max_ipa, ipa_bits, max_ipa_bits);