From nobody Mon May 20 23:39:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1597258997; cv=none; d=zohomail.com; s=zohoarc; b=OxdKyLtOo6qT/fp5T8gtdmojK6lqtXn3euTDka/HZ+x6hNgu+C2Pknqz2YgIhirhqCiHq/y3rSuor8ho6cT6SHWsK6gBs+6l8C/IskmPcJr00qCGD8D6pn1XFOI94eZyC3oOll1bWoELTvDt9WfGwKDFRCmrkek93UpMqmDYNLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597258997; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+iUv2TzpXLrAdI56+r9nGAkPMiWMPyqKq2ram8/0+Co=; b=f6vZxT2m4MoGn5AMd6nCvTVaQs0xCWRD5TcNotPBw+IkrOIEhrhOl8P94vKa/GHi5YMbp+Uroc/64+VGSZxzMbzylzjsgvypGWZuBhlnVFbh08O/XP9MWTxo9yoFRxq4QlMGkRfUK4Lu1gqBvZxqxNUdFTRcMbrWueUKhkQXXyU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597258997356198.25102967103123; Wed, 12 Aug 2020 12:03:17 -0700 (PDT) Received: from localhost ([::1]:42506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5w1r-0003ZR-QR for importer@patchew.org; Wed, 12 Aug 2020 15:03:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5w0r-0002UY-7v; Wed, 12 Aug 2020 15:02:13 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:35498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5w0p-0006EW-IM; Wed, 12 Aug 2020 15:02:12 -0400 Received: by mail-wr1-x441.google.com with SMTP id f1so3055564wro.2; Wed, 12 Aug 2020 12:02:10 -0700 (PDT) Received: from x1w.redhat.com (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id z12sm5689441wrp.20.2020.08.12.12.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 12:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+iUv2TzpXLrAdI56+r9nGAkPMiWMPyqKq2ram8/0+Co=; b=ewiL921ImKlRlevO/ifdoTJyIbgpgneiRO4Kv6Z0/gbEFnJY1rw9sLS6++vCVOc5bs 4jfiCgBN8eh2KphPBkOe3Kxe7x5JcNaopu31OxA5JfvxjrzYNi+FVjKr82oXGW/M6Lsh q8+TkYt7czYFCQ2WrzYuoqvM77n/KTV9QNaIMyJgc7c381WTdKBF4wMGbz4Pri52Lwk3 O4OLMYyVo46KLCFOjGBwQ3xlcEGhaWnyaBpndAv1Tm6CUnIPwo3r82QkUutCuhNJGE9c BgokAYskXAyt8+LnATQhH/W3fRZMUcuEdDL8EZmPFg7nMTLavmqd97tsgsbGGS2f4h/Z ndKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+iUv2TzpXLrAdI56+r9nGAkPMiWMPyqKq2ram8/0+Co=; b=NZDKxpfLGopWRSm271DdahH+Q4DaexRlOCASnTXoIUszA0v3Ma5VCMPv3mB+ntwzKT XVMg6tbtb5tbAz645TFF9A0fkEcJBYFjEb3D5IvXH1WppSnXO+tqpHDWrBsqtv6ZirTE 6sX58+Yk+cLebp0aht+ruduX+SgrQglsiWm8Fqc9Q6sXhMZ/FzDwOJalgwEmZ74cgDep DP6JeNY/jV59XYJ59uQKndo9NfDsV3xx8E2+GXnyAzY2daKrEgNsZ50lMch+fhDgTFDY /FCvIR8zoDiD70R+elfP/xL3DZFz/ryXUMNlgrOlyvM+4NNMnDG7ef2MygZwBSqEhyyM PicQ== X-Gm-Message-State: AOAM532LtUP1WR9QFGaxtF4pDYx7aBN0BtKvgGjpF7TqIWLMmycPOuVO s8CHkNXuMIxkekveAeAZlDXluubM X-Google-Smtp-Source: ABdhPJxwmxPcVC/oXUsJch+Gs8mCqwRyQQrvO1MHl0DIqZLBjq0dRL3BBqCFdr67h7+6aQoF20QhoQ== X-Received: by 2002:adf:de91:: with SMTP id w17mr576191wrl.108.1597258929379; Wed, 12 Aug 2020 12:02:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 1/3] hw/misc/unimp: Display value after offset Date: Wed, 12 Aug 2020 21:02:04 +0200 Message-Id: <20200812190206.31595-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200812190206.31595-1-f4bug@amsat.org> References: <20200812190206.31595-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: qemu-trivial@nongnu.org, Peter Maydell , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) To better align the read/write accesses, display the value after the offset (read accesses only display the offset). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/unimp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c index bc4084d344..ee2e536c8b 100644 --- a/hw/misc/unimp.c +++ b/hw/misc/unimp.c @@ -22,7 +22,7 @@ static uint64_t unimp_read(void *opaque, hwaddr offset, u= nsigned size) { UnimplementedDeviceState *s =3D UNIMPLEMENTED_DEVICE(opaque); =20 - qemu_log_mask(LOG_UNIMP, "%s: unimplemented device read " + qemu_log_mask(LOG_UNIMP, "%s: unimplemented device read " "(size %d, offset 0x%" HWADDR_PRIx ")\n", s->name, size, offset); return 0; @@ -34,9 +34,9 @@ static void unimp_write(void *opaque, hwaddr offset, UnimplementedDeviceState *s =3D UNIMPLEMENTED_DEVICE(opaque); =20 qemu_log_mask(LOG_UNIMP, "%s: unimplemented device write " - "(size %d, value 0x%" PRIx64 - ", offset 0x%" HWADDR_PRIx ")\n", - s->name, size, value, offset); + "(size %d, offset 0x%" HWADDR_PRIx + ", value 0x%" PRIx64 ")\n", + s->name, size, offset, value); } =20 static const MemoryRegionOps unimp_ops =3D { --=20 2.21.3 From nobody Mon May 20 23:39:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=1597259058; cv=none; d=zohomail.com; s=zohoarc; b=mHAINhEvXDF2ZdWyirQl4rMKF6QHdhkufvyK/LxDxCAWcJmAkl+HTTzM0+/dvsUF/FP9USaWRcGdOtm/mhbywZNRPvSYLuCWOz3QM61Nd5Q/9tiCbuxVprocFfugrDjjFr/2L9s/8b8IZ/fg/uvg0v08CRGYzPJuDT5Q1AP7m+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597259058; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uc6ONUoxoWg8xYm//tb9mML/JLxliOTk/GE+b+dOnas=; b=SMHGjdIdm3SH4LYnloMx7pWcjLRacwHeCMx5TKzOHKE7JOtClQ54MQNLaUiMf0UP6weUCq3y6aSu7OhL+6F7Q9tE9jtW2D0WC3kROWPzjuQCcXtd4qiVvVjmxq4uH/6/pVvF7VbSl1qkFcoeT0tAbZd3bKdfjjZVDdZwClDYslQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 15972590588003.651749158771736; Wed, 12 Aug 2020 12:04:18 -0700 (PDT) Received: from localhost ([::1]:45986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5w2r-00051m-Mn for importer@patchew.org; Wed, 12 Aug 2020 15:04:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5w0s-0002Vc-5g; Wed, 12 Aug 2020 15:02:14 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5w0q-0006Ee-OE; Wed, 12 Aug 2020 15:02:13 -0400 Received: by mail-wr1-x442.google.com with SMTP id f1so3055615wro.2; Wed, 12 Aug 2020 12:02:11 -0700 (PDT) Received: from x1w.redhat.com (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id z12sm5689441wrp.20.2020.08.12.12.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 12:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uc6ONUoxoWg8xYm//tb9mML/JLxliOTk/GE+b+dOnas=; b=c9W9WpFZ14ZVaiiG7/rHyW4DOZkgwnYdtaquSFi086j6rADMzsT/BIYYoHzUdr+n2H G3QWTVU5/A2ODpn1R48Q+7MjOpkH24zMI5Ng8NCn/WRPPedUQo+Tgq1uZMBzIW2DHYMe McxbRpFb4NoOCODIMtf2P0Dxu1GES8NU94bK6vAnSdDimft8Odk/voxTSq+VpPXzmuql AwC/Xy42rWqjXUPeIWlnBDzYKhcDNhwyqAg9vFIy+H0dVpXtXG4NgoHc1DR2MRbXTSrN +WIF8IpIxeDdAatDkqiD7sGc6XEz/zoBubsJEZi4OwVYmTmwlLxH8sEFYdeZRV0stVeM 5Kmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uc6ONUoxoWg8xYm//tb9mML/JLxliOTk/GE+b+dOnas=; b=nQevCQVu/GFn5+uwtDWVDN5aUbd5WRCnID3/WVZIcImRy87hghgUmGHPBMq02UUOZg DaLbHfceqXyedIYC0NMiHfr0NvfKA1496Q/TTQU+UiWDiA/rSmL1yeXByYn34VIfVzzR G/GJP9aiQ84Qbbr0r7Yp8ybCcELJq9mJsWl/W2f2u/pAw57wAK9XSezEg3Kfe5lTIYim pl4uozKmhs63g0kcpDM88f9xwXcDlecn69TsDeDbRZM0PZhMUeqq0anMDYKiKxwWObGa FEOfUliWYFqrhvq4NK8QiH1pxyQQl/AojHfc984la9CAZp++4wYkz0LTMhl8HCNe86Xp If5w== X-Gm-Message-State: AOAM532snlGNkyHuZRrzsN3YtQ/eKLHd2FndCO4O60Kg0kvH4iYpZ7Fc iOjtopey55JFdovi0P06/CedwacO X-Google-Smtp-Source: ABdhPJzYJbCg3ZMdEYVaVcwEcoDDOETH/LjovL4W33ppbFiwQtwwSBFW1XqXNLtfFAdNtCaYsxOzeA== X-Received: by 2002:adf:f341:: with SMTP id e1mr576615wrp.207.1597258930812; Wed, 12 Aug 2020 12:02:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 2/3] hw/misc/unimp: Display the value with width of the access size Date: Wed, 12 Aug 2020 21:02:05 +0200 Message-Id: <20200812190206.31595-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200812190206.31595-1-f4bug@amsat.org> References: <20200812190206.31595-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: qemu-trivial@nongnu.org, Peter Maydell , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) To quickly notice the access size, display the value with the width of the access (i.e. 16-bit access is displayed 0x0000, while 8-bit access 0x00). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/unimp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c index ee2e536c8b..b4b318db1c 100644 --- a/hw/misc/unimp.c +++ b/hw/misc/unimp.c @@ -35,8 +35,8 @@ static void unimp_write(void *opaque, hwaddr offset, =20 qemu_log_mask(LOG_UNIMP, "%s: unimplemented device write " "(size %d, offset 0x%" HWADDR_PRIx - ", value 0x%" PRIx64 ")\n", - s->name, size, offset, value); + ", value 0x%0*" PRIx64 ")\n", + s->name, size, offset, size << 1, value); } =20 static const MemoryRegionOps unimp_ops =3D { --=20 2.21.3 From nobody Mon May 20 23:39:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=1597259116; cv=none; d=zohomail.com; s=zohoarc; b=l+59iI4dvBQsiBlSDxG8KkaRBV9pNY3esFJaE9Vfz7djHAI0zLBPt84YVtkrYMn1GZMZiSUgSt7VTYESsLxZzWvK82PkhoEaFNCBJZ73lICsbuNB8nsoGbpeeBCp/MYY+mXF3KIwwjXjruk2s0OX36aAr+0ZG+zgjX1qUAKQDtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597259116; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=51xOVz0iHhc5rb1/zArjdyiBJ2orj09aEiXFrYZBmxQ=; b=kGubaZ0DPyadN7a0RouLtGQoF2OpAkoXUhDZ1xvT1x9HMUXkBZdRngD38aBHCQaIsXBqi3DwiYMqg+7ruPQIfh/zObygaeuQDUJSCCIBY1j7vv2X0nKOFmHQ/M8QsDccD4/CW2KmvSqKm8s+2zQpQ/IYKCv8voO5KGC0ArLdCII= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1597259116548633.392523726002; Wed, 12 Aug 2020 12:05:16 -0700 (PDT) Received: from localhost ([::1]:48286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5w3n-000601-F8 for importer@patchew.org; Wed, 12 Aug 2020 15:05:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5w0t-0002Xj-HC; Wed, 12 Aug 2020 15:02:15 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:53152) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5w0r-0006Eu-Tp; Wed, 12 Aug 2020 15:02:15 -0400 Received: by mail-wm1-x342.google.com with SMTP id x5so2692116wmi.2; Wed, 12 Aug 2020 12:02:13 -0700 (PDT) Received: from x1w.redhat.com (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id z12sm5689441wrp.20.2020.08.12.12.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 12:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=51xOVz0iHhc5rb1/zArjdyiBJ2orj09aEiXFrYZBmxQ=; b=LbIZT74N9akuor1WBjAtsMxUiWLuENqkdyQxXoe0VeryXYKYcg0UL2UfMJmyZ52AEx HF9Le9CpeEMdWVj3ocoJjKyxYzQgtDt+ELuQz1SLyEJplalTThYGEyI7aWJCsFfx49is Y5dOaWX7Z54KrvlTpCWsp2p3ydfMvqskqJ71nhEC9Z+2SDm3bqalRQw0DcoGOYSuro+6 Z7SdowABj/nXlINABahwZsXbHCq/+mpu+UwRToO2ZAJm5cwsLQgzSFVYiEGBlkc3VwXe pHO8F75nWubY0M39ZD9mEfw4S3BnlUzwgpe8AahjBgGrudE4umgoLxM2QF1di2fSklwT KwFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=51xOVz0iHhc5rb1/zArjdyiBJ2orj09aEiXFrYZBmxQ=; b=bj1WEP27NBFPPdIzc5k+p2Am9riD5yX6HWDn7gKLDahVIdi5unqZlj7aKNMBckPlBB op8aMQ9JjMeRa86V3y3zXOcYQdVmdbifOWCw/aUHL0NOv8q1+Xib/MQNavC83QrWLCYE FGGUOoq+L6AOsC69EF4hVa+VvX3gjGESkv3Wa8OTtVC0SFC3tJkwGNulNzvCDn2J0R2i VU2bES6CFOQaM6Q6isuTF+BDxHk5OjbL+V6rlsAvOgxFogxB0mX/eYiWs8iVTAaTjfj6 0XsIWrUURkpECozHPtirpumZbluyP5CNhNfQFsETacS1/090JfA1v6oodqKBP6bGkze/ mjyQ== X-Gm-Message-State: AOAM531CNnpCZdItZ3K7MfSj9D01VJ4RiVVqPdgWgpW34kwBLViwXa9A 3RrGJE7OzRsDobw/+kRxTZf7QdLu X-Google-Smtp-Source: ABdhPJxf8K4e2Tbys3JicI75ds3VmcHIuqnQHqBJyDjIPvfZCy7VW4rFHRqNNboQBtp/sxlXCLEDKw== X-Received: by 2002:a7b:c095:: with SMTP id r21mr954823wmh.96.1597258931818; Wed, 12 Aug 2020 12:02:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 3/3] hw/misc/unimp: Display the offset with width of the region size Date: Wed, 12 Aug 2020 21:02:06 +0200 Message-Id: <20200812190206.31595-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200812190206.31595-1-f4bug@amsat.org> References: <20200812190206.31595-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: qemu-trivial@nongnu.org, Peter Maydell , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) To have a better idea of how big is the region where the offset belongs, display the value with the width of the region size (i.e. a region of 0x1000 bytes uses 0x000 format). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Since v1: Use DIV_ROUND_UP (rth) --- include/hw/misc/unimp.h | 1 + hw/misc/unimp.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index 4c1d13c9bf..c63968a2cd 100644 --- a/include/hw/misc/unimp.h +++ b/include/hw/misc/unimp.h @@ -20,6 +20,7 @@ typedef struct { SysBusDevice parent_obj; MemoryRegion iomem; + unsigned offset_fmt_width; char *name; uint64_t size; } UnimplementedDeviceState; diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c index b4b318db1c..6cfc5727f0 100644 --- a/hw/misc/unimp.c +++ b/hw/misc/unimp.c @@ -23,8 +23,8 @@ static uint64_t unimp_read(void *opaque, hwaddr offset, u= nsigned size) UnimplementedDeviceState *s =3D UNIMPLEMENTED_DEVICE(opaque); =20 qemu_log_mask(LOG_UNIMP, "%s: unimplemented device read " - "(size %d, offset 0x%" HWADDR_PRIx ")\n", - s->name, size, offset); + "(size %d, offset 0x%0*" HWADDR_PRIx ")\n", + s->name, size, s->offset_fmt_width, offset); return 0; } =20 @@ -34,9 +34,9 @@ static void unimp_write(void *opaque, hwaddr offset, UnimplementedDeviceState *s =3D UNIMPLEMENTED_DEVICE(opaque); =20 qemu_log_mask(LOG_UNIMP, "%s: unimplemented device write " - "(size %d, offset 0x%" HWADDR_PRIx + "(size %d, offset 0x%0*" HWADDR_PRIx ", value 0x%0*" PRIx64 ")\n", - s->name, size, offset, size << 1, value); + s->name, size, s->offset_fmt_width, offset, size << 1, v= alue); } =20 static const MemoryRegionOps unimp_ops =3D { @@ -63,6 +63,8 @@ static void unimp_realize(DeviceState *dev, Error **errp) return; } =20 + s->offset_fmt_width =3D DIV_ROUND_UP(64 - clz64(s->size - 1), 4); + memory_region_init_io(&s->iomem, OBJECT(s), &unimp_ops, s, s->name, s->size); sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem); --=20 2.21.3