qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: Kevin O'Connor <kevin@koconnor.net>
Cc: Gal Hammer <ghammer@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	seabios@seabios.org, qemu-devel@nongnu.org,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] piix: do not reset APIC base address (0x80) on piix4_reset.
Date: Thu, 19 Dec 2013 20:03:15 +0200	[thread overview]
Message-ID: <1387476195.28388.4.camel@localhost.localdomain> (raw)
In-Reply-To: <20131219160650.GA15329@morn.localdomain>

On Thu, 2013-12-19 at 11:06 -0500, Kevin O'Connor wrote:
> On Wed, Dec 18, 2013 at 06:55:24PM +0200, Marcel Apfelbaum wrote:
> > On Wed, 2013-12-18 at 11:34 -0500, Paolo Bonzini wrote:
> > > Or put an array of (bdf, offset, size, value) tuples somewhere in low memory,
> > > fill it at startup, and reproduce it blindly at S3 resume time.  This is similar
> > > to what UEFI does.
> > Could you please elaborate a little more?
> > Let me see first if I understand the problem:
> > PciDevices list is a list of pointers that cannot be used
> > inside init code which is 16 bit code, right?
> 
> FYI, all the code at this point is 32bit code.  Both the SeaBIOS init
> code (aka POST) and the SeaBIOS resume code run in 32bit mode.
> 
> The problem is that SeaBIOS has ownership of all ram during its
> initialization phase, but it must release ownership during its runtime
> phase.  (During the runtime phase, the OS has ownership of the bulk of
> ram and SeaBIOS only has a tiny fraction that it reserves.)  The PCI
> device cache that SeaBIOS builds is not placed in reserved memory, and
> that's why it is marked as VARVERIFY32INIT.  It's to try and prevent
> pointers that no longer point to valid memory from being accessed
> after the init phase has completed.
> 
> The error it produces is correct - one must not access the pci_device
> structs from the resume code in the current code.
Thank you Kevin for the detailed explanation! By the way, do you know
how this fraction is allocated by Seabios and how can one "decide" to move
the device cache to this region reserved by the BIOS ? (not that I want to,
but to understand how Seabios does this)

Thanks again!
Marcel

> 
> > If I got it right, the solution is to find another way to iterate
> > over pci devices? If yes, *when* would this data be put in memory and "when"?
> > A pointer to the right direction would be appreciated,
> 
> A good question.  I'll take a look at Michael's patch.

> 
> -Kevin

  reply	other threads:[~2013-12-19 18:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  9:21 [Qemu-devel] [PATCH] piix: do not reset APIC base address (0x80) on piix4_reset Gal Hammer
2013-12-11 10:23 ` Paolo Bonzini
2013-12-11 10:44   ` Michael S. Tsirkin
2013-12-11 11:04     ` Gal Hammer
2013-12-18 14:19       ` Paolo Bonzini
2013-12-18 15:16         ` Gal Hammer
2013-12-18 21:57         ` Laszlo Ersek
2013-12-18 14:22 ` Paolo Bonzini
2013-12-18 15:22   ` Michael S. Tsirkin
2013-12-18 16:27     ` Marcel Apfelbaum
2013-12-18 16:33       ` Michael S. Tsirkin
2013-12-18 16:34         ` Paolo Bonzini
2013-12-18 16:55           ` Marcel Apfelbaum
2013-12-18 17:21             ` Michael S. Tsirkin
2013-12-19 16:06             ` Kevin O'Connor
2013-12-19 18:03               ` Marcel Apfelbaum [this message]
2013-12-19 18:17                 ` Kevin O'Connor
2013-12-18 16:58           ` Michael S. Tsirkin
2013-12-18 22:10           ` Laszlo Ersek
2013-12-18 22:16             ` Laszlo Ersek
2013-12-18 23:43             ` Paolo Bonzini
2013-12-18 16:49         ` Marcel Apfelbaum
2013-12-18 17:20           ` Michael S. Tsirkin
2013-12-19  9:37             ` Marcel Apfelbaum
2013-12-19  9:49               ` Marcel Apfelbaum
2013-12-19 10:35                 ` Michael S. Tsirkin
2013-12-18 15:59   ` Gal Hammer
2013-12-18 16:00     ` Paolo Bonzini

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=1387476195.28388.4.camel@localhost.localdomain \
    --to=marcel.a@redhat.com \
    --cc=ghammer@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /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).