2015-08-13 01:15:50

by David Gibson

[permalink] [raw]
Subject: [PATCH] vfio: Enable VFIO device for powerpc

ec53500f "kvm: Add VFIO device" added a special KVM pseudo-device which is
used to handle any necessary interactions between KVM and VFIO.

Currently that device is built on x86 and ARM, but not powerpc, although
powerpc does support both KVM and VFIO. This makes things awkward in
userspace

Currently qemu prints an alarming error message if you attempt to use VFIO
and it can't initialize the KVM VFIO device. We don't want to remove the
warning, because lack of the KVM VFIO device could mean coherency problems
on x86. On powerpc, however, the error is harmless but looks disturbing,
and a test based on host architecture in qemu would be ugly, and break if
we do need the KVM VFIO device for something important in future.

There's nothing preventing the KVM VFIO device from being built for
powerpc, so this patch turns it on. It won't actually do anything, since
we don't define any of the arch_*() hooks, but it will make qemu happy and
we can extend it in future if we need to.

Signed-off-by: David Gibson <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
---
arch/powerpc/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Alex (Graf), sorry, forgot to send this to you on my first posting of
this patch, but I'm guessing it's your tree it should go in via.
Resending, with Eric's reviewed-by line folded in. Please apply.

diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 0570eef..7f7b6d8 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -8,7 +8,7 @@ ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
KVM := ../../../virt/kvm

common-objs-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
- $(KVM)/eventfd.o
+ $(KVM)/eventfd.o $(KVM)/vfio.o

CFLAGS_e500_mmu.o := -I.
CFLAGS_e500_mmu_host.o := -I.
--
2.4.3


2015-08-26 09:34:38

by Alexander Graf

[permalink] [raw]
Subject: Re: [PATCH] vfio: Enable VFIO device for powerpc



On 13.08.15 03:15, David Gibson wrote:
> ec53500f "kvm: Add VFIO device" added a special KVM pseudo-device which is
> used to handle any necessary interactions between KVM and VFIO.
>
> Currently that device is built on x86 and ARM, but not powerpc, although
> powerpc does support both KVM and VFIO. This makes things awkward in
> userspace
>
> Currently qemu prints an alarming error message if you attempt to use VFIO
> and it can't initialize the KVM VFIO device. We don't want to remove the
> warning, because lack of the KVM VFIO device could mean coherency problems
> on x86. On powerpc, however, the error is harmless but looks disturbing,
> and a test based on host architecture in qemu would be ugly, and break if
> we do need the KVM VFIO device for something important in future.
>
> There's nothing preventing the KVM VFIO device from being built for
> powerpc, so this patch turns it on. It won't actually do anything, since
> we don't define any of the arch_*() hooks, but it will make qemu happy and
> we can extend it in future if we need to.
>
> Signed-off-by: David Gibson <[email protected]>
> Reviewed-by: Eric Auger <[email protected]>

Paul is going to take care of the kvm-ppc tree for 4.3. Also, ppc kvm
patches should get CC on the kvm-ppc@vger mailing list ;).

Paul, could you please pick this one up?


Thanks!

Alex

2015-08-26 18:54:58

by Paul Mackerras

[permalink] [raw]
Subject: Re: [PATCH] vfio: Enable VFIO device for powerpc

On Wed, Aug 26, 2015 at 11:34:26AM +0200, Alexander Graf wrote:
>
>
> On 13.08.15 03:15, David Gibson wrote:
> > ec53500f "kvm: Add VFIO device" added a special KVM pseudo-device which is
> > used to handle any necessary interactions between KVM and VFIO.
> >
> > Currently that device is built on x86 and ARM, but not powerpc, although
> > powerpc does support both KVM and VFIO. This makes things awkward in
> > userspace
> >
> > Currently qemu prints an alarming error message if you attempt to use VFIO
> > and it can't initialize the KVM VFIO device. We don't want to remove the
> > warning, because lack of the KVM VFIO device could mean coherency problems
> > on x86. On powerpc, however, the error is harmless but looks disturbing,
> > and a test based on host architecture in qemu would be ugly, and break if
> > we do need the KVM VFIO device for something important in future.
> >
> > There's nothing preventing the KVM VFIO device from being built for
> > powerpc, so this patch turns it on. It won't actually do anything, since
> > we don't define any of the arch_*() hooks, but it will make qemu happy and
> > we can extend it in future if we need to.
> >
> > Signed-off-by: David Gibson <[email protected]>
> > Reviewed-by: Eric Auger <[email protected]>
>
> Paul is going to take care of the kvm-ppc tree for 4.3. Also, ppc kvm
> patches should get CC on the kvm-ppc@vger mailing list ;).
>
> Paul, could you please pick this one up?

Sure, I'll do that once I get home (end of this week).

Paul.