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

2015-09-14 Thread Christoffer Dall
On Mon, Sep 14, 2015 at 11:29:34AM +0200, Eric Auger wrote: > Christoffer, > On 09/02/2015 09:58 PM, Christoffer Dall wrote: > > 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

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

2015-09-14 Thread Christoffer Dall
On Tue, Sep 08, 2015 at 02:04:15PM +0200, Eric Auger wrote: > Hi Christoffer, > On 09/02/2015 09:42 PM, Christoffer Dall wrote: > > 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

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

2015-09-14 Thread Christoffer Dall
Hi Eric, On Wed, Sep 09, 2015 at 10:41:32AM +0200, Eric Auger wrote: [...] > I tried to integrate into the updated state machine for non shared > mapped IRQ but I fail. What exactly do you mean when you refer to 'updated state machine' ? > > 1) The first problem encountered is how to reset

Re: [PATCH v2 6/8] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-09-14 Thread Christoffer Dall
On Mon, Sep 07, 2015 at 06:45:42PM +0200, Eric Auger wrote: > Hi Christoffer, > On 09/04/2015 09:40 PM, Christoffer Dall wrote: > > Forwarded physical interrupts on arm/arm64 is a tricky concept and the > > way we deal with them is not apparently easy to understand by reading > > various specs. >

Re: [PATCH v2 7/8] arm/arm64: KVM: Rework the arch timer to use level-triggered semantics

2015-09-14 Thread Christoffer Dall
On Mon, Sep 14, 2015 at 11:29:53AM +0200, Eric Auger wrote: > On 09/04/2015 09:40 PM, Christoffer Dall wrote: > > The arch timer currently uses edge-triggered semantics in the sense that > > the line is never sampled by the vgic and lowering the line from the > > timer to the vgic doesn't have any

[PATCH] KVM: nVMX: nested VPID emulation

2015-09-14 Thread Wanpeng Li
VPID is used to tag address space and avoid a TLB flush. Currently L0 use the same VPID to run L1 and all its guests. KVM flushes VPID when switching between L1 and L2. This patch advertises VPID to the L1 hypervisor, then address space of L1 and L2 can be separately treated and avoid TLB

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-14 Thread Christoffer Dall
Hi Shannon, On Fri, Sep 11, 2015 at 04:54:53PM +0800, Shannon Zhao wrote: > From: Shannon Zhao > > This patchset adds guest PMU support for KVM on ARM64. It takes > trap-and-emulate approach. When guest wants to monitor one event, it > will be trapped by KVM and KVM

Re: [PATCH 00/39] drop null test before destroy functions

2015-09-14 Thread SF Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following > functions able to tolerate NULL arguments: > > kmem_cache_destroy (commit 3942d29918522) > mempool_destroy (commit 4e3ca3e033d1) > dma_pool_destroy (commit 44d7175da6ea) How do you think about to extend an other SmPL

Re: [PATCH] KVM: arm/arm64: BUG FIX: Do not inject spurious interrupts

2015-09-14 Thread Christoffer Dall
On Fri, Aug 28, 2015 at 12:11:17PM +0300, Pavel Fedin wrote: > Hello! > > > It's a bit weird to just sned this as a new patch without replying to my > > mail from yesterday with feedback > > Sorry. But changes are actually minimal, and i remember that i replied to > you with the promise of >

Re: [PATCH v2 6/8] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-09-14 Thread Christoffer Dall
Hi Andre, On Fri, Sep 11, 2015 at 12:21:22PM +0100, Andre Przywara wrote: > Hi Christoffer, > > (actually you are not supposed to reply during your holidays!) yeah, I know, but I couldn't help myself here. > > On 09/09/15 09:49, Christoffer Dall wrote: > > On Tue, Sep 8, 2015 at 6:57 PM,

Re: [PATCH v2 04/22] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register

