From patchwork Wed Jul 3 08:42:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 2815561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 23E109F755 for ; Wed, 3 Jul 2013 08:43:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5C7E20153 for ; Wed, 3 Jul 2013 08:43:10 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A264220150 for ; Wed, 3 Jul 2013 08:43:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UuIeW-0008UP-49; Wed, 03 Jul 2013 08:43:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UuIeT-0004bS-BH; Wed, 03 Jul 2013 08:43:01 +0000 Received: from mail-pb0-f45.google.com ([209.85.160.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UuIeR-0004aI-0f for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2013 08:42:59 +0000 Received: by mail-pb0-f45.google.com with SMTP id mc8so7099002pbc.18 for ; Wed, 03 Jul 2013 01:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=1ymEq6GJEuzSZPxDUqyXMMRqWna+MFY/Wbstvws+wAI=; b=Jo5laWMmf8+VMR4/y0wxwSbqSaru2xzMK8GVasVmqe0rZZUTg7t5LL1ItvFaIRIu0y 1UU3DPoOD0qvMPRwzqkdbhM8+LLzdrXKE/0/blbSmS1b+QVe2ig+lvCRv/BvX+hZlXtl Lc/AJUtUD7cEbYrvND2mH4VvAaPHNplApUxY9LF4JYpIQMBZJhCHyREQJNBFSsNfxrqj 0OBmg6jraFE6P5gZ4Mvm0qNDhGI8pYjDbMsaZYYhVXkexoPYq8sANeSZ2gu6pCYowK4K 5oDmQ5XlIv00X6sGI8X8IZvxxyP0zs23GvYAc+Bc/HkD7j9DvvYje22FgXiPFGiwenpz ZGBw== X-Received: by 10.68.197.136 with SMTP id iu8mr32631113pbc.183.1372840956905; Wed, 03 Jul 2013 01:42:36 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id i16sm32954959pag.18.2013.07.03.01.42.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Jul 2013 01:42:36 -0700 (PDT) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Subject: [PATCH] arm64: KVM: Support Cortex-A57 guest CPU on APM X-Gene host Date: Wed, 3 Jul 2013 14:12:03 +0530 Message-Id: <1372840923-12808-1-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlscZMGK0WlD1Q+ObNy9Jcssnl6t+9LC5fkC1Gm+ZxTOXtSv8btS1tWsUxojwj+PfFNeUv7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130703_044259_129046_76E9A9AE X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, Anup Patel , patches@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, Pranavkumar Sawargaonkar X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update kvm_target_cpu() to allow Cortex-A57 guest CPU on APM X-Gene. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- arch/arm64/kvm/guest.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 2c3ff67..765f56f 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -207,8 +207,13 @@ int __attribute_const__ kvm_target_cpu(void) unsigned long implementor = read_cpuid_implementor(); unsigned long part_number = read_cpuid_part_number(); - if (implementor != ARM_CPU_IMP_ARM) - return -EINVAL; + switch (implementor) { + case ARM_CPU_IMP_ARM: + case ARM_CPU_IMP_APM: + break; + default: + return -EINVAL; + } switch (part_number) { case ARM_CPU_PART_AEM_V8: @@ -216,6 +221,7 @@ int __attribute_const__ kvm_target_cpu(void) case ARM_CPU_PART_FOUNDATION: return KVM_ARM_TARGET_FOUNDATION_V8; case ARM_CPU_PART_CORTEX_A57: + case APM_CPU_PART_POTENZA: /* Currently handled by the generic backend */ return KVM_ARM_TARGET_CORTEX_A57; default: