[PATCH 0/4] HVM Virtual S3 These set of patches are our prototype for HVM virtual ACPI S3 support: - patch 1/4: Xen interface for HVM S3 - patch 2/4: QEMU interface for HVM S3 - patch 3/4: rombios interface for HVM S3 - patch 4/4: xend interface for HVM S3 The main idea is: - emulate ACPI PM1A control resiger in QEMU to capture guest S3 request - when QEMU capture guest S3 request, it call hypercall to trap to Xen - Xen will suspend HVM by reseting all vcpus - on resume, "xm resume" will call hypercall to trap to Xen - Xen will resume HVM by setting HVM vcpu EIP to 0xfff0, cs base to 0xf0000, and also set other related registers/msr to the correct value/attributes in realmode environment which will start from rombios post Entry code in realmode directly when resuming. - rombios post code will start s3 resume by jumping to wakeup vector set by guest OS. How to use it: - apply this patch to changeset 17589:9a6ad687ec20 - create and boot HVM domain - In HVM guest, enter S3 state * for Linux, "echo mem >/sys/power/state" * for Windows, shutdown windows by Standby - to resume HVM domain, "xm resume <domid>" Note: FC6/FC5 guest can successfully S3 suspend/resume in both text mode and X window. Also, with vtd-enabled, network card assigned to HVM, it works too. However, Windows guest can not suspend, because the windows driver for QEMU VGA and monitor has no power management support, and windows refuse to enter S3 sleep state. Kevin/Ke/Liping _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel- > bounces@lists.xensource.com] On Behalf Of Ke, Liping > Sent: Thursday, 8 May 2008 15:13 > To: xen-devel@lists.xensource.com > Cc: Tian, Kevin; Jiang,Yunhong; Yu, Ke; Ke, Liping > Subject: [Xen-devel] [PATCH 0/4] HVM Virtual S3 > > [PATCH 0/4] HVM Virtual S3 > > These set of patches are our prototype for HVM virtual > ACPI S3 support: > - patch 1/4: Xen interface for HVM S3 > - patch 2/4: QEMU interface for HVM S3 > - patch 3/4: rombios interface for HVM S3 > - patch 4/4: xend interface for HVM S3 >How does this interact with the PV drivers? Linux, but also how should I interact with it in the GPL PV drivers for Windows?> However, Windows guest can not suspend, because the windows > driver for QEMU VGA and monitor has no power management support, and > windows refuse to enter S3 sleep state.I have successfully suspended Windows before using the GPL PV drivers, but I haven''t gotten resume working yet... James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
James Harper wrote:>> >> [PATCH 0/4] HVM Virtual S3 >> >> These set of patches are our prototype for HVM virtual >> ACPI S3 support: >> - patch 1/4: Xen interface for HVM S3 >> - patch 2/4: QEMU interface for HVM S3 >> - patch 3/4: rombios interface for HVM S3 >> - patch 4/4: xend interface for HVM S3 >> > > How does this interact with the PV drivers? Linux, but also how > should I interact with it in the GPL PV drivers for Windows?By design, PV drivers should have suspend/resume routine, and it will be called by guest OS S3 sleep/resume logic. We have test the linux pv driver, it works fine. Due to current windows virtual S3 resume issue, we have no chance to test your windows PV driver. But by desing, as long as PV drvier has right suspeend/resume routine, it should work just fine.> >> However, Windows guest can not suspend, because the windows >> driver for QEMU VGA and monitor has no power management support, and >> windows refuse to enter S3 sleep state. > > I have successfully suspended Windows before using the GPL PV drivers, > but I haven''t gotten resume working yet... > > JamesCan you elaborate how you manage to suspend guest windows? We are very interested in this. In our environment, windows XP refuse to suspend due to QEMU VGA Best Regards Ke _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
We plan to send the patches today, other four patches will come out soon. And please see below answers. Thanks& Regards Criping James Harper wrote:>> -----Original Message----- >> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel- >> bounces@lists.xensource.com] On Behalf Of Ke, Liping >> Sent: Thursday, 8 May 2008 15:13 >> To: xen-devel@lists.xensource.com >> Cc: Tian, Kevin; Jiang,Yunhong; Yu, Ke; Ke, Liping >> Subject: [Xen-devel] [PATCH 0/4] HVM Virtual S3 >> >> [PATCH 0/4] HVM Virtual S3 >> >> These set of patches are our prototype for HVM virtual >> ACPI S3 support: >> - patch 1/4: Xen interface for HVM S3 >> - patch 2/4: QEMU interface for HVM S3 >> - patch 3/4: rombios interface for HVM S3 >> - patch 4/4: xend interface for HVM S3 >> > > How does this interact with the PV drivers? Linux, but also how > should I interact with it in the GPL PV drivers for Windows?I have tested the patch with PV driver Linux HVM, FC5-32e, it could resume back sucessfully. Both in Txt mode and X windows. Since after S3, only cpu reset, all pv drivers or (device drivers such as network with vtd-enabled) information still in memory, it should work fine after resume. But I did not test windows yet because of below problems.> >> However, Windows guest can not suspend, because the windows >> driver for QEMU VGA and monitor has no power management support, and >> windows refuse to enter S3 sleep state. > > I have successfully suspended Windows before using the GPL PV drivers, > but I haven''t gotten resume working yet...And could you help to tell us how to let windows hvm successfully sleep down? We used to successfully do this on va project, but never succeed on upstream because of qemu VGA drivers seems does not support pnp S3 request. I have tried both std-vga and cirrus vga on xp/server2003/vista hvm, yet all failed . Std-vga, even s3 button is disabed. . Cirrus-vga, s3 is enabled, when you click, it will say "default monitor prevent S3 operation...". And thanks for the information.> > James_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> The main idea is: > - emulate ACPI PM1A control resiger in QEMU to capture guest S3request> - when QEMU capture guest S3 request, it call hypercall to trap to Xen > - Xen will suspend HVM by reseting all vcpus > - on resume, "xm resume" will call hypercall to trap to Xen > - Xen will resume HVM by setting HVM vcpu EIP to 0xfff0, cs base to > 0xf0000, > and also set other related registers/msr to the correct > value/attributes > in realmode environment which will start from rombios post Entrycode> in realmode directly when resuming. > - rombios post code will start s3 resume by jumping to wakeup vector > set > by guest OS.Have you checked save/restore works when the guest is in S3 state? This is essential for some of the server (as opposed to client) use cases for guest S3. [One thing to watch out for is that if the guest is in S3 it should be possible to skip the usual synchronization with PV drivers as they will already be shutdown.] Further, do we actually need the s3 resume hypercall? Couldn''t we just put the VCPUs and xen-emulated devices into the right state for resume at the end of s3 sleep and just leave the domain paused (i.e. unscheduled)? Also, do you have plans to implement an "xm send-power-event" type thing that enables us to inform the guest of actions such as lid switch open/close, power cable in/out, power button pressed etc ? Many Thanks, Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt wrote:>> The main idea is: >> - emulate ACPI PM1A control resiger in QEMU to capture guest S3 >> request >> - when QEMU capture guest S3 request, it call hypercall to trap to >> Xen >> - Xen will suspend HVM by reseting all vcpus >> - on resume, "xm resume" will call hypercall to trap to Xen >> - Xen will resume HVM by setting HVM vcpu EIP to 0xfff0, cs base to >> 0xf0000, and also set other related registers/msr to the correct >> value/attributes in realmode environment which will start from >> rombios post Entry code in realmode directly when resuming. >> - rombios post code will start s3 resume by jumping to wakeup vector >> set by guest OS. > > Have you checked save/restore works when the guest is in S3 state? > This is essential for some of the server (as opposed to client) use > cases for guest S3.Yes, save/restore should work when guest is in S3 state. When S3_sleep, domain is still alive, just only that VCPU is blocked. We''ll do further test on it these days.> > [One thing to watch out for is that if the guest is in S3 it should be > possible to skip the usual synchronization with PV drivers as they > will already be shutdown.]Yes, when guest is in S3, PV drivers should not deal with any synchronization Jobs. When resume back, it returns back to work again.> > > Further, do we actually need the s3 resume hypercall? Couldn''t we just > put the VCPUs and xen-emulated devices into the right state for resume > at the end of s3 sleep and just leave the domain paused (i.e. > unscheduled)?As I can understand, when S3, HVM will perform like native-machine S3, all execution context are in memory When resume back, jump to the CS/EIP, those vcpus resume execution normally. Ke& Kevin, any coments here?> > > Also, do you have plans to implement an "xm send-power-event" type > thing that enables us to inform the guest of actions such as lid > switch open/close, power cable in/out, power button pressed etc ?Since now host S3 and HVM S3 is not integrated yet, I am not sure whether those lid/cable/power button are appropriate to be involved with Guest notification. Especially if we have multiple guest. Yet I think we must consider it carefully as part of VMM PM solution :) If both host and HVM is S3 done, when lid open, Xen is back, host is back and then HVM is back. It is a possible senario?> > Many Thanks, > Ian_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 8/5/08 15:57, "Ke, Liping" <liping.ke@intel.com> wrote:>> Further, do we actually need the s3 resume hypercall? Couldn''t we just >> put the VCPUs and xen-emulated devices into the right state for resume >> at the end of s3 sleep and just leave the domain paused (i.e. >> unscheduled)? > As I can understand, when S3, HVM will perform like native-machine S3, > all execution context are in memory When resume back, jump to the CS/EIP, > those vcpus resume execution normally. > Ke& Kevin, any coments here?I think part of what Ian means is that you may as well have a single interface into each device model in Xen -- e.g., hpet_reset(), pit_reset(), and so on. Rather than have separate poweroff/poweron functions. Apart from the greater simplicity, some models already have a reset interface, and I''m not sure the implemented poweroff/poweron splits are all correct. And then, once the poweron calls are all gone, what else does s3_resume actually have to do? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ke, Liping wrote:> Ian Pratt wrote: >>> The main idea is: >>> - emulate ACPI PM1A control resiger in QEMU to capture guest S3 >>> request >>> - when QEMU capture guest S3 request, it call hypercall to trap to >>> Xen >>> - Xen will suspend HVM by reseting all vcpus >>> - on resume, "xm resume" will call hypercall to trap to Xen >>> - Xen will resume HVM by setting HVM vcpu EIP to 0xfff0, cs base to >>> 0xf0000, and also set other related registers/msr to the correct >>> value/attributes in realmode environment which will start from >>> rombios post Entry code in realmode directly when resuming. >>> - rombios post code will start s3 resume by jumping to wakeup vector >>> set by guest OS. >> >> Have you checked save/restore works when the guest is in S3 state? >> This is essential for some of the server (as opposed to client) use >> cases for guest S3. > Yes, save/restore should work when guest is in S3 state. When > S3_sleep, domain is still alive, just only that VCPU is blocked. > We''ll do further test on it these days.We did not try yet. Since our original purose is for PCI passthrouhg device. And surely we will test it. Thanks for reminder.>> >> [One thing to watch out for is that if the guest is in S3 it should >> be possible to skip the usual synchronization with PV drivers as they >> will already be shutdown.] > Yes, when guest is in S3, PV drivers should not deal with any > synchronization Jobs. When resume back, it returns back to work again.Oh, right, we will look more on this. Basic test shows vritual S3 works fine with Linux PV drivers.>> >> >> Further, do we actually need the s3 resume hypercall? Couldn''t we >> just put the VCPUs and xen-emulated devices into the right state for >> resume at the end of s3 sleep and just leave the domain paused (i.e. >> unscheduled)? > As I can understand, when S3, HVM will perform like native-machine S3, > all execution context are in memory When resume back, jump to the > CS/EIP, those vcpus resume execution normally. > Ke& Kevin, any coments here?That is good idea. Basically we will combine suspend/resume into one logic. And use "xm unpause" for resume. We will look into more.> >> >> >> Also, do you have plans to implement an "xm send-power-event" type >> thing that enables us to inform the guest of actions such as lid >> switch open/close, power cable in/out, power button pressed etc ? > Since now host S3 and HVM S3 is not integrated yet, I am not sure > whether those lid/cable/power button are appropriate to be involved > with Guest notification. Especially if we have multiple guest. Yet I > think we must consider it carefully as part of VMM PM solution :) > If both host and HVM is S3 done, when lid open, > Xen is back, host is back and then HVM is back. It is a possible > senario?We are also thinking about this. This is basically qemu work, and we see qemu upstream already has some logic like GPE event. We will analysis the gap and propose task plan for next step.> >> >> Many Thanks, >> IanThanks for the valuable comments :) Best Regards Ke _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> > Also, do you have plans to implement an "xm send-power-event" type > > thing that enables us to inform the guest of actions such as lid > > switch open/close, power cable in/out, power button pressed etc ? > Since now host S3 and HVM S3 is not integrated yet, I am not sure > whether those lid/cable/power button are appropriate to be involved > with Guest notification. Especially if we have multiple guest. Yet Ithink> we must consider it carefully as part of VMM PM solution :) > If both host and HVM is S3 done, when lid open, > Xen is back, host is back and then HVM is back. It is a possible > senario?I don''t think we need any integration with host S3 as part of the xend -- that''s a separate issue, maybe an example script that runs (early) as part of a host S3 that puts the guests into S3 too. I think what we need in xm/xend is a command for informing the guest of ACPI events such as lid switch, power cable, power button etc. Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 8/5/08 16:11, "Ian Pratt" <Ian.Pratt@eu.citrix.com> wrote:> I don''t think we need any integration with host S3 as part of the xend > -- that''s a separate issue, maybe an example script that runs (early) as > part of a host S3 that puts the guests into S3 too. > > I think what we need in xm/xend is a command for informing the guest of > ACPI events such as lid switch, power cable, power button etc.We can actually extend the ''xm trigger'' command for this with some more events. ''xm trigger {lid-closed,lid-open}''? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser wrote:> On 8/5/08 16:11, "Ian Pratt" <Ian.Pratt@eu.citrix.com> wrote: > >> I don''t think we need any integration with host S3 as part of the >> xend -- that''s a separate issue, maybe an example script that runs >> (early) as part of a host S3 that puts the guests into S3 too. >> >> I think what we need in xm/xend is a command for informing the guest >> of ACPI events such as lid switch, power cable, power button etc. > > We can actually extend the ''xm trigger'' command for this with some > more events. ''xm trigger {lid-closed,lid-open}''? > > -- Keir > >Yes. And another thing we may need think about is the inter-process communication with qemu, to notify qemu to trigger the ACPI event. Best Regards Ke _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
>>> >>> Further, do we actually need the s3 resume hypercall? Couldn''t we >>> just put the VCPUs and xen-emulated devices into the right state for >>> resume at the end of s3 sleep and just leave the domain paused (i.e. >>> unscheduled)? >> As I can understand, when S3, HVM will perform like native-machine >> S3, all execution context are in memory When resume back, jump to the >> CS/EIP, those vcpus resume execution normally. >> Ke& Kevin, any coments here? > > That is good idea. Basically we will combine suspend/resume into one > logic. And use "xm unpause" for resume. We will look into more. >Hi, Ke and Ian Today I am trying this idea, I found combining S3 sus/resume+domain_pause, and then use domain_unpause letting domain back works fine. Yet when I am trying xm save after pausing domain, I found if a domain not running, Xm save will reject the save request. So I want to know whether domain running is a must for xm save operation? Thanks& Regards, Criping>>> >>> Many Thanks, >>> Ian > > Thanks for the valuable comments :) > > Best Regards > Ke_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
''xm [un]pause'' already has a meaning, and I don''t think the meaning should be overloaded for HVM guests. That''s asking for trouble. I''d rather we went with the ''xm trigger'' approach, making it look like a lid opening and closing. Apart from that, this approach of doing most of the work on the suspend side is definitely the right thing to do. Then ''xm trigger lid-open'' (or whatever you call it) will be really not much more complicated than domain_unpause(). -- Keir On 9/5/08 10:58, "Ke, Liping" <liping.ke@intel.com> wrote:>> That is good idea. Basically we will combine suspend/resume into one >> logic. And use "xm unpause" for resume. We will look into more. >> > Hi, Ke and Ian > Today I am trying this idea, I found combining S3 > sus/resume+domain_pause, and then > use domain_unpause letting domain back works fine. > > Yet when I am trying xm save after pausing domain, I found if a domain > not running, > Xm save will reject the save request. > So I want to know whether domain running is a must for xm save > operation?_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> Today I am trying this idea, I found combining S3 > sus/resume+domain_pause, and then > use domain_unpause letting domain back works fine. > > Yet when I am trying xm save after pausing domain, I found if a domain > not running, > Xm save will reject the save request. > So I want to know whether domain running is a must for xm save > operation?Yes, you''ll certainly need a few tweaks to the save/restore code. Normally save/restore needs to send a notification to the guest such that the PV drivers get themselves into a ''safe'' state. If the guest is in S3, the drivers will already be shutdown (hence safe). I think you''ll need to add an explicit new state that a VM can be in (S3 sleep), and then gate out some of the save code based on that state. You''ll also need to make sure that the state is saved as part of the image written to disk to make sure that when it restored it remains in S3 sleep until triggered back to life. [We may want to add flags to the xm save/restore commands to incorporate S3 sleep and wake up behaviour as part of save restore, but this is just CLI sugar.] Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, Ian and Keir Thanks for the detailed explanation. I have tried below solution according to all feedbacks: 1. merged s3suspend+s3resume+domain_pause phase into one s3_suspend phase 2. s3 resume phase is now very light. Do something like unpause domain 3. add xm trigger <domid> s3resume interface to for s3_resume operation 4. add new state s3suspended plus (paused, blocked, etc) All works just fine. Yet I have met below problems: 1. if hvm in s3suspended, could we allow pause/unpause/suspend/resume operation? Need we add condition guard in python code? 2. when we add a new flag is_s3_suspended in dominfo structure, it will affect other Trace/statistic tools in xen, seems this is not a very small change? The above two changes is ok for you or not? Thanks a lot for your help! Regards, Criping Ian Pratt wrote:>> Today I am trying this idea, I found combining S3 >> sus/resume+domain_pause, and then >> use domain_unpause letting domain back works fine. >> >> Yet when I am trying xm save after pausing domain, I found if a >> domain not running, Xm save will reject the save request. >> So I want to know whether domain running is a must for xm save >> operation? > > Yes, you''ll certainly need a few tweaks to the save/restore code. > > Normally save/restore needs to send a notification to the guest such > that the PV drivers get themselves into a ''safe'' state. If the guest > is in S3, the drivers will already be shutdown (hence safe). > > I think you''ll need to add an explicit new state that a VM can be in > (S3 sleep), and then gate out some of the save code based on that > state. You''ll also need to make sure that the state is saved as part > of the image written to disk to make sure that when it restored it > remains in S3 sleep until triggered back to life. [We may want to add > flags to the xm save/restore commands to incorporate S3 sleep and > wake up behaviour as part of save restore, but this is just CLI > sugar.] > > Ian_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 14/5/08 10:50, "Ke, Liping" <liping.ke@intel.com> wrote:> 1. if hvm in s3suspended, could we allow pause/unpause/suspend/resume > operation? > Need we add condition guard in python code?I think pause/unpause still makes sense. Obviously a paused and s3suspended guest will not run again until both s3 resumed and unpaused. As for suspend/resume, that should also just work I think? Isn''t the point to be able to s3-suspend then save then restore then s3-resume?> 2. when we add a new flag is_s3_suspended in dominfo structure, it will affect > other > Trace/statistic tools in xen, seems this is not a very small change? > The above two changes is ok for you or not?I don''t really care to have is_s3_suspended visible via dominfo. Leave it hidden if you like. Xend should be able to remember whether it s3-suspended a domain, if it needs to. Or we can expose it via an interface other than dominfo. We could, for example, make it an HVM_PARAM. Then you can enter/leave/interrogate s3suspend state via the existing hvm_op param interfaces. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser wrote:> On 14/5/08 10:50, "Ke, Liping" <liping.ke@intel.com> wrote: > >> 1. if hvm in s3suspended, could we allow >> pause/unpause/suspend/resume operation? Need we add condition >> guard in python code? > > I think pause/unpause still makes sense. Obviously a paused and > s3suspended guest will not run again until both s3 resumed and > unpaused. As for suspend/resume, that should also just work I think? > Isn''t the point to be able to s3-suspend then save then restore then > s3-resume? >Yes, now S3 could works with save/restore. Since suspend/resume has Similar mechanism with save/restore, it works. I just thought s3_suspend/resume is a kind of suspend/resume already? As for pause/unpause, since after s3_supend is now already in pause state, I just thought is it a little interleaving? If you like, I will make it work firstly.>> 2. when we add a new flag is_s3_suspended in dominfo structure, it >> will affect other Trace/statistic tools in xen, seems this is not a >> very small change? The above two changes is ok for you or not? > > I don''t really care to have is_s3_suspended visible via dominfo. > Leave it hidden if you like. Xend should be able to remember whether > it s3-suspended a domain, if it needs to. Or we can expose it via an > interface other than dominfo. We could, for example, make it an > HVM_PARAM. Then you can enter/leave/interrogate s3suspend state via > the existing hvm_op param interfaces.Ok. I will use the first solution and do not revise trace related code. If we want to expose this state in the furture, first solution is easier to modify.> > -- KeirThanks a lot for your help:) Regards, Criping _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 15/5/08 02:31, "Ke, Liping" <liping.ke@intel.com> wrote:>> I think pause/unpause still makes sense. Obviously a paused and >> s3suspended guest will not run again until both s3 resumed and >> unpaused. As for suspend/resume, that should also just work I think? >> Isn''t the point to be able to s3-suspend then save then restore then >> s3-resume? >> > Yes, now S3 could works with save/restore. Since suspend/resume has > Similar mechanism with save/restore, it works. I just thought > s3_suspend/resume > is a kind of suspend/resume already? > As for pause/unpause, since after s3_supend is now already in pause state, > I just thought is it a little interleaving? If you like, I will make it work > firstly.The ''pause'' state visible to tools is a specific type of domain_pause(), and *has* to be entered via the pause domctl hypercall. So don''t worry -- your new type of pause should stack on top of ''xm pause/unpause'' no problem. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> The ''pause'' state visible to tools is a specific type of > domain_pause(), and > *has* to be entered via the pause domctl hypercall. So don''t worry -- > your new type of pause should stack on top of ''xm pause/unpause'' noproblem. In fact, does the S3 suspended guest need to go into a pause state at all? Presumably we could just let it block? Xend does need to be able to know when the S3 suspend has actually happened -- there should probably be a VIRQ for this. Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 15/5/08 12:45, "Ian Pratt" <Ian.Pratt@eu.citrix.com> wrote:>> The ''pause'' state visible to tools is a specific type of >> domain_pause(), and >> *has* to be entered via the pause domctl hypercall. So don''t worry -- >> your new type of pause should stack on top of ''xm pause/unpause'' no > problem. > > In fact, does the S3 suspended guest need to go into a pause state at > all? Presumably we could just let it block? > Xend does need to be able to know when the S3 suspend has actually > happened -- there should probably be a VIRQ for this.S3 suspend is enacted by an I/O port write from the guest, trapped by qemu, so the final reset of machine state is synchronously triggered by the tools anyway. As for pause-vs-block I think this is just a matter of terminology. At the end of the day we want the domain to not run until s3-resume is triggered. The natural way to do this within the hypervisor is to maintain a per-domain is_s3_suspended flag and domain_[un]pause() when this flag toggles. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> > In fact, does the S3 suspended guest need to go into a pause stateat> > all? Presumably we could just let it block? > > Xend does need to be able to know when the S3 suspend has actually > > happened -- there should probably be a VIRQ for this. > > S3 suspend is enacted by an I/O port write from the guest, trapped by > qemu, > so the final reset of machine state is synchronously triggered by the > tools > anyway.OK, as long as qemu-dm communicates this via xenstore.> As for pause-vs-block I think this is just a matter of terminology. At > the end of the day we want the domain to not run until s3-resume is > triggered. > The natural way to do this within the hypervisor is to maintain a per- > domain is_s3_suspended flag and domain_[un]pause() when this flagtoggles. We wouldn''t need to do the pause if the code after the magic port write did "cli;hlt". Does it do this or loop? [On real hardware the effect of the port write wouldn''t be immediate, so it must do something] Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 15/5/08 13:42, "Ian Pratt" <Ian.Pratt@eu.citrix.com> wrote:>> As for pause-vs-block I think this is just a matter of terminology. At >> the end of the day we want the domain to not run until s3-resume is >> triggered. >> The natural way to do this within the hypervisor is to maintain a per- >> domain is_s3_suspended flag and domain_[un]pause() when this flag > toggles. > > We wouldn''t need to do the pause if the code after the magic port write > did "cli;hlt". Does it do this or loop? > [On real hardware the effect of the port write wouldn''t be immediate, so > it must do something]It spins. But to take advantage of that we have to restructure s3-suspend/resume so that the reset of machine state happens in the resume hypercall. At that point suspend, from the point of view of Xen, becomes a no-op. I suppose we could do that... It seems a bit odd though and I don;t know that it''s guaranteed that all operating systems will happily spin forever waiting for S3 oblivion. Some may time out. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ok. So we will keep the current implementation now. After we finish the patch, we''ll send it for a quick review first. Keir Fraser wrote:> On 15/5/08 13:42, "Ian Pratt" <Ian.Pratt@eu.citrix.com> wrote: > >>> As for pause-vs-block I think this is just a matter of terminology. >>> At the end of the day we want the domain to not run until s3-resume >>> is triggered. The natural way to do this within the hypervisor is >>> to maintain a per- domain is_s3_suspended flag and >>> domain_[un]pause() when this flag toggles. >> >> We wouldn''t need to do the pause if the code after the magic port >> write did "cli;hlt". Does it do this or loop? >> [On real hardware the effect of the port write wouldn''t be >> immediate, so it must do something] > > It spins. But to take advantage of that we have to restructure > s3-suspend/resume so that the reset of machine state happens in the > resume hypercall. At that point suspend, from the point of view of > Xen, becomes a no-op. I suppose we could do that... It seems a bit > odd though and I don;t know that it''s guaranteed that all operating > systems will happily spin forever waiting for S3 oblivion. Some may > time out. > > -- Keir_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel