From patchwork Fri Sep 5 12:24:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 36841 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CDC24202A1 for ; Fri, 5 Sep 2014 12:26:26 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id le20sf32924841vcb.8 for ; Fri, 05 Sep 2014 05:26:26 -0700 (PDT) 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:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=nHqT3EXDT23H7amkSGEl6ebLkiiTGEpAum5jj9XgUhA=; b=SJKTuN7o4KDfQWIOHVW35UliY1RikJJNHnwGOIvsq0O1jzvifx1aBedM4RZsj9zHu9 SsaAM5XEtWitJBcirtVLWiYvLxPqKxteFlJE6yx499e34hELyo19N5nye+Ld2eZ0Xql4 McKRyZRODTjbhLWqxj5FmsP+IfAYg2zIxq//jh+gHSarFqeK/T3zZK3O5gNK0RInhvWa t2Xj4KLWMhaEBgNsHtnA8pr6lxRPvDXF7XfDDFdh9UeMGHmWFP1oLMGz6E4BNVg1WbGV qeU6XEnPXvo+P69ryv2oQd5/azWaiUabZymoc68zD3oFaQ7rVPpJ9bKMVncFRSi36/FK +Eiw== X-Gm-Message-State: ALoCoQnFI5332RaFzztenFWkTVfaGJW6jbUWGxwWCKMeNQ0HS9/snu8Uo0tYDdnM0Zt/44jKVSrf X-Received: by 10.236.108.172 with SMTP id q32mr6717273yhg.0.1409919986632; Fri, 05 Sep 2014 05:26:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.225 with SMTP id s88ls697593qga.59.gmail; Fri, 05 Sep 2014 05:26:26 -0700 (PDT) X-Received: by 10.52.121.74 with SMTP id li10mr8282257vdb.19.1409919986459; Fri, 05 Sep 2014 05:26:26 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id uy8si385506vcb.72.2014.09.05.05.26.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 05:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hq11so12016282vcb.22 for ; Fri, 05 Sep 2014 05:26:26 -0700 (PDT) X-Received: by 10.52.129.165 with SMTP id nx5mr7435922vdb.25.1409919986372; Fri, 05 Sep 2014 05:26:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp74826vcb; Fri, 5 Sep 2014 05:26:26 -0700 (PDT) X-Received: by 10.224.47.6 with SMTP id l6mr18228287qaf.32.1409919985878; Fri, 05 Sep 2014 05:26:25 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b6si1379854qcc.45.2014.09.05.05.26.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 05:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:57479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPsau-0000mX-SC for patch@linaro.org; Fri, 05 Sep 2014 08:26:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPsZp-0008Gc-87 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 08:25:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPsZj-0006Qz-CA for qemu-devel@nongnu.org; Fri, 05 Sep 2014 08:25:17 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:55741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPsZj-0006Qp-6H for qemu-devel@nongnu.org; Fri, 05 Sep 2014 08:25:11 -0400 Received: by mail-we0-f173.google.com with SMTP id t60so11788884wes.18 for ; Fri, 05 Sep 2014 05:25:07 -0700 (PDT) X-Received: by 10.194.186.178 with SMTP id fl18mr14185136wjc.8.1409919906098; Fri, 05 Sep 2014 05:25:06 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id mv14sm1807558wic.20.2014.09.05.05.25.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 05:25:05 -0700 (PDT) From: Ard Biesheuvel To: peter.maydell@linaro.org, christoffer.dall@linaro.org, qemu-devel@nongnu.org Date: Fri, 5 Sep 2014 14:24:55 +0200 Message-Id: <1409919897-360-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1409919897-360-1-git-send-email-ard.biesheuvel@linaro.org> References: <1409919897-360-1-git-send-email-ard.biesheuvel@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.173 Cc: Ard Biesheuvel Subject: [Qemu-devel] [PATCH v3 4/6] target-arm: add missing PSCI constants needed for PSCI emulation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This adds some PSCI function IDs and symbolic return codes that are needed to implement PSCI emulation in TCG mode. Signed-off-by: Ard Biesheuvel Reviewed-by: Peter Maydell --- target-arm/kvm-consts.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/target-arm/kvm-consts.h b/target-arm/kvm-consts.h index 091c1267d659..ba5a7c7a894d 100644 --- a/target-arm/kvm-consts.h +++ b/target-arm/kvm-consts.h @@ -59,14 +59,21 @@ MISMATCH_CHECK(QEMU_PSCI_0_1_FN_MIGRATE, KVM_PSCI_FN_MIGRATE) (QEMU_PSCI_0_2_FN_BASE + QEMU_PSCI_0_2_64BIT) #define QEMU_PSCI_0_2_FN64(n) (QEMU_PSCI_0_2_FN64_BASE + (n)) +#define QEMU_PSCI_0_2_FN_PSCI_VERSION QEMU_PSCI_0_2_FN(0) #define QEMU_PSCI_0_2_FN_CPU_SUSPEND QEMU_PSCI_0_2_FN(1) #define QEMU_PSCI_0_2_FN_CPU_OFF QEMU_PSCI_0_2_FN(2) #define QEMU_PSCI_0_2_FN_CPU_ON QEMU_PSCI_0_2_FN(3) +#define QEMU_PSCI_0_2_FN_AFFINITY_INFO QEMU_PSCI_0_2_FN(4) #define QEMU_PSCI_0_2_FN_MIGRATE QEMU_PSCI_0_2_FN(5) +#define QEMU_PSCI_0_2_FN_MIGRATE_INFO_TYPE QEMU_PSCI_0_2_FN(6) +#define QEMU_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU QEMU_PSCI_0_2_FN(7) +#define QEMU_PSCI_0_2_FN_SYSTEM_OFF QEMU_PSCI_0_2_FN(8) +#define QEMU_PSCI_0_2_FN_SYSTEM_RESET QEMU_PSCI_0_2_FN(9) #define QEMU_PSCI_0_2_FN64_CPU_SUSPEND QEMU_PSCI_0_2_FN64(1) #define QEMU_PSCI_0_2_FN64_CPU_OFF QEMU_PSCI_0_2_FN64(2) #define QEMU_PSCI_0_2_FN64_CPU_ON QEMU_PSCI_0_2_FN64(3) +#define QEMU_PSCI_0_2_FN64_AFFINITY_INFO QEMU_PSCI_0_2_FN64(4) #define QEMU_PSCI_0_2_FN64_MIGRATE QEMU_PSCI_0_2_FN64(5) MISMATCH_CHECK(QEMU_PSCI_0_2_FN_CPU_SUSPEND, PSCI_0_2_FN_CPU_SUSPEND) @@ -77,6 +84,39 @@ MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_CPU_SUSPEND, PSCI_0_2_FN64_CPU_SUSPEND) MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_CPU_ON, PSCI_0_2_FN64_CPU_ON) MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_MIGRATE, PSCI_0_2_FN64_MIGRATE) +/* PSCI v0.2 return values used by TCG emulation of PSCI */ + +/* No Trusted OS migration to worry about when offlining CPUs */ +#define QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED 2 + +/* We implement version 0.2 only */ +#define QEMU_PSCI_0_2_RET_VERSION_0_2 2 + +MISMATCH_CHECK(QEMU_PSCI_0_2_RET_TOS_MIGRATION_NOT_REQUIRED, PSCI_0_2_TOS_MP) +MISMATCH_CHECK(QEMU_PSCI_0_2_RET_VERSION_0_2, + PSCI_VERSION_MAJOR(0) | PSCI_VERSION_MINOR(2)) + +/* PSCI return values (inclusive of all PSCI versions) */ +#define QEMU_PSCI_RET_SUCCESS 0 +#define QEMU_PSCI_RET_NOT_SUPPORTED -1 +#define QEMU_PSCI_RET_INVALID_PARAMS -2 +#define QEMU_PSCI_RET_DENIED -3 +#define QEMU_PSCI_RET_ALREADY_ON -4 +#define QEMU_PSCI_RET_ON_PENDING -5 +#define QEMU_PSCI_RET_INTERNAL_FAILURE -6 +#define QEMU_PSCI_RET_NOT_PRESENT -7 +#define QEMU_PSCI_RET_DISABLED -8 + +MISMATCH_CHECK(QEMU_PSCI_RET_SUCCESS, PSCI_RET_SUCCESS) +MISMATCH_CHECK(QEMU_PSCI_RET_NOT_SUPPORTED, PSCI_RET_NOT_SUPPORTED) +MISMATCH_CHECK(QEMU_PSCI_RET_INVALID_PARAMS, PSCI_RET_INVALID_PARAMS) +MISMATCH_CHECK(QEMU_PSCI_RET_DENIED, PSCI_RET_DENIED) +MISMATCH_CHECK(QEMU_PSCI_RET_ALREADY_ON, PSCI_RET_ALREADY_ON) +MISMATCH_CHECK(QEMU_PSCI_RET_ON_PENDING, PSCI_RET_ON_PENDING) +MISMATCH_CHECK(QEMU_PSCI_RET_INTERNAL_FAILURE, PSCI_RET_INTERNAL_FAILURE) +MISMATCH_CHECK(QEMU_PSCI_RET_NOT_PRESENT, PSCI_RET_NOT_PRESENT) +MISMATCH_CHECK(QEMU_PSCI_RET_DISABLED, PSCI_RET_DISABLED) + /* Note that KVM uses overlapping values for AArch32 and AArch64 * target CPU numbers. AArch32 targets: */