From patchwork Fri Aug 8 13:28:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 35122 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D3572118A for ; Fri, 8 Aug 2014 13:29:33 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id eb12sf22818690oac.9 for ; Fri, 08 Aug 2014 06:29:33 -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: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=Tx8R/BqyKncR/M36DHpgboUygV01KXGfa5KNqKFBPc0=; b=KvRJuw/1MEFY7Bni0IP2mfPmV62JMJEWQ9k+2Bg3toMgjjdgoJRLgk8zMl7RvG7U6r MbuKzX0W1MjdBiVIWET7BBP5/35DgzU5FfJBksR3A8irmx8gMCiPT0H0r9uWzvIY7vba oowzTcv61PAtP6kJxbK2YyO+ign2XfRr6XmT9Nvo2ort3rcQjsdnYhPhSI1nwTvHIAlQ 1nFJBUIq24319zvOYZlXLT6Lni54uCGtIvdnCnHym7muU8Rhf9zblKx5J89RFGCvEM90 nJzPZgFhy2LSnTiLo0BrQKJE5OuzXnsRIZk+VtND3BrzSxu9Yda1xdLo4NMmfIKSeZ5G 8QcQ== X-Gm-Message-State: ALoCoQlu+Pr8MsxXAtgZ4jjRePdDKhwD6tOSNXmNj5a1gpOmBDBCroVgf6wZ49x10tKNLh+qIJ3A X-Received: by 10.50.33.18 with SMTP id n18mr1999253igi.8.1407504573037; Fri, 08 Aug 2014 06:29:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.21 with SMTP id h21ls579315qge.52.gmail; Fri, 08 Aug 2014 06:29:32 -0700 (PDT) X-Received: by 10.52.1.39 with SMTP id 7mr6682670vdj.17.1407504572861; Fri, 08 Aug 2014 06:29:32 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id lu10si271415veb.1.2014.08.08.06.29.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 06:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id hy10so8279924vcb.32 for ; Fri, 08 Aug 2014 06:29:32 -0700 (PDT) X-Received: by 10.52.185.193 with SMTP id fe1mr6831849vdc.31.1407504572761; Fri, 08 Aug 2014 06:29:32 -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.37.5 with SMTP id tc5csp122913vcb; Fri, 8 Aug 2014 06:29:32 -0700 (PDT) X-Received: by 10.224.111.193 with SMTP id t1mr37750202qap.103.1407504572203; Fri, 08 Aug 2014 06:29:32 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v7si10212809qay.99.2014.08.08.06.29.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Aug 2014 06:29:32 -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]:51143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFkEd-00046R-R0 for patch@linaro.org; Fri, 08 Aug 2014 09:29:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFkE7-0003n6-Ls for qemu-devel@nongnu.org; Fri, 08 Aug 2014 09:29:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFkE1-0000TP-PO for qemu-devel@nongnu.org; Fri, 08 Aug 2014 09:28:59 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:47472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFkE1-0000TE-Iw for qemu-devel@nongnu.org; Fri, 08 Aug 2014 09:28:53 -0400 Received: by mail-la0-f46.google.com with SMTP id b8so4701947lan.33 for ; Fri, 08 Aug 2014 06:28:52 -0700 (PDT) X-Received: by 10.152.116.50 with SMTP id jt18mr22041481lab.21.1407504532489; Fri, 08 Aug 2014 06:28:52 -0700 (PDT) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id j20sm4535754lbo.3.2014.08.08.06.28.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Aug 2014 06:28:50 -0700 (PDT) From: Christoffer Dall To: qemu-devel@nongnu.org Date: Fri, 8 Aug 2014 15:28:48 +0200 Message-Id: <1407504529-3417-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.0.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.46 Cc: kvmarm@lists.cs.columbia.edu, Christoffer Dall Subject: [Qemu-devel] [PATCH 1/2] target-arm: Rename QEMU PSCI v0.1 definitions 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: christoffer.dall@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.173 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 The function IDs for PSCI v0.1 are exported by KVM and defined as KVM_PSCI_FN_. To build using these defines in non-KVM code, QEMU defines these IDs locally and check their correctness against the KVM headers when those are available. However, the naming scheme used for QEMU (almost) clashes with the PSCI v0.2 definitions from Linux so to avoid unfortunate naming when we introduce local PSCI v0.2 defines, rename the current local defines with QEMU_ prependend and clearly identify the PSCI version as v0.1 in the defines. Signed-off-by: Christoffer Dall --- hw/arm/virt.c | 8 ++++---- target-arm/kvm-consts.h | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ba94298..8f3f607 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -204,10 +204,10 @@ static void fdt_add_psci_node(const VirtBoardInfo *vbi) qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc"); qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend", - PSCI_FN_CPU_SUSPEND); - qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off", PSCI_FN_CPU_OFF); - qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on", PSCI_FN_CPU_ON); - qemu_fdt_setprop_cell(fdt, "/psci", "migrate", PSCI_FN_MIGRATE); + QEMU_PSCI_0_1_FN_CPU_SUSPEND); + qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off", QEMU_PSCI_0_1_FN_CPU_OFF); + qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on", QEMU_PSCI_0_1_FN_CPU_ON); + qemu_fdt_setprop_cell(fdt, "/psci", "migrate", QEMU_PSCI_0_1_FN_MIGRATE); } } diff --git a/target-arm/kvm-consts.h b/target-arm/kvm-consts.h index 6009a33..bcad7ba 100644 --- a/target-arm/kvm-consts.h +++ b/target-arm/kvm-consts.h @@ -38,17 +38,17 @@ MISMATCH_CHECK(CP_REG_SIZE_U64, KVM_REG_SIZE_U64) MISMATCH_CHECK(CP_REG_ARM, KVM_REG_ARM) MISMATCH_CHECK(CP_REG_ARCH_MASK, KVM_REG_ARCH_MASK) -#define PSCI_FN_BASE 0x95c1ba5e -#define PSCI_FN(n) (PSCI_FN_BASE + (n)) -#define PSCI_FN_CPU_SUSPEND PSCI_FN(0) -#define PSCI_FN_CPU_OFF PSCI_FN(1) -#define PSCI_FN_CPU_ON PSCI_FN(2) -#define PSCI_FN_MIGRATE PSCI_FN(3) - -MISMATCH_CHECK(PSCI_FN_CPU_SUSPEND, KVM_PSCI_FN_CPU_SUSPEND) -MISMATCH_CHECK(PSCI_FN_CPU_OFF, KVM_PSCI_FN_CPU_OFF) -MISMATCH_CHECK(PSCI_FN_CPU_ON, KVM_PSCI_FN_CPU_ON) -MISMATCH_CHECK(PSCI_FN_MIGRATE, KVM_PSCI_FN_MIGRATE) +#define QEMU_PSCI_0_1_FN_BASE 0x95c1ba5e +#define QEMU_PSCI_0_1_FN(n) (QEMU_PSCI_0_1_FN_BASE + (n)) +#define QEMU_PSCI_0_1_FN_CPU_SUSPEND QEMU_PSCI_0_1_FN(0) +#define QEMU_PSCI_0_1_FN_CPU_OFF QEMU_PSCI_0_1_FN(1) +#define QEMU_PSCI_0_1_FN_CPU_ON QEMU_PSCI_0_1_FN(2) +#define QEMU_PSCI_0_1_FN_MIGRATE QEMU_PSCI_0_1_FN(3) + +MISMATCH_CHECK(QEMU_PSCI_0_1_FN_CPU_SUSPEND, KVM_PSCI_FN_CPU_SUSPEND) +MISMATCH_CHECK(QEMU_PSCI_0_1_FN_CPU_OFF, KVM_PSCI_FN_CPU_OFF) +MISMATCH_CHECK(QEMU_PSCI_0_1_FN_CPU_ON, KVM_PSCI_FN_CPU_ON) +MISMATCH_CHECK(QEMU_PSCI_0_1_FN_MIGRATE, KVM_PSCI_FN_MIGRATE) /* Note that KVM uses overlapping values for AArch32 and AArch64 * target CPU numbers. AArch32 targets: