Re: [PATCH 02/27] Pass PVR in sregs

2009-10-10 Thread Alexander Graf


Am 09.10.2009 um 23:00 schrieb Hollis Blanchard holl...@us.ibm.com:


On Tue, 2009-09-29 at 10:17 +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 ag...@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 {


Architecturally, PVR is 32 bits, even for PPC64. Is there a reason you
want it to be 64 bits here? (I can understand just picking 64 for
registers that could be either size, but that's not this case.)


No obvious reason. It fills a registerwhich can be up to u64, but if  
it's limited to u32 we can keep it 32 bits.


Alex



--
Hollis Blanchard
IBM Linux Technology Center


--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/27] Pass PVR in sregs

2009-10-09 Thread Hollis Blanchard
On Tue, 2009-09-29 at 10:17 +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 ag...@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 {

Architecturally, PVR is 32 bits, even for PPC64. Is there a reason you
want it to be 64 bits here? (I can understand just picking 64 for
registers that could be either size, but that's not this case.)

-- 
Hollis Blanchard
IBM Linux Technology Center

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html