Bug 1431584
| Summary: | SLOF does not support LUNs greater than 255 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Yongxue Hong <yhong> |
| Component: | SLOF | Assignee: | Thomas Huth <thuth> |
| Status: | CLOSED ERRATA | QA Contact: | xianwang <xianwang> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.4 | CC: | aliang, chayang, coli, dgibson, juzhang, knoel, lvivier, micai, michen, mrezanin, pbonzini, qzhang, thuth, virt-maint, xianwang, yhong |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | ppc64 | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | SLOF-20170724-1.git89f519f.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 14:41:52 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
AIUI, the LUN field is only 3-bits, so only 0..7 are valid LUN numbers. qemu could do with a more informative error message here, but this is essentially a cosmetic problem only. AFAICT this is also not ppc specific, so reassigning to the general virt pool. 256 is a valid lun number for virtio-scsi, so I have no idea what/how error reporting can be improved here. Not able to boot from it seems a separate bug for SLOF, which I have no clue at the moment. Does this scenario work with seabios on x86? Hi Fam, It is also exist on x86,but there is a bit of different, guest could boot up with lun id is only 0! while set the lun id to other value ,guest couldn't boot up,then it would try to boot with pxe. Test version: host : 3.10.0-690.el7.x86_64 guest : 3.10.0-656.el7.x86_64 qemu : qemu-kvm-rhev-2.9.0-14.el7 What is the seabios version? Please try the fixed version of bug 1020622. Hi Fam, Update the seabios version to seabios-1.10.2-3.el7, then it works, guest could boot up with other lun id besides 0. So It might that the SLOF cause this problem on ppc64le. David, what did you have in mind about what can be done in QEMU? Ugh, it's been so long that I've forgotten. I'm not sure where I got the idea that the LUN was only 3 bits. Looking again at the virtio scsi code, that doesn't appear to be the case. So it sounds like this probably is a SLOF bug after all. Thomas, can you confirm if that seems plausible? David, you likely mix up spapr-vscsi with virtio-scsi here. For spapr-vscsi, the LUNs are limited to 3 bits only, see BZ 1260464. Concerning virtio-scsi, as far as I can see, it works fine with SLOF for LUNs < 256, the problem only occurs if the LUN is bigger than 255. Yongxue Hong, does it work on x86 if you use a LUN bigger than 256 there? I think the problem is likely in the virtio_scsi_device_find() function in QEMU: static inline SCSIDevice *virtio_scsi_device_find(VirtIOSCSI *s, uint8_t *lun) { if (lun[0] != 1) { return NULL; } if (lun[2] != 0 && !(lun[2] >= 0x40 && lun[2] < 0x80)) { return NULL; } return scsi_device_find(&s->bus, 0, lun[1], virtio_scsi_get_lun(lun)); } For LUNs >= 256, the second if-statement triggers and the function returns NULL. Not sure what this check is really good for, though, it looks very strange to me. Hi Thomas, It works on x86 while use a LUN bigger than 256. eg: -drive file=/home/hyx/image/rhel-7_4-11853-20G.qcow2,format=qcow2,if=none,cache=none,media=disk,werror=stop,rerror=stop,id=drive-0 \ -device scsi-hd,bus=scsi-pci-1.0,id=scsi-hd-0,drive=drive-0,channel=0,scsi-id=0,lun=257,bootindex=0 \ Thanks. I think I now understood what's going on here. It's a bug in SLOF. The virtio spec says: "When used to address a target and logical unit, the only supported format for lun is: first byte set to 1, second byte set to target, third and fourth byte representing a single level LUN structure, followed by four zero bytes." Now, according to the "SCSI Architecture Model" specification, there are two formats for "single level LUNs" that fit into two bytes (i.e. into the third and fourth byte here): The "Single level LUN structure using peripheral device addressing method" which supports up to 256 LUNs, and the "Single level LUN structure using flat space addressing method" which supports up to 16384 LUNs. SLOF is using the first way, so it is currently limited to 256 LUNs. I'll try to come up with a patch to fix this issue... Suggested patch upstream: https://lists.ozlabs.org/pipermail/slof/2017-July/001685.html Patch has been accepted upstream: https://github.com/aik/SLOF/commit/f72a37713fea47da625238f032c245f40b987a28 The step of verification is same as comment 0. Version of verification: host: 3.10.0-693.2.1.el7.ppc64le qemu-kvm: qemu-kvm-rhev-2.9.0-16.el7_4.8.ppc64le SLOF: SLOF-20170724-2.git89f519f.el7.noarch Actual results: The guest could boot up successfully with luns greater than 256.So this bug is fixed and change the status to verified. This bug exists in the latest version:
Host (RHEL7.5):
Compose: RHEL7.4 released (RHEL-7.4-20170711.0)
kernel-3.10.0-771.el7
qemu-kvm-rhev-2.10.0-4.el7
SLOF-20170724-2.git89f519f.el7.noarch
Guest:
Compose: RHEL7.4 released (RHEL-7.4-20170711.0)
kernel-3.10.0-771.el7
How reproducible:
100%
Steps to Reproduce:
1:Boot a guest with scsi disk which lun=0
eg:/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1' \
-sandbox off \
-machine pseries-rhel7.5.0 \
-nodefaults \
-vga std \
-chardev socket,id=serial_id_serial0,path=/tmp/console0,server,nowait \
-device spapr-vty,reg=0x30000000,chardev=serial_id_serial0 \
-device virtio-serial-pci,id=virtio_serial_pci0,bus=pci.0,addr=04 \
-chardev socket,path=/tmp/serial0,nowait,id=idQdLRHP,server \
-device virtserialport,id=idBu8FQH,name=vs,bus=virtio_serial_pci0.0,chardev=idQdLRHP \
-object rng-random,filename=/dev/random,id=passthrough-rOXjKxaC \
-device virtio-rng-pci,id=virtio-rng-pci-GVn8yzUA,rng=passthrough-rOXjKxaC,bus=pci.0,addr=05 \
-device nec-usb-xhci,id=usb1,bus=pci.0,addr=06 \
-device pci-ohci,id=usb3,bus=pci.0,addr=07 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=08 \
-drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,media=disk,format=qcow2,file=/root/micai/RHEL.7.4.qcow2 \
-device scsi-hd,drive=drive_image1,id=mage1,bus=virtio_scsi_pci0.0,bootindex=0,channel=0,scsi-id=0,lun=0 \
-chardev socket,id=chardev0,path=/tmp/slofpath,server,nowait \
-device spapr-vty,chardev=chardev0 \
-object iothread,id=thread0 \
-device virtio-blk-pci,id=disk,drive=drive-disk0,iothread=thread0 \
-drive file=/root/micai/r3.qcow2,format=qcow2,if=none,id=drive-disk0,cache=none\
-object iothread,id=iothread0 \
-drive file=/root/micai/r1.qcow2,format=qcow2,if=none,cache=none,id=drive_plane,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=d\rive_plane,id=plane,bus=pci.0,addr=09,iothread=iothread0 \
-drive file=/root/micai/r2.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop \
-device spapr-vscsi,reg=0x1000,id=scsi0 \
-device scsi-hd,drive=drive-system-disk,id=system-disk,bus=scsi0.0 \
-device virtio-net-pci,mac=9a:4f:50:51:52:53,id=id9HRc5V,vectors=4,netdev=idjlQN53,bus=pci.0,addr=11 \
-netdev tap,id=idjlQN53,vhost=on,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \
-device spapr-vlan,mac=9a:4f:50:51:52:54,netdev=hostnet0,id=net0 \
-netdev tap,id=hostnet0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \
-m 8G,slots=4,maxmem=32G \
-smp 8,cores=4,threads=1,sockets=2 \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device usb-mouse,id=input1,bus=usb1.0,port=2 \
-device usb-kbd,id=input2,bus=usb1.0,port=3 \
-drive id=drive_cd1,if=none,snapshot=off,aio=threads,cache=none,media=cdrom,file=/root/micai/RHEL-7.4-20170711.0-Server-ppc64-dvd1.iso \
-device scsi-cd,id=cd1,drive=drive_cd1,bus=virtio_scsi_pci0.0,bootindex=1 \
-vnc :1 \
-qmp tcp:0:8881,server,nowait \
-monitor stdio \
-rtc base=utc,clock=host \
-boot order=cdn,once=c,menu=on,strict=on \
-enable-kvm \
-watchdog i6300esb \
-watchdog-action reset \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=15
2.shutdown guest and change the lun id of scsi disk to 256 and boot up guest
eg:
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1' \
-sandbox off \
-machine pseries-rhel7.5.0 \
-nodefaults \
-vga std \
-chardev socket,id=serial_id_serial0,path=/tmp/console0,server,nowait \
-device spapr-vty,reg=0x30000000,chardev=serial_id_serial0 \
-device virtio-serial-pci,id=virtio_serial_pci0,bus=pci.0,addr=04 \
-chardev socket,path=/tmp/serial0,nowait,id=idQdLRHP,server \
-device virtserialport,id=idBu8FQH,name=vs,bus=virtio_serial_pci0.0,chardev=idQdLRHP \
-object rng-random,filename=/dev/random,id=passthrough-rOXjKxaC \
-device virtio-rng-pci,id=virtio-rng-pci-GVn8yzUA,rng=passthrough-rOXjKxaC,bus=pci.0,addr=05 \
-device nec-usb-xhci,id=usb1,bus=pci.0,addr=06 \
-device pci-ohci,id=usb3,bus=pci.0,addr=07 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=08 \
-drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,media=disk,format=qcow2,file=/root/micai/RHEL.7.4.qcow2 \
-device scsi-hd,drive=drive_image1,id=mage1,bus=virtio_scsi_pci0.0,bootindex=0,channel=0,scsi-id=0,lun=256 \
-chardev socket,id=chardev0,path=/tmp/slofpath,server,nowait \
-device spapr-vty,chardev=chardev0 \
-object iothread,id=thread0 \
-device virtio-blk-pci,id=disk,drive=drive-disk0,iothread=thread0 \
-drive file=/root/micai/r3.qcow2,format=qcow2,if=none,id=drive-disk0,cache=none\
-object iothread,id=iothread0 \
-drive file=/root/micai/r1.qcow2,format=qcow2,if=none,cache=none,id=drive_plane,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=d\rive_plane,id=plane,bus=pci.0,addr=09,iothread=iothread0 \
-drive file=/root/micai/r2.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop \
-device spapr-vscsi,reg=0x1000,id=scsi0 \
-device scsi-hd,drive=drive-system-disk,id=system-disk,bus=scsi0.0 \
-device virtio-net-pci,mac=9a:4f:50:51:52:53,id=id9HRc5V,vectors=4,netdev=idjlQN53,bus=pci.0,addr=11 \
-netdev tap,id=idjlQN53,vhost=on,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \
-device spapr-vlan,mac=9a:4f:50:51:52:54,netdev=hostnet0,id=net0 \
-netdev tap,id=hostnet0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \
-m 8G,slots=4,maxmem=32G \
-smp 8,cores=4,threads=1,sockets=2 \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device usb-mouse,id=input1,bus=usb1.0,port=2 \
-device usb-kbd,id=input2,bus=usb1.0,port=3 \
-drive id=drive_cd1,if=none,snapshot=off,aio=threads,cache=none,media=cdrom,file=/root/micai/RHEL-7.4-20170711.0-Server-ppc64-dvd1.iso \
-device scsi-cd,id=cd1,drive=drive_cd1,bus=virtio_scsi_pci0.0,bootindex=1 \
-vnc :1 \
-qmp tcp:0:8881,server,nowait \
-monitor stdio \
-rtc base=utc,clock=host \
-boot order=cdn,once=c,menu=on,strict=on \
-enable-kvm \
-watchdog i6300esb \
-watchdog-action reset \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=15
Actual results:
The guest can't boot up and enter the installation.
The console prompt is same as comment 0
Strange, it seems to work for me... The only oddity that I saw was that SLOF rather preferred to boot from the CD-ROM drive instead of the hard disk, but that's likely another problem. Could you please try again and omit the CD-ROM drive in your test? Also, please do not use "-boot order=cdn,once=c" when using "bootindex" for other devices, since that likely gives unexpected results. If it still fails for you without CD-ROM, could you please paste the serial console output here again? Thanks! FWIW, here's a shorter command line to reproduce the problem with the boot ordering (SLOF boots from CD-ROM, though it should boot from HD instead): sudo /usr/libexec/qemu-kvm -nodefaults -serial mon:stdio -nographic -enable-kvm -device virtio-scsi-pci,id=vsp0,bus=pci.0 -drive id=hdimg1,if=none,format=qcow2,file=/var/lib/libvirt/images/disk.img -device scsi-hd,drive=hdimg1,id=hd1,bus=vsp0.0,bootindex=0,channel=0,scsi-id=0,lun=256 -drive id=cdimg1,if=none,media=cdrom,file=/var/lib/libvirt/images/RHEL-7.iso -device scsi-cd,id=cd1,drive=cdimg1,bus=vsp0.0,bootindex=1 i just used your command line to reproduce the problem.When configuring the cd-rom bootindex= 1, I also saw the problem of SLOF boots from CD-ROM.Then I removed the configuration of the cd-rom with the parameter of bootindex= 1, and the lun parameter remained 256. The guest boots from HD.This indicates that lun=256 does not affect on it。This indicates that the Bug 1431584 has been fixed. Do I need to open a CD and hd boot order bug? I will discuss this with xianwang tomorrow. (In reply to Minjia Cai from comment #19) > This indicates that the Bug 1431584 has been fixed. Yes, I think it should be fixed, so please mark this as VERIFIED if you agree (I'm moving the bug back to ON_QA for this). > Do I need to open a CD and hd boot order bug? Yes, I think we should track this with a separate BZ. I've now already created a new BZ here: https://bugzilla.redhat.com/show_bug.cgi?id=1515393 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0820 |
Description of problem: The guest can boot up after first install os,but changed the scsi lun id to 256 ,then the guest can not boot up. Version-Release number of selected component (if applicable): host kernel:kernel-3.10.0-598.el7 guest kernel :kernel-2.6.32-680.el6.ppc64 SLOF :20160223-6.gitdbbfda4.el7 qemu-kvm:qemu-kvm-rhev-2.8.0-6.el7 How reproducible: 100% Steps to Reproduce: 1.boot a guest with virtio scsi disk and install os eg : /usr/libexec/qemu-kvm \ -name 11837-2 \ -M pseries-rhel7.2.0 \ -m 16G \ -nodefaults \ -smp 8 \ -boot menu=on,order=cd \ -device VGA,id=vga0,addr=0 \ -device nec-usb-xhci,id=xhci \ -device usb-tablet,id=usb-tablet0 \ -device usb-kbd,id=usb-kbd0 \ -device virtio-scsi-pci,id=scsi-pci-0 \ -drive file=/home/hyx/iso/RHEL-6.9-20161216.1-Server-ppc64-dvd1.iso,if=none,media=cdrom,id=image0 \ -device scsi-cd,bus=scsi-pci-0.0,id=scsi-cd0,drive=image0,channel=0,scsi-id=0,lun=1,bootindex=0 \ -device virtio-scsi-pci,id=scsi-pci-1 \ -drive file=/home/hyx/image/RHEL6-11837-2-1-20G.qcow2,format=qcow2,if=none,cache=none,id=drive-scsi-0 \ -device scsi-hd,bus=scsi-pci-1.0,id=scsi-blk0,drive=drive-scsi-0,channel=0,scsi-id=0,lun=0 \ -netdev tap,id=hostnet0,script=/etc/qemu-ifup \ -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=70:e2:84:14:0c:01 \ -monitor stdio \ -serial unix:./sock1,server,nowait \ -qmp tcp:0:3001,server,nowait \ -vnc :1 2.change the system disk lun id to 256 and boot up eg: /usr/libexec/qemu-kvm \ -name 11837-2 \ -M pseries-rhel7.2.0 \ -m 16G \ -nodefaults \ -smp 8 \ -boot menu=on,order=cd \ -device VGA,id=vga0,addr=0 \ -device nec-usb-xhci,id=xhci \ -device usb-tablet,id=usb-tablet0 \ -device usb-kbd,id=usb-kbd0 \ -device virtio-scsi-pci,id=scsi-pci-0 \ -device virtio-scsi-pci,id=scsi-pci-1 \ -drive file=/home/hyx/image/RHEL6-11837-2-1-20G.qcow2,format=qcow2,if=none,cache=none,id=drive-scsi-0 \ -device scsi-hd,bus=scsi-pci-1.0,id=scsi-blk0,drive=drive-scsi-0,channel=0,scsi-id=0,lun=256,bootindex=0 \ -netdev tap,id=hostnet0,script=/etc/qemu-ifup \ -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=70:e2:84:14:0c:01 \ -monitor stdio \ -serial unix:./sock1,server,nowait \ -qmp tcp:0:3001,server,nowait \ -vnc :1 Actual results: The guest can't boot up and enter the installation. The console prompt: SLOF ********************************************************************** QEMU Starting Build Date = Aug 5 2016 01:08:50 FW Version = mockbuild@ release 20160223 Press "s" to enter Open Firmware. Press F12 for boot menu. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /pci@800000020000000 00 2000 (D) : 1af4 1000 virtio [ net ] 00 1800 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@3 SCSI: Looking for devices 00 1000 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@2 SCSI: Looking for devices 00 0800 (D) : 1033 0194 serial bus [ usb-xhci ] 00 0000 (D) : 1234 1111 qemu vga Installing QEMU fb Scanning USB XHCI: Initializing USB Keyboard No console specified using screen & keyboard Welcome to Open Firmware Copyright (c) 2004, 2011 IBM Corporation All rights reserved. This program and the accompanying materials are made available under the terms of the BSD License available at http://www.opensource.org/licenses/bsd-license.php Trying to load: from: /pci@800000020000000/scsi@3/disk@100010000000000 ... E3405: No such device E3407: Load failed ..`. .. ....... .. ...... ....... ..`...`''.`'. .''``````..''. .`''```''`. `''`````` .`` .:' ': `''..... .''. ''` .''..''....... ``.':.';. ``````''`.''. .''. ''``''`````'` ``.':':` .....`''.`'`...... `'`.....`''.`'` .`.`'`` .'`'`````. ``'''''' ``''`'''`. `'` Type 'boot' and press return to continue booting the system. Type 'reset-all' and press return to reboot the system. Ready! 0 > Expected results: The guest boot up successfully. Additional info: the following is first boot successfully. SLOF ********************************************************************** QEMU Starting Build Date = Aug 5 2016 01:08:50 FW Version = mockbuild@ release 20160223 Press "s" to enter Open Firmware. Press F12 for boot menu. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /pci@800000020000000 00 2000 (D) : 1af4 1000 virtio [ net ] 00 1800 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@3 SCSI: Looking for devices 100000000000000 DISK : "QEMU QEMU HARDDISK 2.5+" 00 1000 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@2 SCSI: Looking for devices 00 0800 (D) : 1033 0194 serial bus [ usb-xhci ] 00 0000 (D) : 1234 1111 qemu vga Installing QEMU fb Scanning USB XHCI: Initializing USB Keyboard No console specified using screen & keyboard Welcome to Open Firmware Copyright (c) 2004, 2011 IBM Corporation All rights reserved. This program and the accompanying materials are made available under the terms of the BSD License available at http://www.opensource.org/licenses/bsd-license.php Trying to load: from: /pci@800000020000000/scsi@3/disk@100000000000000 ... Successfully loaded CF000012 CF000015ch CF000020ne CF000021t Linux ppc64 #1 SMP Tue Dec 1