Re: vmd(8): fix broken bootorder for cdrom
On Thu, Nov 04, 2021 at 08:09:16PM +0100, Jan Klemkow wrote: > On Thu, Nov 04, 2021 at 10:43:46AM -0400, Dave Voutila wrote: > > Jan Klemkow writes: > > > This fix [1] in seabios breaks our "boot device cdrom" feature. > > > > > > # vmctl start -Lc -d disk.img -r cd70.iso -B cdrom vm > > > ... > > > No bootable device. Retrying in 60 seconds. > > > > > > # vmctl start -Lc -d disk.img -r cd70.iso vm > > > doas vmctl start -c -r cd70.iso vm > > > ... > > > CD-ROM: E0 > > > Loading /7.0/AMD64/CDBOOT > > > probing: pc0 com0 mem[638K 510M a20=on] > > > disk: cd0 > > >>> OpenBSD/amd64 CDBOOT 3.53 > > > boot> > > > > > > The diff below, fixes the lun number of the bootorder string for cdrom. > > > > > > OK? > > > > This change definitely fixes -B cdrom, but -B disk seems broken as well. > > > > ok dv to fix the -B cdrom issue, but do you also have an idea how to fix > > the -B disk option? > > The diff below, fixes the -B disk option. BUT... > > The bootorder for disk and cdrom are hard coded strings for a runtime > dynamic PCI bus. The current disk bootorder string just works, if there > is no network device configured. With the diff below, it will work, if > there is just one network device. The current cdrom bootorder string > just works, with one network and one disk device, or with no network and > two disk devices. > > One example of vmd(8)'s PCI bus: > > PCI: init bdf=00:00.0 id=0b5d:0666/* VMM Host */ > PCI: init bdf=00:01.0 id=1af4:1005/* Virtio RNG */ > PCI: init bdf=00:02.0 id=1af4:1000/* Virtio Network */ > PCI: init bdf=00:03.0 id=1af4:1001/* Virtio Storage (disk) */ > PCI: init bdf=00:04.0 id=1af4:1004/* Virtio SCSI (cdrom) */ > PCI: init bdf=00:05.0 id=0b5d:0777/* VMM Control */ > > We should assemble dynamic bootorder strings, which fits to our dynamic > assembled PCI bus. This would be a general solution for this problem. > > For now, this diff will fix the -B disk option for the most common case > of one NIC. Which fits to the cdrom bootorder string for one NIC, one > disk and a cdrom. > > OK? > > bye, > Jan > > Index: fw_cfg.c > === > RCS file: /cvs/src/usr.sbin/vmd/fw_cfg.c,v > retrieving revision 1.4 > diff -u -p -r1.4 fw_cfg.c > --- fw_cfg.c 4 Nov 2021 17:50:05 - 1.4 > +++ fw_cfg.c 4 Nov 2021 18:48:48 - > @@ -77,7 +77,7 @@ fw_cfg_init(struct vmop_create_params *v > > switch (vmc->vmc_bootdevice) { > case VMBOOTDEV_DISK: > - bootorder = "/pci@i0cf8/*@2\nHALT"; > + bootorder = "/pci@i0cf8/*@3\nHALT"; > break; > case VMBOOTDEV_CDROM: > bootorder = "/pci@i0cf8/*@4/*@0/*@0,4100\nHALT"; > Thanks. ok mlarkin@ And I do agree that we probably need dynamic bootorder strings. -ml
Re: vmd(8): fix broken bootorder for cdrom
Jan Klemkow writes: > Hi, > > This fix [1] in seabios breaks our "boot device cdrom" feature. > > # vmctl start -Lc -d disk.img -r cd70.iso -B cdrom vm > ... > No bootable device. Retrying in 60 seconds. > > # vmctl start -Lc -d disk.img -r cd70.iso vm > doas vmctl start -c -r cd70.iso vm > ... > CD-ROM: E0 > Loading /7.0/AMD64/CDBOOT > probing: pc0 com0 mem[638K 510M a20=on] > disk: cd0 >>> OpenBSD/amd64 CDBOOT 3.53 > boot> > > The diff below, fixes the lun number of the bootorder string for cdrom. > > OK? This change definitely fixes -B cdrom, but -B disk seems broken as well. ok dv to fix the -B cdrom issue, but do you also have an idea how to fix the -B disk option? Thanks for looking at this. > > bye, > Jan > > [1]: > https://github.com/coreboot/seabios/commit/f3ca59c6f3da0f30110ca216b072f8b602313734#diff-fb210bc834fdee64b4c337a57a96d0593afd9c86e956f5ef12a437810ebe61d1 > > Index: fw_cfg.c > === > RCS file: /cvs/src/usr.sbin/vmd/fw_cfg.c,v > retrieving revision 1.3 > diff -u -p -r1.3 fw_cfg.c > --- fw_cfg.c 16 Jun 2021 16:55:02 - 1.3 > +++ fw_cfg.c 4 Nov 2021 13:33:37 - > @@ -80,7 +80,7 @@ fw_cfg_init(struct vmop_create_params *v > bootorder = "/pci@i0cf8/*@2\nHALT"; > break; > case VMBOOTDEV_CDROM: > - bootorder = "/pci@i0cf8/*@4/*@0/*@0,100\nHALT"; > + bootorder = "/pci@i0cf8/*@4/*@0/*@0,4100\nHALT"; > break; > case VMBOOTDEV_NET: > /* XXX not yet */
Re: vmd(8): fix broken bootorder for cdrom
On Thu, Nov 04, 2021 at 02:44:18PM +0100, Jan Klemkow wrote: > Hi, > > This fix [1] in seabios breaks our "boot device cdrom" feature. > > # vmctl start -Lc -d disk.img -r cd70.iso -B cdrom vm > ... > No bootable device. Retrying in 60 seconds. > > # vmctl start -Lc -d disk.img -r cd70.iso vm > doas vmctl start -c -r cd70.iso vm > ... > CD-ROM: E0 > Loading /7.0/AMD64/CDBOOT > probing: pc0 com0 mem[638K 510M a20=on] > disk: cd0 > >> OpenBSD/amd64 CDBOOT 3.53 > boot> > > The diff below, fixes the lun number of the bootorder string for cdrom. > > OK? > > bye, > Jan > > [1]: > https://github.com/coreboot/seabios/commit/f3ca59c6f3da0f30110ca216b072f8b602313734#diff-fb210bc834fdee64b4c337a57a96d0593afd9c86e956f5ef12a437810ebe61d1 > > Index: fw_cfg.c > === > RCS file: /cvs/src/usr.sbin/vmd/fw_cfg.c,v > retrieving revision 1.3 > diff -u -p -r1.3 fw_cfg.c > --- fw_cfg.c 16 Jun 2021 16:55:02 - 1.3 > +++ fw_cfg.c 4 Nov 2021 13:33:37 - > @@ -80,7 +80,7 @@ fw_cfg_init(struct vmop_create_params *v > bootorder = "/pci@i0cf8/*@2\nHALT"; > break; > case VMBOOTDEV_CDROM: > - bootorder = "/pci@i0cf8/*@4/*@0/*@0,100\nHALT"; > + bootorder = "/pci@i0cf8/*@4/*@0/*@0,4100\nHALT"; > break; > case VMBOOTDEV_NET: > /* XXX not yet */ > I noticed this was broken too after a recent discussion on twitter. ok brynet@