2015-09-14 Thread Marc Zyngier
On 14/09/15 04:14, Shannon Zhao wrote: > > > On 2015/9/11 18:07, Marc Zyngier wrote: >> On 11/09/15 09:54, Shannon Zhao wrote: From: Shannon Zhao Add reset handler which gets host value of PMCR_EL0 and make writable bits architecturally UNKNOWN. Add

Re: [PATCH v2 3/8] arm/arm64: KVM: vgic: Factor out level irq processing on guest exit

2015-09-14 Thread Christoffer Dall
On Mon, Sep 07, 2015 at 05:32:35PM +0200, Eric Auger wrote: > > > On 09/04/2015 09:40 PM, Christoffer Dall wrote: > > Currently vgic_process_maintenance() processes dealing with a completed > > level-triggered interrupt directly, but we are soon going to reuse this > > logic for level-triggered

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-14 Thread Shannon Zhao
On 2015/9/14 19:53, Christoffer Dall wrote: Hi Shannon, On Fri, Sep 11, 2015 at 04:54:53PM +0800, Shannon Zhao wrote: From: Shannon Zhao This patchset adds guest PMU support for KVM on ARM64. It takes trap-and-emulate approach. When guest wants to monitor one

Re: [PATCH] powerpc/e500: move qemu machine spec together with the rest

2015-09-14 Thread Laurentiu Tudor
On 09/10/2015 02:01 AM, Scott Wood wrote: > On Fri, 2015-09-04 at 15:46 +0300, Laurentiu Tudor wrote: >> This way we get rid of an entire file with mostly >> duplicated code plus a Kconfig option that you always >> had to take care to check it in order for kvm to work. >> >> Signed-off-by:

Re: [PATCH] KVM: nVMX: nested VPID emulation

2015-09-14 Thread Jan Kiszka
On 2015-09-14 14:52, Wanpeng Li wrote: > VPID is used to tag address space and avoid a TLB flush. Currently L0 use > the same VPID to run L1 and all its guests. KVM flushes VPID when switching > between L1 and L2. > > This patch advertises VPID to the L1 hypervisor, then address space of L1

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-14 Thread Shannon Zhao
Sorry, I forgot the changlog. Below are the main changes of this v2 patchset. Changes since v1->v2: * Use switch...case for registers access handler instead of adding alone handler for each register * Try to use the sys_regs to store the register value instead of adding new variables in

Re: [PATCH] powerpc/e500: move qemu machine spec together with the rest

2015-09-14 Thread Alexander Graf
> Am 14.09.2015 um 15:17 schrieb Laurentiu Tudor : > >> On 09/10/2015 02:01 AM, Scott Wood wrote: >>> On Fri, 2015-09-04 at 15:46 +0300, Laurentiu Tudor wrote: >>> This way we get rid of an entire file with mostly >>> duplicated code plus a Kconfig option that you always

Re: [PATCH] powerpc/e500: move qemu machine spec together with the rest

2015-09-14 Thread Scott Wood
On Mon, 2015-09-14 at 16:17 +0300, Laurentiu Tudor wrote: > On 09/10/2015 02:01 AM, Scott Wood wrote: > > On Fri, 2015-09-04 at 15:46 +0300, Laurentiu Tudor wrote: > > > This way we get rid of an entire file with mostly > > > duplicated code plus a Kconfig option that you always > > > had to take

Re: [PATCH] powerpc/e500: move qemu machine spec together with the rest

2015-09-14 Thread Scott Wood
On Mon, 2015-09-14 at 16:14 +0200, Alexander Graf wrote: > > Am 14.09.2015 um 15:17 schrieb Laurentiu Tudor : > > > > > On 09/10/2015 02:01 AM, Scott Wood wrote: > > > > On Fri, 2015-09-04 at 15:46 +0300, Laurentiu Tudor wrote: > > > > This way we get rid of an entire file

Re: [PATCH] KVM: arm64: add workaround for Cortex-A57 erratum #852523

2015-09-14 Thread Marc Zyngier
On 14/09/15 16:06, Will Deacon wrote: > When restoring the system register state for an AArch32 guest at EL2, > writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57, > which can lead to the guest effectively running with junk in the DACR > and running into unexpected domain faults.

