summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-02-14 01:08:13 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-03-30 23:34:24 +1100
commit499dcd41378ebab2a37a0df65735748d66e75599 (patch)
treeada2a1a7758be906d2e8e5dd799bbb74192f22de /arch/powerpc/kvm
parentd2e60075a3d4422dc54b919f3b125d8066b839d4 (diff)
downloadlinux-499dcd41378ebab2a37a0df65735748d66e75599.tar.bz2
powerpc/64s: Allocate LPPACAs individually
We no longer allocate lppacas in an array, so this patch removes the 1kB static alignment for the structure, and enforces the PAPR alignment requirements at allocation time. We can not reduce the 1kB allocation size however, due to existing KVM hypervisors. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s_hv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 41fce69714d5..9b48d4a191ff 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -498,7 +498,8 @@ static unsigned long do_h_register_vpa(struct kvm_vcpu *vcpu,
* use 640 bytes of the structure though, so we should accept
* clients that set a size of 640.
*/
- if (len < 640)
+ BUILD_BUG_ON(sizeof(struct lppaca) != 640);
+ if (len < sizeof(struct lppaca))
break;
vpap = &tvcpu->arch.vpa;
err = 0;