From patchwork Sun Dec 22 22:50:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22714 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 95FDC202A0 for ; Sun, 22 Dec 2013 22:50:21 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf20593622obc.8 for ; Sun, 22 Dec 2013 14:50:20 -0800 (PST) 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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=qusTW3cg2XaFb8uBM+i+lnzhTtDYlR6dM7Ixg9Takqo=; b=QY4QlAosENdGAn4gjXPXBmVBUdlZhSbZ7WgPzZSMQfj7Zq/SoIPpVXO+OXLy7fnCRy vmf8+nSPG4PrfsvwkGc5D0vfzswir3zxWc08kfdSVpUO0c0uoKRPKDBd6/jRYunMglJo iv7sTLmJogHXJMx4c5gXP6PM1YAlqlI2vLzuoUpFb731vYSh4DsoEtvWp+uEoCqbCDnE f+9ItOoHpMHgFBFG0f1qjgTtcXClTTeECfbh+JVH1C9j6adYSNu3EqnoKbBQWtIAnH+9 h9ep5twDSe3V2z90i3H9A23/xA21kenPvz2h2B2vYTe+M2Rj+ZaoCEd2VLaip+w/39pU uFpw== X-Gm-Message-State: ALoCoQmREG6NM4Y5EqEmKjbxfLVOgPn/WbYTQT5r7+HrzyzPSWdlifjj68j9v36lGPBPZkdc30ef X-Received: by 10.182.19.164 with SMTP id g4mr8769708obe.21.1387752620685; Sun, 22 Dec 2013 14:50:20 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.234 with SMTP id a10ls1396279qed.92.gmail; Sun, 22 Dec 2013 14:50:20 -0800 (PST) X-Received: by 10.52.175.6 with SMTP id bw6mr88405vdc.48.1387752620589; Sun, 22 Dec 2013 14:50:20 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id ti3si4046164vdc.67.2013.12.22.14.50.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Dec 2013 14:50:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jw12so2636265veb.3 for ; Sun, 22 Dec 2013 14:50:20 -0800 (PST) X-Received: by 10.220.127.68 with SMTP id f4mr221113vcs.32.1387752620523; Sun, 22 Dec 2013 14:50:20 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp193905ved; Sun, 22 Dec 2013 14:50:20 -0800 (PST) X-Received: by 10.152.28.230 with SMTP id e6mr9138548lah.3.1387752615016; Sun, 22 Dec 2013 14:50:15 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id ww4si7309638lbb.147.2013.12.22.14.50.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 22 Dec 2013 14:50:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Vurqb-0006D6-1f; Sun, 22 Dec 2013 22:50:09 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite Subject: [PATCH v2 23/25] linux-user: AArch64: Use correct values for FPSR/FPCR in sigcontext Date: Sun, 22 Dec 2013 22:50:05 +0000 Message-Id: <1387752607-23755-24-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387752607-23755-1-git-send-email-peter.maydell@linaro.org> References: <1387752607-23755-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Will Newton Use the helpers provided for getting the correct FPSR and FPCR values for the signal context. Signed-off-by: Will Newton Signed-off-by: Peter Maydell --- linux-user/signal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 4e7148a..6c74b18 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1189,8 +1189,8 @@ static int target_setup_sigframe(struct target_rt_sigframe *sf, __put_user(env->vfp.regs[i * 2 + 1], &aux->fpsimd.vregs[i * 2 + 1]); #endif } - __put_user(/*env->fpsr*/0, &aux->fpsimd.fpsr); - __put_user(/*env->fpcr*/0, &aux->fpsimd.fpcr); + __put_user(vfp_get_fpsr(env), &aux->fpsimd.fpsr); + __put_user(vfp_get_fpcr(env), &aux->fpsimd.fpcr); __put_user(TARGET_FPSIMD_MAGIC, &aux->fpsimd.head.magic); __put_user(sizeof(struct target_fpsimd_context), &aux->fpsimd.head.size); @@ -1209,7 +1209,7 @@ static int target_restore_sigframe(CPUARMState *env, int i; struct target_aux_context *aux = (struct target_aux_context *)sf->uc.tuc_mcontext.__reserved; - uint32_t magic, size; + uint32_t magic, size, fpsr, fpcr; uint64_t pstate; target_to_host_sigset(&set, &sf->uc.tuc_sigmask); @@ -1235,6 +1235,10 @@ static int target_restore_sigframe(CPUARMState *env, for (i = 0; i < 32 * 2; i++) { __get_user(env->vfp.regs[i], &aux->fpsimd.vregs[i]); } + __get_user(fpsr, &aux->fpsimd.fpsr); + vfp_set_fpsr(env, fpsr); + __get_user(fpcr, &aux->fpsimd.fpcr); + vfp_set_fpcr(env, fpcr); return 0; }