All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Enable Option ROM support in Guest BIOS
@ 2008-11-24  5:16 Shan, Haitao
  2008-11-25  0:35 ` Akio Takebe
  2008-11-25 17:15 ` John Levon
  0 siblings, 2 replies; 11+ messages in thread
From: Shan, Haitao @ 2008-11-24  5:16 UTC (permalink / raw)
  To: 'Keir Fraser'; +Cc: 'xen-devel@lists.xensource.com'

Hi, Keir,

These three patches enables Option ROM support in guest BIOS. Please see detailed description below.

Descriptions:
etherboot_reloc.patch: Relocating the etherboot ROM to be near the end of VGA BIOS. Current Xen hard coded VGA ROM at 0xC0000 and etherboot ROM at 0xD0000. This makes the space in [0xC0000 - 0xDFFFF] to be fragments, which makes it hard to find enough space to hold another Option ROM.

rom_copy.patch: In hvmloader, scan the PCI hierarchy and load Option ROM at proper place. If no space is left, a warning is given out.

rom_exec.patch: Append the BDF of the device at the end of the Option ROM location. Guest BIOS will fetch this info and pass it to Option ROM initialization routine.

I have tested the patch using a PCI SCSI card. I can successfully run the Option ROM to configure the SCSI disk.

Note: There is no support for booting from SCSI disk now. Since guest BIOS lacks support for that. Please see the comments below.
//--------------------------------------------------------------------------
// BIOS Boot Specification 1.0.1 compatibility
//
// Very basic support for the BIOS Boot Specification, which allows expansion
// ROMs to register themselves as boot devices, instead of just stealing the
// INT 19h boot vector.
//
// This is a hack: to do it properly requires a proper PnP BIOS and we aren't
// one; we just lie to the option ROMs to make them behave correctly.
// We also don't support letting option ROMs register as bootable disk
// drives (BCVs), only as bootable devices (BEVs).
//
// http://www.phoenix.com/en/Customer+Services/White+Papers-Specs/pc+industry+specifications.htm
//--------------------------------------------------------------------------

Best Regards
Haitao Shan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-24  5:16 [PATCH 0/3] Enable Option ROM support in Guest BIOS Shan, Haitao
@ 2008-11-25  0:35 ` Akio Takebe
  2008-11-25  1:38   ` Shan, Haitao
  2008-11-25 17:15 ` John Levon
  1 sibling, 1 reply; 11+ messages in thread
From: Akio Takebe @ 2008-11-25  0:35 UTC (permalink / raw)
  To: Shan, Haitao, 'Keir Fraser'
  Cc: 'xen-devel@lists.xensource.com'

Hi, Shan

>
>Note: There is no support for booting from SCSI disk now. Since guest BIOS 
>lacks support for that. Please see the comments below.
>//--------------------------------------------------------------------------
>// BIOS Boot Specification 1.0.1 compatibility
>//
>// Very basic support for the BIOS Boot Specification, which allows expansion
>// ROMs to register themselves as boot devices, instead of just stealing the
>// INT 19h boot vector.
>//
>// This is a hack: to do it properly requires a proper PnP BIOS and we aren't
>// one; we just lie to the option ROMs to make them behave correctly.
>// We also don't support letting option ROMs register as bootable disk
>// drives (BCVs), only as bootable devices (BEVs).
>//
>// http://www.phoenix.com/en/Customer+Services/White+Papers-Specs/pc+industry
>+specifications.htm
>//--------------------------------------------------------------------------
>
We have also worked for enabling option ROM.
I and Kouya made the patch for supporting BCV. And we could boot HVM 
guest from SAN storage. (please see my presentation of XenSummit Tokyo)

I'll check your patch and remake the patch soon.

BTW, I found some problems, they are:
- Some device require services that are not supported by ROMBIOS.
  (I think updating ROMBIOS to the latest bochs is better.)
- Some devcies have empty option ROM or option ROM for EFI.
  (e.g. NIC cards)

Best Regards,

Akio Takebe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-25  0:35 ` Akio Takebe
@ 2008-11-25  1:38   ` Shan, Haitao
  2008-11-25  1:47     ` Akio Takebe
  0 siblings, 1 reply; 11+ messages in thread
From: Shan, Haitao @ 2008-11-25  1:38 UTC (permalink / raw)
  To: Akio Takebe, 'Keir Fraser', Nakajima, Jun
  Cc: 'xen-devel@lists.xensource.com'

Takebe San,

