[PATCH v2 2/3] arm64: KVM: Do not use pgd_index to index stage-2 pgd

2015-03-12 Thread Marc Zyngier
The kernel's pgd_index macro is designed to index a normal, page sized array. KVM is a bit diffferent, as we can use concatenated pages to have a bigger address space (for example 40bit IPA with 4kB pages gives us an 8kB PGD. In the above case, the use of pgd_index will always return an index

Re: [PATCH v2 1/3] arm64: KVM: Fix stage-2 PGD allocation to have per-page refcounting

2015-03-12 Thread Andrew Jones
On Wed, Mar 11, 2015 at 02:20:56PM +0100, Christoffer Dall wrote: On Wed, Mar 11, 2015 at 2:13 PM, Marc Zyngier marc.zyng...@arm.com wrote: Hi Christoffer, On 11/03/15 12:16, Christoffer Dall wrote: Hi Marc, On Tue, Mar 10, 2015 at 07:06:59PM +, Marc Zyngier wrote: We're using

Re: [PATCH v14 00/20] VFIO support for platform devices

2015-03-12 Thread Eric Auger
On 03/11/2015 11:08 AM, Baptiste Reynal wrote: Thanks Eric and Alex for your reviews. I can confirm we can drop the dependency, as I re-tested without it. Do you need a fix for the headers issue underlined by Eric ? Hi Baptiste, As far as I am concerned I do not have such request ;-) Best

Re: [PATCH] arm64: dts: Fix GIC reg sizes for APM X-Gene

2015-03-12 Thread Marc Zyngier
[adding RobH to the CC list, as he was commenting on the subject earlier] Hi Pranav, On 12/03/15 03:52, Pranavkumar Sawargaonkar wrote: Hi Marc, On Wed, Mar 11, 2015 at 11:47 PM, Marc Zyngier marc.zyng...@arm.com wrote: On 11/03/15 17:57, Feng Kan wrote: On Wed, Mar 11, 2015 at 10:31 AM,

Re: [PATCH 3/3] arm/arm64: KVM: Optimize handling of Access Flag faults

2015-03-12 Thread Christoffer Dall
On Wed, Jan 21, 2015 at 06:42:13PM +, Marc Zyngier wrote: Now that we have page aging in Stage-2, it becomes obvious that we're doing way too much work handling the fault. The page is not going anywhere (it is still mapped), the page tables are already allocated, and all we want is to

Re: [PATCH 1/3] arm/arm64: KVM: Allow handle_hva_to_gpa to return a value

2015-03-12 Thread Christoffer Dall
On Wed, Jan 21, 2015 at 06:42:11PM +, Marc Zyngier wrote: So far, handle_hva_to_gpa was never required to return a value. As we prepare to age pages at Stage-2, we need to be able to return a value from the iterator (kvm_test_age_hva). Adapt the code to handle this situation. No semantic

Re: [PATCH 2/3] arm/arm64: KVM: Implement Stage-2 page aging

2015-03-12 Thread Christoffer Dall
On Wed, Jan 21, 2015 at 06:42:12PM +, Marc Zyngier wrote: Until now, KVM/arm didn't care much for page aging (who was swapping anyway?), and simply provided empty hooks to the core KVM code. With server-type systems now being available, things are quite different. This patch implements

Re: [PATCH 2/3] arm/arm64: KVM: Implement Stage-2 page aging

2015-03-12 Thread Marc Zyngier
On Thu, 12 Mar 2015 11:40:17 + Christoffer Dall christoffer.d...@linaro.org wrote: On Wed, Jan 21, 2015 at 06:42:12PM +, Marc Zyngier wrote: Until now, KVM/arm didn't care much for page aging (who was swapping anyway?), and simply provided empty hooks to the core KVM code. With

Re: [PATCH v5] hw/intc/arm_gic: Initialize the vgic in the realize function

