From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 2176DC433E0 for ; Tue, 5 Jan 2021 11:08:17 +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 66FC5229C5 for ; Tue, 5 Jan 2021 11:08:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66FC5229C5 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]:56734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwkCF-0006FJ-AI for qemu-devel@archiver.kernel.org; Tue, 05 Jan 2021 06:08:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwkAE-0005Rs-Ia for qemu-devel@nongnu.org; Tue, 05 Jan 2021 06:06:10 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:55263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwkAC-0000D9-Tq for qemu-devel@nongnu.org; Tue, 05 Jan 2021 06:06:10 -0500 Received: by mail-wm1-x334.google.com with SMTP id c133so2636140wme.4 for ; Tue, 05 Jan 2021 03:06:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EFMyGSDJt4qj6NP/4S3XK5VuofbF5cddEcI+tpbu6ss=; b=eru1qnHPbUR8R73Sff4pNQGyc7cOSN8uARFZ2zP/MP4SL8p9cq7VIA+oVGuvOateo3 ftw095N7j3KoDMzELTbW5bHhDHuUPkDdDP/0B39Dk8XfAXyZl7VetYD+0Jt5h82ys0KS iVWitGpVgbvJplYLZqWKGyCxDaNYwCNOAA+tB5GA4nmXYvqtggVQ3xyXyMuP3d2D4soA 6STcaVm7S4YBU6giZC82FP8h7qGVPUuBooVr+P8GzEYYkz2b3TyRAVBbDOWqiMZ0Gx9X qXpmT3WtxUwqffYFZwc3vcS8OeIQHaj0WPxnsE4y/Et9lW5H/1URQ+TuRJ1aZ2ikZSAS MvLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EFMyGSDJt4qj6NP/4S3XK5VuofbF5cddEcI+tpbu6ss=; b=q2HW/OCPCqsbpJpr45BfjsUvFxXX9G76Oilqbvimanc9f0xJ1t5i/wEgplsVDNrvst qbVEisK6FL0O9Jv1COFJ2atBYgi5e/8ttTx0In3HxXhwl4hZEU4A89K5/2GykD/37XfZ MZ6Oy/sdrEuv4p9ah9cwYdQPTmcezxJ36qgasocmdymb4QtIjpiy+ya+74JSGG211BuN rGM8jchCOL9HpiQc9EeACRhxm0inZWWQKLDzFuymOgUaZFacrLYZhQEawpZm3YPi2wTd scjBgFHybkRTK03cvJGDsKhV4b8WloRQPSbZh4oICGk/jEEeKUBqJ9MjT4QWAXFHUHTA kHOw== X-Gm-Message-State: AOAM533RZaVs0UWRDstPe2kAJ0zMK3oWbKdpWePHQ2GhwwtCRBUR5Iby 3hAfcgllB2VCtcjXc0xl7xU= X-Google-Smtp-Source: ABdhPJwmCZviwiJZzuMDTYlHOcS3SrNhIn2LQ8IbikrAhnxZ8cG1UVSZxmVefKxWWOcmQmWVnoyuNA== X-Received: by 2002:a7b:cc94:: with SMTP id p20mr2966305wma.22.1609844767281; Tue, 05 Jan 2021 03:06:07 -0800 (PST) Received: from [192.168.1.36] (241.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.241]) by smtp.gmail.com with ESMTPSA id s6sm104908391wro.79.2021.01.05.03.06.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Jan 2021 03:06:06 -0800 (PST) Subject: Re: [PATCH] hw/timer/slavio_timer: Allow 64-bit accesses To: qemu-devel@nongnu.org References: <20201205150903.3062711-1-f4bug@amsat.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Tue, 5 Jan 2021 12:06:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201205150903.3062711-1-f4bug@amsat.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-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: Benoit Canet , "Michael S . Tsirkin" , Mark Cave-Ayland , Yap KV , 1906905@bugs.launchpad.net, Artyom Tarasenko Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" ping? On 12/5/20 4:09 PM, Philippe Mathieu-Daudé wrote: > Per the "NCR89C105 Chip Specification" referenced in the header: > > Chip-level Address Map > > ------------------------------------------------------------------ > | 1D0 0000 -> | Counter/Timers | W,D | > | 1DF FFFF | | | > ... > > The address map indicated the allowed accesses at each address. > [...] W indicates a word access, and D indicates a double-word > access. > > The SLAVIO timer controller is implemented expecting 32-bit accesses. > Commit a3d12d073e1 restricted the memory accesses to 32-bit, while > the device allows 64-bit accesses. > > This was not an issue until commit 5d971f9e67 which reverted > ("memory: accept mismatching sizes in memory_region_access_valid"). > > Fix by renaming .valid MemoryRegionOps as .impl, and add the valid > access range (W -> 4, D -> 8). > > Since commit 21786c7e598 ("memory: Log invalid memory accesses") > this class of bug can be quickly debugged displaying 'guest_errors' > accesses, as: > > $ qemu-system-sparc -M SS-20 -m 256 -bios ss20_v2.25_rom -serial stdio -d guest_errors > > Power-ON Reset > Invalid access at addr 0x0, size 8, region 'timer-1', reason: invalid size (min:4 max:4) > > $ qemu-system-sparc -M SS-20 -m 256 -bios ss20_v2.25_rom -monitor stdio -S > (qemu) info mtree > address-space: memory > 0000000000000000-ffffffffffffffff (prio 0, i/o): system > ... > 0000000ff1300000-0000000ff130000f (prio 0, i/o): timer-1 > ^^^^^^^^^ ^^^^^^^ > \ memory region base address and name / > > (qemu) info qtree > bus: main-system-bus > dev: slavio_timer, id "" <-- device type name > gpio-out "sysbus-irq" 17 > num_cpus = 1 (0x1) > mmio 0000000ff1310000/0000000000000014 > mmio 0000000ff1300000/0000000000000010 <--- base address > mmio 0000000ff1301000/0000000000000010 > mmio 0000000ff1302000/0000000000000010 > ... > > Reported-by: Yap KV > Buglink: https://bugs.launchpad.net/bugs/1906905 > Fixes: a3d12d073e1 ("slavio_timer: convert to memory API") > Signed-off-by: Philippe Mathieu-Daudé > --- > Cc: Benoit Canet > Cc: <1906905@bugs.launchpad.net> > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/timer/slavio_timer.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c > index 5b2d20cb6a5..03e33fc5926 100644 > --- a/hw/timer/slavio_timer.c > +++ b/hw/timer/slavio_timer.c > @@ -331,6 +331,10 @@ static const MemoryRegionOps slavio_timer_mem_ops = { > .write = slavio_timer_mem_writel, > .endianness = DEVICE_NATIVE_ENDIAN, > .valid = { > + .min_access_size = 4, > + .max_access_size = 8, > + }, > + .impl = { > .min_access_size = 4, > .max_access_size = 4, > }, > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 96F29C433E0 for ; Tue, 5 Jan 2021 11:23:49 +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 96363229C5 for ; Tue, 5 Jan 2021 11:23:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96363229C5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bugs.launchpad.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwkRH-0002qh-BK for qemu-devel@archiver.kernel.org; Tue, 05 Jan 2021 06:23:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwkOx-0001jw-PR for qemu-devel@nongnu.org; Tue, 05 Jan 2021 06:21:25 -0500 Received: from indium.canonical.com ([91.189.90.7]:37256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwkOk-0006lM-Ku for qemu-devel@nongnu.org; Tue, 05 Jan 2021 06:21:22 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1kwkOi-0001kD-HB for ; Tue, 05 Jan 2021 11:21:08 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 80EE12E8134 for ; Tue, 5 Jan 2021 11:21:08 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 05 Jan 2021 11:06:05 -0000 From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <1906905@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=Confirmed; importance=Undecided; assignee=None; X-Launchpad-Bug-Tags: sparc X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: mark-cave-ayland philmd yapkv X-Launchpad-Bug-Reporter: yapkv (yapkv) X-Launchpad-Bug-Modifier: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9_=28philmd?= =?utf-8?q?=29?= References: <160714087524.10652.4920404623701840898.malonedeb@soybean.canonical.com> <20201205150903.3062711-1-f4bug@amsat.org> Message-ID: Subject: [Bug 1906905] Re: [PATCH] hw/timer/slavio_timer: Allow 64-bit accesses X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="34b3ffd45c9543b7f7aa5aa313925241e9e7ca3f"; Instance="production" X-Launchpad-Hash: 7e649b2bddd9980b245cc9c791b0aef23520ceb5 Received-SPF: none client-ip=91.189.90.7; envelope-from=bounces@canonical.com; helo=indium.canonical.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1906905 <1906905@bugs.launchpad.net> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20210105110605.VsrFkNupeAm0eUulGNRF09SdnRJicGG-zQgYt2ZUnK0@z> ping? On 12/5/20 4:09 PM, Philippe Mathieu-Daud=C3=A9 wrote: > Per the "NCR89C105 Chip Specification" referenced in the header: > = > Chip-level Address Map > = > ------------------------------------------------------------------ > | 1D0 0000 -> | Counter/Timers | W,D | > | 1DF FFFF | | | > ... > = > The address map indicated the allowed accesses at each address. > [...] W indicates a word access, and D indicates a double-word > access. > = > The SLAVIO timer controller is implemented expecting 32-bit accesses. > Commit a3d12d073e1 restricted the memory accesses to 32-bit, while > the device allows 64-bit accesses. > = > This was not an issue until commit 5d971f9e67 which reverted > ("memory: accept mismatching sizes in memory_region_access_valid"). > = > Fix by renaming .valid MemoryRegionOps as .impl, and add the valid > access range (W -> 4, D -> 8). > = > Since commit 21786c7e598 ("memory: Log invalid memory accesses") > this class of bug can be quickly debugged displaying 'guest_errors' > accesses, as: > = > $ qemu-system-sparc -M SS-20 -m 256 -bios ss20_v2.25_rom -serial stdio = -d guest_errors > = > Power-ON Reset > Invalid access at addr 0x0, size 8, region 'timer-1', reason: invalid s= ize (min:4 max:4) > = > $ qemu-system-sparc -M SS-20 -m 256 -bios ss20_v2.25_rom -monitor stdio= -S > (qemu) info mtree > address-space: memory > 0000000000000000-ffffffffffffffff (prio 0, i/o): system > ... > 0000000ff1300000-0000000ff130000f (prio 0, i/o): timer-1 > ^^^^^^^^^ ^^^^^^^ > \ memory region base address and name / > = > (qemu) info qtree > bus: main-system-bus > dev: slavio_timer, id "" <-- device type name > gpio-out "sysbus-irq" 17 > num_cpus =3D 1 (0x1) > mmio 0000000ff1310000/0000000000000014 > mmio 0000000ff1300000/0000000000000010 <--- base address > mmio 0000000ff1301000/0000000000000010 > mmio 0000000ff1302000/0000000000000010 > ... > = > Reported-by: Yap KV > Buglink: https://bugs.launchpad.net/bugs/1906905 > Fixes: a3d12d073e1 ("slavio_timer: convert to memory API") > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > Cc: Benoit Canet > Cc: <1906905@bugs.launchpad.net> > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/timer/slavio_timer.c | 4 ++++ > 1 file changed, 4 insertions(+) > = > diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c > index 5b2d20cb6a5..03e33fc5926 100644 > --- a/hw/timer/slavio_timer.c > +++ b/hw/timer/slavio_timer.c > @@ -331,6 +331,10 @@ static const MemoryRegionOps slavio_timer_mem_ops = =3D { > .write =3D slavio_timer_mem_writel, > .endianness =3D DEVICE_NATIVE_ENDIAN, > .valid =3D { > + .min_access_size =3D 4, > + .max_access_size =3D 8, > + }, > + .impl =3D { > .min_access_size =3D 4, > .max_access_size =3D 4, > }, > -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1906905 Title: qemu-system-sparc stucked while booting using ss20_v2.25_rom Status in QEMU: Confirmed Bug description: I cannot boot up OBP using the current (5.1) version of qemu with ss20_v2.25_rom. It just stuck at "Power-ON reset" and hanged. However using the previous version from 2015 I can successfully both up the OBP. qemu-system-sparc -M SS-20 -m 256 -bios ss20_v2.25.rom -nographic Power-ON Reset (*hang) regards Yap KV To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1906905/+subscriptions