From patchwork Thu Jul 10 15:50:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 33462 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 197BD203C0 for ; Thu, 10 Jul 2014 22:12:24 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cm18sf802636qab.5 for ; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version: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:content-type :content-transfer-encoding; bh=/WnSRvZOpyIOlmV3vrbkSt+0hhIryuPbR5X0rs6D8kE=; b=k1duw7gUF0p8JdD7o/irWevEY/Y2tvEBc4UQJuVQFEsYn6AbtPQV4ovUgFwUsYJuwn 9GmMBbYY+y6Syxqqex6h3ojYXwAAkDDZaaVm7wLnQ5Ob7vxYl2gRT2atmN+zKAIhB2iO RZ3BySIUXc85oZnJg90EEqS9tyKOgW5o3yJ8+di/XB9O7EX1e5cVYZvsbOZMfhITCr1P 0qOpFEj7mSpekZbaNXBuHfLA2mEVZnedlVKb8a/pihduujGIYMlWq3SeqIFyavYK60C8 MivEnkX9XeuTJ+HNuniMG+ZcvkIJReQLqX1HQdLXEBclhXciUi/gpnXTHS+KM72a+YyS NW6A== X-Gm-Message-State: ALoCoQl276jKlY3w9dbJNL9HhN8qBEvJBP7sy4s5L4U2h3Ym9B9t5rkyH1+tsdLbJxh3d65H22Kc X-Received: by 10.236.168.101 with SMTP id j65mr2830352yhl.30.1405030343942; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.203 with SMTP id h69ls219487qgh.56.gmail; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) X-Received: by 10.58.46.34 with SMTP id s2mr2833038vem.49.1405030343778; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id wa10si284759veb.79.2014.07.10.15.12.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 15:12:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so471597vcb.19 for ; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) X-Received: by 10.58.182.234 with SMTP id eh10mr2850872vec.41.1405030343669; Thu, 10 Jul 2014 15:12:23 -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 tc5csp171534vcb; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) X-Received: by 10.224.120.68 with SMTP id c4mr48279873qar.17.1405030343081; Thu, 10 Jul 2014 15:12:23 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p2si638258qah.58.2014.07.10.15.12.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 10 Jul 2014 15:12:23 -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]:38658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gco-00026C-49 for patch@linaro.org; Thu, 10 Jul 2014 11:51:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gba-0001ht-VD for qemu-devel@nongnu.org; Thu, 10 Jul 2014 11:50:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5GbV-00071e-8J for qemu-devel@nongnu.org; Thu, 10 Jul 2014 11:49:54 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:35657 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5GbV-00071U-1e for qemu-devel@nongnu.org; Thu, 10 Jul 2014 11:49:49 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaro.local) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1X5GgL-0007L4-Jq; Thu, 10 Jul 2014 17:54:49 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 10 Jul 2014 16:50:05 +0100 Message-Id: <1405007407-23549-9-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1405007407-23549-1-git-send-email-alex.bennee@linaro.org> References: <1405007407-23549-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: Peter Maydell , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [Qemu-devel] [PATCH v2 08/10] target-arm: remove final users of pstate_write 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: alex.bennee@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.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 This converts all users of pstate_write to use the common state save/restore functionality. Signed-off-by: Alex Bennée Acked-by: Riku Voipio diff --git a/linux-user/signal.c b/linux-user/signal.c index b6f9ef4..b1958a5 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1274,7 +1274,7 @@ static int target_restore_sigframe(CPUARMState *env, __get_user(env->xregs[31], &sf->uc.tuc_mcontext.sp); __get_user(env->pc, &sf->uc.tuc_mcontext.pc); __get_user(pstate, &sf->uc.tuc_mcontext.pstate); - pstate_write(env, pstate); + restore_state_from_spsr(env, pstate); __get_user(magic, &aux->fpsimd.head.magic); __get_user(size, &aux->fpsimd.head.size); diff --git a/target-arm/gdbstub64.c b/target-arm/gdbstub64.c index 76d1b91..366335a 100644 --- a/target-arm/gdbstub64.c +++ b/target-arm/gdbstub64.c @@ -63,7 +63,7 @@ int aarch64_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) return 8; case 33: /* SPSR */ - pstate_write(env, tmp); + restore_state_from_spsr(env, tmp); return 4; } /* Unknown register. */ diff --git a/target-arm/helper-a64.c b/target-arm/helper-a64.c index 03cd64f..990b084 100644 --- a/target-arm/helper-a64.c +++ b/target-arm/helper-a64.c @@ -507,9 +507,8 @@ void aarch64_cpu_do_interrupt(CPUState *cs) env->condexec_bits = 0; } - // TODO: restore_state_from_spsr() - env->aarch64 = 1; - pstate_write(env, PSTATE_DAIF | PSTATE_MODE_EL1h); + /* start IRQ with a clean program state */ + restore_state_from_spsr(env, PSTATE_DAIF | PSTATE_MODE_EL1h); env->pc = addr; cs->interrupt_request |= CPU_INTERRUPT_EXITTB; diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c index eaf6ff8..7a022a6 100644 --- a/target-arm/kvm64.c +++ b/target-arm/kvm64.c @@ -230,7 +230,7 @@ int kvm_arch_get_registers(CPUState *cs) if (ret) { return ret; } - pstate_write(env, val); + restore_state_from_spsr(env, val); /* KVM puts SP_EL0 in regs.sp and SP_EL1 in regs.sp_el1. On the * QEMU side we keep the current SP in xregs[31] as well.