[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [RFC PATCH 07/10] spapr_pci: Allow PCI host bridge DMA wi

From: David Gibson
Subject: Re: [Qemu-ppc] [RFC PATCH 07/10] spapr_pci: Allow PCI host bridge DMA window to be configured
Date: Tue, 6 Oct 2015 15:18:56 +1100
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Oct 06, 2015 at 02:25:07PM +1100, David Gibson wrote:
> On Mon, Oct 05, 2015 at 04:13:30PM +0200, Paolo Bonzini wrote:
> > 
> > 
> > On 03/10/2015 02:25, Alexey Kardashevskiy wrote:
> > >> I think this is the aim of VMSTATE_UINT64_EQUAL() ?
> > > 
> > > We use it only for things which cannot be set via the command line
> > > and ideally there should be no VMSTATE_*_EQUAL. If something can be
> > > set via the command line, then the management software (read -
> > > libvirt) runs QEMU with explicit parameters to guarantee that these
> > > are equal.
> > 
> > VMSTATE_*_EQUAL is used when a value is later used as e.g. the size of
> > an array.  It basically provides bounds checking for the subsequent
> > array, avoiding that an invalid migration file or an error issuing the
> > QEMU command on the destination transforms into a buffer overflow.
> > 
> > Michael Roth did most of this work, IIRC.  Documenting it in
> > docs/migration.txt would be nice.
> Ah.. which means we probably should use VMSTATE_*_EQUAL here since the
> window size determines the size of the array of actual TCEs to follow
> shortly.

Wait.. no we don't.

The vmstate for the sPAPRTCETable object which actually holds the
IOMMU page table information already has a suitable VMSTATE_*_EQUAL to
protect the variable sized array, so we don't need another one here.

David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]