From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] x86/xen: do not identity map E820 memory regions that are UNUSABLE Date: Fri, 12 Jul 2013 22:38:13 +0100 Message-ID: <51E07745.9020301@cantab.net> References: <1373377133-11018-1-git-send-email-david.vrabel@citrix.com> <20130709141329.GC24897@phenom.dumpdata.com> <51DC21D6.4000107@citrix.com> <20130709184538.GB10188@phenom.dumpdata.com> <51DE9546.8050206@citrix.com> <20130712193342.GA6364@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130712193342.GA6364@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: David Vrabel , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 12/07/2013 20:33, Konrad Rzeszutek Wilk wrote: > > So the 'HYPERVISOR_update_va_mapping' fails b/c we include it in the > xen_set_identify_and_release_chunk. That's what I understand. > Why not make the logic that sets "gaps" > and E820_RESERVED regions to omit E820_UNUSABLE regions? That would solve > it as well - and we won't be messing with the E820. I suppose we could do what you suggest but there would have to be a xen_release_chunk() function added, otherwise you would waste the frames in that region. I remain unconvinced that adding pointless unusable regions into the dom0's memory map makes any sense. >>> OK. What about the BIOS manufacturing [unusable regions? >> >> What about it? As a PV guest we don't care what the machine memory map >> looks like, /except/ as a means to find interesting bits of hardware >> that we want 1:1 mappings for. > > Right but now you are converting it from 1:1 to a RAM region - where we > don't do 1:1. No, it's leaving it as a RAM region, as setup by Xen (and as marked as such in the pseudo-physical map). I guess I still haven't explained very well what the (confusing) setup code is trying to do. 1. Get psuedo-physical memory map. 2. Get machine memory map. 3. For each "interesting" (reserved or MMIO hole) region in the machine memory map: a. Add reserved region or hole to pseudo-physical memory map. b. Release memory. c. Set as 1:1 in p2m. d. Update any existing mappings. The code as-is doesn't work like that but the end result should be the same. David