diff -r a4274d1e85a3 tools/firmware/hvmloader/hvmloader.c --- a/tools/firmware/hvmloader/hvmloader.c Wed Mar 11 13:11:21 2009 +0000 +++ b/tools/firmware/hvmloader/hvmloader.c Thu Mar 12 18:50:26 2009 +0900 @@ -479,37 +479,38 @@ uint16_t vendor_id, device_id; uint8_t devfn, class; - for ( devfn = 0; devfn < 128; devfn++ ) - { - class = pci_readb(devfn, PCI_CLASS_DEVICE + 1); - vendor_id = pci_readw(devfn, PCI_VENDOR_ID); - device_id = pci_readw(devfn, PCI_DEVICE_ID); + devfn = cmos_inb(0x60); + printf("devfn=%x \n", devfn); - if ( (vendor_id == 0xffff) && (device_id == 0xffff) ) - continue; + class = pci_readb(devfn, PCI_CLASS_DEVICE + 1); + vendor_id = pci_readw(devfn, PCI_VENDOR_ID); + device_id = pci_readw(devfn, PCI_DEVICE_ID); - /* - * Currently only scan options from mass storage devices and serial - * bus controller (Fibre Channel included). - */ - if ( (class != 0x1) && (class != 0xc) ) - continue; + if ( (vendor_id == 0xffff) && (device_id == 0xffff) ) + goto out; - option_rom_addr = pci_readl(devfn, PCI_ROM_ADDRESS); - if ( !option_rom_addr ) - continue; + /* + * Currently only scan options from mass storage devices and serial + * bus controller (Fibre Channel included). + */ + if ( (class != 0x1) && (class != 0xc) ) + goto out; - /* Ensure Expansion Bar is enabled before copying */ - pci_writel(devfn, PCI_ROM_ADDRESS, option_rom_addr | 0x1); + option_rom_addr = pci_readl(devfn, PCI_ROM_ADDRESS); + if ( !option_rom_addr ) + goto out; - rom_phys_addr += scan_option_rom( - devfn, vendor_id, device_id, - (void *)(option_rom_addr & ~2047), rom_phys_addr); + /* Ensure Expansion Bar is enabled before copying */ + pci_writel(devfn, PCI_ROM_ADDRESS, option_rom_addr | 0x1); - /* Restore the default original value of Expansion Bar */ - pci_writel(devfn, PCI_ROM_ADDRESS, option_rom_addr); - } + rom_phys_addr += scan_option_rom( + devfn, vendor_id, device_id, + (void *)(option_rom_addr & ~2047), rom_phys_addr); + /* Restore the default original value of Expansion Bar */ + pci_writel(devfn, PCI_ROM_ADDRESS, option_rom_addr); + +out: return rom_phys_addr - rom_base_addr; } diff -r a4274d1e85a3 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Wed Mar 11 13:11:21 2009 +0000 +++ b/tools/python/xen/xm/create.py Thu Mar 12 18:50:26 2009 +0900 @@ -322,7 +322,7 @@ backend driver domain to use for the disk. The option may be repeated to add more than one disk.""") -gopts.var('pci', val='BUS:DEV.FUNC[,msitranslate=0|1][,power_mgmt=0|1]', +gopts.var('pci', val='BUS:DEV.FUNC[,msitranslate=0|1][,power_mgmt=0|1][,boot=0|1]', fn=append_value, default=[], use="""Add a PCI device to a domain, using given params (in hex). For example 'pci=c0:02.1'. @@ -331,7 +331,10 @@ translated from physical MSI, HVM only. Default is 1. The option may be repeated to add more than one pci device. If power_mgmt is set, the guest OS will be able to program the power - states D0-D3hot of the device, HVM only. Default=0.""") + states D0-D3hot of the device, HVM only. Default=0. + The option can add only one pci device. + If boot is set, guest BIOS boot OS from the pass-through devices. + The option is used by SAN/SAS boot.""") gopts.var('vscsi', val='PDEV,VDEV[,DOM]', fn=append_value, default=[], @@ -697,7 +700,7 @@ d = comma_sep_kv_to_dict(opts) def f(k): - if k not in ['msitranslate', 'power_mgmt']: + if k not in ['msitranslate', 'power_mgmt', 'boot']: err('Invalid pci option: ' + k) config_pci_opts.append([k, d[k]])