From: Yuji Shimada Subject: Re: [RFC] Disable xen platform device when it is not needed. Date: Fri, 20 Feb 2009 16:52:55 +0900 Message-ID: <20090220165009.DC71.27C06F64@necst.nec.co.jp> References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "Tian, Kevin" , "xen-devel@lists.xensource.com" , Ian Jackson , Kouya Shimura , James Harper List-Id: xen-devel@lists.xenproject.org On Thu, 19 Feb 2009 09:53:54 +0000 Keir Fraser wrote: > On 19/02/2009 09:39, "Keir Fraser" wrote: > > >> I will create the patch to add "xen_platform_pci" option in guest > >> config file to disable xen platform device. > >> > >> xen_platform_pci=0: Disable xen platform device. > >> xen_platform_pci=1: Enable xen platform device. (default) > > > > I still might veto this. I don't really want the platform device I/O ports > > scattered elsewhere for this rather frivolous reason. > > Actually it's okay, you can alias the 'platform_flags' byte of the ioport > BAR to fixed byte port 0x10. There's a handler for that already in > xen_platform.c (platform_fixed_ioport_{read,write}1). That's the only port > that hvmloader/rombios cares about. > > Hvmloader/rombios can then always use fixed single-byte ioport 0x10. This is > actually better since the code is simpler and also rombios accesses that > port on S3 suspend/resume, at which point an OS could have relocated the > xen_platform ioport BAR! Using a fixed port is therefore safer. > > Notice that I said you must *alias* this ioport byte. You cannot remove it > from the xen_platform BAR as old saved guests will rely on it being there, > and removing it will break their S3. We have to be backward compatible with > the Xen-3.3 virtual hardware interface for saved guests. > > So, no veto after all! I will create the patch as follows. - Alias the 'platform_flags' byte of the ioport BAR to fixed byte port 0x10, and don't remove existing 'platform_flags' byte. - Change guest firmware to use new fixed byte port 0x10. - Add "xen_platform_pci" option in guest config file. xen_platform_pci=0: Disable xen platform device. xen_platform_pci=1: Enable xen platform device. (default) Thanks, -- Yuji Shimada