From patchwork Mon May 12 12:37:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 29973 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D043238EB for ; Mon, 12 May 2014 12:41:05 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf41150161pab.5 for ; Mon, 12 May 2014 05:41:04 -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=inVCFh9Xu4+VewCdmpl7+3kEpuOhcDj5xlzcOCuBitQ=; b=kGBq6AuI+ZPrcYVBKpmJtaAQ32wzrHgjS9AEj9VZBJco6XfmO/aMCkGlze17DjcyAB mjPlKB6gf6tHwKt7+gB2lbAY1LCY7z4AGuSQF8WJiOTfNUFpm4twNQqvzQJUtlaD6QwS f3hPgN2S2m7JvsyrB1YV4MM7HA9JyuAaI2BESU7VXY4KUMT4JQYWgg/GX4BoK30Yo0MK 5HD/asd7hnZ7xNXsltjFgqCd7PVfLF80wRgCt3dR+szyPw5eNEmK4salLtANeID1alvj nIAgbONguRQ3RdhTfyapNC2i2cjkczm+nqGJ3vN9f3/rxpwUjmBnPiP1SWo+RvGovdei i8cg== X-Gm-Message-State: ALoCoQlyRDJdHZPDiHrTT8RBLtmPcf8gIjeU2BTRd0X154Agclat4KMFYq279XlNvlZzG5PBd9Fc X-Received: by 10.67.4.170 with SMTP id cf10mr11089803pad.31.1399898464756; Mon, 12 May 2014 05:41:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.4 with SMTP id 4ls1347874qgy.39.gmail; Mon, 12 May 2014 05:41:04 -0700 (PDT) X-Received: by 10.220.162.196 with SMTP id w4mr258300vcx.58.1399898464643; Mon, 12 May 2014 05:41:04 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id rw10si2055721vec.26.2014.05.12.05.41.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 05:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so8668078veb.33 for ; Mon, 12 May 2014 05:41:04 -0700 (PDT) X-Received: by 10.220.5.10 with SMTP id 10mr525325vct.40.1399898464474; Mon, 12 May 2014 05:41:04 -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 ib8csp65793vcb; Mon, 12 May 2014 05:41:04 -0700 (PDT) X-Received: by 10.140.102.161 with SMTP id w30mr3753291qge.108.1399898464029; Mon, 12 May 2014 05:41:04 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g2si5896759qaf.204.2014.05.12.05.41.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 12 May 2014 05:41: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]:37465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjpXT-0004C8-M4 for patch@linaro.org; Mon, 12 May 2014 08:41:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjpVA-0001Zz-J6 for qemu-devel@nongnu.org; Mon, 12 May 2014 08:38:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjpV4-0002UI-MO for qemu-devel@nongnu.org; Mon, 12 May 2014 08:38:40 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:48835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjpV4-0002UD-HJ for qemu-devel@nongnu.org; Mon, 12 May 2014 08:38:34 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so8438520pab.38 for ; Mon, 12 May 2014 05:38:33 -0700 (PDT) X-Received: by 10.67.23.234 with SMTP id id10mr30783409pad.54.1399898313876; Mon, 12 May 2014 05:38:33 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ek2sm22718531pbd.30.2014.05.12.05.38.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 05:38:33 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Mon, 12 May 2014 18:07:26 +0530 Message-Id: <1399898246-4831-9-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1399898246-4831-1-git-send-email-pranavkumar@linaro.org> References: <1399898246-4831-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.51 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 V5 8/8] 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 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 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ea4f02d..64ee630 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -183,7 +183,13 @@ 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"); + if (kvm_check_extension(kvm_state, QEMU_KVM_CAP_ARM_PSCI_0_2)) { + qemu_fdt_setprop(fdt, "/psci", "compatible", + "arm,psci-0.2\0arm,psci", + strlen("arm,psci-0.2") + strlen("arm,psci") + 2); + } else { + 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", PSCI_FN_CPU_SUSPEND);