For the empty option ROM case, do you mean that you can not see any contents by reading the PCI expansion ROM bar address? Or they are indeed empty?
I have met a problem when developing the patches; I can not read any contents from expansion ROM bar. I wonder whether they are the same problem.

Shan Haitao

-----Original Message-----
From: Akio Takebe [mailto:takebe_akio@jp.fujitsu.com] 
Sent: 2008年11月25日 8:35
To: Shan, Haitao; 'Keir Fraser'
Cc: 'xen-devel@lists.xensource.com'
Subject: Re: [Xen-devel] [PATCH 0/3] Enable Option ROM support in Guest BIOS

Hi, Shan

>
>Note: There is no support for booting from SCSI disk now. Since guest BIOS 
>lacks support for that. Please see the comments below.
>//--------------------------------------------------------------------------
>// BIOS Boot Specification 1.0.1 compatibility
>//
>// Very basic support for the BIOS Boot Specification, which allows expansion
>// ROMs to register themselves as boot devices, instead of just stealing the
>// INT 19h boot vector.
>//
>// This is a hack: to do it properly requires a proper PnP BIOS and we aren't
>// one; we just lie to the option ROMs to make them behave correctly.
>// We also don't support letting option ROMs register as bootable disk
>// drives (BCVs), only as bootable devices (BEVs).
>//
>// http://www.phoenix.com/en/Customer+Services/White+Papers-Specs/pc+industry
>+specifications.htm
>//--------------------------------------------------------------------------
>
We have also worked for enabling option ROM.
I and Kouya made the patch for supporting BCV. And we could boot HVM 
guest from SAN storage. (please see my presentation of XenSummit Tokyo)

I'll check your patch and remake the patch soon.

BTW, I found some problems, they are:
- Some device require services that are not supported by ROMBIOS.
  (I think updating ROMBIOS to the latest bochs is better.)
- Some devcies have empty option ROM or option ROM for EFI.
  (e.g. NIC cards)

Best Regards,

Akio Takebe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-25  1:38   ` Shan, Haitao
@ 2008-11-25  1:47     ` Akio Takebe
  2008-11-25  2:09       ` Shan, Haitao
  0 siblings, 1 reply; 11+ messages in thread
From: Akio Takebe @ 2008-11-25  1:47 UTC (permalink / raw)
  To: Shan, Haitao, 'Keir Fraser', Nakajima, Jun
  Cc: 'xen-devel@lists.xensource.com', Akio Takebe

Hi, Shan-san

I read option ROM from /sys/devices/pci0000\:00/<BDF>/rom like the below.
1. echo 1 > /sys/devices/pci0000\:00/0000\:00\:01.0/0000\:01\:00.0/rom
2. dd if=/sys/devices/pci0000\:00/0000\:00\:01.0/0000\:01\:00.0/rom of=
rom.data

The rom didn't have any contents.

Best Regards,

Akio Takebe

>Takebe San,
>
>For the empty option ROM case, do you mean that you can not see any contents 
>by reading the PCI expansion ROM bar address? Or they are indeed empty?
>I have met a problem when developing the patches; I can not read any contents 
>from expansion ROM bar. I wonder whether they are the same problem.
>
>Shan Haitao
>
>-----Original Message-----
>From: Akio Takebe [mailto:takebe_akio@jp.fujitsu.com] 
>Sent: 2008年11月25日 8:35
>To: Shan, Haitao; 'Keir Fraser'
>Cc: 'xen-devel@lists.xensource.com'
>Subject: Re: [Xen-devel] [PATCH 0/3] Enable Option ROM support in Guest BIOS
>
>Hi, Shan
>
>>
>>Note: There is no support for booting from SCSI disk now. Since guest BIOS 
>>lacks support for that. Please see the comments below.
>>//--------------------------------------------------------------------------
>>// BIOS Boot Specification 1.0.1 compatibility
>>//
>>// Very basic support for the BIOS Boot Specification, which allows 
>>expansion
>>// ROMs to register themselves as boot devices, instead of just stealing the
>>// INT 19h boot vector.
>>//
>>// This is a hack: to do it properly requires a proper PnP BIOS and we 
>>aren't
>>// one; we just lie to the option ROMs to make them behave correctly.
>>// We also don't support letting option ROMs register as bootable disk
>>// drives (BCVs), only as bootable devices (BEVs).
>>//
>>// http://www.phoenix.com/en/Customer+Services/White+Papers-Specs/pc+
>>industry
>>+specifications.htm
>>//--------------------------------------------------------------------------
>>
>We have also worked for enabling option ROM.
>I and Kouya made the patch for supporting BCV. And we could boot HVM 
>guest from SAN storage. (please see my presentation of XenSummit Tokyo)
>
>I'll check your patch and remake the patch soon.
>
>BTW, I found some problems, they are:
>- Some device require services that are not supported by ROMBIOS.
>  (I think updating ROMBIOS to the latest bochs is better.)
>- Some devcies have empty option ROM or option ROM for EFI.
>  (e.g. NIC cards)
>
>Best Regards,
>
>Akio Takebe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-25  1:47     ` Akio Takebe
@ 2008-11-25  2:09       ` Shan, Haitao
  0 siblings, 0 replies; 11+ messages in thread
From: Shan, Haitao @ 2008-11-25  2:09 UTC (permalink / raw)
  To: Akio Takebe, 'Keir Fraser', Nakajima, Jun
  Cc: 'xen-devel@lists.xensource.com'

Hi, Takebe-san,

Maybe you can apply this little patch to your dom0 linux kernel.
And it is not enough to only echo 1 > /sys/......../rom.
Can you do "setpci -s <your BDF> 04.b=7" and "setpci -s <your bdf> 30.b=1" before you dump the contents?
As far as I can see, there are two problems exist in kernel (including native).
1> Kernel resumes that expansion ROM bar resources are within the prefetch MMIO range of its parent bridge. This is not true. At least, I have not seen such requirement in any spec. And my BIOS does not configure resources like that. That is what my little patch is trying to fix.
2> The handler of writing /sys/........./rom does enable the bar in its code. It does not enable the device. Expansion ROM bar is in effect only when you set MMIO enable in its command register.

I hope this can help you. But if not, we are facing not identical problems.

Best Regards
Shan Haitao   

diff -r 2fb13b8cbe13 drivers/pci/probe.c
--- a/drivers/pci/probe.c   Thu Oct 30 13:34:43 2008 +0000
+++ b/drivers/pci/probe.c   Thu Nov 13 13:53:53 2008 +0800
@@ -223,7 +223,7 @@
            sz = pci_size(l, sz, (u32)PCI_ROM_ADDRESS_MASK);
            if (sz) {
                res->flags = (l & IORESOURCE_ROM_ENABLE) |
-                 IORESOURCE_MEM | IORESOURCE_PREFETCH |
+                 IORESOURCE_MEM |// IORESOURCE_PREFETCH |
                  IORESOURCE_READONLY | IORESOURCE_CACHEABLE;
                res->start = l & PCI_ROM_ADDRESS_MASK;
                res->end = res->start + (unsigned long) sz;

-----Original Message-----
From: Akio Takebe [mailto:takebe_akio@jp.fujitsu.com] 
Sent: 2008年11月25日 9:48
To: Shan, Haitao; 'Keir Fraser'; Nakajima, Jun
Cc: 'xen-devel@lists.xensource.com'; Akio Takebe
Subject: RE: [Xen-devel] [PATCH 0/3] Enable Option ROM support in Guest BIOS

Hi, Shan-san

I read option ROM from /sys/devices/pci0000\:00/<BDF>/rom like the below.
1. echo 1 > /sys/devices/pci0000\:00/0000\:00\:01.0/0000\:01\:00.0/rom
2. dd if=/sys/devices/pci0000\:00/0000\:00\:01.0/0000\:01\:00.0/rom of=
rom.data

The rom didn't have any contents.

Best Regards,

Akio Takebe

>Takebe San,
>
>For the empty option ROM case, do you mean that you can not see any contents 
>by reading the PCI expansion ROM bar address? Or they are indeed empty?
>I have met a problem when developing the patches; I can not read any contents 
>from expansion ROM bar. I wonder whether they are the same problem.
>
>Shan Haitao
>
>-----Original Message-----
>From: Akio Takebe [mailto:takebe_akio@jp.fujitsu.com] 
>Sent: 2008年11月25日 8:35
>To: Shan, Haitao; 'Keir Fraser'
>Cc: 'xen-devel@lists.xensource.com'
>Subject: Re: [Xen-devel] [PATCH 0/3] Enable Option ROM support in Guest BIOS
>
>Hi, Shan
>
>>
>>Note: There is no support for booting from SCSI disk now. Since guest BIOS 
>>lacks support for that. Please see the comments below.
>>//--------------------------------------------------------------------------
>>// BIOS Boot Specification 1.0.1 compatibility
>>//
>>// Very basic support for the BIOS Boot Specification, which allows 
>>expansion
>>// ROMs to register themselves as boot devices, instead of just stealing the
>>// INT 19h boot vector.
>>//
>>// This is a hack: to do it properly requires a proper PnP BIOS and we 
>>aren't
>>// one; we just lie to the option ROMs to make them behave correctly.
>>// We also don't support letting option ROMs register as bootable disk
>>// drives (BCVs), only as bootable devices (BEVs).
>>//
>>// http://www.phoenix.com/en/Customer+Services/White+Papers-Specs/pc+
>>industry
>>+specifications.htm
>>//--------------------------------------------------------------------------
>>
>We have also worked for enabling option ROM.
>I and Kouya made the patch for supporting BCV. And we could boot HVM 
>guest from SAN storage. (please see my presentation of XenSummit Tokyo)
>
>I'll check your patch and remake the patch soon.
>
>BTW, I found some problems, they are:
>- Some device require services that are not supported by ROMBIOS.
>  (I think updating ROMBIOS to the latest bochs is better.)
>- Some devcies have empty option ROM or option ROM for EFI.
>  (e.g. NIC cards)
>
>Best Regards,
>
>Akio Takebe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-24  5:16 [PATCH 0/3] Enable Option ROM support in Guest BIOS Shan, Haitao
  2008-11-25  0:35 ` Akio Takebe
