Re: [kvm-unit-tests PATCH v4 0/3] A couple of small fixes

2015-07-28 Thread Andrew Jones
On Tue, Jul 28, 2015 at 06:42:29AM +0100, Alex Bennée wrote: > > Alex Bennée writes: > > > One minor fix for quote usage and added a final r-b tag from Drew. > > > > Please apply > > Ping. Do I need to get anyone in particular to commit this. I notice we > don't list any particular maintainers

[kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Alex Bennée
This may be overkill for a project as small as the unit tests now but perhaps it pays to be explicit? Signed-off-by: Alex Bennée --- MAINTAINERS | 67 + 1 file changed, 67 insertions(+) create mode 100644 MAINTAINERS diff --git a/MAIN

Re: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 10:56, Alex Bennée wrote: > +Architecture Specific Code: > +--- > + > +ARM > +M: Christoffer Dall > +L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) > +L: kvm...@lists.cs.columbia.edu > +F: arm/* > + Hmm, shouldn't the maintainer be

Re: Should KVM_GUEST stop depending on PARAVIRT?

2015-07-28 Thread Paolo Bonzini
On 27/07/2015 20:45, Andy Lutomirski wrote: > On Mon, Jul 27, 2015 at 11:30 AM, Paolo Bonzini wrote: >> >> >> On 27/07/2015 19:51, Andy Lutomirski wrote: > I think I'm missing something. Does KVM_GUEST hook read_msr and > write_msr? I don't see it. PARAVIRT does, and it's the

Re: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Alex Bennée
Paolo Bonzini writes: > On 28/07/2015 10:56, Alex Bennée wrote: >> +Architecture Specific Code: >> +--- >> + >> +ARM >> +M: Christoffer Dall >> +L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) >> +L: kvm...@lists.cs.columbia.edu >> +F: arm/* >> +

Re: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Andrew Jones
On Tue, Jul 28, 2015 at 12:41:38PM +0100, Alex Bennée wrote: > > Paolo Bonzini writes: > > > On 28/07/2015 10:56, Alex Bennée wrote: > >> +Architecture Specific Code: > >> +--- > >> + > >> +ARM > >> +M: Christoffer Dall > >> +L: linux-arm-ker...@lists.infradead.org (mode

Re: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Marc Zyngier
On 28/07/15 13:44, Andrew Jones wrote: > On Tue, Jul 28, 2015 at 12:41:38PM +0100, Alex Bennée wrote: >> >> Paolo Bonzini writes: >> >>> On 28/07/2015 10:56, Alex Bennée wrote: +Architecture Specific Code: +--- + +ARM +M: Christoffer Dall +L:

[kvm-unit-tests PATCH 0/2] lib: devicetree: add stdout-path

2015-07-28 Thread Andrew Jones
Easy addition to the devicetree support that may come in handy for powerpc (and it may not - I have a ppc series ready to post that doesn't actually bother with stdout-path yet, but whatever...) Andrew Jones (2): devicetree: add /chosen/stdout-path support arm/arm64: uart0_init: check /chosen/

[kvm-unit-tests PATCH 1/2] devicetree: add /chosen/stdout-path support

2015-07-28 Thread Andrew Jones
Signed-off-by: Andrew Jones --- lib/devicetree.c | 24 lib/devicetree.h | 9 + 2 files changed, 33 insertions(+) diff --git a/lib/devicetree.c b/lib/devicetree.c index 0f9b4e9942736..93f3841daf22c 100644 --- a/lib/devicetree.c +++ b/lib/devicetree.c @@ -246,6 +2

[kvm-unit-tests PATCH 2/2] arm/arm64: uart0_init: check /chosen/stdout-path

2015-07-28 Thread Andrew Jones
Arguably all of uart0_init() is unnecessary, as we're pretty sure that the address we initialize uart0_base to is correct. We go through the motions of finding the uart anyway though, because it's easy. It's also easy to check chosen/stdout-path first, so let's do that too. But, just to make all th

Re: [PATCH v5 4/4] KVM: x86: Add support for local interrupt requests from userspace

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 01:17, Steve Rutherford wrote: > return kvm->arch.vpic; > } > > +static inline int pic_in_kernel(struct kvm *kvm) > +{ > + int ret; > + > + ret = (pic_irqchip(kvm) != NULL); > + smp_rmb(); What does this memory barrier pair with? I don't think it's necessary.

Re: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-07-28 Thread Alex Williamson
On Fri, 2015-07-24 at 14:33 +0530, Pranavkumar Sawargaonkar wrote: > In current VFIO MSI/MSI-X implementation, linux host kernel > allocates MSI/MSI-X vectors when userspace requests through vfio ioctls. > Vfio creates irqfd mappings to notify MSI/MSI-X interrupts > to the userspace when raised. >

Re: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-07-28 Thread Marc Zyngier
Hi Alex, On 28/07/15 17:21, Alex Williamson wrote: > On Fri, 2015-07-24 at 14:33 +0530, Pranavkumar Sawargaonkar wrote: >> In current VFIO MSI/MSI-X implementation, linux host kernel >> allocates MSI/MSI-X vectors when userspace requests through vfio ioctls. >> Vfio creates irqfd mappings to notif

RE: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-07-28 Thread Bhushan Bharat
Hi Alex, > -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Tuesday, July 28, 2015 9:52 PM > To: Pranavkumar Sawargaonkar > Cc: kvm@vger.kernel.org; kvm...@lists.cs.columbia.edu; linux-arm- > ker...@lists.infradead.org; linux-ker...@vger.kernel.org; >

Re: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-07-28 Thread Alex Williamson
On Tue, 2015-07-28 at 17:55 +0100, Marc Zyngier wrote: > Hi Alex, > > On 28/07/15 17:21, Alex Williamson wrote: > > On Fri, 2015-07-24 at 14:33 +0530, Pranavkumar Sawargaonkar wrote: > >> In current VFIO MSI/MSI-X implementation, linux host kernel > >> allocates MSI/MSI-X vectors when userspace re

[RFC PATCH 0/1] iommu: Detach device from domain when removed from group

2015-07-28 Thread Gerald Schaefer
Hi, during IOMMU API function testing on s390 I hit the following scenario: After binding a device to vfio-pci, the user completes the VFIO_SET_IOMMU ioctl and stops, see the sample C program below. Now the device is manually removed via "echo 1 > /sys/bus/pci/devices/.../remove". Although the S

[RFC PATCH 1/1] iommu: Detach device from domain when removed from group

2015-07-28 Thread Gerald Schaefer
This patch adds a call to __iommu_detach_device() to the iommu_group_remove_device() function, which will trigger a missing detach_dev callback in (at least) the following scenario: When a user completes the VFIO_SET_IOMMU ioctl for a vfio-pci device, and the corresponding device is removed therea

Re: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-07-28 Thread Alex Williamson
On Tue, 2015-07-28 at 17:23 +, Bhushan Bharat wrote: > Hi Alex, > > > -Original Message- > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Tuesday, July 28, 2015 9:52 PM > > To: Pranavkumar Sawargaonkar > > Cc: kvm@vger.kernel.org; kvm...@lists.cs.columbia.edu; li

Re: [PATCH v5 4/4] KVM: x86: Add support for local interrupt requests from userspace

2015-07-28 Thread Steve Rutherford
On Tue, Jul 28, 2015 at 05:58:38PM +0200, Paolo Bonzini wrote: > > > On 28/07/2015 01:17, Steve Rutherford wrote: > > return kvm->arch.vpic; > > } > > > > +static inline int pic_in_kernel(struct kvm *kvm) > > +{ > > + int ret; > > + > > + ret = (pic_irqchip(kvm) != NULL); > > + smp_r

Re: [PATCH v5 4/4] KVM: x86: Add support for local interrupt requests from userspace

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 21:06, Steve Rutherford wrote: >>> > > + if (!kvm_run->ready_for_interrupt_injection && >>> > > + ready_for_interrupt_injection) >>> > > + kvm_make_request(KVM_REQ_PIC_UNMASK_EXIT, vcpu); >>> > > + >>> > > + kvm_run

Re: Should KVM_GUEST stop depending on PARAVIRT?

2015-07-28 Thread Andy Lutomirski
Let's add peterz? On Tue, Jul 28, 2015 at 2:57 AM, Paolo Bonzini wrote: > > > On 27/07/2015 20:45, Andy Lutomirski wrote: >> On Mon, Jul 27, 2015 at 11:30 AM, Paolo Bonzini wrote: >>> >>> >>> On 27/07/2015 19:51, Andy Lutomirski wrote: >> I think I'm missing something. Does KVM_GUEST hook r

Re: [PATCH v5 4/4] KVM: x86: Add support for local interrupt requests from userspace

2015-07-28 Thread Steve Rutherford
On Wed, Jul 29, 2015 at 12:05:37AM +0200, Paolo Bonzini wrote: > Ok, I understand it now. However, you're still not causing an exit > when LVT0 changes, are you? post_kvm_run_save is not run until the > next exit to userspace, which could be a long time later. Yes! This is definitely right. Thi

[PATCH v6 1/4] KVM: x86: Split the APIC from the rest of IRQCHIP.

2015-07-28 Thread Steve Rutherford
First patch in a series which enables the relocation of the PIC/IOAPIC to userspace. Adds capability KVM_CAP_SPLIT_IRQCHIP; KVM_CAP_SPLIT_IRQCHIP enables the construction of LAPICs without the rest of the irqchip. Compile tested for x86. Signed-off-by: Steve Rutherford Suggested-by: Andrew Hon

[PATCH v6 3/4] KVM: x86: Add EOI exit bitmap inference

2015-07-28 Thread Steve Rutherford
In order to support a userspace IOAPIC interacting with an in kernel APIC, the EOI exit bitmaps need to be configurable. If the IOAPIC is in userspace (i.e. the irqchip has been split), the EOI exit bitmaps will be set whenever the GSI Routes are configured. In particular, for the low MSI routes a

[PATCH v6 2/4] KVM: x86: Add KVM exit for IOAPIC EOIs

2015-07-28 Thread Steve Rutherford
Adds KVM_EXIT_IOAPIC_EOI which allows the kernel to EOI level-triggered IOAPIC interrupts. Uses a per VCPU exit bitmap to decide whether or not the IOAPIC needs to be informed (which is identical to the EOI_EXIT_BITMAP field used by modern x86 processors, but can also be used to elide kvm IOAPIC E

[PATCH v6 4/4] KVM: x86: Add support for local interrupt requests from userspace

2015-07-28 Thread Steve Rutherford
In order to enable userspace PIC support, the userspace PIC needs to be able to inject local interrupts even when the APICs are in the kernel. KVM_INTERRUPT now supports sending local interrupts to an APIC when APICs are in the kernel. The ready_for_interrupt_request flag is now only set when the

Re: Should KVM_GUEST stop depending on PARAVIRT?

2015-07-28 Thread Venkatesh Srinivas
> On Tue, Jul 28, 2015 at 2:57 AM, Paolo Bonzini wrote: >> >> >> On 27/07/2015 20:45, Andy Lutomirski wrote: >>> On Mon, Jul 27, 2015 at 11:30 AM, Paolo Bonzini wrote: On 27/07/2015 19:51, Andy Lutomirski wrote: >>> I think I'm missing something. Does KVM_GUEST hook read_msr a