diff options
author | Alexander Graf | 2014-07-13 22:31:53 +0200 |
---|---|---|
committer | Alexander Graf | 2014-09-08 12:50:52 +0200 |
commit | b981289c493c7ddabc1cdf7de99daa24642c7739 (patch) | |
tree | 1e239e4f64e013f67057eebe2ca4ca9ed360a2ca /hw/ppc/mac_newworld.c | |
parent | PPC: Mac: Move tbfreq into local variable (diff) | |
download | qemu-b981289c493c7ddabc1cdf7de99daa24642c7739.tar.gz qemu-b981289c493c7ddabc1cdf7de99daa24642c7739.tar.xz qemu-b981289c493c7ddabc1cdf7de99daa24642c7739.zip |
PPC: Cuda: Use cuda timer to expose tbfreq to guest
Mac OS X calibrates a number of frequencies on bootup based on reading
tb values on bootup and comparing them to via cuda timer values.
The only variable we can really steer well (thanks to KVM) is the cuda
frequency. So let's use that one to fake Mac OS X into believing the
bus frequency is tbfreq * 4. That way Mac OS X will automatically
calculate the correct timebase frequency.
With this patch and the patch set I posted earlier I can successfully
run Mac OS X 10.2, 10.3 and 10.4 guests with -M mac99 on TCG and KVM.
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc/mac_newworld.c')
-rw-r--r-- | hw/ppc/mac_newworld.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index d525247c0a..8453bfa284 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -395,6 +395,7 @@ static void ppc_core99_init(MachineState *machine) qdev_connect_gpio_out(dev, 2, pic[0x02]); /* IDE DMA */ qdev_connect_gpio_out(dev, 3, pic[0x0e]); /* IDE */ qdev_connect_gpio_out(dev, 4, pic[0x03]); /* IDE DMA */ + qdev_prop_set_uint64(dev, "frequency", tbfreq); macio_init(macio, pic_mem, escc_bar); /* We only emulate 2 out of 3 IDE controllers for now */ |