From patchwork Sun Jun 28 14:24:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 191974 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2140739ilg; Sun, 28 Jun 2020 07:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTl8CkiI2j521qhJII8LqxrWCE+2eMpusMBUy7orxa2x3/z68Gl2GsHdJrK2IR0p/WcPJU X-Received: by 2002:a5b:c02:: with SMTP id f2mr19832156ybq.151.1593354872905; Sun, 28 Jun 2020 07:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593354872; cv=none; d=google.com; s=arc-20160816; b=py49OtuuG582WM/Kr8U8op2PKp4KFCfSEoF7Z10slLVWGBQXDXmRajN1+uj2tg4BY/ G+AowG6TrLHbzVuVq5DgP3YI4E+c7lJ7rkWKyh7AsTxKOfwu07/3wV2YiH/tr0ZS0U18 UJs48VvuUhoPOCDp7Hq5s+SWzi3vPvJ5DufMLlS44GClTBDXZvTfRA3daKvTKISFxSHB cFLtwHIGcs9hEVtt+kSBlG/BCMb7zKEXgtZ3Gp/9nYkbTu+q73CCcS2nk4o9/CNDkDnZ coawzARjgkDyN+ArmbvOV/Wu0CqW6v2gxGnbsUrONWmVXhCu2yN6BeAjW8aEB1tK6rXi cQWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=fwBSY0MsI6h8FbtVujLNC6mJpu8V4peKWaK9z7XDiI0=; b=tlemuRiRgOlreU2bKYQqsYvzNpVUswFU9N2x8NS79Gd8TnzNhSqK9YcYcIKRkKuG/H ZxigjJoxCp0Vo5WR1z1mQ0CPYfnYUnowlxnxAwQ4AJz4JeBeIr931FZm2vj2voXjalnA xfFfsBXeEOy3OHcBETWPv9CXnsqHieJ49/RaC3RkZSC/CJQrel+c0kDeVKRZ5cVuyCxz UrELiuFleH6b5KB4xomAIGFBedAwrijqo/mC6NA1uThZpI7c+PTfKbnAf4CUS0yQJKTu vt5zUyG8jmd1xS8Pu1NgRL8Y6P6cyN9gnuL7oE4f2XpgTaFuKFWmiKl7sZ2gKc1EUjcL KnYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rg7325tu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b15si31008935ybn.58.2020.06.28.07.34.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jun 2020 07:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rg7325tu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpYO8-0005Yu-E5 for patch@linaro.org; Sun, 28 Jun 2020 10:34:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpYEk-0006Sg-MW for qemu-devel@nongnu.org; Sun, 28 Jun 2020 10:24:50 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:39600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jpYEi-0004lT-VF for qemu-devel@nongnu.org; Sun, 28 Jun 2020 10:24:50 -0400 Received: by mail-wr1-x444.google.com with SMTP id q5so14033636wru.6 for ; Sun, 28 Jun 2020 07:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fwBSY0MsI6h8FbtVujLNC6mJpu8V4peKWaK9z7XDiI0=; b=rg7325tuDYm4hUluuyLxFpyBeffHXylA4vO7YVE+nBUruGnnIL7GDbNPBPROrBMHDq SZwkDsEWqsPO0Nh8foIzHvMmvUEt5rXLSW/C1FOkdXGoxJILdMd3gXAtuH068iC3vvOT w8wbeCN1qWkFmSWVzrcTAN0xgOYcZRIt0TmS4OaGwTW3Z7x0p+GdLzfHJ+ileI1FJuOy JeQKmiW0uC1KKQadVkcMS5tVticI3PDxrrjUz17cHupg05Ri8nPN37aI6dgoUW8GVXrG PFBxUNdrf5YRB7wd1O3kOJhTY3Qko9ODCBsnBMeA7MWKjHROYUzcww7omiMmCipT3ie4 SIRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fwBSY0MsI6h8FbtVujLNC6mJpu8V4peKWaK9z7XDiI0=; b=ikR0TvklwayWeeLhJpk/aSzcT4Ry0HRHghdh7C5EDADdWrkwjHldx3PcZeY9mbw7ir uc93yDKwqJVn37/gJ4vdWk9AaZA0EjyHM1btgbGsdNCR44y/kiqdpEHktRL0FxV1e+s9 89O56CCSIFOJczteKfVXzqCf5l16aCxFn7b266Nda15J0zp7Mb+fpIL/EbAOEaeqmBDe t/TTm+9k/rnnCUdkaUzqGyCRrG+siUl/KYQjzWvEfMw9vX9yxFQW2f8Y7uzMI/re/7fZ r6DUcK3/yI5472Dkf75+1LxqaxtUs0ZPjK/5dxLub7EezqXQy4vg5yEsSzTBs562J6Vd Jw4Q== X-Gm-Message-State: AOAM531zdO9aBcCXAjAXOWZoDwfhv5NjJetMip4HQCHu5vDiwX2mmrDs CnMfriwrPM/9TXsbPcu6vOTeMQ== X-Received: by 2002:a5d:6912:: with SMTP id t18mr12770328wru.411.1593354287667; Sun, 28 Jun 2020 07:24:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id h13sm5321555wml.42.2020.06.28.07.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jun 2020 07:24:47 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 13/17] hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses Date: Sun, 28 Jun 2020 15:24:25 +0100 Message-Id: <20200628142429.17111-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200628142429.17111-1-peter.maydell@linaro.org> References: <20200628142429.17111-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x444.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Instead of logging guest accesses to invalid register offsets in this device using zaurus_printf() (which just prints to stderr), use the usual qemu_log_mask(LOG_GUEST_ERROR,...). Since this was the only use of the zaurus_printf() macro outside spitz.c, we can move the definition of that macro from sharpsl.h to spitz.c. Signed-off-by: Peter Maydell --- include/hw/arm/sharpsl.h | 3 --- hw/arm/spitz.c | 3 +++ hw/gpio/zaurus.c | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis diff --git a/include/hw/arm/sharpsl.h b/include/hw/arm/sharpsl.h index 89e168fbff3..e986b28c527 100644 --- a/include/hw/arm/sharpsl.h +++ b/include/hw/arm/sharpsl.h @@ -9,9 +9,6 @@ #include "exec/hwaddr.h" -#define zaurus_printf(format, ...) \ - fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__) - /* zaurus.c */ #define SL_PXA_PARAM_BASE 0xa0000a00 diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index bab9968ccee..6eb46869157 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -62,6 +62,9 @@ typedef struct { #define SPITZ_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(SpitzMachineClass, klass, TYPE_SPITZ_MACHINE) +#define zaurus_printf(format, ...) \ + fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__) + #undef REG_FMT #define REG_FMT "0x%02lx" diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c index 9a12c683420..258e9264930 100644 --- a/hw/gpio/zaurus.c +++ b/hw/gpio/zaurus.c @@ -22,9 +22,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qemu/module.h" - -#undef REG_FMT -#define REG_FMT "0x%02lx" +#include "qemu/log.h" /* SCOOP devices */ @@ -104,7 +102,9 @@ static uint64_t scoop_read(void *opaque, hwaddr addr, case SCOOP_GPRR: return s->gpio_level; default: - zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr); + qemu_log_mask(LOG_GUEST_ERROR, + "scoop_read: bad register offset 0x%02" HWADDR_PRIx "\n", + addr); } return 0; @@ -150,7 +150,9 @@ static void scoop_write(void *opaque, hwaddr addr, scoop_gpio_handler_update(s); break; default: - zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr); + qemu_log_mask(LOG_GUEST_ERROR, + "scoop_write: bad register offset 0x%02" HWADDR_PRIx "\n", + addr); } }