@ 2008-11-25 17:15 ` John Levon
  2008-11-26  2:08   ` Shan, Haitao
  2008-11-26  5:47   ` Ian Pratt
  1 sibling, 2 replies; 11+ messages in thread
From: John Levon @ 2008-11-25 17:15 UTC (permalink / raw)
  To: Shan, Haitao
  Cc: 'xen-devel@lists.xensource.com', 'Keir Fraser'

On Mon, Nov 24, 2008 at 01:16:09PM +0800, Shan, Haitao wrote:

> These three patches enables Option ROM support in guest BIOS. Please see detailed description below.

Do these changes help towards being able to boot from an emulated SCSI
device for HVM guests? Has any thought been done about that?

regards
john

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-25 17:15 ` John Levon
@ 2008-11-26  2:08   ` Shan, Haitao
  2008-11-26  5:27     ` Akio Takebe
  2008-11-26  5:47   ` Ian Pratt
  1 sibling, 1 reply; 11+ messages in thread
From: Shan, Haitao @ 2008-11-26  2:08 UTC (permalink / raw)
  To: 'John Levon'
  Cc: 'xen-devel@lists.xensource.com', 'Keir Fraser'

Hi,

Although we developed this for assigned devices, I think it also applies to emulated devices.

For adding support of an emulated SCSI device, I think there are different approach.
1> Modifies guest BIOS to directly support your emulated SCSI controller and devices. This does not need option ROM support.
2> Implement option ROM for your emulated devices. But loading of this option ROM can be hardcoded in HVMLoader, like current VGA BIOS in guest BIOS. This does not need generic option ROM support.
3> Implement option ROM for your emulated decices. Access this option ROM via PCI expansion BAR (of your emulated device of course). You can use this patches for loading and executing the option ROM. However, this alone can *not* enable booting from that SCSI device. You still need to modify guest BIOS to support BCV in BIOS Boot Specification.

So that answer to your question is: Yes, it helps towarding being able to boot from an emulated SCSI device for HVM guest if you choose to do it that way. But *not* enough. I do not know if there is anyone that is developing this capability. Maybe others who has interests on this can comment more.

Best Regards
Haitao Shan

John Levon wrote:
> On Mon, Nov 24, 2008 at 01:16:09PM +0800, Shan, Haitao wrote:
> 
>> These three patches enables Option ROM support in guest BIOS. Please
>> see detailed description below. 
> 
> Do these changes help towards being able to boot from an emulated SCSI
> device for HVM guests? Has any thought been done about that?
> 
> regards
> john

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-26  2:08   ` Shan, Haitao
@ 2008-11-26  5:27     ` Akio Takebe
  0 siblings, 0 replies; 11+ messages in thread
From: Akio Takebe @ 2008-11-26  5:27 UTC (permalink / raw)
  To: Shan, Haitao, 'John Levon'
  Cc: 'xen-devel@lists.xensource.com', 'Keir Fraser'

Hi,

>So that answer to your question is: Yes, it helps towarding being able to 
>boot from an emulated SCSI device for HVM guest if you choose to do it that 
>way. But *not* enough. I do not know if there is anyone that is developing 
>this capability. Maybe others who has interests on this can comment more.
>
We are interested in SAN boot, SAS boot and so on.
We have a patch to be able to boot HVM guest from SAN.
The patch is for supporting BCV style booting.
But we needs to revise the patch a little bit.

Best Regards,

Akio Takebe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-25 17:15 ` John Levon
  2008-11-26  2:08   ` Shan, Haitao
@ 2008-11-26  5:47   ` Ian Pratt
  2008-11-26  5:54     ` James Harper
  2008-11-27 10:27     ` Gerd Hoffmann
  1 sibling, 2 replies; 11+ messages in thread
