Re: [PATCH v4 0/3] KVM: Dynamic Halt-Polling

2015-09-02 Thread Wanpeng Li
On 9/2/15 9:49 AM, David Matlack wrote: On Tue, Sep 1, 2015 at 5:29 PM, Wanpeng Li wrote: On 9/2/15 7:24 AM, David Matlack wrote: On Tue, Sep 1, 2015 at 3:58 PM, Wanpeng Li wrote: Why this can happen? Ah, probably because I'm missing

[PATCH v5 0/3] KVM: Dynamic Halt-Polling

2015-09-02 Thread Wanpeng Li
v4 -> v5: * set base case 10us and max poll time 500us * handle short/long halt, idea from David, many thanks David ;-) v3 -> v4: * bring back grow vcpu->halt_poll_ns when interrupt arrives and shrinks when idle VCPU is detected v2 -> v3: * grow/shrink vcpu->halt_poll_ns by

[PATCH v5 2/3] KVM: dynamic halt_poll_ns adjustment

2015-09-02 Thread Wanpeng Li
There is a downside of always-poll since poll is still happened for idle vCPUs which can waste cpu usage. This patch adds the ability to adjust halt_poll_ns dynamically, to grow halt_poll_ns when shot halt is detected, and to shrink halt_poll_ns when long halt is detected. There are two new

[PATCH v5 3/3] KVM: trace kvm_halt_poll_ns grow/shrink

2015-09-02 Thread Wanpeng Li
Tracepoint for dynamic halt_pool_ns, fired on every potential change. Signed-off-by: Wanpeng Li --- include/trace/events/kvm.h | 30 ++ virt/kvm/kvm_main.c| 8 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git

[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: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
On 02/09/15 00:24, Paul Mackerras wrote: > On Tue, Sep 01, 2015 at 11:41:18PM +0200, Thomas Huth wrote: >> The size of the Problem State Priority Boost Register is only >> 32 bits, so let's change the type of the corresponding variable >> accordingly to avoid future trouble. > > Since we're

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
On 02/09/15 00:24, Paul Mackerras wrote: > On Tue, Sep 01, 2015 at 11:41:18PM +0200, Thomas Huth wrote: >> The size of the Problem State Priority Boost Register is only >> 32 bits, so let's change the type of the corresponding variable >> accordingly to avoid future trouble. > > Since we're

[PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink

2015-09-02 Thread Wanpeng Li
Tracepoint for dynamic halt_pool_ns, fired on every potential change. Signed-off-by: Wanpeng Li --- include/trace/events/kvm.h | 30 ++ virt/kvm/kvm_main.c| 8 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git

[PATCH v2 4/5] KVM: arm64: Introduce find_reg_by_id()

2015-09-02 Thread Pavel Fedin
In order to implement vGICv3 CPU interface access, we will need to perform table lookup of system registers. We would need both index_to_params() and find_reg() exported for that purpose, but instead we export a single function which combines them both. Signed-off-by: Pavel Fedin

[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 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 +---

[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] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
The size of the Problem State Priority Boost Register is only 32 bits, but the kvm_vcpu_arch->pspb variable is declared as "ulong", ie. 64-bit. However, the assembler code accesses this variable with 32-bit accesses, and the KVM_REG_PPC_PSPB macro is defined with SIZE_U32, too, so that the current

[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

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Alexander Graf
> Am 02.09.2015 um 09:26 schrieb Thomas Huth : > >> On 02/09/15 00:55, Benjamin Herrenschmidt wrote: >>> On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: >>> On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt >>> wrote: On Tue, 2015-09-01 at 23:41

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
On 02/09/15 10:26, Alexander Graf wrote: > >> Am 02.09.2015 um 09:26 schrieb Thomas Huth : >> >>> On 02/09/15 00:55, Benjamin Herrenschmidt wrote: On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt

[PATCH v2] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
The size of the Problem State Priority Boost Register is only 32 bits, but the kvm_vcpu_arch->pspb variable is declared as "ulong", ie. 64-bit. However, the assembler code accesses this variable with 32-bit accesses, and the KVM_REG_PPC_PSPB macro is defined with SIZE_U32, too, so that the current

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
On 02/09/15 00:55, Benjamin Herrenschmidt wrote: > On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: >> On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt >> wrote: >>> On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: The size of the Problem State Priority Boost

[PATCH v6 1/3] KVM: make halt_poll_ns per-vCPU

2015-09-02 Thread Wanpeng Li
Change halt_poll_ns into per-vCPU variable, seeded from module parameter, to allow greater flexibility. Signed-off-by: Wanpeng Li --- include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v6 0/3] KVM: Dynamic Halt-Polling

2015-09-02 Thread Wanpeng Li
v5 -> v6: * fix wait_ns and poll_ns v4 -> v5: * set base case 10us and max poll time 500us * handle short/long halt, idea from David, many thanks David ;-) v3 -> v4: * bring back grow vcpu->halt_poll_ns when interrupt arrives and shrinks when idle VCPU is detected v2 -> v3: *

[PATCH v6 2/3] KVM: dynamic halt_poll_ns adjustment

2015-09-02 Thread Wanpeng Li
There is a downside of always-poll since poll is still happened for idle vCPUs which can waste cpu usage. This patch adds the ability to adjust halt_poll_ns dynamically, to grow halt_poll_ns when shot halt is detected, and to shrink halt_poll_ns when long halt is detected. There are two new

Re: [PATCH v2 01/18] acpi: allow aml_operation_region() working on 64 bit offset

2015-09-02 Thread Igor Mammedov
On Fri, 14 Aug 2015 22:51:54 +0800 Xiao Guangrong wrote: > Currently, the offset in OperationRegion is limited to 32 bit, extend it > to 64 bit so that we can switch SSDT to 64 bit in later patch > > Signed-off-by: Xiao Guangrong

[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

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Alexander Graf
> Am 02.09.2015 um 09:26 schrieb Thomas Huth : > >> On 02/09/15 00:55, Benjamin Herrenschmidt wrote: >>> On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: >>> On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt >>> wrote: On Tue, 2015-09-01 at 23:41

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
On 02/09/15 10:26, Alexander Graf wrote: > >> Am 02.09.2015 um 09:26 schrieb Thomas Huth : >> >>> On 02/09/15 00:55, Benjamin Herrenschmidt wrote: On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt

Re: [PATCH v2 01/15] KVM: arm/arm64: VGIC: don't track used LRs in the distributor

2015-09-02 Thread Andre Przywara
On 31/08/15 09:42, Eric Auger wrote: > On 08/24/2015 06:33 PM, Andre Przywara wrote: Salut Eric, ... @@ -1126,9 +1124,9 @@ static void vgic_queue_irq_to_lr(struct kvm_vcpu *vcpu, int irq, */ bool vgic_queue_irq(struct kvm_vcpu *vcpu, u8 sgi_source_id, int irq) {

[PATCH v5 1/3] KVM: make halt_poll_ns per-VCPU

2015-09-02 Thread Wanpeng Li
Change halt_poll_ns into per-vCPU variable, seeded from module parameter, to allow greater flexibility. Signed-off-by: Wanpeng Li --- include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH] kvm: irqchip: fix memory leak

2015-09-02 Thread Sudip Mukherjee
We were taking the exit path after checking ue->flags and return value of setup_routing_entry(), but 'e' was not freed incase of a failure. Signed-off-by: Sudip Mukherjee --- virt/kvm/irqchip.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] KVM: ppc: Fix size of the PSPB register

2015-09-02 Thread Thomas Huth
On 02/09/15 00:55, Benjamin Herrenschmidt wrote: > On Wed, 2015-09-02 at 08:45 +1000, Paul Mackerras wrote: >> On Wed, Sep 02, 2015 at 08:25:05AM +1000, Benjamin Herrenschmidt >> wrote: >>> On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: The size of the Problem State Priority Boost

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: [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 14/15] KVM: arm: implement lazy world switch for debug registers

2015-09-02 Thread Christoffer Dall
On Mon, Aug 10, 2015 at 09:26:06PM +0800, Zhichao Huang wrote: > Avoid world-switching all the debug registers when neither the host > nor the guest has configured any [WB]points. > > Signed-off-by: Zhichao Huang > --- > arch/arm/kvm/interrupts_head.S | 23

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 -- To unsubscribe from this list: send the line "unsubscribe

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 v6 0/3] KVM: Dynamic Halt-Polling

2015-09-02 Thread David Matlack
On Wed, Sep 2, 2015 at 12:29 AM, Wanpeng Li wrote: > v5 -> v6: > * fix wait_ns and poll_ns Thanks for bearing with me through all the reviews. I think it's on the verge of being done :). There are just few small things to fix. > > v4 -> v5: > * set base case 10us and

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 v6 2/3] KVM: dynamic halt_poll_ns adjustment

2015-09-02 Thread David Matlack
On Wed, Sep 2, 2015 at 12:29 AM, Wanpeng Li wrote: > There is a downside of always-poll since poll is still happened for idle > vCPUs which can waste cpu usage. This patch adds the ability to adjust > halt_poll_ns dynamically, to grow halt_poll_ns when shot halt is

Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-09-02 Thread Nakajima, Jun
On Wed, Sep 2, 2015 at 3:38 PM, Steve Rutherford wrote: > On Thu, Aug 13, 2015 at 09:31:48AM +0200, Paolo Bonzini wrote: > Pinging this thread. > > Should I put together a patch to make split irqchip work properly with the > old TMR behavior? Yes, please. Intel® 64 and

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set

2015-09-02 Thread David Gibson
On Thu, Sep 03, 2015 at 03:21:23PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" > > The code that handles the case when we receive a H_DOORBELL interrupt > has a comment which says "Hypervisor doorbell - exit only if host IPI > flag set". However, the

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set

2015-09-02 Thread David Gibson
On Thu, Sep 03, 2015 at 03:21:23PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" > > The code that handles the case when we receive a H_DOORBELL interrupt > has a comment which says "Hypervisor doorbell - exit only if host IPI > flag set". However, the

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread David Gibson
On Thu, Sep 03, 2015 at 03:20:50PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" > > The current dynamic micro-threading code has a race due to which a > secondary thread naps when it is supposed to be running a vcpu. As a > side effect of this, on a guest

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread David Gibson
On Thu, Sep 03, 2015 at 03:20:50PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" > > The current dynamic micro-threading code has a race due to which a > secondary thread naps when it is supposed to be running a vcpu. As a > side effect of this, on a guest

[PATCH] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set

2015-09-02 Thread Paul Mackerras
From: "Gautham R. Shenoy" The code that handles the case when we receive a H_DOORBELL interrupt has a comment which says "Hypervisor doorbell - exit only if host IPI flag set". However, the current code does not actually check if the host IPI flag is set. This is due

[PATCH] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread Paul Mackerras
From: "Gautham R. Shenoy" The current dynamic micro-threading code has a race due to which a secondary thread naps when it is supposed to be running a vcpu. As a side effect of this, on a guest exit, the primary thread in kvmppc_wait_for_nap() finds that this secondary

[PATCH] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set

2015-09-02 Thread Paul Mackerras
From: "Gautham R. Shenoy" The code that handles the case when we receive a H_DOORBELL interrupt has a comment which says "Hypervisor doorbell - exit only if host IPI flag set". However, the current code does not actually check if the host IPI flag is set. This is due

[PATCH] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread Paul Mackerras
From: "Gautham R. Shenoy" The current dynamic micro-threading code has a race due to which a secondary thread naps when it is supposed to be running a vcpu. As a side effect of this, on a guest exit, the primary thread in kvmppc_wait_for_nap() finds that this secondary

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 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 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

[PATCH] Add baseline PIC tests.

2015-09-02 Thread Steve Rutherford
Tests basic interrupt functionality of the PIC. Relies on the QEMU test device to raise and lower irq lines leading into the PIC. Signed-off-by: Steve Rutherford --- config/config-x86-common.mak | 3 + config/config-x86_64.mak | 2 +- lib/x86/apic.c

Re: [PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink

2015-09-02 Thread David Matlack
On Wed, Sep 2, 2015 at 12:42 AM, Wanpeng Li wrote: > Tracepoint for dynamic halt_pool_ns, fired on every potential change. > > Signed-off-by: Wanpeng Li > --- > include/trace/events/kvm.h | 30 ++ > virt/kvm/kvm_main.c

Re: [PATCH v6 2/3] KVM: dynamic halt_poll_ns adjustment

2015-09-02 Thread David Matlack
On Wed, Sep 2, 2015 at 12:12 PM, Paolo Bonzini wrote: > > > On 02/09/2015 20:09, David Matlack wrote: >> On Wed, Sep 2, 2015 at 12:29 AM, Wanpeng Li wrote: >>> There is a downside of always-poll since poll is still happened for idle >>> vCPUs which

Re: [Bug 103321] New: NPT page attribute support causes extreme slowdown

2015-09-02 Thread Sebastian Schütte
I inserted some printk() lines into init_vmcb() around the call of svm_set_guest_pat() to print out the g_pat value as well as svm->vcpu.vcpu_id and noticed that something was off: Initially, the PATs of all VCPUs are set to 0x0606060606060606. However, after attaching some devices (vfio-pci

Re: [PATCH v6 2/3] KVM: dynamic halt_poll_ns adjustment

2015-09-02 Thread Paolo Bonzini
On 02/09/2015 20:09, David Matlack wrote: > On Wed, Sep 2, 2015 at 12:29 AM, Wanpeng Li wrote: >> There is a downside of always-poll since poll is still happened for idle >> vCPUs which can waste cpu usage. This patch adds the ability to adjust >> halt_poll_ns

Re: [PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink

2015-09-02 Thread Wanpeng Li
On 9/3/15 2:09 AM, David Matlack wrote: On Wed, Sep 2, 2015 at 12:42 AM, Wanpeng Li wrote: Tracepoint for dynamic halt_pool_ns, fired on every potential change. Signed-off-by: Wanpeng Li --- include/trace/events/kvm.h | 30

Re: [PATCH 11/12] cpu: Add crash_occurred flag into CPUState

2015-09-02 Thread Paolo Bonzini
On 03/07/2015 14:01, Denis V. Lunev wrote: > From: Andrey Smetanin > > CPUState::crash_occurred field inside CPUState marks > that guest crash occurred. This value is added into > cpu common migration subsection. > > Signed-off-by: Andrey Smetanin

Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-09-02 Thread Steve Rutherford
On Thu, Aug 13, 2015 at 09:31:48AM +0200, Paolo Bonzini wrote: Pinging this thread. Should I put together a patch to make split irqchip work properly with the old TMR behavior? > > > On 13/08/2015 08:35, Zhang, Yang Z wrote: > >> You may be right. It is safe if no future hardware plans to use

Re: [PATCH v3 0/5] KVM: optimize userspace exits with a new ioctl

2015-09-02 Thread Christian Borntraeger
Am 14.08.2015 um 12:08 schrieb Radim Krčmář: > v3: > * acked by Christian [1/5] > * use ioctl argument directly (unsigned long as flags) [4/5] > * precisely #ifdef arch-specific ioctls [5/5] > v2: > * move request_exits debug counter patch right after introduction of >KVM_REQ_EXIT [3/5] >

Re: [Qemu-devel] [PATCH v2 06/18] pc: implement NVDIMM device abstract

2015-09-02 Thread Igor Mammedov
On Wed, 2 Sep 2015 18:36:43 +0800 Xiao Guangrong wrote: > > > On 09/02/2015 05:58 PM, Igor Mammedov wrote: > > On Fri, 14 Aug 2015 22:51:59 +0800 > > Xiao Guangrong wrote: > > > >> Introduce "pc-nvdimm" device and it has two

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 v2 05/18] acpi: add aml_create_field

2015-09-02 Thread Igor Mammedov
On Fri, 14 Aug 2015 22:51:58 +0800 Xiao Guangrong wrote: > Implement CreateField term which are used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c | 14 ++ >

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: [Qemu-devel] [PATCH v2 02/18] i386/acpi-build: allow SSDT to operate on 64 bit

2015-09-02 Thread Igor Mammedov
On Wed, 2 Sep 2015 18:43:41 +0800 Xiao Guangrong wrote: > > > On 09/02/2015 06:06 PM, Igor Mammedov wrote: > > On Fri, 14 Aug 2015 22:51:55 +0800 > > Xiao Guangrong wrote: > > > >> Only 512M is left for MMIO below 4G and that are

Re: commit 3c2e7f7de3 (KVM use NPT page attributes) causes boot failures

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 11:50 AM, Markus Trippelsdorf wrote: On 2015.09.02 at 06:31 +0800, Xiao Guangrong wrote: On 09/01/2015 09:56 PM, Markus Trippelsdorf wrote: On 2015.09.01 at 21:00 +0800, Xiao Guangrong wrote: Did it trigger the BUG()/BUG_ON() in mtrr2protval()/fallback_mtrr_type()? If yes,

Re: commit 3c2e7f7de3 (KVM use NPT page attributes) causes boot failures

2015-09-02 Thread Markus Trippelsdorf
On 2015.09.02 at 17:17 +0800, Xiao Guangrong wrote: > > > > No. PAT is of course enabled and booting is successful sometimes even > > with the BUG() in allback_mtrr_type(). I suspect a setup (timing) issue. > > Thanks for your confirmation. > > > > > markus@x4 linux % cat .config | grep X86_PAT

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 02/14] arm64: Handle section maps for swapper/idmap

2015-09-02 Thread Ard Biesheuvel
On 2 September 2015 at 11:42, Suzuki K. Poulose wrote: > On 02/09/15 10:38, Ard Biesheuvel wrote: >> >> On 13 August 2015 at 13:33, Suzuki K. Poulose >> wrote: >>> >>> From: "Suzuki K. Poulose" >>> >>> We use section maps

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: [PATCH v2 03/18] acpi: add aml_derefof

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 06:16 PM, Igor Mammedov wrote: On Fri, 14 Aug 2015 22:51:56 +0800 Xiao Guangrong wrote: Implement DeRefOf term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong ---

Re: [Qemu-devel] [PATCH v2 02/18] i386/acpi-build: allow SSDT to operate on 64 bit

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 06:06 PM, Igor Mammedov wrote: On Fri, 14 Aug 2015 22:51:55 +0800 Xiao Guangrong wrote: Only 512M is left for MMIO below 4G and that are used by PCI, BIOS etc. Other components also reserve regions from their internal usage, e.g, [0xFED0,

Re: commit 3c2e7f7de3 (KVM use NPT page attributes) causes boot failures

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 06:54 PM, Markus Trippelsdorf wrote: On 2015.09.02 at 18:27 +0800, Xiao Guangrong wrote: On 09/02/2015 05:38 PM, Markus Trippelsdorf wrote: On 2015.09.02 at 17:17 +0800, Xiao Guangrong wrote: No. PAT is of course enabled and booting is successful sometimes even with the

Re: [PATCH v2 02/18] i386/acpi-build: allow SSDT to operate on 64 bit

2015-09-02 Thread Michael S. Tsirkin
On Wed, Sep 02, 2015 at 12:06:02PM +0200, Igor Mammedov wrote: > On Fri, 14 Aug 2015 22:51:55 +0800 > Xiao Guangrong wrote: > > > Only 512M is left for MMIO below 4G and that are used by PCI, BIOS etc. > > Other components also reserve regions from their internal

[kvm-unit-tests PATCH 0/2] arm/arm64: Add self-modifying code test case

2015-09-02 Thread Alexander Spyridakis
This series implements a self-modifying code test for the arm and arm64 targets. The first patch adds the new test case, while the second modifies the arch_clean rule for arm and arm64, to explicitly remove object files and binaries on 'make clean' (fixing and issue while reconfiguring). The test

Re: [PATCH v2 02/18] i386/acpi-build: allow SSDT to operate on 64 bit

2015-09-02 Thread Igor Mammedov
On Fri, 14 Aug 2015 22:51:55 +0800 Xiao Guangrong wrote: > Only 512M is left for MMIO below 4G and that are used by PCI, BIOS etc. > Other components also reserve regions from their internal usage, e.g, > [0xFED0, 0xFED0 + 0x400) is reserved for HPET > >

Re: [PATCH v2 04/18] acpi: add aml_sizeof

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 06:18 PM, Igor Mammedov wrote: On Fri, 14 Aug 2015 22:51:57 +0800 Xiao Guangrong wrote: Implement SizeOf term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong ---

[KVMTOOL][PATCH] Handle KVM_EXIT_SYSTEM_EVENT on any VCPU

2015-09-02 Thread Mark Rutland
When VCPU #0 exits (e.g. due to KVM_EXIT_SYSTEM_EVENT), it sends SIGKVMEXIT to all other VCPUs, waits for them to exit, then tears down any remaining context. The signalling of SIGKVMEXIT is critical to forcing VCPUs to shut down in response to a system event (e.g. PSCI SYSTEM_OFF). VCPUs other

[kvm-unit-tests PATCH 2/2] arm/arm64 config: Fix arch_clean rule

2015-09-02 Thread Alexander Spyridakis
Properly clean any generated object and binary files after a 'make clean', this fixes an issue when trying to reconfigure between arm and arm64. Signed-off-by: Alexander Spyridakis --- config/config-arm.mak | 2 ++ config/config-arm64.mak | 3 ++- 2 files

[kvm-unit-tests PATCH 1/2] arm/arm64: Add self-modifying code test

2015-09-02 Thread Alexander Spyridakis
Basic torture test that continuously modifies a single instruction opcode and checks if all modifications were done and run as expected. Signed-off-by: Alexander Spyridakis --- arm/self-modifying-test.c| 109 +++

Re: [PATCH 02/14] arm64: Handle section maps for swapper/idmap

2015-09-02 Thread Ard Biesheuvel
On 13 August 2015 at 13:33, Suzuki K. Poulose wrote: > From: "Suzuki K. Poulose" > > We use section maps with 4K page size to create the > swapper/idmaps. So far we have used !64K or 4K checks > to handle the case where we use the section maps.

Re: [PATCH v2 03/18] acpi: add aml_derefof

2015-09-02 Thread Igor Mammedov
On Fri, 14 Aug 2015 22:51:56 +0800 Xiao Guangrong wrote: > Implement DeRefOf term which is used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c | 8 >

Re: KVM: Security Policy

2015-09-02 Thread Stefan Hajnoczi
On Thu, Aug 27, 2015 at 02:01:52PM +0200, Stefan Geißler wrote: > Hello kvm mailing list, > > I assume, this is a rather uncommon mailing list post since it is not > directly related to the usage or development of KVM. Instead, the following > is the case: > > I am a student of computer science

Re: commit 3c2e7f7de3 (KVM use NPT page attributes) causes boot failures

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 05:38 PM, Markus Trippelsdorf wrote: On 2015.09.02 at 17:17 +0800, Xiao Guangrong wrote: No. PAT is of course enabled and booting is successful sometimes even with the BUG() in allback_mtrr_type(). I suspect a setup (timing) issue. Thanks for your confirmation. markus@x4

Re: [PATCH 02/14] arm64: Handle section maps for swapper/idmap

2015-09-02 Thread Suzuki K. Poulose
On 02/09/15 10:38, Ard Biesheuvel wrote: On 13 August 2015 at 13:33, Suzuki K. Poulose wrote: From: "Suzuki K. Poulose" We use section maps with 4K page size to create the swapper/idmaps. So far we have used !64K or 4K checks to handle the case

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 v6 0/3] KVM: Dynamic Halt-Polling

2015-09-02 Thread Paolo Bonzini
On 02/09/2015 09:29, Wanpeng Li wrote: > v5 -> v6: > * fix wait_ns and poll_ns > > v4 -> v5: > * set base case 10us and max poll time 500us > * handle short/long halt, idea from David, many thanks David ;-) > > v3 -> v4: > * bring back grow vcpu->halt_poll_ns when interrupt arrives and

Re: [Qemu-devel] [PATCH v2 06/18] pc: implement NVDIMM device abstract

2015-09-02 Thread Igor Mammedov
On Fri, 14 Aug 2015 22:51:59 +0800 Xiao Guangrong wrote: > Introduce "pc-nvdimm" device and it has two parameters: Why do you use prefix "pc-", I suppose we potentially could use this device not only with x86 targets but with other targets as well. I'd just drop

Re: [PATCH v2 04/18] acpi: add aml_sizeof

2015-09-02 Thread Igor Mammedov
On Fri, 14 Aug 2015 22:51:57 +0800 Xiao Guangrong wrote: > Implement SizeOf term which is used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c | 8 >

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: [Qemu-devel] [PATCH v2 06/18] pc: implement NVDIMM device abstract

2015-09-02 Thread Xiao Guangrong
On 09/02/2015 05:58 PM, Igor Mammedov wrote: On Fri, 14 Aug 2015 22:51:59 +0800 Xiao Guangrong wrote: Introduce "pc-nvdimm" device and it has two parameters: Why do you use prefix "pc-", I suppose we potentially could use this device not only with x86

Re: commit 3c2e7f7de3 (KVM use NPT page attributes) causes boot failures

2015-09-02 Thread Markus Trippelsdorf
On 2015.09.02 at 18:27 +0800, Xiao Guangrong wrote: > > > On 09/02/2015 05:38 PM, Markus Trippelsdorf wrote: > > On 2015.09.02 at 17:17 +0800, Xiao Guangrong wrote: > >>> > >>> No. PAT is of course enabled and booting is successful sometimes even > >>> with the BUG() in allback_mtrr_type(). I

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 +- >