Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-06-02 Thread Paolo Bonzini
Il 02/06/2013 17:05, Gleb Natapov ha scritto:
>>> Anthony requested that patches be made that generate the ACPI tables
>>> in QEMU for the upcoming hotplug work, so that they could be evaluated
>>> to see if they truly do need to live in QEMU or if the code could live
>>> in the firmware.  There were no objections.
>>
>> I volunteered to implement this.
>
> Why hotplug should generate ACPI code? It does not do so on real HW.

Hotplug can do a LoadTable and merge it into the existing ones.  But
then you do not need QEMU-time generation of tables to do the same thing
for cold-plug.

Paolo



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-06-02 Thread Gerd Hoffmann
On 06/01/13 01:01, Jordan Justen wrote:
> On Fri, May 31, 2013 at 2:32 AM, Gerd Hoffmann  wrote:
>>   Hi,
>>
>>> I guess -bios would load coreboot. Coreboot would siphon the data
>>> necessary for ACPI table building through the current (same) fw_cfg
>>> bottleneck, build the tables,
>>
>> Yes.
> 
> So, this is really about making coreboot+seabios the default QEMU
> firmware, and making seabios depend on being a coreboot payload?

I still think it's better to simply have qemu generate the acpi tables,
but if that isn't going to be accepted we should seriously consider &
evaluate switching to coreboot.

>>> load the boot firmware (SeaBIOS or OVMF or
>>> something else -- not sure how to configure that),
> 
> It wouldn't be loading OVMF. It would be loading CorebootPkg.

Yep.  Some OVMF bits would be needed though (virtio drivers, qemu boot
priority support, ...).

cheers,
  Gerd




Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-06-02 Thread Michael S. Tsirkin
On Sun, Jun 02, 2013 at 06:40:43PM +0300, Gleb Natapov wrote:
> On Sun, Jun 02, 2013 at 06:09:50PM +0300, Michael S. Tsirkin wrote:
> > On Sun, Jun 02, 2013 at 06:05:42PM +0300, Gleb Natapov wrote:
> > > On Wed, May 29, 2013 at 11:45:44AM +0300, Michael S. Tsirkin wrote:
> > > > On Tue, May 28, 2013 at 07:53:09PM -0400, Kevin O'Connor wrote:
> > > > > On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
> > > > > > Juan is not available now, and Anthony asked for
> > > > > > agenda to be sent early.
> > > > > > So here comes:
> > > > > > 
> > > > > > Agenda for the meeting Tue, May 28:
> > > > > > 
> > > > > > - Generating acpi tables
> > > > > 
> > > > > I didn't see any meeting notes, but I thought it would be worthwhile
> > > > > to summarize the call.  This is from memory so correct me if I got
> > > > > anything wrong.
> > > > > 
> > > > > Anthony believes that the generation of ACPI tables is the task of the
> > > > > firmware.  Reasons cited include security implications of running more
> > > > > code in qemu vs the guest context, complexities in running iasl on
> > > > > big-endian machines, possible complexity of having to regenerate
> > > > > tables on a vm reboot, overall sloppiness of doing it in QEMU.  Raised
> > > > > that QOM interface should be sufficient.
> > > > > 
> > > > > Kevin believes that the bios table code should be moved up into QEMU.
> > > > > Reasons cited include the churn rate in SeaBIOS for this QEMU feature
> > > > > (15-20% of all SeaBIOS commits since integrating with QEMU have been
> > > > > for bios tables; 20% of SeaBIOS commits in last year), complexity of
> > > > > trying to pass all the content needed to generate the tables (eg,
> > > > > device details, power tree, irq routing), complexity of scheduling
> > > > > changes across different repos and synchronizing their rollout,
> > > > > complexity of implemeting the code in both OVMF and SeaBIOS.  Kevin
> > > > > wasn't aware of a requirement to regenerate acpi tables on a vm
> > > > > reboot.
> > > > 
> > > > I think this last one is based on a misunderstanding: it's based
> > > > on assumption that we we change hardware by hotplug
> > > > we should regenerate the tables to match.
> > > > But there's no management that can take advantage of
> > > > this.
> > > > Two possible reasonable things we can tell management:
> > > > - hotplug for device XXX is not supported: restart qemu
> > > >   to make guest use the device
> > > > - hotplug for device XXX is supported
> > > > 
> > > > What is proposed here instead is a third option:
> > > > - hotplug is supported but device is not functional.
> > > >   reboot guest to make it fully functional
> > > > 
> > > > This will naturally lead to requirement to regenerate tables on reset.
> > > > 
> > > > And this is what would happen with guest-generated
> > > > tables, and I consider this a bug, not a feature.
> > > > 
> > > +1. This will probably break guest resume too.
> > > 
> > > > If you really wanted to update tables dynamically, without restarting
> > > > qemu, don't stop there, add an interface for guest to update them
> > > > without reset. I think that's over-endineering and a
> > > > requirement that's best avoided.
> > > > 
> > > > 
> > > > > There were discussions on potentially introducing a middle component
> > > > > to generate the tables.  Coreboot was raised as a possibility, and
> > > > > David thought it would be okay to use coreboot for both OVMF and
> > > > > SeaBIOS.  The possibility was also raised of a "rom" that lives in the
> > > > > qemu repo, is run in the guest, and generates the tables (which is
> > > > > similar to the hvmloader approach that Xen uses).
> > > > > 
> > > > > Anthony requested that patches be made that generate the ACPI tables
> > > > > in QEMU for the upcoming hotplug work, so that they could be evaluated
> > > > > to see if they truly do need to live in QEMU or if the code could live
> > > > > in the firmware.  There were no objections.
> > > > > 
> > > > > -Kevin
> > > > 
> > > > I volunteered to implement this.
> > > Why hotplug should generate ACPI code? It does not do so on real HW.
> > 
> > Hotplug should not generate ACPI code.
> > What is meant here is adding ACPI code to support hotplug
> > of devices behind a PCI to PCI bridge.
> > 
> Ah, OK. This one does not change on reset.

It wouldn't if QEMU generates it.
With bios generating the tables it might depending
on how it's implemented.
To make it not change across resets we'd need
an interface in QEMU to tell guest whether a
device was added since QEMU start.

> --
>   Gleb.



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-06-02 Thread Gleb Natapov
On Sun, Jun 02, 2013 at 06:09:50PM +0300, Michael S. Tsirkin wrote:
> On Sun, Jun 02, 2013 at 06:05:42PM +0300, Gleb Natapov wrote:
> > On Wed, May 29, 2013 at 11:45:44AM +0300, Michael S. Tsirkin wrote:
> > > On Tue, May 28, 2013 at 07:53:09PM -0400, Kevin O'Connor wrote:
> > > > On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
> > > > > Juan is not available now, and Anthony asked for
> > > > > agenda to be sent early.
> > > > > So here comes:
> > > > > 
> > > > > Agenda for the meeting Tue, May 28:
> > > > > 
> > > > > - Generating acpi tables
> > > > 
> > > > I didn't see any meeting notes, but I thought it would be worthwhile
> > > > to summarize the call.  This is from memory so correct me if I got
> > > > anything wrong.
> > > > 
> > > > Anthony believes that the generation of ACPI tables is the task of the
> > > > firmware.  Reasons cited include security implications of running more
> > > > code in qemu vs the guest context, complexities in running iasl on
> > > > big-endian machines, possible complexity of having to regenerate
> > > > tables on a vm reboot, overall sloppiness of doing it in QEMU.  Raised
> > > > that QOM interface should be sufficient.
> > > > 
> > > > Kevin believes that the bios table code should be moved up into QEMU.
> > > > Reasons cited include the churn rate in SeaBIOS for this QEMU feature
> > > > (15-20% of all SeaBIOS commits since integrating with QEMU have been
> > > > for bios tables; 20% of SeaBIOS commits in last year), complexity of
> > > > trying to pass all the content needed to generate the tables (eg,
> > > > device details, power tree, irq routing), complexity of scheduling
> > > > changes across different repos and synchronizing their rollout,
> > > > complexity of implemeting the code in both OVMF and SeaBIOS.  Kevin
> > > > wasn't aware of a requirement to regenerate acpi tables on a vm
> > > > reboot.
> > > 
> > > I think this last one is based on a misunderstanding: it's based
> > > on assumption that we we change hardware by hotplug
> > > we should regenerate the tables to match.
> > > But there's no management that can take advantage of
> > > this.
> > > Two possible reasonable things we can tell management:
> > > - hotplug for device XXX is not supported: restart qemu
> > >   to make guest use the device
> > > - hotplug for device XXX is supported
> > > 
> > > What is proposed here instead is a third option:
> > > - hotplug is supported but device is not functional.
> > >   reboot guest to make it fully functional
> > > 
> > > This will naturally lead to requirement to regenerate tables on reset.
> > > 
> > > And this is what would happen with guest-generated
> > > tables, and I consider this a bug, not a feature.
> > > 
> > +1. This will probably break guest resume too.
> > 
> > > If you really wanted to update tables dynamically, without restarting
> > > qemu, don't stop there, add an interface for guest to update them
> > > without reset. I think that's over-endineering and a
> > > requirement that's best avoided.
> > > 
> > > 
> > > > There were discussions on potentially introducing a middle component
> > > > to generate the tables.  Coreboot was raised as a possibility, and
> > > > David thought it would be okay to use coreboot for both OVMF and
> > > > SeaBIOS.  The possibility was also raised of a "rom" that lives in the
> > > > qemu repo, is run in the guest, and generates the tables (which is
> > > > similar to the hvmloader approach that Xen uses).
> > > > 
> > > > Anthony requested that patches be made that generate the ACPI tables
> > > > in QEMU for the upcoming hotplug work, so that they could be evaluated
> > > > to see if they truly do need to live in QEMU or if the code could live
> > > > in the firmware.  There were no objections.
> > > > 
> > > > -Kevin
> > > 
> > > I volunteered to implement this.
> > Why hotplug should generate ACPI code? It does not do so on real HW.
> 
> Hotplug should not generate ACPI code.
> What is meant here is adding ACPI code to support hotplug
> of devices behind a PCI to PCI bridge.
> 
Ah, OK. This one does not change on reset.

