From patchwork Tue Oct 27 17:26:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 11861173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04F93C4363A for ; Tue, 27 Oct 2020 17:29:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7054C21D42 for ; Tue, 27 Oct 2020 17:29:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mQt4rBkN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7054C21D42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=f8TFBrv+VkyqcWDbi/js8ZZBCvi1Rx5KMM7qXNc/5dM=; b=mQt4rBkNLSpKwa6ca4TXN4AaY f4fFr4lEyNYb9HbCYEvn5fdPjkC69oDbrsB/H/QuAtcve64xPW3cBJEK/dYucEMI77eN3w+UOSRqz 8VJSmmrddRMhX4xTqZjPoIJMY8+fG2RmvdNb7YoFKxZ2llHKjkmAfmfok2bgM8JHz8nnFBNdog+y6 exeCETXbfRPVQ3zPV2kdCVpV3bbhoxaICDgtKsM4g5Z+DYFpqpOJBP3VV+4x4zo+8CL56X7NZylgS 8WfH+jiVOSb9gqQX9CjEzwazlEAl0Z81fJOjpbB5u4KFZc4PJsIMjWijLZCMOnbj6S4vID39l9vUo i8rFIjaAg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXSkS-00050Z-O7; Tue, 27 Oct 2020 17:27:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXSjo-0004oT-Ft for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 17:26:25 +0000 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 E63C0139F; Tue, 27 Oct 2020 10:26:23 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A2F873F719; Tue, 27 Oct 2020 10:26:22 -0700 (PDT) From: Alexandru Elisei To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [RFC PATCH v3 07/16] KVM: arm64: Define SPE data structure for each VCPU Date: Tue, 27 Oct 2020 17:26:56 +0000 Message-Id: <20201027172705.15181-8-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027172705.15181-1-alexandru.elisei@arm.com> References: <20201027172705.15181-1-alexandru.elisei@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_132624_685147_F7A2D3F9 X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: suzuki.poulose@arm.com, maz@kernel.org, james.morse@arm.com, Sudeep Holla , Andrew Murray , will@kernel.org, julien.thierry.kdev@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Sudeep Holla Define basic struct for supporting SPE for guest VCPUs. [Andrew M: Add irq_level, rename irq to irq_num for kvm_spe ] [Alexandru E: Reworked patch ] Signed-off-by: Sudeep Holla Signed-off-by: Andrew Murray Signed-off-by: Alexandru Elisei --- arch/arm64/include/asm/kvm_host.h | 2 ++ include/kvm/arm_spe.h | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 43eee197764f..5b68c06930c6 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -35,6 +35,7 @@ #include #include #include +#include #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS @@ -329,6 +330,7 @@ struct kvm_vcpu_arch { struct vgic_cpu vgic_cpu; struct arch_timer_cpu timer_cpu; struct kvm_pmu pmu; + struct kvm_spe_cpu spe_cpu; /* * Anything that is not used directly from assembly code goes diff --git a/include/kvm/arm_spe.h b/include/kvm/arm_spe.h index db51ef15bf45..46ec447ed013 100644 --- a/include/kvm/arm_spe.h +++ b/include/kvm/arm_spe.h @@ -12,8 +12,17 @@ static inline bool kvm_arm_supports_spe(void) return cpus_have_final_cap(ARM64_SPE); } +struct kvm_spe_cpu { + int irq_num; /* Guest visibile INTID */ + bool irq_level; /* 'true' if interrupt is asserted to the VGIC */ + bool initialized; /* Feature is initialized on VCPU */ +}; + #else #define kvm_arm_supports_spe() false +struct kvm_spe_cpu { +}; + #endif /* CONFIG_KVM_ARM_SPE */ #endif /* __ASM_ARM_KVM_SPE_H */