Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp557496pxb; Wed, 25 Aug 2021 09:23:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLWoL1ppb6GVNahF+Xw/6Ivh5Qqqbn/rP6B3En1b00KX55oVqBV4cwdupDVqoPEQRBJuv8 X-Received: by 2002:aa7:d645:: with SMTP id v5mr908574edr.145.1629908604303; Wed, 25 Aug 2021 09:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629908604; cv=none; d=google.com; s=arc-20160816; b=c9yJbuHTqFp8UkM+nBm/dewZ7FeM+EbV60SwKvRUyHE4z1mskmb4U3zxru7R3jelmF vULVtzRyquDx/+8CWTsdh6iyterxAUNRPka7mXXZwXOeT/7Nx+SjY+NjsovmluCaO0tu uoEINDLHH5YBrCAI/cawsjRZlWYBTApbk8k1Trf/ECeS7EKsfxgcDwTVFUVZXSckRO3r xKdCcqFvD83FGNSJg1Piihl1+0IHQKmZ99/9oNiN1eBRX/mzF0SJeTG60yFD0YXiUKdD DBf22rTc6plfa+vUEIGpt9db8V3sBUModI4ZDUohyczdf6APDyT7PHgG4BHGp6Yq3Med Q6gw== 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:to:from; bh=ndB/+LOQaPTf224Zl8MUxXznzhPVj1k9zzpNHGk4uWY=; b=o6BSSQX0yXYB2FsgbAyfkd++87XR+Pu+CXJ8AA0WxwwlYhoncU0hwD6SVmBHkILorN gFPMA/MdDpxMk4fzeRAkC39cZSuGYS9pdzpjNBPrH9nlOtlRvvU5wfOIXx1LVPc+Ps8B oqwHWMrY3hoS0CYCtGr4+Q2D/865J/CrbqlbKiaAW1jBtOw2VOr5pKdRoRH5vMLZGB1n 464Y5TxDapJTFaaA8ycDOc634iCXvjm0L6Cq7z1aokbEWhu+CyTFAHnsXxJ22Ywil1p4 byiS6xhN4+adNvBMPT4zR5DPsNtLt+Aq0beyc5Ode93OJxmTvISTuqR5ECJpxClyrbW4 bQeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si461125edd.224.2021.08.25.09.23.00; Wed, 25 Aug 2021 09:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S241670AbhHYQUP (ORCPT + 99 others); Wed, 25 Aug 2021 12:20:15 -0400 Received: from foss.arm.com ([217.140.110.172]:54870 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241349AbhHYQTB (ORCPT ); Wed, 25 Aug 2021 12:19:01 -0400 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 49DAD1063; Wed, 25 Aug 2021 09:18:15 -0700 (PDT) Received: from monolith.cable.virginm.net (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EFF723F66F; Wed, 25 Aug 2021 09:18:13 -0700 (PDT) From: Alexandru Elisei To: maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v4 39/39] KVM: arm64: Allow userspace to enable SPE for guests Date: Wed, 25 Aug 2021 17:18:15 +0100 Message-Id: <20210825161815.266051-40-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210825161815.266051-1-alexandru.elisei@arm.com> References: <20210825161815.266051-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Everything is in place to emulate SPE for a guest, allow userspace to set the VCPU feature. Signed-off-by: Alexandru Elisei --- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/arm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index f866c4556ff9..040da3b0cf2b 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -39,7 +39,7 @@ #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS -#define KVM_VCPU_MAX_FEATURES 7 +#define KVM_VCPU_MAX_FEATURES 8 #define KVM_REQ_SLEEP \ KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index b7aae25bb9da..8016b98a8ac3 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -309,7 +309,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) break; case KVM_CAP_ARM_SPE: kvm_spe_init_supported_cpus(); - r = 0; + r = kvm_supports_spe(); break; default: r = 0; -- 2.33.0