Message ID | 20230127113932.166089-21-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 s9csp808483wrn; Fri, 27 Jan 2023 04:34:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIaB4PuKGfBsqIlaSjlR/7jZ7DN7jLGV3MweGGnO0vcxys5hs2Ly44uobZ+smMzJe0ebJV X-Received: by 2002:a17:902:b613:b0:194:457d:6dca with SMTP id b19-20020a170902b61300b00194457d6dcamr36048491pls.44.1674822858524; Fri, 27 Jan 2023 04:34:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674822858; cv=none; d=google.com; s=arc-20160816; b=gTmvT7CfMp2I/S/KV7xn0/IGj23gXAjN4CPzaYSaKv91WCctA79n3tUn+bacG66i3T pTWnn3Xw1VwVR63x1TbCHcLU041os47kxttcGB7K+ZkZxtJ+IYY8C+OvVnq7fVV35e+o cwYwKZoPb1bJ3mjWd0movLxq8KY3w7CEqYY8BjDOmCechbPomf4IKabbi0j3EAuo6fNQ aCTM7NzB8LVa3QgzW9t7pqDO+DE93pzZa2CdV4I/vOfH6L5EJA881AXK+1Fklp42t9Cq c8gPqREbKgWICLkd5GZbySNJ/AGon1M6HE0y9mXyOdEu7Lvq9VWbRzNxaain0L3T20UY hCDA== 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=FNDxVN0vwSE1oTFDyBpw5EyJz5I6jBq/lbsd6C1JGaI=; b=d0NpVUpjxJFh7ZGOH2b4o9+DpIp23jIBiOoBsF6jZ9us45uF2r1qLqbuwuIluNocE1 dQ6KEbJwSDa9t+xmpN1V/oDtq3Tj9pIhlCb/OiSw030LhGmbqYAEmzJUhj6mtlKnI3y0 I7RuhXUk1n8pIzlVThVNvsTbdXKZikCpinlKy9bAEnUiTy81e2iv0NVGa+4VELvLXvcH hepDGTYP+LTFCvK7snvi0vl8OV6bED0wC+HU+p9d2FpjhmmL1qckGQvM4cfsTz2y5Mkx YEow3RFtqkDLdN5hMZs3/1d7AmdkItg9pT5sCMTBWxAaebFEN/4Xy2hcBVIAPd4TZtVS J54w== 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 n12-20020a1709026a8c00b00194c49857acsi4277122plk.226.2023.01.27.04.34.06; Fri, 27 Jan 2023 04:34:18 -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 S233784AbjA0MUE (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 07:20:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234012AbjA0MT3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 07:19:29 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 387E783251; Fri, 27 Jan 2023 04:16:08 -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 D149115BF; Fri, 27 Jan 2023 03:41:27 -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 4AF653F64C; Fri, 27 Jan 2023 03:40:43 -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 20/31] arm64: Finalize realm VCPU after reset Date: Fri, 27 Jan 2023 11:39:21 +0000 Message-Id: <20230127113932.166089-21-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?1756179053494333644?= X-GMAIL-MSGID: =?utf-8?q?1756179053494333644?= |
Series |
arm64: Support for Arm Confidential Compute Architecture
|
|
Commit Message
Suzuki K Poulose
Jan. 27, 2023, 11:39 a.m. UTC
From: Alexandru Elisei <alexandru.elisei@arm.com> In order to run a VCPU belonging to a realm, that VCPU must be in the finalized state. Finalize the CPU after reset, since kvmtool won't be touching the VCPU state afterwards. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> --- arm/aarch64/kvm-cpu.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arm/aarch64/kvm-cpu.c b/arm/aarch64/kvm-cpu.c index 37f9aa9d..24e570c4 100644 --- a/arm/aarch64/kvm-cpu.c +++ b/arm/aarch64/kvm-cpu.c @@ -128,6 +128,13 @@ static void reset_vcpu_aarch64(struct kvm_cpu *vcpu) if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0) die_perror("KVM_SET_ONE_REG failed (pc)"); } + + if (kvm->cfg.arch.is_realm) { + int feature = KVM_ARM_VCPU_REC; + + if (ioctl(vcpu->vcpu_fd, KVM_ARM_VCPU_FINALIZE, &feature) < 0) + die_perror("KVM_ARM_VCPU_FINALIZE(KVM_ARM_VCPU_REC)"); + } } void kvm_cpu__select_features(struct kvm *kvm, struct kvm_vcpu_init *init)