qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: Howard Spoelstra <hsp.cat7@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	 Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: Re: [PATCH v4 00/19] Misc ppc/mac machines clean up
Date: Thu, 27 Oct 2022 14:22:21 +0200 (CEST)	[thread overview]
Message-ID: <173f8ca1-78ff-5e37-46dd-d61c14fba064@eik.bme.hu> (raw)
In-Reply-To: <CABLmASFGAS-ck2XN2FOTKqTB346UB_+j+BhpumhFj0eomAjp4A@mail.gmail.com>

On Thu, 27 Oct 2022, Howard Spoelstra wrote:
> I applied these patches and they seem to work as expected. I like the way
> this makes it clearer which machine is actually emulated, even though it is
> still not easy to understand which default hardware the emulated machine
> actually presents.

Thanks for the feed back and testing. The emulation is not perfect so 
there are some differences from the actual machines. These could be 
documented in qemu/docs/system/ppc/powermac.rst patches are welcome). Some 
of these are not yet implemented like sound or i2c (see: 
https://osdn.net/projects/qmiga/wiki/SubprojectMac99I2C and 
https://patchew.org/QEMU/cover.1593456926.git.balaton@eik.bme.hu/93758f65ef21d977fe835364bb1386fb4c03a6ce.1593456926.git.balaton@eik.bme.hu/ 
if anybody is interested to finish these) or some are missing due to 
OpenBIOS can't yet handle it like a PCI bridge on some PCI bus which was 
there in code commented out for a while but looks like it's gone now or I 
couldn't find it. But the presented hardware should be close enough to 
these machines for OSes and it also shows what machines we should aim for 
so it's not an undefined machine any more. The mac99 machine may not be an 
actual existing config, according to

http://macos9lives.com/smforum/index.php/topic,2408.msg28843.html?PHPSESSID=ce15448df7a74e13c82c59eedf624db7#msg28843

