Message ID | 87mwbpiv0z.fsf@approximate.cambridge.arm.com |
---|---|
State | Accepted |
Commit | fb3ec67942e92e5713e05b7691b277d0a0c0575d |
Headers | show |
On Thu, Jul 31, 2014 at 01:15:40PM +0100, Marc Zyngier wrote: > On Thu, Jul 31 2014 at 12:53:03 pm BST, Christoffer Dall <christofferdall@christofferdall.dk> wrote: > > Hi Christoffer, > > > On Thu, Jul 31, 2014 at 8:30 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > Hi all, > > > > Today's linux-next merge of the kvm-arm tree got a conflict in > > virt/kvm/arm/vgic.c between commit 63afbe7a0ac1 ("kvm: arm64: vgic: fix > > hyp panic with 64k pages on juno platform") from Linus' tree and commit > > 8f186d522c69 ("KVM: ARM: vgic: split GICv2 backend from the main vgic > > code") and others from the kvm-arm tree. > > > > I fixed it up (the latter extensively rewrites the function, so I just > > used that) and can carry the fix as necessary (no action is required). > > > > Hmm that doesn't look correct, the checks for > > PAGE_ALIGNED(vcpu_res.start) and PAGE_ALIGNED(resource_size(vcpu_res)) > > still need to be enforced for both vgic-v2 and vgic-v3. How do we > > provide a correct fix for Linux-next? > > I've provided a resolution for GICv2 in a separate email. For GICv3, I > have the following patch in my tree, which can be added at a later time. > The GICv3 build fix and the GICv3 fix you provided here are now both in kvmarm/next. Stephen, did you pick up the resolution provided by Marc for the gicv2 fix patch so that it applies to tomorrow's next/kvmarm merge? Thanks, -Christoffer -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
On Thu, Jul 31 2014 at 03:23:47 PM, Christoffer Dall <cdall@cs.columbia.edu> wrote: > On Thu, Jul 31, 2014 at 01:15:40PM +0100, Marc Zyngier wrote: >> On Thu, Jul 31 2014 at 12:53:03 pm BST, Christoffer Dall >> <christofferdall@christofferdall.dk> wrote: >> >> Hi Christoffer, >> >> > On Thu, Jul 31, 2014 at 8:30 AM, Stephen Rothwell >> > <sfr@canb.auug.org.au> wrote: >> > >> > Hi all, >> > >> > Today's linux-next merge of the kvm-arm tree got a conflict in >> > virt/kvm/arm/vgic.c between commit 63afbe7a0ac1 ("kvm: arm64: vgic: fix >> > hyp panic with 64k pages on juno platform") from Linus' tree and commit >> > 8f186d522c69 ("KVM: ARM: vgic: split GICv2 backend from the main vgic >> > code") and others from the kvm-arm tree. >> > >> > I fixed it up (the latter extensively rewrites the function, so I just >> > used that) and can carry the fix as necessary (no action is required). >> > >> > Hmm that doesn't look correct, the checks for >> > PAGE_ALIGNED(vcpu_res.start) and PAGE_ALIGNED(resource_size(vcpu_res)) >> > still need to be enforced for both vgic-v2 and vgic-v3. How do we >> > provide a correct fix for Linux-next? >> >> I've provided a resolution for GICv2 in a separate email. For GICv3, I >> have the following patch in my tree, which can be added at a later time. >> > The GICv3 build fix and the GICv3 fix you provided here are now both > in kvmarm/next. Excellent, thanks Christoffer. Cheers, M.
Hi Christoffer, On Thu, 31 Jul 2014 16:23:47 +0200 Christoffer Dall <cdall@cs.columbia.edu> wrote: > > Stephen, did you pick up the resolution provided by Marc for the gicv2 > fix patch so that it applies to tomorrow's next/kvmarm merge? Yes, I have. You will need to produce the same for Linus eventually, or do the merge yourself as I suggested.
diff --git a/virt/kvm/arm/vgic-v3.c b/virt/kvm/arm/vgic-v3.c index f01d446..1c2c8ee 100644 --- a/virt/kvm/arm/vgic-v3.c +++ b/virt/kvm/arm/vgic-v3.c @@ -215,6 +215,22 @@ int vgic_v3_probe(struct device_node *vgic_node, ret = -ENXIO; goto out; } + + if (!PAGE_ALIGNED(vcpu_res.start)) { + kvm_err("GICV physical address 0x%llx not page aligned\n", + (unsigned long long)vcpu_res.start); + ret = -ENXIO; + goto out; + } + + if (!PAGE_ALIGNED(resource_size(&vcpu_res))) { + kvm_err("GICV size 0x%llx not a multiple of page size 0x%lx\n", + (unsigned long long)resource_size(&vcpu_res), + PAGE_SIZE); + ret = -ENXIO; + goto out; + } + vgic->vcpu_base = vcpu_res.start; vgic->vctrl_base = NULL; vgic->type = VGIC_V3;