--
Gleb.



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-06-02 Thread Michael S. Tsirkin
On Sun, Jun 02, 2013 at 06:05:42PM +0300, Gleb Natapov wrote:
> On Wed, May 29, 2013 at 11:45:44AM +0300, Michael S. Tsirkin wrote:
> > On Tue, May 28, 2013 at 07:53:09PM -0400, Kevin O'Connor wrote:
> > > On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
> > > > Juan is not available now, and Anthony asked for
> > > > agenda to be sent early.
> > > > So here comes:
> > > > 
> > > > Agenda for the meeting Tue, May 28:
> > > > 
> > > > - Generating acpi tables
> > > 
> > > I didn't see any meeting notes, but I thought it would be worthwhile
> > > to summarize the call.  This is from memory so correct me if I got
> > > anything wrong.
> > > 
> > > Anthony believes that the generation of ACPI tables is the task of the
> > > firmware.  Reasons cited include security implications of running more
> > > code in qemu vs the guest context, complexities in running iasl on
> > > big-endian machines, possible complexity of having to regenerate
> > > tables on a vm reboot, overall sloppiness of doing it in QEMU.  Raised
> > > that QOM interface should be sufficient.
> > > 
> > > Kevin believes that the bios table code should be moved up into QEMU.
> > > Reasons cited include the churn rate in SeaBIOS for this QEMU feature
> > > (15-20% of all SeaBIOS commits since integrating with QEMU have been
> > > for bios tables; 20% of SeaBIOS commits in last year), complexity of
> > > trying to pass all the content needed to generate the tables (eg,
> > > device details, power tree, irq routing), complexity of scheduling
> > > changes across different repos and synchronizing their rollout,
> > > complexity of implemeting the code in both OVMF and SeaBIOS.  Kevin
> > > wasn't aware of a requirement to regenerate acpi tables on a vm
> > > reboot.
> > 
> > I think this last one is based on a misunderstanding: it's based
> > on assumption that we we change hardware by hotplug
> > we should regenerate the tables to match.
> > But there's no management that can take advantage of
> > this.
> > Two possible reasonable things we can tell management:
> > - hotplug for device XXX is not supported: restart qemu
> >   to make guest use the device
> > - hotplug for device XXX is supported
> > 
> > What is proposed here instead is a third option:
> > - hotplug is supported but device is not functional.
> >   reboot guest to make it fully functional
> > 
> > This will naturally lead to requirement to regenerate tables on reset.
> > 
> > And this is what would happen with guest-generated
> > tables, and I consider this a bug, not a feature.
> > 
> +1. This will probably break guest resume too.
> 
> > If you really wanted to update tables dynamically, without restarting
> > qemu, don't stop there, add an interface for guest to update them
> > without reset. I think that's over-endineering and a
> > requirement that's best avoided.
> > 
> > 
> > > There were discussions on potentially introducing a middle component
> > > to generate the tables.  Coreboot was raised as a possibility, and
> > > David thought it would be okay to use coreboot for both OVMF and
> > > SeaBIOS.  The possibility was also raised of a "rom" that lives in the
> > > qemu repo, is run in the guest, and generates the tables (which is
> > > similar to the hvmloader approach that Xen uses).
> > > 
> > > Anthony requested that patches be made that generate the ACPI tables
> > > in QEMU for the upcoming hotplug work, so that they could be evaluated
> > > to see if they truly do need to live in QEMU or if the code could live
> > > in the firmware.  There were no objections.
> > > 
> > > -Kevin
> > 
> > I volunteered to implement this.
> Why hotplug should generate ACPI code? It does not do so on real HW.

Hotplug should not generate ACPI code.
What is meant here is adding ACPI code to support hotplug
of devices behind a PCI to PCI bridge.


> > 
> > It was also mentioned that this patch does not yet have to fix the
> > cross-version migration issue with fw_cfg. If we agree on a direction,
> > we will fix it then.
> > 
> > Lastly, a proposal was made by Michael to make the call bi-weekly
> > instead of weekly, as we were cancelling it too much.
> > There were no objections.
> > 
> > Thus, the next call is planned for June 11, 2013.
> > 
> > -- 
> > MST
> > 
> > ___
> > SeaBIOS mailing list
> > seab...@seabios.org
> > http://www.seabios.org/mailman/listinfo/seabios
> 
> --
>   Gleb.



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-06-02 Thread Gleb Natapov
On Wed, May 29, 2013 at 11:45:44AM +0300, Michael S. Tsirkin wrote:
> On Tue, May 28, 2013 at 07:53:09PM -0400, Kevin O'Connor wrote:
> > On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
> > > Juan is not available now, and Anthony asked for
> > > agenda to be sent early.
> > > So here comes:
> > > 
> > > Agenda for the meeting Tue, May 28:
> > > 
> > > - Generating acpi tables
> > 
> > I didn't see any meeting notes, but I thought it would be worthwhile
> > to summarize the call.  This is from memory so correct me if I got
> > anything wrong.
> > 
> > Anthony believes that the generation of ACPI tables is the task of the
> > firmware.  Reasons cited include security implications of running more
> > code in qemu vs the guest context, complexities in running iasl on
> > big-endian machines, possible complexity of having to regenerate
> > tables on a vm reboot, overall sloppiness of doing it in QEMU.  Raised
> > that QOM interface should be sufficient.
> > 
> > Kevin believes that the bios table code should be moved up into QEMU.
> > Reasons cited include the churn rate in SeaBIOS for this QEMU feature
> > (15-20% of all SeaBIOS commits since integrating with QEMU have been
> > for bios tables; 20% of SeaBIOS commits in last year), complexity of
> > trying to pass all the content needed to generate the tables (eg,
> > device details, power tree, irq routing), complexity of scheduling
> > changes across different repos and synchronizing their rollout,
> > complexity of implemeting the code in both OVMF and SeaBIOS.  Kevin
> > wasn't aware of a requirement to regenerate acpi tables on a vm
> > reboot.
> 
> I think this last one is based on a misunderstanding: it's based
> on assumption that we we change hardware by hotplug
> we should regenerate the tables to match.
> But there's no management that can take advantage of
> this.
> Two possible reasonable things we can tell management:
> - hotplug for device XXX is not supported: restart qemu
>   to make guest use the device
> - hotplug for device XXX is supported
> 
> What is proposed here instead is a third option:
> - hotplug is supported but device is not functional.
>   reboot guest to make it fully functional
> 
> This will naturally lead to requirement to regenerate tables on reset.
> 
> And this is what would happen with guest-generated
> tables, and I consider this a bug, not a feature.
> 
+1. This will probably break guest resume too.

> If you really wanted to update tables dynamically, without restarting
> qemu, don't stop there, add an interface for guest to update them
> without reset. I think that's over-endineering and a
> requirement that's best avoided.
> 
> 
> > There were discussions on potentially introducing a middle component
> > to generate the tables.  Coreboot was raised as a possibility, and
> > David thought it would be okay to use coreboot for both OVMF and
> > SeaBIOS.  The possibility was also raised of a "rom" that lives in the
> > qemu repo, is run in the guest, and generates the tables (which is
> > similar to the hvmloader approach that Xen uses).
> > 
> > Anthony requested that patches be made that generate the ACPI tables
> > in QEMU for the upcoming hotplug work, so that they could be evaluated
> > to see if they truly do need to live in QEMU or if the code could live
> > in the firmware.  There were no objections.
> > 
> > -Kevin
> 
> I volunteered to implement this.
Why hotplug should generate ACPI code? It does not do so on real HW.

> 
> It was also mentioned that this patch does not yet have to fix the
> cross-version migration issue with fw_cfg. If we agree on a direction,
> we will fix it then.
> 
> Lastly, a proposal was made by Michael to make the call bi-weekly
> instead of weekly, as we were cancelling it too much.
> There were no objections.
> 
> Thus, the next call is planned for June 11, 2013.
> 
> -- 
> MST
> 
> ___
> SeaBIOS mailing list
> seab...@seabios.org
> http://www.seabios.org/mailman/listinfo/seabios

--
Gleb.



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Kevin O'Connor
On Fri, May 31, 2013 at 10:13:34AM +0200, Peter Stuge wrote:
> Kevin O'Connor wrote:
> > one possible way forward would be to split the current SeaBIOS rom
> > into two roms: "qvmloader" and "seabios".  The "qvmloader" would do
> > the qemu specific platform init (pci init, smm init, mtrr init, bios
> > tables) and then load and run the regular seabios rom.
> 
> qvmloader sounds a lot like coreboot.

Agreed.  I don't much like the qvmloader idea.  I did want to open up
discussion on the possibility, however.  The only advantage it has
over coreboot is that it could reasonably live in the qemu repo, and I
do think that the hardware descriptions should like in the same code
repo as the hardware implementation.

