* [PATCH 01/23] Pass PVR in sregs
@ 2009-07-07 14:17 Alexander Graf
2009-07-07 15:40 ` Avi Kivity
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Alexander Graf @ 2009-07-07 14:17 UTC (permalink / raw)
To: kvm-ppc
Right now sregs is unused on PPC, so we can use it for initialization
of the CPU.
KVM on BookE always virtualizes the host CPU. On PPC64 we go a step further
and take the PVR from userspace that tells us what kind of CPU we are supposed
to virtualize, because we support PPC32 and PPC64 guests.
In order to get that information, we use the sregs ioctl, because we don't
want to reset the guest CPU on every normal register set.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/include/asm/kvm.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
index bb2de6a..96b02cd 100644
--- a/arch/powerpc/include/asm/kvm.h
+++ b/arch/powerpc/include/asm/kvm.h
@@ -46,6 +46,7 @@ struct kvm_regs {
};
struct kvm_sregs {
+ __u64 pvr;
};
struct kvm_fpu {
--
1.6.0.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
@ 2009-07-07 15:40 ` Avi Kivity
2009-07-07 22:50 ` Hollis Blanchard
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Avi Kivity @ 2009-07-07 15:40 UTC (permalink / raw)
To: kvm-ppc
On 07/07/2009 05:17 PM, Alexander Graf wrote:
> Right now sregs is unused on PPC, so we can use it for initialization
> of the CPU.
>
> KVM on BookE always virtualizes the host CPU. On PPC64 we go a step further
> and take the PVR from userspace that tells us what kind of CPU we are supposed
> to virtualize, because we support PPC32 and PPC64 guests.
>
> In order to get that information, we use the sregs ioctl, because we don't
> want to reset the guest CPU on every normal register set.
>
> Signed-off-by: Alexander Graf<agraf@suse.de>
> ---
> arch/powerpc/include/asm/kvm.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
> index bb2de6a..96b02cd 100644
> --- a/arch/powerpc/include/asm/kvm.h
> +++ b/arch/powerpc/include/asm/kvm.h
> @@ -46,6 +46,7 @@ struct kvm_regs {
> };
>
> struct kvm_sregs {
> + __u64 pvr;
> };
>
You can only do that if existing userspace never calls KVM_SET_SREGS.
Hollis?
Also, make sure to reserve a bunch of space in there so you if you
forget something you can add it later.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
2009-07-07 15:40 ` Avi Kivity
@ 2009-07-07 22:50 ` Hollis Blanchard
2009-07-07 23:22 ` Alexander Graf
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Hollis Blanchard @ 2009-07-07 22:50 UTC (permalink / raw)
To: kvm-ppc
On Tue, 2009-07-07 at 18:40 +0300, Avi Kivity wrote:
> On 07/07/2009 05:17 PM, Alexander Graf wrote:
> > Right now sregs is unused on PPC, so we can use it for initialization
> > of the CPU.
> >
> > KVM on BookE always virtualizes the host CPU. On PPC64 we go a step further
> > and take the PVR from userspace that tells us what kind of CPU we are supposed
> > to virtualize, because we support PPC32 and PPC64 guests.
> >
> > In order to get that information, we use the sregs ioctl, because we don't
> > want to reset the guest CPU on every normal register set.
> >
> > Signed-off-by: Alexander Graf<agraf@suse.de>
> > ---
> > arch/powerpc/include/asm/kvm.h | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
> > index bb2de6a..96b02cd 100644
> > --- a/arch/powerpc/include/asm/kvm.h
> > +++ b/arch/powerpc/include/asm/kvm.h
> > @@ -46,6 +46,7 @@ struct kvm_regs {
> > };
> >
> > struct kvm_sregs {
> > + __u64 pvr;
> > };
> >
>
> You can only do that if existing userspace never calls KVM_SET_SREGS.
> Hollis?
It doesn't.
> Also, make sure to reserve a bunch of space in there so you if you
> forget something you can add it later.
Agreed.
The PVR register is basically the equivalent of cpuid. It might make
more sense to exit to qemu to handle those accesses. Today, PVR reads
are emulated in-kernel.
Hmm, I don't remember where arch->vcpu.pvr is being set at all for 440
and e500...
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
2009-07-07 15:40 ` Avi Kivity
2009-07-07 22:50 ` Hollis Blanchard
@ 2009-07-07 23:22 ` Alexander Graf
2009-07-08 2:28 ` Liu Yu-B13201
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alexander Graf @ 2009-07-07 23:22 UTC (permalink / raw)
To: kvm-ppc
On 08.07.2009, at 00:50, Hollis Blanchard wrote:
> On Tue, 2009-07-07 at 18:40 +0300, Avi Kivity wrote:
>> On 07/07/2009 05:17 PM, Alexander Graf wrote:
>>> Right now sregs is unused on PPC, so we can use it for
>>> initialization
>>> of the CPU.
>>>
>>> KVM on BookE always virtualizes the host CPU. On PPC64 we go a
>>> step further
>>> and take the PVR from userspace that tells us what kind of CPU we
>>> are supposed
>>> to virtualize, because we support PPC32 and PPC64 guests.
>>>
>>> In order to get that information, we use the sregs ioctl, because
>>> we don't
>>> want to reset the guest CPU on every normal register set.
>>>
>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>> ---
>>> arch/powerpc/include/asm/kvm.h | 1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/
>>> asm/kvm.h
>>> index bb2de6a..96b02cd 100644
>>> --- a/arch/powerpc/include/asm/kvm.h
>>> +++ b/arch/powerpc/include/asm/kvm.h
>>> @@ -46,6 +46,7 @@ struct kvm_regs {
>>> };
>>>
>>> struct kvm_sregs {
>>> + __u64 pvr;
>>> };
>>>
>>
>> You can only do that if existing userspace never calls KVM_SET_SREGS.
>> Hollis?
>
> It doesn't.
>
>> Also, make sure to reserve a bunch of space in there so you if you
>> forget something you can add it later.
>
> Agreed.
>
> The PVR register is basically the equivalent of cpuid. It might make
> more sense to exit to qemu to handle those accesses. Today, PVR reads
> are emulated in-kernel.
I actually use it in 970.c to find out which guest MMU to choose from.
So even if we were to do it in userspace, we'd still need the
information what CPU to create in the guest on the kernel side. Which
in turn means we don't win anything from leaving the PVR emulation to
userspace.
> Hmm, I don't remember where arch->vcpu.pvr is being set at all for 440
> and e500...
It used to be in some creation code - either general kvm or vcpu. But
some recent patch removed vcpu->arch.pvr and made emulate.c do an
mfspr(SPRN_PVR).
Alex
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
` (2 preceding siblings ...)
2009-07-07 23:22 ` Alexander Graf
@ 2009-07-08 2:28 ` Liu Yu-B13201
2009-07-10 0:52 ` Hollis Blanchard
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Liu Yu-B13201 @ 2009-07-08 2:28 UTC (permalink / raw)
To: kvm-ppc
> -----Original Message-----
> From: kvm-ppc-owner@vger.kernel.org
> [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Alexander Graf
> Sent: Wednesday, July 08, 2009 7:23 AM
> To: Hollis Blanchard
> Cc: Avi Kivity; kvm-ppc@vger.kernel.org; arnd@arndb.de;
> kwolf@redhat.com
> Subject: Re: [PATCH 01/23] Pass PVR in sregs
>
>
> On 08.07.2009, at 00:50, Hollis Blanchard wrote:
> >
> > The PVR register is basically the equivalent of cpuid. It might make
> > more sense to exit to qemu to handle those accesses. Today,
> PVR reads
> > are emulated in-kernel.
>
> I actually use it in 970.c to find out which guest MMU to choose from.
> So even if we were to do it in userspace, we'd still need the
> information what CPU to create in the guest on the kernel
> side. Which
> in turn means we don't win anything from leaving the PVR
> emulation to
> userspace.
>
> > Hmm, I don't remember where arch->vcpu.pvr is being set at
> all for 440
> > and e500...
>
> It used to be in some creation code - either general kvm or
> vcpu. But
> some recent patch removed vcpu->arch.pvr and made emulate.c do an
> mfspr(SPRN_PVR).
>
Yes. Since the demand to emulate PVR for 440 and e500 is still vague.
Directly return the real value can simplify the code, and latter patches
can easily change it.
The same thing goes for PIR.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
` (3 preceding siblings ...)
2009-07-08 2:28 ` Liu Yu-B13201
@ 2009-07-10 0:52 ` Hollis Blanchard
2009-07-10 2:50 ` Liu Yu-B13201
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Hollis Blanchard @ 2009-07-10 0:52 UTC (permalink / raw)
To: kvm-ppc
On Wed, 2009-07-08 at 10:28 +0800, Liu Yu-B13201 wrote:
>
> > -----Original Message-----
> > From: kvm-ppc-owner@vger.kernel.org
> > [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Alexander Graf
> > Sent: Wednesday, July 08, 2009 7:23 AM
> > To: Hollis Blanchard
> > Cc: Avi Kivity; kvm-ppc@vger.kernel.org; arnd@arndb.de;
> > kwolf@redhat.com
> > Subject: Re: [PATCH 01/23] Pass PVR in sregs
> >
> >
> > On 08.07.2009, at 00:50, Hollis Blanchard wrote:
> > >
> > > The PVR register is basically the equivalent of cpuid. It might make
> > > more sense to exit to qemu to handle those accesses. Today,
> > PVR reads
> > > are emulated in-kernel.
> >
> > I actually use it in 970.c to find out which guest MMU to choose from.
> > So even if we were to do it in userspace, we'd still need the
> > information what CPU to create in the guest on the kernel
> > side. Which
> > in turn means we don't win anything from leaving the PVR
> > emulation to
> > userspace.
> >
> > > Hmm, I don't remember where arch->vcpu.pvr is being set at
> > all for 440
> > > and e500...
> >
> > It used to be in some creation code - either general kvm or
> > vcpu. But
> > some recent patch removed vcpu->arch.pvr and made emulate.c do an
> > mfspr(SPRN_PVR).
> >
>
> Yes. Since the demand to emulate PVR for 440 and e500 is still vague.
> Directly return the real value can simplify the code, and latter patches
> can easily change it.
> The same thing goes for PIR.
By the way, I don't like that PVR patch you sent to Avi (and he
committed). It's my own fault for not reading more closely, but in the
future could you send me patches that touch code which isn't
e500-specific?
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
` (4 preceding siblings ...)
2009-07-10 0:52 ` Hollis Blanchard
@ 2009-07-10 2:50 ` Liu Yu-B13201
2009-07-16 13:29 ` Alexander Graf
2009-09-11 23:03 ` Hollis Blanchard
7 siblings, 0 replies; 9+ messages in thread
From: Liu Yu-B13201 @ 2009-07-10 2:50 UTC (permalink / raw)
To: kvm-ppc
> -----Original Message-----
> From: kvm-ppc-owner@vger.kernel.org
> [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Hollis Blanchard
> Sent: Friday, July 10, 2009 8:52 AM
> To: Liu Yu-B13201
> Cc: Alexander Graf; Avi Kivity; kvm-ppc@vger.kernel.org;
> arnd@arndb.de; kwolf@redhat.com
> Subject: RE: [PATCH 01/23] Pass PVR in sregs
>
> On Wed, 2009-07-08 at 10:28 +0800, Liu Yu-B13201 wrote:
> >
> > > -----Original Message-----
> > > From: kvm-ppc-owner@vger.kernel.org
> > > [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Alexander Graf
> > > Sent: Wednesday, July 08, 2009 7:23 AM
> > > To: Hollis Blanchard
> > > Cc: Avi Kivity; kvm-ppc@vger.kernel.org; arnd@arndb.de;
> > > kwolf@redhat.com
> > > Subject: Re: [PATCH 01/23] Pass PVR in sregs
> > >
> > >
> > > On 08.07.2009, at 00:50, Hollis Blanchard wrote:
> > > >
> > > > The PVR register is basically the equivalent of cpuid.
> It might make
> > > > more sense to exit to qemu to handle those accesses. Today,
> > > PVR reads
> > > > are emulated in-kernel.
> > >
> > > I actually use it in 970.c to find out which guest MMU to
> choose from.
> > > So even if we were to do it in userspace, we'd still need the
> > > information what CPU to create in the guest on the kernel
> > > side. Which
> > > in turn means we don't win anything from leaving the PVR
> > > emulation to
> > > userspace.
> > >
> > > > Hmm, I don't remember where arch->vcpu.pvr is being set at
> > > all for 440
> > > > and e500...
> > >
> > > It used to be in some creation code - either general kvm or
> > > vcpu. But
> > > some recent patch removed vcpu->arch.pvr and made
> emulate.c do an
> > > mfspr(SPRN_PVR).
> > >
> >
> > Yes. Since the demand to emulate PVR for 440 and e500 is
> still vague.
> > Directly return the real value can simplify the code, and
> latter patches
> > can easily change it.
> > The same thing goes for PIR.
>
> By the way, I don't like that PVR patch you sent to Avi (and he
> committed). It's my own fault for not reading more closely, but in the
> future could you send me patches that touch code which isn't
> e500-specific?
>
OK.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
` (5 preceding siblings ...)
2009-07-10 2:50 ` Liu Yu-B13201
@ 2009-07-16 13:29 ` Alexander Graf
2009-09-11 23:03 ` Hollis Blanchard
7 siblings, 0 replies; 9+ messages in thread
From: Alexander Graf @ 2009-07-16 13:29 UTC (permalink / raw)
To: kvm-ppc
Right now sregs is unused on PPC, so we can use it for initialization
of the CPU.
KVM on BookE always virtualizes the host CPU. On Book3s we go a step further
and take the PVR from userspace that tells us what kind of CPU we are supposed
to virtualize, because we support Book3s_32 and Book3s_64 guests.
In order to get that information, we use the sregs ioctl, because we don't
want to reset the guest CPU on every normal register set.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/include/asm/kvm.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
index bb2de6a..b82bd68 100644
--- a/arch/powerpc/include/asm/kvm.h
+++ b/arch/powerpc/include/asm/kvm.h
@@ -46,6 +46,8 @@ struct kvm_regs {
};
struct kvm_sregs {
+ __u64 pvr;
+ char pad[1016];
};
struct kvm_fpu {
--
1.6.0.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 01/23] Pass PVR in sregs
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
` (6 preceding siblings ...)
2009-07-16 13:29 ` Alexander Graf
@ 2009-09-11 23:03 ` Hollis Blanchard
7 siblings, 0 replies; 9+ messages in thread
From: Hollis Blanchard @ 2009-09-11 23:03 UTC (permalink / raw)
To: kvm-ppc
Hi Avi, would you apply this patch? Looks like the corresponding qemu
patch went in a while ago, so the qemu build has been broken for some
time.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--
Hollis Blanchard
IBM Linux Technology Center
On Thu, 2009-07-16 at 15:29 +0200, Alexander Graf wrote:
> Right now sregs is unused on PPC, so we can use it for initialization
> of the CPU.
>
> KVM on BookE always virtualizes the host CPU. On Book3s we go a step further
> and take the PVR from userspace that tells us what kind of CPU we are supposed
> to virtualize, because we support Book3s_32 and Book3s_64 guests.
>
> In order to get that information, we use the sregs ioctl, because we don't
> want to reset the guest CPU on every normal register set.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> arch/powerpc/include/asm/kvm.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
> index bb2de6a..b82bd68 100644
> --- a/arch/powerpc/include/asm/kvm.h
> +++ b/arch/powerpc/include/asm/kvm.h
> @@ -46,6 +46,8 @@ struct kvm_regs {
> };
>
> struct kvm_sregs {
> + __u64 pvr;
> + char pad[1016];
> };
>
> struct kvm_fpu {
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-09-11 23:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07 14:17 [PATCH 01/23] Pass PVR in sregs Alexander Graf
2009-07-07 15:40 ` Avi Kivity
2009-07-07 22:50 ` Hollis Blanchard
2009-07-07 23:22 ` Alexander Graf
2009-07-08 2:28 ` Liu Yu-B13201
2009-07-10 0:52 ` Hollis Blanchard
2009-07-10 2:50 ` Liu Yu-B13201
2009-07-16 13:29 ` Alexander Graf
2009-09-11 23:03 ` Hollis Blanchard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.