Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C46CEC433EF for ; Fri, 29 Oct 2021 23:41:38 +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 3484A6044F for ; Fri, 29 Oct 2021 23:41:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3484A6044F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eik.bme.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgbVA-0000Fc-Op for qemu-devel@archiver.kernel.org; Fri, 29 Oct 2021 19:41:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgbQ3-0006uj-Sz for qemu-devel@nongnu.org; Fri, 29 Oct 2021 19:36:19 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]:18352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgbQ1-0002Ii-7M for qemu-devel@nongnu.org; Fri, 29 Oct 2021 19:36:19 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 7CD2A7475FA; Sat, 30 Oct 2021 01:36:15 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id F37FC746333; Sat, 30 Oct 2021 01:36:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id EF72B7462D3; Sat, 30 Oct 2021 01:36:14 +0200 (CEST) Date: Sat, 30 Oct 2021 01:36:14 +0200 (CEST) From: BALATON Zoltan To: =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= Subject: Re: [PATCH v6 29/30] hw/timer/sh_timer: Fix timer memory region size In-Reply-To: Message-ID: <851b67-fd93-ec4a-cb80-3fd83a9a374@eik.bme.hu> References: <82ca7d39f47685f35f735e40ab1dfa8fa1b86b9b.1635541329.git.balaton@eik.bme.hu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3866299591-1581180928-1635550574=:5796" Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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: Peter Maydell , Magnus Damm , Richard Henderson , qemu-devel@nongnu.org, Yoshinori Sato Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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-1581180928-1635550574=:5796 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Sat, 30 Oct 2021, Philippe Mathieu-Daudé wrote: > On 10/29/21 23:02, BALATON Zoltan wrote: >> The timer memory region is only accessed via aliases that are 0x1000 >> bytes long, no need to have the timer region larger than that. >> >> Signed-off-by: BALATON Zoltan >> --- >> hw/timer/sh_timer.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c >> index 250ad41b48..a6445092e4 100644 >> --- a/hw/timer/sh_timer.c >> +++ b/hw/timer/sh_timer.c >> @@ -350,8 +350,7 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base, int feat, uint32_t freq, >> ch2_irq0); /* ch2_irq1 not supported */ >> } >> >> - memory_region_init_io(&s->iomem, NULL, &tmu012_ops, s, >> - "timer", 0x100000000ULL); >> + memory_region_init_io(&s->iomem, NULL, &tmu012_ops, s, "timer", 0x1000); > > Per the manual (R01UH0457EJ0401 Rev. 4.01 [*]) Page 317/1128, Table > 12.2 "TMU Registers" the first 3 timers (implemented by the tmu012_state > structure) fit in a region of 0x30 bytes. Sent a v7 of this patch only changing it to 0x30 with which the Linux image I've tested still boots but don't know if it uses a timer at all. > Looking at hw/timer/sh_timer.c I only see a maximum access of 0x40, Where do you see 0x40? > where 0x1000 comes from? The P4/A7 aliases? Yes, as the commit message said. Since this was a last minute change I tried to be safe and not change anything guest visible at this point. > If you have a way to test and ack, I can replace by 0x40 when applying. If you think 0x40 is better then I'm fine with that but I don't see a register after 0x2c which is 32 bits so 0x30 length should be enough according to that. Regards. BALATON Zoltan > [*] > https://www.renesas.com/us/en/document/mah/sh7751-group-sh7751r-group-users-manual-hardware?language=en&r=1055171 > > --3866299591-1581180928-1635550574=:5796--