-Kevin



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Jordan Justen
On Fri, May 31, 2013 at 2:32 AM, Gerd Hoffmann  wrote:
>   Hi,
>
>> I guess -bios would load coreboot. Coreboot would siphon the data
>> necessary for ACPI table building through the current (same) fw_cfg
>> bottleneck, build the tables,
>
> Yes.

So, this is really about making coreboot+seabios the default QEMU
firmware, and making seabios depend on being a coreboot payload?

>> load the boot firmware (SeaBIOS or OVMF or
>> something else -- not sure how to configure that),

It wouldn't be loading OVMF. It would be loading CorebootPkg.

OVMF is a better sample platform for EDK II since it shows a more
realistic view of what an EDK II based platform looks like on real
hardware.

Thus, if the ACPI tables are just being added to a new coreboot layer
with coreboot becoming the default QEMU firmware, then it doesn't help
OVMF (or other non-coreboot payloads).

Well, it could if the table code was BSD licensed, but only so we
could then merge them into OVMF. Then again, why not just provide a
set of suitably licensed ACPI source files within the QEMU tree that
firmware projects could use? QEMU doesn't necessarily need to
build/link them, or attempt to communicate them at runtime.

-Jordan

> The coreboot rom has named sections (this is called cbfs which stands
> for coreboot filesystem IIRC):
>
> rincewind kraxel ~# cbfstool /usr/share/coreboot.git/bios.bin print
> bios.bin: 256 kB, bootblocksize 848, romsize 262144, offset 0x0
> alignment: 64 bytes
>
> Name   Offset Type Size
> cmos_layout.bin0x0cmos_layout  1160
> fallback/romstage  0x4c0  stage14419
> fallback/coreboot_ram  0x3d80 stage37333
> config 0xcfc0 raw  2493
> fallback/payload   0xd9c0 payload  56969
> vgabios/sgabios0x1b8c0raw  4096
> (empty)0x1c900null 144216
>
> where "fallback/payload" is seabios.
>
>> and pass down the
>> tables to the firmware (through a now unspecified interface -- perhaps
>> the tables could even be installed at this point).
>
> As far I know coreboot can add more stuff such as acpi tables to cbfs at
> runtime and seabios able to access cbfs too and pull informations from
> coreboot that way.
>
> HTH,
>   Gerd
>
>



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Patrick Georgi
Am 31.05.2013 14:09, schrieb David Woodhouse:
> On Thu, 2013-05-30 at 09:20 -0700, Jordan Justen wrote:
>> On Thu, May 30, 2013 at 5:19 AM, David Woodhouse 
>> wrote:
>>> https://github.com/pgeorgi/edk2/tree/coreboot-pkg
>> Is the license on this actually BSD as the License.txt indicates?
Yes. All code is either Stefan's or my own work or taken from Tiano and
adapted. We will probably import some libpayload code, but that is
BSD-l, too.
>> Is this planned to be upstreamed?
Yes, once it's ready.
>> Does this support UEFI variables?
Not yet, planned.
>> Does this support UEFI IA32 / X64?
Both, no mixed mode.
> Those are questions for Patrick. 
HTH,
Patrick



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Laszlo Ersek
On 05/31/13 10:13, Peter Stuge wrote:

> ACPI bytes are obviously a function of QEMU configuration.

Precisely!

When we evaluate that (mathematical-sense) function in boot firmware, we
need to retrieve the function's arguments. Those arguments are bits of
QEMU configuration, as you say, and fw_cfg is extremely inconvenient for
fetching them. Whenever the domain or arity of said "mathematical"
function changes (we need more arguments, or different kinds of
arguments), we have to extend fw_cfg with yet another ad-hoc key or file
entry.

The set of arguments going into ACPI tables *is* ad-hoc and arbitrary,
there's nothing to do about it. But at least we shouldn't impede the
retrieval of said arguments with artificial obstacles, such as
half-assedly serializing them over fw_cfg (and not documenting them,
naturally). In qemu the entire pool of arguments, current and future,
would be at just an arm's length, in immediately consumable form.

I've said the same about the acpi_build_madt() prototype that was
proposed for qemu:
.

Thanks,
Laszlo



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread David Woodhouse
On Wed, 2013-05-29 at 21:12 -0400, Kevin O'Connor wrote:
> 
> I remain doubtful that QOM has all the info needed to generate the
> BIOS tables.  Does QOM describe how the 5th pci device uses global
> interrupt 11 when using global interrupts, legacy interrupt 5 when not
> using global interrupts, and that the legacy interrupt can be changed
> by writing to the 0x60 address of the 1st pci device's config space?
> Does QOM state that the machine supports S3 sleep mode?  Does QOM
> indicate that an IPMI device supports the 3rd version of the IPMI
> device specification?

Does it indicate whether this particular version of qemu has correctly
implemented the hard reset at 0xcf9? If so, we need to put that in as
the ACPI RESET_REG.

It seems that there's a *lot* which isn't fully described in the QOM
tree. Do we really want to add it all, just so that ACPI tables can be
reliably generated from it? 

As we add new types of hardware and even fix/adjust features like the
examples above, we'll also have to implement the translation from QOM to
ACPI tables. And we'll have to do so in more than one place, in projects
with a completely different release cycle. This would be *so* much
easier if the code which actually generates the ACPI tables was *in* the
qemu tree along with the "hardware" that those tables describe.

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature


Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread David Woodhouse
On Thu, 2013-05-30 at 09:20 -0700, Jordan Justen wrote:
> On Thu, May 30, 2013 at 5:19 AM, David Woodhouse 
> wrote:
> > On Thu, 2013-05-30 at 13:13 +0200, Laszlo Ersek wrote:
> >> Where is CorebootPkg available from?
> >
> > https://github.com/pgeorgi/edk2/tree/coreboot-pkg
> 
> Is the license on this actually BSD as the License.txt indicates?
> 
> Is this planned to be upstreamed?
> 
> Does this support UEFI variables?
> 
> Does this support UEFI IA32 / X64?

Those are questions for Patrick.

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature


Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Gerd Hoffmann
On 05/31/13 10:13, Peter Stuge wrote:
> Kevin O'Connor wrote:
>> one possible way forward would be to split the current SeaBIOS rom
>> into two roms: "qvmloader" and "seabios".  The "qvmloader" would do
>> the qemu specific platform init (pci init, smm init, mtrr init, bios
>> tables) and then load and run the regular seabios rom.
> 
> qvmloader sounds a lot like coreboot.

Indeed.

> ACPI bytes are obviously a function of QEMU configuration. QEMU
> configuration can be changed through a great many channels, so it
> makes sense to me that QEMU itself would take care of generating
> correct ACPI, rather than exporting it's own data structures and
> pushing the ACPI problem onto the firmware, especially considering
> the desire for multiple independent firmware implementations.

Can't agree more.

I still think the best solution is to have qemu generate the acpi tables
and all firmware can just grab them.

Second best option would be to have coreboot generate them and
everything else go on top of coreboot then.

Third best option is to duplicate the acpi generation code in all
firmware variants (this is what we have today).

IMO qvmloader would be even worse than these three.  Writing a piece of
firmware is alot more tricky than a linux userspace app, especially in
x86 land with the funky mode switching and assembler modes.

cheers,
  Gerd





Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Peter Stuge
Gerd Hoffmann wrote:
> > and pass down the
> > tables to the firmware (through a now unspecified interface -- perhaps
> > the tables could even be installed at this point).
> 
> As far I know coreboot can add more stuff such as acpi tables to cbfs at
> runtime and seabios able to access cbfs too and pull informations from
> coreboot that way.

Only a minor correction - cbfs is the flash image, which so far
doesn't really change at runtime. Stuff added at runtime goes into
"coreboot tables" which is a coreboot-specified data structure which
SeaBIOS finds and uses to know things like the memory map.

When using coreboot+SeaBIOS on real hardware, ACPI tables are built
and put in place by coreboot, and never modified by SeaBIOS AFAIK.


//Peter



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Gerd Hoffmann
  Hi,

> I guess -bios would load coreboot. Coreboot would siphon the data
> necessary for ACPI table building through the current (same) fw_cfg
> bottleneck, build the tables,

Yes.

> load the boot firmware (SeaBIOS or OVMF or
> something else -- not sure how to configure that),

The coreboot rom has named sections (this is called cbfs which stands
for coreboot filesystem IIRC):

rincewind kraxel ~# cbfstool /usr/share/coreboot.git/bios.bin print
bios.bin: 256 kB, bootblocksize 848, romsize 262144, offset 0x0
alignment: 64 bytes

Name   Offset Type Size
cmos_layout.bin0x0cmos_layout  1160
fallback/romstage  0x4c0  stage14419
fallback/coreboot_ram  0x3d80 stage37333
config 0xcfc0 raw  2493
fallback/payload   0xd9c0 payload  56969
vgabios/sgabios0x1b8c0raw  4096
(empty)0x1c900null 144216

where "fallback/payload" is seabios.

> and pass down the
> tables to the firmware (through a now unspecified interface -- perhaps
> the tables could even be installed at this point).

As far I know coreboot can add more stuff such as acpi tables to cbfs at
runtime and seabios able to access cbfs too and pull informations from
coreboot that way.