Re: [PATCH] KVM: nVMX: nested VPID emulation

2015-09-14 Thread Bandan Das
Wanpeng Li writes: > VPID is used to tag address space and avoid a TLB flush. Currently L0 use > the same VPID to run L1 and all its guests. KVM flushes VPID when switching > between L1 and L2. > > This patch advertises VPID to the L1 hypervisor, then address space of

Re: [PATCH v2 7/8] arm/arm64: KVM: Rework the arch timer to use level-triggered semantics

2015-09-14 Thread Andre Przywara
Hi Christoffer, just one small nit I stumbled upon: On 04/09/15 20:40, Christoffer Dall wrote: > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index 9ed8d53..f4ea950 100644 > --- a/virt/kvm/arm/vgic.c > +++ b/virt/kvm/arm/vgic.c > @@ -1422,34 +1422,43 @@ static bool

[PATCH] KVM: arm64: add workaround for Cortex-A57 erratum #852523

2015-09-14 Thread Will Deacon
When restoring the system register state for an AArch32 guest at EL2, writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57, which can lead to the guest effectively running with junk in the DACR and running into unexpected domain faults. This patch works around the issue by

Re: [RESEARCH] Patch delivery delay

2015-09-14 Thread Paolo Bonzini
On 14/09/2015 10:58, Stefan Geißler wrote: > > I am currently analyzing the delay between vulnerability disclosure (CVE > release) and the release of a corresponding patch. > > Firstly, i noticed that some vulnerabilities are patched before the CVE > was assigned. How is that possible? Was the

Re: [PATCH] KVM: make the declaration of functions within 80 characters

2015-09-14 Thread Paolo Bonzini
On 11/09/2015 08:12, Wei Yang wrote: > After 'commit 0b8ba4a2b658 ("KVM: fix checkpatch.pl errors in > kvm/coalesced_mmio.h")', the declaration of the two function will exceed 80 > characters. > > This patch reduces the TAPs to make each line in 80 characters. > > Signed-off-by: Wei Yang

Re: [PATCH] KVM: arm64: add workaround for Cortex-A57 erratum #852523

2015-09-14 Thread Will Deacon
On Mon, Sep 14, 2015 at 04:46:28PM +0100, Marc Zyngier wrote: > On 14/09/15 16:06, Will Deacon wrote: > > When restoring the system register state for an AArch32 guest at EL2, > > writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57, > > which can lead to the guest effectively

Re: [RFC PATCH] vfio/pci: Use kernel VPD access functions

2015-09-14 Thread Alex Williamson
On Sat, 2015-09-12 at 01:11 +, Rustad, Mark D wrote: > Alex, > > > On Sep 11, 2015, at 11:16 AM, Alex Williamson > > wrote: > > > > RFC - Is this something we should do? > > Superficially this looks pretty good. I need to think harder to be sure of > the

Re: [RESEARCH] Patch delivery delay

2015-09-14 Thread Paolo Bonzini
On 14/09/2015 20:59, Stefan Geißler wrote: >> >> There could be many reasons. For example the problem could be very >> minor, the patches could have problems, or a second patch was needed >> because the first fix was insufficient so. It's difficult to say >> without seeing the CVE and patch

Re: [RFC PATCH] vfio/pci: Use kernel VPD access functions

2015-09-14 Thread Rustad, Mark D
> On Sep 11, 2015, at 6:11 PM, Rustad, Mark D wrote: > > Superficially this looks pretty good. I need to think harder to be sure of > the details. This is the first time I've looked at all at any of the vfio code, but this is still looking good to me. Thanks for

[RFC PATCH] os-android: Add support to android platform, built by ndk-r10

2015-09-14 Thread Houcheng Lin
From: Houcheng This patch is to build qemu in android ndk tool-chain, and has been tested in both x86_64 and x86 android platform with hardware virtualization enabled. This patch is composed of three part: - configure scripts for android - OS dependent code

[RFC PATCH] os-android: Add support to android platform, built by ndk-r10

