[PATCH kvm-kmod] fix undefined kvm_vfio_ops

2014-01-24 Thread Jonas Pfoh
vfio.c is being pulled in from the submodule, but it is not being 
compiled/linked by the build environment, causing a "Unknown symbol in module" 
error when loading the resulting module.

Adding vfio.o to the kvm-objs variable in x86/Kbuild fixes this issue

Signed-off-by: Jonas Pfoh 
---

diff --git a/x86/Kbuild b/x86/Kbuild
index d75b756..637b3b1 100644
--- a/x86/Kbuild
+++ b/x86/Kbuild
@@ -1,7 +1,7 @@
 obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o x86.o mmu.o emulate.o irq.o i8259.o pmu.o \
 lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o irq_comm.o \
-eventfd.o compat-x86.o async_pf.o cpuid.o irqchip.o \
+eventfd.o compat-x86.o async_pf.o cpuid.o irqchip.o vfio.o\
 ../external-module-compat.o
 ifeq ($(CONFIG_IOMMU_API)$(CONFIG_PCI),yy)
 kvm-objs += assigned-dev.o iommu.o
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: compiling with kvm-kmod

2014-01-24 Thread Jonas Pfoh
Thanks for the quick fix, I found that the modules build, but I still have a 
problem loading the module due to the fact that kvm_vfio_ops remains undefined 
in the kvm module.  Below is the patch that I used to fix the issue if it is 
helpful.

-Jonas



diff --git a/x86/Kbuild b/x86/Kbuild
index d75b756..637b3b1 100644
--- a/x86/Kbuild
+++ b/x86/Kbuild
@@ -1,7 +1,7 @@
 obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o x86.o mmu.o emulate.o irq.o i8259.o pmu.o \
 lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o irq_comm.o \
-eventfd.o compat-x86.o async_pf.o cpuid.o irqchip.o \
+eventfd.o compat-x86.o async_pf.o cpuid.o irqchip.o vfio.o\
 ../external-module-compat.o
 ifeq ($(CONFIG_IOMMU_API)$(CONFIG_PCI),yy)
 kvm-objs += assigned-dev.o iommu.o

On 23.01.2014 19:19, Jan Kiszka wrote:
> On 2014-01-23 17:34, Jonas Pfoh wrote:
>> Hello,
>>
>> I am currently working on a project involving KVM and have been making use 
>> Jan's kvm-kmod repository.  I receive the below error when I attempt to 
>> compile with the most recent version.  My question is simply if this is 
>> something anyone is aware of or has any suggestions for before I go poking 
>> around?  
>>
>> I am compiling against a 3.13.0 mainline vanilla kernel and am using the 
>> master branch (3d923a3) of Jan's kvm-kmod repo which seems to be syncing 
>> from kvm commit 7650b68.
>>
>> Thanks and regards,
>> Jonas Pfoh
>>
>> make -C /lib/modules/3.13.0/build M=`pwd` \
>> LINUXINCLUDE="-I`pwd`/include -I`pwd`/include/uapi -Iinclude 
>> \
>>  -Iinclude/uapi -Iarch/x86/include 
>> -Iarch/x86/include/uapi \
>> -Iinclude/generated/uapi 
>> -Iarch/x86/include/generated \
>> -Iarch/x86/include/generated/uapi \
>> -I`pwd`/include-compat -I`pwd`/x86 \
>> -include  include/generated/autoconf.h \
>> -include `pwd`/x86/external-module-compat.h" \
>> "$@"
>> make[1]: Entering directory `/usr/src/linux-3.13'
>>   CC [M]  /local/repos/kvm-kmod/x86/svm.o
>> In file included from include/linux/device.h:29:0,
>>  from include/linux/node.h:17,
>>  from include/linux/cpu.h:16,
>>  from 
>> /local/repos/kvm-kmod/x86/../external-module-compat-comm.h:15,
>>  from /local/repos/kvm-kmod/x86/external-module-compat.h:45,
>>  from :0:
>> include/linux/gfp.h: In function ‘gfp_zonelist’:
>> include/linux/gfp.h:272:2: error: implicit declaration of function 
>> ‘IS_ENABLED’ [-Werror=implicit-function-declaration]
>>   if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
>>   ^
>> cc1: some warnings being treated as errors
>> make[3]: *** [/local/repos/kvm-kmod/x86/svm.o] Error 1
>> make[2]: *** [/local/repos/kvm-kmod/x86] Error 2
>> make[1]: *** [_module_/local/repos/kvm-kmod] Error 2
>> make[1]: Leaving directory `/usr/src/linux-3.13'
>> make: *** [all] Error 2
> 
> That's likely a kernel issue: not all required headers are pulled by gfp.h.
> 
> It's worked around now with 2b06046.
> 
> Thanks,
> Jan
> 
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