HTH,
  Gerd





Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-31 Thread Peter Stuge
Kevin O'Connor wrote:
> one possible way forward would be to split the current SeaBIOS rom
> into two roms: "qvmloader" and "seabios".  The "qvmloader" would do
> the qemu specific platform init (pci init, smm init, mtrr init, bios
> tables) and then load and run the regular seabios rom.

qvmloader sounds a lot like coreboot.


> qvmloader could be committed into the QEMU repo and maintained there.

If QEMU really doesn't want anything besides quacking like a PC with
BIOS or UEFI (such as quacking like a PC *without* a particular
firmware) it makes perfect sense to me to put the complete firmware
code into the QEMU repo and never reuse anything else. After all,
that's how the proprietary firmware products are managed.


Jordan Justen wrote:
> Why is updating the ACPI tables in seabios viewed as such a burden?

I don't know about burden but to me it just doesn't make any sense
to generate ACPI in one component (SeaBIOS) based on configuration
for another component (QEMU).

ACPI bytes are obviously a function of QEMU configuration. QEMU
configuration can be changed through a great many channels, so it
makes sense to me that QEMU itself would take care of generating
correct ACPI, rather than exporting it's own data structures and
pushing the ACPI problem onto the firmware, especially considering
the desire for multiple independent firmware implementations.

There's some code for dynamic ACPI generation in coreboot already,
maybe that can be reused in QEMU to save some effort..


> On the flip side, why is moving the ACPI tables to QEMU such an issue?

Maybe because it is such a steaming pile that even the place where it
belongs doesn't really want it..


> I think overall I prefer the tables being built in the firmware,
> despite the extra thrash.

That doesn't make sense to me. :\

Keep in mind: there is firmware and there is firmware..


> Some things, such as the addresses where devices are configured at
> are re-programmable in QEMU, so a firmware can decide to use a
> different address, and thus invalidate the address qvmloader had
> set in the tables.

..there is now talk about a first-stage firmware (qvmloader) which
does only hardware init, and then jumps into a second-stage firmware
(SeaBIOS) which starts the operating system.

I don't expect that anyone would argue for the second-stage firmware
to generate ACPI tables if the first-stage firmware would be shared
across different second-stage implementations.

The above is by the way *exactly* the model coreboot uses since 14 years.

Please make an ernest effort to *look into and try to reuse* what *is
already there* ..

The fear of coreboot is truly amazing.


//Peter



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Michael S. Tsirkin
On Thu, May 30, 2013 at 09:57:10AM -0700, Jordan Justen wrote:
> On Thu, May 30, 2013 at 9:41 AM, Laszlo Ersek  wrote:
> > On 05/30/13 18:20, Jordan Justen wrote:
> >> I think ACPI table generation lives in firmware on real products,
> >> because on real products the firmware is the point that best
> >> understands the actual hardware layout for the machine. In qemu, I
> >> would say that qemu best knows the hardware layout, given that the
> >> firmware is generally a slightly separate project from qemu.
> >>
> >> I don't think adding a coreboot layer into the picture helps, if it
> >> brings along the coreboot payload boot interface as a requirement.
> >>
> >> Then again, I don't really understand how firmware could be swapped
> >> out in this case. What would -bios do? How would the coreboot ACPI
> >> shim layer be specified to qemu?
> >
> > I guess -bios would load coreboot. Coreboot would siphon the data
> > necessary for ACPI table building through the current (same) fw_cfg
> > bottleneck, build the tables, load the boot firmware (SeaBIOS or OVMF or
> > something else -- not sure how to configure that), and pass down the
> > tables to the firmware (through a now unspecified interface -- perhaps
> > the tables could even be installed at this point). This could introduce
> > another interface (fw_cfg+something rather than just fw_cfg), but ACPI
> > table preparation would be concentrated in one project.
> >
> > I guess.
> 
> For reference, I believe that both Xen and virtualbox build ACPI table
> in the VMM rather than firmware. They both dump the tables into the
> 0xe000 segment (yuck) where firmware finds and publishes it to the OS.
> I think fw-cfg would be a reasonable alternative to this for
> communicating the tables.
> 
> -Jordan

Want to review/ack the patches I sent? That's exactly what they do.