From: Ian Pratt @ 2008-11-26  5:47 UTC (permalink / raw)
  To: John Levon, Shan, Haitao; +Cc: Ian Pratt, xen-devel, Keir Fraser

> > These three patches enables Option ROM support in guest BIOS. Please
> see detailed description below.
> 
> Do these changes help towards being able to boot from an emulated SCSI
> device for HVM guests? Has any thought been done about that?

The easiest way to do this would be to ask LSI whether we could
redistribute the binary blob BIOS option ROM that was originally shipped
with the 53C895A. To my knowledge, I don't think anyone has tried this
approach yet -- they may have no objections to the binary becoming part
of the xen distribution.

Writing even a simple driver for a scsi device is a bit of a pain, so if
we can't use the real option ROM, it's probably easiest to hack in a
real simple block read/write and LUN query function into the emulated
device and then write a trivial option ROM to drive it.
Anthony Liguori started something similar to this a year or two back,
but I don't believe it was finished.

Ian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-26  5:47   ` Ian Pratt
@ 2008-11-26  5:54     ` James Harper
  2008-11-27 10:27     ` Gerd Hoffmann
  1 sibling, 0 replies; 11+ messages in thread
From: James Harper @ 2008-11-26  5:54 UTC (permalink / raw)
  To: Ian Pratt, John Levon, Shan, Haitao; +Cc: xen-devel, Keir Fraser

> > > These three patches enables Option ROM support in guest BIOS.
Please
> > see detailed description below.
> >
> > Do these changes help towards being able to boot from an emulated
SCSI
> > device for HVM guests? Has any thought been done about that?
> 
> The easiest way to do this would be to ask LSI whether we could
> redistribute the binary blob BIOS option ROM that was originally
shipped
> with the 53C895A. To my knowledge, I don't think anyone has tried this
> approach yet -- they may have no objections to the binary becoming
part
> of the xen distribution.
> 
> Writing even a simple driver for a scsi device is a bit of a pain, so
if
> we can't use the real option ROM, it's probably easiest to hack in a
> real simple block read/write and LUN query function into the emulated
> device and then write a trivial option ROM to drive it.
> Anthony Liguori started something similar to this a year or two back,
> but I don't believe it was finished.
> 

It would be really nice to have a BIOS emulated device that worked with
INT13 calls and nothing else so that we didn't have the problem of HVM
domains trying to drive it via PV drivers and emulated hardware
(ide/scsi) drivers...

James

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] Enable Option ROM support in Guest BIOS
  2008-11-26  5:47   ` Ian Pratt
  2008-11-26  5:54     ` James Harper
@ 2008-11-27 10:27     ` Gerd Hoffmann
  1 sibling, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2008-11-27 10:27 UTC (permalink / raw)
  To: Ian Pratt; +Cc: xen-devel, Shan, Haitao, Keir Fraser, John Levon

  Hi,

> Writing even a simple driver for a scsi device is a bit of a pain, so if
> we can't use the real option ROM, it's probably easiest to hack in a
> real simple block read/write and LUN query function into the emulated
> device and then write a trivial option ROM to drive it.
> Anthony Liguori started something similar to this a year or two back,
> but I don't believe it was finished.

It's done, named "extboot", allows booting from scsi and virtio devices
(effectively any qemu block device).  It sits in the kvm tree right now
and will probably submitted to upstream qemu soon.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-11-27 10:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24  5:16 [PATCH 0/3] Enable Option ROM support in Guest BIOS Shan, Haitao
2008-11-25  0:35 ` Akio Takebe
2008-11-25  1:38   ` Shan, Haitao
2008-11-25  1:47     ` Akio Takebe
2008-11-25  2:09       ` Shan, Haitao
2008-11-25 17:15 ` John Levon
2008-11-26  2:08   ` Shan, Haitao
2008-11-26  5:27     ` Akio Takebe
2008-11-26  5:47   ` Ian Pratt
2008-11-26  5:54     ` James Harper
2008-11-27 10:27     ` Gerd Hoffmann

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.