compiling with kvm-kmod

2014-01-23 Thread Jonas Pfoh
Hello,

I am currently working on a project involving KVM and have been making use 
Jan's kvm-kmod repository.  I receive the below error when I attempt to compile 
with the most recent version.  My question is simply if this is something 
anyone is aware of or has any suggestions for before I go poking around?  

I am compiling against a 3.13.0 mainline vanilla kernel and am using the master 
branch (3d923a3) of Jan's kvm-kmod repo which seems to be syncing from kvm 
commit 7650b68.

Thanks and regards,
Jonas Pfoh

make -C /lib/modules/3.13.0/build M=`pwd` \
LINUXINCLUDE="-I`pwd`/include -I`pwd`/include/uapi -Iinclude \
 -Iinclude/uapi -Iarch/x86/include 
-Iarch/x86/include/uapi \
-Iinclude/generated/uapi -Iarch/x86/include/generated \
-Iarch/x86/include/generated/uapi \
-I`pwd`/include-compat -I`pwd`/x86 \
-include  include/generated/autoconf.h \
-include `pwd`/x86/external-module-compat.h" \
"$@"
make[1]: Entering directory `/usr/src/linux-3.13'
  CC [M]  /local/repos/kvm-kmod/x86/svm.o
In file included from include/linux/device.h:29:0,
 from include/linux/node.h:17,
 from include/linux/cpu.h:16,
 from 
/local/repos/kvm-kmod/x86/../external-module-compat-comm.h:15,
 from /local/repos/kvm-kmod/x86/external-module-compat.h:45,
 from :0:
include/linux/gfp.h: In function ‘gfp_zonelist’:
include/linux/gfp.h:272:2: error: implicit declaration of function ‘IS_ENABLED’ 
[-Werror=implicit-function-declaration]
  if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
  ^
cc1: some warnings being treated as errors
make[3]: *** [/local/repos/kvm-kmod/x86/svm.o] Error 1
make[2]: *** [/local/repos/kvm-kmod/x86] Error 2
make[1]: *** [_module_/local/repos/kvm-kmod] Error 2
make[1]: Leaving directory `/usr/src/linux-3.13'
make: *** [all] Error 2
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pci pass-through on AMD architecture

2009-08-05 Thread Jonas Pfoh
Sry, prob informative to add that were running qemu-kvm-0.10.6 on a 
vanilla 2.6.30.4-0.1-default kernel.

-Jonas

Jonas Pfoh wrote:

Hello,

I seem to be having some issues making the pci pass-through work from 
the command line.  Interestingly, a hot-plug works (i.e., passing the 
device through via the qemu console).  Any help would be appreciated.


Thanks,
Jonas Pfoh

Below the attempt and error msgs:

# /usr/local/kvm/bin/qemu-system-x86_64 -m 2048 -hda 
/srv/kvm/suseimg.img -vnc localhost:1 -pcidevice host=00:09.0 -net none

create_userspace_phys_mem: Invalid argument
assigned_dev_iomem_map: Error: create new mapping failed


dmesg output:

...
pci-stub :00:09.0: PCI INT A -> Link[LMAD] -> GSI 21 (level, low) -> 
IRQ 21

