Re: [PATCH 12/16] mm/ioremap: Add arch-specific callbacks on ioremap/iounmap calls

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:55PM +0100, Marc Zyngier wrote: > Add a pair of hooks (ioremap_page_range_hook/iounmap_page_range_hook) > that can be implemented by an architecture. > > Signed-off-by: Marc Zyngier > --- > include/linux/io.h | 3 +++ > mm/ioremap.c | 13 - >

Re: [PATCH 07/16] KVM: arm64: Wire MMIO guard hypercalls

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:50PM +0100, Marc Zyngier wrote: > Plumb in the hypercall interface to allow a guest to discover, > enroll, map and unmap MMIO regions. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hypercalls.c | 20 > include/linux/arm-smccc.h | 28

Re: [PATCH 06/16] KVM: arm64: Force a full unmap on vpcu reinit

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:49PM +0100, Marc Zyngier wrote: > As we now keep information in the S2PT, we must be careful not > to keep it across a VM reboot, which could otherwise lead to > interesting problems. > > Make sure that the S2 is completely discarded on reset of > a vcpu, and remove

Re: [PATCH 05/16] KVM: arm64: Plumb MMIO checking into the fault handling

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:48PM +0100, Marc Zyngier wrote: > Plumb the MMIO checking code into the MMIO fault handling code. > Nothing allows a region to be registered yet, so there should be > no funtional change either. Typo: functional > Signed-off-by: Marc Zyngier > --- >

Re: [PATCH 04/16] KVM: arm64: Add MMIO checking infrastructure

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:47PM +0100, Marc Zyngier wrote: > Introduce the infrastructure required to identify an IPA region > that is expected to be used as an MMIO window. > > This include mapping, unmapping and checking the regions. Nothing > calls into it yet, so no expected functional

Re: [PATCH 02/16] KVM: arm64: Don't issue CMOs when the physical address is invalid

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:45PM +0100, Marc Zyngier wrote: > Make sure we don't issue CMOs when mapping something that > is not a memory address in the S2 page tables. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/pgtable.c | 16 ++-- > 1 file changed, 10

Re: [PATCH 01/16] KVM: arm64: Generalise VM features into a set of flags

2021-07-27 Thread Will Deacon
On Thu, Jul 15, 2021 at 05:31:44PM +0100, Marc Zyngier wrote: > We currently deal with a set of booleans for VM features, > while they could be better represented as set of flags > contained in an unsigned long, similarily to what we are > doing on the CPU side. > > Signed-off-by: Marc Zyngier >

Re: [PATCH v2 5/6] KVM: arm64: Use get_page() instead of kvm_get_pfn()

2021-07-27 Thread Alexandru Elisei
Hi Marc, On 7/26/21 4:35 PM, Marc Zyngier wrote: > When mapping a THP, we are guaranteed that the page isn't reserved, > and we can safely avoid the kvm_is_reserved_pfn() call. > > Replace kvm_get_pfn() with get_page(pfn_to_page()). > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/mmu.c |

Re: [PATCH v2 3/6] KVM: arm64: Avoid mapping size adjustment on permission fault

2021-07-27 Thread Alexandru Elisei
Hi Marc, On 7/26/21 4:35 PM, Marc Zyngier wrote: > Since we only support PMD-sized mappings for THP, getting > a permission fault on a level that results in a mapping > being larger than PAGE_SIZE is a sure indication that we have > already upgraded our mapping to a PMD. > > In this case, there

Re: [PATCH v2 2/6] KVM: arm64: Walk userspace page tables to compute the THP mapping size

2021-07-27 Thread Alexandru Elisei
Hi Marc, On 7/26/21 4:35 PM, Marc Zyngier wrote: > We currently rely on the kvm_is_transparent_hugepage() helper to > discover whether a given page has the potential to be mapped as > a block mapping. > > However, this API doesn't really give un everything we want: > - we don't get the size: this

Re: [PATCH v2 1/6] KVM: arm64: Introduce helper to retrieve a PTE and its level

2021-07-27 Thread Alexandru Elisei
Hi Marc, On 7/26/21 4:35 PM, Marc Zyngier wrote: > It is becoming a common need to fetch the PTE for a given address > together with its level. Add such a helper. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_pgtable.h | 19 ++ > arch/arm64/kvm/hyp/pgtable.c

Re: [PATCH v2 1/6] KVM: arm64: Introduce helper to retrieve a PTE and its level

2021-07-27 Thread Quentin Perret
On Monday 26 Jul 2021 at 16:35:47 (+0100), Marc Zyngier wrote: > It is becoming a common need to fetch the PTE for a given address > together with its level. Add such a helper. Reviewed-by: Quentin Perret Thanks, Quentin ___ kvmarm mailing list

[PATCH] KVM: ARM: count remote TLB flushes

2021-07-27 Thread Paolo Bonzini
KVM/ARM has an architecture-specific implementation of kvm_flush_remote_tlbs; however, unlike the generic one, it does not count the flushes in kvm->stat.remote_tlb_flush, so that it inexorably remained stuck to zero. Signed-off-by: Paolo Bonzini --- arch/arm64/kvm/mmu.c | 1 + 1 file changed,