From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR Date: Thu, 6 Jun 2013 09:34:33 +0300 Message-ID: <20130606063432.GQ4725@redhat.com> References: <87ehcgr3wq.fsf@codemonkey.ws> <20130605151953.GA25987@redhat.com> <87bo7ktvaw.fsf@codemonkey.ws> <20130605162029.GB26561@redhat.com> <51AFA92B.2030203@zytor.com> <87fvwwmdmf.fsf@codemonkey.ws> <51AFB3DD.1050902@zytor.com> <874ndcb47i.fsf@codemonkey.ws> <51AFC4A6.6070607@zytor.com> <877gi8nk9e.fsf@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <877gi8nk9e.fsf@codemonkey.ws> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Anthony Liguori Cc: Peter Maydell , kvm@vger.kernel.org, "Michael S. Tsirkin" , virtualization@lists.linux-foundation.org, Stefan Hajnoczi , "H. Peter Anvin" , Paolo Bonzini , KONRAD Frederic List-Id: virtualization@lists.linuxfoundation.org On Wed, Jun 05, 2013 at 07:41:17PM -0500, Anthony Liguori wrote: > "H. Peter Anvin" writes: > > > On 06/05/2013 03:08 PM, Anthony Liguori wrote: > >>> > >>> Definitely an option. However, we want to be able to boot from native > >>> devices, too, so having an I/O BAR (which would not be used by the OS > >>> driver) should still at the very least be an option. > >> > >> What makes it so difficult to work with an MMIO bar for PCI-e? > >> > >> With legacy PCI, tracking allocation of MMIO vs. PIO is pretty straight > >> forward. Is there something special about PCI-e here? > >> > > > > It's not tracking allocation. It is that accessing memory above 1 MiB > > is incredibly painful in the BIOS environment, which basically means > > MMIO is inaccessible. > > Oh, you mean in real mode. > > SeaBIOS runs the virtio code in 32-bit mode with a flat memory layout. > There are loads of ASSERT32FLAT()s in the code to make sure of this. > Well, not exactly. Initialization is done in 32bit, but disk reads/writes are done in 16bit mode since it should work from int13 interrupt handler. The only way I know to access MMIO bars from 16 bit is to use SMM which we do not have in KVM. -- Gleb.