From: Hollis Blanchard Date: Wed, 23 Jul 2008 20:30:13 +0000 Subject: [PATCH] kvm: ppc: qemu: Fix 440 CPU initialization Message-Id: <40d8ba7ccef06cdb99af.1216845013@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org # HG changeset patch # User Hollis Blanchard # Date 1216845007 18000 # Node ID 40d8ba7ccef06cdb99af00a28825c4c80bb3dbf6 # Parent b1d0e9c44b7ce0ca8035582ab791a451eec141ca kvm: ppc: qemu: Fix 440 CPU initialization Qemu doesn't implement 440 emulation, so pretend we're 405 instead. (We used to provide our own cpu_ppc_find_by_name() function that allowed us to use "440".) This fixes a fatal runtime error introduced in a recent upstream qemu merge. Signed-off-by: Hollis Blanchard diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c --- a/qemu/hw/ppc440_bamboo.c +++ b/qemu/hw/ppc440_bamboo.c @@ -77,10 +77,12 @@ void bamboo_init(ram_addr_t ram_size, in mem_reg_property[2] = ram_size; } - /* Setup CPU */ - env = cpu_ppc_init("440"); + /* Setup CPU. + * XXX Since qemu doesn't implement 440, we just say it's a 405. Since + * we don't use qemu's CPU emulation it seems to be working OK. */ + env = cpu_ppc_init("405"); if (!env) { - fprintf(stderr, "Unable to initilize CPU!\n"); + fprintf(stderr, "Unable to initialize CPU!\n"); exit(1); }