From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAJKc-0005ZF-K6 for qemu-devel@nongnu.org; Thu, 24 Jul 2014 09:45:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAJKW-0007r3-Tx for qemu-devel@nongnu.org; Thu, 24 Jul 2014 09:45:14 -0400 Sender: Paolo Bonzini Message-ID: <53D10DCF.5030807@redhat.com> Date: Thu, 24 Jul 2014 15:44:47 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1406191971-22404-1-git-send-email-agraf@suse.de> In-Reply-To: <1406191971-22404-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , qemu-ppc@nongnu.org Cc: qemu-devel@nongnu.org Il 24/07/2014 10:52, Alexander Graf ha scritto: > On PPC we have 2 different styles of KVM: PR and HV. HV can only virtualize > sPAPR guests while PR can virtualize everything that's reasonably close to > the host hardware platform. > > As long as only one kernel module (PR or HV) is loaded, the "default" kvm type > is the module that's loaded. So if your hardware only supports PR mode you can > easily spawn a Mac VM. > > However, if both HV and PR are loaded we default to HV mode. And in that case > the Mac machines have to explicitly ask for PR mode to get a working VM. > > Fix this up by explicitly having the Mac machines ask for PR style KVM. This > fixes bootup of Mac VMs on systems where bot HV and PR kvm modules are loaded > for me. > > Signed-off-by: Alexander Graf > --- > hw/ppc/mac_newworld.c | 7 +++++++ > hw/ppc/mac_oldworld.c | 7 +++++++ > 2 files changed, 14 insertions(+) > > diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c > index f5bccd2..2e66a35 100644 > --- a/hw/ppc/mac_newworld.c > +++ b/hw/ppc/mac_newworld.c > @@ -477,12 +477,19 @@ static void ppc_core99_init(MachineState *machine) > qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); > } > > +static int core99_kvm_type(const char *arg) > +{ > + /* Always force PR KVM */ > + return 2; > +} > + > static QEMUMachine core99_machine = { > .name = "mac99", > .desc = "Mac99 based PowerMAC", > .init = ppc_core99_init, > .max_cpus = MAX_CPUS, > .default_boot_order = "cd", > + .kvm_type = core99_kvm_type, > }; > > static void core99_machine_init(void) > diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c > index cd9bdbc..ec7ed38 100644 > --- a/hw/ppc/mac_oldworld.c > +++ b/hw/ppc/mac_oldworld.c > @@ -346,6 +346,12 @@ static void ppc_heathrow_init(MachineState *machine) > qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); > } > > +static int heathrow_kvm_type(const char *arg) > +{ > + /* Always force PR KVM */ > + return 2; > +} > + > static QEMUMachine heathrow_machine = { > .name = "g3beige", > .desc = "Heathrow based PowerMAC", > @@ -355,6 +361,7 @@ static QEMUMachine heathrow_machine = { > .is_default = 1, > #endif > .default_boot_order = "cd", /* TOFIX "cad" when Mac floppy is implemented */ > + .kvm_type = heathrow_kvm_type, > }; > > static void heathrow_machine_init(void) > Why should anything except pseries ever use HV KVM? Paolo