From nobody Tue Nov 11 12:52:30 2025 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1563603551; cv=none; d=zoho.com; s=zohoarc; b=Xz46EBwWMtpEBdToVrNa3BfjY7pA/+I4MpmG/6gtPz7fkF+Hp/9G4A6tVci3Yib/ubER13Kyx9yL1jO7Hn3LW66P+zh0H2X26ErH6WX0nkxHv+LEDVqW3nvH5ImugBC5CxeYT1ASeL1D3ibHzpR00HFmYtahEGrw7piqhq8nhGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563603551; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=s1XM+wB87CFfOkwpkUXy/cJjPtzX6DYVxwybzh2pRww=; b=aF3pH5Q/9TcAobycKakg1sF8PDyFIO8atk8bUjHWqTNOx5F9JWXTtNfX9wBc6msa6CyyIYUKI1M7DpTFn5a1JDwLA2f+a17PIFSJJxPTzue9jU10PR8UfprmJu1NXTedABXhEfBKcgWa9whlgx3JAmSfCyLcfoNgFE38905LhHM= ARC-Authentication-Results: i=1; mx.zoho.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156360355174190.44411480757412; Fri, 19 Jul 2019 23:19:11 -0700 (PDT) Received: from localhost ([::1]:49760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoii6-0006nM-8m for importer@patchew.org; Sat, 20 Jul 2019 02:19:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56486) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoihv-0006OS-Hy for qemu-devel@nongnu.org; Sat, 20 Jul 2019 02:19:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hoiht-0004kF-RA for qemu-devel@nongnu.org; Sat, 20 Jul 2019 02:18:59 -0400 Received: from mel.act-europe.fr ([2a02:2ab8:224:1::a0a:d2]:34535 helo=smtp.eu.adacore.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hoihs-0004iU-Ek; Sat, 20 Jul 2019 02:18:57 -0400 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 0F17B813A1; Sat, 20 Jul 2019 08:18:53 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mfMi38ftFdjn; Sat, 20 Jul 2019 08:18:53 +0200 (CEST) Received: from localhost.localdomain.localdomain (lfbn-tou-1-447-75.w86-206.abo.wanadoo.fr [86.206.4.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 499B68139F; Sat, 20 Jul 2019 08:18:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com From: KONRAD Frederic To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Sat, 20 Jul 2019 08:18:32 +0200 Message-Id: <1563603512-5914-1-git-send-email-frederic.konrad@adacore.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2a02:2ab8:224:1::a0a:d2 Subject: [Qemu-devel] [PATCH] riscv: htif: use qemu_log_mask instead of qemu_log 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: kbastian@mail.uni-paderborn.de, frederic.konrad@adacore.com, palmer@sifive.com, Alistair.Francis@wdc.com, sagark@eecs.berkeley.edu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There are some debug trace appearing when using GDB with the HTIF mapped @0: Invalid htif read: address 0000000000000002 Invalid htif read: address 0000000000000006 Invalid htif read: address 000000000000000a Invalid htif read: address 000000000000000e So don't show them unconditionally. Signed-off-by: KONRAD Frederic --- hw/riscv/riscv_htif.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c index 4f7b11d..6a8f0c2 100644 --- a/hw/riscv/riscv_htif.c +++ b/hw/riscv/riscv_htif.c @@ -119,7 +119,8 @@ static void htif_handle_tohost_write(HTIFState *htifsta= te, uint64_t val_written) int resp =3D 0; =20 HTIF_DEBUG("mtohost write: device: %d cmd: %d what: %02" PRIx64 - " -payload: %016" PRIx64 "\n", device, cmd, payload & 0xFF, payloa= d); + " -payload: %016" PRIx64 "\n", device, cmd, payload & 0xFF, + payload); =20 /* * Currently, there is a fixed mapping of devices: @@ -137,7 +138,7 @@ static void htif_handle_tohost_write(HTIFState *htifsta= te, uint64_t val_written) qemu_log_mask(LOG_UNIMP, "pk syscall proxy not supported\n= "); } } else { - qemu_log("HTIF device %d: unknown command\n", device); + HTIF_DEBUG("HTIF device %d: unknown command\n", device); } } else if (likely(device =3D=3D 0x1)) { /* HTIF Console */ @@ -150,12 +151,13 @@ static void htif_handle_tohost_write(HTIFState *htifs= tate, uint64_t val_written) qemu_chr_fe_write(&htifstate->chr, (uint8_t *)&payload, 1); resp =3D 0x100 | (uint8_t)payload; } else { - qemu_log("HTIF device %d: unknown command\n", device); + HTIF_DEBUG("HTIF device %d: unknown command\n", device); } } else { - qemu_log("HTIF unknown device or command\n"); + HTIF_DEBUG("HTIF unknown device or command\n"); HTIF_DEBUG("device: %d cmd: %d what: %02" PRIx64 - " payload: %016" PRIx64, device, cmd, payload & 0xFF, payload); + " payload: %016" PRIx64, device, cmd, payload & 0xFF, + payload); } /* * - latest bbl does not set fromhost to 0 if there is a value in toho= st @@ -180,6 +182,7 @@ static void htif_handle_tohost_write(HTIFState *htifsta= te, uint64_t val_written) static uint64_t htif_mm_read(void *opaque, hwaddr addr, unsigned size) { HTIFState *htifstate =3D opaque; + if (addr =3D=3D TOHOST_OFFSET1) { return htifstate->env->mtohost & 0xFFFFFFFF; } else if (addr =3D=3D TOHOST_OFFSET2) { @@ -189,8 +192,8 @@ static uint64_t htif_mm_read(void *opaque, hwaddr addr,= unsigned size) } else if (addr =3D=3D FROMHOST_OFFSET2) { return (htifstate->env->mfromhost >> 32) & 0xFFFFFFFF; } else { - qemu_log("Invalid htif read: address %016" PRIx64 "\n", - (uint64_t)addr); + HTIF_DEBUG("Invalid htif read: address %016" PRIx64 "\n", + (uint64_t)addr); return 0; } } @@ -219,8 +222,8 @@ static void htif_mm_write(void *opaque, hwaddr addr, htifstate->env->mfromhost |=3D value << 32; htifstate->fromhost_inprogress =3D 0; } else { - qemu_log("Invalid htif write: address %016" PRIx64 "\n", - (uint64_t)addr); + HTIF_DEBUG("Invalid htif write: address %016" PRIx64 "\n", + (uint64_t)addr); } } =20 --=20 1.8.3.1