From patchwork Thu Feb 6 11:31:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 24249 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4043B20445 for ; Thu, 6 Feb 2014 11:33:05 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp4sf8379370obc.1 for ; Thu, 06 Feb 2014 03:33:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=N9OD3YTXrC7oX3b/8TYs4Rr2SHwfN0sb9wz5c8UwWkU=; b=GMMs2JnVAkkqXdSVUrBZDUzrhT5NQgN2KBIBgnMPouHg6saiOOPvDjyNZjL8+8TVhz ryld5yDOToOlsE64qiOY/nas7BeS/zHqLcN/iJPFQcz/R3wP9fHY/hmzOr39CyKwPajq Zd3aQ2ANbalyvkjCfxr7EVUCllBtovMWaARG9BGzaJhL39iOG0syJOQJuyJgyyLDMDuN sfMR/t6u2pbhzpbqn2NT2rnvUw3NEVk3ioAZu2OceY2J6zyBisofey0ElFPOFdpaKqLZ H48swJQz7Z5/v+QTVZqDx2aIJoVIp75dIlK02zkaNJPJjN09uKHpjVKUJfGtIYWmLQxR qw2A== X-Gm-Message-State: ALoCoQnjcRc14gadFUkqVv9FhMF0dtD+S1mg/wakWFDJtjLgOoYjJGFXj97kwltnpW3kxriYfIsr X-Received: by 10.182.81.7 with SMTP id v7mr3222091obx.28.1391686384330; Thu, 06 Feb 2014 03:33:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.235 with SMTP id l98ls518721qgl.90.gmail; Thu, 06 Feb 2014 03:33:04 -0800 (PST) X-Received: by 10.52.25.135 with SMTP id c7mr48539vdg.62.1391686384187; Thu, 06 Feb 2014 03:33:04 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id v7si159924vet.104.2014.02.06.03.33.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Feb 2014 03:33:04 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so1374636veb.35 for ; Thu, 06 Feb 2014 03:33:04 -0800 (PST) X-Received: by 10.58.155.162 with SMTP id vx2mr65222veb.46.1391686384106; Thu, 06 Feb 2014 03:33:04 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp5280vcz; Thu, 6 Feb 2014 03:33:03 -0800 (PST) X-Received: by 10.68.92.98 with SMTP id cl2mr11855239pbb.81.1391686383203; Thu, 06 Feb 2014 03:33:03 -0800 (PST) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by mx.google.com with ESMTPS id gj4si817531pac.118.2014.02.06.03.33.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Feb 2014 03:33:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.49 is neither permitted nor denied by best guess record for domain of anup.patel@linaro.org) client-ip=209.85.220.49; Received: by mail-pa0-f49.google.com with SMTP id hz1so1564242pad.22 for ; Thu, 06 Feb 2014 03:33:02 -0800 (PST) X-Received: by 10.66.232.40 with SMTP id tl8mr39871pac.137.1391686382658; Thu, 06 Feb 2014 03:33:02 -0800 (PST) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id yd4sm2594758pbc.13.2014.02.06.03.32.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Feb 2014 03:33:01 -0800 (PST) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, patches@apm.com, Marc Zyngier , Christoffer Dall , Mark Rutland , Pranavkumar Sawargaonkar , Anup Patel Subject: [PATCH v4 08/10] ARM/ARM64: KVM: Emulate PSCI v0.2 MIGRATE_INFO_TYPE and related functions Date: Thu, 6 Feb 2014 17:01:40 +0530 Message-Id: <1391686302-19451-9-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391686302-19451-1-git-send-email-anup.patel@linaro.org> References: <1391686302-19451-1-git-send-email-anup.patel@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anup.patel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch adds emulation of PSCI v0.2 MIGRATE, MIGRATE_INFO_TYPE, and MIGRATE_INFO_UP_CPU function calls for KVM ARM/ARM64. KVM ARM/ARM64 being a hypervisor (and not a Trusted OS), we cannot provide this functions hence we emulate these functions in following way: 1. MIGRATE - Returns "Not Supported" 2. MIGRATE_INFO_TYPE - Return 2 i.e. Trusted OS is either not present or does not require migration 3. MIGRATE_INFO_UP_CPU - Returns "Not Supported" Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar Reviewed-by: Christoffer Dall --- arch/arm/kvm/psci.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c index 9890710..75447a3 100644 --- a/arch/arm/kvm/psci.c +++ b/arch/arm/kvm/psci.c @@ -120,7 +120,8 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) /* Ignore other bits of target affinity */ target_affinity &= target_affinity_mask; - /* If one or more VCPU matching target affinity are running + /* + * If one or more VCPU matching target affinity are running * then return 0 (ON) else return 1 (OFF) */ kvm_for_each_vcpu(i, tmp, kvm) { @@ -185,6 +186,21 @@ static int kvm_psci_0_2_call(struct kvm_vcpu *vcpu) case KVM_PSCI_0_2_FN64_AFFINITY_INFO: val = kvm_psci_vcpu_affinity_info(vcpu); break; + case KVM_PSCI_0_2_FN_MIGRATE: + case KVM_PSCI_0_2_FN64_MIGRATE: + val = KVM_PSCI_RET_NI; + break; + case KVM_PSCI_0_2_FN_MIGRATE_INFO_TYPE: + /* + * Trusted OS is either not present or + * does not require migration + */ + val = 2; + break; + case KVM_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU: + case KVM_PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU: + val = KVM_PSCI_RET_NI; + break; case KVM_PSCI_0_2_FN_SYSTEM_OFF: kvm_psci_system_off(vcpu); val = KVM_PSCI_RET_SUCCESS; @@ -196,12 +212,7 @@ static int kvm_psci_0_2_call(struct kvm_vcpu *vcpu) ret = 0; break; case KVM_PSCI_0_2_FN_CPU_SUSPEND: - case KVM_PSCI_0_2_FN_MIGRATE: - case KVM_PSCI_0_2_FN_MIGRATE_INFO_TYPE: - case KVM_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU: case KVM_PSCI_0_2_FN64_CPU_SUSPEND: - case KVM_PSCI_0_2_FN64_MIGRATE: - case KVM_PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU: val = KVM_PSCI_RET_NI; break; default: