diff options
author | Sam bobroff <sam.bobroff@au1.ibm.com> | 2015-05-26 19:56:57 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-08-22 05:16:19 -0400 |
commit | c63517c2e3810071359af926f621c1f784388c3f (patch) | |
tree | 7687ac199f73c810ffc480b274941b77eff8fab3 /arch/powerpc/include/asm/kvm_book3s.h | |
parent | 563a1e93afac4d2c135072461fbab418b9dff43f (diff) |
KVM: PPC: Book3S: correct width in XER handling
In 64 bit kernels, the Fixed Point Exception Register (XER) is a 64
bit field (e.g. in kvm_regs and kvm_vcpu_arch) and in most places it is
accessed as such.
This patch corrects places where it is accessed as a 32 bit field by a
64 bit kernel. In some cases this is via a 32 bit load or store
instruction which, depending on endianness, will cause either the
lower or upper 32 bits to be missed. In another case it is cast as a
u32, causing the upper 32 bits to be cleared.
This patch corrects those places by extending the access methods to
64 bits.
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_book3s.h')
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index e6b2534a2a63..9fac01cb89c1 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -226,12 +226,12 @@ static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) | |||
226 | return vcpu->arch.cr; | 226 | return vcpu->arch.cr; |
227 | } | 227 | } |
228 | 228 | ||
229 | static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) | 229 | static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, ulong val) |
230 | { | 230 | { |
231 | vcpu->arch.xer = val; | 231 | vcpu->arch.xer = val; |
232 | } | 232 | } |
233 | 233 | ||
234 | static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu) | 234 | static inline ulong kvmppc_get_xer(struct kvm_vcpu *vcpu) |
235 | { | 235 | { |
236 | return vcpu->arch.xer; | 236 | return vcpu->arch.xer; |
237 | } | 237 | } |