2015-03-12 Thread Peter Maydell
On 11 March 2015 at 17:17, Eric Auger eric.au...@linaro.org wrote: This patch forces vgic initialization in the vgic realize function. It uses a new group/attribute that allows such operation: KVM_DEV_ARM_VGIC_GRP_CTRL/KVM_DEV_ARM_VGIC_CTRL_INIT This earlier initialization allows, for

Re: [PATCH v2 1/6] target-arm: kvm: save/restore mp state

2015-03-12 Thread Peter Maydell
On 4 March 2015 at 14:35, Alex Bennée alex.ben...@linaro.org wrote: This adds the saving and restore of the current Multi-Processing state of the machine. While the KVM_GET/SET_MP_STATE API exposes a number of potential states for x86 we only use two for ARM. Either the process is running or

Re: [PATCH v2 3/6] hw/char: pl011 don't keep setting the IRQ if nothing changed

2015-03-12 Thread Peter Maydell
On 4 March 2015 at 14:35, Alex Bennée alex.ben...@linaro.org wrote: While observing KVM traces I can see additional IRQ calls on pretty much every MMIO access which is just plain inefficient. Only update the QEMU IRQ level if something has actually changed from last time. Otherwise we may be

Re: [PATCH 3/3] arm/arm64: KVM: Optimize handling of Access Flag faults

2015-03-12 Thread Marc Zyngier
On Thu, 12 Mar 2015 11:40:24 + Christoffer Dall christoffer.d...@linaro.org wrote: On Wed, Jan 21, 2015 at 06:42:13PM +, Marc Zyngier wrote: Now that we have page aging in Stage-2, it becomes obvious that we're doing way too much work handling the fault. The page is not going

Re: [PATCH v2 3/6] hw/char: pl011 don't keep setting the IRQ if nothing changed

2015-03-12 Thread Peter Maydell
On 12 March 2015 at 15:51, Peter Maydell peter.mayd...@linaro.org wrote: On 4 March 2015 at 14:35, Alex Bennée alex.ben...@linaro.org wrote: While observing KVM traces I can see additional IRQ calls on pretty much every MMIO access which is just plain inefficient. Only update the QEMU IRQ

[PATCH v2 3/3] arm/arm64: KVM: Optimize handling of Access Flag faults

2015-03-12 Thread Marc Zyngier
Now that we have page aging in Stage-2, it becomes obvious that we're doing way too much work handling the fault. The page is not going anywhere (it is still mapped), the page tables are already allocated, and all we want is to flip a bit in the PMD or PTE. Also, we can avoid any form of TLB

[PATCH v2 0/3] arm/arm64: KVM: Add support for page aging

2015-03-12 Thread Marc Zyngier
So far, KVM/arm doesn't implement any support for page aging, leading to rather bad performance when the system is swapping. This short series implements the required hooks and fault handling to deal with pages being marked old/young. The three patches are fairly straightforward: - First patch

[PATCH v2 2/3] arm/arm64: KVM: Implement Stage-2 page aging

2015-03-12 Thread Marc Zyngier
Until now, KVM/arm didn't care much for page aging (who was swapping anyway?), and simply provided empty hooks to the core KVM code. With server-type systems now being available, things are quite different. This patch implements very simple support for page aging, by clearing the Access flag in

[PATCH v2 1/3] arm/arm64: KVM: Allow handle_hva_to_gpa to return a value

2015-03-12 Thread Marc Zyngier
So far, handle_hva_to_gpa was never required to return a value. As we prepare to age pages at Stage-2, we need to be able to return a value from the iterator (kvm_test_age_hva). Adapt the code to handle this situation. No semantic change. Acked-by: Christoffer Dall christoffer.d...@linaro.org

Re: [PATCH v2 0/3] arm/arm64: KVM: Add support for page aging

2015-03-12 Thread Christoffer Dall
On Thu, Mar 12, 2015 at 06:16:49PM +, Marc Zyngier wrote: So far, KVM/arm doesn't implement any support for page aging, leading to rather bad performance when the system is swapping. This short series implements the required hooks and fault handling to deal with pages being marked