From patchwork Thu Oct 24 16:26:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 177570 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2468062ill; Thu, 24 Oct 2019 10:04:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqcEZdB+iMtTjqS7RnjX5d8jbCscHc4XXG7GmOdwOyUZcUUki0OrH+9RXfkzDA4QK8+iAX X-Received: by 2002:a17:906:1f44:: with SMTP id d4mr38255649ejk.16.1571936659511; Thu, 24 Oct 2019 10:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571936659; cv=none; d=google.com; s=arc-20160816; b=Q4lTqVqDvytc5rg4wI/bzzZNVx7t2/cyUqRAIiHl21z1Gu4Hxl0dOJGyqiUpK0n33k tcTNSrlSwYf8fy8q87WeZFgnH0S58tKUW110yBQHMveWz0G5IewrbGyMWU5W8m3rcC9o KdUhda6wmTQ7M1iFWxMYLq/gbFFXTUmZZZozPR13eJIU3shVgHx+D68JTwwBLWUs3qbE mBddvQ8qo0goO0sJdC31+0dDRKqHL0J+aJhWjr1L/QDcPZVWjR4sNdqNxAJow366YpMV 2dWQzfqrLNHgsjyNCQbZDsesULjS7RkfXKsPRoBbyHiZZdhmH05HiB3on5Xj7Nx6Xu2Q qwxQ== 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=AY2/tIXkLZV7yrWE3pOZo6OjdcTvWP16EPP+NMcPWOY=; b=QAWxllBxO90+qDIYUEoauqIu+qmplb8Ig4OJDlY07Esgsn+rYAtQszgBVisVzfOOst WtbWUPW3i4QlF4ohEczrajmT3FCg1e1olCrCF8xfePkg9Mli27ZA1XR0gYKPYhnP+shO 424RPrjhGFaryUiXbVqI+0IrELxNJl7MwYHDmM8+5QD0UjZjLFqA/pIQpX5qrTOAQG1d Y6skeifEZzx7bu0qhWq50r/uWwah40sP9QkE0SIUMhYm8c1Td9fEV/y72u54N2lFWjig J+KMarMHbmcSBx2ZG2PCAhlR3dFQffpmL50v2KZCCBggDzMTo2X3WNegHAGk7d6SCdfW FmUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rcKcYb4Q; 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 f12si9025729edc.1.2019.10.24.10.04.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 10:04:19 -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=rcKcYb4Q; 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]:48248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNgX3-0005Gr-MM for patch@linaro.org; Thu, 24 Oct 2019 13:04:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57986) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNfxv-0007cI-MP for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:28:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNfxt-0000rI-Dl for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:58 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:39153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNfxt-0000qo-7a for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:57 -0400 Received: by mail-wm1-x341.google.com with SMTP id r141so3206480wme.4 for ; Thu, 24 Oct 2019 09:27:57 -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=AY2/tIXkLZV7yrWE3pOZo6OjdcTvWP16EPP+NMcPWOY=; b=rcKcYb4Q/C6aJJS7RCxWq/1+9rYHncrV6q41sNHFI/21mW++j72hExwaa4beHA0AA3 Gu/SbVrRB4T983waVo533cEl0BSpGEQlDk6I/D2vAaTMmo/evCpadKor5vYzVsD+ybRA 5cVsEafLhmYPQZsineSASfQiodZVhWCWHZZhD78TEnuY1ioY9d3pai5e64MwqA0UorLN a98YK5giwQf+3q+MHRWdttSvg6PMvGuHAjQkrrY9VGyX/LufVwxnk0+lUaJQT8CG5wSk RH9oYavr+37dRDiTQqS724yGmZfeJE8SydO9ey4shwVZI5CHsNJgms9lNTO4v+pjIt47 l2Dg== 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=AY2/tIXkLZV7yrWE3pOZo6OjdcTvWP16EPP+NMcPWOY=; b=GLXAPiEunqo6QTx7gf7zY3iX6oWfzmZrfcOsXgzK7eybwxlFPhPYdYqGNkrleYMQHy 29TRDfoYe720z7VppAp0t5WHcogUC2RtP17rwbBjwgzv3Y1k+2hixaSIIwD26roQQ2tr /B/A39Tv9QhlfScrxWzeSIDS5NsdQAqnjeMp0H8V1WRbzWpiQBv1IHQhhatg7Aick1vs e9cQ5rl7gpn+5LBgAsVV8V1oeDl9UnnVidgGiomzgDeKCnFeOuKbdp+cXAD8vJ3mca5F qFCHVjvwgrnQbp/Rl4cuNsxXFgt0gz8dyjzJ9rhgTe9bjLEfxQ71KQ3P5bDc1e7oV8/i Qhmg== X-Gm-Message-State: APjAAAWupHZm1ExQ4JHA5d29Dh8uCIV64t035Z9yH6r1LGi3j3YYZSRY OMJh2dBbbY+uuOPoi82TouZ3N50ryQk= X-Received: by 2002:a1c:39c1:: with SMTP id g184mr5688761wma.75.1571934475889; Thu, 24 Oct 2019 09:27:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r27sm42606124wrc.55.2019.10.24.09.27.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:27:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/51] target/arm: Rebuild hflags for M-profile NVIC Date: Thu, 24 Oct 2019 17:26:56 +0100 Message-Id: <20191024162724.31675-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191024162724.31675-1-peter.maydell@linaro.org> References: <20191024162724.31675-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: Richard Henderson Continue setting, but not relying upon, env->hflags. Suggested-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20191023150057.25731-22-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- hw/intc/armv7m_nvic.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 8e93e51e815..e8c74f9ebaf 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -2251,7 +2251,7 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, } } nvic_irq_update(s); - return MEMTX_OK; + goto exit_ok; case 0x200 ... 0x23f: /* NVIC Set pend */ /* the special logic in armv7m_nvic_set_pending() * is not needed since IRQs are never escalated @@ -2269,9 +2269,9 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, } } nvic_irq_update(s); - return MEMTX_OK; + goto exit_ok; case 0x300 ... 0x33f: /* NVIC Active */ - return MEMTX_OK; /* R/O */ + goto exit_ok; /* R/O */ case 0x400 ... 0x5ef: /* NVIC Priority */ startvec = (offset - 0x400) + NVIC_FIRST_IRQ; /* vector # */ @@ -2281,10 +2281,10 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, } } nvic_irq_update(s); - return MEMTX_OK; + goto exit_ok; case 0xd18 ... 0xd1b: /* System Handler Priority (SHPR1) */ if (!arm_feature(&s->cpu->env, ARM_FEATURE_M_MAIN)) { - return MEMTX_OK; + goto exit_ok; } /* fall through */ case 0xd1c ... 0xd23: /* System Handler Priority (SHPR2, SHPR3) */ @@ -2299,10 +2299,10 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, set_prio(s, hdlidx, sbank, newprio); } nvic_irq_update(s); - return MEMTX_OK; + goto exit_ok; case 0xd28 ... 0xd2b: /* Configurable Fault Status (CFSR) */ if (!arm_feature(&s->cpu->env, ARM_FEATURE_M_MAIN)) { - return MEMTX_OK; + goto exit_ok; } /* All bits are W1C, so construct 32 bit value with 0s in * the parts not written by the access size @@ -2322,15 +2322,19 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, */ s->cpu->env.v7m.cfsr[M_REG_NS] &= ~(value & R_V7M_CFSR_BFSR_MASK); } - return MEMTX_OK; + goto exit_ok; } if (size == 4) { nvic_writel(s, offset, value, attrs); - return MEMTX_OK; + goto exit_ok; } qemu_log_mask(LOG_GUEST_ERROR, "NVIC: Bad write of size %d at offset 0x%x\n", size, offset); /* This is UNPREDICTABLE; treat as RAZ/WI */ + + exit_ok: + /* Ensure any changes made are reflected in the cached hflags. */ + arm_rebuild_hflags(&s->cpu->env); return MEMTX_OK; }