qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: <jasper.lowell@bt.com>
To: <atar4qemu@gmail.com>
Cc: tony.nguyen@bt.com, peter.tribble@gmail.com,
	mark.cave-ayland@ilande.co.uk, dgilbert@redhat.com,
	qemu-devel@nongnu.org
Subject: Re: Emulating Solaris 10 on SPARC64 sun4u
Date: Mon, 18 May 2020 02:56:40 +0000	[thread overview]
Message-ID: <be68b7ad559ec17c69439217c1378c23e30745c9.camel@bt.com> (raw)
In-Reply-To: <CACXAS8DqO8CSkkSbD5aivGxL8xVB-FS5Bm0TL3ad+OLsvzcuxg@mail.gmail.com>

> Great progress! Are you planning to contribute your escc2 to the
> upstream?

I would like to. While it didn't solve the console difficulties on
OpenSolaris variants, it's probably still a good idea to increment
Sun4u emulation towards being more faithful to hardware. It will take
me a few weeks to clean up and test but I'll make an RFC once I have a
patch to discuss. It's unlikely that the patch will be feature complete
but I'll aim for it to be enough to satisfy the Linux/OpenBSD drivers.

> We can use the strategy I used 10 years back for sun4m: boot the
> proprietary firmware first to reduce the number of possible emulation
> bugs. The proprietary firmware is known to boot Solaris.

Using the proprietary firmware for this would be ideal. It would also
provide reliable access to the kernel debugger which would be extremely
helpful for diagnosing what's going wrong with the console. I'm not
sure how I would go about making progress on this though. I know there
are binaries of the BIOS for Sun4m machines floating around but I'm not
aware of any for Sun4u machines.

Thanks,
Jasper Lowell.

On Sun, 2020-05-17 at 14:37 +0200, Artyom Tarasenko wrote:
> On Sun, May 17, 2020 at 9:57 AM <jasper.lowell@bt.com> wrote:
> > I've written up a basic implementation of the SAB 82532 ESCC2
> > device
> > and have written a patch for OpenBIOS to add it to the device tree.
> > I
> > still have the 16550A UART acting as ttya to avoid having to write
> > an
> > OpenBIOS device driver.
> 
> Great progress! Are you planning to contribute your escc2 to the
> upstream?
> 
> > OpenBSD and Solaris both identify the device correctly and attach
> > it.
> > 
> > Interestingly, it looks like Solaris entered an interrupt handler
> > to
> > deal with an event for the SAB 82532 and it probed a few status
> > registers. Given that I couldn't encourage Solaris to do anything
> > outside of attach the device for the 16550A, I was thinking this
> > might
> > be a good sign.
> > 
> > There really shouldn't be an interrupt though as the reset state of
> > the
> > SAB 82532 is to have all interrupts masked. Solaris probes these
> > interrupt status registers while "configuring" the sunhme device.
> > 
> > Attempting to configure interface hme0...
> > 140070@1589698603.268942:escc2_mem_read channel a addr 0x38 value
> > 0x4
> > 140070@1589698603.269011:escc2_irq_update value 0x0
> > 140070@1589698603.269015:escc2_mem_read channel a addr 0x3a value
> > 0x80
> > 140070@1589698603.269017:escc2_irq_update value 0x0
> > 140070@1589698603.269018:escc2_mem_read channel a addr 0x3b value
> > 0x0
> > 140070@1589698603.269076:escc2_mem_read channel a addr 0x38 value
> > 0x0
> > WARNING: Power off requested from power button or SC, powering down
> > the
> > system!
> > 140070@1589698611.270845:escc2_mem_read channel a addr 0x38 value
> > 0x0
> > 140070@1589698619.271758:escc2_mem_read channel a addr 0x38 value
> > 0x0
> > 
> > I've noticed that removing the sunhme code for sun4u.c in QEMU
> > prevents
> > the spurious interrupt from happening for the serial device along
> > with
> > prevent the unexpected power off request (the power off request was
> > not
> > introduced by my code). I haven't investigated why the presence of
> > sunhme causes these events.
> > 
> > I modified OpenBIOS to use ttyb for stdin/stdout and assigned that
> > to
> > the 16550A so that ttya could be aliased to the SAB 82532. Outside
> > of
> > the spurious interrupt handler being called, I'm getting the same
> > behaviour where Solaris identifies, attaches, and then ignores the
> > device. Doesn't look like my guess was on the mark.
> > 
> > I'll be looking at getting an OpenSolaris-like kernel built with
> > prom
> > debugging output for console/tty related files like
> > usr/src/uts/common/io/consconfig_dacf.c. The illumos kernel is
> > probably
> > suitable for this because it's still maintained and appears to be
> > suffering from the same console problems. I don't have a SPARC64
> > machine immediately available and I'm unfamiliar with the build
> > system
> > behind these distributions, so it might be a while before this
> > happens.
> > 
> > I'm out of ideas.
> 
> We can use the strategy I used 10 years back for sun4m: boot the
> proprietary firmware first to reduce the number of possible emulation
> bugs. The proprietary firmware is known to boot Solaris.
> 
> Regards,
> Artyom

  reply	other threads:[~2020-05-18  2:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  6:31 Emulating Solaris 10 on SPARC64 sun4u jasper.lowell
2020-02-05 17:33 ` Dr. David Alan Gilbert
2020-02-07  5:43   ` jasper.lowell
2020-02-08  0:03     ` BALATON Zoltan
2020-02-10 15:38       ` BALATON Zoltan
2020-02-10 19:04         ` John Snow
2020-02-10 22:32           ` Missing IRQ with bmdma on ppc/mips/sparc? (was: Re: Emulating Solaris 10 on SPARC64 sun4u) BALATON Zoltan
2020-02-25 20:55           ` IDE IRQ problem after UDMA enabled " BALATON Zoltan
2020-02-25 22:00             ` BALATON Zoltan
2020-02-25 22:12         ` Emulating Solaris 10 on SPARC64 sun4u BALATON Zoltan
2020-02-09 11:26 ` Mark Cave-Ayland
2020-02-19  3:42   ` jasper.lowell
2020-02-19 18:54     ` BALATON Zoltan
2020-02-19 20:10       ` BALATON Zoltan
2020-02-21 19:53         ` Dr. David Alan Gilbert
2020-02-28 22:05         ` BALATON Zoltan
2020-03-01  0:15           ` BALATON Zoltan
2020-05-07 14:29   ` jasper.lowell
2020-05-07 15:02     ` Artyom Tarasenko
2020-05-08  2:33       ` jasper.lowell
2020-05-08  8:51         ` Peter Tribble
2020-05-08 13:45           ` Artyom Tarasenko
2020-05-10  2:46             ` jasper.lowell
2020-05-10  9:22               ` Mark Cave-Ayland
2020-05-17  7:57                 ` jasper.lowell
2020-05-17 12:37                   ` Artyom Tarasenko
2020-05-18  2:56                     ` jasper.lowell [this message]
2020-05-20 17:44                       ` Mike Russo
2020-05-07 18:54     ` BALATON Zoltan
2020-05-08  2:55       ` jasper.lowell

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=be68b7ad559ec17c69439217c1378c23e30745c9.camel@bt.com \
    --to=jasper.lowell@bt.com \
    --cc=atar4qemu@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.tribble@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tony.nguyen@bt.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).