From patchwork Wed Oct 23 15:00:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177317 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp901574ill; Wed, 23 Oct 2019 08:43:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz36RzbsSL5SnUUPxDyXuFJ5p7+8PUF3AfHyRwjz/AbfO42uJpBqDUgdXnnxGg1oQdD22Sf X-Received: by 2002:ac8:2653:: with SMTP id v19mr9963502qtv.278.1571845402560; Wed, 23 Oct 2019 08:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571845402; cv=none; d=google.com; s=arc-20160816; b=eM0ey40M2sNKZB9y3tpH32VP/cspKrzFqQ2icTe3mo5suG+Qzno5PjsP/cYksB2VTv L40c+QuPJ4HUmFjfsthWqeRDCXIyI0QtjJZA+Mikxwx+dlH3ISZzmFGzJ8LvA95yXyOw pV2VePSM3mjGKV6eTC/tqtNZ9HmqgtY+o9q3hVT1wRDU6DcLfdr4UhLRnBjAHGMacpQS WsR118CiUKmvdwjPCC1RJ2eqOL+SN9qBcFtImHCCXV7EZ4hoSEA73qUcMu8Vd+/Rk8pq qVKnp1TfBY/C0lAgxzxJma/DvQjCK4EcDnsxKKUKQOZ5M/MupwPbIupVZ88q8Nx9nBaN NpEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=X22okviioTNDt7zI04Hhn7/Ba9cdRHpUwnG0LrTV7qc=; b=GG5MoSSmmx1JGgdCiQnKxQOn9wNv1K9XWv/Z4Qa5CxUdLZmbYhJF8h1Xc66z5ce/Za 4jThaDn6gBbApciBetpikrh58hQ5Cn8A/WfUt75v9M7n2DU1gUJ111cqm+pPWZEMPeOA 7KlPb+lKDkMZ2wvnFsXNoedf3k174KPWPKliXZCtiNFS9pCaV9IrLSwbXojiAlAndF+t h+HK3tnq/hR+rKYKLKUWB/VgjlXTyfPwubcWjMGcXz5iFbb3fxCIQN+FUCq0uug59C4l 3Do42BuN+2iKSFANLaLuiqNg4xfuZNU9YgUbW91UbSSQ1p3Y3WnElUqUTsshRkyLWrcb b7wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W7hUYkvB; 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 o22si10417777qvh.30.2019.10.23.08.43.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Oct 2019 08:43:22 -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=W7hUYkvB; 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]:39754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNInB-0002gT-Ct for patch@linaro.org; Wed, 23 Oct 2019 11:43:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35406) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNI8x-0008F7-08 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNI8s-0001Ic-BS for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:46 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:40482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNI8s-0001BC-1G for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:42 -0400 Received: by mail-qt1-x844.google.com with SMTP id o49so24899748qta.7 for ; Wed, 23 Oct 2019 08:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X22okviioTNDt7zI04Hhn7/Ba9cdRHpUwnG0LrTV7qc=; b=W7hUYkvBV4U84FkGgu5j4qdKyHLytPYVaAmgc1TcoF7kDY+hBgJktlSMHu+sOn8g8v 6j2aDHaY00/K32dfJPL8WYfJtG4JCQ3olPYZFb+7LrS6dlWB7SXkMRgIHCj9mebasoL3 nvSC2yN9Lsu+cyPMophx5upiL8QYj2jR0y9R7/xk49LkWcVJv0UDchl71MIj74mUk2HL GJVCqsBeYj4ytI5c8gMrf2CcO6NkTvHJ6e+eNrQq7m03xCHMOs1/5RVkH8YzxB07hI3i UFQSIbaqNeJALnezQuP1x8/VT1Xv51oTQswEnCSpxJScLmL+00Ykn81brw/Z821lJMKZ Ftyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X22okviioTNDt7zI04Hhn7/Ba9cdRHpUwnG0LrTV7qc=; b=iVbz34qPHy+poOgbzXhKsrmI40gtO5VoQnHnFrohudynp7Wj26z3d3nYX/2i8K+7Ox /y3Jonlrrg4nm3MbcMBKeNC3lgfJEg6J1n2X3Z6pwLia179BHu1rAmz8YuCaG8SoyDfD 2c747v/joNZZ1xYz8YYRKyE8hP/xbyM9YBZp6ZHbYceaiuyM13qqQ9Pn0y8srfzZ/Mqq a2ymdexCXo6DbWAWBkmRUfxVDL+h7j20dVGlTRyD+2xswRTK/OVC3/tXpKONJ2yrYQCN igXkWnr6Gs6NBedmTIqE0GJiErRLOLSTRy9lGwFBXgLEBdfHxEXURGVxu+X5ovaniKym 15Kg== X-Gm-Message-State: APjAAAXbagvgJozcISCl5kSUB5U8Htk/GwjKX2VsbYOTrHIHGWlzkC0V J3i1LndJkvQYT+BhGAr+5Cx3bRiBXuw= X-Received: by 2002:ac8:1194:: with SMTP id d20mr9752190qtj.275.1571842890760; Wed, 23 Oct 2019 08:01:30 -0700 (PDT) Received: from localhost.localdomain (198-4-20-64.static.cosmoweb.net. [64.20.4.198]) by smtp.gmail.com with ESMTPSA id l189sm11030168qke.69.2019.10.23.08.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 08:01:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v9 21/24] target/arm: Rebuild hflags for M-profile NVIC Date: Wed, 23 Oct 2019 11:00:54 -0400 Message-Id: <20191023150057.25731-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023150057.25731-1-richard.henderson@linaro.org> References: <20191023150057.25731-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Continue setting, but not relying upon, env->hflags. Suggested-by: Peter Maydell Signed-off-by: Richard Henderson --- hw/intc/armv7m_nvic.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 8e93e51e81..e8c74f9eba 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; }