From patchwork Mon May 18 19:41:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 282439 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 0D7EAC433E0 for ; Mon, 18 May 2020 19:50:34 +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 CABFC20657 for ; Mon, 18 May 2020 19:50:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vGY1hKRB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CABFC20657 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jalmS-0005Om-UX for qemu-devel@archiver.kernel.org; Mon, 18 May 2020 15:50:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jalep-00038D-HB for qemu-devel@nongnu.org; Mon, 18 May 2020 15:42:39 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:35466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaleo-0004eI-VQ for qemu-devel@nongnu.org; Mon, 18 May 2020 15:42:39 -0400 Received: by mail-lj1-x243.google.com with SMTP id g4so11172031ljl.2 for ; Mon, 18 May 2020 12:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L66Agc2lHgpy7FO0yh6pn/rfQ2aSoQ2VmphzAuOdIik=; b=vGY1hKRB0ZyOZm2sZstGyWZUYDH823rpzDqzzVSB2oKrT+cl80BEFydZo4Btm33SZo 4j4yLUaIPvS+oYCbYvBa5oAVUvef9mRfErPgVjSYsfuFKhUVdr9ithIuVcr2OG2WGNvq S9D5Y7Zrh6KDSkULj8Pdj7teLNP0F+8y063iulV5Loe2t+VrxonDFkJ8H7sTXrt27tI0 dpXE4+cvndw5G+x3BoTKnWegA8dA3mvWj2ITGVlbeV+bE1l6Y04ZQwPBJS1nuTqyOjfS 4f+Oe/u5A95KLRydcrOOqvcgMA2e4HW5KGfXcmcnwXzqOI0NVScjMp0rIkk+K1nlwR/y 7wdg== 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=L66Agc2lHgpy7FO0yh6pn/rfQ2aSoQ2VmphzAuOdIik=; b=DU9x8ZAuAkKJqvIHx79XvGj1PmqkJHF/IQcxzkxJXACVh4HMgm1hrDTQGUTWkqaIsz JXAnySmvOIKxlXNY6owF0HleL2Qt94TKdR6Qv2z80WQJe00nRQRlrK+/pyqgPJoykar0 mCzWcaztDnAZTP3jk2Wxpbox3V5Kp6z9XA/GNKPDk8UawH8wMB3y8Dr901OmFG8S6u0J crXfK7e9bbFXMWaOg1S6efO8snywy+1t6kR4BkOP0dbTX92yGWoC1ytYGDPqrp9OaOwW uOIoB1PzrQE7K0zP96FzlVhkVHW0q+mwvHezz8d6MLQfSEbfVfI6I2OHNOazgVNv+jI6 w3Hw== X-Gm-Message-State: AOAM533JGHh346zCf8UEzmjbZc94ZN9wgKF2r0AEAxg75CHDPCjlqWnY ywU/Ybq4lKZINT15LRc4ifcFRUA2LZk= X-Google-Smtp-Source: ABdhPJzOmKlQYTRwsOXo8IcdtLa51qD6MwwlQDl1h3NTmp/wo+kJUKM7nGa+xuU6BkkjE/qH7hdeaQ== X-Received: by 2002:a05:651c:20d:: with SMTP id y13mr11356564ljn.29.1589830957350; Mon, 18 May 2020 12:42:37 -0700 (PDT) Received: from localhost.localdomain ([109.245.227.98]) by smtp.gmail.com with ESMTPSA id r15sm7593128lfp.34.2020.05.18.12.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 12:42:36 -0700 (PDT) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH v5 21/22] hw/mips: Add some logging for bad register offset cases Date: Mon, 18 May 2020 21:41:48 +0200 Message-Id: <20200518194149.16281-22-aleksandar.qemu.devel@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518194149.16281-1-aleksandar.qemu.devel@gmail.com> References: <20200518194149.16281-1-aleksandar.qemu.devel@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=aleksandar.qemu.devel@gmail.com; helo=mail-lj1-x243.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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_PASS=-0.001, URIBL_BLOCKED=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: aleksandar.rikalo@syrmia.com, Aleksandar Markovic , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Log the cases where a guest attempts read or write using bad register offset. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Aleksandar Markovic --- hw/mips/mips_malta.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index e4c4de1b4e..88869b828e 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -427,10 +427,9 @@ static uint64_t malta_fpga_read(void *opaque, hwaddr addr, break; default: -#if 0 - printf("malta_fpga_read: Bad register offset 0x" TARGET_FMT_lx "\n", - addr); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "malta_fpga_read: Bad register offset 0x" + TARGET_FMT_lx "\n", addr); break; } return val; @@ -515,10 +514,9 @@ static void malta_fpga_write(void *opaque, hwaddr addr, break; default: -#if 0 - printf("malta_fpga_write: Bad register offset 0x" TARGET_FMT_lx "\n", - addr); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "malta_fpga_write: Bad register offset 0x" + TARGET_FMT_lx "\n", addr); break; } }