Received: from eggs.gnu.org ([2001:4830:134:3::10]:43260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzZ97-0002Y1-Jp for qemu-devel@nongnu.org; Wed, 17 Jul 2013 17:20:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzZ93-0006su-0x for qemu-devel@nongnu.org; Wed, 17 Jul 2013 17:20:25 -0400 Date: Wed, 17 Jul 2013 18:20:17 -0300 From: Eduardo Habkost Message-ID: <20130717212017.GI11420@otherpad.lan.raisama.net> References: <1373995321-2470-1-git-send-email-aarcange@redhat.com> <20130716173844.GC19826@otherpad.lan.raisama.net> <51E586E6.1060001@redhat.com> <20130716181136.GD19826@otherpad.lan.raisama.net> <51E59DEE.5030603@redhat.com> <20130716194238.GG11420@otherpad.lan.raisama.net> <20130717151928.GF13732@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130717151928.GF13732@redhat.com> Subject: Re: [Qemu-devel] [PATCH] fix guest physical bits to match host, to go beyond 1TB guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Andrea Arcangeli , Paolo Bonzini , qemu-devel@nongnu.org, qemu-stable@nongnu.org On Wed, Jul 17, 2013 at 06:19:28PM +0300, Gleb Natapov wrote: > On Tue, Jul 16, 2013 at 04:42:38PM -0300, Eduardo Habkost wrote: > > On Tue, Jul 16, 2013 at 09:24:30PM +0200, Paolo Bonzini wrote: > > > Il 16/07/2013 20:11, Eduardo Habkost ha scritto: > > > > For physical bit size, what about extending it in a backwards-compatible > > > > way? Something like this: > > > > > > > > *eax = 0x0003000; /* 48 bits virtual */ > > > > if (ram_size < 1TB) { > > > > physical_size = 40; /* Keeping backwards compatibility */ > > > > } else if (ram_size < 4TB) { > > > > physical_size = 42; > > > > > > Why not go straight up to 44? > > > > I simply trusted the comment saying: "The physical address space is > > limited to 42 bits in exec.c", and assumed we had a 42-bit limit > > somewhere else. > > > > We could also try something like this: > > > > if (ram_size < 1TB) { > > physical_size = 40; /* Keeping backwards compatibility */ > > } else { > > physical_size = msb(ram_size); > > } > > if (supported_host_physical_size() < physical_size) { > > abort(); > > } > > > > > ram_size is the things we set with -m, right? Because if it is then > using it here is incorrect since, due to PCI hole, max phys address is > higher than ram_size. Yeah, everywhere I used ram_size I actually meant "max phys address". -- Eduardo