[Kimchi-devel] [PATCH V2] Add vfio driver as default for powerkvm systems.

Aline Manera alinefm at linux.vnet.ibm.com
Wed May 27 16:51:22 UTC 2015



On 27/05/2015 13:37, Jose Ricardo Ziviani wrote:
>
>
> On 27-05-2015 13:33, Aline Manera wrote:
>>
>>
>> On 27/05/2015 13:31, Jose Ricardo Ziviani wrote:
>>>
>>>
>>> On 27-05-2015 13:20, Aline Manera wrote:
>>>>
>>>>
>>>> On 25/05/2015 13:08, Jose Ricardo Ziviani wrote:
>>>>>   - ppc hotplug does not work with kvm driver, it must be
>>>>>     vfio by default.
>>>>>
>>>>> Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
>>>>> ---
>>>>>   src/kimchi/model/vmhostdevs.py | 6 ++++++
>>>>>   1 file changed, 6 insertions(+)
>>>>>
>>>>> diff --git a/src/kimchi/model/vmhostdevs.py
>>>>> b/src/kimchi/model/vmhostdevs.py
>>>>> index 964ec49..516d48f 100644
>>>>> --- a/src/kimchi/model/vmhostdevs.py
>>>>> +++ b/src/kimchi/model/vmhostdevs.py
>>>>> @@ -31,6 +31,7 @@ from kimchi.model.utils import get_vm_config_flag
>>>>>   from kimchi.model.vms import DOM_STATE_MAP, VMModel
>>>>>   from kimchi.rollbackcontext import RollbackContext
>>>>>   from kimchi.utils import kimchi_log, run_command
>>>>> +import platform
>>>>>
>>>>>
>>>>>   class VMHostDevsModel(object):
>>>>> @@ -164,6 +165,11 @@ class VMHostDevsModel(object):
>>>>>           driver = ('vfio' if DOM_STATE_MAP[dom.info()[0]] ==
>>>>> "shutoff" and
>>>>>                     self.caps.kernel_vfio else 'kvm')
>>>>>
>>>>> +        # on powerkvm systems it must be vfio driver.
>>>>> +        distro, _, _ = platform.linux_distribution()
>>>>> +        if distro == 'IBM_PowerKVM':
>>>>> +            driver = 'vfio'
>>>>
>>>> What happen if the kernel module for vfio is not loaded?
>>>
>>> This won't happen because vfio is not a kernel module but a feature
>>> built in.
>>>
>>
>> So why do we have a feature test (FeatureTests.kernel_support_vfio) to
>> verify it?
>
> Because it's a built in for PowerKVM but a kernel module for other 
> distros.
>

Thanks for the details!

>>
>>
>>> # grep -i vfio /boot/config-<kernel-version>
>>> CONFIG_VFIO_IOMMU_SPAPR_TCE=y
>>> CONFIG_VFIO_SPAPR_EEH=y
>>> CONFIG_VFIO=y
>>> CONFIG_VFIO_PCI=y
>>> CONFIG_KVM_VFIO=y
>>>
>>>
>>>>
>>>>> +
>>>>>           # Attach all PCI devices in the same IOMMU group
>>>>>           dev_model = DeviceModel(conn=self.conn)
>>>>>           devs_model = DevicesModel(conn=self.conn)
>>>>
>>>
>>
>




More information about the Kimchi-devel mailing list