From patchwork Sat Jul 20 06:18:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KONRAD Frederic X-Patchwork-Id: 1134354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45rHl21j2pz9s4Y for ; Sat, 20 Jul 2019 16:19:08 +1000 (AEST) Received: from localhost ([::1]:49754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoii1-0006On-CZ for incoming@patchwork.ozlabs.org; Sat, 20 Jul 2019 02:19:05 -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) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com 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) 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 *htifstate, uint64_t val_written) int resp = 0; HTIF_DEBUG("mtohost write: device: %d cmd: %d what: %02" PRIx64 - " -payload: %016" PRIx64 "\n", device, cmd, payload & 0xFF, payload); + " -payload: %016" PRIx64 "\n", device, cmd, payload & 0xFF, + payload); /* * Currently, there is a fixed mapping of devices: @@ -137,7 +138,7 @@ static void htif_handle_tohost_write(HTIFState *htifstate, 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 == 0x1)) { /* HTIF Console */ @@ -150,12 +151,13 @@ static void htif_handle_tohost_write(HTIFState *htifstate, uint64_t val_written) qemu_chr_fe_write(&htifstate->chr, (uint8_t *)&payload, 1); resp = 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 tohost @@ -180,6 +182,7 @@ static void htif_handle_tohost_write(HTIFState *htifstate, uint64_t val_written) static uint64_t htif_mm_read(void *opaque, hwaddr addr, unsigned size) { HTIFState *htifstate = opaque; + if (addr == TOHOST_OFFSET1) { return htifstate->env->mtohost & 0xFFFFFFFF; } else if (addr == TOHOST_OFFSET2) { @@ -189,8 +192,8 @@ static uint64_t htif_mm_read(void *opaque, hwaddr addr, unsigned size) } else if (addr == 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 |= value << 32; htifstate->fromhost_inprogress = 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); } }