From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [RFC][PATCH 3/5] tools:libxc: remove mmio BAR out of RMRR mappings Date: Tue, 12 Aug 2014 18:55:56 +0800 Message-ID: <53E9F2BC.9040409@intel.com> References: <1407409371-31728-1-git-send-email-tiejun.chen@intel.com> <1407409371-31728-4-git-send-email-tiejun.chen@intel.com> <53E50D91020000780002AB44@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53E50D91020000780002AB44@mail.emea.novell.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: Jan Beulich Cc: kevin.tian@intel.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org On 2014/8/8 23:49, Jan Beulich wrote: >>>> On 07.08.14 at 13:02, wrote: >> @@ -300,6 +302,30 @@ static int setup_guest(xc_interface *xch, >> goto error_out; >> } >> >> + /* We need to move mmio range out of RMRR mapping. */ >> + rc = xc_get_rmrr_map(xch, map, E820MAX); >> + if (rc < 0) >> + { >> + PERROR("Could not get RMRR info on domain"); >> + } >> + else if ( rc ) >> + { >> + for ( i = 0; i < rc; i++ ) >> + { >> + rmrr_end = map[i].addr + map[i].size + 1; >> + if ( rmrr_end > mmio_start ) >> + { >> + mmio_start = rmrr_end; >> + } >> + } > > This seems way too simplistic - what if the RMRRs are referring to > memory regions extremely far apart? > >> + mmio_size = (1ull << 32) - mmio_start; > > Limiting things to 4Gb? > >> + if ( mmio_size <= 0 ) > > mmio_size is an unsigned quantity, so this won't do what you intend. Yes, you're right. With a further consideration, mmio size should be configured so I think it may be enough just to check if current mmio is overlapping, then let user determine what next should do. Please comments this in next revision directly. Thanks Tiejun > > Jan > >