[PATCH] ARM/ARM64: KVM: remove 'config KVM_ARM_MAX_VCPUS'

2015-09-02 Thread Ming Lei
This patch removes config option of KVM_ARM_MAX_VCPUS, and like other ARCHs, just choose the maximum allowed value from hardware, and follows the reasons: 1) from distribution view, the option has to be defined as the max allowed value because it need to meet all kinds of virtulization

Re: [RFC PATCH v3 0/3] vfio: platform: return device properties for a platform device

2015-09-02 Thread Christoffer Dall
On Wed, Sep 02, 2015 at 09:21:26AM +0200, Baptiste Reynal wrote: > On Tue, Sep 1, 2015 at 5:52 PM, Christoffer Dall > wrote: > > On Tue, Sep 01, 2015 at 05:32:21PM +0200, Baptiste Reynal wrote: > >> Hi everyone, > >> > >> The usefullness of this patch has already been

[PATCH v2 2/5] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-09-02 Thread Pavel Fedin
The access is done similar to vGICv2, using KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_REDIST_REGS with KVM_SET_DEVICE_ATTR and KVM_GET_DEVICE_ATTR ioctls. Some registers are 64-bit wide according to the specification. KVM_DEV_ARM_VGIC_64BIT flag is introduced, allowing to perform

[PATCH v2 0/5] KVM: arm64: Implement API for vGICv3 live migration

2015-09-02 Thread Pavel Fedin
This patchset adds necessary userspace API in order to support vGICv3 live migration. GICv3 registers are accessed using device attribute ioctls, similar to GICv2. v1 => v2: - Do not use generic register get/set API for CPU interface, use only device attributes. - Introduce size specifier for

[PATCH v2 3/5] KVM: arm64: Refactor system register handlers

2015-09-02 Thread Pavel Fedin
Replace Rt with data pointer in struct sys_reg_params. This will allow to reuse system register handling code in implementation of vGICv3 CPU interface access API. Additionally, got rid of "massive hack" in kvm_handle_cp_64(). Signed-off-by: Pavel Fedin ---

[PATCH v2 5/5] Implement vGICv3 CPU interface access

2015-09-02 Thread Pavel Fedin
The access is done similar to GICv2, using KVM_DEV_ARM_VGIC_GRP_CPU_REGS group, however attribute ID encodes corresponding system register. Access size is always 64 bits. Since CPU interface state actually affects only a single vCPU, no vGIC locking is done. Just made sure that the vCPU is not

[PATCH v2 1/5] KVM: arm/arm64: Refactor vGIC attributes handling code

2015-09-02 Thread Pavel Fedin
Separate all implementation-independent code in vgic_attr_regs_access() and move it to vgic.c. This will allow to reuse this code for vGICv3 implementation. Signed-off-by: Pavel Fedin --- virt/kvm/arm/vgic-v2-emul.c | 126 +---

Re: [RFC PATCH v3 0/3] vfio: platform: return device properties for a platform device

2015-09-02 Thread Baptiste Reynal
On Tue, Sep 1, 2015 at 5:52 PM, Christoffer Dall wrote: > On Tue, Sep 01, 2015 at 05:32:21PM +0200, Baptiste Reynal wrote: >> Hi everyone, >> >> The usefullness of this patch has already been discussed during the >> first releases >>

Re: [PATCH v4 11/15] KVM: arm: add a function to keep track of host use of the debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:03PM +0800, Zhichao Huang wrote: > As we're about to implement a lazy world switch for debug registers, > we add a function reading the break/watch control variables directly to > indicate whether the host has enabled any break/watch points or not. > > Signed-off-by:

Re: [PATCH v4 15/15] KVM: arm: enable trapping of all debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:07PM +0800, Zhichao Huang wrote: > Enable trapping of the debug registers unconditionally, allowing guests to > use the debug infrastructure. > > Signed-off-by: Zhichao Huang > Reviewed-by: Christoffer Dall >

Re: [RFC PATCH v3 0/3] vfio: platform: return device properties for a platform device

2015-09-02 Thread Alex Williamson
On Wed, 2015-09-02 at 11:49 +0200, Baptiste Reynal wrote: > On Wed, Sep 2, 2015 at 11:21 AM, Christoffer Dall > wrote: > > On Wed, Sep 02, 2015 at 09:21:26AM +0200, Baptiste Reynal wrote: > >> On Tue, Sep 1, 2015 at 5:52 PM, Christoffer Dall > >>

Re: [PATCH v4 06/15] KVM: arm: add trap handlers for 32-bit debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:25:58PM +0800, Zhichao Huang wrote: > Add handlers for all the 32-bit debug registers. > > Signed-off-by: Zhichao Huang Reviewed-by: Christoffer Dall ___ kvmarm mailing

Re: [PATCH v4 12/15] KVM: arm: keep track of host use of the debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:04PM +0800, Zhichao Huang wrote: > Every guest entry, we need to keep track of host use of the debug > registers. > > We only call the function upon guest entry, after preempt_disable() > and local_irq_disable(), so there is no race for it. what about on SMP? It

Re: [PATCH v4 13/15] KVM: arm: keep track of guest use of the debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:05PM +0800, Zhichao Huang wrote: > We trap debug register accesses from guest all the time, and read the > BCR/WCR to indicate whether the guest has enabled any break/watch points > or not. > > Signed-off-by: Zhichao Huang > --- >

Re: [PATCH v3 05/10] VFIO: platform: add vfio_platform_is_active

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 03:20:59PM +0200, Eric Auger wrote: > This function returns whether the IRQ is active at irqchip level or > VFIO masked. If either is true, it is considered the IRQ is active. > Currently there is no way to differentiate userspace masked IRQ from > automasked IRQ. There

Re: [PATCH v3 07/10] KVM: arm/arm64: vgic: Allow HW interrupts for non-shared devices

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 03:21:01PM +0200, Eric Auger wrote: > From: Marc Zyngier > > So far, the only use of the HW interrupt facility was the timer, > implying that the active state is context-switched for each vcpu, > as the device is is shared across all vcpus. > > This

Re: [PATCH v3 06/10] VFIO: platform: add irq bypass producer management

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 03:21:00PM +0200, Eric Auger wrote: > This patch populates the IRQ bypass callacks: > - stop/start producer simply consist in disabling/enabling the host irq > - add/del consumer: basically set the automasked flag to false/true > > Signed-off-by: Eric Auger

Re: [PATCH v3 09/10] KVM: arm/arm64: vgic: forwarding control

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 03:21:03PM +0200, Eric Auger wrote: > Implements kvm_vgic_[set|unset]_forward. > > Handle low-level VGIC programming: physical IRQ/guest IRQ mapping, > list register cleanup, VGIC state machine. Also interacts with > the irqchip. > > Signed-off-by: Eric Auger

Re: [PATCH v3 00/10] ARM IRQ forward control based on IRQ bypass manager

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 03:20:54PM +0200, Eric Auger wrote: > This series allows to set ARM IRQ forwarding between a VFIO platform > device physical IRQ and a guest virtual IRQ. The link is coordinated > by the IRQ bypass manager. > > The principle is the VFIO platform driver registers an IRQ

Re: [PATCH v4 01/15] KVM: arm: plug guest debug exploit

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:25:53PM +0800, Zhichao Huang wrote: > Hardware debugging in guests is not intercepted currently, it means > that a malicious guest can bring down the entire machine by writing > to the debug registers. > > This patch enable trapping of all debug registers, preventing

Re: [PATCH] ARM/ARM64: KVM: remove 'config KVM_ARM_MAX_VCPUS'

2015-09-02 Thread Ming Lei
On Wed, Sep 2, 2015 at 6:25 PM, Christoffer Dall wrote: > On Wed, Sep 02, 2015 at 02:31:21PM +0800, Ming Lei wrote: >> This patch removes config option of KVM_ARM_MAX_VCPUS, >> and like other ARCHs, just choose the maximum allowed >> value from hardware, and follows

Re: [PATCH 00/14] arm64: 16K translation granule support

2015-09-02 Thread Ard Biesheuvel
On 13 August 2015 at 13:33, Suzuki K. Poulose wrote: > From: "Suzuki K. Poulose" > > This series enables the 16K page size support on Linux for arm64. > This series adds support for 48bit VA(4 level), 47bit VA(3 level) and > 36bit VA(2 level) with

Re: [PATCH 00/14] arm64: 16K translation granule support

2015-09-02 Thread Suzuki K. Poulose
On 02/09/15 10:55, Ard Biesheuvel wrote: On 13 August 2015 at 13:33, Suzuki K. Poulose wrote: From: "Suzuki K. Poulose" Patches 1-7 cleans up the kernel page size handling code. Patches 8-11 Fixes some issues with the KVM bits, mainly the

Re: [PATCH] ARM/ARM64: KVM: remove 'config KVM_ARM_MAX_VCPUS'

2015-09-02 Thread Christoffer Dall
On Wed, Sep 02, 2015 at 02:31:21PM +0800, Ming Lei wrote: > This patch removes config option of KVM_ARM_MAX_VCPUS, > and like other ARCHs, just choose the maximum allowed > value from hardware, and follows the reasons: > > 1) from distribution view, the option has to be > defined as the max

Re: [RFC PATCH v3 0/3] vfio: platform: return device properties for a platform device

2015-09-02 Thread Christoffer Dall
On Wed, Sep 02, 2015 at 11:49:12AM +0200, Baptiste Reynal wrote: > On Wed, Sep 2, 2015 at 11:21 AM, Christoffer Dall > wrote: > > On Wed, Sep 02, 2015 at 09:21:26AM +0200, Baptiste Reynal wrote: > >> On Tue, Sep 1, 2015 at 5:52 PM, Christoffer Dall > >>

Re: [PATCH 12/14] arm64: Check for selected granule support

2015-09-02 Thread Ard Biesheuvel
On 13 August 2015 at 19:29, Catalin Marinas wrote: > On Thu, Aug 13, 2015 at 03:45:07PM +0100, Suzuki K. Poulose wrote: >> On 13/08/15 13:28, Steve Capper wrote: >> >On 13 August 2015 at 12:34, Suzuki K. Poulose >> >wrote: >> >> __enable_mmu: >>

Re: [PATCH 12/14] arm64: Check for selected granule support

2015-09-02 Thread Ard Biesheuvel
On 2 September 2015 at 11:48, Ard Biesheuvel wrote: > On 13 August 2015 at 19:29, Catalin Marinas wrote: >> On Thu, Aug 13, 2015 at 03:45:07PM +0100, Suzuki K. Poulose wrote: >>> On 13/08/15 13:28, Steve Capper wrote: >>> >On 13 August 2015 at

Re: [PATCH v4 04/15] KVM: arm: common infrastructure for handling AArch32 CP14/CP15

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:25:56PM +0800, Zhichao Huang wrote: > As we're about to trap a bunch of CP14 registers, let's rework > the CP15 handling so it can be generalized and work with multiple > tables. > > We stop trapping access here, because we haven't finished our trap > handlers. We will

Re: [PATCH v4 10/15] KVM: arm: implement world switch for debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:02PM +0800, Zhichao Huang wrote: > Implement switching of the debug registers. While the number > of registers is massive, CPUs usually don't implement them all > (A15 has 6 breakpoints and 4 watchpoints, which gives us a total > of 22 registers "only"). > >

Re: [PATCH v4 09/15] KVM: arm: redefine kvm_cpu_context_t to save the host cp14 states

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:01PM +0800, Zhichao Huang wrote: > Redefine kvm_cpu_context_t as a new struct that include the cp14 states, > which we used to save the host cp14 states. > > Signed-off-by: Zhichao Huang > --- > arch/arm/include/asm/kvm_host.h | 6 +- >