From nobody Fri May 17 16:55:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554402332514346.6937033739101; Thu, 4 Apr 2019 11:25:32 -0700 (PDT) Received: from localhost ([127.0.0.1]:58376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC73I-0002za-D1 for importer@patchew.org; Thu, 04 Apr 2019 14:25:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC71r-000211-I1 for qemu-devel@nongnu.org; Thu, 04 Apr 2019 14:24:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hC6tc-0007dv-4m for qemu-devel@nongnu.org; Thu, 04 Apr 2019 14:15:29 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:28835) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hC6tb-0007ZM-LS; Thu, 04 Apr 2019 14:15:28 -0400 Received: from mail-cys01nam02lp2059.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([104.47.37.59]) by ob1.hgst.iphmx.com with ESMTP; 05 Apr 2019 02:15:25 +0800 Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5653.namprd04.prod.outlook.com (20.179.56.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.16; Thu, 4 Apr 2019 18:15:23 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::44e8:bd21:17b:348c]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::44e8:bd21:17b:348c%4]) with mapi id 15.20.1750.014; Thu, 4 Apr 2019 18:15:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554401728; x=1585937728; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=79pbO0GbeBAVTnws1xxyh7pFWGBGiUs30qislFg0vv4=; b=qwUuTXTrBaBc5I0wk/WjA1q9VWNmsk8h69zeJ1zWwy1VCoPydqeePXvD 9HGSLLeKQEjZZkOfksFdtd48xpEfZAtMCTZ2n0tudTJ+9+e+KLwTuq+7q XIKtGmd6+WLdhTjdvyaMmKdUnmNgrWQVB0BcUso1ROsPxLOUaFVy6+0vd fqzjk5Nq5ketGZGkytDsBYCvTMzuJP0fDgSkvnEsW9/+lqcB6oauJnZ6T 0ikLWdkTHSw4xQNnNYoxYTG5/vxRbxHV1x5K88oauz73nmhdNmt32N2+H Mi8uV8rhT2uYSez4CSgHRbdeC0pyTKnLSihwoZ2hw3bmO/jsWxfGwNZn7 w==; X-IronPort-AV: E=Sophos;i="5.60,309,1549900800"; d="scan'208";a="106375608" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=79pbO0GbeBAVTnws1xxyh7pFWGBGiUs30qislFg0vv4=; b=mzn6DW5lIJHFUI9/44PNMH5zzIq6Atf/0H8fVNfOqNPejJ+NGcVR+I6/r310RwbIYfznF18wzGkRI9T6Wz0eUUrlDJRrTS0RuvQW/cjnn2LdTOzwkuxempOH0pIBPnz2Sf7IGaYXR6r/4v+M60xj949uP9/JiyuaupgfrAC1r9s= From: Alistair Francis To: "qemu-devel@nongnu.org" , "qemu-riscv@nongnu.org" Thread-Topic: [PATCH for 4.0 v3 1/2] riscv: plic: Fix incorrect irq calculation Thread-Index: AQHU6xJeGL9ISzjuS0aO7FKdCXPRVg== Date: Thu, 4 Apr 2019 18:15:23 +0000 Message-ID: <6f18d167026f523a6dbfc74699abec62598f7c0b.1554401615.git.alistair.francis@wdc.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR21CA0012.namprd21.prod.outlook.com (2603:10b6:a03:114::22) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5e8f4ff7-93d1-4e82-117a-08d6b929813b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5653; x-ms-traffictypediagnostic: BYAPR04MB5653: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(136003)(366004)(346002)(376002)(39860400002)(189003)(199004)(5660300002)(6486002)(3846002)(6116002)(68736007)(50226002)(6436002)(2906002)(118296001)(316002)(54906003)(2616005)(110136005)(36756003)(8936002)(11346002)(446003)(486006)(476003)(14444005)(44832011)(256004)(305945005)(7736002)(105586002)(478600001)(106356001)(66066001)(25786009)(72206003)(8676002)(81166006)(81156014)(71200400001)(71190400001)(2501003)(97736004)(6506007)(102836004)(386003)(6512007)(52116002)(14454004)(53936002)(99286004)(76176011)(186003)(4326008)(86362001)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5653; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: fsc23pLel3svtZvqbe7zLQReh8k6OOwl4gqB8f9BDY+CCNBOZ2R9NqPA6IbQ6F55ddSQvjCNNjX+ZQqw82nUZ7MhXseiXFMnGcITOBOrHPWj8M4czG4BD+0oXEuIvzQsvBCsO+ve80G92lOaGKxJV+Y7NIySBUWTlXzRniHg3rqy6/xVjEn2cZ0ULKTVRb0xTkSFOQ1dgxNcL9hkSmJkmmayzTw9fxtbP3awRqyZKDrj1IFmnZ5mMLIqg1nlepJE/Mjn8E9EontlGelBjjscdXk+8Frb2/d/FeYbJfl50HeWE9e0aI97k2L49+g7jSXcaKoGoexg7nBG7AIjOz+pU+iEfISruZmp4rBLo5mo1tXYOHQ455ctmfAZMidQaeFlKgVQvU4zn7Vri/mPvQqhBrP1ExMvgImZhN/oiunuoes= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e8f4ff7-93d1-4e82-117a-08d6b929813b X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 18:15:23.4414 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5653 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.153.144 Subject: [Qemu-devel] [PATCH for 4.0 v3 1/2] riscv: plic: Fix incorrect irq calculation 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: "alistair23@gmail.com" , "palmer@sifive.com" , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 2 invalid signatures) This patch fixes four different things, to maintain bisectability they have been merged into a single patch. The following fixes are below: sifive_plic: Fix incorrect irq calculation The irq is incorrectly calculated to be off by one. It has worked in the past as the priority_base offset has also been set incorrectly. We are about to fix the priority_base offset so first first the irq calculation. sifive_u: Fix PLIC priority base offset and numbering According to the FU540 manual the PLIC source priority address starts at an offset of 0x04 and not 0x00. The same manual also specifies that the PLIC only has 53 source priorities. Fix these two incorrect header files. We also need to over extend the plic_gpios[] array as the PLIC sources count from 1 and not 0. riscv: sifive_e: Fix PLIC priority base offset According to the FE31 manual the PLIC source priority address starts at an offset of 0x04 and not 0x00. riscv: virt: Fix PLIC priority base offset Update the virt offsets based on the newly updated SiFive U and SiFive E offsets. Signed-off-by: Alistair Francis --- hw/riscv/sifive_plic.c | 4 ++-- include/hw/riscv/sifive_e.h | 2 +- include/hw/riscv/sifive_u.h | 4 ++-- include/hw/riscv/virt.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c index ac768e6c27..0315e035e5 100644 --- a/hw/riscv/sifive_plic.c +++ b/hw/riscv/sifive_plic.c @@ -207,7 +207,7 @@ static uint64_t sifive_plic_read(void *opaque, hwaddr a= ddr, unsigned size) if (addr >=3D plic->priority_base && /* 4 bytes per source */ addr < plic->priority_base + (plic->num_sources << 2)) { - uint32_t irq =3D (addr - plic->priority_base) >> 2; + uint32_t irq =3D ((addr - plic->priority_base) >> 2) + 1; if (RISCV_DEBUG_PLIC) { qemu_log("plic: read priority: irq=3D%d priority=3D%d\n", irq, plic->source_priority[irq]); @@ -280,7 +280,7 @@ static void sifive_plic_write(void *opaque, hwaddr addr= , uint64_t value, if (addr >=3D plic->priority_base && /* 4 bytes per source */ addr < plic->priority_base + (plic->num_sources << 2)) { - uint32_t irq =3D (addr - plic->priority_base) >> 2; + uint32_t irq =3D ((addr - plic->priority_base) >> 2) + 1; plic->source_priority[irq] =3D value & 7; if (RISCV_DEBUG_PLIC) { qemu_log("plic: write priority: irq=3D%d priority=3D%d\n", diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h index 7b6d8aed96..f715f8606f 100644 --- a/include/hw/riscv/sifive_e.h +++ b/include/hw/riscv/sifive_e.h @@ -70,7 +70,7 @@ enum { #define SIFIVE_E_PLIC_HART_CONFIG "M" #define SIFIVE_E_PLIC_NUM_SOURCES 127 #define SIFIVE_E_PLIC_NUM_PRIORITIES 7 -#define SIFIVE_E_PLIC_PRIORITY_BASE 0x0 +#define SIFIVE_E_PLIC_PRIORITY_BASE 0x04 #define SIFIVE_E_PLIC_PENDING_BASE 0x1000 #define SIFIVE_E_PLIC_ENABLE_BASE 0x2000 #define SIFIVE_E_PLIC_ENABLE_STRIDE 0x80 diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index be13cc1304..892f0eee21 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -68,9 +68,9 @@ enum { }; =20 #define SIFIVE_U_PLIC_HART_CONFIG "MS" -#define SIFIVE_U_PLIC_NUM_SOURCES 127 +#define SIFIVE_U_PLIC_NUM_SOURCES 54 #define SIFIVE_U_PLIC_NUM_PRIORITIES 7 -#define SIFIVE_U_PLIC_PRIORITY_BASE 0x0 +#define SIFIVE_U_PLIC_PRIORITY_BASE 0x04 #define SIFIVE_U_PLIC_PENDING_BASE 0x1000 #define SIFIVE_U_PLIC_ENABLE_BASE 0x2000 #define SIFIVE_U_PLIC_ENABLE_STRIDE 0x80 diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index f12deaebd6..568764b570 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -59,7 +59,7 @@ enum { #define VIRT_PLIC_HART_CONFIG "MS" #define VIRT_PLIC_NUM_SOURCES 127 #define VIRT_PLIC_NUM_PRIORITIES 7 -#define VIRT_PLIC_PRIORITY_BASE 0x0 +#define VIRT_PLIC_PRIORITY_BASE 0x04 #define VIRT_PLIC_PENDING_BASE 0x1000 #define VIRT_PLIC_ENABLE_BASE 0x2000 #define VIRT_PLIC_ENABLE_STRIDE 0x80 --=20 2.21.0 From nobody Fri May 17 16:55:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554402507131178.30282738479548; Thu, 4 Apr 2019 11:28:27 -0700 (PDT) Received: from localhost ([127.0.0.1]:58420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC768-0005GV-6P for importer@patchew.org; Thu, 04 Apr 2019 14:28:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC71q-000211-G2 for qemu-devel@nongnu.org; Thu, 04 Apr 2019 14:23:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hC6tv-0007yD-Nw for qemu-devel@nongnu.org; Thu, 04 Apr 2019 14:15:48 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:28856) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hC6tv-0007x9-9B; Thu, 04 Apr 2019 14:15:47 -0400 Received: from mail-cys01nam02lp2053.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([104.47.37.53]) by ob1.hgst.iphmx.com with ESMTP; 05 Apr 2019 02:15:36 +0800 Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5653.namprd04.prod.outlook.com (20.179.56.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.16; Thu, 4 Apr 2019 18:15:34 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::44e8:bd21:17b:348c]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::44e8:bd21:17b:348c%4]) with mapi id 15.20.1750.014; Thu, 4 Apr 2019 18:15:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554401747; x=1585937747; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Et928z5/Pkkajrx+6BIahBUKil/AKJwhi5dv5cM6fY0=; b=Qa7CfoRaEN0jAufeP97hrKeppLkzSXYLgggnE4cYpUrM+l7LiJjZzPO6 GbhN5cXuae6W4/Q9f3pVv7zm2RbOUal44gyjGZ5IaaSYW/lZ3Xfr15o1o /1PbKRZA+9jPYy4DsnVR5OzdxN5BpXF83vjNqUpHkHjozI+mYnRgREHyX FlzwPZN2U2h4GHBk9hhjcjz4rmFIf588xPIX9VQ918zuLiESsV1Lhy0qX +/D0moo8pwXbveUgU73mkhhmrYSqoECn/Mrny6R52W1LagjaxU5nM9Wgu sM/aV5oy7r1sLBarhdPdpUNr1UmK0FDpdx2qEGZbulV2HeFP/G/nwvmyy w==; X-IronPort-AV: E=Sophos;i="5.60,309,1549900800"; d="scan'208";a="106375664" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Et928z5/Pkkajrx+6BIahBUKil/AKJwhi5dv5cM6fY0=; b=YgkQL/vxjJvsf9WNcC5gqsut+oPq2VaAo1Gun5cuk7LJ4aM0W4BXRyhMmP7hXx4iieGQ5yA+IrGUKe1ayaifmAU6avrQcnIu8yUCBMYprhvLfcBzYpA4nJMngcZCTCIQD+cP+EhWyhu+ZwEpRq1RkeNcdOSAneYagtDuX3mu/2c= From: Alistair Francis To: "qemu-devel@nongnu.org" , "qemu-riscv@nongnu.org" Thread-Topic: [PATCH for 4.0 v3 2/2] riscv: plic: Log guest errors Thread-Index: AQHU6xJl/qUPGmN15EuQUWtOuLCBlA== Date: Thu, 4 Apr 2019 18:15:34 +0000 Message-ID: <5a5be6c3ae42d8c585f221eb60995310ffee4103.1554401615.git.alistair.francis@wdc.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR02CA0007.namprd02.prod.outlook.com (2603:10b6:a02:ee::20) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.45.63] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2b922f3e-71fa-4058-0bac-08d6b92987dd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB5653; x-ms-traffictypediagnostic: BYAPR04MB5653: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(136003)(366004)(346002)(376002)(39860400002)(189003)(199004)(5660300002)(6486002)(3846002)(6116002)(68736007)(50226002)(6436002)(2906002)(118296001)(316002)(54906003)(2616005)(110136005)(36756003)(8936002)(11346002)(446003)(486006)(476003)(14444005)(44832011)(256004)(305945005)(7736002)(105586002)(478600001)(106356001)(66066001)(25786009)(72206003)(8676002)(81166006)(81156014)(71200400001)(71190400001)(2501003)(97736004)(6506007)(102836004)(386003)(6512007)(52116002)(14454004)(53936002)(99286004)(76176011)(186003)(4326008)(86362001)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5653; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: qw4gQCN0cbbwjiXViMRSqwOWHWMte/oKFHLUomvBVwzQQmQC38NXGcKpatq6xm3AbusuJxHL5OPR7+wlra+YT58VNWV4P/B9EbZ9CD4SydjljvJXHpLyTNOdl/PUcOabskq9keVnvpVVULqBEFrLwzRrutsHS7xpisplh8eYjNduvCh/MgeG7Sfy6uPpOFqfW0xL83TgsiJEMppRiv+VHOb6pt55gJAlJhMgBYqC6qXShcDM2fCiQC/2i1w/nIn1niq9Q8fEJNmTV85miJgmV3V0Goz5H9Jpj4fbKUNVIztbs4ORhUlZUAk0LkeH4f2TTO2xxCGcHvo7HCu207lrNptsHZXbvl22+A5o7QVSMcSuPA6SDtkxazkcyrlKkUo5TNxT9rFvCwIUkyS7/75RgfYjIZ94UMieexaKyU4BClk= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b922f3e-71fa-4058-0bac-08d6b92987dd X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 18:15:34.6674 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5653 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.153.144 Subject: [Qemu-devel] [PATCH for 4.0 v3 2/2] riscv: plic: Log guest errors 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: "alistair23@gmail.com" , "palmer@sifive.com" , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 2 invalid signatures) Instead of using error_report() to print guest errors let's use qemu_log_mask(LOG_GUEST_ERROR,...) to log the error. Signed-off-by: Alistair Francis --- hw/riscv/sifive_plic.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c index 0315e035e5..07a032d93d 100644 --- a/hw/riscv/sifive_plic.c +++ b/hw/riscv/sifive_plic.c @@ -263,7 +263,9 @@ static uint64_t sifive_plic_read(void *opaque, hwaddr a= ddr, unsigned size) } =20 err: - error_report("plic: invalid register read: %08x", (uint32_t)addr); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Invalid register read 0x%" HWADDR_PRIx "\n", + __func__, addr); return 0; } =20 @@ -290,7 +292,9 @@ static void sifive_plic_write(void *opaque, hwaddr addr= , uint64_t value, } else if (addr >=3D plic->pending_base && /* 1 bit per source */ addr < plic->pending_base + (plic->num_sources >> 3)) { - error_report("plic: invalid pending write: %08x", (uint32_t)addr); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: invalid pending write: 0x%" HWADDR_PRIx "", + __func__, addr); return; } else if (addr >=3D plic->enable_base && /* 1 bit per source */ addr < plic->enable_base + plic->num_addrs * plic->enable_stride) @@ -340,7 +344,9 @@ static void sifive_plic_write(void *opaque, hwaddr addr= , uint64_t value, } =20 err: - error_report("plic: invalid register write: %08x", (uint32_t)addr); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Invalid register write 0x%" HWADDR_PRIx "\n", + __func__, addr); } =20 static const MemoryRegionOps sifive_plic_ops =3D { --=20 2.21.0