Message ID | 20230127113932.166089-29-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 s9csp787891wrn; Fri, 27 Jan 2023 03:45:35 -0800 (PST) X-Google-Smtp-Source: AK7set90RbtzxixM6uTt83Fwll/rsC6u/hHIABJC0/ro0AbKQMy8JDBujH3n0CgelzY1rJn9h3iA X-Received: by 2002:a17:90b:4f46:b0:22c:1211:89c0 with SMTP id pj6-20020a17090b4f4600b0022c121189c0mr8616387pjb.30.1674819934966; Fri, 27 Jan 2023 03:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674819934; cv=none; d=google.com; s=arc-20160816; b=ernMpdOYuehqJN3fK2+Yr2rIn14JjMeQeHRX8ntxD3lxR3T3NptcKAXFvV+uiWs8VO NEa6VICbMdlyUWMzw7vvMn/1Lo7HjSjlVYm6p3iIgEuRhJFilF94gxKutYdnp0EemDrL NHcOpSe1dhIvUNrIn3FeSv66IDCxBc+bv9EYAFI61hu1XYUmZq8i0UsA2a6H7rV9RsSN crYqaywm/23vQU46fjjQlMZ+cFehxGbclMqNnUpaJ17CsNX0NB8kAAf23lHHPPf9NxBm dR/wJ46zvzv/lkXifPzRMMhabTh89HDKyc9WMpRUFvGU4ChwY2NFfxxtOucfWEdbAIjm aG4Q== 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=55CzEaHyu3zC2RRESS1M/EgSOmQty8uOohnUSon2wxc=; b=ba8TDE35Q9iIlZ5SxPvRE+3n38xqXtUY/9X0NU6vmvQ3cIaQLszkS0ILmSrcWq9FNE 1q/XHtF/oqs4Xw/jBDfHNCBiuLo88sAJhvSB/cp44aGjvtF2EYcp87Bm5Q/6B4S10Oj5 E2JM6WdKeMLmgM+rQZmd0FBl0YUnmgz1an2KPRWve8NVnoU6KhqW/HkxLj/O6UAqn0fY zX0NDOqYlGiUUNNelfBRwwTTuIH1MGxA4Vv3L2MWpfeVlcBbFytyuvFXdxkX4ipxIFpk TzqrBFC4X3n09eooIah9AzwbAX2FM1befq9XVjYu5e9lHhHrH1DnIvz9ipLVEgPowkPL bJSQ== 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 d194-20020a6336cb000000b004ccbc54e8bcsi3983493pga.93.2023.01.27.03.45.22; Fri, 27 Jan 2023 03:45:34 -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 S233647AbjA0Lm4 (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 06:42:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233925AbjA0LmB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 06:42:01 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E13317A4A1; Fri, 27 Jan 2023 03:41:29 -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 B8BAC165C; Fri, 27 Jan 2023 03:41:50 -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 329813F64C; Fri, 27 Jan 2023 03:41:06 -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 28/31] arm64: realm: Enforce virtio F_ACCESS_PLATFORM flag Date: Fri, 27 Jan 2023 11:39:29 +0000 Message-Id: <20230127113932.166089-29-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?1756175987949463054?= X-GMAIL-MSGID: =?utf-8?q?1756175987949463054?= |
Series |
arm64: Support for Arm Confidential Compute Architecture
|
|
Commit Message
Suzuki K Poulose
Jan. 27, 2023, 11:39 a.m. UTC
For realms, force the F_ACCESS_PLATFORM flag to ensure DMA-APIs
are triggered for virtio in Linux
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arm/aarch64/kvm.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c index a4664237..1f3a0def 100644 --- a/arm/aarch64/kvm.c +++ b/arm/aarch64/kvm.c @@ -5,6 +5,7 @@ #include <linux/byteorder.h> #include <linux/cpumask.h> #include <linux/sizes.h> +#include <linux/virtio_config.h> #include <kvm/util.h> @@ -237,5 +238,10 @@ void kvm__arch_enable_mte(struct kvm *kvm) u64 kvm__arch_get_virtio_host_features(struct kvm *kvm) { - return 0; + u64 features = 0; + + /* Enforce F_ACCESS_PLATFORM for Realms */ + if (kvm->cfg.arch.is_realm) + features |= (1ULL << VIRTIO_F_ACCESS_PLATFORM); + return features; }