From patchwork Thu Apr 11 16:36:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 2429631 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E0CE93FD40 for ; Thu, 11 Apr 2013 16:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933797Ab3DKQiO (ORCPT ); Thu, 11 Apr 2013 12:38:14 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:64795 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756562Ab3DKQgr (ORCPT ); Thu, 11 Apr 2013 12:36:47 -0400 Received: from mudshark.cambridge.arm.com (mudshark.cambridge.arm.com [10.1.79.58]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id r3BGadki007865; Thu, 11 Apr 2013 17:36:39 +0100 (BST) Received: by mudshark.cambridge.arm.com (Postfix, from userid 1000) id 7D13FC2B16; Thu, 11 Apr 2013 17:36:28 +0100 (BST) From: Will Deacon To: kvm@vger.kernel.org Cc: penberg@kernel.org, sasha.levin@oracle.com, marc.zyngier@arm.com, Marc Zyngier , Will Deacon Subject: [PATCH 4/5] kvm tools: arm64: add support for AEM and Foundation models Date: Thu, 11 Apr 2013 17:36:25 +0100 Message-Id: <1365698186-27355-5-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1365698186-27355-1-git-send-email-will.deacon@arm.com> References: <1365698186-27355-1-git-send-email-will.deacon@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Zyngier The ARMv8 architecture is supported by two publicly available software models: the Architecture Enveloppe Model, and the Foundation model. Both are fairly similar to the Cortex-A57 from a kvm tools point of view, so we can hijack the A57 implementation to register these new targets. Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon --- tools/kvm/arm/aarch64/cortex-a57.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/kvm/arm/aarch64/cortex-a57.c b/tools/kvm/arm/aarch64/cortex-a57.c index 5b0dc4c..0c340fb 100644 --- a/tools/kvm/arm/aarch64/cortex-a57.c +++ b/tools/kvm/arm/aarch64/cortex-a57.c @@ -49,6 +49,22 @@ static int cortex_a57__vcpu_init(struct kvm_cpu *vcpu) return 0; } +/* + * As far as userspace is concerned, both of these implementations are + * extremely similar. + */ +static struct kvm_arm_target target_aem_v8 = { + .id = KVM_ARM_TARGET_AEM_V8, + .compatible = "arm,arm-v8", + .init = cortex_a57__vcpu_init, +}; + +static struct kvm_arm_target target_foundation_v8 = { + .id = KVM_ARM_TARGET_FOUNDATION_V8, + .compatible = "arm,arm-v8", + .init = cortex_a57__vcpu_init, +}; + static struct kvm_arm_target target_cortex_a57 = { .id = KVM_ARM_TARGET_CORTEX_A57, .compatible = "arm,cortex-a57", @@ -57,6 +73,8 @@ static struct kvm_arm_target target_cortex_a57 = { static int cortex_a57__core_init(struct kvm *kvm) { - return kvm_cpu__register_kvm_arm_target(&target_cortex_a57); + return (kvm_cpu__register_kvm_arm_target(&target_aem_v8) || + kvm_cpu__register_kvm_arm_target(&target_foundation_v8) || + kvm_cpu__register_kvm_arm_target(&target_cortex_a57)); } core_init(cortex_a57__core_init);