pci-stub :00:09.0: irq 31 for MSI/MSI-X
pci-stub :00:09.0: PCI INT A disabled



/proc/cpuinfo (one of two identical procs):

processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 15
model   : 107
model name  : AMD Athlon(tm) Dual Core Processor 5050e
stepping: 2
cpu MHz : 1000.000
cache size  : 512 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 2
apicid  : 0
initial apicid  : 0
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext 
fxsr_opt rdtscp lm 3dnowext 3dnow rep_good extd_apicid pni cx16 lahf_lm 
cmp_legacy svm extapic cr8_legacy 3dnowprefetch

bogomips: 1999.98
TLB size: 1024 4K pages
clflush size: 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc 100mhzsteps


lspci -v:

...
00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3)
Subsystem: nVidia Corporation Device cb84
Flags: 66MHz, fast devsel, IRQ 21
Memory at feaf5000 (32-bit, non-prefetchable) [size=4K]
I/O ports at b080 [size=8]
Memory at feafa000 (32-bit, non-prefetchable) [size=256]
Memory at feaf4c00 (32-bit, non-prefetchable) [size=16]
Capabilities: [44] Power Management version 2
Capabilities: [70] MSI-X: Enable- Mask- TabSize=8
Capabilities: [50] Message Signalled Interrupts: Mask+ 64bit+ 
Count=1/8 Enable-

Capabilities: [6c] HyperTransport: MSI Mapping Enable- Fixed+
Kernel driver in use: pci-stub
Kernel modules: forcedeth
...


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pci pass-through on AMD architecture

2009-08-05 Thread Jonas Pfoh

Hello,

I seem to be having some issues making the pci pass-through work from 
the command line.  Interestingly, a hot-plug works (i.e., passing the 
device through via the qemu console).  Any help would be appreciated.


Thanks,
Jonas Pfoh

Below the attempt and error msgs:

# /usr/local/kvm/bin/qemu-system-x86_64 -m 2048 -hda 
/srv/kvm/suseimg.img -vnc localhost:1 -pcidevice host=00:09.0 -net none

create_userspace_phys_mem: Invalid argument
assigned_dev_iomem_map: Error: create new mapping failed


dmesg output:

...
pci-stub :00:09.0: PCI INT A -> Link[LMAD] -> GSI 21 (level, low) -> 
IRQ 21

pci-stub :00:09.0: irq 31 for MSI/MSI-X
pci-stub :00:09.0: PCI INT A disabled



/proc/cpuinfo (one of two identical procs):

processor   : 0 

vendor_id   : AuthenticAMD 

cpu family  : 15 

model   : 107 

model name  : AMD Athlon(tm) Dual Core Processor 5050e 

stepping: 2 

cpu MHz : 1000.000 

cache size  : 512 KB 

physical id : 0 


siblings: 2
core id : 0
cpu cores   : 2
apicid  : 0
initial apicid  : 0
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext 
fxsr_opt rdtscp lm 3dnowext 3dnow rep_good extd_apicid pni cx16 lahf_lm 
cmp_legacy svm extapic cr8_legacy 3dnowprefetch

bogomips: 1999.98
TLB size: 1024 4K pages
clflush size: 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc 100mhzsteps


lspci -v:

...
00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3)
Subsystem: nVidia Corporation Device cb84
Flags: 66MHz, fast devsel, IRQ 21
Memory at feaf5000 (32-bit, non-prefetchable) [size=4K]
I/O ports at b080 [size=8]
Memory at feafa000 (32-bit, non-prefetchable) [size=256]
Memory at feaf4c00 (32-bit, non-prefetchable) [size=16]
Capabilities: [44] Power Management version 2
Capabilities: [70] MSI-X: Enable- Mask- TabSize=8
Capabilities: [50] Message Signalled Interrupts: Mask+ 64bit+ 
Count=1/8 Enable-
Capabilities: [6c] HyperTransport: MSI Mapping Enable- Fixed+ 

Kernel driver in use: pci-stub 


Kernel modules: forcedeth
...
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html