KVM: PPC: Make EPCR a valid field for booke64 and bookehv
Subsystems (3)
PATCH 1/1 KVM: PPC: Make EPCR a valid field for booke64 and bookehv
In BookE, EPCR is defined and valid when either the HV or the 64bit category are implemented. Reflect this in the field definition.
Today the only KVM target on 64bit is HV enabled, so there is no change in actual source code, but this keeps the code closer to the spec and doesn't build up artificial road blocks for a PR KVM on 64bit.
--- arch/powerpc/include/asm/kvm_host.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/kvm_host.h +7 -2
@@ -405,14 +405,19 @@ struct kvm_vcpu_arch {#ifdef CONFIG_KVM_BOOKE_HV u32 host_mas4;u32 host_mas6; -u32 shadow_epcr; -u32 epcr;u32 shadow_msrp;u32 eplc;u32 epsc;u32 oldpir;#endif +#if defined(CONFIG_BOOKE ) +#if defined(CONFIG_KVM_BOOKE_HV ) || defined(CONFIG_64BIT ) +u32 shadow_epcr; +u32 epcr; +#endif +#endif +#ifdef CONFIG_PPC_BOOK3S /* For Gekko paired singles */ u32 qpr[32 ];
Signature · 1 line
1.6.0.2
Quoted 7 lines · Alexander Graf
In BookE, EPCR is defined and valid when either the HV or the 64bit category are implemented. Reflect this in the field definition.
Today the only KVM target on 64bit is HV enabled, so there is no change in actual source code, but this keeps the code closer to the spec and doesn't build up artificial road blocks for a PR KVM on 64bit.
[snip]
Quoted 18 lines
Signed-off-by Alexander Graf <[email protected]>--- arch/powerpc/include/asm/kvm_host.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)arch/powerpc/include/asm/kvm_host.h +0
-2@@ -405,14 +405,19 @@ struct kvm_vcpu_arch {#ifdef CONFIG_KVM_BOOKE_HV u32 host_mas4;u32 host_mas6; -u32 shadow_epcr; -u32 epcr;u32 shadow_msrp;u32 eplc;
arch/powerpc/include/asm/kvm_host.h struct kvm_vcpu_arch { · line 419
Quoted 10 lines
arch/powerpc/include/asm/kvm_host.h +6
-0u32 epsc;u32 oldpir;#endif +#if defined(CONFIG_BOOKE ) +#if defined(CONFIG_KVM_BOOKE_HV ) || defined(CONFIG_64BIT ) +u32 shadow_epcr; +u32 epcr; +#endif +#endif
On a PR-mode implementation, why would we be have a shadow_epcr? It would always be set based on the host kernel, just like when running any other userspace process.
-Scott
Quoted 27 lines · Scott Wood
Quoted 6 lines · Alexander Graf
In BookE, EPCR is defined and valid when either the HV or the 64bit category are implemented. Reflect this in the field definition. Today the only KVM target on 64bit is HV enabled, so there is no change in actual source code, but this keeps the code closer to the spec and doesn't build up artificial road blocks for a PR KVM on 64bit.
[snip]
Quoted 19 lines
Signed-off-by Alexander Graf <[email protected]>---
arch/powerpc/include/asm/kvm_host.h| 9 +++++++--1 files changed, 7 insertions(+), 2 deletions(-)arch/powerpc/include/asm/kvm_host.h +0
-2@@ -405,14 +405,19 @@ struct kvm_vcpu_arch {#ifdef CONFIG_KVM_BOOKE_HV u32 host_mas4;u32 host_mas6; -u32 shadow_epcr; -u32 epcr;u32 shadow_msrp;u32 eplc;u32 epsc;u32 oldpir;#endif
Quoted 8 lines
arch/powerpc/include/asm/kvm_host.h struct kvm_vcpu_arch { · line 419
Quoted 6 lines
arch/powerpc/include/asm/kvm_host.h +6
-0+#if defined(CONFIG_BOOKE ) +#if defined(CONFIG_KVM_BOOKE_HV ) || defined(CONFIG_64BIT ) +u32 shadow_epcr; +u32 epcr; +#endif +#endif On a PR-mode implementation, why would we be have a
shadow_epcr? It would always be set based on the host kernel, just like when running any other userspace process.
Right - we could simply set MSR_CM. I'll move shadow_epcr back into the HV only bit above.
Alex