From nobody Sun Apr 28 12:22:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 148818362987410.454216126005463; Mon, 27 Feb 2017 00:20:29 -0800 (PST) Received: from localhost ([::1]:50980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciGXj-0006Rj-5C for importer@patchew.org; Mon, 27 Feb 2017 03:20:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciGWh-00068Y-19 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 03:19:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciGWb-00006F-Vn for qemu-devel@nongnu.org; Mon, 27 Feb 2017 03:19:22 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::5]:36983) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciGWb-00005z-Lo for qemu-devel@nongnu.org; Mon, 27 Feb 2017 03:19:17 -0500 Received: from oxapp02-01.back.ox.d0m.de (com4.strato.de [81.169.145.237]) by smtp-ox.front (RZmta 39.13 AUTH) with ESMTPSA id I02aadt1R8FuwMm (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Mon, 27 Feb 2017 09:15:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1488183555; l=728; s=domk; d=brightwise.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc:To: From:Date; bh=YJPCEjvT/L8pGgqWz7qq1TBNgBmGQtMoY6/Ms+o0KAo=; b=ODFkelE1vSy8ba4geP04jS45YI0wPRQkJjuUbFkgBONo8Y7GDD5O2vL2wgvohc+9c/ rTiP2fK4fYA92qXONZi6zsghuU3xNbJd+3pN3BTl7V+0U2lIS+ccWmlg8z5JLJm/650A rcPa/RGv8t4DW0u1MP/UujpEjDcBK7SZdF3sE= X-RZG-AUTH: :IW0WdmCqafYHpw3VzoDcDCGus5Hbx7huq/HoB046EkhOK032THZrVXuR8HXF X-RZG-CLASS-ID: mo00 Date: Mon, 27 Feb 2017 09:15:55 +0100 (CET) From: Marc Bommert To: qemu-devel@nongnu.org Message-ID: <492427237.68231.1488183356160@communicator.strato.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.2-Rev25 X-Originating-Client: open-xchange-appsuite X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::5 Subject: [Qemu-devel] [PATCH] pl190: Fix off-by-one error in priority handling when reading VECTADDR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The "current" priority bit (1 << i) should also be set in s->prio_mask[i], = if the interrupt is enabled. This will in turn cause the read operation of = VECTADDR to return the correct vector of the pending interrupt. --- hw/intc/pl190.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c index 55ea15d..0369da8 100644 --- a/hw/intc/pl190.c +++ b/hw/intc/pl190.c @@ -80,12 +80,12 @@ static void pl190_update_vectors(PL190State *s) mask =3D 0; for (i =3D 0; i < 16; i++) { - s->prio_mask[i] =3D mask; if (s->vect_control[i] & 0x20) { n =3D s->vect_control[i] & 0x1f; mask |=3D 1 << n; } + s->prio_mask[i] =3D mask; } s->prio_mask[16] =3D mask; pl190_update(s); -- 2.5.0