From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [v8][PATCH 06/16] hvmloader/pci: disable all pci devices conflicting with rdm Date: Fri, 17 Jul 2015 05:15:59 +0800 Message-ID: <55A81F0F.7090006@intel.com> References: <1437029582-19564-1-git-send-email-tiejun.chen@intel.com> <1437029582-19564-7-git-send-email-tiejun.chen@intel.com> <55A79AFA.3040500@intel.com> <55A7AFF4.1040909@intel.com> <55A7CE890200007800091EC8@mail.emea.novell.com> <55A7B647.8080808@intel.com> <55A7E1C30200007800091F48@mail.emea.novell.com> <55A7CBBA.90606@intel.com> <55A7D040.809@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap , George Dunlap Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , "xen-devel@lists.xen.org" , Jan Beulich , Keir Fraser List-Id: xen-devel@lists.xenproject.org > > base = (resource->base + bar_sz - 1) & ~(uint64_t)(bar_sz - 1); > + > + /* If we're using mem_resource, check for RMRR conflicts */ > + while ( resource == &mem_resource && > + next_rmrr > 0 && > + check_overlap(base, bar_sz, > + memory_map.map[next_rmrr].addr, > + memory_map.map[next_rmrr].size)) { > + base = memory_map.map[next_rmrr].addr + > memory_map.map[next_rmrr].size; > + base = (resource->base + bar_sz - 1) & ~(uint64_t)(bar_sz - 1); > + next_rmrr=find_next_rmrr(base); > + } > + > bar_data |= (uint32_t)base; > bar_data_upper = (uint32_t)(base >> 32); > base += bar_sz; > Actually this chunk of codes are really similar as what we did in my previous revisions from RFC ~ v3. It's just trying to skip and then allocate, right? As Jan pointed out, there are two key problems: #1. All skipping action probably cause a result of no sufficient MMIO to allocate all devices as before. #2. Another is that alignment issue. When the original "base" change to align to rdm_end, some spaces are wasted. Especially, these spaces could be allocated to other smaller bars. This is one key reason why I had new revision started from v4 to address these two points :) Thanks Tiejun