* [Patch] avoid unnecessary loading NIC rom.
@ 2008-12-18 13:45 Akio Takebe
2008-12-18 14:40 ` Keir Fraser
0 siblings, 1 reply; 6+ messages in thread
From: Akio Takebe @ 2008-12-18 13:45 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
Hi,
When we don't specify PXE boot in guest configuration file,
it is not necessary for hvmloader to load PXE option ROM.
This patch avoid unncessary loading the rom.
It can save shadow memory area for option ROMs.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Best Regards,
Akio Takebe
[-- Attachment #2: avoid_unnecessary_rom_loading.patch --]
[-- Type: text/x-diff, Size: 1654 bytes --]
diff -r a76b4e00e186 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c Tue Dec 16 13:14:25 2008 +0000
+++ b/tools/firmware/hvmloader/hvmloader.c Thu Dec 18 22:38:18 2008 +0900
@@ -423,19 +423,28 @@
{
uint8_t devfn;
uint16_t class, vendor_id, device_id;
+ uint16_t bootdev;
+ uint16_t seq_nr;
- for ( devfn = 0; devfn < 128; devfn++ )
- {
- class = pci_readw(devfn, PCI_CLASS_DEVICE);
- vendor_id = pci_readw(devfn, PCI_VENDOR_ID);
- device_id = pci_readw(devfn, PCI_DEVICE_ID);
+ for (seq_nr=0; seq_nr<3; seq_nr++ ){
+ bootdev = cmos_inb(0x3d);
+ bootdev |= ((cmos_inb(0x38) & 0xf0) << 4);
+ bootdev >>= 4 * seq_nr;
+ bootdev &= 0xf;
+ if ( bootdev == 4 ){
+ for ( devfn = 0; devfn < 128; devfn++ ){
+ class = pci_readw(devfn, PCI_CLASS_DEVICE);
+ vendor_id = pci_readw(devfn, PCI_VENDOR_ID);
+ device_id = pci_readw(devfn, PCI_DEVICE_ID);
- /* We're only interested in NICs. */
- if ( (vendor_id != 0xffff) &&
- (device_id != 0xffff) &&
- (class == 0x0200) )
- return scan_option_rom(
- devfn, vendor_id, device_id, etherboot, copy_rom_dest);
+ /* We're only interested in NICs. */
+ if ( (vendor_id != 0xffff) &&
+ (device_id != 0xffff) &&
+ (class == 0x0200) )
+ return scan_option_rom(devfn, vendor_id,
+ device_id, etherboot, copy_rom_dest);
+ }
+ }
}
return 0;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch] avoid unnecessary loading NIC rom.
2008-12-18 13:45 [Patch] avoid unnecessary loading NIC rom Akio Takebe
@ 2008-12-18 14:40 ` Keir Fraser
2008-12-18 14:50 ` Akio Takebe
0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2008-12-18 14:40 UTC (permalink / raw)
To: Akio Takebe, xen-devel
On 18/12/2008 13:45, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:
> When we don't specify PXE boot in guest configuration file,
> it is not necessary for hvmloader to load PXE option ROM.
> This patch avoid unncessary loading the rom.
> It can save shadow memory area for option ROMs.
There's a 'F10 to select boot device' option in rombios, so you can't
determine this in hvmloader.
-- Keir
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch] avoid unnecessary loading NIC rom.
2008-12-18 14:40 ` Keir Fraser
@ 2008-12-18 14:50 ` Akio Takebe
2008-12-18 14:55 ` Keir Fraser
0 siblings, 1 reply; 6+ messages in thread
From: Akio Takebe @ 2008-12-18 14:50 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Keir Fraser wrote:
> On 18/12/2008 13:45, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:
>
>> When we don't specify PXE boot in guest configuration file,
>> it is not necessary for hvmloader to load PXE option ROM.
>> This patch avoid unncessary loading the rom.
>> It can save shadow memory area for option ROMs.
>
> There's a 'F10 to select boot device' option in rombios, so you can't
> determine this in hvmloader.
Exactly. But if gPXE rom is loaded,
hvmloader cannot load some option ROMs of raal PCI cards.
I suspect we don't use F10 option for PXE boot.
Do you have good idea?
Best Regards,
Akio Takebe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch] avoid unnecessary loading NIC rom.
2008-12-18 14:50 ` Akio Takebe
@ 2008-12-18 14:55 ` Keir Fraser
2008-12-18 15:00 ` Keir Fraser
0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2008-12-18 14:55 UTC (permalink / raw)
To: Akio Takebe; +Cc: xen-devel
On 18/12/2008 14:50, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:
>> There's a 'F10 to select boot device' option in rombios, so you can't
>> determine this in hvmloader.
> Exactly. But if gPXE rom is loaded,
> hvmloader cannot load some option ROMs of raal PCI cards.
> I suspect we don't use F10 option for PXE boot.
> Do you have good idea?
Not really. Perhaps scan_etherboot_nic() after pci_load_option_roms(), so
the latter takes priority?
-- Keir
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch] avoid unnecessary loading NIC rom.
2008-12-18 14:55 ` Keir Fraser
@ 2008-12-18 15:00 ` Keir Fraser
2008-12-19 7:37 ` Akio Takebe
0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2008-12-18 15:00 UTC (permalink / raw)
To: Akio Takebe; +Cc: xen-devel
On 18/12/2008 14:55, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:
>>> There's a 'F10 to select boot device' option in rombios, so you can't
>>> determine this in hvmloader.
>> Exactly. But if gPXE rom is loaded,
>> hvmloader cannot load some option ROMs of raal PCI cards.
>> I suspect we don't use F10 option for PXE boot.
>> Do you have good idea?
>
> Not really. Perhaps scan_etherboot_nic() after pci_load_option_roms(), so the
> latter takes priority?
Another possibility is to let option ROMs load up to 0xe9000 rather than
just 0xe0000. There's nothing in the range 0xe0000-0xe9000 right now; it's
36kB of wasted space.
-- Keir
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Patch] avoid unnecessary loading NIC rom.
2008-12-18 15:00 ` Keir Fraser
@ 2008-12-19 7:37 ` Akio Takebe
0 siblings, 0 replies; 6+ messages in thread
From: Akio Takebe @ 2008-12-19 7:37 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Keir Fraser wrote:
> On 18/12/2008 14:55, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:
>
>>>> There's a 'F10 to select boot device' option in rombios, so you can't
>>>> determine this in hvmloader.
>>> Exactly. But if gPXE rom is loaded,
>>> hvmloader cannot load some option ROMs of raal PCI cards.
>>> I suspect we don't use F10 option for PXE boot.
>>> Do you have good idea?
>> Not really. Perhaps scan_etherboot_nic() after pci_load_option_roms(), so the
>> latter takes priority?
>
> Another possibility is to let option ROMs load up to 0xe9000 rather than
> just 0xe0000. There's nothing in the range 0xe0000-0xe9000 right now; it's
> 36kB of wasted space.
>
OK. I'll try to use the range 0xe0000-0xe9000.
The range seems to be OK in BBS spec.
Best Regards,
Akio Takebe
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-12-19 7:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 13:45 [Patch] avoid unnecessary loading NIC rom Akio Takebe
2008-12-18 14:40 ` Keir Fraser
2008-12-18 14:50 ` Akio Takebe
2008-12-18 14:55 ` Keir Fraser
2008-12-18 15:00 ` Keir Fraser
2008-12-19 7:37 ` Akio Takebe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.