Re: [PATCH v2 6/6] KVM: arm/arm64: vgic: Allow configuration of interrupt groups

2018-07-09 Thread Christoffer Dall
On Mon, Jul 09, 2018 at 09:42:40AM +0100, Marc Zyngier wrote: > On 04/07/18 10:38, Christoffer Dall wrote: > > Implement the required MMIO accessors for GICv2 and GICv3 for the > > IGROUPR distributor and redistributor registers. > > > > This can allow guests to change behavior compared to

Re: [PATCH v4 0/6] KVM/arm64: Cache maintenance relaxations

2018-07-09 Thread Marc Zyngier
On 02/07/18 16:02, Marc Zyngier wrote: > This small series makes use of features recently introduced in the > ARMv8 architecture to relax the cache maintenance operations on CPUs > that implement these features. > > FWB is the most important one. It allows stage-2 to enforce the > cacheability of

Re: [PATCH] KVM: arm/arm64: Fix vgic init race

2018-07-09 Thread Marc Zyngier
On 03/07/18 22:26, Christoffer Dall wrote: > The vgic_init function can race with kvm_arch_vcpu_create() which does > not hold kvm_lock() and we therefore have no synchronization primitives > to ensure we're doing the right thing. > > As the user is trying to initialize or run the VM while at the

[PATCH] KVM: arm/arm64: vgic-debug: Show LPI status

2018-07-09 Thread Marc Zyngier
The vgic debugfs file only knows about SGI/PPI/SPI interrupts, and completely ignores LPIs. Let's fix that. Signed-off-by: Marc Zyngier --- I've had this patch in my tree for almost 4 months now, and it has been useful at least once. Thoughts? virt/kvm/arm/vgic/vgic-debug.c | 42

Re: [PATCH v3 15/20] kvm: arm/arm64: Allow tuning the physical address size for VM

2018-07-09 Thread Dave Martin
On Fri, Jul 06, 2018 at 05:39:00PM +0100, Suzuki K Poulose wrote: > On 07/06/2018 04:09 PM, Marc Zyngier wrote: > >On 06/07/18 14:49, Suzuki K Poulose wrote: > >>On 04/07/18 23:03, Suzuki K Poulose wrote: > >>>On 07/04/2018 04:51 PM, Will Deacon wrote: > Hi Suzuki, > > On Fri, Jun 29,

Re: [PATCH v2 6/6] KVM: arm/arm64: vgic: Allow configuration of interrupt groups

2018-07-09 Thread Marc Zyngier
On 04/07/18 10:38, Christoffer Dall wrote: > Implement the required MMIO accessors for GICv2 and GICv3 for the > IGROUPR distributor and redistributor registers. > > This can allow guests to change behavior compared to running on previous > versions of KVM, but only to align with the architecture

Re: [PATCH v3 15/20] kvm: arm/arm64: Allow tuning the physical address size for VM

2018-07-09 Thread Dave Martin
On Mon, Jul 09, 2018 at 01:29:42PM +0100, Marc Zyngier wrote: > On 09/07/18 12:23, Dave Martin wrote: > > On Fri, Jul 06, 2018 at 05:39:00PM +0100, Suzuki K Poulose wrote: > >> On 07/06/2018 04:09 PM, Marc Zyngier wrote: > >>> On 06/07/18 14:49, Suzuki K Poulose wrote: > On 04/07/18 23:03,

Re: [PATCH v3 15/20] kvm: arm/arm64: Allow tuning the physical address size for VM

2018-07-09 Thread Marc Zyngier
On 09/07/18 12:23, Dave Martin wrote: > On Fri, Jul 06, 2018 at 05:39:00PM +0100, Suzuki K Poulose wrote: >> On 07/06/2018 04:09 PM, Marc Zyngier wrote: >>> On 06/07/18 14:49, Suzuki K Poulose wrote: On 04/07/18 23:03, Suzuki K Poulose wrote: > On 07/04/2018 04:51 PM, Will Deacon wrote:

[PATCH v5 6/7] KVM: arm64: Update age handlers to support PUD hugepages

2018-07-09 Thread Punit Agrawal
In preparation for creating larger hugepages at Stage 2, add support to the age handling notifiers for PUD hugepages when encountered. Provide trivial helpers for arm32 to allow sharing code. Signed-off-by: Punit Agrawal Cc: Christoffer Dall Cc: Marc Zyngier Cc: Russell King Cc: Catalin

[PATCH v5 5/7] KVM: arm64: Support handling access faults for PUD hugepages