-- 
MST



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Michael S. Tsirkin
On Thu, May 30, 2013 at 09:20:42AM -0700, Jordan Justen wrote:
> On Thu, May 30, 2013 at 5:19 AM, David Woodhouse  wrote:
> > On Thu, 2013-05-30 at 13:13 +0200, Laszlo Ersek wrote:
> >> Where is CorebootPkg available from?
> >
> > https://github.com/pgeorgi/edk2/tree/coreboot-pkg
> 
> Is the license on this actually BSD as the License.txt indicates?
> 
> Is this planned to be upstreamed?
> 
> Does this support UEFI variables?
> 
> Does this support UEFI IA32 / X64?
> 
> >> > And it helps to dispel the stupid misconception in some quarters that
> >> > Coreboot *competes* with UEFI and thus cannot possibly be supported
> >> > because helping something that competes with UEFI would be bad.
> 
> Coreboot and EDK II both provide a good infrastructure for
> initializing hardware. So, they compete on that point.
> 
> Coreboot then focuses on booting coreboot payloads, while EDK II
> focuses on UEFI support. On that point they don't compete, but the
> focus is different.
> 
> Of course, you can build a layer of EDK II => Coreboot payload
> support, or Coreboot => EDK II (CorebootPkg, I guess?), but the match
> will not be perfect. (That is not to say it can't work.)
> 
> >> I'm not sure who do you mean by "some quarters", but for some
> >> distributions Coreboot would be yet another component (package) to
> >> support, for no obvious benefit.
> >>
> >> (Gerd said it better than I possibly could:
> >> .)
> >
> > Yeah, but if we're shoving a lot of hardware-specific ACPI table
> > generation into the guest's firmware, instead of just doing it on the
> > qemu side where a number of us seem to think it belongs, then there *is*
> > a benefit to using Coreboot. When stuff changes on the qemu side and we
> > have to update the table generation to match, you end up having to
> > update just the Coreboot package, and *not* having to patch both SeaBIOS
> > and OVMF.
> 
> I think ACPI table generation lives in firmware on real products,
> because on real products the firmware is the point that best
> understands the actual hardware layout for the machine. In qemu, I
> would say that qemu best knows the hardware layout, given that the
> firmware is generally a slightly separate project from qemu.

Of course ACPI tables are firmware.
Please note that what my patches do is simply supply
templates for ACPI tables on a ROM device separate
from where bios code resides.
bios still tweaks them in minor ways.
I am guessing this is what happens on real hardware too:
most tables pre-generated in ROM, firmware shadows
them and tweaks them in minor ways.

> I don't think adding a coreboot layer into the picture helps, if it
> brings along the coreboot payload boot interface as a requirement.
> 
> Then again, I don't really understand how firmware could be swapped
> out in this case. What would -bios do? How would the coreboot ACPI
> shim layer be specified to qemu?
> 
> -Jordan



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Laszlo Ersek
On 05/30/13 18:57, Jordan Justen wrote:
> On Thu, May 30, 2013 at 9:41 AM, Laszlo Ersek  wrote:
>> On 05/30/13 18:20, Jordan Justen wrote:
>>> I think ACPI table generation lives in firmware on real products,
>>> because on real products the firmware is the point that best
>>> understands the actual hardware layout for the machine. In qemu, I
>>> would say that qemu best knows the hardware layout, given that the
>>> firmware is generally a slightly separate project from qemu.
>>>
>>> I don't think adding a coreboot layer into the picture helps, if it
>>> brings along the coreboot payload boot interface as a requirement.
>>>
>>> Then again, I don't really understand how firmware could be swapped
>>> out in this case. What would -bios do? How would the coreboot ACPI
>>> shim layer be specified to qemu?
>>
>> I guess -bios would load coreboot. Coreboot would siphon the data
>> necessary for ACPI table building through the current (same) fw_cfg
>> bottleneck, build the tables, load the boot firmware (SeaBIOS or OVMF or
>> something else -- not sure how to configure that), and pass down the
>> tables to the firmware (through a now unspecified interface -- perhaps
>> the tables could even be installed at this point). This could introduce
>> another interface (fw_cfg+something rather than just fw_cfg), but ACPI
>> table preparation would be concentrated in one project.
>>
>> I guess.
> 
> For reference, I believe that both Xen and virtualbox build ACPI table
> in the VMM rather than firmware. They both dump the tables into the
> 0xe000 segment (yuck) where firmware finds and publishes it to the OS.
> I think fw-cfg would be a reasonable alternative to this for
> communicating the tables.

I think Xen uses a separate utility called "hvmloader" that runs in the
domU.

- http://thread.gmane.org/gmane.comp.bios.coreboot.seabios/5453/focus=5668
- http://xenbits.xen.org/gitweb/?p=xen.git;a=tree;f=tools/firmware/hvmloader
- http://thread.gmane.org/gmane.comp.bios.coreboot.seabios/6255/focus=110562

Laszlo



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Jordan Justen
On Thu, May 30, 2013 at 9:41 AM, Laszlo Ersek  wrote:
> On 05/30/13 18:20, Jordan Justen wrote:
>> I think ACPI table generation lives in firmware on real products,
>> because on real products the firmware is the point that best
>> understands the actual hardware layout for the machine. In qemu, I
>> would say that qemu best knows the hardware layout, given that the
>> firmware is generally a slightly separate project from qemu.
>>
>> I don't think adding a coreboot layer into the picture helps, if it
>> brings along the coreboot payload boot interface as a requirement.
>>
>> Then again, I don't really understand how firmware could be swapped
>> out in this case. What would -bios do? How would the coreboot ACPI
>> shim layer be specified to qemu?
>
> I guess -bios would load coreboot. Coreboot would siphon the data
> necessary for ACPI table building through the current (same) fw_cfg
> bottleneck, build the tables, load the boot firmware (SeaBIOS or OVMF or
> something else -- not sure how to configure that), and pass down the
> tables to the firmware (through a now unspecified interface -- perhaps
> the tables could even be installed at this point). This could introduce
> another interface (fw_cfg+something rather than just fw_cfg), but ACPI
> table preparation would be concentrated in one project.
>
> I guess.

For reference, I believe that both Xen and virtualbox build ACPI table
in the VMM rather than firmware. They both dump the tables into the
0xe000 segment (yuck) where firmware finds and publishes it to the OS.
I think fw-cfg would be a reasonable alternative to this for
communicating the tables.

-Jordan



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Laszlo Ersek
On 05/30/13 18:20, Jordan Justen wrote:

> I think ACPI table generation lives in firmware on real products,
> because on real products the firmware is the point that best
> understands the actual hardware layout for the machine. In qemu, I
> would say that qemu best knows the hardware layout, given that the
> firmware is generally a slightly separate project from qemu.
> 
> I don't think adding a coreboot layer into the picture helps, if it
> brings along the coreboot payload boot interface as a requirement.
> 
> Then again, I don't really understand how firmware could be swapped
> out in this case. What would -bios do? How would the coreboot ACPI
> shim layer be specified to qemu?

I guess -bios would load coreboot. Coreboot would siphon the data
necessary for ACPI table building through the current (same) fw_cfg
bottleneck, build the tables, load the boot firmware (SeaBIOS or OVMF or
something else -- not sure how to configure that), and pass down the
tables to the firmware (through a now unspecified interface -- perhaps
the tables could even be installed at this point). This could introduce
another interface (fw_cfg+something rather than just fw_cfg), but ACPI
table preparation would be concentrated in one project.

I guess.

Laszlo




Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Jordan Justen
On Thu, May 30, 2013 at 5:19 AM, David Woodhouse  wrote:
> On Thu, 2013-05-30 at 13:13 +0200, Laszlo Ersek wrote:
>> Where is CorebootPkg available from?
>
> https://github.com/pgeorgi/edk2/tree/coreboot-pkg

Is the license on this actually BSD as the License.txt indicates?

Is this planned to be upstreamed?

Does this support UEFI variables?

Does this support UEFI IA32 / X64?

>> > And it helps to dispel the stupid misconception in some quarters that
>> > Coreboot *competes* with UEFI and thus cannot possibly be supported
>> > because helping something that competes with UEFI would be bad.

Coreboot and EDK II both provide a good infrastructure for
initializing hardware. So, they compete on that point.

Coreboot then focuses on booting coreboot payloads, while EDK II
focuses on UEFI support. On that point they don't compete, but the
focus is different.

Of course, you can build a layer of EDK II => Coreboot payload
support, or Coreboot => EDK II (CorebootPkg, I guess?), but the match
will not be perfect. (That is not to say it can't work.)

>> I'm not sure who do you mean by "some quarters", but for some
>> distributions Coreboot would be yet another component (package) to
>> support, for no obvious benefit.
>>
>> (Gerd said it better than I possibly could:
>> .)
>
> Yeah, but if we're shoving a lot of hardware-specific ACPI table
> generation into the guest's firmware, instead of just doing it on the
> qemu side where a number of us seem to think it belongs, then there *is*
> a benefit to using Coreboot. When stuff changes on the qemu side and we
> have to update the table generation to match, you end up having to
> update just the Coreboot package, and *not* having to patch both SeaBIOS
> and OVMF.

I think ACPI table generation lives in firmware on real products,
because on real products the firmware is the point that best
understands the actual hardware layout for the machine. In qemu, I
would say that qemu best knows the hardware layout, given that the
firmware is generally a slightly separate project from qemu.

I don't think adding a coreboot layer into the picture helps, if it
brings along the coreboot payload boot interface as a requirement.

Then again, I don't really understand how firmware could be swapped
out in this case. What would -bios do? How would the coreboot ACPI
shim layer be specified to qemu?

-Jordan



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Laszlo Ersek
On 05/30/13 14:19, David Woodhouse wrote:

> Yeah, but if we're shoving a lot of hardware-specific ACPI table
> generation into the guest's firmware, instead of just doing it on the
> qemu side where a number of us seem to think it belongs, then there *is*
> a benefit to using Coreboot. When stuff changes on the qemu side and we
> have to update the table generation to match, you end up having to
> update just the Coreboot package, and *not* having to patch both SeaBIOS
> and OVMF.
> 
> The extra package in the distro really isn't painful to handle, and I
> suspect it would end up *reducing* the amount of work that we have to do
> to update. You update *just* Coreboot, not *both* of SeaBIOS and OVMF.

I can't deny there's logic in that, but it still feels like tying
ourselves up in some intricate bondage choreography. "We'd like to move
ACPI tables out of firmware, but we can't move them to qemu due to
project direction disagreement, so let's adopt a middleman." (I'm not
trying to denigrate coreboot -- I don't know it at all --, but
introducing it in a (granted, distro-specific) stack just for this
purpose seems quite arbitrary.)

>> If you implement a private UEFI FAT driver from scratch, or port a free
>> software FAT implementation (eg. the r/o one in grub or the r/w one in
>> mtools), you could still run into legal problems, I've been told.
> 
> That has been said, and it's been said for the FAT implementation in the
> kernel too. If a distribution is happy to ship the kernel without
> ripping out its FAT support, then I see no reason why that distribution
> wouldn't also be happy to ship a version of OVMF with a clean
> implementation of FAT support. It doesn't make sense to be happy with
> one but not the other.

Under my *personal* impression, logic and Common Law don't really mix,
especially not in the US. Still under my *personal* impression, someone
might not feel convenient suing you for redistributing code that already
exists in the upstream Linux kernel, but might happily drag you to court
for an original clean implementation, and then you can explain it's
illogical for them to do so.

The best I can do with your suggestion is to take it to our legal dept.
I would be happy to work on a new FAT driver. (I used to feel
differently earlier but I've changed my mind.)


>> We need at least one out-of-tree edk2 patch for now (from you) but
>> apparently that's no problem.
> 
> That'll get merged soon. We are working on the corresponding spec
> update...

Great news!

Thanks,
Laszlo



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Michael S. Tsirkin
On Thu, May 30, 2013 at 01:19:18PM +0100, David Woodhouse wrote:
> Yeah, but if we're shoving a lot of hardware-specific ACPI table
> generation into the guest's firmware, instead of just doing it on the
> qemu side where a number of us seem to think it belongs,

Hopefully this is not yet set in stone.

> then there *is*
> a benefit to using Coreboot. When stuff changes on the qemu side and we
> have to update the table generation to match, you end up having to
> update just the Coreboot package, and *not* having to patch both SeaBIOS
> and OVMF.

We have all kind of logic in qemu. Some of it can thinkably
be moved to a separate VM - it doesn't even need to
run in the same VM as the guest - we could do it e.g. like
kvm unit-test does, with less pain than running it in firmware.
Not clear why would generating ACPI tables - which merely
fills up an array of bytes from internal QEMU
datastructures - should be the part where we start
this modularization.

-- 
MST



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread David Woodhouse
On Thu, 2013-05-30 at 13:13 +0200, Laszlo Ersek wrote:
> Where is CorebootPkg available from?

https://github.com/pgeorgi/edk2/tree/coreboot-pkg

> > And it helps to dispel the stupid misconception in some quarters that
> > Coreboot *competes* with UEFI and thus cannot possibly be supported
> > because helping something that competes with UEFI would be bad.
> 
> I'm not sure who do you mean by "some quarters", but for some
> distributions Coreboot would be yet another component (package) to
> support, for no obvious benefit.
> 
> (Gerd said it better than I possibly could:
> .)

Yeah, but if we're shoving a lot of hardware-specific ACPI table
generation into the guest's firmware, instead of just doing it on the
qemu side where a number of us seem to think it belongs, then there *is*
a benefit to using Coreboot. When stuff changes on the qemu side and we
have to update the table generation to match, you end up having to
update just the Coreboot package, and *not* having to patch both SeaBIOS
and OVMF.

The extra package in the distro really isn't painful to handle, and I
suspect it would end up *reducing* the amount of work that we have to do
to update. You update *just* Coreboot, not *both* of SeaBIOS and OVMF.

> If you implement a private UEFI FAT driver from scratch, or port a free
> software FAT implementation (eg. the r/o one in grub or the r/w one in
> mtools), you could still run into legal problems, I've been told.

That has been said, and it's been said for the FAT implementation in the
kernel too. If a distribution is happy to ship the kernel without
ripping out its FAT support, then I see no reason why that distribution
wouldn't also be happy to ship a version of OVMF with a clean
implementation of FAT support. It doesn't make sense to be happy with
one but not the other.

> We need at least one out-of-tree edk2 patch for now (from you) but
> apparently that's no problem.

That'll get merged soon. We are working on the corresponding spec
update...

> As far as I understand:
> - Jordan is nearing completion of flash support on KVM,
> - he also has WIP NvVar storage on top of qemu flash.
> 
> http://thread.gmane.org/gmane.comp.emulators.qemu/213690
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/2781/focus=2798
> 
> ("Please coordinate" I guess :))

Ooh, shiny. Yeah, when I get back to actually working on it rather than
just heckling, I'll make sure I do :)

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature


Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread Laszlo Ersek
On 05/30/13 11:23, David Woodhouse wrote:
> On Wed, 2013-05-29 at 11:18 -0500, Anthony Liguori wrote:
>>
>>> Certainly an option, but that is a long-term project.
>>
>> Out of curiousity, are there other benefits to using coreboot as a core
>> firmware in QEMU?
>>
>> Is there a payload we would ever plausibly use besides OVMF and SeaBIOS?
> 
> I like the idea of using Coreboot on the UEFI side — if the most
> actively used TianoCore platform is CorebootPkg instead of OvmfPkg, that
> makes it a lot easier for people using *real* hardware with Coreboot to
> use TianoCore.

Where is CorebootPkg available from?

> And it helps to dispel the stupid misconception in some quarters that
> Coreboot *competes* with UEFI and thus cannot possibly be supported
> because helping something that competes with UEFI would be bad.

I'm not sure who do you mean by "some quarters", but for some
distributions Coreboot would be yet another component (package) to
support, for no obvious benefit.

(Gerd said it better than I possibly could:
.)

> 
>> Is there a payload we would ever plausibly use besides OVMF and
>> SeaBIOS?
> 
> For my part I want to get to the point where the default firmware
> shipped with qemu can be OVMF.

For some distributions this is a licensing question as well. See
"FatBinPkg/License.txt". (The same applies if you rebuild it from source
(FatPkgDev), based on "FatBinPkg/ReadMe.txt".)  For example Fedora can't
ship OVMF because of it.

If you implement a UEFI FAT driver based on Microsoft's official
specification, you're bound by the same restrictions on use and
redistribution.

If you implement a private UEFI FAT driver from scratch, or port a free
software FAT implementation (eg. the r/o one in grub or the r/w one in
mtools), you could still run into legal problems, I've been told.

If you rip out the FAT driver, then OVMF won't be UEFI compliant and no
installer media will boot on it.

Interestingly, Ubuntu has OVMF in "Universe"
. I think they missed the
FatBinPkg license (I would have missed it too, after all you have to
track down the licenses of every module included in the FDF file -- it
was Paolo who told me about it) and I believe they should actually ship
OVMF in Multiverse or Restricted
.

> We have SeaBIOS-as-CSM working, which was
> one of the biggest barriers.

Agreed, and I could have never done that. Thanks for implementing it
with Kevin.

We need at least one out-of-tree edk2 patch for now (from you) but
apparently that's no problem.

> There are a few more things (like NV
> variable storage, in particular) that I need to fix before I can
> actually make that suggestion with a straight face though...

As far as I understand:
- Jordan is nearing completion of flash support on KVM,
- he also has WIP NvVar storage on top of qemu flash.

http://thread.gmane.org/gmane.comp.emulators.qemu/213690
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/2781/focus=2798

("Please coordinate" I guess :))

