From patchwork Tue Sep 1 14:40:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 274918 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, 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 21F35C433E6 for ; Tue, 1 Sep 2020 15:14:46 +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 E115E206FA for ; Tue, 1 Sep 2020 15:14:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MhzHMidq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E115E206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD7zh-0002Fs-2p for qemu-devel@archiver.kernel.org; Tue, 01 Sep 2020 11:14:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD7TA-0004EA-Pd; Tue, 01 Sep 2020 10:41:08 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39144) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD7T9-0008Rq-7b; Tue, 01 Sep 2020 10:41:08 -0400 Received: by mail-wm1-x344.google.com with SMTP id b79so1404896wmb.4; Tue, 01 Sep 2020 07:41:06 -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=Yw0o3aDHS2ktNtFlFwU+FwiNBr3VIt0o9HwcG9CrL1o=; b=MhzHMidqhoXGQZqvzWG9dkGG11BwkkaD68W7LIT4q72sUUaBo+YDQ7IKv15oaJ8qla wjbBBrKxZ7yiyq624NNO+zOwMjwmzPXcN2XfdwQ+oICWFbzHQ0KFJ9f/zVkwyez/HU+T GvTLsP5163UUxsd5EPPL+t/mHTehlv9gG1Zf81ee4nbXwYuBLbXyNPwSnde/v0DyxlZ+ IggVGyTeDevj9xbDjXWsYRhmsgT5ejh75A9dM4mJ0ACwWULPoUxJ1Kapfjh1AOa+y82V JupWedHRGCG0FxpOJ5bDJNkKnyfC5PWGfhs4zOthvnYr/oGPtf8S8STl618fa8o8SZps ef7g== 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=Yw0o3aDHS2ktNtFlFwU+FwiNBr3VIt0o9HwcG9CrL1o=; b=SFWcQ86VryJQtpyZ2ZWJHSzC42DbtyEBooQ3KDIEksU/5Qkp6yikxUELU47IR/dz8W IHmD0vN4ER82GncO9jfJX0SgpiyLPhwU1C4FgLtM96ajWA5BC+6a606AwNt3CQb12aiF jrF2F6d+OqAzJVCuellYMf4IBmOF9oAOsQr1TK1rnPZux+wde5qmirKe5FvUXaaHBDtc YN6twdVoH67seK2KTjbelwT1gMYEjRVAPGtfruzf5vp+iQCcss50/uO0lJ5nV81jnCtJ SpUp/wctTWPm7plg8kpUsEF2S5F55ooZtOmSakEkzRzfnAhcgRAliJEB7hBKL0l0Ejyj 9hoQ== X-Gm-Message-State: AOAM530hXEuCjIoNk5SQRtvXDbyuRezUYvGTkasyoSv5/aOG8mGV/q6n k2qk/c0LvPh+m5owgq3AetXpdSkMSQU= X-Google-Smtp-Source: ABdhPJx4JjS4906P0zwy5E9hRQ5IeDMxQktg+ks+CiWeSOvnKXMad5hUY7dLNBrgm9SY6KAvVPOAdA== X-Received: by 2002:a1c:1f42:: with SMTP id f63mr2044061wmf.1.1598971265339; Tue, 01 Sep 2020 07:41:05 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id a82sm2213204wmc.45.2020.09.01.07.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 07:41:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/4] hw/misc/a9scu: Simplify setting MemoryRegionOps::valid fields Date: Tue, 1 Sep 2020 16:40:58 +0200 Message-Id: <20200901144100.116742-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901144100.116742-1-f4bug@amsat.org> References: <20200901144100.116742-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x344.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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, 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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Per the datasheet (DDI0407 r2p0): "All SCU registers are byte accessible" and are 32-bit aligned. Set MemoryRegionOps::valid min/max fields and simplify the write() handler. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/a9scu.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c index 915f127761e..3f3dcc414fe 100644 --- a/hw/misc/a9scu.c +++ b/hw/misc/a9scu.c @@ -52,23 +52,8 @@ static void a9_scu_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { A9SCUState *s = (A9SCUState *)opaque; - uint32_t mask; + uint32_t mask = MAKE_64BIT_MASK(0, size * 8); uint32_t shift; - switch (size) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - case 4: - mask = 0xffffffff; - break; - default: - fprintf(stderr, "Invalid size %u in write to a9 scu register %x\n", - size, (unsigned)offset); - return; - } switch (offset) { case 0x00: /* Control */ @@ -99,6 +84,10 @@ static void a9_scu_write(void *opaque, hwaddr offset, static const MemoryRegionOps a9_scu_ops = { .read = a9_scu_read, .write = a9_scu_write, + .valid = { + .min_access_size = 1, + .max_access_size = 4, + }, .endianness = DEVICE_NATIVE_ENDIAN, }; From patchwork Tue Sep 1 14:40:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 274922 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 C3CA9C433E7 for ; Tue, 1 Sep 2020 15:05:41 +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 8BA0620BED for ; Tue, 1 Sep 2020 15:05:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="u/VemtCj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BA0620BED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD7qu-00036f-LK for qemu-devel@archiver.kernel.org; Tue, 01 Sep 2020 11:05:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD7TC-0004Fo-Ot; Tue, 01 Sep 2020 10:41:10 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:51179) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD7TA-0008S7-E9; Tue, 01 Sep 2020 10:41:09 -0400 Received: by mail-wm1-x344.google.com with SMTP id e17so1425422wme.0; Tue, 01 Sep 2020 07:41:07 -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=pHNAYrNieu1B/5GPFduULWjxl/G5it3aeYsEpJLKzAg=; b=u/VemtCjA72ycMPJGwnhrVInkqeGfOL1kePfJtx7FgMOpP245ld2tOqRqkNzz3YSRC q/bzmZipjQP/p3GauRf3IsbEuQj/+9o9z+taZop4xwR29HjByzwPhrrrTtqhBYogeuNX 6i/9nHaJgs81Wi5ILVJ31wMMqcQYVdTlcfmQrFfavl7yJ0H0j6HqvhI8e2yMCgYaEnrM 1JCrL6c64tERQCAor935U5JGUI/hcAkcB0w8c7j+GzNYsBicyG3O0zJ89Lh+kPjUhb7I D0WZaTDwKhqeI9HEmBcMmhLMrrx0w2gsFc5BOVxEvFgHAfQNFrLA+JRMMwuzxHRGUmSG ob2Q== 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=pHNAYrNieu1B/5GPFduULWjxl/G5it3aeYsEpJLKzAg=; b=QhcLh9ikpIf1yJcoyw6t5n79Z0sGhG2YWSxSKfsQMnTbXh8jhW2lO4qZFO98e/2njg RCre6kVP+GfulCt0e8qD7445Z8nJVkyaJ3e2D4txMY/b6EHdG+ThLc43WRpmt/mQ1g/g SJkMeO/nggA7BNx1zNBtP2VvpsyAYbjmKDYlkDHsd042IiDYanbY1P4Nr1z3jQgUQk1S qpf6wjcXsu0bpJjF2MlPJ5VjNxCXJr5eGMNCzRmIytpKaOlkwTNMrHsZ773V7C4qA4HS e72H3dJmYhbPaObYZzi+z/GyfdWwqTTbn3E7EYYUthaw072d+6rzAsuAlsvYuV+fx2Nu 0W8w== X-Gm-Message-State: AOAM530DRtqKbG1HM/uCv2paTeQPMFDBa+RZwv3zKk7qLpdL3+ePr2AS n9MR1LMwq46stPjq8SrmKOFPH9g93lg= X-Google-Smtp-Source: ABdhPJw6oWec4iF2ldZ49pXjCurt3QO6RRa5U5qQQZAhrKvuedgTBnuKiU0l/ZO922hg0FHzBB9t0Q== X-Received: by 2002:a1c:2cd7:: with SMTP id s206mr2174171wms.165.1598971266604; Tue, 01 Sep 2020 07:41:06 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id a82sm2213204wmc.45.2020.09.01.07.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 07:41:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/4] hw/misc/a9scu: Simplify setting MemoryRegionOps::impl fields Date: Tue, 1 Sep 2020 16:40:59 +0200 Message-Id: <20200901144100.116742-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901144100.116742-1-f4bug@amsat.org> References: <20200901144100.116742-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x344.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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, 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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This model implementation is designed for 32-bit accesses. We can simplify setting the MemoryRegionOps::impl min/max fields to 32-bit (memory::access_with_adjusted_size() will take care of the 8/16-bit accesses). Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/a9scu.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c index 3f3dcc414fe..47f948341f7 100644 --- a/hw/misc/a9scu.c +++ b/hw/misc/a9scu.c @@ -28,12 +28,6 @@ static uint64_t a9_scu_read(void *opaque, hwaddr offset, return (((1 << s->num_cpu) - 1) << 4) | (s->num_cpu - 1); case 0x08: /* CPU Power Status */ return s->status; - case 0x09: /* CPU status. */ - return s->status >> 8; - case 0x0a: /* CPU status. */ - return s->status >> 16; - case 0x0b: /* CPU status. */ - return s->status >> 24; case 0x0c: /* Invalidate All Registers In Secure State */ return 0; case 0x40: /* Filtering Start Address Register */ @@ -52,8 +46,6 @@ static void a9_scu_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { A9SCUState *s = (A9SCUState *)opaque; - uint32_t mask = MAKE_64BIT_MASK(0, size * 8); - uint32_t shift; switch (offset) { case 0x00: /* Control */ @@ -62,9 +54,7 @@ static void a9_scu_write(void *opaque, hwaddr offset, case 0x4: /* Configuration: RO */ break; case 0x08: case 0x09: case 0x0A: case 0x0B: /* Power Control */ - shift = (offset - 0x8) * 8; - s->status &= ~(mask << shift); - s->status |= ((value & mask) << shift); + s->status = value; break; case 0x0c: /* Invalidate All Registers In Secure State */ /* no-op as we do not implement caches */ @@ -84,6 +74,10 @@ static void a9_scu_write(void *opaque, hwaddr offset, static const MemoryRegionOps a9_scu_ops = { .read = a9_scu_read, .write = a9_scu_write, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 1, .max_access_size = 4, From patchwork Tue Sep 1 14:41:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 274921 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 668B2C433E6 for ; Tue, 1 Sep 2020 15:07:11 +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 2D62C2137B for ; Tue, 1 Sep 2020 15:07:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o7cuozSm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D62C2137B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD7sM-0006fe-8X for qemu-devel@archiver.kernel.org; Tue, 01 Sep 2020 11:07:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD7TE-0004Kn-MO; Tue, 01 Sep 2020 10:41:12 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:34121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD7TC-0008SW-QO; Tue, 01 Sep 2020 10:41:12 -0400 Received: by mail-wr1-x443.google.com with SMTP id t10so988030wrv.1; Tue, 01 Sep 2020 07:41: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=/0CItXRpsjbnSZbfizzT7hsK4ATPfYOi35n7IOshX5M=; b=o7cuozSmNCtHclFzjtvLc+2uq/AH828HkMYG9Ib4urkGyXXrjBmIC94PEzxRVPFlIc uR8ZhLKi3t039gT4bAzFhwN1pd7UF6RgJoSc6znVg0FQfbLSur3e/NinKIgt/ynG7DOh KfecV5gm4ZfRZ0iUxJ4H4Rl7c0Atv78JJMfpO3DQ+QgFl4EthmGCnZ3++enRWd7120nz uC2WwMHzhHkW+RW4sOLdqjojmxPeNsudKn712JlQMK3sfIQHnt6PHH5RSXg1dh5VasNg zHJ48UJFESDed8Us5pTtinmkOlGsNJ0RSCjKSzq3pEG3McpA1f/afMN7yfbi2K10ZK2T bhIA== 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=/0CItXRpsjbnSZbfizzT7hsK4ATPfYOi35n7IOshX5M=; b=Tu1zFg7b9YhKB2RxoymIizbctVsXRc7vBtR8LNCpI1awXROI7Vt7ps2RcUpFQbWb67 22k5dKMn3irGVfXaaK0HQX7qP6J9TykrDcdzQ1iBchbeeoE7rws2PuPAO7wDmIzkbeZo 2nxxI4l4XLKt9JFt0M5UFg3WyNCN7VZTkFI/Mp/ZVzoca6QLtLQj47uZk7FUKwQ2bdAs LC34iay3PjMT8Fw+H4507pKaYnWZjcB0bGYMCEpF/GzcM3h4nMMmS7nmNJXiwQAKhWM+ qmsWzMJNkJYso3VAupV3iGS9HiHiuBs2hAVkx1UZmb7Z5linitQZkSSOxdbDqzVZII5K F7Kw== X-Gm-Message-State: AOAM531WUlv21WTUanzrGCHI7HhhlxbBz2Sjy7PfB3KH+VT7rFf9HxK3 B22dc73Or0AmJMjhsK0skC9xcJqfd8U= X-Google-Smtp-Source: ABdhPJyu703r5xF86dtH6sAH1kZE6X0yeRaqx/Eyd4WkwcnimUOmnbnFPwY54NonX61jR2xXXHiNtQ== X-Received: by 2002:adf:aad1:: with SMTP id i17mr2433806wrc.360.1598971267766; Tue, 01 Sep 2020 07:41:07 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id a82sm2213204wmc.45.2020.09.01.07.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 07:41:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/4] hw/misc/a9scu: Report unimplemented accesses with qemu_log_mask(UNIMP) Date: Tue, 1 Sep 2020 16:41:00 +0200 Message-Id: <20200901144100.116742-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901144100.116742-1-f4bug@amsat.org> References: <20200901144100.116742-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, 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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Report unimplemented register accesses using qemu_log_mask(UNIMP). Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/a9scu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c index 47f948341f7..a375ebc9878 100644 --- a/hw/misc/a9scu.c +++ b/hw/misc/a9scu.c @@ -13,6 +13,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qapi/error.h" +#include "qemu/log.h" #include "qemu/module.h" #define A9_SCU_CPU_MAX 4 @@ -38,6 +39,8 @@ static uint64_t a9_scu_read(void *opaque, hwaddr offset, case 0x54: /* SCU Non-secure Access Control Register */ /* unimplemented, fall through */ default: + qemu_log_mask(LOG_UNIMP, "%s: Unsupported offset 0x%"HWADDR_PRIx"\n", + __func__, offset); return 0; } } @@ -67,6 +70,9 @@ static void a9_scu_write(void *opaque, hwaddr offset, case 0x54: /* SCU Non-secure Access Control Register */ /* unimplemented, fall through */ default: + qemu_log_mask(LOG_UNIMP, "%s: Unsupported offset 0x%"HWADDR_PRIx + " value 0x%"PRIx64"\n", + __func__, offset, value); break; } }