which says no Mac had Uninorth, Keylargo and CUDA, although this forum 
post may not list every machine, e.g. powermac1,2 (the first PCI Power Mac 
G4) according to <https://en.wikipedia.org/wiki/Power_Mac_G4> had CUDA but 
used Grackle (the same motherboard as the Blue&White G3 PowerMac 
powermac1,1 <https://en.wikipedia.org/wiki/Power_Macintosh_G3_(Blue_and_White)> )
but had no ADB ports so you could not have ADB keyboard and mouse attached 
to it like we have in mac99. The powermac1,2 is maybe more similar to 
g3beige but g3beige has old world ROM while the B&W G3 powermac1,1 is the 
first new world ROM machine but may have more differences I don't know 
about. (That also means maybe our naming mac_oldworld and mac_newworld is 
misleading but that's OK for now as it's only in the source code and not 
user visible.)

> I also like the more consistent way a new rom file for a VGA device can be
> added. The deprecation warnings are clear.

Some more info on this last ndrv via romfile patch: OpenBIOS has two ways 
to add an NDRV in the device tree for MacOS to a vga card:

1. It adds it in openbios/drivers/pci.c::vga_config_cb() if the ROM 
contains an NDRV

2. Then in vga-driver-fcode defined in vga.fs (that OpenBIOS 
unconditionally calls for vga devices it knows about) it also checks for a 
file called ndrv/qemu_vga.ndrv in fw_cfg and adds that to the device tree. 
The vga-ndrv? option controls this second way and defaults to true.

Problems with 2.

- The ndrv/qemu_vga.ndrv is added by the machine not the card so it will 
be used for other cards (liek ati-vga) that it shouldn't be used for and 
there's no good way to control or fix it other than the user having to set 
vga-ndrv? to false when adding -device ati-vga.

- It's too complex for no good reason so after my patch this could be 
dropped altogether simpifying the code both in QEMU and OpenBIOS.

My patch sets the default value for the romfile property of the VGA device 
to qemu_vga.ndrv instead so QEMU will put the ndrv in the ROM and OpenBIOS 
detects that and adds it to the property without going through fw_cfg (it 
still checks fw_cfg but since we don't add the ndrv there any more that 
part won't do anything so that can be dropped later from OpenBIOS together 
with the vga-ndrv? option. If you want to disable the ndrv with my patch 
you can use -device VGA,romfile="" instead which replaces the default with 
empty romfile so OpenBIOS won't find it neither in the ROM not in fw_cfg. 
Additionally you can pass a real FCode ROM or different NDRV the same way 
via romfile now without having to replace the file in QEMU install which 
might come handy for someone developing NDRVs or experimenting with ROMs 
or pass-thorugh. So I think this simple patch really helps users and makes 
the code overall simpler too.

> Qemu-system-ppc defaults to the g3beige machine, which does not reflect the
> (in my opinion) main use case of running Mac OS/X with the powermac3_1
> machine and will not boot the main versions of ppc Mac OS/X anyway.

We can't easily change the default wihtout breaking existing commands and 
it's also debatable what should be a new default so I think we're stuck 
with that now. In any case we need an at least 2 release long deprecation 
period so what we could do is to deprecare g3beige as the default to 
require users to always specify a machine option explicitly so we can do 
something with it in the future but I don't know how to add such warning, 
i.e. how to detect if g3beige was chosen via -M or by default. Maybe this 
warning should be issued by command line parsing not the g3beige board 
code? So I've only added warnings for the mac99 with via option and G5 CPU 
for now and left qemu-system-ppc -M mac99 and g3beige alone for now. If 
you think these also need some warnings added now then we should find out 
how and what should be done instead. I could not decide on those so opted 
for preserving backwards compatibility for these.

Regards,
BALATON Zoltan

> So for qemu-system-ppc:
>
> Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
>
> Best,
> Howard



  reply	other threads:[~2022-10-27 12:23 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 16:44 [PATCH v4 00/19] Misc ppc/mac machines clean up BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 01/19] mac_newworld: Drop some variables BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 02/19] mac_oldworld: Drop some more variables BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 03/19] mac_{old|new}world: Set tbfreq at declaration BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 04/19] mac_{old|new}world: Avoid else branch by setting default value BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 05/19] mac_{old|new}world: Simplify cmdline_base calculation BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 06/19] mac_newworld: Clean up creation of Uninorth devices BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 07/19] mac_{old|new}world: Reduce number of QOM casts BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 08/19] hw/ppc/mac.h: Move newworld specific parts out from shared header BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 09/19] hw/ppc/mac.h: Move macio " BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 10/19] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 11/19] hw/ppc/mac.h: Move PROM and KERNEL defines to board code BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 12/19] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 13/19] mac_nvram: Use NVRAM_SIZE constant BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 14/19] mac_{old|new}world: Code style fix adding missing braces to if-s BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 15/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 16/19] mac_newworld: Add machine types for different mac99 configs BALATON Zoltan
2022-10-28  9:37   ` Mark Cave-Ayland
2022-10-28 12:18     ` BALATON Zoltan
2022-10-29  7:48       ` Mark Cave-Ayland
2022-10-29 12:35         ` BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 17/19] mac_newworld: Deprecate mac99 with G5 CPU BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 18/19] mac_newworld: Deprecate mac99 "via" option BALATON Zoltan
2022-10-25 16:44 ` [PATCH v4 19/19] mac_newworld: Document deprecation BALATON Zoltan
2022-10-28  9:41   ` Mark Cave-Ayland
2022-10-28 12:20     ` BALATON Zoltan
2022-10-29  8:09       ` Mark Cave-Ayland
2022-10-25 21:31 ` [PATCH v5 19/20] " BALATON Zoltan
2022-10-25 21:31 ` [PATCH v5 20/20] mac_{old, new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg BALATON Zoltan
2022-10-28  9:51   ` Mark Cave-Ayland
2022-10-28 12:32     ` BALATON Zoltan
2022-10-29  8:22       ` Mark Cave-Ayland
2022-10-29 12:18         ` BALATON Zoltan
2022-10-25 21:35 ` [PATCH v4 00/19] Misc ppc/mac machines clean up BALATON Zoltan
2022-10-27  5:41 ` Howard Spoelstra
2022-10-27 12:22   ` BALATON Zoltan [this message]
2022-10-28  9:07 ` Mark Cave-Ayland
2022-10-28 12:24   ` BALATON Zoltan

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=173f8ca1-78ff-5e37-46dd-d61c14fba064@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=hsp.cat7@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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).