Laszlo



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-30 Thread David Woodhouse
On Wed, 2013-05-29 at 11:18 -0500, Anthony Liguori wrote:
> 
> > Certainly an option, but that is a long-term project.
> 
> Out of curiousity, are there other benefits to using coreboot as a core
> firmware in QEMU?
> 
> Is there a payload we would ever plausibly use besides OVMF and SeaBIOS?

I like the idea of using Coreboot on the UEFI side — if the most
actively used TianoCore platform is CorebootPkg instead of OvmfPkg, that
makes it a lot easier for people using *real* hardware with Coreboot to
use TianoCore.

And it helps to dispel the stupid misconception in some quarters that
Coreboot *competes* with UEFI and thus cannot possibly be supported
because helping something that competes with UEFI would be bad.

> Is there a payload we would ever plausibly use besides OVMF and
> SeaBIOS?

For my part I want to get to the point where the default firmware
shipped with qemu can be OVMF. We have SeaBIOS-as-CSM working, which was
one of the biggest barriers. There are a few more things (like NV
variable storage, in particular) that I need to fix before I can
actually make that suggestion with a straight face though...

-- 
dwmw2



smime.p7s
Description: S/MIME cryptographic signature


Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Gerd Hoffmann
  Hi,

>>> Raised
>>> that QOM interface should be sufficient.
>>
>> Agree on this one.  Ideally the acpi table generation code should be
>> able to gather all information it needs from the qom tree, so it can be
>> a standalone C file instead of being scattered over all qemu.
> 
> Ack.  So my basic argument is why not expose the QOM interfaces to
> firmware and move the generation code there?  Seems like it would be
> more or less a copy/paste once we had a proper implementation in QEMU.

Well, no.  Firmware is a quite simple environment without standard libc
etc, so moving code from qemu to firmware certainly isn't as easy as
copying over a file.

>>> There were discussions on potentially introducing a middle component
>>> to generate the tables.  Coreboot was raised as a possibility, and
>>> David thought it would be okay to use coreboot for both OVMF and
>>> SeaBIOS.
>>
>> Certainly an option, but that is a long-term project.
> 
> Out of curiousity, are there other benefits to using coreboot as a core
> firmware in QEMU?

Short-term it's alot of work as we have to bring coreboot's qemu support
to feature parity with seabios.  I suspect most of this is acpi related
though, so when qemu provides the tables and coreboot uses them we could
be pretty close already.

Long-term it should simplify firmware maintainance as we have only *one*
place which handles the hardware bringup, and seabios/ovmf have less
work to do.

> Is there a payload we would ever plausibly use besides OVMF and SeaBIOS?

I wouldn't be surprised if people start using other coreboot payloads
and/or features such as direct linux kernel boot once it works well on qemu.

We might even run qemu test suites as coreboot payload.

cheers,
  Gerd





Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Kevin O'Connor
On Wed, May 29, 2013 at 11:18:03AM -0500, Anthony Liguori wrote:
> Gerd Hoffmann  writes:
> > On 05/29/13 01:53, Kevin O'Connor wrote:
> >> Raised
> >> that QOM interface should be sufficient.
> >
> > Agree on this one.  Ideally the acpi table generation code should be
> > able to gather all information it needs from the qom tree, so it can be
> > a standalone C file instead of being scattered over all qemu.
> 
> Ack.  So my basic argument is why not expose the QOM interfaces to
> firmware and move the generation code there?

I remain doubtful that QOM has all the info needed to generate the
BIOS tables.  Does QOM describe how the 5th pci device uses global
interrupt 11 when using global interrupts, legacy interrupt 5 when not
using global interrupts, and that the legacy interrupt can be changed
by writing to the 0x60 address of the 1st pci device's config space?
Does QOM state that the machine supports S3 sleep mode?  Does QOM
indicate that an IPMI device supports the 3rd version of the IPMI
device specification?

I don't see how exporting QOM to the firmware will help.  I predict we
would continue to see most of the BIOS tables hardcoded in the
firmware and that all but the most minor changes to those tables would
require synchronizing code patches to both QEMU and the firmware.  I
also suspect we would end up adding fields to QOM that only the BIOS
tables cared about, and that ever increasing code would be needed in
both QEMU and the firmware to juggle to/from QOM so that the BIOS
tables could be created.

-Kevin



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 07:28:05PM +0300, Michael S. Tsirkin wrote:
> Because that's just insanely rick interface

s/rick/rich/. Sorry about the typo.



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Markus Armbruster
Anthony Liguori  writes:

> Gerd Hoffmann  writes:
>
>> On 05/29/13 01:53, Kevin O'Connor wrote:
>>> On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
 Juan is not available now, and Anthony asked for
 agenda to be sent early.
 So here comes:

 Agenda for the meeting Tue, May 28:

 - Generating acpi tables
>>> 
>>> I didn't see any meeting notes, but I thought it would be worthwhile
>>> to summarize the call.  This is from memory so correct me if I got
>>> anything wrong.
>>> 
>>> Anthony believes that the generation of ACPI tables is the task of the
>>> firmware.  Reasons cited include security implications of running more
>>> code in qemu vs the guest context,
>>
>> I fail to see the security issues here.  It's not like the apci table
>> generation code operates on untrusted input from the guest ...
>
> But possibly untrusted input from a malicious user.  You can imagine
> something like a IaaS provider that let's a user input arbitrary values
> for memory, number of nics, etc.
>
> It's a stretch of an example, I agree, but the general principle I think
> is sound:  we should push as much work as possible to the least
> privileged part of the stack.  In this case, firmware has much less
> privileges than QEMU.

Firmware runs in a primitive, unforgiving environment, and should do as
little as humanly possible.  For an instructive example of deviating
from that rule, check out UEFI.

[...]



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 11:18:03AM -0500, Anthony Liguori wrote:
> Gerd Hoffmann  writes:
> 
> > On 05/29/13 01:53, Kevin O'Connor wrote:
> >> On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
> >>> Juan is not available now, and Anthony asked for
> >>> agenda to be sent early.
> >>> So here comes:
> >>>
> >>> Agenda for the meeting Tue, May 28:
> >>>
> >>> - Generating acpi tables
> >> 
> >> I didn't see any meeting notes, but I thought it would be worthwhile
> >> to summarize the call.  This is from memory so correct me if I got
> >> anything wrong.
> >> 
> >> Anthony believes that the generation of ACPI tables is the task of the
> >> firmware.  Reasons cited include security implications of running more
> >> code in qemu vs the guest context,
> >
> > I fail to see the security issues here.  It's not like the apci table
> > generation code operates on untrusted input from the guest ...
> 
> But possibly untrusted input from a malicious user.  You can imagine
> something like a IaaS provider that let's a user input arbitrary values
> for memory, number of nics, etc.
> 
> It's a stretch of an example, I agree, but the general principle I think
> is sound:  we should push as much work as possible to the least
> privileged part of the stack.  In this case, firmware has much less
> privileges than QEMU.

