vfio-ccw dasd ipl support

本文介绍如何通过配置vfio-ccw支持从DASD设备引导系统,包括主机准备、DASD设备激活及格式化、创建MDEV设备并传递给虚拟机等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This feature could support booting from vfio-ccw dasd devices.

It is enabled in our SLE12SP5, SLE15SP1 and SLES15SP2

This feature is actally using a real dasd for ipl device based on vfio-ccw bus. 

So it is not like using a vfio-cow qcow2 or just use this dasd device as a storage block.

 

1.HOST Preparation

Make sure HOST enabled below configuration:

CONFIG_S390_CCW_IOMMU=y
CONFIG_VFIO=m
CONFIG_VFIO_MDEV=m
CONFIG_VFIO_MDEV_DEVICE=m
CONFIG_VFIO_CCW=m

2. Make sure Host has extra active DASD device for passthrough

2.1 check dasd devices

# lsdasd -a
Bus-ID     Status      Name      Device  Type  BlkSz  Size      Blocks
==============================================================================
0.0.6000   active      dasda     94:0    ECKD  4096   7043MB    1803060
0.0.6001   active      dasdb     94:4    ECKD  4096   7043MB    1803060
0.0.6002   active      dasdc     94:8    ECKD  4096   7043MB    1803060


2. Active DASD 

For example, for device 0.0.6001, issue:
# chccwdev -e 0.0.6001
WARNING: Device[0.0.6001] is already  online
Done


3. Format the DASD 

# dasdfmt -b 4096 /dev/disk/by-path/ccw-0.0.6001 -p

 

3. Seprate DASD as a MDEV device 

3.1 Unbind dasd device and its sub channel
1.1 unbind the CCW device from its subchannel
#echo 0.0.6003 > /sys/bus/ccw/devices/0.0.6003/driver/unbind
1.2 unbind the subchannel from the I/O subchannel driver
#echo 0.0.023f > /sys/bus/css/devices/0.0.023f/driver/unbind

3.2 Bind the subchannel to vfio_ccw driver
#echo 0.0.023f > /sys/bus/css/drivers/vfio_ccw/bind

3.3 Create a Mediated Device(mdev) for the physical device with vfio_ccw driver
#uuidgen 08e8c006-146d-48d3-b21a-c005f9d3a04b
#echo "08e8c006-146d-48d3-b21a-c005f9d3a04b" > \
/sys/bus/css/devices/0.0.023f/mdev_supported_types/vfio_ccw-io/create


4. passthrough mdev to vm
    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
     <source>
       <address uuid='08e8c006-146d-48d3-b21a-c005f9d3a04b'/>
      </source>
      <boot order='1'/>
    </hostdev>
  </devices>

 

5 Current s390 bios has some issue, it needs extra xml:

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">

<qemu:commandline>
<qemu:arg value="-global"/>
<qemu:arg value="vfio-ccw.force-orb-pfch=yes"/>
</qemu:commandline>

 

6. start Guest and check with mdev
Confirm the DASD/ECKD as a Subchannel-attached device on guest system(verify e.g via lscss tool)
For example:
# lscss
Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs          
----------------------------------------------------------------------
0.0.0002 0.0.0003  0000/00 3832/05 yes  80  80  ff   00000000 00000000

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

认真的柯南

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值