2018-07-09 Thread Punit Agrawal
In preparation for creating larger hugepages at Stage 2, extend the access fault handling at Stage 2 to support PUD hugepages when encountered. Provide trivial helpers for arm32 to allow sharing of code. Signed-off-by: Punit Agrawal Cc: Christoffer Dall Cc: Marc Zyngier Cc: Russell King Cc:

[PATCH v5 0/7] KVM: Support PUD hugepages at stage 2

2018-07-09 Thread Punit Agrawal
This series is an update to the PUD hugepage support previously posted at [0]. This patchset adds support for PUD hugepages at stage 2. This feature is useful on cores that have support for large sized TLB mappings (e.g., 1GB for 4K granule). The biggest change in this version is to replace

[PATCH v5 0/7] KVM: Support PUD hugepages at stage 2

2018-07-09 Thread Punit Agrawal
This series is an update to the PUD hugepage support previously posted at [0]. This patchset adds support for PUD hugepages at stage 2. This feature is useful on cores that have support for large sized TLB mappings (e.g., 1GB for 4K granule). The biggest change in this version is to replace

[PATCH v5 7/7] KVM: arm64: Add support for creating PUD hugepages at stage 2

2018-07-09 Thread Punit Agrawal
KVM only supports PMD hugepages at stage 2. Now that the various page handling routines are updated, extend the stage 2 fault handling to map in PUD hugepages. Addition of PUD hugepage support enables additional page sizes (e.g., 1G with 4K granule) which can be useful on cores that support

[PATCH v5 4/7] KVM: arm64: Support PUD hugepage in stage2_is_exec()

2018-07-09 Thread Punit Agrawal
In preparation for creating PUD hugepages at stage 2, add support for detecting execute permissions on PUD page table entries. Faults due to lack of execute permissions on page table entries is used to perform i-cache invalidation on first execute. Provide trivial implementations of arm32 helpers

[PATCH v5 2/7] KVM: arm/arm64: Introduce helpers to manupulate page table entries

2018-07-09 Thread Punit Agrawal
Introduce helpers to abstract architectural handling of the conversion of pfn to page table entries and marking a PMD page table entry as a block entry. The helpers are introduced in preparation for supporting PUD hugepages at stage 2 - which are supported on arm64 but do not exist on arm.

[PATCH v5 1/7] KVM: arm/arm64: Share common code in user_mem_abort()

2018-07-09 Thread Punit Agrawal
The code for operations such as marking the pfn as dirty, and dcache/icache maintenance during stage 2 fault handling is duplicated between normal pages and PMD hugepages. Instead of creating another copy of the operations when we introduce PUD hugepages, let's share them across the different

[PATCH v5 3/7] KVM: arm64: Support dirty page tracking for PUD hugepages

2018-07-09 Thread Punit Agrawal
In preparation for creating PUD hugepages at stage 2, add support for write protecting PUD hugepages when they are encountered. Write protecting guest tables is used to track dirty pages when migrating VMs. Also, provide trivial implementations of required kvm_s2pud_* helpers to allow sharing of

Re: [PATCH v5 0/7] KVM: Support PUD hugepages at stage 2

2018-07-09 Thread Punit Agrawal
Please ignore this cover letter. Apologies for the duplicate cover-letter and a somewhat funky threading (I blame emacs unsaved buffer). The patches appear to be intact so don't let the threading get in the way of review. Punit Agrawal writes: > This series is an update to the PUD hugepage

Re: [PATCH] KVM: arm64: vgic-its: Remove VLA usage

2018-07-09 Thread Kees Cook
On Mon, Jul 9, 2018 at 3:47 AM, Marc Zyngier wrote: > Hi kees, > > On 02/07/18 18:15, Kees Cook wrote: >> On Mon, Jul 2, 2018 at 12:36 AM, Auger Eric wrote: >>> Hi Kees, >>> >>> On 06/29/2018 08:46 PM, Kees Cook wrote: In the quest to remove all stack VLA usage from the kernel[1], this

Re: [RFC PATCH 05/16] KVM: arm: Add arch init/uninit hooks

2018-07-09 Thread Dave Martin
On Fri, Jul 06, 2018 at 11:02:20AM +0100, Alex Bennée wrote: > > Dave Martin writes: > > > In preparation for adding support for SVE in guests on arm64, hooks > > for allocating and freeing additional per-vcpu memory are needed. > > > > kvm_arch_vcpu_setup() could be used for allocation, but