It's a big stretch. We have to draw the line somewhere, and I think
when *all* firmware people tell us that QEMU is a pain to work
with and should just supply ACPI table to BIOS, that line
has been crossed.

> >> complexities in running iasl on
> >> big-endian machines,
> >
> > We already have a bunch of prebuilt blobs in the qemu repo for simliar
> > reasons, we can do that with iasl output too.
> >
> >> possible complexity of having to regenerate
> >> tables on a vm reboot,
> >
> > Why tables should be regenerated at reboot?  I remember hotplug being
> > mentioned in the call.  Hmm?  Which hotplugged component needs acpi
> > table updates to work properly?  And what is the point of hotplugging if
> > you must reboot the guest anyway to get the acpi updates needed?
> > Details please.
> 
> See my response to Michael.
> 
> > Also mentioned in the call: "architectural reasons", which I understand
> > as "real hardware works that way".  Correct.  But qemu's virtual
> > hardware is configurable in more ways than real hardware, so we have
> > different needs.  For example: pci slots can or can't be hotpluggable.
> > On real hardware this is fixed.  IIRC this is one of the reasons why we
> > have to patch acpi tables.
> 
> It's not really fixed.  Hardware supports PCI expansion chassises.

These normally aren't reported in ACPI, so no hotplug,
or only native hotplug.

> Multi-node NUMA systems also affect the ACPI tables.

In a very minor way.

> >> overall sloppiness of doing it in QEMU.
> >
> > /me gets the feeling that this is the *main* reason, given that the
> > other ones don't look very convincing to me.
> >
> >> Raised
> >> that QOM interface should be sufficient.
> >
> > Agree on this one.  Ideally the acpi table generation code should be
> > able to gather all information it needs from the qom tree, so it can be
> > a standalone C file instead of being scattered over all qemu.
> 
> Ack.  So my basic argument is why not expose the QOM interfaces to
> firmware and move the generation code there?  Seems like it would be
> more or less a copy/paste once we had a proper implementation in QEMU.

Because that's just insanely rick interface we have no chance to
keep stable across versions.
Because it's a ton of QEMU specific firmware.
Because firmware devs don't want to maintain the ACPI that *is* there either.

> >> There were discussions on potentially introducing a middle component
> >> to generate the tables.  Coreboot was raised as a possibility, and
> >> David thought it would be okay to use coreboot for both OVMF and
> >> SeaBIOS.
> >
> > Certainly an option, but that is a long-term project.
> 
> Out of curiousity, are there other benefits to using coreboot as a core
> firmware in QEMU?
> 
> Is there a payload we would ever plausibly use besides OVMF and SeaBIOS?
> 
> Regards,
> 
> Anthony Liguori

The easier it is to switch firmware the better.

Gives us choice, we switched firmware several times,
we will do it again.

If firmware only has a simple loader for QEMU specific
stuff and is mostly generic, then it's easy.
If there's a lot of code for walking QOM, etc - it's
very painful.

-- 
MST



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Anthony Liguori
Gerd Hoffmann  writes:

> On 05/29/13 01:53, Kevin O'Connor wrote:
>> On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
>>> Juan is not available now, and Anthony asked for
>>> agenda to be sent early.
>>> So here comes:
>>>
>>> Agenda for the meeting Tue, May 28:
>>>
>>> - Generating acpi tables
>> 
>> I didn't see any meeting notes, but I thought it would be worthwhile
>> to summarize the call.  This is from memory so correct me if I got
>> anything wrong.
>> 
>> Anthony believes that the generation of ACPI tables is the task of the
>> firmware.  Reasons cited include security implications of running more
>> code in qemu vs the guest context,
>
> I fail to see the security issues here.  It's not like the apci table
> generation code operates on untrusted input from the guest ...

But possibly untrusted input from a malicious user.  You can imagine
something like a IaaS provider that let's a user input arbitrary values
for memory, number of nics, etc.

It's a stretch of an example, I agree, but the general principle I think
is sound:  we should push as much work as possible to the least
privileged part of the stack.  In this case, firmware has much less
privileges than QEMU.

>> complexities in running iasl on
>> big-endian machines,
>
> We already have a bunch of prebuilt blobs in the qemu repo for simliar
> reasons, we can do that with iasl output too.
>
>> possible complexity of having to regenerate
>> tables on a vm reboot,
>
> Why tables should be regenerated at reboot?  I remember hotplug being
> mentioned in the call.  Hmm?  Which hotplugged component needs acpi
> table updates to work properly?  And what is the point of hotplugging if
> you must reboot the guest anyway to get the acpi updates needed?
> Details please.

See my response to Michael.

> Also mentioned in the call: "architectural reasons", which I understand
> as "real hardware works that way".  Correct.  But qemu's virtual
> hardware is configurable in more ways than real hardware, so we have
> different needs.  For example: pci slots can or can't be hotpluggable.
> On real hardware this is fixed.  IIRC this is one of the reasons why we
> have to patch acpi tables.

It's not really fixed.  Hardware supports PCI expansion chassises.
Multi-node NUMA systems also affect the ACPI tables.

>> overall sloppiness of doing it in QEMU.
>
> /me gets the feeling that this is the *main* reason, given that the
> other ones don't look very convincing to me.
>
>> Raised
>> that QOM interface should be sufficient.
>
> Agree on this one.  Ideally the acpi table generation code should be
> able to gather all information it needs from the qom tree, so it can be
> a standalone C file instead of being scattered over all qemu.

Ack.  So my basic argument is why not expose the QOM interfaces to
firmware and move the generation code there?  Seems like it would be
more or less a copy/paste once we had a proper implementation in QEMU.

>> There were discussions on potentially introducing a middle component
>> to generate the tables.  Coreboot was raised as a possibility, and
>> David thought it would be okay to use coreboot for both OVMF and
>> SeaBIOS.
>
> Certainly an option, but that is a long-term project.

Out of curiousity, are there other benefits to using coreboot as a core
firmware in QEMU?

Is there a payload we would ever plausibly use besides OVMF and SeaBIOS?

Regards,

Anthony Liguori



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 11:42:34AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> >>> possible complexity of having to regenerate
> >>> tables on a vm reboot,
> >>
> >> Why tables should be regenerated at reboot?  I remember hotplug being
> >> mentioned in the call.  Hmm?  Which hotplugged component needs acpi
> >> table updates to work properly?  And what is the point of hotplugging if
> >> you must reboot the guest anyway to get the acpi updates needed?
> >> Details please.
> > 
> > I think it's a mistake. I sent a mail explaining this part.
> 
> Saw it meanwhile.
> 
> >> Also mentioned in the call: "architectural reasons", which I understand
> >> as "real hardware works that way".  Correct.
> > 
> > Not exactly. Real hardware is very likely to have
> > most of the tables pre-generated in ROM, load
> > them and tweak them in the minor way.
> 
> >From a quick look it seems coreboot has a static (iasl-compiled) dsdt
> and generates everything else.
> 
> http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/mainboard/emulation/qemu-x86/acpi_tables.c
> 
> >> Agree on this one.  Ideally the acpi table generation code should be
> >> able to gather all information it needs from the qom tree, so it can be
> >> a standalone C file instead of being scattered over all qemu.
> > 
> > Did you look at the patchset I posted?
> 
> Very briefly only.
> 
> > Generation is in a standalone C file there.
> 
> Good.
> 
> > However, if you mean we should do things like
> > 
> > if (Device_id == foobar) {
> > }
> > in once central place, I disagree.
> > I think that's nasty, adding devices would
> > mean touching this central registry.
> 
> No, I mean more "lookup PIIX4_PM object + check disable_s3 property"
> instead of having code for it in hw/acpi/piix4.c or using global variables.
> 
> cheers,
>   Gerd

So that would make code PIIX specific.
Instead I'm passing in guest_info structure to each object
and that describes itself, e.g. sets disable_s3.

-- 
MST



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Gerd Hoffmann
  Hi,

>>> possible complexity of having to regenerate
>>> tables on a vm reboot,
>>
>> Why tables should be regenerated at reboot?  I remember hotplug being
>> mentioned in the call.  Hmm?  Which hotplugged component needs acpi
>> table updates to work properly?  And what is the point of hotplugging if
>> you must reboot the guest anyway to get the acpi updates needed?
>> Details please.
> 
> I think it's a mistake. I sent a mail explaining this part.

Saw it meanwhile.

>> Also mentioned in the call: "architectural reasons", which I understand
>> as "real hardware works that way".  Correct.
> 
> Not exactly. Real hardware is very likely to have
> most of the tables pre-generated in ROM, load
> them and tweak them in the minor way.

>From a quick look it seems coreboot has a static (iasl-compiled) dsdt
and generates everything else.

http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/mainboard/emulation/qemu-x86/acpi_tables.c

>> Agree on this one.  Ideally the acpi table generation code should be
>> able to gather all information it needs from the qom tree, so it can be
>> a standalone C file instead of being scattered over all qemu.
> 
> Did you look at the patchset I posted?

Very briefly only.

