From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwzoW-0001I5-44 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 16:17:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwzoP-0002k2-TS for qemu-devel@nongnu.org; Tue, 17 Jun 2014 16:17:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwzoP-0002jt-Lz for qemu-devel@nongnu.org; Tue, 17 Jun 2014 16:16:57 -0400 Date: Tue, 17 Jun 2014 23:17:13 +0300 From: "Michael S. Tsirkin" Message-ID: <20140617201713.GA16416@redhat.com> References: <1402077126-17799-1-git-send-email-dslutz@verizon.com> <1402077126-17799-3-git-send-email-dslutz@verizon.com> <20140617182237.GA15403@redhat.com> <53A08C99.4030403@terremark.com> <20140617194329.GF15610@redhat.com> <20140617200854.GC27242@laptop.dumpdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140617200854.GC27242@laptop.dumpdata.com> Subject: Re: [Qemu-devel] [Xen-devel] [PATCH v5 2/3] pc & q35: Add new machine opt max-ram-below-4g List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com, Stefano Stabellini , qemu-devel@nongnu.org, Don Slutz , Anthony Liguori , Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= On Tue, Jun 17, 2014 at 04:08:54PM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Jun 17, 2014 at 10:43:29PM +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 17, 2014 at 02:44:41PM -0400, Don Slutz wrote: > > > On 06/17/14 14:22, Michael S. Tsirkin wrote: > > > >On Fri, Jun 06, 2014 at 01:52:05PM -0400, Don Slutz wrote: > > > >>This is a pc & q35 only machine opt. One use is to allow for more > > > >>ram in a 32bit guest for example: > > > >> > > > >>-machine pc,max-ram-below-4g=3.75G > > > >> > > > >>If you add enough PCI devices then all mmio for them will not fit > > > >>below 4G which may not be the layout the user wanted. This allows > > > >>you to increase the below 4G address space that PCI devices can use > > > >>(aka decrease ram below 4G) and therefore in more cases not have any > > > >>mmio that is above 4G. > > > >> > > > >>For example using "-machine pc,max-ram-below-4g=2G" on the command > > > >>line will limit the amount of ram that is below 4G to 2G. > > > >I'm not sure I get it. > > > > > > > >All this only has effect if you have >4G RAM, right? > > > > > > Nope. When it takes effect includes RAM > max-ram-below-4g. I.E. > > > > > > -machine pc,max-ram-below-4g=2G -m 3G > > > > > > Will have 2G in 32bit space (below 4G) and 1G in 64bit space (above 4G). > > > > > > >Presumably you then have a 64 bit guest so why does it > > > >care about memory/MMIO being below 4G? > > > > > > It is not the guest that matters, it is all the PCI devices in use. There are > > > ones (all old hardware) that only support 32bit addresses. > > > > Emulated devices? Let's just teach them to support 64 bit BARs. > > Looks like a nicer solution than asking user to make > > this decision. > > I presume real normal PCI devices. > > > > > When using > > > these you may need more room. > > > > > > Also pci-passthru of real hardware that is 32bit only may require this. > > > -Don Slutz > > > > Guest and host BARs are unrelated so it seems we could allow 64 bit BARs > > even when they are 32 bit on host. > > That assumes that the devices are OK with having their BARs remmaped. > That is not always the case and some of them might not like that. > > Also OSes might want to only use 32-bit BARs as that is what they > had been written for. I presume since Don is working for a telecom > that this might be some ancient networking hardware with super-fast > BSD OS. > > > > Though PCI Express spec requires 64 bit BARs since version 1.0, > > are there really many devices like this out there? > > Care giving examples? > > I think he mentioned PCI devices, not PCIe. OK that's a small niche but it makes some sense. So let's focus on this case, it can be addressed cleanly: default: max-ram-below-4g=4g pc: low = MIN(low, max-ram-below-4g) no special handling for any corner cases. For bonus points detect and warn if value chosen causes alignment issues. -- MST