From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC8EC433E0 for ; Fri, 1 Jan 2021 23:12:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5FB2221E92 for ; Fri, 1 Jan 2021 23:12:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FB2221E92 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvTaW-0003kB-DA for qemu-devel@archiver.kernel.org; Fri, 01 Jan 2021 18:12:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvTZk-0003KP-IJ for qemu-devel@nongnu.org; Fri, 01 Jan 2021 18:11:16 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:39273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvTZi-0001W6-KH for qemu-devel@nongnu.org; Fri, 01 Jan 2021 18:11:16 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 351287470FA; Sat, 2 Jan 2021 00:11:11 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 0243E7470E2; Sat, 2 Jan 2021 00:11:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 00E587470FB; Sat, 2 Jan 2021 00:11:10 +0100 (CET) Date: Sat, 2 Jan 2021 00:11:10 +0100 (CET) To: =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= Subject: Re: [PATCH v2 09/10] vt82c686: Convert debug printf to trace points In-Reply-To: <3088f630-ffc4-22e8-e04b-c3eff09bd9c4@amsat.org> Message-ID: <69ae1946-617e-9ba6-7118-4ea2ad22d89c@eik.bme.hu> References: <28d9455165261a9cfd2cc4a650b25f987e60295c.1609121293.git.balaton@eik.bme.hu> <3088f630-ffc4-22e8-e04b-c3eff09bd9c4@amsat.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3866299591-1787848807-1609542670=:11390" Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Huacai Chen , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: BALATON Zoltan From: BALATON Zoltan via This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3866299591-1787848807-1609542670=:11390 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Fri, 1 Jan 2021, Philippe Mathieu-Daudé wrote: > On 12/28/20 3:08 AM, BALATON Zoltan via wrote: >> Drop DPRINTF and use trace functions instead. Two debug messages about >> unimplemented registers could be converted to qemu_log_mask() but in >> reality all registers are currently unimplemented (we just store and >> return values of writable regs but do nothing with them). As we >> already trace register access there's no need for additional debug >> messages so these are just removed and a comment is added as a reminder. >> >> Signed-off-by: BALATON Zoltan > > Reviewed-by: Philippe Mathieu-Daudé > >> --- >> v2: Extended commit message >> >> hw/isa/trace-events | 6 ++++++ >> hw/isa/vt82c686.c | 51 +++++++++++++-------------------------------- >> 2 files changed, 21 insertions(+), 36 deletions(-) >> >> diff --git a/hw/isa/trace-events b/hw/isa/trace-events >> index 3544c6213c..d267d3e652 100644 >> --- a/hw/isa/trace-events >> +++ b/hw/isa/trace-events >> @@ -13,3 +13,9 @@ pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" >> # apm.c >> apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" >> apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x" >> + >> +# vt82c686.c >> +via_isa_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x" >> +via_pm_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x len 0x%x" >> +via_superio_read(uint8_t addr, uint8_t val) "addr 0x%x val 0x%x" >> +via_superio_write(uint8_t addr, uint32_t val) "addr 0x%x val 0x%x" >> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c >> index cd87ec0103..d7ce15bf9f 100644 >> --- a/hw/isa/vt82c686.c >> +++ b/hw/isa/vt82c686.c >> @@ -27,14 +27,7 @@ >> #include "qemu/timer.h" >> #include "exec/address-spaces.h" >> #include "qom/object.h" >> - >> -/* #define DEBUG_VT82C686B */ >> - >> -#ifdef DEBUG_VT82C686B >> -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__) >> -#else >> -#define DPRINTF(fmt, ...) >> -#endif >> +#include "trace.h" >> >> typedef struct SuperIOConfig { >> uint8_t config[0x100]; >> @@ -55,12 +48,12 @@ static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data, >> { >> SuperIOConfig *superio_conf = opaque; >> >> - DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data); >> - if (addr == 0x3f0) { >> + if (addr == 0x3f0) { /* config index register */ >> superio_conf->index = data & 0xff; >> } else { >> bool can_write = true; >> - /* 0x3f1 */ >> + /* 0x3f1, config data register */ >> + trace_via_superio_write(superio_conf->index, data & 0xff); >> switch (superio_conf->index) { >> case 0x00 ... 0xdf: >> case 0xe4: >> @@ -73,18 +66,7 @@ static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data, >> case 0xfd ... 0xff: >> can_write = false; >> break; >> - case 0xe7: >> - if ((data & 0xff) != 0xfe) { >> - DPRINTF("change uart 1 base. unsupported yet\n"); >> - can_write = false; >> - } >> - break; >> - case 0xe8: >> - if ((data & 0xff) != 0xbe) { >> - DPRINTF("change uart 2 base. unsupported yet\n"); >> - can_write = false; >> - } >> - break; >> + /* case 0xe6 ... 0xe8: Should set base port of parallel and serial */ > > If you don't mind I'll prepend this patch: > -- >8 -- > diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c > index cd87ec01039..23b4deaac93 100644 > --- a/hw/isa/vt82c686.c > +++ b/hw/isa/vt82c686.c > @@ -25,6 +25,7 @@ > #include "qapi/error.h" > #include "qemu/module.h" > #include "qemu/timer.h" > +#include "qemu/log.h" > #include "exec/address-spaces.h" > #include "qom/object.h" > > @@ -73,17 +74,9 @@ static void superio_ioport_writeb(void *opaque, > hwaddr addr, uint64_t data, > case 0xfd ... 0xff: > can_write = false; > break; > - case 0xe7: > - if ((data & 0xff) != 0xfe) { > - DPRINTF("change uart 1 base. unsupported yet\n"); > - can_write = false; > - } > - break; > - case 0xe8: > - if ((data & 0xff) != 0xbe) { > - DPRINTF("change uart 2 base. unsupported yet\n"); > - can_write = false; > - } > + case 0xe6 ... 0xe8: /* set base port of parallel and serial */ > + qemu_log_mask(LOG_UNIMP, "change base port not implemented\n"); > + can_write = false; Actually I won't add this log becuse in later patches I've added logging for all unimplemented regs here and implemented changing base for serial (needed for pegasos2 which puts the single serial port at 0x2f8). Still want this patch spit into too? Regards, BALATON Zoltan --3866299591-1787848807-1609542670=:11390--