> Generation is in a standalone C file there.

Good.

> However, if you mean we should do things like
> 
> if (Device_id == foobar) {
> }
> in once central place, I disagree.
> I think that's nasty, adding devices would
> mean touching this central registry.

No, I mean more "lookup PIIX4_PM object + check disable_s3 property"
instead of having code for it in hw/acpi/piix4.c or using global variables.

cheers,
  Gerd





Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 10:49:27AM +0200, Gerd Hoffmann wrote:
> On 05/29/13 01:53, Kevin O'Connor wrote:
> > On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
> >> Juan is not available now, and Anthony asked for
> >> agenda to be sent early.
> >> So here comes:
> >>
> >> Agenda for the meeting Tue, May 28:
> >>
> >> - Generating acpi tables
> > 
> > I didn't see any meeting notes, but I thought it would be worthwhile
> > to summarize the call.  This is from memory so correct me if I got
> > anything wrong.
> > 
> > Anthony believes that the generation of ACPI tables is the task of the
> > firmware.  Reasons cited include security implications of running more
> > code in qemu vs the guest context,
> 
> I fail to see the security issues here.  It's not like the apci table
> generation code operates on untrusted input from the guest ...
> 
> > complexities in running iasl on
> > big-endian machines,
> 
> We already have a bunch of prebuilt blobs in the qemu repo for simliar
> reasons, we can do that with iasl output too.
> 
> > possible complexity of having to regenerate
> > tables on a vm reboot,
> 
> Why tables should be regenerated at reboot?  I remember hotplug being
> mentioned in the call.  Hmm?  Which hotplugged component needs acpi
> table updates to work properly?  And what is the point of hotplugging if
> you must reboot the guest anyway to get the acpi updates needed?
> Details please.

I think it's a mistake. I sent a mail explaining this part.

> Also mentioned in the call: "architectural reasons", which I understand
> as "real hardware works that way".  Correct.

Not exactly. Real hardware is very likely to have
most of the tables pre-generated in ROM, load
them and tweak them in the minor way.

That's exactly what patches I sent do.

>  But qemu's virtual
> hardware is configurable in more ways than real hardware, so we have
> different needs.  For example: pci slots can or can't be hotpluggable.
> On real hardware this is fixed.  IIRC this is one of the reasons why we
> have to patch acpi tables.
> 
> > overall sloppiness of doing it in QEMU.
> 
> /me gets the feeling that this is the *main* reason, given that the
> other ones don't look very convincing to me.
> 
> > Raised
> > that QOM interface should be sufficient.
> 
> Agree on this one.  Ideally the acpi table generation code should be
> able to gather all information it needs from the qom tree, so it can be
> a standalone C file instead of being scattered over all qemu.

Did you look at the patchset I posted?
Generation is in a standalone C file there.


However, if you mean we should do things like

if (Device_id == foobar) {
}

in once central place, I disagree.
I think that's nasty, adding devices would
mean touching this central registry.


> > There were discussions on potentially introducing a middle component
> > to generate the tables.  Coreboot was raised as a possibility, and
> > David thought it would be okay to use coreboot for both OVMF and
> > SeaBIOS.
> 
> Certainly an option, but that is a long-term project.
> 
> > The possibility was also raised of a "rom" that lives in the
> > qemu repo, is run in the guest, and generates the tables (which is
> > similar to the hvmloader approach that Xen uses).
> 
> Also simliar to the coreboot idea.
> 
> Also in the call: The idea of having some library for acpi table
> generation provided by qemu which the firmware can use.  Has license
> compatibility issues.  Also difficult due to the fact that there is no
> libc in firmware, so such a library would need firmware-specific
> abstraction layers even for simple stuff such as memory allocation.
> 
> > Anthony requested that patches be made that generate the ACPI tables
> > in QEMU for the upcoming hotplug work, so that they could be evaluated
> > to see if they truly do need to live in QEMU or if the code could live
> > in the firmware.
> 
> Good.  I think having qemu generate the tables is also quite useful for
> evaluating the move to coreboot:
> 
>   (1)  make qemu generate the acpi tables.
>   (2a) make seabios use the qemu-generated tables.
>   (2b) make ovmf use the qemu-generated tables.
>   (2c) make coreboot use the qemu-generated tables.
> 
> Now we can look where we stand when using coreboot+seabios or
> coreboot+tianocore compared to bare seabios / bare ovmf.  I expect there
> are quite a few things to fix until the coreboot+seabios combo runs
> without regressions compared to bare seabios.  But maybe not when qemu
> provides the acpi tables to coreboot.
> 
> In case the coreboot testdrive works out well we can continue with:
> 
>   (3)  use coreboot+seabios by default.
>   (4)  move acpi table generation from qemu to coreboot.
> 
> cheers,
>   Gerd
> 



Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-29 Thread Gerd Hoffmann
On 05/29/13 01:53, Kevin O'Connor wrote:
> On Thu, May 23, 2013 at 03:41:32PM +0300, Michael S. Tsirkin wrote:
>> Juan is not available now, and Anthony asked for
>> agenda to be sent early.
>> So here comes:
>>
>> Agenda for the meeting Tue, May 28:
>>
>> - Generating acpi tables
> 
> I didn't see any meeting notes, but I thought it would be worthwhile
> to summarize the call.  This is from memory so correct me if I got
> anything wrong.
> 
> Anthony believes that the generation of ACPI tables is the task of the
> firmware.  Reasons cited include security implications of running more
> code in qemu vs the guest context,

I fail to see the security issues here.  It's not like the apci table
generation code operates on untrusted input from the guest ...

> complexities in running iasl on
> big-endian machines,

We already have a bunch of prebuilt blobs in the qemu repo for simliar
reasons, we can do that with iasl output too.

> possible complexity of having to regenerate
> tables on a vm reboot,

Why tables should be regenerated at reboot?  I remember hotplug being
mentioned in the call.  Hmm?  Which hotplugged component needs acpi
table updates to work properly?  And what is the point of hotplugging if
you must reboot the guest anyway to get the acpi updates needed?
Details please.

Also mentioned in the call: "architectural reasons", which I understand
as "real hardware works that way".  Correct.  But qemu's virtual
hardware is configurable in more ways than real hardware, so we have
different needs.  For example: pci slots can or can't be hotpluggable.
On real hardware this is fixed.  IIRC this is one of the reasons why we
have to patch acpi tables.

> overall sloppiness of doing it in QEMU.

/me gets the feeling that this is the *main* reason, given that the
other ones don't look very convincing to me.

> Raised
> that QOM interface should be sufficient.

Agree on this one.  Ideally the acpi table generation code should be
able to gather all information it needs from the qom tree, so it can be
a standalone C file instead of being scattered over all qemu.

> There were discussions on potentially introducing a middle component
> to generate the tables.  Coreboot was raised as a possibility, and
> David thought it would be okay to use coreboot for both OVMF and
> SeaBIOS.

Certainly an option, but that is a long-term project.

> The possibility was also raised of a "rom" that lives in the
> qemu repo, is run in the guest, and generates the tables (which is
> similar to the hvmloader approach that Xen uses).

Also simliar to the coreboot idea.

Also in the call: The idea of having some library for acpi table
generation provided by qemu which the firmware can use.  Has license
compatibility issues.  Also difficult due to the fact that there is no
libc in firmware, so such a library would need firmware-specific
abstraction layers even for simple stuff such as memory allocation.

> Anthony requested that patches be made that generate the ACPI tables
> in QEMU for the upcoming hotplug work, so that they could be evaluated
> to see if they truly do need to live in QEMU or if the code could live
> in the firmware.

Good.  I think having qemu generate the tables is also quite useful for
evaluating the move to coreboot:

  (1)  make qemu generate the acpi tables.
  (2a) make seabios use the qemu-generated tables.
  (2b) make ovmf use the qemu-generated tables.
  (2c) make coreboot use the qemu-generated tables.

Now we can look where we stand when using coreboot+seabios or
coreboot+tianocore compared to bare seabios / bare ovmf.  I expect there
are quite a few things to fix until the coreboot+seabios combo runs
without regressions compared to bare seabios.  But maybe not when qemu
provides the acpi tables to coreboot.

In case the coreboot testdrive works out well we can continue with:

  (3)  use coreboot+seabios by default.
  (4)  move acpi table generation from qemu to coreboot.

cheers,
  Gerd





Re: [Qemu-devel] [SeaBIOS] KVM call agenda for 2013-05-28

2013-05-23 Thread li guang
在 2013-05-23四的 15:41 +0300,Michael S. Tsirkin写道:
> Juan is not available now, and Anthony asked for
> agenda to be sent early.
> So here comes:
> 
> Agenda for the meeting Tue, May 28:
> 
> - Generating acpi tables
> 
> - Switching the call to a bi-weekly schedule
> 
> Please, send any topic that you are interested in covering.

"add ACPI Embedded Controller"

it can work as an event carrier, so ACPI events 
can be passed between platform(like QEMU emulated)
and OS, OS can execute _Qxx method which defined
by yourself.
this mechanism can be very flexible, and you can
avoid bothering to create some special devices
for QEMU and drivers for linux kernel.
I don't have many examples,
e.g. CPU hotplug,
we can pass hotplug event by _Qxx method, and,
Embedded Controller driver of linux kernel can
get this event, so, it can trigger cpu_up process,
and you'll don't need 
"echo 1 > /sys/devices/system/cpu/cpu1/online"

may you think of it,

Thanks!