From patchwork Mon May 5 08:57:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 29629 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CEA752055D for ; Mon, 5 May 2014 09:21:05 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cm18sf18777782qab.9 for ; Mon, 05 May 2014 02:21:05 -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=TxgBodNNHy8jC/nYdJb3YJqcjgaldA60A1XiPWYS3hs=; b=JC9fiT+3HcN44DjCmtf/27ZeJG2hy5xzm5Xvc+pmeJns0JNJZwSL1hh0MJ1uDuse2S CupNvN08RSJRF+JMmSoFIjmNCxSOX57Xg+yao81iW4JM1UVMrVDGLttyxzWLnIbMxuq1 VI2KbKf/AY1VBxzbPsvEsmY1Sbt9jlAPYJMyVEuY5WqVX40DxcFwZ7LC8t3x9kj/SIue eJeqDFfw48IjWe9VsIV0NxbvPkDTLFBkqHYVqvibRofZFUCpIUJIFkjp3ftA5NiEBPr5 w7wk/lk4j7KDER64/fA+PGCe8iGSgSOG1GOvFbuD+y1Uza3ywaSOsWUjV45w4kTNpPr5 qe9w== X-Gm-Message-State: ALoCoQmXrE1Rn0UhU7G9urlc4wOFAACW8EHwjj3xpnesE2ppKM3on/lKcYhgseEl0kfSEjVbe5t2 X-Received: by 10.58.188.4 with SMTP id fw4mr18183157vec.9.1399281665576; Mon, 05 May 2014 02:21:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.209 with SMTP id x75ls2232263qgx.46.gmail; Mon, 05 May 2014 02:21:05 -0700 (PDT) X-Received: by 10.58.220.161 with SMTP id px1mr28153174vec.13.1399281665452; Mon, 05 May 2014 02:21:05 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id v2si1419949vet.142.2014.05.05.02.21.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 02:21:05 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ij19so1296974vcb.0 for ; Mon, 05 May 2014 02:21:05 -0700 (PDT) X-Received: by 10.58.96.36 with SMTP id dp4mr27645274veb.21.1399281665386; Mon, 05 May 2014 02:21:05 -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.220.221.72 with SMTP id ib8csp125195vcb; Mon, 5 May 2014 02:21:04 -0700 (PDT) X-Received: by 10.140.19.212 with SMTP id 78mr40059450qgh.84.1399281664796; Mon, 05 May 2014 02:21:04 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t10si4168833qci.21.2014.05.05.02.21.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 05 May 2014 02:21:04 -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]:56091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhElK-0000eu-Jf for patch@linaro.org; Mon, 05 May 2014 05:00:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhEkD-0007WA-UI for qemu-devel@nongnu.org; Mon, 05 May 2014 04:59:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhEk7-0007Ir-TC for qemu-devel@nongnu.org; Mon, 05 May 2014 04:59:29 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:55165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhEk7-0007Ib-NN for qemu-devel@nongnu.org; Mon, 05 May 2014 04:59:23 -0400 Received: by mail-pa0-f46.google.com with SMTP id kx10so6203328pab.5 for ; Mon, 05 May 2014 01:59:22 -0700 (PDT) X-Received: by 10.66.250.161 with SMTP id zd1mr70211494pac.136.1399280362830; Mon, 05 May 2014 01:59:22 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id zv3sm66118407pab.20.2014.05.05.01.59.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 01:59:21 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Mon, 5 May 2014 14:27:12 +0530 Message-Id: <1399280234-25036-5-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1399280234-25036-1-git-send-email-pranavkumar@linaro.org> References: <1399280234-25036-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.46 Cc: peter.maydell@linaro.org, Anup Patel , patches@apm.com, robherring2@gmail.com, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [RFC PATCH V4 4/6] hw/arm/virt: Use PSCI v0.2 compatible when kernel supports it 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: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 If we have in-kernel emulation of PSCI v0.2 for KVM ARM/ARM64 then we enable PSCI v0.2 for each VCPU at the time of VCPU init hence we need to provide PSCI v0.2 compatible string via generated DTB. This patch updates generated DTB to have PSCI v0.2 compatible string when we have in-kernel emulation PSCI v0.2 for KVM ARM/ARM64. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel --- hw/arm/virt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2bbc931..e4ae8ba 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -185,13 +185,17 @@ static void create_fdt(VirtBoardInfo *vbi) /* No PSCI for TCG yet */ if (kvm_enabled()) { qemu_fdt_add_subnode(fdt, "/psci"); - qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci"); - qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc"); - qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend", + if (kvm_check_extension(kvm_state, KVM_CAP_ARM_PSCI_0_2)) { + qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci-0.2"); + } else { + qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci"); + 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_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_fdt_setprop_string(fdt, "/psci", "method", "hvc"); } }