From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [v7][PATCH 06/16] hvmloader/pci: skip reserved ranges Date: Wed, 15 Jul 2015 14:56:16 +0100 Message-ID: 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> <55A65F620200007800091472@mail.emea.novell.com> <55A6454D.2000201@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55A6454D.2000201@intel.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: "Chen, Tiejun" 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 On Wed, Jul 15, 2015 at 12:34 PM, Chen, Tiejun wrote: >>> 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? >> > > We can't but IMO, > > #1. We're already posting that warning messages. > > #2. Actually this is like this sort of case like, as you known, even in the > native platform, some broken devices are also disabled by BIOS, right? So I > think this is OS's responsibility or risk to force enabling such a broken > device. > > #3. Its really rare possibility in real world. Well the real question is if the guest re-enabling the device would cause a security problem; I think the answer to that must be "no" (or at least, "it's not any worse than it was before"). The guest OS has the device disabled, and the RMRRs in the e820 map; if it re-enables the device over the "BIOS" (which hvmloader sort of acts as), then it should know what it's doing. Would it be possible, on a collision, to have one last "stab" at allocating the BAR somewhere else, without relocating memory (or relocating any other BARs)? At very least then an administrator could work around this kind of thing by setting the mmio_hole larger in the domain config. -George