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

### 解决 PP-OCRv4 出现的错误 当遇到 `WARNING: The pretrained params backbone.blocks2.0.dw_conv.lab.scale not in model` 这样的警告时,这通常意味着预训练模型中的某些参数未能匹配到当前配置下的模型结构中[^2]。 对于此问题的一个有效解决方案是采用特定配置文件来适配预训练权重。具体操作方法如下: 通过指定配置文件 `ch_PP-OCRv4_det_student.yml` 并利用已有的最佳精度预训练模型 (`best_accuracy`) 来启动训练过程可以绕过上述不兼容的问题。执行命令如下所示: ```bash python3 tools/train.py -c configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml ``` 该方案不仅解决了参数缺失带来的警告,还能够继续基于高质量的预训练成果进行微调,从而提升最终检测效果。 关于蒸馏的概念,在机器学习领域内指的是将大型复杂网络(teacher 模型)的知识迁移到小型简单网络(student 模型)。这里 student 和 teacher 的关系是指两个不同规模或架构的神经网络之间的指导与被指导的关系;其中 teacher 已经经过充分训练并具有良好的性能,而 student 则试图模仿前者的行为模式以达到相似的效果但保持更高效的计算特性。 至于提到的 `Traceback` 错误信息部分,由于未提供具体的跟踪堆栈详情,难以给出针对性建议。不过一般而言,这报错往往涉及代码逻辑错误或是环境配置不当等问题。为了更好地帮助定位和解决问题,推荐记录完整的异常日志,并仔细检查最近修改过的代码片段以及确认依赖库版本的一致性。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

认真的柯南

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

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

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

打赏作者

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

抵扣说明:

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

余额充值