* [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded
@ 2014-07-24 8:52 Alexander Graf
2014-07-24 13:44 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2014-07-24 8:52 UTC (permalink / raw)
To: qemu-ppc; +Cc: qemu-devel
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 <agraf@suse.de>
---
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)
--
1.8.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded
2014-07-24 8:52 [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded Alexander Graf
@ 2014-07-24 13:44 ` Paolo Bonzini
2014-07-24 13:54 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2014-07-24 13:44 UTC (permalink / raw)
To: Alexander Graf, qemu-ppc; +Cc: qemu-devel
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 <agraf@suse.de>
> ---
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded
2014-07-24 13:44 ` Paolo Bonzini
@ 2014-07-24 13:54 ` Alexander Graf
2014-07-24 14:11 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2014-07-24 13:54 UTC (permalink / raw)
To: Paolo Bonzini, qemu-ppc; +Cc: qemu-devel
On 24.07.14 15:44, Paolo Bonzini wrote:
> 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 <agraf@suse.de>
>> ---
>> 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?
Because there are no other Book3S machines :). And for BookE we don't
implement kvm_type != 0 because we only support either PR or HV
depending on the host platform.
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded
2014-07-24 13:54 ` Alexander Graf
@ 2014-07-24 14:11 ` Paolo Bonzini
2014-07-24 14:13 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2014-07-24 14:11 UTC (permalink / raw)
To: Alexander Graf, qemu-ppc; +Cc: qemu-devel
Il 24/07/2014 15:54, Alexander Graf ha scritto:
>>>
>> Why should anything except pseries ever use HV KVM?
>
> Because there are no other Book3S machines :). And for BookE we don't
> implement kvm_type != 0 because we only support either PR or HV
> depending on the host platform.
Yeah, what I meant was (in a rather Socratic way): why should the
default for kvm_type == NULL be anything but PR?
All 2.2 stuff, of course.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded
2014-07-24 14:11 ` Paolo Bonzini
@ 2014-07-24 14:13 ` Alexander Graf
2014-07-24 14:55 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2014-07-24 14:13 UTC (permalink / raw)
To: Paolo Bonzini, qemu-ppc; +Cc: qemu-devel
On 24.07.14 16:11, Paolo Bonzini wrote:
> Il 24/07/2014 15:54, Alexander Graf ha scritto:
>>> Why should anything except pseries ever use HV KVM?
>> Because there are no other Book3S machines :). And for BookE we don't
>> implement kvm_type != 0 because we only support either PR or HV
>> depending on the host platform.
> Yeah, what I meant was (in a rather Socratic way): why should the
> default for kvm_type == NULL be anything but PR?
I would prefer to keep the BookE machines on kvm_type = 0. Saying "give
me whatever you can" makes a lot more sense there.
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded
2014-07-24 14:13 ` Alexander Graf
@ 2014-07-24 14:55 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-07-24 14:55 UTC (permalink / raw)
To: Alexander Graf, qemu-ppc; +Cc: qemu-devel
Il 24/07/2014 16:13, Alexander Graf ha scritto:
>
> On 24.07.14 16:11, Paolo Bonzini wrote:
>> Il 24/07/2014 15:54, Alexander Graf ha scritto:
>>>> Why should anything except pseries ever use HV KVM?
>>> Because there are no other Book3S machines :). And for BookE we don't
>>> implement kvm_type != 0 because we only support either PR or HV
>>> depending on the host platform.
>> Yeah, what I meant was (in a rather Socratic way): why should the
>> default for kvm_type == NULL be anything but PR?
>
> I would prefer to keep the BookE machines on kvm_type = 0. Saying "give
> me whatever you can" makes a lot more sense there.
Got the answer on IRC:
(16:18:18) bonzini: agraf: do g3beige and mac99 run on booke PR kvm?
(16:33:51) agraf: bonzini: nope - booke only virtualizes booke
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-24 14:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 8:52 [Qemu-devel] [PATCH 2.1] PPC: KVM: Fix g3beige and mac99 when HV is loaded Alexander Graf
2014-07-24 13:44 ` Paolo Bonzini
2014-07-24 13:54 ` Alexander Graf
2014-07-24 14:11 ` Paolo Bonzini
2014-07-24 14:13 ` Alexander Graf
2014-07-24 14:55 ` Paolo Bonzini
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).