qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Marc Marí" <markmb@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	"Gabriel L. Somlo" <somlo@cmu.edu>,
	qemu-devel@nongnu.org, Kevin O'Connor <kevin@koconnor.net>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, Laszlo <lersek@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] Add optionrom compatible with fw_cfg DMA version
Date: Tue, 19 Jan 2016 13:11:47 +0100	[thread overview]
Message-ID: <1453205507.18326.61.camel@redhat.com> (raw)
In-Reply-To: <20160118172209.1c165640@markmb_rh>

  Hi,

> > > +    if (fw_cfg_dma_enabled(fw_cfg)) {
> > > +        option_rom[nb_option_roms].name = "linuxboot_dma.bin";
> > > +        option_rom[nb_option_roms].bootindex = 0;
> > > +    } else {
> > > +        option_rom[nb_option_roms].name = "linuxboot.bin";
> > > +        option_rom[nb_option_roms].bootindex = 0;
> > > +    }  
> > 
> > Live migration compatibility requires that guest-visible changes to
> > the machine are only introduced in a new -machine <machine-type>.

> > I've CCed Gerd and Juan, I think they know how changes to Option ROMs
> > affect live migration better than me.  What needs to be done to
> > preserve live migration compatibility?
> 
> They are CC'd now :)

I think we are fine here.  The dma interface is enabled for new machine
types only, thats why we have fw_cfg_dma_enabled() in the first place ;)

> > Was there a technical reason why linuxboot.S cannot be extended
> > (e.g.  a size limit)?
> 
> I don't think there's a technical reason. It is a lot simpler to write
> the fw_cfg DMA stuff in C. To extend linuxboot.S these things should be
> modified:
>  - Add fw_cfg DMA detection support
>  - Change read_fw from a macro to a function that checks for fw_cfg DMA
>    support and does the operation using IO or memory
>  - Extract bits and pieces from linuxboot.S into functions, that are
>    only necessary when there is no support for fw_cfg DMA (the most
>    important is jumping to 32 bits to read and copy the kernel).
> 
> This way, you check for support from the very beggining (when
> configuring the machine), and you don't have to branch the code
> anymore.
> 
> (I think I discussed this with somebody in the past. But I'm not sure
> with whom, or when. So I'll suppose it was a dream and it is not on the
> archives).

Could have been /me.

The fw_cfg macros in linuxboot.S are messy, looks like because they got
extended a few times.  Piling DMA support on top of that didn't look
very appealing to me.

Also DMA support simplifies things, there is no need to switch processor
modes to load the kernel above 1M.

> If you really think they should be merged, I'd even propose to
> merge the ASM version onto the C version (convert this patch into
> linuxboot.S). This slightly improves readability.

Fully agree.  I'm personally fine with having two roms, but when merging
them into one we surely should ditch the fw_cfg asm macros and go with
something more maintainable.

cheers,
  Gerd

  parent reply	other threads:[~2016-01-19 12:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  9:59 [Qemu-devel] [PATCH v2] Add optionrom compatible with fw_cfg DMA version Marc Marí
2016-01-18 10:38 ` Paolo Bonzini
2016-01-18 14:42 ` Stefan Hajnoczi
2016-01-18 16:22   ` Marc Marí
2016-01-18 17:10     ` Kevin O'Connor
2016-01-19 12:11     ` Gerd Hoffmann [this message]
2016-01-21 10:02       ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453205507.18326.61.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=lersek@redhat.com \
    --cc=markmb@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=somlo@cmu.edu \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).