Re: [Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-13 Thread Paolo Bonzini
> > > +if (guest_info->gb_align && above_4g_mem_size > holesize) { > > > +/* Round the allocation up to 2 MB to use more hugepages. > > To align to 2MB boundary, the number of hugepages is the same. Right. > > > + * Remove the slack from the [yyy] piece so that pieceonesize >

Re: [Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-13 Thread Marcelo Tosatti
On Wed, Nov 13, 2013 at 05:58:32PM -0200, Marcelo Tosatti wrote: > On Wed, Nov 13, 2013 at 06:13:15PM +0100, Paolo Bonzini wrote: > > > assert(piecetwosize <= holesize); > > > > > > piecetwosize = MIN(above_4g_mem_size, piecetwosize); > > > if ((above_4g_mem_siz

Re: [Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-13 Thread Michael S. Tsirkin
On Tue, Nov 12, 2013 at 07:16:37PM -0200, Marcelo Tosatti wrote: > > v2: condition enablement of new mapping to new machine types (Paolo) > v3: fix changelog > v4: rebase > v5: ensure alignment of piecetwo on 2MB GPA (Igor) > do not register zero-sized piece-one(Igor) > v6: fix memory leak

Re: [Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-13 Thread Paolo Bonzini
> assert(piecetwosize <= holesize); > > piecetwosize = MIN(above_4g_mem_size, piecetwosize); > if ((above_4g_mem_size - piecetwosize) > 0) { > memory_region_init_alias(ram_above_4g, NULL, "ram-above-4g", >

Re: [Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-13 Thread Igor Mammedov
On Tue, 12 Nov 2013 19:16:37 -0200 Marcelo Tosatti wrote: > > v2: condition enablement of new mapping to new machine types (Paolo) > v3: fix changelog > v4: rebase > v5: ensure alignment of piecetwo on 2MB GPA (Igor) > do not register zero-sized piece-one(Igor) > v6: fix memory leak

[Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-12 Thread Marcelo Tosatti
v2: condition enablement of new mapping to new machine types (Paolo) v3: fix changelog v4: rebase v5: ensure alignment of piecetwo on 2MB GPA (Igor) do not register zero-sized piece-one(Igor) v6: fix memory leak (Igor) fix integer overflow(Ig