2015-09-14 Thread Houcheng Lin
From: Houcheng This patch is to build qemu in android ndk tool-chain, and has been tested in both x86_64 and x86 android platform with hardware virtualization enabled. This patch is composed of three part: - configure scripts for android - OS dependent code

Re: [PATCH v3] ppc/spapr: Implement H_RANDOM hypercall in QEMU

2015-09-14 Thread David Gibson
On Mon, Sep 14, 2015 at 08:32:36AM +0200, Thomas Huth wrote: > On 14/09/15 04:15, David Gibson wrote: > > On Fri, Sep 11, 2015 at 11:17:01AM +0200, Thomas Huth wrote: > >> The PAPR interface defines a hypercall to pass high-quality > >> hardware generated random numbers to guests. Recent kernels

RE: [PATCH v7 15/17] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-09-14 Thread Wu, Feng
First of all, Paolo, thanks a lot for your review on this series, it really means a lot!:) > -Original Message- > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of Paolo Bonzini > Sent: Friday, September 11, 2015 7:21 PM > To: Wu, Feng;

Re: [RESEARCH] Patch delivery delay

2015-09-14 Thread Stefan Geißler
I am currently analyzing the delay between vulnerability disclosure (CVE release) and the release of a corresponding patch. Firstly, i noticed that some vulnerabilities are patched before the CVE was assigned. How is that possible? Was the vulnerability "accitendally" fixed? (Example: According

Re: [PATCH v3] ppc/spapr: Implement H_RANDOM hypercall in QEMU

2015-09-14 Thread Thomas Huth
On 14/09/15 04:15, David Gibson wrote: > On Fri, Sep 11, 2015 at 11:17:01AM +0200, Thomas Huth wrote: >> The PAPR interface defines a hypercall to pass high-quality >> hardware generated random numbers to guests. Recent kernels can >> already provide this hypercall to the guest if the right

[RESEARCH] Patch delivery delay

2015-09-14 Thread Stefan Geißler
Hello all, I am currently analyzing the delay between vulnerability disclosure (CVE release) and the release of a corresponding patch. Firstly, i noticed that some vulnerabilities are patched before the CVE was assigned. How is that possible? Was the vulnerability "accitendally" fixed?

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

2015-09-14 Thread Eric Auger
Christoffer, On 09/02/2015 09:58 PM, Christoffer Dall wrote: > 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

Re: [PATCH v2 7/8] arm/arm64: KVM: Rework the arch timer to use level-triggered semantics

2015-09-14 Thread Eric Auger
On 09/04/2015 09:40 PM, Christoffer Dall wrote: > The arch timer currently uses edge-triggered semantics in the sense that > the line is never sampled by the vgic and lowering the line from the > timer to the vgic doesn't have any affect on the pending state of s/affect/effect > virtual interrupts

[PATCH] KVM: fix polling for guest halt continued even if disable it

2015-09-14 Thread Wanpeng Li
If there is already some polling ongoing, it's impossible to disable the polling, since as soon as somebody sets halt_poll_ns to 0, polling will never stop, as grow and shrink are only handled if halt_poll_ns is != 0. This patch fix it by reset vcpu->halt_poll_ns in order to stop polling when

Re: [PATCH 31/39] KVM: MMU: drop null test before destroy functions

2015-09-14 Thread Paolo Bonzini
On 13/09/2015 14:15, Julia Lawall wrote: > Remove unneeded NULL test. > > The semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ expression x; @@ > -if (x != NULL) > \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); > // > >

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

2015-09-14 Thread Wanpeng Li
On 9/10/15 3:13 PM, Christian Borntraeger wrote: Am 10.09.2015 um 03:55 schrieb Wanpeng Li: On 9/9/15 9:39 PM, Christian Borntraeger wrote: Am 03.09.2015 um 16:07 schrieb Wanpeng Li: v6 -> v7: * explicit signal (set a bool) * fix the tracepoint v5 -> v6: * fix wait_ns and poll_ns