From patchwork Fri Nov 1 08:51:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 178289 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp183955ill; Fri, 1 Nov 2019 02:01:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaKAwdFczizvlAXEpyKQ1sizBuvLJLI3d2qEyqBICqMACJstYNUrUe4MdlQcjBJ+N05Cr6 X-Received: by 2002:a17:906:1f8b:: with SMTP id t11mr8548335ejr.191.1572598917429; Fri, 01 Nov 2019 02:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572598917; cv=none; d=google.com; s=arc-20160816; b=z1pitiFB21sSIZLtinhzWXgQVZ3+yiWKOGq7c7Hk7CX2EvW78pnZ+FthtxiqCgVv5H BUs26bHqik+mNETWP6+DiDZR4JEZKNEIN+VxxkQAgLkKEs0MrnATVz14gTvhoC9lX+24 Ab7kOWubUFyBclIDYhtuuB2BETMrD9ck/gQdEVBdhymmQQ40XvyLCv+MufLRBPpa42Mw gHBzklrARNVkzjnjcVZ2oHUE1vePIVkB3xorfK7+z3HhwNjxNI0J079sk2O0swJ/rdRg aa6nind1Z87J0m7RrNfDnN7M+bLaw3E1nwpkrD4+UU7EyNkHarvdwT6oZJF0xoXhJoWr V0EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Wh/QH/3UtP8gd1jgQHJ/Qv7q+ZrFPgvBOyLNaqirHw4=; b=WR/TfUALMdjlIy8sEjcioImodWvOLJQ/gSRZwihWx4hXMO0wZntEQ6HfAku1PNv25h oYjmej6KvXtVS0Eokuoi7HSZIH+V7zp4SEDEzW9zIC5EAtuu9GVrvnEQ6Qf7oqYRTSjT 8b/Xcpevipz228gO2X+4L2VfJjuX+TBPjBIk8jBxChcgsTWOMqPhlXSPthUvA7MkErkt SwlaloYMkA1e6LacUyEPhGxMpEaxv5iWMKFhg0pV4F/bAidm8BZwMSDhm8GLQ2RRs4vN uMRCc+8p33Rm3x8bxUuUvaGGVXtHIC8s0+GYzz+Y/pSMun/4MP6J6tQs5IXe6p33vp8N buAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PcWRJD+2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n27si5476683ejh.342.2019.11.01.02.01.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Nov 2019 02:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PcWRJD+2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQSoe-0003Um-8f for patch@linaro.org; Fri, 01 Nov 2019 05:01:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56599) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQSf3-0001EE-42 for qemu-devel@nongnu.org; Fri, 01 Nov 2019 04:52:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQSf1-0000qx-3H for qemu-devel@nongnu.org; Fri, 01 Nov 2019 04:52:00 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQSf0-0000d0-TO for qemu-devel@nongnu.org; Fri, 01 Nov 2019 04:51:59 -0400 Received: by mail-wm1-x341.google.com with SMTP id q130so8376472wme.2 for ; Fri, 01 Nov 2019 01:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Wh/QH/3UtP8gd1jgQHJ/Qv7q+ZrFPgvBOyLNaqirHw4=; b=PcWRJD+2t9c1RwGAyxjqMq/hHwGAencq1Rz+H1oWSHpe2aBI2Vv49/EhUt7sNMkTBu qrYeScn/sm7js4jf2JgWznQgI6ryoC8oULJeyH/keLkFYXO9g5S6mqOy6mBAFlzTr2J9 w2P7Q/JhgVhBUAXovmGrTAgpCIcpFpUPFCY0XpaL91xzXZjSsC2zcGPe4VedocwrczGj rc7hVBddwVuTHiFpI0paq/weOCjLPfRh8U5ALb4UzF12OOUKJFWqDvP+2IayzVQAj8y4 RdO47tGe+BTakUoK0Twh1PGV38pOEI05+Zu92knMLm6uzyqRZ+bpTUtL923A06kySGLf xg8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wh/QH/3UtP8gd1jgQHJ/Qv7q+ZrFPgvBOyLNaqirHw4=; b=OtQQ8iU/Mk0G5NZ9M5ahFw7T4WxilEdCpIHffsuWDgQ+MlpeMXGIjBEqJHXlHZQ7CG AmpG03hSBEm056QODIGT1gRDbeJyFsNJJisu/MdERaSfk4LW28J9yqBu5uiJ6z3n1QBY xOw1A7gq824Vf+p9SfkYVv57N02RXIcr06qtAERVd/YHbwQKgS48IiC4TkD+R3plf78q PdUQPBwBeFawt93Zc6fe6J+OUa97WE/cj0GmPHjBlG6y4J1nznbHcA6lxFzhx2doSi3B oTjzTghcZ1BT2+NlpCT9jbNztb5yZKY1r2RgjeHdYu5FUlgt1t1hbNFVzhs+uftHOVCc FUrg== X-Gm-Message-State: APjAAAUi9IAp4/pCzMakRQtkn8xAcYqfgSMP2xqD3VMY/88aaLOGmpnA /f1BGJuIZHXsG4Kozg85oA9pj2DD1NCUEc8Z X-Received: by 2002:a7b:ce0c:: with SMTP id m12mr9325256wmc.38.1572598315697; Fri, 01 Nov 2019 01:51:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d20sm8818922wra.4.2019.11.01.01.51.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 01:51:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/11] target/arm: Allow reading flags from FPSCR for M-profile Date: Fri, 1 Nov 2019 08:51:40 +0000 Message-Id: <20191101085140.5205-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191101085140.5205-1-peter.maydell@linaro.org> References: <20191101085140.5205-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" From: Christophe Lyon rt==15 is a special case when reading the flags: it means the destination is APSR. This patch avoids rejecting vmrs apsr_nzcv, fpscr as illegal instruction. Cc: qemu-stable@nongnu.org Signed-off-by: Christophe Lyon Message-id: 20191025095711.10853-1-christophe.lyon@linaro.org [PMM: updated the comment] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-vfp.inc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 9ae980bef63..85c5ef897be 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -703,9 +703,10 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) if (arm_dc_feature(s, ARM_FEATURE_M)) { /* * The only M-profile VFP vmrs/vmsr sysreg is FPSCR. - * Writes to R15 are UNPREDICTABLE; we choose to undef. + * Accesses to R15 are UNPREDICTABLE; we choose to undef. + * (FPSCR -> r15 is a special case which writes to the PSR flags.) */ - if (a->rt == 15 || a->reg != ARM_VFP_FPSCR) { + if (a->rt == 15 && (!a->l || a->reg != ARM_VFP_FPSCR)) { return false; } }