All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: Bob Breuer <breuerr@mc.net>
Cc: "Blue Swirl" <blauwirbel@gmail.com>,
	"Andreas Färber" <andreas.faerber@web.de>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: [PATCH] sparc32: ledma extra registers
Date: Mon, 20 Dec 2010 11:22:09 +0100	[thread overview]
Message-ID: <AANLkTimY3tqRQ_dTjPJAYyUNLXSGgq4BG33pT+6Va7qn@mail.gmail.com> (raw)
In-Reply-To: <4D0E5F16.3090905@mc.net>

On Sun, Dec 19, 2010 at 8:37 PM, Bob Breuer <breuerr@mc.net> wrote:
> Andreas Färber wrote:
>> Am 18.12.2010 um 19:53 schrieb Blue Swirl:
>>
>>> On Sat, Dec 18, 2010 at 5:09 PM, Bob Breuer <breuerr@mc.net> wrote:
>>>> ledma has 0x20 bytes of registers according to OBP, and at least
>>>> Solaris9
>>>> reads the 5th register which is beyond what we've mapped.  So let's
>>>> setup
>>>> a flag (inspired by a previous patch from Blue Swirl) to identify ledma
>>>> from espdma, and map another 16 bytes of registers which return 0.
>>>>
>>>> Signed-off-by: Bob Breuer <breuerr@mc.net>
>>
>> I'm not familar with that part of code but...
>>
>>>> diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c
>>>> index e78f025..56be8c8 100644
>>>> --- a/hw/sparc32_dma.c
>>>> +++ b/hw/sparc32_dma.c
>>
>>>> @@ -165,6 +169,9 @@ static uint32_t dma_mem_readl(void *opaque,
>>>> target_phys_addr_t addr)
>>>>     DMAState *s = opaque;
>>>>     uint32_t saddr;
>>>>
>>>> +    if (s->is_ledma && (addr > DMA_MAX_REG_OFFSET)) {
>>>> +        return 0; /* extra mystery register(s) */
>>
>> Wouldn't it be a good idea to trace these "mystery" reads...
>>
>>>> +    }
>>>>     saddr = (addr & DMA_MASK) >> 2;
>>>>     trace_sparc32_dma_mem_readl(addr, s->dmaregs[saddr]);
>>>>     return s->dmaregs[saddr];
>>>> @@ -175,6 +182,9 @@ static void dma_mem_writel(void *opaque,
>>>> target_phys_addr_t addr, uint32_t val)
>>>>     DMAState *s = opaque;
>>>>     uint32_t saddr;
>>>>
>>>> +    if (s->is_ledma && (addr > DMA_MAX_REG_OFFSET)) {
>>>> +        return; /* extra mystery register(s) */
>>
>> ...and writes? We return just before the tracepoints fire.
>>
>
> Ok, I'll put together a patch to add the trace calls just before the
> returns.  How about I also call it undocumented instead of mystery.
> None of the BSD's or Linux know about or use anything beyond the 4
> registers.

I'd use "aliased" instead of mystery.  On a real SS-5:

ok 78400020 20 spacel@ .
a4240050
ok 78400000 20 spacel@ .
a4240050
ok 78400024 20 spacel@ .
fc004000
ok 78400004 20 spacel@ .
fc004000

Addresses 0x7840002x are aliases for 0x7840000x. As well as
0x7840004x. And so on up to
ok 787fffe4 20 spacel@ .
fc004000
78800004 20 spacel@ .
0

Or a real SS-20 ef0400000 is aliased up to ef37fffe0

Fwiw I think it's a bug in the later Solaris versions:
http://tyom.blogspot.com/2010/10/bug-in-all-solaris-versions-after-57.html

On the bare metal it works because of address aliasing. If you want to
emulate the hw precisely, the Blue's generic aliasing patch can be
used here. The question is though do we want to do a generic aliasing
for all the SBUS devices, or just in the single case(es) where we know
is necessary.

On the other hand Solaris seems to be fine with a 0 stub too.

-- 
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/

  parent reply	other threads:[~2010-12-20 10:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 17:09 [Qemu-devel] [PATCH] sparc32: ledma extra registers Bob Breuer
2010-12-18 18:53 ` [Qemu-devel] " Blue Swirl
2010-12-18 20:26   ` Andreas Färber
2010-12-19 19:37     ` Bob Breuer
2010-12-19 20:00       ` [Qemu-devel] [PATCH] sparc32: ledma extra registers need tracing too Bob Breuer
2010-12-20 17:55         ` [Qemu-devel] [PATCH v2] " Bob Breuer
2010-12-20 21:20           ` [Qemu-devel] " Blue Swirl
2010-12-20 10:22       ` Artyom Tarasenko [this message]
2010-12-20 17:33         ` [Qemu-devel] Re: [PATCH] sparc32: ledma extra registers Bob Breuer
2010-12-21  9:28           ` Artyom Tarasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimY3tqRQ_dTjPJAYyUNLXSGgq4BG33pT+6Va7qn@mail.gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=andreas.faerber@web.de \
    --cc=blauwirbel@gmail.com \
    --cc=breuerr@mc.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.