From nobody Thu Nov 28 04:37:11 2024 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E7BE1CACD8; Fri, 4 Oct 2024 15:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728055819; cv=none; b=dII8BrwLTfLSJxzvPCXJRd7am6u3c5vQipEqQgwf7+8j5mHMfUviYu/kzX2kDiiSiDRkYQ1Bp/OcQnVUjqffp6U38lRSd5C6WxBG4QjfsIwKfGxPqWySdlvyr1+axnSeTLLp1pg6STZxj9YqO4LTlao6t/1XCjIrp20/+JxTbrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728055819; c=relaxed/simple; bh=1F2YHcror2Su4wkBq+es/16Ppem3zr/jwW/Kcxaojlo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uZy2NBb2HYAL7ouZdgxo5ck6LiQLydIi+so8OB6Hly8ScgaEPOsZZKwpBik/3whfO0RFMGSWMm0VxxEHvHpgdFD21x5/iK0VQZjzBd/m/7de2ZADZErU1TEp0lAGL3x0cjOEtfoKkMEbnqZvOAJ2K80Kouybd0Cez+v4DjiFsK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 6CF92152B; Fri, 4 Oct 2024 08:30:45 -0700 (PDT) Received: from e122027.cambridge.arm.com (unknown [10.1.25.25]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 06CF23F640; Fri, 4 Oct 2024 08:30:11 -0700 (PDT) From: Steven Price To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Steven Price , Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun , "Aneesh Kumar K . V" Subject: [PATCH v5 26/43] arm64: Don't expose stolen time for realm guests Date: Fri, 4 Oct 2024 16:27:47 +0100 Message-Id: <20241004152804.72508-27-steven.price@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241004152804.72508-1-steven.price@arm.com> References: <20241004152804.72508-1-steven.price@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It doesn't make much sense as a realm guest wouldn't want to trust the host. It will also need some extra work to ensure that KVM will only attempt to write into a shared memory region. So for now just disable it. Signed-off-by: Steven Price Reviewed-by: Suzuki K Poulose --- arch/arm64/kvm/arm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 075c1b7306ff..bde1e0f23258 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -433,7 +433,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long= ext) r =3D system_supports_mte(); break; case KVM_CAP_STEAL_TIME: - r =3D kvm_arm_pvtime_supported(); + if (kvm_is_realm(kvm)) + r =3D 0; + else + r =3D kvm_arm_pvtime_supported(); break; case KVM_CAP_ARM_EL1_32BIT: r =3D cpus_have_final_cap(ARM64_HAS_32BIT_EL1); --=20 2.34.1