Pass PVR in sregs
Subsystems (2)
PATCH 2/27 Pass PVR in sregs
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.
--- arch/powerpc/include/asm/kvm.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/kvm.h +2 -0
@@ -46,6 +46,8 @@ struct kvm_regs { };struct kvm_sregs { +__u64 pvr; +char pad[1016 ]; };struct kvm_fpu {
Signature · 1 line
1.6.0.2
Quoted 20 lines · Alexander Graf
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_32andBook3s_64guests.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 <[email protected]>--- arch/powerpc/include/asm/kvm.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)arch/powerpc/include/asm/kvm.h +0
-0
arch/powerpc/include/asm/kvm.h struct kvm_regs { · line 53
Quoted 8 lines
arch/powerpc/include/asm/kvm.h +2
-0@@ -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.)
Signature · 2 lines
Hollis Blanchard IBM Linux Technology Center
Am 09.10.2009 um 23:00 schrieb Hollis Blanchard <[email protected]>:
Quoted 32 lines · Alexander Graf
Quoted 31 lines
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 supportBook3s_32andBook3s_64guests.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 <[email protected]>---
arch/powerpc/include/asm/kvm.h| 2 ++1 files changed, 2 insertions(+), 0 deletions(-)arch/powerpc/include/ renamed from arch/powerpc/include/asm/kvm.h +0
-0
asm/kvm.h
index bb2de6a..b82bd68 100644arch/powerpc/include/asm/kvm.h +2
-0@@ -46,6 +46,8 @@ struct kvm_regs { };struct kvm_sregs { +__u64 pvr; +char pad[1016 ]; };
Quoted 5 lines
arch/powerpc/include/asm/kvm.h struct kvm_regs { · line 53
Quoted 1 line
arch/powerpc/include/asm/kvm.h +0
-0struct 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
Quoted 5 lines
Signature · 3 lines
-- Hollis Blanchard IBM Linux Technology Center