Yuji Shimada
2009-Feb-18 00:15 UTC
[Xen-devel] [RFC] Disable xen platform device when it is not needed.
I plan to create the patch to disable xen platform device when it is not needed. Please let me know if anyone has a comment. Windows guest shows xen platform device as unknown device with "!" mark in the device manager, when PV drivers are not loaded. So I''d like to disable xen platform device. If following conditions are all true, I will disable xen platform device. Otherwise, xen platform device will be enabled. - All entries in "disk" parameter have "ioemu:" prefix in DEV field. Example: disk = [ ''/var/images/guest.img,ioemu:hda,w'', '',ioemu:hdc:cdrom,r'' ] - All entries in "vif" parameter have "type=ioemu". Example: vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu, bridge=eth1'' ] - "vscsi" parameter is not specified. Xen platform device has functions for PV drivers and guest firmware (hvmloader and rombios). The functions for PV drivers will be disabled when xen platform device is disabled. This is no problem. But the function for guest firmware should not be disabled. I will move the function for guest firmware from xen platform device to host bridge. The interface between host bridge and guest firmware will be in PCI configuration space, because host bridge does not have io resource and memory resource. The function which I will move is switching RW/RO state of ROM memory area. Please refer qemu-xen/hw/xen_platform.c:xen_platform_ioport_writeb. I will not move the other functions. Thanks, -- Yuji Shimada _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
James Harper
2009-Feb-18 00:29 UTC
RE: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
> > I plan to create the patch to disable xen platform device when it > is not needed. Please let me know if anyone has a comment. > > Windows guest shows xen platform device as unknown > device with "!" mark in the device manager, when PV drivers are not > loaded. So I''d like to disable xen platform device. > > If following conditions are all true, I will disable xen platform > device. Otherwise, xen platform device will be enabled. > > - All entries in "disk" parameter have "ioemu:" prefix in DEVfield.> Example: > disk = [ ''/var/images/guest.img,ioemu:hda,w'','',ioemu:hdc:cdrom,r''> ] > > - All entries in "vif" parameter have "type=ioemu". > Example: > vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu, bridge=eth1'' ] > > - "vscsi" parameter is not specified.I still leave my disks and network as ioemu even when using PV drivers, as I simply need to use the /NOGPLPV boot option to switch back to them. I recommend you add a ''no_platform_pci=1'' option or something like that, rather than try and guess that the user doesn''t want it. I''m also not sure that xen will boot without the disks being in ioemu mode, so using a non-ioemu disk for the situation where you want to use PV drivers will not give you a bootable system. James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2009-Feb-18 01:21 UTC
RE: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
James Harper writes:> > > > I plan to create the patch to disable xen platform device when it > > is not needed. Please let me know if anyone has a comment. > > > > Windows guest shows xen platform device as unknown > > device with "!" mark in the device manager, when PV drivers are not > > loaded. So I''d like to disable xen platform device. > > > > If following conditions are all true, I will disable xen platform > > device. Otherwise, xen platform device will be enabled. > > > > - All entries in "disk" parameter have "ioemu:" prefix in DEV > field. > > Example: > > disk = [ ''/var/images/guest.img,ioemu:hda,w'', > '',ioemu:hdc:cdrom,r'' > > ] > > > > - All entries in "vif" parameter have "type=ioemu". > > Example: > > vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu, bridge=eth1'' ] > > > > - "vscsi" parameter is not specified. > > I still leave my disks and network as ioemu even when using PV drivers, > as I simply need to use the /NOGPLPV boot option to switch back to them. > > I recommend you add a ''no_platform_pci=1'' option or something like that, > rather than try and guess that the user doesn''t want it.Besides, we can add a PV disk by ''xm block-attach'' command after boot. My vote would be a ''xen_platform_pci=0'' option (default=1).> I''m also not sure that xen will boot without the disks being in ioemu > mode, so using a non-ioemu disk for the situation where you want to use > PV drivers will not give you a bootable system.The PCI passthrough enables it. Thanks, Kouya _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Yuji Shimada
2009-Feb-18 03:17 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
Thank you for your comments. On Wed, 18 Feb 2009 11:29:54 +1100 "James Harper" <james.harper@bendigoit.com.au> wrote:> > > > I plan to create the patch to disable xen platform device when it > > is not needed. Please let me know if anyone has a comment. > > > > Windows guest shows xen platform device as unknown > > device with "!" mark in the device manager, when PV drivers are not > > loaded. So I''d like to disable xen platform device. > > > > If following conditions are all true, I will disable xen platform > > device. Otherwise, xen platform device will be enabled. > > > > - All entries in "disk" parameter have "ioemu:" prefix in DEV > field. > > Example: > > disk = [ ''/var/images/guest.img,ioemu:hda,w'', > '',ioemu:hdc:cdrom,r'' > > ] > > > > - All entries in "vif" parameter have "type=ioemu". > > Example: > > vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu, bridge=eth1'' ] > > > > - "vscsi" parameter is not specified. > > I still leave my disks and network as ioemu even when using PV drivers, > as I simply need to use the /NOGPLPV boot option to switch back to them.When "ioemu:" or "type=ioemu" are not specified, both emulated device and PV device are enabled. This is current xen''s behavior. So my idea does not break your usage.> I recommend you add a ''no_platform_pci=1'' option or something like that, > rather than try and guess that the user doesn''t want it.I think xen''s users are not interested in whether platform device is enabled or disabled. When they find that the device manager shows "!", they will complain. On the other hand, they are interested in type of disk and vif, because this affects the performance of disk and vif. So I think it is better to use "ioemu:" and "type=ioemu". What do you think about this? Thanks, -- Yuji Shimada _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
James Harper
2009-Feb-18 03:20 UTC
RE: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
> > Thank you for your comments. > > On Wed, 18 Feb 2009 11:29:54 +1100 > "James Harper" <james.harper@bendigoit.com.au> wrote: > > > > > > > I plan to create the patch to disable xen platform device when it > > > is not needed. Please let me know if anyone has a comment. > > > > > > Windows guest shows xen platform device as unknown > > > device with "!" mark in the device manager, when PV drivers arenot> > > loaded. So I''d like to disable xen platform device. > > > > > > If following conditions are all true, I will disable xen platform > > > device. Otherwise, xen platform device will be enabled. > > > > > > - All entries in "disk" parameter have "ioemu:" prefix in DEV > > field. > > > Example: > > > disk = [ ''/var/images/guest.img,ioemu:hda,w'', > > '',ioemu:hdc:cdrom,r'' > > > ] > > > > > > - All entries in "vif" parameter have "type=ioemu". > > > Example: > > > vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu,bridge=eth1'' ]> > > > > > - "vscsi" parameter is not specified. > > > > I still leave my disks and network as ioemu even when using PVdrivers,> > as I simply need to use the /NOGPLPV boot option to switch back tothem.> > When "ioemu:" or "type=ioemu" are not specified, both emulated device > and PV device are enabled. This is current xen''s behavior. > > So my idea does not break your usage.Maybe I don''t understand your idea, but I think you are saying that if ioemu is specified then the PV drivers won''t work because you will disable the platform pci device. James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Tian, Kevin
2009-Feb-18 04:36 UTC
RE: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
>From: James Harper >Sent: Wednesday, February 18, 2009 8:30 AM > >I''m also not sure that xen will boot without the disks being in ioemu >mode, so using a non-ioemu disk for the situation where you want to use >PV drivers will not give you a bootable system. >Anthony Liguori posted a pxeboot feature to allow booting from pv disk: http://www.mailinglistarchive.com/xen-devel@lists.xensource.com/msg47004.html Thanks, Kevin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Shohei Fujiwara
2009-Feb-18 05:45 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
> > Thank you for your comments. > > > > On Wed, 18 Feb 2009 11:29:54 +1100 > > "James Harper" <james.harper@bendigoit.com.au> wrote: > > > > > > > > > > I plan to create the patch to disable xen platform device when it > > > > is not needed. Please let me know if anyone has a comment. > > > > > > > > Windows guest shows xen platform device as unknown > > > > device with "!" mark in the device manager, when PV drivers are > not > > > > loaded. So I''d like to disable xen platform device. > > > > > > > > If following conditions are all true, I will disable xen platform > > > > device. Otherwise, xen platform device will be enabled. > > > > > > > > - All entries in "disk" parameter have "ioemu:" prefix in DEV > > > field. > > > > Example: > > > > disk = [ ''/var/images/guest.img,ioemu:hda,w'', > > > '',ioemu:hdc:cdrom,r'' > > > > ] > > > > > > > > - All entries in "vif" parameter have "type=ioemu". > > > > Example: > > > > vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu, > bridge=eth1'' ] > > > > > > > > - "vscsi" parameter is not specified. > > > > > > I still leave my disks and network as ioemu even when using PV > drivers, > > > as I simply need to use the /NOGPLPV boot option to switch back to > them. > > > > When "ioemu:" or "type=ioemu" are not specified, both emulated device > > and PV device are enabled. This is current xen''s behavior. > > > > So my idea does not break your usage. > > Maybe I don''t understand your idea, but I think you are saying that if > ioemu is specified then the PV drivers won''t work because you will > disable the platform pci device.I suppose your understanding is right. BTW, I have one question. If you want to use the PV drivers, I don''t think xen requires "ioemu" option. Without "ioemu" option, xen will enable the emulated devices. Why do you need "ioemu" option? Thanks, -- Shohei Fujiwara _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
James Harper
2009-Feb-18 06:25 UTC
RE: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
> > > So my idea does not break your usage. > > > > Maybe I don''t understand your idea, but I think you are saying thatif> > ioemu is specified then the PV drivers won''t work because you will > > disable the platform pci device. > > I suppose your understanding is right. > > BTW, I have one question. > If you want to use the PV drivers, I don''t think xen requires "ioemu" > option. > Without "ioemu" option, xen will enable the emulated devices. > Why do you need "ioemu" option? >For booting. I don''t think PV boot in HVM is supported properly yet is it? That post I was directed to appears to just be an idea. Also, the instructions for setting up GPLPV specify to add a separate entry into boot.ini with a ''/NOGPLPV'' option in it which will disable the PV device drivers and use the ioemu drivers, which is useful for testing to see if an error is being caused by the GPLPV drivers or is unrelated. Also safe mode will disable the PV drivers (I''m not sure if that will stay that way though). It would be a nuisance to have to edit the domu config file each time you wanted to flip between the two modes. Do you have an objection to something like an explicit ''xen_platform_pci=0'' option in the config to disable the PCI device? That seems like a far more sensible way of doing things IMHO if users are really bothered by the extra PCI device. James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-18 08:14 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 18/02/2009 00:15, "Yuji Shimada" <shimada-yxb@necst.nec.co.jp> wrote:> Windows guest shows xen platform device as unknown > device with "!" mark in the device manager, when PV drivers are not > loaded. So I''d like to disable xen platform device.Is it really worth the hassle just to get rid of that? A number of responders have said they don''t want the device auto disabled, and noone is going to bother to manually disable the device just to get rid of a warning triangle in device manager. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-18 08:17 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 18/02/2009 03:20, "James Harper" <james.harper@bendigoit.com.au> wrote:>> When "ioemu:" or "type=ioemu" are not specified, both emulated device >> and PV device are enabled. This is current xen''s behavior. >> >> So my idea does not break your usage. > > Maybe I don''t understand your idea, but I think you are saying that if > ioemu is specified then the PV drivers won''t work because you will > disable the platform pci device.That''s my understanding. I''m not keen. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Yuji Shimada
2009-Feb-19 06:44 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
Thank all for the comments. 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) Thanks, -- Yuji Shimada On Wed, 18 Feb 2009 09:15:43 +0900 Yuji Shimada <shimada-yxb@necst.nec.co.jp> wrote:> I plan to create the patch to disable xen platform device when it > is not needed. Please let me know if anyone has a comment. > > Windows guest shows xen platform device as unknown > device with "!" mark in the device manager, when PV drivers are not > loaded. So I''d like to disable xen platform device. > > If following conditions are all true, I will disable xen platform > device. Otherwise, xen platform device will be enabled. > > - All entries in "disk" parameter have "ioemu:" prefix in DEV field. > Example: > disk = [ ''/var/images/guest.img,ioemu:hda,w'', '',ioemu:hdc:cdrom,r'' ] > > - All entries in "vif" parameter have "type=ioemu". > Example: > vif = [ ''type=ioemu, bridge=eth0'', ''type=ioemu, bridge=eth1'' ] > > - "vscsi" parameter is not specified. > > Xen platform device has functions for PV drivers and guest > firmware (hvmloader and rombios). The functions for PV drivers will be > disabled when xen platform device is disabled. This is no problem. But > the function for guest firmware should not be disabled. > > I will move the function for guest firmware from xen platform device > to host bridge. The interface between host bridge and guest firmware > will be in PCI configuration space, because host bridge does not have > io resource and memory resource. > > The function which I will move is switching RW/RO state of ROM memory > area. Please refer > qemu-xen/hw/xen_platform.c:xen_platform_ioport_writeb. I will not move > the other functions. > > Thanks, > -- > Yuji Shimada_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-19 09:39 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 19/02/2009 06:44, "Yuji Shimada" <shimada-yxb@necst.nec.co.jp> wrote:> Thank all for the comments. > > 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. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-19 09:53 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 19/02/2009 09:39, "Keir Fraser" <keir.fraser@eu.citrix.com> 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! -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Yuji Shimada
2009-Feb-20 07:52 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On Thu, 19 Feb 2009 09:53:54 +0000 Keir Fraser <keir.fraser@eu.citrix.com> wrote:> On 19/02/2009 09:39, "Keir Fraser" <keir.fraser@eu.citrix.com> 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-20 08:33 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 20/02/2009 07:52, "Yuji Shimada" <shimada-yxb@necst.nec.co.jp> wrote:> 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)Agreed. K. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2009-Feb-23 16:43 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
Yuji Shimada writes ("Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed."):> - Alias the ''platform_flags'' byte of the ioport BAR to fixed byte port > 0x10, and don''t remove existing ''platform_flags'' byte.How will this interact with the `disable qemu PCI devices in HVM domains'' feature, which also uses ioport 0x10 ? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-23 17:05 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 23/02/2009 08:43, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:> Yuji Shimada writes ("Re: [Xen-devel] [RFC] Disable xen platform device when > it is not needed."): >> - Alias the ''platform_flags'' byte of the ioport BAR to fixed byte port >> 0x10, and don''t remove existing ''platform_flags'' byte. > > How will this interact with the `disable qemu PCI devices in HVM > domains'' feature, which also uses ioport 0x10 ?That feature implements WORD and DWORD ports at address 0x10, but leaves the BYTE port at that address available for other uses. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2009-Feb-23 17:35 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
Keir Fraser writes ("Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed."):> On 23/02/2009 08:43, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote: > > How will this interact with the `disable qemu PCI devices in HVM > > domains'' feature, which also uses ioport 0x10 ? > > That feature implements WORD and DWORD ports at address 0x10, but leaves the > BYTE port at that address available for other uses.Ah, err, yes. Ugh. Maybe a table of uses of ioports 0x10 (and 0x12!) would be a sensible addition to xen-unstable.hg/doc/ somewhere. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Feb-23 17:41 UTC
Re: [Xen-devel] [RFC] Disable xen platform device when it is not needed.
On 23/02/2009 09:35, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:> Keir Fraser writes ("Re: [Xen-devel] [RFC] Disable xen platform device when it > is not needed."): >> On 23/02/2009 08:43, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote: >>> How will this interact with the `disable qemu PCI devices in HVM >>> domains'' feature, which also uses ioport 0x10 ? >> >> That feature implements WORD and DWORD ports at address 0x10, but leaves the >> BYTE port at that address available for other uses. > > Ah, err, yes. Ugh. Maybe a table of uses of ioports 0x10 (and 0x12!) > would be a sensible addition to xen-unstable.hg/doc/ somewhere.Well, byte 0x10 is available and is the first one, so it seemed to make sense to me. ;-) The protocol on the fixed ports is already kind of ugly and makes use of different meanings for different access sizes, so it''s in the existing spirit also. More documentation is almost always nice, so I can''t disagree with that. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel