* [PATCH 0 of 2] Fix loading of registers preboot for PowerPC
@ 2008-04-10 21:04 Jerone Young
2008-04-10 21:04 ` [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation Jerone Young
2008-04-10 21:04 ` [PATCH 2 of 2] Remove kvm_load_registers from ppc440_bamboo board model Jerone Young
0 siblings, 2 replies; 5+ messages in thread
From: Jerone Young @ 2008-04-10 21:04 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
These patches fix issue with brining up bamboo board model for PowerPC. We need to load certain registers in the first vcp preboot.
I have not tested this on x86, but it should work without issue. Does anyone not like this being where it is?
2 files changed, 5 insertions(+), 3 deletions(-)
qemu/hw/ppc440_bamboo.c | 3 ---
qemu/qemu-kvm.c | 5 +++++
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation
2008-04-10 21:04 [PATCH 0 of 2] Fix loading of registers preboot for PowerPC Jerone Young
@ 2008-04-10 21:04 ` Jerone Young
2008-04-10 21:35 ` Marcelo Tosatti
2008-04-10 21:04 ` [PATCH 2 of 2] Remove kvm_load_registers from ppc440_bamboo board model Jerone Young
1 sibling, 1 reply; 5+ messages in thread
From: Jerone Young @ 2008-04-10 21:04 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
1 file changed, 5 insertions(+)
qemu/qemu-kvm.c | 5 +++++
This patch adds a call to load_kvm_registers after creation of vcpu. This is required for ppc since we are required to set certain registers before boot. This should not have any effect on the curren x86 code (though I need to test this to make sure).
What I would like though are some comments on the fix. Is this the right place for this? We had this in our platform setup code, but with recent code changes it will not work there anymore).
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -353,6 +353,11 @@ static void *ap_main_loop(void *_env)
sigdelset(&signals, SIG_IPI);
sigprocmask(SIG_BLOCK, &signals, NULL);
kvm_create_vcpu(kvm_context, env->cpu_index);
+ if (env->cpu_index == 0) {
+ /* load any registers set in env into
+ kvm for the first guest vcpu */
+ kvm_load_registers(env);
+ }
kvm_qemu_init_env(env);
if (kvm_irqchip_in_kernel(kvm_context))
env->hflags &= ~HF_HALTED_MASK;
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2 of 2] Remove kvm_load_registers from ppc440_bamboo board model
2008-04-10 21:04 [PATCH 0 of 2] Fix loading of registers preboot for PowerPC Jerone Young
2008-04-10 21:04 ` [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation Jerone Young
@ 2008-04-10 21:04 ` Jerone Young
1 sibling, 0 replies; 5+ messages in thread
From: Jerone Young @ 2008-04-10 21:04 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
1 file changed, 3 deletions(-)
qemu/hw/ppc440_bamboo.c | 3 ---
This patch removes the call to kvm_load_registers while in board platform setup code. This must now be done later in vcpu initialization.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
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
@@ -174,9 +174,6 @@ void bamboo_init(ram_addr_t ram_size, in
env->gpr[3] = dt_base;
#endif
env->nip = ep;
-
- printf("%s: loading kvm registers\n", __func__);
- kvm_load_registers(env);
}
for (i = 0; i < nb_nics; i++) {
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation
2008-04-10 21:04 ` [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation Jerone Young
@ 2008-04-10 21:35 ` Marcelo Tosatti
2008-04-10 21:59 ` Jerone Young
0 siblings, 1 reply; 5+ messages in thread
From: Marcelo Tosatti @ 2008-04-10 21:35 UTC (permalink / raw)
To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel
On Thu, Apr 10, 2008 at 04:04:47PM -0500, Jerone Young wrote:
> 1 file changed, 5 insertions(+)
> qemu/qemu-kvm.c | 5 +++++
>
>
> This patch adds a call to load_kvm_registers after creation of
> vcpu. This is required for ppc since we are required to set certain
> registers before boot. This should not have any effect on the curren
> x86 code (though I need to test this to make sure).
>
> What I would like though are some comments on the fix. Is this the
> right place for this? We had this in our platform setup code, but with
> recent code changes it will not work there anymore).
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
> --- a/qemu/qemu-kvm.c
> +++ b/qemu/qemu-kvm.c
> @@ -353,6 +353,11 @@ static void *ap_main_loop(void *_env)
> sigdelset(&signals, SIG_IPI);
> sigprocmask(SIG_BLOCK, &signals, NULL);
> kvm_create_vcpu(kvm_context, env->cpu_index);
> + if (env->cpu_index == 0) {
> + /* load any registers set in env into
> + kvm for the first guest vcpu */
> + kvm_load_registers(env);
> + }
> kvm_qemu_init_env(env);
> if (kvm_irqchip_in_kernel(kvm_context))
> env->hflags &= ~HF_HALTED_MASK;
Hi Jerone,
You can hook into PPC's kvm_arch_qemu_init_env().
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation
2008-04-10 21:35 ` Marcelo Tosatti
@ 2008-04-10 21:59 ` Jerone Young
0 siblings, 0 replies; 5+ messages in thread
From: Jerone Young @ 2008-04-10 21:59 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm-devel, kvm-ppc-devel
On Thu, 2008-04-10 at 18:35 -0300, Marcelo Tosatti wrote:
> On Thu, Apr 10, 2008 at 04:04:47PM -0500, Jerone Young wrote:
> > 1 file changed, 5 insertions(+)
> > qemu/qemu-kvm.c | 5 +++++
> >
> >
> > This patch adds a call to load_kvm_registers after creation of
> > vcpu. This is required for ppc since we are required to set certain
> > registers before boot. This should not have any effect on the curren
> > x86 code (though I need to test this to make sure).
> >
> > What I would like though are some comments on the fix. Is this the
> > right place for this? We had this in our platform setup code, but with
> > recent code changes it will not work there anymore).
> >
> > Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
> >
> > diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
> > --- a/qemu/qemu-kvm.c
> > +++ b/qemu/qemu-kvm.c
> > @@ -353,6 +353,11 @@ static void *ap_main_loop(void *_env)
> > sigdelset(&signals, SIG_IPI);
> > sigprocmask(SIG_BLOCK, &signals, NULL);
> > kvm_create_vcpu(kvm_context, env->cpu_index);
> > + if (env->cpu_index == 0) {
> > + /* load any registers set in env into
> > + kvm for the first guest vcpu */
> > + kvm_load_registers(env);
> > + }
> > kvm_qemu_init_env(env);
> > if (kvm_irqchip_in_kernel(kvm_context))
> > env->hflags &= ~HF_HALTED_MASK;
>
> Hi Jerone,
>
> You can hook into PPC's kvm_arch_qemu_init_env().
That would be a much better place.
I also noticed that kvm_qemu_init_env() is called in ap_main_loop and
the kvm_main_loop_cpu. ap_main_loop calls kvm_main_loop_cpu, so one
them should be removed. I'll submit another patch for that.
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-10 21:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-10 21:04 [PATCH 0 of 2] Fix loading of registers preboot for PowerPC Jerone Young
2008-04-10 21:04 ` [PATCH 1 of 2] Add kvm_load_registers after first vcpu creation Jerone Young
2008-04-10 21:35 ` Marcelo Tosatti
2008-04-10 21:59 ` Jerone Young
2008-04-10 21:04 ` [PATCH 2 of 2] Remove kvm_load_registers from ppc440_bamboo board model Jerone Young
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox