From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Date: Tue, 22 Jan 2008 19:09:51 +0000 Subject: Re: [kvm-ppc-devel] [PATCH 4 of 4] Add powerpc kvm qemu support Message-Id: <1201028991.19557.3.camel@thinkpad> List-Id: References: <1c5b26c965e85986cc93.1200693048@thinkpad> In-Reply-To: <1c5b26c965e85986cc93.1200693048@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Tue, 2008-01-22 at 09:15 -0600, Nathan Lynch wrote: > Jerone Young wrote: > > --- /dev/null > > +++ b/qemu/hw/ppc440_boards_kvm.c > > @@ -0,0 +1,251 @@ > > +/* > > + * Qemu PowerPC 440 board emualtion with KVM enlightnments > > enhancements? > > > + * > > + * Copyright 2007 IBM Corporation. > > + * Added by: Jerone Young > > + * > > + * This work is licensed under the GNU LGPL license, version 2. > > + * > > + */ > > + > > +/* XXX THIS CODE IS STILL DRAFT! DO NOT POST TO THE LIST! */ > > heh I've cleaned this up in our internal repo. I plan on sending these patches every friday till we get them in upstream KVM. But it was a last minute decision to send what we had to the list. Next one will be a LOT cleaner. > > > > + > > +#include > > + > > +#include "hw.h" > > +#include "ppc.h" > > +#include "ppc405.h" > > +#include "pc.h" > > +#include "qemu-timer.h" > > +#include "sysemu.h" > > +#include "exec-all.h" > > +#include "boards.h" > > + > > +#include "qemu-kvm.h" > > + > > +#define DEFAULT_RAM_SIZE 32*1024*1024 > > You want parentheses around that expression. I've removed this now. But yes you are right, not having the parentheses can cause problems if you have DEFAULT_RAM_SIZE^2 or something like that. > > > > +static void bambooKVM_init(ram_addr_t ram_size, int vga_ram_size, > > + const char *boot_device, DisplayState *ds, > > + const char *kernel_filename, > > + const char *kernel_cmdline, > > + const char *initrd_filename, > > + const char *cpu_model) > > +{ > > .... > > > + > > + /* XXX insert TLB entries */ > > + env->gpr[1] = (16<<20) - 8; > > + env->gpr[4] = initrd_base; > > + env->gpr[5] = initrd_size; > > + > > + /* Set program counter (ip in x86 terms .... but it's ep in ppc) */ > > + env->nip = ep; > > + printf("Program Counter (ep) is being set to 0x%08x\n", ep); > > + > > + /* lock RAM */ > > + mlock(phys_ram_base, phys_ram_size); > > Do you care if that fails? Good catch. I'll add a check for it. > > > > + > > + /* run in kvm */ > > + /* XXX SMP IS NOT SUPPORTED YET */ > > + printf("%s: running kvm functions\n", __func__); > > + env->cpu_index = 0; > > + > > + /* XXX need a call to set ep */ > > + printf("%s: loading kvm registers\n", __func__); > > + kvm_load_registers(env); > > + > > + printf("%s: DONE\n", __func__); > > +} ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-ppc-devel mailing list kvm-ppc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel