Re: [PATCH v2] KVM: arm64: Limit stage2_apply_range() batch size to 1GB

2022-09-28 Thread Marc Zyngier
On Tue, 27 Sep 2022 15:43:10 -0400, Oliver Upton wrote: > > Hi Marc, > > On Tue, Sep 27, 2022 at 07:34:22AM -0400, Marc Zyngier wrote: > > [...] > > > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > > > index c9a13e487187..5d05bb92e129 100644 > > > --- a/arch/arm64/kvm/mmu.c > >

Re: [PATCH v2] KVM: arm64: Limit stage2_apply_range() batch size to 1GB

2022-09-27 Thread Oliver Upton
Hi Marc, On Tue, Sep 27, 2022 at 07:34:22AM -0400, Marc Zyngier wrote: [...] > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > > index c9a13e487187..5d05bb92e129 100644 > > --- a/arch/arm64/kvm/mmu.c > > +++ b/arch/arm64/kvm/mmu.c > > @@ -31,6 +31,12 @@ static phys_addr_t

Re: [PATCH v2] KVM: arm64: Limit stage2_apply_range() batch size to 1GB

2022-09-27 Thread Marc Zyngier
On Mon, 26 Sep 2022 18:21:45 -0400, Oliver Upton wrote: > > Presently stage2_apply_range() works on a batch of memory addressed by a > stage 2 root table entry for the VM. Depending on the IPA limit of the > VM and PAGE_SIZE of the host, this could address a massive range of > memory. Some

[PATCH v2] KVM: arm64: Limit stage2_apply_range() batch size to 1GB

2022-09-26 Thread Oliver Upton
Presently stage2_apply_range() works on a batch of memory addressed by a stage 2 root table entry for the VM. Depending on the IPA limit of the VM and PAGE_SIZE of the host, this could address a massive range of memory. Some examples: 4 level, 4K paging -> 512 GB batch size 3 level, 64K