From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [v7][PATCH 06/16] hvmloader/pci: skip reserved ranges Date: Wed, 15 Jul 2015 12:25:54 +0100 Message-ID: <55A65F620200007800091472@mail.emea.novell.com> References: <1436420047-25356-1-git-send-email-tiejun.chen@intel.com> <1436420047-25356-7-git-send-email-tiejun.chen@intel.com> <55A3D5600200007800090330@mail.emea.novell.com> <55A4AE88.2000200@intel.com> <55A4F2270200007800090834@mail.emea.novell.com> <55A4EA54.60708@intel.com> <55A5138F0200007800090A71@mail.emea.novell.com> <55A5AF6F.1050305@intel.com> <55A5E122.7030203@intel.com> <55A6374E02000078000911EC@mail.emea.novell.com> <55A6210E.8080406@intel.com> <55A64386020000780009132E@mail.emea.novell.com> <55A6374F.6030901@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55A6374F.6030901@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tiejun Chen Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org, Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 15.07.15 at 12:34, wrote: >>>> Yet more special casing code you want to add. I said no to this >>>> model, and unless you can address the issue _without_ adding >>>> a lot of special casing code, the answer will remain no (subject >>> >>> What about this? >>> >>> @@ -301,6 +301,19 @@ void pci_setup(void) >>> pci_mem_start <<= 1; >>> } >>> >>> + for ( i = 0; i < memory_map.nr_map ; i++ ) >>> + { >>> + uint64_t reserved_start, reserved_size; >>> + reserved_start = memory_map.map[i].addr; >>> + reserved_size = memory_map.map[i].size; >>> + if ( check_overlap(pci_mem_start, pci_mem_end - pci_mem_start, >>> + reserved_start, reserved_size) ) >>> + { >>> + printf("Reserved device memory conflicts current PCI memory.\n"); >>> + BUG(); >>> + } >>> + } >> >> So what would the cure be if someone ran into this BUG() (other >> than removing the device associated with the conflicting RMRR)? > > Maybe I can move this chunk of codes downward those actual allocation > to check if RDM conflicts with the final allocation, and then just > disable those associated devices by writing PCI_COMMAND without BUG() > like this draft code, And what would keep the guest from re-enabling the device? Jan