From patchwork Mon May 5 16:00:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 29653 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D99E2055D for ; Mon, 5 May 2014 16:01:57 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oz11sf3685396veb.10 for ; Mon, 05 May 2014 09:01:57 -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=0jW88Kv6IsG7t0OxjcEVbkiBKYYgVbWsmxPyH6jpl6s=; b=IaUZpdY//tGSGGpOwWfjpdyo4HUiwi8WIF/0a2HW4D78UBNW/XPyATgSAqubJc5mde rPKOaB18lOZgz/fVsSHnAQtJ1dmYs9gEPC1HVFQwMH33qLmloWXWdoIFLgi21Db0Rsxy hBx/XRnM9a9TRaXHfcayU5+8Qta3maLtZGDUAHWUz96YzI6N9OwZyB3qhcebfe3LHKrY x5wV8qbgC9k3n0gf29iUuOstHWCDgjrJDVQxjIu0qf02vUg+2YmHl78OrFU9kP2JNu/5 dOS/ZMK+TTsY6KoeKqd7d/kakDsMXJ0WPjnIqHNncWQXePU/qOC0Ok5SOPEpepFqxBiz Km0Q== X-Gm-Message-State: ALoCoQnECpIKahhYvmkVGZGF2K73x3qdG8DPV0et7NCfkjJc4708X/KElGzqWJG/Kg3tBljortbi X-Received: by 10.236.118.38 with SMTP id k26mr17206964yhh.35.1399305717121; Mon, 05 May 2014 09:01:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.182 with SMTP id 51ls2531147qgv.38.gmail; Mon, 05 May 2014 09:01:57 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr3886015vch.22.1399305717016; Mon, 05 May 2014 09:01:57 -0700 (PDT) Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236]) by mx.google.com with ESMTPS id ko12si823905veb.81.2014.05.05.09.01.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 09:01:57 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=2607:f8b0:400c:c01::236; Received: by mail-ve0-f182.google.com with SMTP id sa20so2745798veb.13 for ; Mon, 05 May 2014 09:01:56 -0700 (PDT) X-Received: by 10.58.179.115 with SMTP id df19mr840883vec.41.1399305716952; Mon, 05 May 2014 09:01:56 -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 ib8csp151695vcb; Mon, 5 May 2014 09:01:56 -0700 (PDT) X-Received: by 10.140.81.197 with SMTP id f63mr5111238qgd.114.1399305716339; Mon, 05 May 2014 09:01:56 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g2si3636856qaf.227.2014.05.05.09.01.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 05 May 2014 09:01:56 -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]:58227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhLL1-00081d-VZ for patch@linaro.org; Mon, 05 May 2014 12:01:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhLJr-0006rM-Kl for qemu-devel@nongnu.org; Mon, 05 May 2014 12:00:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhLJk-0000lE-Uw for qemu-devel@nongnu.org; Mon, 05 May 2014 12:00:43 -0400 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]:45123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhLJk-0000l2-HW for qemu-devel@nongnu.org; Mon, 05 May 2014 12:00:36 -0400 Received: by mail-ob0-f175.google.com with SMTP id wp4so8689220obc.34 for ; Mon, 05 May 2014 09:00:36 -0700 (PDT) X-Received: by 10.182.2.72 with SMTP id 8mr33102938obs.21.1399305635935; Mon, 05 May 2014 09:00:35 -0700 (PDT) Received: from localhost.localdomain (72-48-77-163.dyn.grandenetworks.net. [72.48.77.163]) by mx.google.com with ESMTPSA id dw5sm20133189obb.0.2014.05.05.09.00.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 May 2014 09:00:35 -0700 (PDT) From: Rob Herring To: Peter Maydell Date: Mon, 5 May 2014 11:00:18 -0500 Message-Id: <1399305623-22016-3-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399305623-22016-1-git-send-email-robherring2@gmail.com> References: <1399305623-22016-1-git-send-email-robherring2@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22f Cc: Rob Herring , qemu-devel@nongnu.org, Christoffer Dall Subject: [Qemu-devel] [PATCH 2/7] target-arm: add powered off cpu state 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-Original-Sender: robherring2@gmail.com 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; dkim=fail header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Rob Herring Add tracking of cpu power state in order to support powering off of cores in system emuluation. The initial state is determined by the start-powered-off QOM property. Signed-off-by: Rob Herring --- target-arm/cpu-qom.h | 1 + target-arm/cpu.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h index edc7f26..8ccb227 100644 --- a/target-arm/cpu-qom.h +++ b/target-arm/cpu-qom.h @@ -96,6 +96,7 @@ typedef struct ARMCPU { /* Should CPU start in PSCI powered-off state? */ bool start_powered_off; + bool powered_off; /* [QEMU_]KVM_ARM_TARGET_* constant for this CPU, or * QEMU_KVM_ARM_TARGET_NONE if the kernel doesn't support this CPU type. diff --git a/target-arm/cpu.c b/target-arm/cpu.c index c0ddc3e..03c025b 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -39,7 +39,9 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value) static bool arm_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & + ARMCPU *cpu = ARM_CPU(cs); + + return !cpu->powered_off && cs->interrupt_request & (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); } @@ -90,6 +92,9 @@ static void arm_cpu_reset(CPUState *s) env->vfp.xregs[ARM_VFP_MVFR1] = cpu->mvfr1; env->vfp.xregs[ARM_VFP_MVFR2] = cpu->mvfr2; + cpu->powered_off = cpu->start_powered_off; + s->halted = cpu->start_powered_off; + if (arm_feature(env, ARM_FEATURE_IWMMXT)) { env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q'; }